[1/2] qsvenc: move cavlc out of common option

Message ID 1510559651-3156-1-git-send-email-zhong.li@intel.com
State New
Headers show

Commit Message

Li, Zhong Nov. 13, 2017, 7:54 a.m.
CAVLC option is only available for h264 encoding.
CABAC is the only entropy coding way for hevc.

Signed-off-by: Zhong Li <zhong.li@intel.com>
---
 libavcodec/qsvenc.h      | 3 +--
 libavcodec/qsvenc_h264.c | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Maxym Dmytrychenko Nov. 13, 2017, 1:03 p.m. | #1
correct fix

On Mon, Nov 13, 2017 at 8:54 AM, Zhong Li <zhong.li@intel.com> wrote:

> CAVLC option is only available for h264 encoding.
> CABAC is the only entropy coding way for hevc.
>
> Signed-off-by: Zhong Li <zhong.li@intel.com>
> ---
>  libavcodec/qsvenc.h      | 3 +--
>  libavcodec/qsvenc_h264.c | 1 +
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
> index a639904..9b0b84b 100644
> --- a/libavcodec/qsvenc.h
> +++ b/libavcodec/qsvenc.h
> @@ -66,8 +66,7 @@
>  { "extbrc",         "Extended bitrate control",
>  OFFSET(qsv.extbrc),         AV_OPT_TYPE_INT, { .i64 = -1 }, -1,
> 1, VE }, \
>  { "adaptive_i",     "Adaptive I-frame placement",
>  OFFSET(qsv.adaptive_i),     AV_OPT_TYPE_INT, { .i64 = -1 }, -1,
> 1, VE }, \
>  { "adaptive_b",     "Adaptive B-frame placement",
>  OFFSET(qsv.adaptive_b),     AV_OPT_TYPE_INT, { .i64 = -1 }, -1,
> 1, VE }, \
> -{ "b_strategy",     "Strategy to choose between I/P/B-frames",
> OFFSET(qsv.b_strategy),    AV_OPT_TYPE_INT, { .i64 = -1 }, -1,          1,
> VE }, \
> -{ "cavlc",          "Enable CAVLC",
>  OFFSET(qsv.cavlc),          AV_OPT_TYPE_INT, { .i64 = 0 },   0,
> 1, VE }, \
> +{ "b_strategy",     "Strategy to choose between I/P/B-frames",
> OFFSET(qsv.b_strategy),    AV_OPT_TYPE_INT, { .i64 = -1 }, -1,          1,
> VE },
>
>  typedef struct QSVEncContext {
>      AVCodecContext *avctx;
> diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
> index a968dcf..62f1909 100644
> --- a/libavcodec/qsvenc_h264.c
> +++ b/libavcodec/qsvenc_h264.c
> @@ -67,6 +67,7 @@ static av_cold int qsv_enc_close(AVCodecContext *avctx)
>  static const AVOption options[] = {
>      QSV_COMMON_OPTS
>
> +    { "cavlc",          "Enable CAVLC",
>  OFFSET(qsv.cavlc),          AV_OPT_TYPE_INT, { .i64 = 0 },   0,
> 1, VE },
>      { "idr_interval", "Distance (in I-frames) between IDR frames",
> OFFSET(qsv.idr_interval), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
>      { "single_sei_nal_unit",    "Put all the SEI messages into one
> NALU",        OFFSET(qsv.single_sei_nal_unit),     AV_OPT_TYPE_INT, {
> .i64 = -1 }, -1,          1, VE },
>      { "max_dec_frame_buffering", "Maximum number of frames buffered in
> the DPB", OFFSET(qsv.max_dec_frame_buffering), AV_OPT_TYPE_INT, { .i64 =
> 0 },   0, UINT16_MAX, VE },
> --
> 1.8.3.1
>
> _______________________________________________
> libav-devel mailing list
> libav-devel@libav.org
> https://lists.libav.org/mailman/listinfo/libav-devel
Luca Barbato Nov. 13, 2017, 2:19 p.m. | #2
On 13/11/2017 08:54, Zhong Li wrote:
> CAVLC option is only available for h264 encoding.
> CABAC is the only entropy coding way for hevc.
> 
> Signed-off-by: Zhong Li <zhong.li@intel.com>
> ---
>   libavcodec/qsvenc.h      | 3 +--
>   libavcodec/qsvenc_h264.c | 1 +
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 

Sure.
Diego Biurrun Nov. 13, 2017, 5:40 p.m. | #3
On Mon, Nov 13, 2017 at 02:03:47PM +0100, Maxym Dmytrychenko wrote:
> On Mon, Nov 13, 2017 at 8:54 AM, Zhong Li <zhong.li@intel.com> wrote:
> 
> > CAVLC option is only available for h264 encoding.
> > CABAC is the only entropy coding way for hevc.
> >
> > Signed-off-by: Zhong Li <zhong.li@intel.com>
> > ---
> >  libavcodec/qsvenc.h      | 3 +--
> >  libavcodec/qsvenc_h264.c | 1 +
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> correct fix

Will queue with an updated log message.

Diego
Li, Zhong Nov. 15, 2017, 3:09 p.m. | #4
> From: libav-devel [mailto:libav-devel-bounces@libav.org] On Behalf Of

> Maxym Dmytrychenko

> Sent: Monday, November 13, 2017 9:04 PM

> To: libav development <libav-devel@libav.org>

> Subject: Re: [libav-devel] [PATCH 1/2] qsvenc: move cavlc out of common

> option

> 

> correct fix


I have an idea to rename the "calvc" option to be "coder", which can be aligned with x264. But I am not sure it will have any compatibility issues or not for old version.
Any comment?
Maxym Dmytrychenko Nov. 15, 2017, 10:22 p.m. | #5
I would leave it as it is now

On Wed, Nov 15, 2017 at 4:09 PM, Li, Zhong <zhong.li@intel.com> wrote:

> > From: libav-devel [mailto:libav-devel-bounces@libav.org] On Behalf Of
> > Maxym Dmytrychenko
> > Sent: Monday, November 13, 2017 9:04 PM
> > To: libav development <libav-devel@libav.org>
> > Subject: Re: [libav-devel] [PATCH 1/2] qsvenc: move cavlc out of common
> > option
> >
> > correct fix
>
> I have an idea to rename the "calvc" option to be "coder", which can be
> aligned with x264. But I am not sure it will have any compatibility issues
> or not for old version.
> Any comment?
> _______________________________________________
> libav-devel mailing list
> libav-devel@libav.org
> https://lists.libav.org/mailman/listinfo/libav-devel
Luca Barbato Nov. 16, 2017, 5:48 a.m. | #6
On 15/11/2017 16:09, Li, Zhong wrote:
>> From: libav-devel [mailto:libav-devel-bounces@libav.org] On Behalf
>> Of Maxym Dmytrychenko Sent: Monday, November 13, 2017 9:04 PM To:
>> libav development <libav-devel@libav.org> Subject: Re:
>> [libav-devel] [PATCH 1/2] qsvenc: move cavlc out of common option
>> 
>> correct fix
> 
> I have an idea to rename the "calvc" option to be "coder", which can
> be aligned with x264. But I am not sure it will have any
> compatibility issues or not for old version. Any comment?

Keeping an alias is always an option, so shouldn't be problems in adding it.

lu
Li, Zhong Nov. 17, 2017, 7:09 a.m. | #7
> From: libav-devel [mailto:libav-devel-bounces@libav.org] On Behalf Of

> Maxym Dmytrychenko

> Sent: Thursday, November 16, 2017 6:23 AM

> To: libav development <libav-devel@libav.org>

> Subject: Re: [libav-devel] [PATCH 1/2] qsvenc: move cavlc out of common

> option

> 

> I would leave it as it is now


Yeah, it is not high priority since FF_API_CODER_TYPE hasn't been removed now.

> 

> On Wed, Nov 15, 2017 at 4:09 PM, Li, Zhong <zhong.li@intel.com> wrote:

> 

> > > From: libav-devel [mailto:libav-devel-bounces@libav.org] On Behalf

> > > Of Maxym Dmytrychenko

> > > Sent: Monday, November 13, 2017 9:04 PM

> > > To: libav development <libav-devel@libav.org>

> > > Subject: Re: [libav-devel] [PATCH 1/2] qsvenc: move cavlc out of

> > > common option

> > >

> > > correct fix

> >

> > I have an idea to rename the "calvc" option to be "coder", which can

> > be aligned with x264. But I am not sure it will have any compatibility

> > issues or not for old version.

> > Any comment?
Li, Zhong Nov. 22, 2017, 1:56 a.m. | #8
Ping? Any dependency to apply this patch?
I'm glad to update this patch if necessary.

> -----Original Message-----

> From: libav-devel [mailto:libav-devel-bounces@libav.org] On Behalf Of

> Diego Biurrun

> Sent: Tuesday, November 14, 2017 1:40 AM

> To: libav development <libav-devel@libav.org>

> Subject: Re: [libav-devel] [PATCH 1/2] qsvenc: move cavlc out of common

> option

> 

> On Mon, Nov 13, 2017 at 02:03:47PM +0100, Maxym Dmytrychenko wrote:

> > On Mon, Nov 13, 2017 at 8:54 AM, Zhong Li <zhong.li@intel.com> wrote:

> >

> > > CAVLC option is only available for h264 encoding.

> > > CABAC is the only entropy coding way for hevc.

> > >

> > > Signed-off-by: Zhong Li <zhong.li@intel.com>

> > > ---

> > >  libavcodec/qsvenc.h      | 3 +--

> > >  libavcodec/qsvenc_h264.c | 1 +

> > >  2 files changed, 2 insertions(+), 2 deletions(-)

> >

> > correct fix

> 

> Will queue with an updated log message.

> 

> Diego

> _______________________________________________

> libav-devel mailing list

> libav-devel@libav.org

> https://lists.libav.org/mailman/listinfo/libav-devel
Maxym Dmytrychenko Nov. 22, 2017, 6:56 a.m. | #9
Patch is just fine, nothing else required.
Busy days and should be finished these days

> 22 нояб. 2017 г., в 2:56, Li, Zhong <zhong.li@intel.com> написал(а):
> 
> Ping? Any dependency to apply this patch?
> I'm glad to update this patch if necessary.
> 
>> -----Original Message-----
>> From: libav-devel [mailto:libav-devel-bounces@libav.org] On Behalf Of
>> Diego Biurrun
>> Sent: Tuesday, November 14, 2017 1:40 AM
>> To: libav development <libav-devel@libav.org>
>> Subject: Re: [libav-devel] [PATCH 1/2] qsvenc: move cavlc out of common
>> option
>> 
>>> On Mon, Nov 13, 2017 at 02:03:47PM +0100, Maxym Dmytrychenko wrote:
>>>> On Mon, Nov 13, 2017 at 8:54 AM, Zhong Li <zhong.li@intel.com> wrote:
>>>> 
>>>> CAVLC option is only available for h264 encoding.
>>>> CABAC is the only entropy coding way for hevc.
>>>> 
>>>> Signed-off-by: Zhong Li <zhong.li@intel.com>
>>>> ---
>>>> libavcodec/qsvenc.h      | 3 +--
>>>> libavcodec/qsvenc_h264.c | 1 +
>>>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>> 
>>> correct fix
>> 
>> Will queue with an updated log message.
>> 
>> Diego
>> _______________________________________________
>> libav-devel mailing list
>> libav-devel@libav.org
>> https://lists.libav.org/mailman/listinfo/libav-devel
> _______________________________________________
> libav-devel mailing list
> libav-devel@libav.org
> https://lists.libav.org/mailman/listinfo/libav-devel
Li, Zhong Nov. 22, 2017, 8:26 a.m. | #10
Got it, thanks very much.  : ) 

