intel / libvpl

Intel® Video Processing Library (Intel® VPL) API, dispatcher, and examples
https://intel.github.io/libvpl/
MIT License
262 stars 80 forks source link

sample_encode shouldn`t use VPP if color conversion has been done by FileReader #8

Closed Fantast34 closed 2 years ago

Fantast34 commented 3 years ago

in case of hardware encoding of I420 input file: pParams->FileInputFourCC == MFX_FOURCC_I420; pParams->EncodeFourCC = MFX_FOURCC_NV12;

This conversion will be done in FileReader. But in pipeline_encode.cpp on line 1783 sample will set bVPP flag to "true" and will create VPP instance. In this case VPP will just copy surface without any conversion.

I suggest change condition

if (pParams->nWidth != pParams->nDstWidth || pParams->nHeight != pParams->nDstHeight || pParams->FileInputFourCC != pParams->EncodeFourCC)

to

if (pParams->nWidth != pParams->nDstWidth || pParams->nHeight != pParams->nDstHeight || m_InputFourCC != pParams->EncodeFourCC)

mav-intel commented 2 years ago

Fixed by #13