Revision 8c3eba7c

View differences:

ffplay.c
194 194
static int fast = 0;
195 195
static int lowres = 0;
196 196
static int idct = FF_IDCT_AUTO;
197
static enum AVDiscard skip_frame= AVDISCARD_DEFAULT;
198
static enum AVDiscard skip_idct= AVDISCARD_DEFAULT;
199
static enum AVDiscard skip_loop_filter= AVDISCARD_DEFAULT;
197 200

  
198 201
/* current context */
199 202
static int is_full_screen;
......
1190 1193
    if(lowres) enc->flags |= CODEC_FLAG_EMU_EDGE;
1191 1194
    enc->idct_algo= idct;
1192 1195
    if(fast) enc->flags2 |= CODEC_FLAG2_FAST;
1196
    enc->skip_frame= skip_frame;
1197
    enc->skip_idct= skip_idct;
1198
    enc->skip_loop_filter= skip_loop_filter;
1193 1199
    if (!codec ||
1194 1200
        avcodec_open(enc, codec) < 0)
1195 1201
        return -1;
......
1863 1869
    { "vismv", HAS_ARG | OPT_EXPERT, {(void*)opt_vismv}, "visualize motion vectors", "" },
1864 1870
    { "fast", OPT_BOOL | OPT_EXPERT, {(void*)&fast}, "non spec compliant optimizations", "" },
1865 1871
    { "lowres", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&lowres}, "", "" },
1872
    { "skiploop", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&skip_loop_filter}, "", "" },
1873
    { "skipframe", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&skip_frame}, "", "" },
1874
    { "skipidct", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&skip_idct}, "", "" },
1866 1875
    { "idct", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&idct}, "set idct algo",  "algo" },
1867 1876
#ifdef CONFIG_NETWORK
1868 1877
    { "rtp_tcp", OPT_EXPERT, {(void*)&opt_rtp_tcp}, "force RTP/TCP protocol usage", "" },
libavcodec/avcodec.h
17 17

  
18 18
#define FFMPEG_VERSION_INT     0x000409
19 19
#define FFMPEG_VERSION         "CVS"
20
#define LIBAVCODEC_BUILD       4757
20
#define LIBAVCODEC_BUILD       4758
21

  
21 22

  
22 23
#define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
23 24
#define LIBAVCODEC_VERSION     FFMPEG_VERSION
......
284 285
    AV_ROUND_NEAR_INF = 5, ///< round to nearest and halfway cases away from zero
285 286
};
286 287

  
288
enum AVDiscard{
289
//we leave some space between them for extensions (drop some keyframes for intra only or drop just some bidir frames)
290
    AVDISCARD_NONE   =-16, ///< discard nothing
291
    AVDISCARD_DEFAULT=  0, ///< discard useless packets like 0 size packets in avi
292
    AVDISCARD_NONREF =  8, ///< discard all non reference
293
    AVDISCARD_BIDIR  = 16, ///< discard all bidirectional frames
294
    AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes
295
    AVDISCARD_ALL    = 48, ///< discard all
296
};
297

  
287 298
typedef struct RcOverride{
288 299
    int start_frame;
289 300
    int end_frame;
......
858 869

  
859 870
    /**
860 871
     * hurry up amount.
872
     * deprecated in favor of skip_idct and skip_frame
861 873
     * - encoding: unused
862 874
     * - decoding: set by user. 1-> skip b frames, 2-> skip idct/dequant too, 5-> skip everything except header
863 875
     */
......
1807 1819
     * - decoding: unused
1808 1820
     */
1809 1821
    int me_penalty_compensation;
1822

  
1823
    /**
1824
     * 
1825
     * - encoding: unused
1826
     * - decoding: set by user.
1827
     */
1828
    enum AVDiscard skip_loop_filter;
1829

  
1830
    /**
1831
     * 
1832
     * - encoding: unused
1833
     * - decoding: set by user.
1834
     */
1835
    enum AVDiscard skip_idct;
1836

  
1837
    /**
1838
     * 
1839
     * - encoding: unused
1840
     * - decoding: set by user.
1841
     */
1842
    enum AVDiscard skip_frame;
1810 1843
} AVCodecContext;
1811 1844

  
1812 1845

  
libavcodec/h261.c
970 970

  
971 971
    /* skip everything if we are in a hurry>=5 */
