No matter cavlc option is set to 0 or 1, the output bitstream is always
cabac mode.
Reproduce: -y -s widthxheight -i widthxheight.yuv -vcodec h264_qsv
-b:v 2000k -maxrate 2000k -cavlc 1 test.h264
Then check the entropy_coding_mode_flag of the encoded bitstream
It is due to the dulicate option "coder" (which should be deprecated) is set to 
cabac

Signed-off-by: Zhong Li <zhong...@intel.com>
---
 libavcodec/qsvenc.c      | 11 ++++++-----
 libavcodec/qsvenc_h264.c |  4 +++-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index c7e5947..65adb44 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -540,19 +540,20 @@ 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);
+
+        if (q->rdo >= 0)
+            q->extco.RateDistortionOpt = q->rdo > 0 ? MFX_CODINGOPTION_ON : 
MFX_CODINGOPTION_OFF;
+
+        if (avctx->codec_id == AV_CODEC_ID_H264) {
 #if FF_API_CODER_TYPE
 FF_DISABLE_DEPRECATION_WARNINGS
-        if (avctx->coder_type != 0)
+        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;
-
-        if (avctx->codec_id == AV_CODEC_ID_H264) {
             if (avctx->strict_std_compliance != FF_COMPLIANCE_NORMAL)
                 q->extco.NalHrdConformance = avctx->strict_std_compliance > 
FF_COMPLIANCE_NORMAL ?
                                              MFX_CODINGOPTION_ON : 
MFX_CODINGOPTION_OFF;
diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
index 62f1909..1365fac 100644
--- a/libavcodec/qsvenc_h264.c
+++ b/libavcodec/qsvenc_h264.c
@@ -107,7 +107,9 @@ static const AVCodecDefault qsv_enc_defaults[] = {
     // same as the x264 default
     { "g",         "250"   },
     { "bf",        "3"     },
-    { "coder",     "ac"    },
+#if FF_API_CODER_TYPE
+    { "coder",     "-1"    },
+#endif
 
     { "flags",     "+cgop" },
 #if FF_API_PRIVATE_OPT
-- 
1.8.3.1

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to