Deprecate CODEC_FLAG2_BPYRAMID.
---
 libavcodec/avcodec.h |    2 +-
 libavcodec/libx264.c |    7 +++++--
 libavcodec/options.c |    2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index c84a4fd..07ce5f9 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -609,8 +609,8 @@ typedef struct RcOverride{
 #define CODEC_FLAG2_LOCAL_HEADER  0x00000008 ///< Place global headers at 
every keyframe instead of in extradata.
 #if FF_API_X264_GLOBAL_OPTS
 #define CODEC_FLAG2_BPYRAMID      0x00000010 ///< H.264 allow B-frames to be 
used as references.
-#endif
 #define CODEC_FLAG2_WPRED         0x00000020 ///< H.264 weighted biprediction 
for B-frames
+#endif
 #define CODEC_FLAG2_MIXED_REFS    0x00000040 ///< H.264 one reference per 
partition, as opposed to one reference per macroblock
 #define CODEC_FLAG2_8X8DCT        0x00000080 ///< H.264 high profile 8x8 
transform
 #define CODEC_FLAG2_FASTPSKIP     0x00000100 ///< H.264 fast pskip
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index bd32d14..e91a14f 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -50,6 +50,7 @@ typedef struct X264Context {
     float psy_trellis;
     int rc_lookahead;
     int weightp;
+    int weightb;
     int ssim;
     int intra_refresh;
     int b_pyramid;
@@ -227,8 +228,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
 
     x4->params.analyse.i_direct_mv_pred  = avctx->directpred;
 
-    x4->params.analyse.b_weighted_bipred = avctx->flags2 & CODEC_FLAG2_WPRED;
-
     if (avctx->me_method == ME_EPZS)
         x4->params.analyse.i_me_method = X264_ME_DIA;
     else if (avctx->me_method == ME_HEX)
@@ -327,6 +326,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
     x4->params.analyse.b_ssim = avctx->flags2 & CODEC_FLAG2_SSIM;
     x4->params.b_intra_refresh = avctx->flags2 & CODEC_FLAG2_INTRA_REFRESH;
     x4->params.i_bframe_pyramid = avctx->flags2 & CODEC_FLAG2_BPYRAMID ? 
X264_B_PYRAMID_NORMAL : X264_B_PYRAMID_NONE;
+    x4->params.analyse.b_weighted_bipred = avctx->flags2 & CODEC_FLAG2_WPRED;
 #endif
 
     if (x4->aq_mode >= 0)
@@ -341,6 +341,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
         x4->params.rc.i_lookahead = x4->rc_lookahead;
     if (x4->weightp >= 0)
         x4->params.analyse.i_weighted_pred = x4->weightp;
+    if (x4->weightb >= 0)
+        x4->params.analyse.b_weighted_bipred = x4->weightb;
 
     if (x4->ssim >= 0)
         x4->params.analyse.b_ssim = x4->ssim;
@@ -432,6 +434,7 @@ static const AVOption options[] = {
     { "pdy_rd",        "Psy RD strength.",                                
OFFSET(psy_rd),        FF_OPT_TYPE_FLOAT,  {-1 }, -1, FLT_MAX, VE},
     { "psy_trellis",   "Psy trellis strength",                            
OFFSET(psy_trellis),   FF_OPT_TYPE_FLOAT,  {-1 }, -1, FLT_MAX, VE},
     { "rc_lookahead",  "Number of frames to look ahead for frametype and 
ratecontrol", OFFSET(rc_lookahead), FF_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE },
+    { "weightb",       "Weighted prediction for B-frames.",               
OFFSET(weightb),       FF_OPT_TYPE_INT,    {-1 }, -1, 1, VE },
     { "weightp",       "Weighted prediction analysis method.",            
OFFSET(weightp),       FF_OPT_TYPE_INT,    {-1 }, -1, INT_MAX, VE, "weightp" },
     { "none",          NULL, 0, FF_OPT_TYPE_CONST, {X264_WEIGHTP_NONE},   
INT_MIN, INT_MAX, VE, "weightp" },
     { "simple",        NULL, 0, FF_OPT_TYPE_CONST, {X264_WEIGHTP_SIMPLE}, 
INT_MIN, INT_MAX, VE, "weightp" },
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 6881f9c..90ffb1c 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -389,8 +389,8 @@ static const AVOption options[]={
 {"directpred", "direct mv prediction mode - 0 (none), 1 (spatial), 2 
(temporal), 3 (auto)", OFFSET(directpred), FF_OPT_TYPE_INT, {.dbl = 2 }, 
INT_MIN, INT_MAX, V|E},
 #if FF_API_X264_GLOBAL_OPTS
 {"bpyramid", "allows B-frames to be used as references for predicting", 0, 
FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_BPYRAMID }, INT_MIN, INT_MAX, V|E, 
"flags2"},
-#endif
 {"wpred", "weighted biprediction for b-frames (H.264)", 0, FF_OPT_TYPE_CONST, 
{.dbl = CODEC_FLAG2_WPRED }, INT_MIN, INT_MAX, V|E, "flags2"},
+#endif
 {"mixed_refs", "one reference per partition, as opposed to one reference per 
macroblock", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_MIXED_REFS }, INT_MIN, 
INT_MAX, V|E, "flags2"},
 {"dct8x8", "high profile 8x8 transform (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = 
CODEC_FLAG2_8X8DCT }, INT_MIN, INT_MAX, V|E, "flags2"},
 {"fastpskip", "fast pskip (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = 
CODEC_FLAG2_FASTPSKIP }, INT_MIN, INT_MAX, V|E, "flags2"},
-- 
1.7.5.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to