972 972
    if(avctx->hurry_up>=5) return get_consumed_bytes(s, buf_size);
973
    if(  (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
974
       ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
975
       || avctx->skip_frame >= AVDISCARD_ALL)
976
        return get_consumed_bytes(s, buf_size);
973 977

  
974 978
    if(MPV_frame_start(s, avctx) < 0)
975 979
        return -1;
libavcodec/h263dec.c
673 673
    if(s->last_picture_ptr==NULL && (s->pict_type==B_TYPE || s->dropable)) return get_consumed_bytes(s, buf_size);
674 674
    /* skip b frames if we are in a hurry */
675 675
    if(avctx->hurry_up && s->pict_type==B_TYPE) return get_consumed_bytes(s, buf_size);
676
    if(   (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
677
       || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
678
       ||  avctx->skip_frame >= AVDISCARD_ALL) 
679
        return get_consumed_bytes(s, buf_size);
676 680
    /* skip everything if we are in a hurry>=5 */
677 681
    if(avctx->hurry_up>=5) return get_consumed_bytes(s, buf_size);
678 682
    
libavcodec/h264.c
4349 4349
            h->slice_beta_offset = get_se_golomb(&s->gb) << 1;
4350 4350
        }
4351 4351
    }
4352
    if(   s->avctx->skip_loop_filter >= AVDISCARD_ALL
4353
       ||(s->avctx->skip_loop_filter >= AVDISCARD_NONKEY && h->slice_type != I_TYPE)
4354
       ||(s->avctx->skip_loop_filter >= AVDISCARD_BIDIR  && h->slice_type == B_TYPE)
4355
       ||(s->avctx->skip_loop_filter >= AVDISCARD_NONREF && h->nal_ref_idc == 0))
4356
        h->deblocking_filter= 0;
4352 4357

  
4353 4358
#if 0 //FMO
4354 4359
    if( h->pps.num_slice_groups > 1  && h->pps.mb_slice_group_map_type >= 3 && h->pps.mb_slice_group_map_type <= 5)
......
7245 7250

  
7246 7251
        buf_index += consumed;
7247 7252

  
7248
        if( s->hurry_up == 1 && h->nal_ref_idc  == 0 )
7253
        if(  (s->hurry_up == 1 && h->nal_ref_idc  == 0)
7254
           ||(avctx->skip_frame >= AVDISCARD_NONREF && h->nal_ref_idc  == 0))
7249 7255
            continue;
7250 7256
        
7251 7257
        switch(h->nal_unit_type){
......
7261 7267
                av_log(h->s.avctx, AV_LOG_ERROR, "decode_slice_header error\n");
7262 7268
                break;
7263 7269
            }
7264
            if(h->redundant_pic_count==0 && s->hurry_up < 5 )
7270
            if(h->redundant_pic_count==0 && s->hurry_up < 5 && avctx->skip_frame < AVDISCARD_ALL)
7265 7271
                decode_slice(h);
7266 7272
            break;
7267 7273
        case NAL_DPA:
......
7282 7288
            init_get_bits(&h->inter_gb, ptr, bit_length);
7283 7289
            h->inter_gb_ptr= &h->inter_gb;
7284 7290

  
7285
            if(h->redundant_pic_count==0 && h->intra_gb_ptr && s->data_partitioning && s->hurry_up < 5 )
7291
            if(h->redundant_pic_count==0 && h->intra_gb_ptr && s->data_partitioning 
7292
               && s->hurry_up < 5 && avctx->skip_frame < AVDISCARD_ALL)
7286 7293
                decode_slice(h);
7287 7294
            break;
7288 7295
        case NAL_SEI:
libavcodec/mpeg12.c
3086 3086
        /* find start next code */
3087 3087
        start_code = find_start_code(&buf_ptr, buf_end);
