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: 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. Adding or keeping a field in the global context has a much greater impact than a codec private option, so I think that only generic options should be kept, the ones that apply to both video and audio or are encoding/decoding properties, of course considering exceptions. Anyway this thread is not the right place for discussion, and notwithstanding the above, I'd say 4 codecs over 350+ (or 117+ if you consider encoders only) is a very small number. -- Vittorio _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
