Revision 8ed2ae09

View differences:

libavcodec/avcodec.h
1320 1320

  
1321 1321
    int b_frame_strategy;
1322 1322

  
1323
#if FF_API_HURRY_UP
1323 1324
    /**
1324 1325
     * hurry up amount
1325 1326
     * - encoding: unused
1326 1327
     * - decoding: Set by user. 1-> Skip B-frames, 2-> Skip IDCT/dequant too, 5-> Skip everything except header
1327 1328
     * @deprecated Deprecated in favor of skip_idct and skip_frame.
1328 1329
     */
1329
    int hurry_up;
1330
    attribute_deprecated int hurry_up;
1331
#endif
1330 1332

  
1331 1333
    struct AVCodec *codec;
1332 1334

  
libavcodec/h261dec.c
595 595
        goto retry;
596 596
    }
597 597

  
598
    // for hurry_up==5
598
    // for skipping the frame
599 599
    s->current_picture.pict_type= s->pict_type;
600 600
    s->current_picture.key_frame= s->pict_type == FF_I_TYPE;
601 601

  
602
#if FF_API_HURRY_UP
602 603
    /* skip everything if we are in a hurry>=5 */
603 604
    if(avctx->hurry_up>=5) return get_consumed_bytes(s, buf_size);
605
#endif
604 606
    if(  (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==FF_B_TYPE)
605 607
       ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE)
606 608
       || avctx->skip_frame >= AVDISCARD_ALL)
libavcodec/h263dec.c
591 591
    if((s->codec_id==CODEC_ID_H263 || s->codec_id==CODEC_ID_H263P || s->codec_id == CODEC_ID_H263I))
592 592
        s->gob_index = ff_h263_get_gob_height(s);
593 593

  
594
    // for hurry_up==5
594
    // for skipping the frame
595 595
    s->current_picture.pict_type= s->pict_type;
596 596
    s->current_picture.key_frame= s->pict_type == FF_I_TYPE;
597 597

  
598 598
    /* skip B-frames if we don't have reference frames */
599 599
    if(s->last_picture_ptr==NULL && (s->pict_type==FF_B_TYPE || s->dropable)) return get_consumed_bytes(s, buf_size);
600
#if FF_API_HURRY_UP
600 601
    /* skip b frames if we are in a hurry */
601 602
    if(avctx->hurry_up && s->pict_type==FF_B_TYPE) return get_consumed_bytes(s, buf_size);
603
#endif
602 604
    if(   (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==FF_B_TYPE)
603 605
       || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE)
604 606
       ||  avctx->skip_frame >= AVDISCARD_ALL)
605 607
        return get_consumed_bytes(s, buf_size);
608
#if FF_API_HURRY_UP
606 609
    /* skip everything if we are in a hurry>=5 */
607 610
    if(avctx->hurry_up>=5) return get_consumed_bytes(s, buf_size);
611
#endif
608 612

  
609 613
    if(s->next_p_frame_damaged){
610 614
        if(s->pict_type==FF_B_TYPE)
libavcodec/h264.c
2820 2820

  
2821 2821
        buf_index += consumed;
2822 2822

  
2823
        if(  (s->hurry_up == 1 && h->nal_ref_idc  == 0) //FIXME do not discard SEI id
2824
           ||(avctx->skip_frame >= AVDISCARD_NONREF && h->nal_ref_idc  == 0))
2823
        //FIXME do not discard SEI id
2824
        if(
2825
#if FF_API_HURRY_UP
2826
           (s->hurry_up == 1 && h->nal_ref_idc  == 0) ||
2827
#endif
2828
           (avctx->skip_frame >= AVDISCARD_NONREF && h->nal_ref_idc  == 0))
2825 2829
            continue;
2826 2830

  
2827 2831
      again:
......
2852 2856
            s->current_picture_ptr->key_frame |=
2853 2857
                    (hx->nal_unit_type == NAL_IDR_SLICE) ||
2854 2858
                    (h->sei_recovery_frame_cnt >= 0);
2855
            if(hx->redundant_pic_count==0 && hx->s.hurry_up < 5
2859
            if(hx->redundant_pic_count==0
2860
#if FF_API_HURRY_UP
2861
               && hx->s.hurry_up < 5
2862
#endif
2856 2863
               && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc)
2857 2864
               && (avctx->skip_frame < AVDISCARD_BIDIR  || hx->slice_type_nos!=FF_B_TYPE)
2858 2865
               && (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==FF_I_TYPE)
......
2890 2897

  
2891 2898
            if(hx->redundant_pic_count==0 && hx->intra_gb_ptr && hx->s.data_partitioning
2892 2899
               && s->context_initialized
2900
#if FF_API_HURRY_UP
2893 2901
               && s->hurry_up < 5
2902
#endif
2894 2903
               && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc)
2895 2904
               && (avctx->skip_frame < AVDISCARD_BIDIR  || hx->slice_type_nos!=FF_B_TYPE)
2896 2905
               && (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==FF_I_TYPE)
......
3011 3020
    }
3012 3021

  
3013 3022
    if(!(s->flags2 & CODEC_FLAG2_CHUNKS) && !s->current_picture_ptr){
3014
        if (avctx->skip_frame >= AVDISCARD_NONREF || s->hurry_up) return 0;
3023
        if (avctx->skip_frame >= AVDISCARD_NONREF
3024
#if FF_API_HURRY_UP
3025
                || s->hurry_up
3026
#endif
3027
           )
3028
            return 0;
3015 3029
        av_log(avctx, AV_LOG_ERROR, "no frame!\n");
3016 3030
        return -1;
3017 3031
    }
libavcodec/mpeg12.c
2398 2398
                /* Skip P-frames if we do not have a reference frame or we have an invalid header. */
2399 2399
                    if(s2->pict_type==FF_P_TYPE && !s->sync) break;
2400 2400
                }
