[FFmpeg-devel] [PATCH 4/5] lavc/qsvdec: add ChromaFormat support for YUV422/YUV444
Hendrik Leppkes
h.leppkes at gmail.com
Fri Jun 28 04:08:37 EEST 2019
On Thu, Jun 27, 2019 at 4:31 PM Linjie Fu <linjie.fu at intel.com> wrote:
>
> Currently, ChromaFormat passed to libmfx is set to YUV42O by default.
>
> Modify to choose ChromaFormat according to fourCC.
>
> Signed-off-by: Linjie Fu <linjie.fu at intel.com>
> ---
> libavcodec/qsvdec.c | 20 +++++++++++++++++++-
> 1 file changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
> index 46aa2d6..7650325 100644
> --- a/libavcodec/qsvdec.c
> +++ b/libavcodec/qsvdec.c
> @@ -40,6 +40,7 @@
> #include "qsv.h"
> #include "qsv_internal.h"
> #include "qsvdec.h"
> +#include <va/va.h>
>
> const AVCodecHWConfigInternal *ff_qsv_hw_configs[] = {
> &(const AVCodecHWConfigInternal) {
> @@ -211,7 +212,24 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q)
> param.mfx.FrameInfo.FourCC = q->fourcc;
> param.mfx.FrameInfo.Width = frame_width;
> param.mfx.FrameInfo.Height = frame_height;
> - param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
> +
> + switch (q->fourcc) {
> + case VA_FOURCC_YUY2:
> +#ifdef VA_FOURCC_Y210
> + case VA_FOURCC_Y210:
> +#endif
> + param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV422;
> + break;
> + case VA_FOURCC_AYUV:
> +#ifdef VA_FOURCC_Y410
> + case VA_FOURCC_Y410:
> +#endif
> + param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV444;
> + break;
> + default:
> + param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
> + break;
> + }
>
> switch (avctx->field_order) {
> case AV_FIELD_PROGRESSIVE:
VA_FOURCC_ sounds like VAAPI, that doesn't seem like it belongs in qsv
code which is supposed to work on multiple platforms.
- Hendrik
More information about the ffmpeg-devel
mailing list