[FFmpeg-cvslog] qsvenc: Add private option to replace coder_type

Vittorio Giovara git at videolan.org
Tue Feb 16 17:52:23 CET 2016


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Wed Jan 13 15:27:00 2016 -0500| [9cac1b4b4f1532fb2aeef54799285360656be5eb] | committer: Vittorio Giovara

qsvenc: Add private option to replace coder_type

Missing from be00ec832c519427cd92218abac77dafdc1d5487.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9cac1b4b4f1532fb2aeef54799285360656be5eb
---

 libavcodec/qsvenc.c |   10 ++++++++--
 libavcodec/qsvenc.h |    2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 9aa865d..453301c 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -447,8 +447,14 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
     if (avctx->codec_id != AV_CODEC_ID_HEVC) {
         q->extco.Header.BufferId      = MFX_EXTBUFF_CODING_OPTION;
         q->extco.Header.BufferSz      = sizeof(q->extco);
-        q->extco.CAVLC                = avctx->coder_type == FF_CODER_TYPE_VLC ?
-                                        MFX_CODINGOPTION_ON : MFX_CODINGOPTION_UNKNOWN;
+#if FF_API_CODER_TYPE
+FF_DISABLE_DEPRECATION_WARNINGS
+        if (avctx->coder_type != 0)
+            q->cavlc = avctx->coder_type == FF_CODER_TYPE_VLC;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+        q->extco.CAVLC = q->cavlc ? MFX_CODINGOPTION_ON
+                                  : MFX_CODINGOPTION_UNKNOWN;
 
         if (q->rdo >= 0)
             q->extco.RateDistortionOpt = q->rdo > 0 ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index 97165fc..719e4ec 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -66,6 +66,7 @@
 { "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 }, \
 
 typedef struct QSVEncContext {
     AVCodecContext *avctx;
@@ -120,6 +121,7 @@ typedef struct QSVEncContext {
     int adaptive_i;
     int adaptive_b;
     int b_strategy;
+    int cavlc;
 
     int int_ref_type;
     int int_ref_cycle_size;



More information about the ffmpeg-cvslog mailing list