[FFmpeg-devel,3/3] qsvenc: cavlc and pic_timing_sei are only available for h264

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

Details

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

Commit Message

Zhong Li Nov. 13, 2017, 9:30 a.m.
Signed-off-by: Zhong Li <zhong.li@intel.com>
---
 libavcodec/qsvenc.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 2259a79..c45b2a6 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -532,22 +532,22 @@  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)
-            q->cavlc = avctx->coder_type == FF_CODER_TYPE_VLC;
+            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;
+            q->extco.CAVLC = q->cavlc ? MFX_CODINGOPTION_ON
+                                      : MFX_CODINGOPTION_UNKNOWN;
 
-        q->extco.PicTimingSEI         = q->pic_timing_sei ?
-                                        MFX_CODINGOPTION_ON : MFX_CODINGOPTION_UNKNOWN;
+            q->extco.PicTimingSEI = q->pic_timing_sei ?
+                                  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;