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

Deb Mukherjee debargha at google.com
Fri Aug 22 02:48:58 CEST 2014


Sets aq_mode in the [0, 3] range for the libvpx encode wrapper.
---
 libavcodec/libvpxenc.c | 5 +++++
 1 file changed, 5 insertions(+)

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},
     LEGACY_OPTIONS
     { NULL }
 };
-- 
2.1.0.rc2.206.gedb03e5



More information about the ffmpeg-devel mailing list