- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey There,
I'm pretty new to working with this IPP stuff, though am running into one final problem. I'm actually correctly converting to MPEG4, though have one final problem. My Hue is off in the finally converted video, and most people/things appear in a shade of blue, and I can't seem to figure out quite why.
I'm having to jump color formats from RGB32 to YV12, and that's one potential area that my problem lies. I'm doing that with the final code.
[cpp]pYV12Buffer = (BYTE*)malloc(InBufLength); long lSrcPitch0 = m_iImageWidth * 4; long lSrcPitch1 = 0; long lSrcPitch2 = 0; BYTE *pSrcBuffer0 = pInBuf; BYTE *pSrcBuffer1 = NULL; BYTE *pSrcBuffer2 = NULL; long lDestPitch0 = m_iImageWidth; long lDestPitch1 = m_iImageWidth/2; long lDestPitch2 = m_iImageWidth/2; BYTE *pDestBuffer0 = pYV12Buffer; BYTE *pDestBuffer1 = pDestBuffer0 + (lDestPitch0 * abs(m_iImageHeight)); BYTE *pDestBuffer2 = pDestBuffer1 + ((lDestPitch1 * abs(m_iImageHeight))/2); IppStatus status = ippStsNoErr; .... else if (IsEqualGUID(m_InMT.subtype, MEDIASUBTYPE_RGB32)) { Ipp8u* pSrc[3] = {pSrcBuffer0, pSrcBuffer1, pSrcBuffer2}; Ipp8u* pDest[3] = {pDestBuffer0, pDestBuffer1, pDestBuffer2}; int destStep[3] = {lDestPitch0, lDestPitch1, lDestPitch2}; IppiSize roiSize = { m_iImageWidth, abs(m_iImageHeight) }; status = ippiBGRToYCrCb420_8u_AC4P3R(pSrcBuffer0, lSrcPitch0, pDest, destStep, roiSize); }[/cpp]
I'm thinking it either has to do with this conversion or the setup of my EncoderFilter. But I'm kinda lost. Any help would be appreciated. If you need a little bit more code from a different area, please ask and I'd be happy to help. I've updated the IPP libraries to be using the latest as well, 6.1 I believe, and that didn't help either.
Thanks in advance,
- Greg
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If people appear as blue and you're using a BGRToYCrCb function, that means you have blue and red swapped. You can still use the BGR function to convert RGB data, but just swap the 1st and 3rd input channels.
Ipp8u* pSrc[3] = {pSrcBuffer2, pSrcBuffer1, pSrcBuffer0};
Ipp8u* pSrc[3] = {pSrcBuffer2, pSrcBuffer1, pSrcBuffer0};
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Greg,
If you dump out the YUV420 data ( the output of ippiBGRToYCrCb420_8u_AC4P3R), and display it with some YUV player, can you find if the YUV data is corrected?
Thanks,
Chao
If you dump out the YUV420 data ( the output of ippiBGRToYCrCb420_8u_AC4P3R), and display it with some YUV player, can you find if the YUV data is corrected?
Thanks,
Chao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If people appear as blue and you're using a BGRToYCrCb function, that means you have blue and red swapped. You can still use the BGR function to convert RGB data, but just swap the 1st and 3rd input channels.
Ipp8u* pSrc[3] = {pSrcBuffer2, pSrcBuffer1, pSrcBuffer0};
Ipp8u* pSrc[3] = {pSrcBuffer2, pSrcBuffer1, pSrcBuffer0};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - oxydius
If people appear as blue and you're using a BGRToYCrCb function, that means you have blue and red swapped. You can still use the BGR function to convert RGB data, but just swap the 1st and 3rd input channels.
Ipp8u* pSrc[3] = {pSrcBuffer2, pSrcBuffer1, pSrcBuffer0};
Ipp8u* pSrc[3] = {pSrcBuffer2, pSrcBuffer1, pSrcBuffer0};
Thank you both for your help...We had originally been using IPP v.4.X.X, and did not have the availability of the RGB functions. Upon switching to 6.1.1, I simply changed the function header to RGB instead of BGR and it worked flawlessly.
I was able to figure this out thanks to the comment above which was dead on. Appreciate the help. =)

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page