From d8eeba3aed554831d8a8b8722ab61b513d8e3c48 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Mon, 10 Nov 2014 10:15:28 +0100 Subject: [PATCH] do lerp of Y' in linear space. --- decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/decode.c b/decode.c index 9a34d7e..303099d 100644 --- a/decode.c +++ b/decode.c @@ -36,7 +36,7 @@ void process_line(uint8_t *pixel, uint8_t *y_pixel, uint8_t *uv_pixel, int y_wid int uv_x0 = uv_xf; int y_x1 = fclampf(0, y_width, y_xf + 1); int uv_x1 = fclampf(0, uv_width, uv_xf + 1); - uint8_t Y = flerpf(y_pixel[y_x0 + l*y_width], y_pixel[y_x1 + l*y_width], y_xf - (float)y_x0); + uint8_t Y = srgb(flerpf(linear(y_pixel[y_x0 + l*y_width]), linear(y_pixel[y_x1 + l*y_width]), y_xf - (float)y_x0)); uint8_t U = flerpf(uv_pixel[uv_x0 + uv_width], uv_pixel[uv_x1 + uv_width], uv_xf - (float)uv_x0); uint8_t V = flerpf(uv_pixel[uv_x0], uv_pixel[uv_x1], uv_xf - (float)uv_x0); #endif