Mercurial > mplayer.hg
changeset 27180:1a35c35a631e
Split simpleCopy into packedCopy and planarCopy. SoC Patch from Keiji Costantini
author | lu_zero |
---|---|
date | Sun, 06 Jul 2008 03:26:32 +0000 |
parents | 77b12b0470e4 |
children | a6ca10caead4 |
files | libswscale/swscale.c |
diffstat | 1 files changed, 14 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/libswscale/swscale.c Sat Jul 05 18:02:17 2008 +0000 +++ b/libswscale/swscale.c Sun Jul 06 03:26:32 2008 +0000 @@ -1731,11 +1731,10 @@ } /* unscaled copy like stuff (assumes nearly identical formats) */ -static int simpleCopy(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[]){ - if (isPacked(c->srcFormat)) - { + if (dstStride[0]==srcStride[0] && srcStride[0] > 0) memcpy(dst[0] + dstStride[0]*srcSliceY, src[0], srcSliceH*dstStride[0]); else @@ -1757,9 +1756,13 @@ dstPtr+= dstStride[0]; } } - } - else - { /* Planar YUV or gray */ + + return srcSliceH; +} +static int planarCopy(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, + int srcSliceH, uint8_t* dst[], int dstStride[]) +{ + int plane; for (plane=0; plane<3; plane++) { @@ -1790,7 +1793,7 @@ } } } - } + return srcSliceH; } @@ -2208,7 +2211,10 @@ || (isPlanarYUV(srcFormat) && isGray(dstFormat)) || (isPlanarYUV(dstFormat) && isGray(srcFormat))) { - c->swScale= simpleCopy; + if (isPacked(c->srcFormat)) + c->swScale= packedCopy; + else /* Planar YUV or gray */ + c->swScale= planarCopy; } /* gray16{le,be} conversions */