2401
#if FF_API_HURRY_UP
2401 2402
                /* Skip B-frames if we are in a hurry. */
2402 2403
                if(avctx->hurry_up && s2->pict_type==FF_B_TYPE) break;
2404
#endif
2403 2405
                if(  (avctx->skip_frame >= AVDISCARD_NONREF && s2->pict_type==FF_B_TYPE)
2404 2406
                    ||(avctx->skip_frame >= AVDISCARD_NONKEY && s2->pict_type!=FF_I_TYPE)
2405 2407
                    || avctx->skip_frame >= AVDISCARD_ALL)
2406 2408
                    break;
2409
#if FF_API_HURRY_UP
2407 2410
                /* Skip everything if we are in a hurry>=5. */
2408 2411
                if(avctx->hurry_up>=5) break;
2412
#endif
2409 2413

  
2410 2414
                if (!s->mpeg_enc_ctx_allocated) break;
2411 2415

  
libavcodec/mpegvideo.c
1025 1025
        }
1026 1026
    }
1027 1027

  
1028
#if FF_API_HURRY_UP
1028 1029
    s->hurry_up= s->avctx->hurry_up;
1030
#endif
1029 1031
    s->error_recognition= avctx->error_recognition;
1030 1032

  
1031 1033
    /* set dequantizer, we can't do it during init as it might change for mpeg4
......
1962 1964
            }
1963 1965

  
1964 1966
            /* skip dequant / idct if we are really late ;) */
1967
#if FF_API_HURRY_UP
1965 1968
            if(s->hurry_up>1) goto skip_idct;
