[FFmpeg-devel] [PATCH] qsvenc: Add adaptive_i and adaptive_b toggles

Ivan Uskov ivan.uskov at nablet.com
Wed Nov 11 13:51:54 CET 2015


Hello Will,

Tuesday, November 10, 2015, 11:41:19 PM, you wrote:

WK> Signed-off-by: Will Kelleher <wkelleher at gogoair.com>
WK> ---
WK>  libavcodec/qsvenc.c      | 2 ++
WK>  libavcodec/qsvenc.h      | 2 ++
WK>  libavcodec/qsvenc_h264.c | 2 ++
WK>  3 files changed, 6 insertions(+)

WK> diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
WK> index df1f777..5e6ace1 100644
WK> --- a/libavcodec/qsvenc.c
WK> +++ b/libavcodec/qsvenc.c
WK> @@ -173,6 +173,8 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
WK>  #endif
WK>  #if QSV_VERSION_ATLEAST(1,8)
WK>          q->extco2.LookAheadDS           = q->look_ahead_downsampling;
+        q->>extco2.AdaptiveI = q->adaptive_i ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_UNKNOWN;
+        q->>extco2.AdaptiveB = q->adaptive_b ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_UNKNOWN;
WK>  #endif
WK>  
WK>          q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer *)&q->extco2;
WK> diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
WK> index 3dd7afe..a5f9463 100644
WK> --- a/libavcodec/qsvenc.h
WK> +++ b/libavcodec/qsvenc.h
WK> @@ -76,6 +76,8 @@ typedef struct QSVEncContext {
WK>      int look_ahead;
WK>      int look_ahead_depth;
WK>      int look_ahead_downsampling;
WK> +    int adaptive_i;
WK> +    int adaptive_b;
WK>  
WK>      char *load_plugins;
WK>  } QSVEncContext;
WK> diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
WK> index 0e5a26c..507f490 100644
WK> --- a/libavcodec/qsvenc_h264.c
WK> +++ b/libavcodec/qsvenc_h264.c
WK> @@ -97,6 +97,8 @@ static const AVOption options[] = {
WK>      { "slow",        NULL, 0, AV_OPT_TYPE_CONST, { .i64 =
WK> MFX_TARGETUSAGE_3  },            INT_MIN, INT_MAX, VE, "preset" },
WK>      { "slower",      NULL, 0, AV_OPT_TYPE_CONST, { .i64 =
WK> MFX_TARGETUSAGE_2  },            INT_MIN, INT_MAX, VE, "preset" },
WK>      { "veryslow",    NULL, 0, AV_OPT_TYPE_CONST, { .i64 =
WK> MFX_TARGETUSAGE_BEST_QUALITY  }, INT_MIN, INT_MAX, VE, "preset" },
WK> +    { "adaptive_i",  "Use AdaptiveI", OFFSET(qsv.adaptive_i),
WK> AV_OPT_TYPE_BOOL,   {.i64 = 0}, 0, 1, VE},
WK> +    { "adaptive_b",  "Use AdaptiveB", OFFSET(qsv.adaptive_b),
WK> AV_OPT_TYPE_BOOL,   {.i64 = 0}, 0, 1, VE},
WK>  
WK>      { NULL },
WK>  };
Looks good to me, thank!

-- 
Best regards,
 Ivan                            mailto:ivan.uskov at nablet.com



More information about the ffmpeg-devel mailing list