Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
18 Views

MJPEG decoder - chroma decoding issue

Here is the issue with chroma decoding.
I feed to decoder the file:



And get decoded:


The picture is coded as JC_YCBCR with subsampling JS_422
If I decode this picture into JC_GRAY - I get goot quality grayscale picture.
But if I require to decode this picture into the colorspace and subsampling
as it is coded internally: JC_YCBCR with subsampling JS_422
I see wrong image.

How to fix it?
0 Kudos
3 Replies
Highlighted
Employee
18 Views

Hello,

How do you set the output video format? some samle code may be helpful here:
I see from the MJPEG sample code, it needs to set as YUY2:


if(JS_422 == sampling && JC_YCBCR == color)
{
m_colorFormat = YUY2;
m_frameStep = m_frameDims.width*2;

}

0 Kudos
Highlighted
18 Views

[bash]My code is there^

jerr = m_decoder.ReadHeader(&in_width, &in_height, &in_channels, &in_color, &in_sampling, &in_precision);

// Allocate buffer here jerr = m_decoder.SetDestination(p42xP4, n42xStepP4, dim4xxY, in_channels, in_color, in_sampling, 8, scale); jerr = m_decoder.ReadData();[/bash]
In this code colorspace and sampling are exactly as coded in compressed JPEG image.
I do so, to avoid redundant color convertions inside of decoder.
Why should I change it?

In IPP 6.1 everithing worked fine.
Why it has been changed?
0 Kudos
Highlighted
Beginner
18 Views

Hello!

Problem still exists with ipp-samples ver. 7.0.7. with JPEG 4:2:2 YCbCr. Is it possible to avoid YUY2 in output and get YUV422?

Possibly i have to change 2928 line in jpegdec.cpp from

status = ippiYCbCr422_8u_P3C2R(pSrc8u,srcStep,pDst8u,dstStep,roi);

to something else, or add some other conversion?

0 Kudos