1969
#endif
1966 1970
            if(s->avctx->skip_idct){
1967 1971
                if(  (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == FF_B_TYPE)
1968 1972
                   ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != FF_I_TYPE)
libavcodec/mpegvideo.h
387 387
    int no_rounding;  /**< apply no rounding to motion compensation (MPEG4, msmpeg4, ...)
388 388
                        for b-frames rounding mode is always 0 */
389 389

  
390
#if FF_API_HURRY_UP
390 391
    int hurry_up;     /**< when set to 1 during decoding, b frames will be skipped
391 392
                         when set to 2 idct/dequant will be skipped too */
393
#endif
392 394

  
393 395
    /* macroblock layer */
394 396
    int mb_x, mb_y;
libavcodec/options.c
125 125
{"rc_strategy", "ratecontrol method", OFFSET(rc_strategy), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
126 126
{"b_strategy", "strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), FF_OPT_TYPE_INT, 0, INT_MIN, INT_MAX, V|E},
127 127
{"wpredp", "weighted prediction analysis method", OFFSET(weighted_p_pred), FF_OPT_TYPE_INT, 0, INT_MIN, INT_MAX, V|E},
128
{"hurry_up", NULL, OFFSET(hurry_up), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|D},
128
#if FF_API_HURRY_UP
129
{"hurry_up", "deprecated, use skip_idct/skip_frame instead", OFFSET(hurry_up), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|D},
130
#endif
129 131
{"ps", "rtp payload size in bytes", OFFSET(rtp_payload_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
130 132
{"mv_bits", NULL, OFFSET(mv_bits), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
131 133
{"header_bits", NULL, OFFSET(header_bits), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
libavcodec/pthread.c
380 380
    dst->release_buffer = src->release_buffer;
381 381

  
382 382
    dst->opaque   = src->opaque;
383
#if FF_API_HURRY_UP
383 384
    dst->hurry_up = src->hurry_up;
385
#endif
384 386
    dst->dsp_mask = src->dsp_mask;
385 387
    dst->debug    = src->debug;
386 388
    dst->debug_mv = src->debug_mv;
libavcodec/rv34.c
1454 1454
    }
1455 1455
    if((!s->last_picture_ptr || !s->last_picture_ptr->data[0]) && si.type == FF_B_TYPE)
1456 1456
        return -1;
1457
#if FF_API_HURRY_UP
1457 1458
    /* skip b frames if we are in a hurry */
1458 1459
    if(avctx->hurry_up && si.type==FF_B_TYPE) return buf_size;
1460
#endif
1459 1461
    if(   (avctx->skip_frame >= AVDISCARD_NONREF && si.type==FF_B_TYPE)
1460 1462
       || (avctx->skip_frame >= AVDISCARD_NONKEY && si.type!=FF_I_TYPE)
1461 1463
       ||  avctx->skip_frame >= AVDISCARD_ALL)
1462 1464
        return buf_size;
1465
#if FF_API_HURRY_UP
1463 1466
    /* skip everything if we are in a hurry>=5 */
1464 1467
    if(avctx->hurry_up>=5)
1465 1468
        return buf_size;
1469
#endif
1466 1470

  
1467 1471
    for(i=0; i<slice_count; i++){
1468 1472
        int offset= get_slice_offset(avctx, slices_hdr, i);
libavcodec/svq1dec.c
684 684
  //this should be removed after libavcodec can handle more flexible picture types & ordering
685 685
  if(s->pict_type==FF_B_TYPE && s->last_picture_ptr==NULL) return buf_size;
686 686

  
687
#if FF_API_HURRY_UP
687 688
  if(avctx->hurry_up && s->pict_type==FF_B_TYPE) return buf_size;
689
#endif
688 690
  if(  (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==FF_B_TYPE)
689 691
     ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE)
690 692
     || avctx->skip_frame >= AVDISCARD_ALL)
libavcodec/svq3.c
945 945
               s->adaptive_quant, s->qscale, h->slice_num);
946 946
    }
947 947

  
948
    /* for hurry_up == 5 */
948
    /* for skipping the frame */
949 949
    s->current_picture.pict_type = s->pict_type;
950 950
    s->current_picture.key_frame = (s->pict_type == FF_I_TYPE);
951 951

  
952 952
    /* Skip B-frames if we do not have reference frames. */
953 953
    if (s->last_picture_ptr == NULL && s->pict_type == FF_B_TYPE)
954 954
        return 0;
955
#if FF_API_HURRY_UP
955 956
    /* Skip B-frames if we are in a hurry. */
956 957
    if (avctx->hurry_up && s->pict_type == FF_B_TYPE)
957 958
        return 0;
958 959
    /* Skip everything if we are in a hurry >= 5. */
959 960
    if (avctx->hurry_up >= 5)
960 961
        return 0;
962
#endif
961 963
    if (  (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == FF_B_TYPE)
962 964
        ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != FF_I_TYPE)
963 965
        || avctx->skip_frame >= AVDISCARD_ALL)
libavcodec/vc1dec.c
3374 3374
        goto err;
3375 3375
    }
3376 3376

  
3377
    // for hurry_up==5
3377
    // for skipping the frame
3378 3378
    s->current_picture.pict_type= s->pict_type;
3379 3379
    s->current_picture.key_frame= s->pict_type == FF_I_TYPE;
3380 3380

  
......
3382 3382
    if(s->last_picture_ptr==NULL && (s->pict_type==FF_B_TYPE || s->dropable)){
3383 3383
        goto err;
3384 3384
    }
3385
#if FF_API_HURRY_UP
3385 3386
    /* skip b frames if we are in a hurry */
3386 3387
    if(avctx->hurry_up && s->pict_type==FF_B_TYPE) return -1;//buf_size;
3388
#endif
3387 3389
    if(   (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==FF_B_TYPE)
3388 3390
       || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE)
3389 3391
       ||  avctx->skip_frame >= AVDISCARD_ALL) {
3390 3392
        goto end;
3391 3393
    }
3394
#if FF_API_HURRY_UP
3392 3395
    /* skip everything if we are in a hurry>=5 */
3393 3396
    if(avctx->hurry_up>=5) {
3394 3397
        goto err;
3395 3398
    }
3399
#endif
3396 3400

  
3397 3401
    if(s->next_p_frame_damaged){
3398 3402
        if(s->pict_type==FF_B_TYPE)
libavcodec/version.h
71 71
#ifndef FF_API_OLD_AUDIOCONVERT
72 72
#define FF_API_OLD_AUDIOCONVERT (LIBAVCODEC_VERSION_MAJOR < 53)
73 73
#endif
74
#ifndef FF_API_HURRY_UP
75
#define FF_API_HURRY_UP         (LIBAVCODEC_VERSION_MAJOR < 53)
76
#endif
74 77

  
75 78
#endif /* AVCODEC_VERSION_H */

Also available in: Unified diff