Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Kamal_Devanga
Beginner
111 Views

Decode -> VPP Color Convert, is this a bug or by design?

VPP seems to require a bit of a "hack" to get it to work properly.  Can anyone tell me if this is true, or perhaps I've misunderstood something.  I want to do a colour convert from NV12 to YUY2 after a decode.  To that end my VPP parameters look like this:

    My_QSV_Vpp_Parameters.vpp.In.FourCC = MFX_FOURCC_NV12;
    My_QSV_Vpp_Parameters.vpp.Out.FourCC = MFX_FOURCC_YUY2;

The NV12 surfaces are coming from DecodeFrameAsync's surface pool.  With these parameters the allocator (D3D11Allocator) produces d3d surfaces for my vpp pool with the NV12 format (it uses the In.FourCC to construct them).  The resulting output is as you would expect, NV12.  I worked out the solution is to use these parameters for allocation:

    My_QSV_Vpp_Parameters.vpp.In.FourCC = MFX_FOURCC_YUY2;
    My_QSV_Vpp_Parameters.vpp.Out.FourCC = MFX_FOURCC_YUY2;

, to force the vpp pool surfaces to be yuy2, and then to change In.FourCC to MFX_FOURCC_NV12 just before the VPP Init function.  This seems to work OK as I get YUY2 output when I do it, NV12 output when I don't.

Does this look vaguely correct?

0 Kudos
3 Replies
Jiandong_Z_Intel
Employee
111 Views

Hi There,

I think is a feature, the VPP color space conversion depend on the in and output surface type. for more detail, you can also refer to sample_vpp

 

Thanks,

Zachary

 

Kamal_Devanga
Beginner
111 Views

What I'm doing works but the API seems wrong to me.  As I say I have to manually flip the in/out fourcc parameters to get the correct D3D11 surfaces from the allocator, as it's different to what I need to pass in to the vpp init function.  The vpp sample isn't really any help.

Hitesh_V_
Beginner
111 Views

Hi Robinson J,

I am doing some PoC similar to what you achieved. I would appreciate your response if you can help me to fix my problem.

I want to decode H.264 data into 422 UYVY but SDK can only decode into YUV 420. I found VPP can do that but I checked the "simple_6_decode_vpp_postproc" demo from the sample demos but I am not able to achieve it yet. I also tried to do what you have done but all the time I am getting NV12 as decoded data.

I am new to this SDK please advise what mistake I am doing? Also please advise which demo you referred to achieve YUV 422 decoding?

-- HRV

Reply