comparison libswscale/swscale.c @ 28460:12c0dfccf149

Give better name to Inverse_Table_6_9
author kostya
date Mon, 09 Feb 2009 14:17:30 +0000
parents 7d49f24cc18f
children 75586eb0750d
comparison
equal deleted inserted replaced
28459:a00a5fff66ac 28460:12c0dfccf149
172 #define GU (-(int)(0.331*224/255*(1<<RGB2YUV_SHIFT)+0.5)) 172 #define GU (-(int)(0.331*224/255*(1<<RGB2YUV_SHIFT)+0.5))
173 #define RY ( (int)(0.299*219/255*(1<<RGB2YUV_SHIFT)+0.5)) 173 #define RY ( (int)(0.299*219/255*(1<<RGB2YUV_SHIFT)+0.5))
174 #define RV ( (int)(0.500*224/255*(1<<RGB2YUV_SHIFT)+0.5)) 174 #define RV ( (int)(0.500*224/255*(1<<RGB2YUV_SHIFT)+0.5))
175 #define RU (-(int)(0.169*224/255*(1<<RGB2YUV_SHIFT)+0.5)) 175 #define RU (-(int)(0.169*224/255*(1<<RGB2YUV_SHIFT)+0.5))
176 176
177 extern const int32_t Inverse_Table_6_9[8][4]; 177 extern const int32_t ff_yuv2rgb_coeffs[8][4];
178 178
179 static const double rgb2yuv_table[8][9]={ 179 static const double rgb2yuv_table[8][9]={
180 {0.7152, 0.0722, 0.2126, -0.386, 0.5, -0.115, -0.454, -0.046, 0.5}, 180 {0.7152, 0.0722, 0.2126, -0.386, 0.5, -0.115, -0.454, -0.046, 0.5},
181 {0.7152, 0.0722, 0.2126, -0.386, 0.5, -0.115, -0.454, -0.046, 0.5}, 181 {0.7152, 0.0722, 0.2126, -0.386, 0.5, -0.115, -0.454, -0.046, 0.5},
182 {0.587 , 0.114 , 0.299 , -0.331, 0.5, -0.169, -0.419, -0.081, 0.5}, 182 {0.587 , 0.114 , 0.299 , -0.331, 0.5, -0.169, -0.419, -0.081, 0.5},
2074 else if (r> 0x7FFF) return 0x7FFF; 2074 else if (r> 0x7FFF) return 0x7FFF;
2075 else return r; 2075 else return r;
2076 } 2076 }
2077 2077
2078 /** 2078 /**
2079 * @param inv_table the yuv2rgb coefficients, normally Inverse_Table_6_9[x] 2079 * @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x]
2080 * @param fullRange if 1 then the luma range is 0..255 if 0 it is 16..235 2080 * @param fullRange if 1 then the luma range is 0..255 if 0 it is 16..235
2081 * @return -1 if not supported 2081 * @return -1 if not supported
2082 */ 2082 */
2083 int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation){ 2083 int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation){
2084 int64_t crv = inv_table[0]; 2084 int64_t crv = inv_table[0];
2319 c->chrSrcW= -((-srcW) >> c->chrSrcHSubSample); 2319 c->chrSrcW= -((-srcW) >> c->chrSrcHSubSample);
2320 c->chrSrcH= -((-srcH) >> c->chrSrcVSubSample); 2320 c->chrSrcH= -((-srcH) >> c->chrSrcVSubSample);
2321 c->chrDstW= -((-dstW) >> c->chrDstHSubSample); 2321 c->chrDstW= -((-dstW) >> c->chrDstHSubSample);
2322 c->chrDstH= -((-dstH) >> c->chrDstVSubSample); 2322 c->chrDstH= -((-dstH) >> c->chrDstVSubSample);
2323 2323
2324 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); 2324 sws_setColorspaceDetails(c, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT], srcRange, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT] /* FIXME*/, dstRange, 0, 1<<16, 1<<16);
2325 2325
2326 /* unscaled special cases */ 2326 /* unscaled special cases */
2327 if (unscaled && !usesHFilter && !usesVFilter && (srcRange == dstRange || isBGR(dstFormat) || isRGB(dstFormat))) 2327 if (unscaled && !usesHFilter && !usesVFilter && (srcRange == dstRange || isBGR(dstFormat) || isRGB(dstFormat)))
2328 { 2328 {
2329 /* yv12_to_nv12 */ 2329 /* yv12_to_nv12 */