> -----Original Message-----

> From: libav-devel [mailto:libav-devel-bounces@libav.org] On Behalf Of

> Maxym Dmytrychenko

> Sent: Wednesday, November 22, 2017 2:56 PM

> To: libav development <libav-devel@libav.org>

> Subject: Re: [libav-devel] [PATCH 1/2] qsvenc: move cavlc out of common

> option

> 

> Patch is just fine, nothing else required.

> Busy days and should be finished these days

> 

> > 22 нояб. 2017 г., в 2:56, Li, Zhong <zhong.li@intel.com> написал(а):

> >

> > Ping? Any dependency to apply this patch?

> > I'm glad to update this patch if necessary.

> >

> >> -----Original Message-----

> >> From: libav-devel [mailto:libav-devel-bounces@libav.org] On Behalf Of

> >> Diego Biurrun

> >> Sent: Tuesday, November 14, 2017 1:40 AM

> >> To: libav development <libav-devel@libav.org>

> >> Subject: Re: [libav-devel] [PATCH 1/2] qsvenc: move cavlc out of

> >> common option

> >>

> >>> On Mon, Nov 13, 2017 at 02:03:47PM +0100, Maxym Dmytrychenko

> wrote:

> >>>> On Mon, Nov 13, 2017 at 8:54 AM, Zhong Li <zhong.li@intel.com>

