[FFmpeg-devel,2/3] qsv/h264enc: fix cavlc option setting useless issue

Submitted by Zhong Li on Nov. 13, 2017, 9:29 a.m.

Details

Message ID 1510565400-15509-2-git-send-email-zhong.li@intel.com
State New
Headers show

Commit Message

Zhong Li Nov. 13, 2017, 9:29 a.m.
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 -look_ahead 0 -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.li@intel.com>
---
 libavcodec/qsvenc.c      | 2 +-
 libavcodec/qsvenc_h264.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Zhong Li Nov. 22, 2017, 3:09 a.m.
> -----Original Message-----
> From: Li, Zhong
> Sent: Monday, November 13, 2017 5:30 PM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Li, Zhong <zhong.li@intel.com>
> Subject: [PATCH 2/3] qsv/h264enc: fix cavlc option setting useless issue
> 
> 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 -look_ahead 0 -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.li@intel.com>

Ping?
Carl Eugen Hoyos Dec. 12, 2017, 9:25 p.m.
2017-11-22 4:09 GMT+01:00 Li, Zhong <zhong.li@intel.com>:
> It is due to the dulicate option "coder" (which should be
> deprecated) is set to cabac

Why don't you deprecate -cavlc instead?

Carl Eugen

Patch hide | download patch | download mbox

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 2bc19f5..2259a79 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -534,7 +534,7 @@  static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
         q->extco.Header.BufferSz      = sizeof(q->extco);
 #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
diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
index 0aaf672..3242062 100644
--- a/libavcodec/qsvenc_h264.c
+++ b/libavcodec/qsvenc_h264.c
@@ -155,7 +155,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