File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Userland/Libraries/LibGfx/ImageFormats Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -186,9 +186,9 @@ class JPEGEncodingContext {
186186 // Conversion from YCbCr to RGB isn't specified in the first JPEG specification but in the JFIF extension:
187187 // See: https://www.itu.int/rec/dologin_pub.asp?lang=f&id=T-REC-T.871-201105-I!!PDF-E&type=items
188188 // 7 - Conversion to and from RGB
189- auto const y_ = clamp ( 0 .299f * r + 0 .587f * g + 0 .114f * b, 0 , 255 ) ;
190- auto const cb = clamp ( -0 .1687f * r - 0 .3313f * g + 0 .5f * b + 128 , 0 , 255 ) ;
191- auto const cr = clamp ( 0 .5f * r - 0 .4187f * g - 0 .0813f * b + 128 , 0 , 255 ) ;
189+ auto const y_ = 0 .299f * r + 0 .587f * g + 0 .114f * b;
190+ auto const cb = -0 .1687f * r - 0 .3313f * g + 0 .5f * b + 128 ;
191+ auto const cr = 0 .5f * r - 0 .4187f * g - 0 .0813f * b + 128 ;
192192
193193 // A.3.1 - Level shift
194194 macroblock.y [i] = y_ - 128 ;
You can’t perform that action at this time.
0 commit comments