Re: [FFmpeg-devel] [PATCH] Adds support for setting aq_mode in libvpx encoder

2014-08-27 Thread James Almer
On 27/08/14 11:00 PM, James Zern wrote:
> On Tue, Aug 26, 2014 at 12:18 PM, James Almer  wrote:
>> On 25/08/14 9:17 PM, Deb Mukherjee wrote:
>>> Sets aq_mode in the [0, 3] range for the libvpx encode wrapper.
>>> 0: none
>>> 1: variance aq
>>> 2: complexity aq
>>> 3: cyclic refresh aq
>>> ---
>>>  doc/encoders.texi  | 5 -
>>>  libavcodec/libvpxenc.c | 9 +
>>>  2 files changed, 13 insertions(+), 1 deletion(-)
>>>
>>
>> LGTM
> 
> lgtm

Applied.

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Adds support for setting aq_mode in libvpx encoder

2014-08-26 Thread James Almer
On 25/08/14 9:17 PM, Deb Mukherjee wrote:
> Sets aq_mode in the [0, 3] range for the libvpx encode wrapper.
> 0: none
> 1: variance aq
> 2: complexity aq
> 3: cyclic refresh aq
> ---
>  doc/encoders.texi  | 5 -
>  libavcodec/libvpxenc.c | 9 +
>  2 files changed, 13 insertions(+), 1 deletion(-)
> 

LGTM
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Adds support for setting aq_mode in libvpx encoder

2014-08-26 Thread Michael Niedermayer
On Tue, Aug 26, 2014 at 03:39:26AM +0200, Michael Niedermayer wrote:
> On Mon, Aug 25, 2014 at 05:17:39PM -0700, Deb Mukherjee wrote:
> > Sets aq_mode in the [0, 3] range for the libvpx encode wrapper.
> > 0: none
> > 1: variance aq
> > 2: complexity aq
> > 3: cyclic refresh aq
> > ---
> >  doc/encoders.texi  | 5 -
> >  libavcodec/libvpxenc.c | 9 +
> >  2 files changed, 13 insertions(+), 1 deletion(-)
> 
> breaks build:
> libavcodec/libvpxenc.c:127:6: error: ‘VP9E_SET_AQ_MODE’ undeclared here (not 
> in a function)
> libavcodec/libvpxenc.c:127:5: error: array index in initializer not of 
> integer type
> libavcodec/libvpxenc.c:127:5: error: (near initialization for ‘ctlidstr’)
> make: *** [libavcodec/libvpxenc.o] Error 1

james configure patch fixed this

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Avoid a single point of failure, be that a person or equipment.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Adds support for setting aq_mode in libvpx encoder

2014-08-25 Thread James Almer
On 25/08/14 10:39 PM, Michael Niedermayer wrote:
> On Mon, Aug 25, 2014 at 05:17:39PM -0700, Deb Mukherjee wrote:
>> Sets aq_mode in the [0, 3] range for the libvpx encode wrapper.
>> 0: none
>> 1: variance aq
>> 2: complexity aq
>> 3: cyclic refresh aq
>> ---
>>  doc/encoders.texi  | 5 -
>>  libavcodec/libvpxenc.c | 9 +
>>  2 files changed, 13 insertions(+), 1 deletion(-)
> 
> breaks build:
> libavcodec/libvpxenc.c:127:6: error: ‘VP9E_SET_AQ_MODE’ undeclared here (not 
> in a function)
> libavcodec/libvpxenc.c:127:5: error: array index in initializer not of 
> integer type
> libavcodec/libvpxenc.c:127:5: error: (near initialization for ‘ctlidstr’)
> make: *** [libavcodec/libvpxenc.o] Error 1

Lets update the configure check then. Any git snapshot prior to 1.3.0 is not 
recommended for vp9 encoding anyway.
No point in adding even more pre-processor checks for this.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Adds support for setting aq_mode in libvpx encoder

