diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2008-07-06 03:26:32 +0000 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2008-07-06 03:26:32 +0000 |
commit | 2d35ae567f89ba2757d8a652ef57854f889d8991 (patch) | |
tree | 8366d7f203424980f65d507582923385abace47b /libswscale | |
parent | 647b90ae0e2a972a1cce0a025fd1332c70a2d956 (diff) | |
download | ffmpeg-2d35ae567f89ba2757d8a652ef57854f889d8991.tar.gz |
Split simpleCopy into packedCopy and planarCopy. SoC Patch from Keiji Costantini
Originally committed as revision 27212 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/swscale.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 139bc55e5f..d14e427b74 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1731,11 +1731,10 @@ static int yvu9toyv12Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int } /* 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 @@ static int simpleCopy(SwsContext *c, uint8_t* src[], int srcStride[], int srcSli 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 @@ static int simpleCopy(SwsContext *c, uint8_t* src[], int srcStride[], int srcSli } } } - } + return srcSliceH; } @@ -2208,7 +2211,10 @@ SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH || (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 */ |