MJPEG decoder - chroma decoding issue

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?

Fichier attachéTaille
Télécharger What-I-decode.jpg545.65 Ko
Télécharger What-I-see.jpg79.68 Ko
4 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.


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;


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();

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?


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?

Connectez-vous pour laisser un commentaire.