2014-08-25 Thread Michael Niedermayer
On Mon, Aug 25, 2014 at 05:17:39PM -0700, Deb Mukherjee wrote:
> Sets aq_mode in the [0, 3] range for the libvpx encode wrapper.
> 0: none
> 1: variance aq
> 2: complexity aq
> 3: cyclic refresh aq
> ---
>  doc/encoders.texi  | 5 -
>  libavcodec/libvpxenc.c | 9 +
>  2 files changed, 13 insertions(+), 1 deletion(-)

breaks build:
libavcodec/libvpxenc.c:127:6: error: ‘VP9E_SET_AQ_MODE’ undeclared here (not in 
a function)
libavcodec/libvpxenc.c:127:5: error: array index in initializer not of integer 
type
libavcodec/libvpxenc.c:127:5: error: (near initialization for ‘ctlidstr’)
make: *** [libavcodec/libvpxenc.o] Error 1

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

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] Adds support for setting aq_mode in libvpx encoder

2014-08-25 Thread Deb Mukherjee
Sets aq_mode in the [0, 3] range for the libvpx encode wrapper.
0: none
1: variance aq
2: complexity aq
3: cyclic refresh aq
---
 doc/encoders.texi  | 5 -
 libavcodec/libvpxenc.c | 9 +
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 8df80c4..44b49ce 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -1330,7 +1330,7 @@ ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
 
 @section libvpx
 
-VP8 format supported through libvpx.
+VP8/VP9 format supported through libvpx.
 
 Requires the presence of the libvpx headers and library during configuration.
 You need to explicitly configure the build with @code{--enable-libvpx}.
@@ -1442,6 +1442,9 @@ g_lag_in_frames
 @item vp8flags error_resilient
 g_error_resilient
 
+@item aq_mode
+@code{VP9E_SET_AQ_MODE}
+
 @end table
 
 For more information about libvpx see:
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 830a793..43015d6 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -96,6 +96,7 @@ typedef struct VP8EncoderContext {
 int tile_columns;
 int tile_rows;
 int frame_parallel;
+int aq_mode;
 } VP8Context;
 
 /** String mappings for enum vp8e_enc_control_id */
@@ -123,6 +124,7 @@ static const char *const ctlidstr[] = {
 [VP9E_SET_TILE_COLUMNS]= "VP9E_SET_TILE_COLUMNS",
 [VP9E_SET_TILE_ROWS]   = "VP9E_SET_TILE_ROWS",
 [VP9E_SET_FRAME_PARALLEL_DECODING] = "VP9E_SET_FRAME_PARALLEL_DECODING",
+[VP9E_SET_AQ_MODE] = "VP9E_SET_AQ_MODE",
 #endif
 };
 
@@ -444,6 +446,8 @@ static av_cold int vpx_init(AVCodecContext *avctx,
 codecctl_int(avctx, VP9E_SET_TILE_ROWS, ctx->tile_rows);
 if (ctx->frame_parallel >= 0)
 codecctl_int(avctx, VP9E_SET_FRAME_PARALLEL_DECODING, 
ctx->frame_parallel);
+if (ctx->aq_mode >= 0)
+codecctl_int(avctx, VP9E_SET_AQ_MODE, ctx->aq_mode);
 }
 #endif
 
@@ -803,6 +807,11 @@ static const AVOption vp9_options[] = {
 { "tile-columns","Number of tile columns to use, log2", 
OFFSET(tile_columns),AV_OPT_TYPE_INT, {.i64 = -1}, -1, 6, VE},
 { "tile-rows",   "Number of tile rows to use, log2",
OFFSET(tile_rows),   AV_OPT_TYPE_INT, {.i64 = -1}, -1, 2, VE},
 { "frame-parallel",  "Enable frame parallel decodability features", 
OFFSET(frame_parallel),  AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, VE},
+{ "aq-mode", "adaptive quantization mode",  
OFFSET(aq_mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 3, VE},
+{ "none",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 0}, 0, 0, VE, 
"aq_mode" }, \
+{ "variance",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 1}, 0, 0, VE, 
"aq_mode" }, \
+{ "complexity",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 2}, 0, 0, VE, 
"aq_mode" }, \
+{ "cyclic",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 3}, 0, 0, VE, 
"aq_mode" }, \
 LEGACY_OPTIONS
 { NULL }
 };
