Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Error UMC::ColorSpaceConversion YUY2 -> YV12

dchris
Beginner
759 Views
I am decoding a Motion JPEG file using the simple_player sample. The JPEGs are encoded with the colorspace as JC_YCBCR and the sampling as JS_422. The resulting UMC colorspace is YUY2. The decoder is using the colorspace converter to match my renderer output, which is YV12. The conversion seems to be incorrect, and looking through the GetFrame funciton of the colorspaceconverter, it appears that several of the YV12/YUV420 functions are used incorrectly (ie treating YV12 as YUV420 on functions that expect/return YV12 buffers). Several example AVI/MJPEG files that demonstrate the problem using the v6.0.0.130 samples can be found at:

http://www.dpreview.com/reviews/nikond90/page18.asp

Please let me know if I am doing something incorrectly or if this is a problem in the samples. Thanks,

0 Kudos
11 Replies
robertd
Beginner
758 Views
Quoting - dchris
I am decoding a Motion JPEG file using the simple_player sample. The JPEGs are encoded with the colorspace as JC_YCBCR and the sampling as JS_422. The resulting UMC colorspace is YUY2. The decoder is using the colorspace converter to match my renderer output, which is YV12. The conversion seems to be incorrect, and looking through the GetFrame funciton of the colorspaceconverter, it appears that several of the YV12/YUV420 functions are used incorrectly (ie treating YV12 as YUV420 on functions that expect/return YV12 buffers). Several example AVI/MJPEG files that demonstrate the problem using the v6.0.0.130 samples can be found at:

http://www.dpreview.com/reviews/nikond90/page18.asp

Please let me know if I am doing something incorrectly or if this is a problem in the samples. Thanks,


I noticed a change in IPP samples umc_color_space_conversion.cpp line 255 of the w_ipp-samples_p_6.0.0.127.

status = ippiYCbCr422ToYCrCb420_8u_C2P3R(pSrc[0], pSrcStep[0], pDst, pDstStep, srcSize);

This change results in our application in exchanging the colors Red and Blue.

In the past it was working correct.
status = ippiYCbCr422ToYCrCb420_8u_C2P3R(pSrc[0], pSrcStep[0], pDstYVU, pDstStepYVU, srcSize);

0 Kudos
Vladimir_Dudnik
Employee
758 Views
Thanks for reporting on this issue. I've created issue report on Intel Premier Support on this.

Regards,
Vladimir
0 Kudos
Ying_H_Intel
Employee
759 Views

It looks like that 5.3 sample had the correct function's call.

The line status = ippiYCbCr422ToYCrCb420_8u_C2P3R(pSrc[0], pSrcStep[0], pDst, pDstStep, srcSize);

should be
status = ippiYCbCr422ToYCrCb420_8u_C2P3R(pSrc[0], pSrcStep[0], pDstYVU, pDstStepYVU, srcSize);

Thansks,
Ying
0 Kudos
meenakshi_pindwal
759 Views
Hello Ying,

I am using IPP7.0.5 and trying to encode YUY2 data to MPEG2.

I tried below three methods:
1. Provided YUY2 data directly to MPEG2 encoder's Getframe(). Here, Red and Blue components of the encoded data are interchanged.

2. Using VideoProcessing class, I converted YUY2 data to YV12. Then provided this YV12 data to MPEG2 encoder's GetFrame().Here also, Red and Blue components of the encoded data are interchanged.

3. Using VideoProcessing class, I converted YUY2 data to NV12. Then provided this NV12 data to MPEG2 encoder's GetFrame(). Here, all components of encoded data are correct.

QUESTIONS:
1. Is the "Error UMC::ColorSpaceConversion YUY2 -> YV12" is fixed in IPP 7.0 or not?
2. Converting YUY2 to NV12 and then encoding to MPEG2 is recommended or not?

Thanks in advance,
Meenakshi Pindwal

PS. I am interested in details on the "UMC::ColorSpaceConversion YUY2->YV12" issue. Let me be more specific; issues DPD200134967, DPD200134973 and other(if any) Thanks.
0 Kudos
Naveen_G_Intel
Employee
759 Views

Hi Meenakshi,

As in the bug fix list, these two issues are (DPD200134967, DPD200134973) are fixed in IPP 6.1 update 1(2.5 years older version).

http://software.intel.com/en-us/articles/intel-ipp-library-61-fixes-list/

Currently IPP 7.0 update 5 is available, which has additional optimization and features.

Get the latest package from - http://software.intel.com/en-us/articles/intel-ipp-70-library-release-notes/

Regards,

Naveen Gv

0 Kudos
meenakshi_pindwal
759 Views
Dear Naveen,

Thanx for replying. From the bug fix list of IPP6.1, it seems the issue is fixed.

But when I performed the YUY2->YV12 conversion using IPP 7.0 (by the three methods I mentioned in earlier post) I still get the inverted colors.

Can you please help me identifying the problem?

Kindly let me know what other information you require for the same.

Thanks and Regards,
Meenakshi pindwal
0 Kudos
Naveen_G_Intel
Employee
759 Views

Hi Meenakshi,

Can you try this, in umc_color_space_conversion.cpp, line number 269 of IPP 7.0 update 5 sample code?

status = ippiYCbCr422ToYCrCb420_8u_C2P3R(pSrc[0], pSrcStep[0], pDstYVU, pDstStepYVU, srcSize);

Let me know how it works.

Regards,

Naveen GV

0 Kudos
meenakshi_pindwal
759 Views
Dear Naveen,

I tried this and it worked! :-) Thanx.

Is changing the colorspace converter sample and then using it recommended?

Apart from this I am observing one more problem. The encoded data I am getting as output of GetFrame() of UMC::MPEG2VideoEncoder class is having some blocks over it on some portions. It appears as corruption in some portion of video frames.

This corruption issue is observed on both encoding, YUY2->YV12 and RGB24->YV12.

Please help me in this.

Thanks and Regards,
Meenakshi Pindwal
0 Kudos
Naveen_G_Intel
Employee
759 Views

Hi Meenakshi,

Is it reproducible using IPP sample code (audio and video codec)? I havent observed any issues with UMC::MPEG2VideoEncoder class.

Regards,

Naveen Gv

0 Kudos
meenakshi_pindwal
759 Views
Hi Naveen,

No, there is no corruption seend with sample codecs. That's why I m quite sure that I am missing some information/parameter setting of Mpeg2 Encoder at my end. Could not figure out which one! :-(

Currently I am only setting below parameters:

Mpeg2EncoderParams.info.clip_info.width = Width;

Mpeg2EncoderParams.info.clip_info.height = Height;

Mpeg2EncoderParams.info.framerate = 30;

Mpeg2EncoderParams.info.bitrate = BitRate;

Mpeg2EncoderParams.numEncodedFrames = 0x7fffffff;

Mpeg2EncoderParams.numThreads = 0;

Apart from this is there any other Mpeg2EncoderParam which need to be set before calling Mpeg2VideoEncoder Init()?

Input toVideoProcessing : VideoData object with Color format as YUY2/RGB24
OutputofVideoProcessing : VideoData object with Color format as YV12


Input to MPEG2encoder: VideoData object with Color format as YV12

Thanks and Regards,
Meenakshi Pindwal

0 Kudos
Naveen_G_Intel
Employee
759 Views

Can you attach a test case to verify this issue? Parameter settings are looks okay.

If you do not want your code to be shown in public, you can make use of the forum's "private post" feature where your text and code will be viewable only by Intel engineers.

Regards,

Naveen Gv

0 Kudos
Reply