diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-09-08 12:36:38 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-09-08 12:36:38 +0000 |
commit | 6bc0c7928a386d5cf99c198ec1b795aff6bf7656 (patch) | |
tree | a90c126c5d92e65bfe4ad9dac24473eaae8464ed /libswscale/swscale.c | |
parent | f7b1d72f45c97f3fc57632a0a23d01cee51c4a4e (diff) | |
download | ffmpeg-6bc0c7928a386d5cf99c198ec1b795aff6bf7656.tar.gz |
Fix jpeg yuv.
Fixes issue504.
Originally committed as revision 27547 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
Diffstat (limited to 'libswscale/swscale.c')
-rw-r--r-- | libswscale/swscale.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 3245521299..0b9bb1e63f 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1984,7 +1984,6 @@ int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4], int srcRange int64_t cy = 1<<16; int64_t oy = 0; - if (isYUV(c->dstFormat) || isGray(c->dstFormat)) return -1; memcpy(c->srcColorspaceTable, inv_table, sizeof(int)*4); memcpy(c->dstColorspaceTable, table, sizeof(int)*4); @@ -1993,6 +1992,7 @@ int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4], int srcRange c->saturation= saturation; c->srcRange = srcRange; c->dstRange = dstRange; + if (isYUV(c->dstFormat) || isGray(c->dstFormat)) return 0; c->uOffset= 0x0400040004000400LL; c->vOffset= 0x0400040004000400LL; @@ -2213,7 +2213,7 @@ SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH sws_setColorspaceDetails(c, Inverse_Table_6_9[SWS_CS_DEFAULT], srcRange, Inverse_Table_6_9[SWS_CS_DEFAULT] /* FIXME*/, dstRange, 0, 1<<16, 1<<16); /* unscaled special Cases */ - if (unscaled && !usesHFilter && !usesVFilter) + if (unscaled && !usesHFilter && !usesVFilter && (srcRange == dstRange || isBGR(dstFormat) || isRGB(dstFormat))) { /* yv12_to_nv12 */ if (srcFormat == PIX_FMT_YUV420P && (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21)) |