-- 
2.1.0.rc2.206.gedb03e5

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Adds support for setting aq_mode in libvpx encoder

2014-08-22 Thread James Almer
On 22/08/14 3:25 PM, Deb Mukherjee wrote:
> @@ -803,6 +807,11 @@ static const AVOption vp9_options[] = {
>  { "tile-columns","Number of tile columns to use, log2", 
> OFFSET(tile_columns),AV_OPT_TYPE_INT, {.i64 = -1}, -1, 6, VE},
>  { "tile-rows",   "Number of tile rows to use, log2",
> OFFSET(tile_rows),   AV_OPT_TYPE_INT, {.i64 = -1}, -1, 2, VE},
>  { "frame-parallel",  "Enable frame parallel decodability features", 
> OFFSET(frame_parallel),  AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, VE},
> +{ "aq-mode", "adaptive quantization mode",  
> OFFSET(aq_mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 3, VE},

This one needs "aq_mode" after VE as well. Otherwise none of the constants 
below will work for it.

> +{ "none",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 0}, 0, 0, VE, 
> "aq_mode" }, \
> +{ "variance",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 1}, 0, 0, VE, 
> "aq_mode" }, \
> +{ "complexity",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 2}, 0, 0, VE, 
> "aq_mode" }, \
> +{ "cyclic",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 3}, 0, 0, VE, 
> "aq_mode" }, \

Instead of NULL you could write a short description for each of them.

>  LEGACY_OPTIONS
>  { NULL }
>  };
> 

LGTM otherwise.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] Adds support for setting aq_mode in libvpx encoder

2014-08-22 Thread Deb Mukherjee
Sets aq_mode in the [0, 3] range for the libvpx encode wrapper.
0: none
1: variance aq
2: complexity aq
3: cyclic refresh aq
---
 doc/encoders.texi  | 5 -
 libavcodec/libvpxenc.c | 9 +
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 8df80c4..44b49ce 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -1330,7 +1330,7 @@ ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
 
 @section libvpx
 
-VP8 format supported through libvpx.
+VP8/VP9 format supported through libvpx.
 
 Requires the presence of the libvpx headers and library during configuration.
 You need to explicitly configure the build with @code{--enable-libvpx}.
@@ -1442,6 +1442,9 @@ g_lag_in_frames
 @item vp8flags error_resilient
 g_error_resilient
 
+@item aq_mode
+@code{VP9E_SET_AQ_MODE}
+
 @end table
 
 For more information about libvpx see:
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 830a793..43015d6 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -96,6 +96,7 @@ typedef struct VP8EncoderContext {
 int tile_columns;
 int tile_rows;
 int frame_parallel;
+int aq_mode;
 } VP8Context;
 
 /** String mappings for enum vp8e_enc_control_id */
@@ -123,6 +124,7 @@ static const char *const ctlidstr[] = {
 [VP9E_SET_TILE_COLUMNS]= "VP9E_SET_TILE_COLUMNS",
 [VP9E_SET_TILE_ROWS]   = "VP9E_SET_TILE_ROWS",
 [VP9E_SET_FRAME_PARALLEL_DECODING] = "VP9E_SET_FRAME_PARALLEL_DECODING",
+[VP9E_SET_AQ_MODE] = "VP9E_SET_AQ_MODE",
 #endif
 };
 
@@ -444,6 +446,8 @@ static av_cold int vpx_init(AVCodecContext *avctx,
 codecctl_int(avctx, VP9E_SET_TILE_ROWS, ctx->tile_rows);
 if (ctx->frame_parallel >= 0)
 codecctl_int(avctx, VP9E_SET_FRAME_PARALLEL_DECODING, 
ctx->frame_parallel);
+if (ctx->aq_mode >= 0)
+codecctl_int(avctx, VP9E_SET_AQ_MODE, ctx->aq_mode);
 }
 #endif
 
