yuv420P转NV12代码

群里一位朋友提供的代码,自己为测试过,mark一下,有朋友测试了记得评论一下告知能不能用,谢谢!!


void YUV420PtoNV12(unsigned char *Src, unsigned char* Dst,int Width,int Height){
    unsigned char* SrcU = Src + Width * Height;
    unsigned char* SrcV = SrcU + Width * Height / 4 ;
    unsigned char* DstU = Dst + Width * Height;
    int i = 0;
    for( i = 0 ; i < Width * Height / 4 ; i++ ){
        *(DstU++) = *(SrcU++);
        *(DstU++) = *(SrcV++);    
    }
}



你可能感兴趣的:(媒体技术)