diff --git a/draw/gen.go b/draw/gen.go index 42505a5..4ce213a 100644 --- a/draw/gen.go +++ b/draw/gen.go @@ -804,7 +804,7 @@ func cOffset(x, y, sratio string) string { func ycbcrToRGB(lhs, tmp string) string { s := ` // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - $yy1 := int(src.Y[$i])<<16 + 1<<15 + $yy1 := int(src.Y[$i]) * 0x10100 $cb1 := int(src.Cb[$j]) - 128 $cr1 := int(src.Cr[$j]) - 128 $r@ := ($yy1 + 91881*$cr1) >> 8 diff --git a/draw/impl.go b/draw/impl.go index 13274fa..fa93d64 100644 --- a/draw/impl.go +++ b/draw/impl.go @@ -327,7 +327,7 @@ func (nnInterpolator) scale_RGBA_YCbCr444_Src(dst *image.RGBA, dr, adr image.Rec pj := (sr.Min.Y+int(sy)-src.Rect.Min.Y)*src.CStride + (sr.Min.X + int(sx) - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - pyy1 := int(src.Y[pi])<<16 + 1<<15 + pyy1 := int(src.Y[pi]) * 0x10100 pcb1 := int(src.Cb[pj]) - 128 pcr1 := int(src.Cr[pj]) - 128 pr := (pyy1 + 91881*pcr1) >> 8 @@ -370,7 +370,7 @@ func (nnInterpolator) scale_RGBA_YCbCr422_Src(dst *image.RGBA, dr, adr image.Rec pj := (sr.Min.Y+int(sy)-src.Rect.Min.Y)*src.CStride + ((sr.Min.X+int(sx))/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - pyy1 := int(src.Y[pi])<<16 + 1<<15 + pyy1 := int(src.Y[pi]) * 0x10100 pcb1 := int(src.Cb[pj]) - 128 pcr1 := int(src.Cr[pj]) - 128 pr := (pyy1 + 91881*pcr1) >> 8 @@ -413,7 +413,7 @@ func (nnInterpolator) scale_RGBA_YCbCr420_Src(dst *image.RGBA, dr, adr image.Rec pj := ((sr.Min.Y+int(sy))/2-src.Rect.Min.Y/2)*src.CStride + ((sr.Min.X+int(sx))/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - pyy1 := int(src.Y[pi])<<16 + 1<<15 + pyy1 := int(src.Y[pi]) * 0x10100 pcb1 := int(src.Cb[pj]) - 128 pcr1 := int(src.Cr[pj]) - 128 pr := (pyy1 + 91881*pcr1) >> 8 @@ -456,7 +456,7 @@ func (nnInterpolator) scale_RGBA_YCbCr440_Src(dst *image.RGBA, dr, adr image.Rec pj := ((sr.Min.Y+int(sy))/2-src.Rect.Min.Y/2)*src.CStride + (sr.Min.X + int(sx) - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - pyy1 := int(src.Y[pi])<<16 + 1<<15 + pyy1 := int(src.Y[pi]) * 0x10100 pcb1 := int(src.Cb[pj]) - 128 pcr1 := int(src.Cr[pj]) - 128 pr := (pyy1 + 91881*pcr1) >> 8 @@ -743,7 +743,7 @@ func (nnInterpolator) transform_RGBA_YCbCr444_Src(dst *image.RGBA, dr, adr image pj := (sy0-src.Rect.Min.Y)*src.CStride + (sx0 - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - pyy1 := int(src.Y[pi])<<16 + 1<<15 + pyy1 := int(src.Y[pi]) * 0x10100 pcb1 := int(src.Cb[pj]) - 128 pcr1 := int(src.Cr[pj]) - 128 pr := (pyy1 + 91881*pcr1) >> 8 @@ -787,7 +787,7 @@ func (nnInterpolator) transform_RGBA_YCbCr422_Src(dst *image.RGBA, dr, adr image pj := (sy0-src.Rect.Min.Y)*src.CStride + ((sx0)/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - pyy1 := int(src.Y[pi])<<16 + 1<<15 + pyy1 := int(src.Y[pi]) * 0x10100 pcb1 := int(src.Cb[pj]) - 128 pcr1 := int(src.Cr[pj]) - 128 pr := (pyy1 + 91881*pcr1) >> 8 @@ -831,7 +831,7 @@ func (nnInterpolator) transform_RGBA_YCbCr420_Src(dst *image.RGBA, dr, adr image pj := ((sy0)/2-src.Rect.Min.Y/2)*src.CStride + ((sx0)/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - pyy1 := int(src.Y[pi])<<16 + 1<<15 + pyy1 := int(src.Y[pi]) * 0x10100 pcb1 := int(src.Cb[pj]) - 128 pcr1 := int(src.Cr[pj]) - 128 pr := (pyy1 + 91881*pcr1) >> 8 @@ -875,7 +875,7 @@ func (nnInterpolator) transform_RGBA_YCbCr440_Src(dst *image.RGBA, dr, adr image pj := ((sy0)/2-src.Rect.Min.Y/2)*src.CStride + (sx0 - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - pyy1 := int(src.Y[pi])<<16 + 1<<15 + pyy1 := int(src.Y[pi]) * 0x10100 pcb1 := int(src.Cb[pj]) - 128 pcr1 := int(src.Cr[pj]) - 128 pr := (pyy1 + 91881*pcr1) >> 8 @@ -1724,7 +1724,7 @@ func (ablInterpolator) scale_RGBA_YCbCr444_Src(dst *image.RGBA, dr, adr image.Re s00j := (sr.Min.Y+int(sy0)-src.Rect.Min.Y)*src.CStride + (sr.Min.X + int(sx0) - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s00yy1 := int(src.Y[s00i])<<16 + 1<<15 + s00yy1 := int(src.Y[s00i]) * 0x10100 s00cb1 := int(src.Cb[s00j]) - 128 s00cr1 := int(src.Cr[s00j]) - 128 s00ru := (s00yy1 + 91881*s00cr1) >> 8 @@ -1753,7 +1753,7 @@ func (ablInterpolator) scale_RGBA_YCbCr444_Src(dst *image.RGBA, dr, adr image.Re s10j := (sr.Min.Y+int(sy0)-src.Rect.Min.Y)*src.CStride + (sr.Min.X + int(sx1) - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s10yy1 := int(src.Y[s10i])<<16 + 1<<15 + s10yy1 := int(src.Y[s10i]) * 0x10100 s10cb1 := int(src.Cb[s10j]) - 128 s10cr1 := int(src.Cr[s10j]) - 128 s10ru := (s10yy1 + 91881*s10cr1) >> 8 @@ -1785,7 +1785,7 @@ func (ablInterpolator) scale_RGBA_YCbCr444_Src(dst *image.RGBA, dr, adr image.Re s01j := (sr.Min.Y+int(sy1)-src.Rect.Min.Y)*src.CStride + (sr.Min.X + int(sx0) - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s01yy1 := int(src.Y[s01i])<<16 + 1<<15 + s01yy1 := int(src.Y[s01i]) * 0x10100 s01cb1 := int(src.Cb[s01j]) - 128 s01cr1 := int(src.Cr[s01j]) - 128 s01ru := (s01yy1 + 91881*s01cr1) >> 8 @@ -1814,7 +1814,7 @@ func (ablInterpolator) scale_RGBA_YCbCr444_Src(dst *image.RGBA, dr, adr image.Re s11j := (sr.Min.Y+int(sy1)-src.Rect.Min.Y)*src.CStride + (sr.Min.X + int(sx1) - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s11yy1 := int(src.Y[s11i])<<16 + 1<<15 + s11yy1 := int(src.Y[s11i]) * 0x10100 s11cb1 := int(src.Cb[s11j]) - 128 s11cr1 := int(src.Cr[s11j]) - 128 s11ru := (s11yy1 + 91881*s11cr1) >> 8 @@ -1899,7 +1899,7 @@ func (ablInterpolator) scale_RGBA_YCbCr422_Src(dst *image.RGBA, dr, adr image.Re s00j := (sr.Min.Y+int(sy0)-src.Rect.Min.Y)*src.CStride + ((sr.Min.X+int(sx0))/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s00yy1 := int(src.Y[s00i])<<16 + 1<<15 + s00yy1 := int(src.Y[s00i]) * 0x10100 s00cb1 := int(src.Cb[s00j]) - 128 s00cr1 := int(src.Cr[s00j]) - 128 s00ru := (s00yy1 + 91881*s00cr1) >> 8 @@ -1928,7 +1928,7 @@ func (ablInterpolator) scale_RGBA_YCbCr422_Src(dst *image.RGBA, dr, adr image.Re s10j := (sr.Min.Y+int(sy0)-src.Rect.Min.Y)*src.CStride + ((sr.Min.X+int(sx1))/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s10yy1 := int(src.Y[s10i])<<16 + 1<<15 + s10yy1 := int(src.Y[s10i]) * 0x10100 s10cb1 := int(src.Cb[s10j]) - 128 s10cr1 := int(src.Cr[s10j]) - 128 s10ru := (s10yy1 + 91881*s10cr1) >> 8 @@ -1960,7 +1960,7 @@ func (ablInterpolator) scale_RGBA_YCbCr422_Src(dst *image.RGBA, dr, adr image.Re s01j := (sr.Min.Y+int(sy1)-src.Rect.Min.Y)*src.CStride + ((sr.Min.X+int(sx0))/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s01yy1 := int(src.Y[s01i])<<16 + 1<<15 + s01yy1 := int(src.Y[s01i]) * 0x10100 s01cb1 := int(src.Cb[s01j]) - 128 s01cr1 := int(src.Cr[s01j]) - 128 s01ru := (s01yy1 + 91881*s01cr1) >> 8 @@ -1989,7 +1989,7 @@ func (ablInterpolator) scale_RGBA_YCbCr422_Src(dst *image.RGBA, dr, adr image.Re s11j := (sr.Min.Y+int(sy1)-src.Rect.Min.Y)*src.CStride + ((sr.Min.X+int(sx1))/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s11yy1 := int(src.Y[s11i])<<16 + 1<<15 + s11yy1 := int(src.Y[s11i]) * 0x10100 s11cb1 := int(src.Cb[s11j]) - 128 s11cr1 := int(src.Cr[s11j]) - 128 s11ru := (s11yy1 + 91881*s11cr1) >> 8 @@ -2074,7 +2074,7 @@ func (ablInterpolator) scale_RGBA_YCbCr420_Src(dst *image.RGBA, dr, adr image.Re s00j := ((sr.Min.Y+int(sy0))/2-src.Rect.Min.Y/2)*src.CStride + ((sr.Min.X+int(sx0))/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s00yy1 := int(src.Y[s00i])<<16 + 1<<15 + s00yy1 := int(src.Y[s00i]) * 0x10100 s00cb1 := int(src.Cb[s00j]) - 128 s00cr1 := int(src.Cr[s00j]) - 128 s00ru := (s00yy1 + 91881*s00cr1) >> 8 @@ -2103,7 +2103,7 @@ func (ablInterpolator) scale_RGBA_YCbCr420_Src(dst *image.RGBA, dr, adr image.Re s10j := ((sr.Min.Y+int(sy0))/2-src.Rect.Min.Y/2)*src.CStride + ((sr.Min.X+int(sx1))/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s10yy1 := int(src.Y[s10i])<<16 + 1<<15 + s10yy1 := int(src.Y[s10i]) * 0x10100 s10cb1 := int(src.Cb[s10j]) - 128 s10cr1 := int(src.Cr[s10j]) - 128 s10ru := (s10yy1 + 91881*s10cr1) >> 8 @@ -2135,7 +2135,7 @@ func (ablInterpolator) scale_RGBA_YCbCr420_Src(dst *image.RGBA, dr, adr image.Re s01j := ((sr.Min.Y+int(sy1))/2-src.Rect.Min.Y/2)*src.CStride + ((sr.Min.X+int(sx0))/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s01yy1 := int(src.Y[s01i])<<16 + 1<<15 + s01yy1 := int(src.Y[s01i]) * 0x10100 s01cb1 := int(src.Cb[s01j]) - 128 s01cr1 := int(src.Cr[s01j]) - 128 s01ru := (s01yy1 + 91881*s01cr1) >> 8 @@ -2164,7 +2164,7 @@ func (ablInterpolator) scale_RGBA_YCbCr420_Src(dst *image.RGBA, dr, adr image.Re s11j := ((sr.Min.Y+int(sy1))/2-src.Rect.Min.Y/2)*src.CStride + ((sr.Min.X+int(sx1))/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s11yy1 := int(src.Y[s11i])<<16 + 1<<15 + s11yy1 := int(src.Y[s11i]) * 0x10100 s11cb1 := int(src.Cb[s11j]) - 128 s11cr1 := int(src.Cr[s11j]) - 128 s11ru := (s11yy1 + 91881*s11cr1) >> 8 @@ -2249,7 +2249,7 @@ func (ablInterpolator) scale_RGBA_YCbCr440_Src(dst *image.RGBA, dr, adr image.Re s00j := ((sr.Min.Y+int(sy0))/2-src.Rect.Min.Y/2)*src.CStride + (sr.Min.X + int(sx0) - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s00yy1 := int(src.Y[s00i])<<16 + 1<<15 + s00yy1 := int(src.Y[s00i]) * 0x10100 s00cb1 := int(src.Cb[s00j]) - 128 s00cr1 := int(src.Cr[s00j]) - 128 s00ru := (s00yy1 + 91881*s00cr1) >> 8 @@ -2278,7 +2278,7 @@ func (ablInterpolator) scale_RGBA_YCbCr440_Src(dst *image.RGBA, dr, adr image.Re s10j := ((sr.Min.Y+int(sy0))/2-src.Rect.Min.Y/2)*src.CStride + (sr.Min.X + int(sx1) - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s10yy1 := int(src.Y[s10i])<<16 + 1<<15 + s10yy1 := int(src.Y[s10i]) * 0x10100 s10cb1 := int(src.Cb[s10j]) - 128 s10cr1 := int(src.Cr[s10j]) - 128 s10ru := (s10yy1 + 91881*s10cr1) >> 8 @@ -2310,7 +2310,7 @@ func (ablInterpolator) scale_RGBA_YCbCr440_Src(dst *image.RGBA, dr, adr image.Re s01j := ((sr.Min.Y+int(sy1))/2-src.Rect.Min.Y/2)*src.CStride + (sr.Min.X + int(sx0) - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s01yy1 := int(src.Y[s01i])<<16 + 1<<15 + s01yy1 := int(src.Y[s01i]) * 0x10100 s01cb1 := int(src.Cb[s01j]) - 128 s01cr1 := int(src.Cr[s01j]) - 128 s01ru := (s01yy1 + 91881*s01cr1) >> 8 @@ -2339,7 +2339,7 @@ func (ablInterpolator) scale_RGBA_YCbCr440_Src(dst *image.RGBA, dr, adr image.Re s11j := ((sr.Min.Y+int(sy1))/2-src.Rect.Min.Y/2)*src.CStride + (sr.Min.X + int(sx1) - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s11yy1 := int(src.Y[s11i])<<16 + 1<<15 + s11yy1 := int(src.Y[s11i]) * 0x10100 s11cb1 := int(src.Cb[s11j]) - 128 s11cr1 := int(src.Cr[s11j]) - 128 s11ru := (s11yy1 + 91881*s11cr1) >> 8 @@ -3313,7 +3313,7 @@ func (ablInterpolator) transform_RGBA_YCbCr444_Src(dst *image.RGBA, dr, adr imag s00j := (sy0-src.Rect.Min.Y)*src.CStride + (sx0 - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s00yy1 := int(src.Y[s00i])<<16 + 1<<15 + s00yy1 := int(src.Y[s00i]) * 0x10100 s00cb1 := int(src.Cb[s00j]) - 128 s00cr1 := int(src.Cr[s00j]) - 128 s00ru := (s00yy1 + 91881*s00cr1) >> 8 @@ -3342,7 +3342,7 @@ func (ablInterpolator) transform_RGBA_YCbCr444_Src(dst *image.RGBA, dr, adr imag s10j := (sy0-src.Rect.Min.Y)*src.CStride + (sx1 - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s10yy1 := int(src.Y[s10i])<<16 + 1<<15 + s10yy1 := int(src.Y[s10i]) * 0x10100 s10cb1 := int(src.Cb[s10j]) - 128 s10cr1 := int(src.Cr[s10j]) - 128 s10ru := (s10yy1 + 91881*s10cr1) >> 8 @@ -3374,7 +3374,7 @@ func (ablInterpolator) transform_RGBA_YCbCr444_Src(dst *image.RGBA, dr, adr imag s01j := (sy1-src.Rect.Min.Y)*src.CStride + (sx0 - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s01yy1 := int(src.Y[s01i])<<16 + 1<<15 + s01yy1 := int(src.Y[s01i]) * 0x10100 s01cb1 := int(src.Cb[s01j]) - 128 s01cr1 := int(src.Cr[s01j]) - 128 s01ru := (s01yy1 + 91881*s01cr1) >> 8 @@ -3403,7 +3403,7 @@ func (ablInterpolator) transform_RGBA_YCbCr444_Src(dst *image.RGBA, dr, adr imag s11j := (sy1-src.Rect.Min.Y)*src.CStride + (sx1 - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s11yy1 := int(src.Y[s11i])<<16 + 1<<15 + s11yy1 := int(src.Y[s11i]) * 0x10100 s11cb1 := int(src.Cb[s11j]) - 128 s11cr1 := int(src.Cr[s11j]) - 128 s11ru := (s11yy1 + 91881*s11cr1) >> 8 @@ -3489,7 +3489,7 @@ func (ablInterpolator) transform_RGBA_YCbCr422_Src(dst *image.RGBA, dr, adr imag s00j := (sy0-src.Rect.Min.Y)*src.CStride + ((sx0)/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s00yy1 := int(src.Y[s00i])<<16 + 1<<15 + s00yy1 := int(src.Y[s00i]) * 0x10100 s00cb1 := int(src.Cb[s00j]) - 128 s00cr1 := int(src.Cr[s00j]) - 128 s00ru := (s00yy1 + 91881*s00cr1) >> 8 @@ -3518,7 +3518,7 @@ func (ablInterpolator) transform_RGBA_YCbCr422_Src(dst *image.RGBA, dr, adr imag s10j := (sy0-src.Rect.Min.Y)*src.CStride + ((sx1)/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s10yy1 := int(src.Y[s10i])<<16 + 1<<15 + s10yy1 := int(src.Y[s10i]) * 0x10100 s10cb1 := int(src.Cb[s10j]) - 128 s10cr1 := int(src.Cr[s10j]) - 128 s10ru := (s10yy1 + 91881*s10cr1) >> 8 @@ -3550,7 +3550,7 @@ func (ablInterpolator) transform_RGBA_YCbCr422_Src(dst *image.RGBA, dr, adr imag s01j := (sy1-src.Rect.Min.Y)*src.CStride + ((sx0)/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s01yy1 := int(src.Y[s01i])<<16 + 1<<15 + s01yy1 := int(src.Y[s01i]) * 0x10100 s01cb1 := int(src.Cb[s01j]) - 128 s01cr1 := int(src.Cr[s01j]) - 128 s01ru := (s01yy1 + 91881*s01cr1) >> 8 @@ -3579,7 +3579,7 @@ func (ablInterpolator) transform_RGBA_YCbCr422_Src(dst *image.RGBA, dr, adr imag s11j := (sy1-src.Rect.Min.Y)*src.CStride + ((sx1)/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s11yy1 := int(src.Y[s11i])<<16 + 1<<15 + s11yy1 := int(src.Y[s11i]) * 0x10100 s11cb1 := int(src.Cb[s11j]) - 128 s11cr1 := int(src.Cr[s11j]) - 128 s11ru := (s11yy1 + 91881*s11cr1) >> 8 @@ -3665,7 +3665,7 @@ func (ablInterpolator) transform_RGBA_YCbCr420_Src(dst *image.RGBA, dr, adr imag s00j := ((sy0)/2-src.Rect.Min.Y/2)*src.CStride + ((sx0)/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s00yy1 := int(src.Y[s00i])<<16 + 1<<15 + s00yy1 := int(src.Y[s00i]) * 0x10100 s00cb1 := int(src.Cb[s00j]) - 128 s00cr1 := int(src.Cr[s00j]) - 128 s00ru := (s00yy1 + 91881*s00cr1) >> 8 @@ -3694,7 +3694,7 @@ func (ablInterpolator) transform_RGBA_YCbCr420_Src(dst *image.RGBA, dr, adr imag s10j := ((sy0)/2-src.Rect.Min.Y/2)*src.CStride + ((sx1)/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s10yy1 := int(src.Y[s10i])<<16 + 1<<15 + s10yy1 := int(src.Y[s10i]) * 0x10100 s10cb1 := int(src.Cb[s10j]) - 128 s10cr1 := int(src.Cr[s10j]) - 128 s10ru := (s10yy1 + 91881*s10cr1) >> 8 @@ -3726,7 +3726,7 @@ func (ablInterpolator) transform_RGBA_YCbCr420_Src(dst *image.RGBA, dr, adr imag s01j := ((sy1)/2-src.Rect.Min.Y/2)*src.CStride + ((sx0)/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s01yy1 := int(src.Y[s01i])<<16 + 1<<15 + s01yy1 := int(src.Y[s01i]) * 0x10100 s01cb1 := int(src.Cb[s01j]) - 128 s01cr1 := int(src.Cr[s01j]) - 128 s01ru := (s01yy1 + 91881*s01cr1) >> 8 @@ -3755,7 +3755,7 @@ func (ablInterpolator) transform_RGBA_YCbCr420_Src(dst *image.RGBA, dr, adr imag s11j := ((sy1)/2-src.Rect.Min.Y/2)*src.CStride + ((sx1)/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s11yy1 := int(src.Y[s11i])<<16 + 1<<15 + s11yy1 := int(src.Y[s11i]) * 0x10100 s11cb1 := int(src.Cb[s11j]) - 128 s11cr1 := int(src.Cr[s11j]) - 128 s11ru := (s11yy1 + 91881*s11cr1) >> 8 @@ -3841,7 +3841,7 @@ func (ablInterpolator) transform_RGBA_YCbCr440_Src(dst *image.RGBA, dr, adr imag s00j := ((sy0)/2-src.Rect.Min.Y/2)*src.CStride + (sx0 - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s00yy1 := int(src.Y[s00i])<<16 + 1<<15 + s00yy1 := int(src.Y[s00i]) * 0x10100 s00cb1 := int(src.Cb[s00j]) - 128 s00cr1 := int(src.Cr[s00j]) - 128 s00ru := (s00yy1 + 91881*s00cr1) >> 8 @@ -3870,7 +3870,7 @@ func (ablInterpolator) transform_RGBA_YCbCr440_Src(dst *image.RGBA, dr, adr imag s10j := ((sy0)/2-src.Rect.Min.Y/2)*src.CStride + (sx1 - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s10yy1 := int(src.Y[s10i])<<16 + 1<<15 + s10yy1 := int(src.Y[s10i]) * 0x10100 s10cb1 := int(src.Cb[s10j]) - 128 s10cr1 := int(src.Cr[s10j]) - 128 s10ru := (s10yy1 + 91881*s10cr1) >> 8 @@ -3902,7 +3902,7 @@ func (ablInterpolator) transform_RGBA_YCbCr440_Src(dst *image.RGBA, dr, adr imag s01j := ((sy1)/2-src.Rect.Min.Y/2)*src.CStride + (sx0 - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s01yy1 := int(src.Y[s01i])<<16 + 1<<15 + s01yy1 := int(src.Y[s01i]) * 0x10100 s01cb1 := int(src.Cb[s01j]) - 128 s01cr1 := int(src.Cr[s01j]) - 128 s01ru := (s01yy1 + 91881*s01cr1) >> 8 @@ -3931,7 +3931,7 @@ func (ablInterpolator) transform_RGBA_YCbCr440_Src(dst *image.RGBA, dr, adr imag s11j := ((sy1)/2-src.Rect.Min.Y/2)*src.CStride + (sx1 - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - s11yy1 := int(src.Y[s11i])<<16 + 1<<15 + s11yy1 := int(src.Y[s11i]) * 0x10100 s11cb1 := int(src.Cb[s11j]) - 128 s11cr1 := int(src.Cr[s11j]) - 128 s11ru := (s11yy1 + 91881*s11cr1) >> 8 @@ -4697,7 +4697,7 @@ func (z *kernelScaler) scaleX_YCbCr444(tmp [][4]float64, src *image.YCbCr, sr im pj := (sr.Min.Y+int(y)-src.Rect.Min.Y)*src.CStride + (sr.Min.X + int(c.coord) - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - pyy1 := int(src.Y[pi])<<16 + 1<<15 + pyy1 := int(src.Y[pi]) * 0x10100 pcb1 := int(src.Cb[pj]) - 128 pcr1 := int(src.Cr[pj]) - 128 pru := (pyy1 + 91881*pcr1) >> 8 @@ -4744,7 +4744,7 @@ func (z *kernelScaler) scaleX_YCbCr422(tmp [][4]float64, src *image.YCbCr, sr im pj := (sr.Min.Y+int(y)-src.Rect.Min.Y)*src.CStride + ((sr.Min.X+int(c.coord))/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - pyy1 := int(src.Y[pi])<<16 + 1<<15 + pyy1 := int(src.Y[pi]) * 0x10100 pcb1 := int(src.Cb[pj]) - 128 pcr1 := int(src.Cr[pj]) - 128 pru := (pyy1 + 91881*pcr1) >> 8 @@ -4791,7 +4791,7 @@ func (z *kernelScaler) scaleX_YCbCr420(tmp [][4]float64, src *image.YCbCr, sr im pj := ((sr.Min.Y+int(y))/2-src.Rect.Min.Y/2)*src.CStride + ((sr.Min.X+int(c.coord))/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - pyy1 := int(src.Y[pi])<<16 + 1<<15 + pyy1 := int(src.Y[pi]) * 0x10100 pcb1 := int(src.Cb[pj]) - 128 pcr1 := int(src.Cr[pj]) - 128 pru := (pyy1 + 91881*pcr1) >> 8 @@ -4838,7 +4838,7 @@ func (z *kernelScaler) scaleX_YCbCr440(tmp [][4]float64, src *image.YCbCr, sr im pj := ((sr.Min.Y+int(y))/2-src.Rect.Min.Y/2)*src.CStride + (sr.Min.X + int(c.coord) - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - pyy1 := int(src.Y[pi])<<16 + 1<<15 + pyy1 := int(src.Y[pi]) * 0x10100 pcb1 := int(src.Cb[pj]) - 128 pcr1 := int(src.Cr[pj]) - 128 pru := (pyy1 + 91881*pcr1) >> 8 @@ -5727,7 +5727,7 @@ func (q *Kernel) transform_RGBA_YCbCr444_Src(dst *image.RGBA, dr, adr image.Rect pj := (ky-src.Rect.Min.Y)*src.CStride + (kx - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - pyy1 := int(src.Y[pi])<<16 + 1<<15 + pyy1 := int(src.Y[pi]) * 0x10100 pcb1 := int(src.Cb[pj]) - 128 pcr1 := int(src.Cr[pj]) - 128 pru := (pyy1 + 91881*pcr1) >> 8 @@ -5851,7 +5851,7 @@ func (q *Kernel) transform_RGBA_YCbCr422_Src(dst *image.RGBA, dr, adr image.Rect pj := (ky-src.Rect.Min.Y)*src.CStride + ((kx)/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - pyy1 := int(src.Y[pi])<<16 + 1<<15 + pyy1 := int(src.Y[pi]) * 0x10100 pcb1 := int(src.Cb[pj]) - 128 pcr1 := int(src.Cr[pj]) - 128 pru := (pyy1 + 91881*pcr1) >> 8 @@ -5975,7 +5975,7 @@ func (q *Kernel) transform_RGBA_YCbCr420_Src(dst *image.RGBA, dr, adr image.Rect pj := ((ky)/2-src.Rect.Min.Y/2)*src.CStride + ((kx)/2 - src.Rect.Min.X/2) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - pyy1 := int(src.Y[pi])<<16 + 1<<15 + pyy1 := int(src.Y[pi]) * 0x10100 pcb1 := int(src.Cb[pj]) - 128 pcr1 := int(src.Cr[pj]) - 128 pru := (pyy1 + 91881*pcr1) >> 8 @@ -6099,7 +6099,7 @@ func (q *Kernel) transform_RGBA_YCbCr440_Src(dst *image.RGBA, dr, adr image.Rect pj := ((ky)/2-src.Rect.Min.Y/2)*src.CStride + (kx - src.Rect.Min.X) // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method. - pyy1 := int(src.Y[pi])<<16 + 1<<15 + pyy1 := int(src.Y[pi]) * 0x10100 pcb1 := int(src.Cb[pj]) - 128 pcr1 := int(src.Cr[pj]) - 128 pru := (pyy1 + 91881*pcr1) >> 8 diff --git a/testdata/go-turns-two-down-ab.png b/testdata/go-turns-two-down-ab.png index 62c2995..317c3af 100644 Binary files a/testdata/go-turns-two-down-ab.png and b/testdata/go-turns-two-down-ab.png differ diff --git a/testdata/go-turns-two-down-bl.png b/testdata/go-turns-two-down-bl.png index 280af36..597d362 100644 Binary files a/testdata/go-turns-two-down-bl.png and b/testdata/go-turns-two-down-bl.png differ diff --git a/testdata/go-turns-two-down-cr.png b/testdata/go-turns-two-down-cr.png index ef00abe..ad1c20a 100644 Binary files a/testdata/go-turns-two-down-cr.png and b/testdata/go-turns-two-down-cr.png differ diff --git a/testdata/go-turns-two-down-nn.png b/testdata/go-turns-two-down-nn.png index 2e385da..166841a 100644 Binary files a/testdata/go-turns-two-down-nn.png and b/testdata/go-turns-two-down-nn.png differ