Revision aa21f0c3 postproc/rgb2rgb_template.c

View differences:

postproc/rgb2rgb_template.c
916 916
			unsigned int g= src[6*i+1];
917 917
			unsigned int r= src[6*i+2];
918 918

  
919
			unsigned int Y  =  RY*r + GY*g + BY*b + 16;
920
			unsigned int V  =  RV*r + GV*g + BV*b + 128;
921
			unsigned int U  =  RU*r + GU*g + BU*b + 128;
919
			unsigned int Y  =  ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16;
920
			unsigned int V  =  ((RV*r + GV*g + BV*b)>>RGB2YUV_SHIFT) + 128;
921
			unsigned int U  =  ((RU*r + GU*g + BU*b)>>RGB2YUV_SHIFT) + 128;
922 922

  
923 923
			udst[i] 	= U;
924 924
			vdst[i] 	= V;
......
928 928
			g= src[6*i+4];
929 929
			r= src[6*i+5];
930 930

  
931
			Y  =  RY*r + GY*g + BY*b + 16;
931
			Y  =  ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16;
932 932
			ydst[2*i+1] 	= Y;
933 933
		}
934 934
		ydst += lumStride;
......
940 940
			unsigned int g= src[6*i+1];
941 941
			unsigned int r= src[6*i+2];
942 942

  
943
			unsigned int Y  =  RY*r + GY*g + BY*b + 16;
943
			unsigned int Y  =  ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16;
944 944

  
945 945
			ydst[2*i] 	= Y;
946 946

  
......
948 948
			g= src[6*i+4];
949 949
			r= src[6*i+5];
950 950

  
951
			Y  =  RY*r + GY*g + BY*b + 16;
951
			Y  =  ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16;
952 952
			ydst[2*i+1] 	= Y;
953 953
		}
954 954
		udst += chromStride;

Also available in: Unified diff