> wrote:

> >>>>

> >>>> CAVLC option is only available for h264 encoding.

> >>>> CABAC is the only entropy coding way for hevc.

> >>>>

> >>>> Signed-off-by: Zhong Li <zhong.li@intel.com>

> >>>> ---

> >>>> libavcodec/qsvenc.h      | 3 +--

> >>>> libavcodec/qsvenc_h264.c | 1 +

> >>>> 2 files changed, 2 insertions(+), 2 deletions(-)

> >>>

> >>> correct fix

> >>

> >> Will queue with an updated log message.

> >>

> >> Diego

> >> _______________________________________________

> >> libav-devel mailing list

> >> libav-devel@libav.org

> >> https://lists.libav.org/mailman/listinfo/libav-devel

> > _______________________________________________

> > libav-devel mailing list

> > libav-devel@libav.org

> > https://lists.libav.org/mailman/listinfo/libav-devel

> _______________________________________________

> libav-devel mailing list

> libav-devel@libav.org

> https://lists.libav.org/mailman/listinfo/libav-devel

Patch

diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index a639904..9b0b84b 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -66,8 +66,7 @@ 
 { "extbrc",         "Extended bitrate control",               OFFSET(qsv.extbrc),         AV_OPT_TYPE_INT, { .i64 = -1 }, -1,          1, VE }, \
 { "adaptive_i",     "Adaptive I-frame placement",             OFFSET(qsv.adaptive_i),     AV_OPT_TYPE_INT, { .i64 = -1 }, -1,          1, VE }, \
 { "adaptive_b",     "Adaptive B-frame placement",             OFFSET(qsv.adaptive_b),     AV_OPT_TYPE_INT, { .i64 = -1 }, -1,          1, VE }, \
