- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
I have a bitmap(no header)buffer of size 176x144 and want to conver to YUV format before calling H.264 encoding routine.
I did it in the following way
int FrameSize = VideoWidth*VideoHeight*3/2;
IppStatus retValue;
Ipp8u * yuvData[3];
IppiSize srcSize={VideoWidth, VideoHeight};
int srcStep = VideoWidth*3;
//yuvData[0]=cYUVData + VideoWidth*VideoHeight*3/2;
yuvData[0]=cYUVData;
yuvData[1]=yuvData[0] +VideoWidth*VideoHeight;
yuvData[2]=yuvData[1] +VideoWidth*VideoHeight/4;
int pDstStepYVU[3] = {VideoWidth, VideoWidth/2, VideoWidth/2};
retValue = ippiRGBToYCbCr420_8u_C3P3R(cRGB24Data, srcStep, yuvData, pDstStepYVU, srcSize);
and retValue is success.
How can I get the size of the cYUVData aftertheabove function call so that I can validate the YUV data by writing to a file.
Pls help.
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Hello,
It looks the input and output image size is different.
In color conversion functions, the input and out function have the same size. It has no functionality to resize the image.
You need to call IPP resize function (ippiResizeSqrPixel_) first to change the image size to 176x144, then call color conversion function.
Thanks,
Chao
Ссылка скопирована
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
And size is defined by width and height of your RGB image, meaning for 420 sampling you will have Y plane with the same width and height, and U and V planes with width/2 and height/2.
Vladimir
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Thanks for you response.
Are my above RGB to YUV conversion code is correct if the bitmap(RGB24) buffer size is 176x144?
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Hi,
It looks fine for me. The BMP data in the memory is possilly in BGR order. If this is your case, it need to call ippiBGRToYCrCb420_8u_C3P3R(..) function.
Thanks,
Chao
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
I have a raw RGB24 bitmap buffer of size 640x480(921600 bytes) from a web cam callback function that i want to convert to YUV format of size 176x144. I tried it as follows.
int VideoWidth=176,VideoHeight=144,FrameNumber=1;
int nMaxYUVSize = (VideoWidth*VideoHeight + (VideoWidth*VideoHeight)/2);
Ipp8u *cYUVData = ippsMalloc_8u(nMaxYUVSize);
Ipp8u *cRGB24Data = ippsMalloc_8u(921600); and cRGB24Data is filled with raw bitmap from webcam callback function
IppStatus retValue;
Ipp8u * yuvData[3];
IppiSize srcSize={VideoWidth, VideoHeight};
int srcStep = VideoWidth*3;
yuvData[0]=cYUVData;
yuvData[1]=yuvData[0] +VideoWidth*VideoHeight;
yuvData[2]=yuvData[1] +VideoWidth*VideoHeight/4;
int pDstStepYVU[3] = {VideoWidth, VideoWidth/2, VideoWidth/2};
retValue = ippiRGBToYCbCr420_8u_C3P3R(cRGB24Data, srcStep,yuvData, pDstStepYVU, srcSize);
eventhough retValue == ippStsNoErr, the yuvData appears to be wrong.
What is wrong with the above method?
Somebody please help
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Hello,
It looks the input and output image size is different.
In color conversion functions, the input and out function have the same size. It has no functionality to resize the image.
You need to call IPP resize function (ippiResizeSqrPixel_) first to change the image size to 176x144, then call color conversion function.
Thanks,
Chao
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Thanks for the help. WhenI resize the image the issue solved.

- Подписка на RSS-канал
- Отметить тему как новую
- Отметить тему как прочитанную
- Выполнить отслеживание данной Тема для текущего пользователя
- Закладка
- Подписаться
- Страница в формате печати