From d4956b0bfbf92a4301529b35096a03f16f355a1b Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 14 Apr 2013 19:55:06 +0200 Subject: sws/input: replace hardcoded rgb2yuv coefficients by table Signed-off-by: Michael Niedermayer --- libswscale/swscale_internal.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'libswscale/swscale_internal.h') diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 83d3a0049c..e801bc92ce 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -360,6 +360,16 @@ typedef struct SwsContext { uint8_t *table_gU[256 + 2*YUVRGB_TABLE_HEADROOM]; int table_gV[256 + 2*YUVRGB_TABLE_HEADROOM]; uint8_t *table_bU[256 + 2*YUVRGB_TABLE_HEADROOM]; + int32_t input_rgb2yuv_table[16]; // This table can contain both C and SIMD formatted values, teh C vales are always at the XY_IDX points +#define RY_IDX 0 +#define GY_IDX 1 +#define BY_IDX 2 +#define RU_IDX 3 +#define GU_IDX 4 +#define BU_IDX 5 +#define RV_IDX 6 +#define GV_IDX 7 +#define BV_IDX 8 int *dither_error[4]; @@ -489,9 +499,9 @@ typedef struct SwsContext { * internally to Y/UV. */ /** @{ */ - void (*readLumPlanar)(uint8_t *dst, const uint8_t *src[4], int width); + void (*readLumPlanar)(uint8_t *dst, const uint8_t *src[4], int width, int32_t *rgb2yuv); void (*readChrPlanar)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src[4], - int width); + int width, int32_t *rgb2yuv); /** @} */ /** -- cgit v1.2.3