Unified · Split
| @@ -13,6 +13,10 @@ libavutil: 2013-12-xx · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | API changes, most recent first: |
| 15 | 15 | |
| 16 | +2014-04-xx - xxxxxxx - lavc 55.50.3 - avcodec.h | |
| 17 | + Deprecate CODEC_FLAG_MV0. It is replaced by the flag "mv0" in the | |
| 18 | + "mpv_flags" private option of the mpegvideo encoders. | |
| 19 | + | |
| 16 | 20 | 2014-04-xx - xxxxxxx - lavc 55.50.2 - avcodec.h |
| 17 | 21 | Deprecate CODEC_FLAG_GMC. It is replaced by the "gmc" private option of the |
| 18 | 22 | libxvid encoder. |
| @@ -675,7 +675,13 @@ typedef struct RcOverride{ · 674 unmodified lines | ||
| 675 | 675 | */ |
| 676 | 676 | #define CODEC_FLAG_GMC 0x0020 ///< Use GMC. |
| 677 | 677 | #endif |
| 678 | −#define CODEC_FLAG_MV0 0x0040 ///< Always try a MB with MV=<0,0>. | |
| 678 | +#if FF_API_MV0 | |
| 679 | +/** | |
| 680 | + * @deprecated use the flag "mv0" in the "mpv_flags" private option of the | |
| 681 | + * mpegvideo encoders | |
| 682 | + */ | |
| 683 | +#define CODEC_FLAG_MV0 0x0040 | |
| 684 | +#endif | |
| 679 | 685 | #if FF_API_INPUT_PRESERVED |
| 680 | 686 | /** |
| 681 | 687 | * @deprecated passing reference-counted frames to the encoders replaces this |
| @@ -973,7 +973,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s, · 972 unmodified lines | ||
| 973 | 973 | // if (varc*2 + 200*256 + 50*(s->lambda2>>FF_LAMBDA_SHIFT) > vard){ |
| 974 | 974 | mb_type|= CANDIDATE_MB_TYPE_INTER; |
| 975 | 975 | c->sub_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16); |
| 976 | − if(s->flags&CODEC_FLAG_MV0) | |
| 976 | + if (s->mpv_flags & FF_MPV_FLAG_MV0) | |
| 977 | 977 | if(mx || my) |
| 978 | 978 | mb_type |= CANDIDATE_MB_TYPE_SKIPPED; //FIXME check difference |
| 979 | 979 | }else{ |
| @@ -1592,7 +1592,8 @@ void ff_estimate_b_frame_motion(MpegEncContext * s, · 612 unmodified lines | ||
| 1592 | 1592 | } |
| 1593 | 1593 | //FIXME something smarter |
| 1594 | 1594 | if(dmin>256*256*16) type&= ~CANDIDATE_MB_TYPE_DIRECT; //do not try direct mode if it is invalid for this MB |
| 1595 | − if(s->codec_id == AV_CODEC_ID_MPEG4 && type&CANDIDATE_MB_TYPE_DIRECT && s->flags&CODEC_FLAG_MV0 && *(uint32_t*)s->b_direct_mv_table[xy]) | |
| 1595 | + if (s->codec_id == AV_CODEC_ID_MPEG4 && type&CANDIDATE_MB_TYPE_DIRECT && | |
| 1596 | + s->mpv_flags & FF_MPV_FLAG_MV0 && *(uint32_t*)s->b_direct_mv_table[xy]) | |
| 1596 | 1597 | type |= CANDIDATE_MB_TYPE_DIRECT0; |
| 1597 | 1598 | } |
| 1598 | 1599 | |
| @@ -896,7 +896,8 @@ static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int · 895 unmodified lines | ||
| 896 | 896 | score_map[0]= dmin; |
| 897 | 897 | |
| 898 | 898 | //FIXME precalc first term below? |
| 899 | − if((s->pict_type == AV_PICTURE_TYPE_B && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0) | |
| 899 | + if ((s->pict_type == AV_PICTURE_TYPE_B && !(c->flags & FLAG_DIRECT)) || | |
| 900 | + s->mpv_flags & FF_MPV_FLAG_MV0) | |
| 900 | 901 | dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor; |
| 901 | 902 | |
| 902 | 903 | /* first line */ |
| @@ -650,6 +650,7 @@ typedef struct MpegEncContext { · 649 unmodified lines | ||
| 650 | 650 | #define FF_MPV_FLAG_QP_RD 0x0004 |
| 651 | 651 | #define FF_MPV_FLAG_CBP_RD 0x0008 |
| 652 | 652 | #define FF_MPV_FLAG_NAQ 0x0010 |
| 653 | +#define FF_MPV_FLAG_MV0 0x0020 | |
| 653 | 654 | |
| 654 | 655 | #define FF_MPV_OFFSET(x) offsetof(MpegEncContext, x) |
| 655 | 656 | #define FF_MPV_OPT_FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM) |
| @@ -660,6 +661,7 @@ typedef struct MpegEncContext { · 4 unmodified lines | ||
| 660 | 661 | { "qp_rd", "Use rate distortion optimization for qp selection", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_QP_RD }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\ |
| 661 | 662 | { "cbp_rd", "use rate distortion optimization for CBP", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_CBP_RD }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\ |
| 662 | 663 | { "naq", "normalize adaptive quantization", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_NAQ }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\ |
| 664 | +{ "mv0", "always try a mb with mv=<0,0>", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_MV0 }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\ | |
| 663 | 665 | { "luma_elim_threshold", "single coefficient elimination threshold for luminance (negative values also consider dc coefficient)",\ |
| 664 | 666 | FF_MPV_OFFSET(luma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\ |
| 665 | 667 | { "chroma_elim_threshold", "single coefficient elimination threshold for chrominance (negative values also consider dc coefficient)",\ |
| @@ -787,6 +787,13 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) · 786 unmodified lines | ||
| 787 | 787 | FF_ENABLE_DEPRECATION_WARNINGS; |
| 788 | 788 | #endif |
| 789 | 789 | |
| 790 | +#if FF_API_MV0 | |
| 791 | + FF_DISABLE_DEPRECATION_WARNINGS | |
| 792 | + if (avctx->flags & CODEC_FLAG_MV0) | |
| 793 | + s->mpv_flags |= FF_MPV_FLAG_MV0; | |
| 794 | + FF_ENABLE_DEPRECATION_WARNINGS | |
| 795 | +#endif | |
| 796 | + | |
| 790 | 797 | if (avctx->b_frame_strategy == 2) { |
| 791 | 798 | for (i = 0; i < s->max_b_frames + 2; i++) { |
| 792 | 799 | s->tmp_frames[i] = av_frame_alloc(); |
| @@ -55,7 +55,9 @@ static const AVOption avcodec_options[] = { · 54 unmodified lines | ||
| 55 | 55 | #if FF_API_GMC |
| 56 | 56 | {"gmc", "use gmc", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_GMC }, INT_MIN, INT_MAX, V|E, "flags"}, |
| 57 | 57 | #endif |
| 58 | +#if FF_API_MV0 | |
| 58 | 59 | {"mv0", "always try a mb with mv=<0,0>", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_MV0 }, INT_MIN, INT_MAX, V|E, "flags"}, |
| 60 | +#endif | |
| 59 | 61 | #if FF_API_INPUT_PRESERVED |
| 60 | 62 | {"input_preserved", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_INPUT_PRESERVED }, INT_MIN, INT_MAX, 0, "flags"}, |
| 61 | 63 | #endif |
| @@ -30,7 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | |
| 31 | 31 | #define LIBAVCODEC_VERSION_MAJOR 55 |
| 32 | 32 | #define LIBAVCODEC_VERSION_MINOR 50 |
| 33 | −#define LIBAVCODEC_VERSION_MICRO 2 | |
| 33 | +#define LIBAVCODEC_VERSION_MICRO 3 | |
| 34 | 34 | |
| 35 | 35 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |
| 36 | 36 | LIBAVCODEC_VERSION_MINOR, \ |
| @@ -138,5 +138,8 @@ · 101 unmodified lines | ||
| 138 | 138 | #ifndef FF_API_GMC |
| 139 | 139 | #define FF_API_GMC (LIBAVCODEC_VERSION_MAJOR < 57) |
| 140 | 140 | #endif |
| 141 | +#ifndef FF_API_MV0 | |
| 142 | +#define FF_API_MV0 (LIBAVCODEC_VERSION_MAJOR < 57) | |
| 143 | +#endif | |
| 141 | 144 | |
| 142 | 145 | #endif /* AVCODEC_VERSION_H */ |