On Sun, Nov 8, 2015 at 9:16 PM, Anton Khirnov <[email protected]> wrote:
> Quoting Vittorio Giovara (2015-11-08 21:08:36)
>> On Sun, Nov 8, 2015 at 9:01 PM, Anton Khirnov <[email protected]> wrote:
>> > Quoting Vittorio Giovara (2015-11-08 20:45:57)
>> >> On Sun, Nov 8, 2015 at 8:33 PM, Anton Khirnov <[email protected]> wrote:
>> >> > Quoting Vittorio Giovara (2015-11-08 20:26:36)
>> >> >> On Sun, Nov 8, 2015 at 3:31 PM, Anton Khirnov <[email protected]> 
>> >> >> wrote:
>> >> >> > ---
>> >> >> >  libavcodec/qsvenc.c       | 52 
>> >> >> > ++++++++++++++++++++++++++++++++++++++++++++++-
>> >> >> >  libavcodec/qsvenc.h       | 28 +++++++++++++++++++++++++
>> >> >> >  libavcodec/qsvenc_h264.c  | 16 +++++++++++++++
>> >> >> >  libavcodec/qsvenc_hevc.c  |  1 +
>> >> >> >  libavcodec/qsvenc_mpeg2.c |  1 +
>> >> >> >  5 files changed, 97 insertions(+), 1 deletion(-)
>> >> >> >
>> >> >> >      { "profile", NULL, OFFSET(qsv.profile), AV_OPT_TYPE_INT, { .i64 
>> >> >> > = MFX_PROFILE_UNKNOWN }, 0, INT_MAX, VE, "profile" },
>> >> >> >      { "unknown" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
>> >> >> > MFX_PROFILE_UNKNOWN      }, INT_MIN, INT_MAX,     VE, "profile" },
>> >> >> > @@ -94,6 +109,7 @@ static const AVCodecDefault qsv_enc_defaults[] = {
>> >> >> >      { "coder",     "ac"    },
>> >> >> >
>> >> >> >      { "flags",     "+cgop" },
>> >> >> > +    { "b_strategy", "-1"   },
>> >> >> >      { NULL },
>> >> >> >  };
>> >> >> >
>> >> >> > diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c
>> >> >> > index d075326..063dd9d 100644
>> >> >> > --- a/libavcodec/qsvenc_hevc.c
>> >> >> > +++ b/libavcodec/qsvenc_hevc.c
>> >> >> > @@ -244,6 +244,7 @@ static const AVCodecDefault qsv_enc_defaults[] = 
>> >> >> > {
>> >> >> >      { "bf",        "3"     },
>> >> >> >
>> >> >> >      { "flags",     "+cgop" },
>> >> >> > +    { "b_strategy", "-1"   },
>> >> >> >      { NULL },
>> >> >> >  };
>> >> >> >
>> >> >> > diff --git a/libavcodec/qsvenc_mpeg2.c b/libavcodec/qsvenc_mpeg2.c
>> >> >> > index a5dd0e4..dcfcb81 100644
>> >> >> > --- a/libavcodec/qsvenc_mpeg2.c
>> >> >> > +++ b/libavcodec/qsvenc_mpeg2.c
>> >> >> > @@ -89,6 +89,7 @@ static const AVCodecDefault qsv_enc_defaults[] = {
>> >> >> >      { "bf",        "3"     },
>> >> >> >
>> >> >> >      { "flags",     "+cgop" },
>> >> >> > +    { "b_strategy", "-1"   },
>> >> >> >      { NULL },
>> >> >> >  };
>> >> >>
>> >> >> would it be possible to use a codec private option for this?
>> >> >> b_frame_strategy is a flag rarely used and I have deprecated the
>> >> >> global usage in one of my branches.
>> >> >
>> >> > Well, the option would now be used by 4 codecs (and that if we count the
>> >> > whole of mpegvideo as one codec). That is a nontrivial number, so
>> >> > perhaps it should remain global.
>> >>
>> >> I don't think we should count the number of codecs this option is
>> >> used, but rather evaluate whether it makes sense to have a global
>> >> option which applies only to encoders, in the video encoders category,
>> >> and only for video encoders with reordering capabilities, in my
>> >> opinion.
>> >
>> > What other criterium than the number of codecs would you consider
>> > relevant. IMO, we need to find a reasonable compromise between polluting
>> > the global context with codec-specific things and duplicating the same
>> > options in multiple places.
>>
>> As i said, in my opinion number of codec is not a good metric
>
> Do you propose some better metric then?

yes, evaluating option-by-option on which level it applies. If it's
video encoding or audio encoding only or if it applies to a very
specific subset of codecs, there are good changes that a private
option might be better suited for the task.

>> this
>> particular option should not be global since it doesn't apply to
>> audio, and subtitle codecs, does not apply to video decoders, and only
>> a handful of video encoders actually support reordering.
>
> This reasoning would eliminate almost all options out there.

Not quite, many options like global_quality, compression_level, and
many many others are perfectly suited for being in the global context.
Sample and pixel format despite being for audio and video are other
fine examples too, they apply globally to their subcategory.

> I would
> also note that this "handful" of video codecs are also the most popular
> ones.

One more reason to avoid adding an option which is under consideration
of being made codec private.
-- 
Vittorio
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to