3088 3088
        if (start_code < 0){
3089
            if(s2->pict_type != B_TYPE || avctx->hurry_up==0){
3089
            if(s2->pict_type != B_TYPE || avctx->skip_frame <= AVDISCARD_DEFAULT){
3090 3090
                if(avctx->thread_count > 1){
3091 3091
                    int i;
3092 3092

  
......
3146 3146
                        }
3147 3147
                        /* skip b frames if we are in a hurry */
3148 3148
                        if(avctx->hurry_up && s2->pict_type==B_TYPE) break;
3149
                        if(  (avctx->skip_frame >= AVDISCARD_NONREF && s2->pict_type==B_TYPE)
3150
                           ||(avctx->skip_frame >= AVDISCARD_NONKEY && s2->pict_type!=I_TYPE)
3151
                           || avctx->skip_frame >= AVDISCARD_ALL)
3152
                            break;
3149 3153
                        /* skip everything if we are in a hurry>=5 */
3150 3154
                        if(avctx->hurry_up>=5) break;
3151 3155
                        
libavcodec/mpegvideo.c
3777 3777
            }
3778 3778

  
3779 3779
            /* skip dequant / idct if we are really late ;) */
3780
            if(s->hurry_up>1) return;
3780
            if(s->hurry_up>1) goto skip_idct;
3781
            if(s->avctx->skip_idct){
3782
                if(  (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == B_TYPE)
3783
                   ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != I_TYPE)
3784
                   || s->avctx->skip_idct >= AVDISCARD_ALL)
3785
                    goto skip_idct;
3786
            }
3781 3787

  
3782 3788
            /* add dct residue */
3783 3789
            if(s->encoding || !(   s->h263_msmpeg4 || s->codec_id==CODEC_ID_MPEG1VIDEO || s->codec_id==CODEC_ID_MPEG2VIDEO
......
3863 3869
                }//gray
3864 3870
            }
3865 3871
        }
3872
skip_idct:
3866 3873
        if(!readable){
3867 3874
            s->dsp.put_pixels_tab[0][0](s->dest[0], dest_y ,   linesize,16);
3868 3875
            s->dsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[1], dest_cb, uvlinesize,16 >> s->chroma_y_shift);
libavcodec/svq1.c
748 748
  if(s->pict_type==B_TYPE && s->last_picture_ptr==NULL) return buf_size;
749 749
  
750 750
  if(avctx->hurry_up && s->pict_type==B_TYPE) return buf_size;
751
  if(  (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
752
     ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
753
     || avctx->skip_frame >= AVDISCARD_ALL)
754
      return buf_size;                            
751 755

  
752 756
  if(MPV_frame_start(s, avctx) < 0)
753 757
      return -1;
libavcodec/svq3.c
896 896
  if (avctx->hurry_up && s->pict_type == B_TYPE) return 0;
897 897
  /* skip everything if we are in a hurry >= 5 */
898 898
  if (avctx->hurry_up >= 5) return 0;
899
  if(  (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
900
     ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
901
     || avctx->skip_frame >= AVDISCARD_ALL)
902
      return 0;
899 903

  
900 904
  if (s->next_p_frame_damaged) {
901 905
    if (s->pict_type == B_TYPE)
libavformat/avformat.h
213 213
    int min_distance;         /* min distance between this and the previous keyframe, used to avoid unneeded searching */
214 214
} AVIndexEntry;
215 215

  
216
enum AVDiscard{
217
//we leave some space between them for extensions (drop some keyframes for intra only or drop just some bidir frames)
218
    AVDISCARD_NONE   =-16, ///< discard nothing
219
    AVDISCARD_DEFAULT=  0, ///< discard useless packets like 0 size packets in avi
220
    AVDISCARD_BIDIR  = 16, ///< discard all bidirectional frames
221
    AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes
222
    AVDISCARD_ALL    = 48, ///< discard all
223
};
224

  
225 216
typedef struct AVStream {
226 217
    int index;    /* stream index in AVFormatContext */
227 218
    int id;       /* format specific stream id */

Also available in: Unified diff