[FFmpeg-devel] [PATCH] avcodec/qsv: remove MFX_EXTBUFF_CODING_OPTION3

Ivan Uskov ivan.uskov at nablet.com
Sun Jul 24 18:59:37 EEST 2016


Hello Zeranoe,

Saturday, June 18, 2016, 7:33:12 AM, you wrote:

zgc> From: Kyle Schwarz <zeranoe at gmail.com>

zgc> 4th generation Intel CPUs don't support MFX_EXTBUFF_CODING_OPTION3.

zgc> This patch fixes bug #5324.
zgc> ---
zgc>  libavcodec/qsvenc.c | 18 ------------------
zgc>  1 file changed, 18 deletions(-)

zgc> diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
zgc> index 132cf47..a561df8 100644
zgc> --- a/libavcodec/qsvenc.c
zgc> +++ b/libavcodec/qsvenc.c
zgc> @@ -132,9 +132,6 @@ static void dump_video_param(AVCodecContext *avctx, QSVEncContext *q,
zgc>  #if QSV_HAVE_CO2
zgc>      mfxExtCodingOption2 *co2 = (mfxExtCodingOption2*)coding_opts[1];
zgc>  #endif
zgc> -#if QSV_HAVE_CO3
zgc> -    mfxExtCodingOption3 *co3 = (mfxExtCodingOption3*)coding_opts[2];
zgc> -#endif
zgc>  
zgc>      av_log(avctx, AV_LOG_VERBOSE, "profile: %s; level: %"PRIu16"\n",
zgc>             print_profile(info->CodecProfile), info->CodecLevel);
zgc> @@ -186,12 +183,6 @@ static void dump_video_param(AVCodecContext *avctx, QSVEncContext *q,
zgc>                 info->ICQQuality, co2->LookAheadDepth);
zgc>      }
zgc>  #endif
zgc> -#if QSV_HAVE_QVBR
-    else if (info->>RateControlMethod == MFX_RATECONTROL_QVBR) {
zgc> -        av_log(avctx, AV_LOG_VERBOSE, "QVBRQuality: %"PRIu16"\n",
zgc> -               co3->QVBRQuality);
zgc> -    }
zgc> -#endif
zgc>  
zgc>      av_log(avctx, AV_LOG_VERBOSE, "NumSlice: %"PRIu16"; NumRefFrame: %"PRIu16"\n",
zgc>             info->NumSlice, info->NumRefFrame);
zgc> @@ -577,12 +568,6 @@ static int qsv_retrieve_enc_params(AVCodecContext *avctx, QSVEncContext *q)
zgc>          .Header.BufferSz = sizeof(co2),
zgc>      };
zgc>  #endif
zgc> -#if QSV_HAVE_CO3
zgc> -    mfxExtCodingOption3 co3 = {
zgc> -        .Header.BufferId = MFX_EXTBUFF_CODING_OPTION3,
zgc> -        .Header.BufferSz = sizeof(co3),
zgc> -    };
zgc> -#endif
zgc>  
zgc>      mfxExtBuffer *ext_buffers[] = {
zgc>          (mfxExtBuffer*)&extradata,
zgc> @@ -590,9 +575,6 @@ static int qsv_retrieve_enc_params(AVCodecContext *avctx, QSVEncContext *q)
zgc>  #if QSV_HAVE_CO2
zgc>          (mfxExtBuffer*)&co2,
zgc>  #endif
zgc> -#if QSV_HAVE_CO3
zgc> -        (mfxExtBuffer*)&co3,
zgc> -#endif
zgc>      };
zgc>  
zgc>      int need_pps = avctx->codec_id != AV_CODEC_ID_MPEG2VIDEO;
First, I'm not sure that "4th generation Intel CPUs don't support MFX_EXTBUFF_CODING_OPTION3".
Do you have any reference which says it? The documentation says:
"This structure is available since SDK API 1.11.", i.e. it depended by API
level but not by CPU generation.
For any case I believe it is wrong to remove code if some issues are appearing
on old CPUs. Especially if we already have got a pre-processor condition to disable
MFX_EXTBUFF_CODING_OPTION3 by correct way. If you have got some
constructive suggestions to improve disabling MFX_EXTBUFF_CODING_OPTION3 by
condition (possible in real-time code, not by preprocessor) please provide.
But stupid disabling of a feature is not the good solution.

-- 
Best regards,
 Ivan                            mailto:ivan.uskov at nablet.com



More information about the ffmpeg-devel mailing list