Quantcast
Channel: Intel® Software - Media
Viewing all articles
Browse latest Browse all 2185

Video scaling with "aspect ratio correction" (Letterbox or Pillarbox) results in incorrect color shift

$
0
0

Hello there!

I ran in an problem, while scaling a video frame with Intels video processing library. This post should help anyone, who experiences same issue.

While  MFXVideoVPP::Init(mfxVideoParam *par) returns MFX_ERR_NONE, there is a color shift (yellow and blue are broken) in the output video data. This runtime error occures because of misconfiguration of "crop" parameters. 

In this example a NTSC frame is scaled to 640x480 frame, under "scale to height" aspect ratio correction  mode.
(To achive this i have to cut equal parts from the left and right sides of the source frame)

This configuration results in described "color-shift" error:

"Intel API Implementation: MFX_IMPL_SOFTWARE Version: 1.13"    
"-------VPP Parameter-------"    
"AsyncDepth: 0"    
"NumExtParam: 0"    
"IOPattern: MFX_IOPATTERN_IN_SYSTEM_MEMORY,MFX_IOPATTERN_OUT_SYSTEM_MEMORY"    
"-------VPP INPUT-------"    
"BitDepthLuma: 8"    
"BitDepthChroma: 8"    
"Shift: 0"    
"FourCC: YUY2"    
"Width: 720"    
"Height: 512"    
"CropX: 35"    
"CropY: 0"    
"CropW: 650"    
"CropH: 486"    
"FrameRateExtN: 30000"    
"FrameRateExtD: 1001"    
"AspectRatioW: 0"    
"AspectRatioH: 0"    
"PicStruct: MFX_PICSTRUCT_FIELD_BFF"    
"ChromaFormat: MFX_CHROMAFORMAT_YUV422"    
""    
"-------VPP OUTPUT-------"    
"BitDepthLuma: 8"    
"BitDepthChroma: 8"    
"Shift: 0"    
"FourCC: RGB4"    
"Width: 640"    
"Height: 480"    
"CropX: 0"    
"CropY: 0"    
"CropW: 640"    
"CropH: 480"    
"FrameRateExtN: 30000"    
"FrameRateExtD: 1001"    
"AspectRatioW: 0"    
"AspectRatioH: 0"    
"PicStruct: MFX_PICSTRUCT_PROGRESSIVE"    
"ChromaFormat: MFX_CHROMAFORMAT_YUV444"    

This would be the correct configuration :

"Intel API Implementation: MFX_IMPL_SOFTWARE Version: 1.13"    
"-------VPP Parameter-------"    
"AsyncDepth: 0"    
"NumExtParam: 0"    
"IOPattern: MFX_IOPATTERN_IN_SYSTEM_MEMORY,MFX_IOPATTERN_OUT_SYSTEM_MEMORY"    
"-------VPP INPUT-------"    
"BitDepthLuma: 8"    
"BitDepthChroma: 8"    
"Shift: 0"    
"FourCC: YUY2"    
"Width: 720"    
"Height: 512"    
"CropX: 36"    
"CropY: 0"    
"CropW: 648"    
"CropH: 486"    
"FrameRateExtN: 30000"    
"FrameRateExtD: 1001"    
"AspectRatioW: 0"    
"AspectRatioH: 0"    
"PicStruct: MFX_PICSTRUCT_FIELD_BFF"    
"ChromaFormat: MFX_CHROMAFORMAT_YUV422"    
""    
"-------VPP OUTPUT-------"    
"BitDepthLuma: 8"    
"BitDepthChroma: 8"    
"Shift: 0"    
"FourCC: RGB4"    
"Width: 640"    
"Height: 480"    
"CropX: 0"    
"CropY: 0"    
"CropW: 640"    
"CropH: 480"    
"FrameRateExtN: 30000"    
"FrameRateExtD: 1001"    
"AspectRatioW: 0"    
"AspectRatioH: 0"    
"PicStruct: MFX_PICSTRUCT_PROGRESSIVE"    
"ChromaFormat: MFX_CHROMAFORMAT_YUV444"    

 

Kind regards,
Max

 


Viewing all articles
Browse latest Browse all 2185

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>