File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2786,6 +2786,25 @@ Op_RRGGBBxx_HDR_to_YCbCr420::convert_colorspace(const std::shared_ptr<const Heif
2786
2786
float g = static_cast <float >((in[2 + le] << 8 ) | in[3 - le]);
2787
2787
float b = static_cast <float >((in[4 + le] << 8 ) | in[5 - le]);
2788
2788
2789
+ int dx = (x + 1 < width) ? bytesPerPixel : 0 ;
2790
+ int dy = (y + 1 < height) ? in_p_stride : 0 ;
2791
+
2792
+ r += static_cast <float >((in[0 + le + dx] << 8 ) | in[1 - le + dx]);
2793
+ g += static_cast <float >((in[2 + le + dx] << 8 ) | in[3 - le + dx]);
2794
+ b += static_cast <float >((in[4 + le + dx] << 8 ) | in[5 - le + dx]);
2795
+
2796
+ r += static_cast <float >((in[0 + le + dy] << 8 ) | in[1 - le + dy]);
2797
+ g += static_cast <float >((in[2 + le + dy] << 8 ) | in[3 - le + dy]);
2798
+ b += static_cast <float >((in[4 + le + dy] << 8 ) | in[5 - le + dy]);
2799
+
2800
+ r += static_cast <float >((in[0 + le + dx + dy] << 8 ) | in[1 - le + dx + dy]);
2801
+ g += static_cast <float >((in[2 + le + dx + dy] << 8 ) | in[3 - le + dx + dy]);
2802
+ b += static_cast <float >((in[4 + le + dx + dy] << 8 ) | in[5 - le + dx + dy]);
2803
+
2804
+ r *= 0 .25f ;
2805
+ g *= 0 .25f ;
2806
+ b *= 0 .25f ;
2807
+
2789
2808
float cb = r * coeffs.c [1 ][0 ] + g * coeffs.c [1 ][1 ] + b * coeffs.c [1 ][2 ];
2790
2809
float cr = r * coeffs.c [2 ][0 ] + g * coeffs.c [2 ][1 ] + b * coeffs.c [2 ][2 ];
2791
2810
You can’t perform that action at this time.
0 commit comments