History

lavc: move CODEC_FLAG_MV0 to mpegvideo

Anton Khirnov committed 12 years ago

Commit a2941c81 parent 64841498 files · +31 −5Browse files

Unified · Split

8 files
  1. doc/APIchanges +4 −0
  2. libavcodec/avcodec.h +7 −1
  3. libavcodec/motion_est.c +3 −2
  4. libavcodec/motion_est_template.c +2 −1
  5. libavcodec/mpegvideo.h +2 −0
  6. libavcodec/mpegvideo_enc.c +7 −0
  7. libavcodec/options_table.h +2 −0
  8. libavcodec/version.h +4 −1
doc/APIchanges+4−0
@@ -13,6 +13,10 @@ libavutil: 2013-12-xx · 12 unmodified lines
1313
1414 API changes, most recent first:
1515
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+
1620 2014-04-xx - xxxxxxx - lavc 55.50.2 - avcodec.h
1721 Deprecate CODEC_FLAG_GMC. It is replaced by the "gmc" private option of the
1822 libxvid encoder.
libavcodec/avcodec.h+7−1
@@ -675,7 +675,13 @@ typedef struct RcOverride{ · 674 unmodified lines
675675 */
676676 #define CODEC_FLAG_GMC 0x0020 ///< Use GMC.
677677 #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
679685 #if FF_API_INPUT_PRESERVED
680686 /**
681687 * @deprecated passing reference-counted frames to the encoders replaces this
libavcodec/motion_est.c+3−2
@@ -973,7 +973,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s, · 972 unmodified lines
973973 // if (varc*2 + 200*256 + 50*(s->lambda2>>FF_LAMBDA_SHIFT) > vard){
974974 mb_type|= CANDIDATE_MB_TYPE_INTER;
975975 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)
977977 if(mx || my)
978978 mb_type |= CANDIDATE_MB_TYPE_SKIPPED; //FIXME check difference
979979 }else{
@@ -1592,7 +1592,8 @@ void ff_estimate_b_frame_motion(MpegEncContext * s, · 612 unmodified lines
15921592 }
15931593 //FIXME something smarter
15941594 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])
15961597 type |= CANDIDATE_MB_TYPE_DIRECT0;
15971598 }
15981599
libavcodec/motion_est_template.c+2−1
@@ -896,7 +896,8 @@ static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int · 895 unmodified lines
896896 score_map[0]= dmin;
897897
898898 //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)
900901 dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor;
901902
902903 /* first line */
libavcodec/mpegvideo.h+2−0
@@ -650,6 +650,7 @@ typedef struct MpegEncContext { · 649 unmodified lines
650650 #define FF_MPV_FLAG_QP_RD 0x0004
651651 #define FF_MPV_FLAG_CBP_RD 0x0008
652652 #define FF_MPV_FLAG_NAQ 0x0010
653+#define FF_MPV_FLAG_MV0 0x0020
653654
654655 #define FF_MPV_OFFSET(x) offsetof(MpegEncContext, x)
655656 #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
660661 { "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" },\
661662 { "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" },\
662663 { "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" },\
663665 { "luma_elim_threshold", "single coefficient elimination threshold for luminance (negative values also consider dc coefficient)",\
664666 FF_MPV_OFFSET(luma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\
665667 { "chroma_elim_threshold", "single coefficient elimination threshold for chrominance (negative values also consider dc coefficient)",\
libavcodec/mpegvideo_enc.c+7−0
@@ -787,6 +787,13 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) · 786 unmodified lines
787787 FF_ENABLE_DEPRECATION_WARNINGS;
788788 #endif
789789
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+
790797 if (avctx->b_frame_strategy == 2) {
791798 for (i = 0; i < s->max_b_frames + 2; i++) {
792799 s->tmp_frames[i] = av_frame_alloc();
libavcodec/options_table.h+2−0
@@ -55,7 +55,9 @@ static const AVOption avcodec_options[] = { · 54 unmodified lines
5555 #if FF_API_GMC
5656 {"gmc", "use gmc", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_GMC }, INT_MIN, INT_MAX, V|E, "flags"},
5757 #endif
58+#if FF_API_MV0
5859 {"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
5961 #if FF_API_INPUT_PRESERVED
6062 {"input_preserved", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_INPUT_PRESERVED }, INT_MIN, INT_MAX, 0, "flags"},
6163 #endif
libavcodec/version.h+4−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030
3131 #define LIBAVCODEC_VERSION_MAJOR 55
3232 #define LIBAVCODEC_VERSION_MINOR 50
33−#define LIBAVCODEC_VERSION_MICRO 2
33+#define LIBAVCODEC_VERSION_MICRO 3
3434
3535 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
3636 LIBAVCODEC_VERSION_MINOR, \
@@ -138,5 +138,8 @@ · 101 unmodified lines
138138 #ifndef FF_API_GMC
139139 #define FF_API_GMC (LIBAVCODEC_VERSION_MAJOR < 57)
140140 #endif
141+#ifndef FF_API_MV0
142+#define FF_API_MV0 (LIBAVCODEC_VERSION_MAJOR < 57)
143+#endif
141144
142145 #endif /* AVCODEC_VERSION_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t