@@ -803,6 +807,11 @@ static const AVOption vp9_options[] = {
 { "tile-columns","Number of tile columns to use, log2", 
OFFSET(tile_columns),AV_OPT_TYPE_INT, {.i64 = -1}, -1, 6, VE},
 { "tile-rows",   "Number of tile rows to use, log2",
OFFSET(tile_rows),   AV_OPT_TYPE_INT, {.i64 = -1}, -1, 2, VE},
 { "frame-parallel",  "Enable frame parallel decodability features", 
OFFSET(frame_parallel),  AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, VE},
+{ "aq-mode", "adaptive quantization mode",  
OFFSET(aq_mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 3, VE},
+{ "none",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 0}, 0, 0, VE, 
"aq_mode" }, \
+{ "variance",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 1}, 0, 0, VE, 
"aq_mode" }, \
+{ "complexity",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 2}, 0, 0, VE, 
"aq_mode" }, \
+{ "cyclic",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 3}, 0, 0, VE, 
"aq_mode" }, \
 LEGACY_OPTIONS
 { NULL }
 };
-- 
2.1.0.rc2.206.gedb03e5

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Adds support for setting aq_mode in libvpx encoder

2014-08-21 Thread James Almer
On 21/08/14 9:48 PM, Deb Mukherjee wrote:
> Sets aq_mode in the [0, 3] range for the libvpx encode wrapper.
> ---
>  libavcodec/libvpxenc.c | 5 +
>  1 file changed, 5 insertions(+)

The new setting should be mentioned in doc/encoders.texi (there are a lot other 
options missing in the documentation for that matter, but that's not related to
this patch).

> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index 830a793..f4d3238 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -96,6 +96,7 @@ typedef struct VP8EncoderContext {
>  int tile_columns;
>  int tile_rows;
>  int frame_parallel;
> +int aq_mode;
>  } VP8Context;
>  
>  /** String mappings for enum vp8e_enc_control_id */
> @@ -123,6 +124,7 @@ static const char *const ctlidstr[] = {
>  [VP9E_SET_TILE_COLUMNS]= "VP9E_SET_TILE_COLUMNS",
>  [VP9E_SET_TILE_ROWS]   = "VP9E_SET_TILE_ROWS",
>  [VP9E_SET_FRAME_PARALLEL_DECODING] = "VP9E_SET_FRAME_PARALLEL_DECODING",
> +[VP9E_SET_AQ_MODE] = "VP9E_SET_AQ_MODE",
>  #endif
>  };
>  
> @@ -444,6 +446,8 @@ static av_cold int vpx_init(AVCodecContext *avctx,
>  codecctl_int(avctx, VP9E_SET_TILE_ROWS, ctx->tile_rows);
>  if (ctx->frame_parallel >= 0)
>  codecctl_int(avctx, VP9E_SET_FRAME_PARALLEL_DECODING, 
> ctx->frame_parallel);
> +if (ctx->aq_mode >= 0)
> +codecctl_int(avctx, VP9E_SET_AQ_MODE, ctx->aq_mode);
>  }
>  #endif
>  
> @@ -803,6 +807,7 @@ static const AVOption vp9_options[] = {
>  { "tile-columns","Number of tile columns to use, log2", 
> OFFSET(tile_columns),AV_OPT_TYPE_INT, {.i64 = -1}, -1, 6, VE},
>  { "tile-rows",   "Number of tile rows to use, log2",
> OFFSET(tile_rows),   AV_OPT_TYPE_INT, {.i64 = -1}, -1, 2, VE},
>  { "frame-parallel",  "Enable frame parallel decodability features", 
> OFFSET(frame_parallel),  AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, VE},
> +{ "aq-mode", "adaptive quantization mode",  
> OFFSET(aq_mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 3, VE},

This needs an AV_OPT_TYPE_CONST for each of the four values, same way it's 
being 
done for the arnr-type and quality settings (Or the equivalent aq_mode setting 
in 
libx264.c).

Also, i have libvpx 1.3.0 here and vpxenc only mentions two values for 
--aq-mode, 
0 (Disabled) and 1 (Variance). 2 and 3 were evidently added after that version.
Not sure if this is something that should be handled in the code, mentioned in 
doc/encoders.texi, or in the description for each of the values.

>  LEGACY_OPTIONS
>  { NULL }
>  };
> 

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel