《周星星教你学ffmpeg》技巧
ipp源码:
static void RGB_2_YUV420_YV12(BYTE* pRGB24Ptr, BYTE* pYUYVPtr, int width,int height)//yuv420 //3/2:1+1/4+1/4----YU12{
//libyuv::RGB24ToI420(pRGB24Ptr,width*3,pYUYVPtr,width,pYUYVPtr+height*width*5/4,width/2,pYUYVPtr+height*width,width/2,width,height);
DWORD dwTime=::GetTickCount();
IppiSize imgSize;
imgSize.width=width;
imgSize.height=height;
const Ipp8u* pSour[3]={pRGB24Ptr,pRGB24Ptr+height*width,pRGB24Ptr+height*width*2};
Ipp8u* pDes[3]={pYUYVPtr,pYUYVPtr+height*width*5/4,pYUYVPtr+height*width};
int Des[3]={width,width*1/2,width*1/2};//YUV420->1,1/4,1/4
int *pInt=Des;
IppStatus is =ippiBGRToYCbCr420_8u_C3P3R(pRGB24Ptr,width*3,pDes,Des,imgSize);
//IppStatus is =ippiRGBToYUV420_8u_C3P3(pRGB24Ptr,pDes,imgSize);
if(is != ippStsNoErr)
{
return;
//convert error
}
//TRACE("RGB_2_YUV422所需时间:%dms\n",::GetTickCount()-dwTime);
}
有问题联系作者QQ:35744025