diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2013-09-12 12:23:35 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2013-09-12 12:27:19 +0200 |
commit | 58e6f33e3544a12ced84e6c78a11aaec5c492f82 (patch) | |
tree | f32afcc732882c8be719bc0759f705ab0e9d4d86 | |
parent | 1ede4551992106f011c8109ea08432d7a06e3dc0 (diff) |
videoscale: fix 4tap for RGB15 and RGB16
Fix component ordering, it's wrong in both the scanline and merge
function so it cancels eachother out and isn't really a except for
loss of precision of the green component.
Fix calculation of the filter weight
-rw-r--r-- | gst/videoscale/vs_4tap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gst/videoscale/vs_4tap.c b/gst/videoscale/vs_4tap.c index 743cfcfcb..7097ad7d3 100644 --- a/gst/videoscale/vs_4tap.c +++ b/gst/videoscale/vs_4tap.c @@ -1028,7 +1028,7 @@ vs_scanline_resample_4tap_RGB565 (uint8_t * dest_u8, uint8_t * src_u8, acc = *xacc; for (i = 0; i < n; i++) { j = acc >> 16; - x = acc & 0xffff >> 8; + x = (acc & 0xffff) >> 8; if (j - 1 >= 0 && j + 2 < src_width) { y = vs_4tap_taps[x][0] * RGB565_R (src[(j - 1)]); @@ -1081,7 +1081,7 @@ vs_scanline_resample_4tap_RGB565 (uint8_t * dest_u8, uint8_t * src_u8, y += (1 << (SHIFT - 1)); y_b = CLAMP (y >> SHIFT, 0, 255); - dest[i] = RGB565 (y_r, y_b, y_g); + dest[i] = RGB565 (y_r, y_g, y_b); acc += increment; } *xacc = acc; @@ -1128,7 +1128,7 @@ vs_scanline_merge_4tap_RGB565 (uint8_t * dest_u8, uint8_t * src1_u8, y += (1 << (SHIFT - 1)); y_b = CLAMP (y >> SHIFT, 0, 255); - dest[i] = RGB565 (y_r, y_b, y_g); + dest[i] = RGB565 (y_r, y_g, y_b); } } @@ -1213,7 +1213,7 @@ vs_scanline_resample_4tap_RGB555 (uint8_t * dest_u8, uint8_t * src_u8, acc = *xacc; for (i = 0; i < n; i++) { j = acc >> 16; - x = acc & 0xffff >> 8; + x = (acc & 0xffff) >> 8; if (j - 1 >= 0 && j + 2 < src_width) { y = vs_4tap_taps[x][0] * RGB555_R (src[(j - 1)]); @@ -1266,7 +1266,7 @@ vs_scanline_resample_4tap_RGB555 (uint8_t * dest_u8, uint8_t * src_u8, y += (1 << (SHIFT - 1)); y_b = CLAMP (y >> SHIFT, 0, 255); - dest[i] = RGB555 (y_r, y_b, y_g); + dest[i] = RGB555 (y_r, y_g, y_b); acc += increment; } *xacc = acc; @@ -1313,7 +1313,7 @@ vs_scanline_merge_4tap_RGB555 (uint8_t * dest_u8, uint8_t * src1_u8, y += (1 << (SHIFT - 1)); y_b = CLAMP (y >> SHIFT, 0, 255); - dest[i] = RGB555 (y_r, y_b, y_g); + dest[i] = RGB555 (y_r, y_g, y_b); } } |