Mercurial > mplayer.hg
comparison libswscale/swscale.c @ 27515:9355343a7721
Fix jpeg yuv.
Fixes issue504.
author | michael |
---|---|
date | Mon, 08 Sep 2008 12:36:38 +0000 |
parents | 2550d0c5bcb6 |
children | f515e8a1273c |
comparison
equal
deleted
inserted
replaced
27514:fa98d451036f | 27515:9355343a7721 |
---|---|
1982 int64_t cgu = -inv_table[2]; | 1982 int64_t cgu = -inv_table[2]; |
1983 int64_t cgv = -inv_table[3]; | 1983 int64_t cgv = -inv_table[3]; |
1984 int64_t cy = 1<<16; | 1984 int64_t cy = 1<<16; |
1985 int64_t oy = 0; | 1985 int64_t oy = 0; |
1986 | 1986 |
1987 if (isYUV(c->dstFormat) || isGray(c->dstFormat)) return -1; | |
1988 memcpy(c->srcColorspaceTable, inv_table, sizeof(int)*4); | 1987 memcpy(c->srcColorspaceTable, inv_table, sizeof(int)*4); |
1989 memcpy(c->dstColorspaceTable, table, sizeof(int)*4); | 1988 memcpy(c->dstColorspaceTable, table, sizeof(int)*4); |
1990 | 1989 |
1991 c->brightness= brightness; | 1990 c->brightness= brightness; |
1992 c->contrast = contrast; | 1991 c->contrast = contrast; |
1993 c->saturation= saturation; | 1992 c->saturation= saturation; |
1994 c->srcRange = srcRange; | 1993 c->srcRange = srcRange; |
1995 c->dstRange = dstRange; | 1994 c->dstRange = dstRange; |
1995 if (isYUV(c->dstFormat) || isGray(c->dstFormat)) return 0; | |
1996 | 1996 |
1997 c->uOffset= 0x0400040004000400LL; | 1997 c->uOffset= 0x0400040004000400LL; |
1998 c->vOffset= 0x0400040004000400LL; | 1998 c->vOffset= 0x0400040004000400LL; |
1999 | 1999 |
2000 if (!srcRange){ | 2000 if (!srcRange){ |
2211 c->chrDstH= -((-dstH) >> c->chrDstVSubSample); | 2211 c->chrDstH= -((-dstH) >> c->chrDstVSubSample); |
2212 | 2212 |
2213 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); | 2213 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); |
2214 | 2214 |
2215 /* unscaled special Cases */ | 2215 /* unscaled special Cases */ |
2216 if (unscaled && !usesHFilter && !usesVFilter) | 2216 if (unscaled && !usesHFilter && !usesVFilter && (srcRange == dstRange || isBGR(dstFormat) || isRGB(dstFormat))) |
2217 { | 2217 { |
2218 /* yv12_to_nv12 */ | 2218 /* yv12_to_nv12 */ |
2219 if (srcFormat == PIX_FMT_YUV420P && (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21)) | 2219 if (srcFormat == PIX_FMT_YUV420P && (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21)) |
2220 { | 2220 { |
2221 c->swScale= PlanarToNV12Wrapper; | 2221 c->swScale= PlanarToNV12Wrapper; |