-{ "b_strategy",     "Strategy to choose between I/P/B-frames", OFFSET(qsv.b_strategy),    AV_OPT_TYPE_INT, { .i64 = -1 }, -1,          1, VE }, \
-{ "cavlc",          "Enable CAVLC",                           OFFSET(qsv.cavlc),          AV_OPT_TYPE_INT, { .i64 = 0 },   0,          1, VE }, \
+{ "b_strategy",     "Strategy to choose between I/P/B-frames", OFFSET(qsv.b_strategy),    AV_OPT_TYPE_INT, { .i64 = -1 }, -1,          1, VE },
 
 typedef struct QSVEncContext {
     AVCodecContext *avctx;
diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
index a968dcf..62f1909 100644
--- a/libavcodec/qsvenc_h264.c
+++ b/libavcodec/qsvenc_h264.c
@@ -67,6 +67,7 @@  static av_cold int qsv_enc_close(AVCodecContext *avctx)
 static const AVOption options[] = {
     QSV_COMMON_OPTS
 
+    { "cavlc",          "Enable CAVLC",                           OFFSET(qsv.cavlc),          AV_OPT_TYPE_INT, { .i64 = 0 },   0,          1, VE },
     { "idr_interval", "Distance (in I-frames) between IDR frames", OFFSET(qsv.idr_interval), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
     { "single_sei_nal_unit",    "Put all the SEI messages into one NALU",        OFFSET(qsv.single_sei_nal_unit),     AV_OPT_TYPE_INT, { .i64 = -1 }, -1,          1, VE },
     { "max_dec_frame_buffering", "Maximum number of frames buffered in the DPB", OFFSET(qsv.max_dec_frame_buffering), AV_OPT_TYPE_INT, { .i64 = 0 },   0, UINT16_MAX, VE },