当前位置: 技术问答>linux和unix
关于YUV420格式数据的问题
来源: 互联网 发布时间:2017-05-07
本文导语: int i ; width = h->pDCodecCtx->width; height = h->pDCodecCtx->height; pY = h->pDPicture->data[0]; pU = h->pDPicture->data[1]; pV = h->pDPicture->data[2]; pY2 = h->pBufYUV; pU2 = h...
int i ;
width = h->pDCodecCtx->width;
height = h->pDCodecCtx->height;
pY = h->pDPicture->data[0];
pU = h->pDPicture->data[1];
pV = h->pDPicture->data[2];
pY2 = h->pBufYUV;
pU2 = h->pBufYUV+width*height;
pV2 = h->pBufYUV+width*height*5/4;
for (i=0;ipDPicture->linesize[0];
pY2 += width;
if (i%2==0)
{
memmove(pU2, pU, width/2);
memmove(pV2, pV, width/2);
pU2 += width/2;
pU += h->pDPicture->linesize[1];
pV2 += width/2;
pV += h->pDPicture->linesize[2];
}
}
不是很清楚pY += h->pDPicture->linesize[0];pU += h->pDPicture->linesize[1];pV += h->pDPicture->linesize[2];这三句的意思。
width = h->pDCodecCtx->width;
height = h->pDCodecCtx->height;
pY = h->pDPicture->data[0];
pU = h->pDPicture->data[1];
pV = h->pDPicture->data[2];
pY2 = h->pBufYUV;
pU2 = h->pBufYUV+width*height;
pV2 = h->pBufYUV+width*height*5/4;
for (i=0;ipDPicture->linesize[0];
pY2 += width;
if (i%2==0)
{
memmove(pU2, pU, width/2);
memmove(pV2, pV, width/2);
pU2 += width/2;
pU += h->pDPicture->linesize[1];
pV2 += width/2;
pV += h->pDPicture->linesize[2];
}
}
不是很清楚pY += h->pDPicture->linesize[0];pU += h->pDPicture->linesize[1];pV += h->pDPicture->linesize[2];这三句的意思。
|
数据偏移,你应该去熟悉一下,YV12 的格式,你的问题是很基础的,