Commit bc5a0444 authored by Luca Barbato's avatar Luca Barbato

Reindent. SoC Patch from Keiji Costantini

Originally committed as revision 27213 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
parent 2d35ae56
...@@ -1732,68 +1732,65 @@ static int yvu9toyv12Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int ...@@ -1732,68 +1732,65 @@ static int yvu9toyv12Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int
/* unscaled copy like stuff (assumes nearly identical formats) */ /* unscaled copy like stuff (assumes nearly identical formats) */
static int packedCopy(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, static int packedCopy(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]){ int srcSliceH, uint8_t* dst[], int dstStride[])
{
if (dstStride[0]==srcStride[0] && srcStride[0] > 0)
memcpy(dst[0] + dstStride[0]*srcSliceY, src[0], srcSliceH*dstStride[0]);
else
{
int i;
uint8_t *srcPtr= src[0];
uint8_t *dstPtr= dst[0] + dstStride[0]*srcSliceY;
int length=0;
/* universal length finder */
while(length+c->srcW <= FFABS(dstStride[0])
&& length+c->srcW <= FFABS(srcStride[0])) length+= c->srcW;
ASSERT(length!=0);
if (dstStride[0]==srcStride[0] && srcStride[0] > 0) for (i=0; i<srcSliceH; i++)
memcpy(dst[0] + dstStride[0]*srcSliceY, src[0], srcSliceH*dstStride[0]);
else
{ {
int i; memcpy(dstPtr, srcPtr, length);
uint8_t *srcPtr= src[0]; srcPtr+= srcStride[0];
uint8_t *dstPtr= dst[0] + dstStride[0]*srcSliceY; dstPtr+= dstStride[0];
int length=0;
/* universal length finder */
while(length+c->srcW <= FFABS(dstStride[0])
&& length+c->srcW <= FFABS(srcStride[0])) length+= c->srcW;
ASSERT(length!=0);
for (i=0; i<srcSliceH; i++)
{
memcpy(dstPtr, srcPtr, length);
srcPtr+= srcStride[0];
dstPtr+= dstStride[0];
}
} }
}
return srcSliceH; return srcSliceH;
} }
static int planarCopy(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, static int planarCopy(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]) int srcSliceH, uint8_t* dst[], int dstStride[])
{ {
int plane;
for (plane=0; plane<3; plane++)
{
int length= plane==0 ? c->srcW : -((-c->srcW )>>c->chrDstHSubSample);
int y= plane==0 ? srcSliceY: -((-srcSliceY)>>c->chrDstVSubSample);
int height= plane==0 ? srcSliceH: -((-srcSliceH)>>c->chrDstVSubSample);
int plane; if ((isGray(c->srcFormat) || isGray(c->dstFormat)) && plane>0)
for (plane=0; plane<3; plane++)
{ {
int length= plane==0 ? c->srcW : -((-c->srcW )>>c->chrDstHSubSample); if (!isGray(c->dstFormat))
int y= plane==0 ? srcSliceY: -((-srcSliceY)>>c->chrDstVSubSample); memset(dst[plane], 128, dstStride[plane]*height);
int height= plane==0 ? srcSliceH: -((-srcSliceH)>>c->chrDstVSubSample); }
else
if ((isGray(c->srcFormat) || isGray(c->dstFormat)) && plane>0) {
{ if (dstStride[plane]==srcStride[plane] && srcStride[plane] > 0)
if (!isGray(c->dstFormat)) memcpy(dst[plane] + dstStride[plane]*y, src[plane], height*dstStride[plane]);
memset(dst[plane], 128, dstStride[plane]*height);
}
else else
{ {
if (dstStride[plane]==srcStride[plane] && srcStride[plane] > 0) int i;
memcpy(dst[plane] + dstStride[plane]*y, src[plane], height*dstStride[plane]); uint8_t *srcPtr= src[plane];
else uint8_t *dstPtr= dst[plane] + dstStride[plane]*y;
for (i=0; i<height; i++)
{ {
int i; memcpy(dstPtr, srcPtr, length);
uint8_t *srcPtr= src[plane]; srcPtr+= srcStride[plane];
uint8_t *dstPtr= dst[plane] + dstStride[plane]*y; dstPtr+= dstStride[plane];
for (i=0; i<height; i++)
{
memcpy(dstPtr, srcPtr, length);
srcPtr+= srcStride[plane];
dstPtr+= dstStride[plane];
}
} }
} }
} }
}
return srcSliceH; return srcSliceH;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment