fix full range (jpeg yuv) chroma
Originally committed as revision 22713 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
This commit is contained in:
parent
d2bfaf8aae
commit
edf97a75f9
@ -1876,7 +1876,12 @@ int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4], int srcRange
|
|||||||
if(!srcRange){
|
if(!srcRange){
|
||||||
cy= (cy*255) / 219;
|
cy= (cy*255) / 219;
|
||||||
oy= 16<<16;
|
oy= 16<<16;
|
||||||
}
|
}else{
|
||||||
|
crv= (crv*224) / 255;
|
||||||
|
cbu= (cbu*224) / 255;
|
||||||
|
cgu= (cgu*224) / 255;
|
||||||
|
cgv= (cgv*224) / 255;
|
||||||
|
}
|
||||||
|
|
||||||
cy = (cy *contrast )>>16;
|
cy = (cy *contrast )>>16;
|
||||||
crv= (crv*contrast * saturation)>>32;
|
crv= (crv*contrast * saturation)>>32;
|
||||||
|
@ -670,6 +670,11 @@ int yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange,
|
|||||||
if(!fullRange){
|
if(!fullRange){
|
||||||
cy= (cy*255) / 219;
|
cy= (cy*255) / 219;
|
||||||
oy= 16<<16;
|
oy= 16<<16;
|
||||||
|
}else{
|
||||||
|
crv= (crv*224) / 255;
|
||||||
|
cbu= (cbu*224) / 255;
|
||||||
|
cgu= (cgu*224) / 255;
|
||||||
|
cgv= (cgv*224) / 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
cy = (cy *contrast )>>16;
|
cy = (cy *contrast )>>16;
|
||||||
|
@ -263,6 +263,11 @@ int yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], int fullRange,
|
|||||||
if (fullRange) {
|
if (fullRange) {
|
||||||
cy = 1 << 16;
|
cy = 1 << 16;
|
||||||
oy = 0;
|
oy = 0;
|
||||||
|
crv= (crv*224) / 255;
|
||||||
|
cbu= (cbu*224) / 255;
|
||||||
|
cgu= (cgu*224) / 255;
|
||||||
|
cgv= (cgv*224) / 255;
|
||||||
|
//FIXME maybe its cleaner if the tables where based on full range (*244/255)
|
||||||
} else {
|
} else {
|
||||||
cy = ((1 << 16) * 255) / 219;
|
cy = ((1 << 16) * 255) / 219;
|
||||||
oy= 16 << 16;
|
oy= 16 << 16;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user