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

Michael Niedermayer michael at niedermayer.cc
Thu Nov 12 23:54:36 CET 2015


On Wed, Nov 11, 2015 at 03:55:58PM +0300, Ivan Uskov wrote:
> Hello Hendrik,
> 
> Wednesday, November 11, 2015, 11:56:49 AM, you wrote:
> 
> HL> On Tue, Nov 10, 2015 at 9:41 PM, Will Kelleher <wkelleher at gogoair.com> wrote:
> >> Signed-off-by: Will Kelleher <wkelleher at gogoair.com>
> >> ---
> >>  libavcodec/qsvenc.c      | 2 ++
> >>  libavcodec/qsvenc.h      | 2 ++
> >>  libavcodec/qsvenc_h264.c | 2 ++
> >>  3 files changed, 6 insertions(+)
> >>
> >> diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
> >> index df1f777..5e6ace1 100644
> >> --- a/libavcodec/qsvenc.c
> >> +++ b/libavcodec/qsvenc.c
> >> @@ -173,6 +173,8 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
> >>  #endif
> >>  #if QSV_VERSION_ATLEAST(1,8)
> >>          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;
> >>  #endif
> >>
> >>          q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer *)&q->extco2;
> >> diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
> >> index 3dd7afe..a5f9463 100644
> >> --- a/libavcodec/qsvenc.h
> >> +++ b/libavcodec/qsvenc.h
> >> @@ -76,6 +76,8 @@ typedef struct QSVEncContext {
> >>      int look_ahead;
> >>      int look_ahead_depth;
> >>      int look_ahead_downsampling;
> >> +    int adaptive_i;
> >> +    int adaptive_b;
> >>
> >>      char *load_plugins;
> >>  } QSVEncContext;
> >> diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
> >> index 0e5a26c..507f490 100644
> >> --- a/libavcodec/qsvenc_h264.c
> >> +++ b/libavcodec/qsvenc_h264.c
> >> @@ -97,6 +97,8 @@ static const AVOption options[] = {
> >>      { "slow",        NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_3  },            INT_MIN, INT_MAX, VE, "preset" },
> >>      { "slower",      NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_2  },            INT_MIN, INT_MAX, VE, "preset" },
> >>      { "veryslow",    NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_QUALITY  }, INT_MIN, INT_MAX, VE, "preset" },
> >> +    { "adaptive_i",  "Use AdaptiveI", OFFSET(qsv.adaptive_i), AV_OPT_TYPE_BOOL,   {.i64 = 0}, 0, 1, VE},
> >> +    { "adaptive_b",  "Use AdaptiveB", OFFSET(qsv.adaptive_b), AV_OPT_TYPE_BOOL,   {.i64 = 0}, 0, 1, VE},
> >>
> >>      { NULL },
> >>  };
> 
> HL> I don't suppose you can give these options a slightly more verbose description?
> HL> That doesn't really tell me anything at all. "<option>: Use <option>"
> HL> is like the worst kind of docs you can have. :)
> I   belive  "Insertion I-frames depending by content" and "Insertion B-frames
> depending by content" would be an enough short description, what do you think?

Scene change detection ?
and
Content dependant B frame insertion

And if people agree then please someone submit a patch with it
ill apply it

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151112/45c6d36f/attachment.sig>


More information about the ffmpeg-devel mailing list