diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-01-10 20:56:15 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-11 15:04:02 +0100 |
commit | 0644cabd7ab60b7384349ddc41262d4f21a084d3 (patch) | |
tree | ec1ee42cefad75d0e38a6fb5188b7cd2b15a3e4a /libswscale/swscale_internal.h | |
parent | 7c4b39750853c1b51652ece70b5bf8fcd72e3181 (diff) | |
download | ffmpeg-0644cabd7ab60b7384349ddc41262d4f21a084d3.tar.gz |
sws: Move yuv2rgb clipping into the tables.
This fixes some cases where the clipping was entirely missing.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Thanks (for the comments and review) -to: Reimar, beastd, Ronald
Diffstat (limited to 'libswscale/swscale_internal.h')
-rw-r--r-- | libswscale/swscale_internal.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index f05925f842..f4220a9eba 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -34,6 +34,8 @@ #define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long +#define YUVRGB_TABLE_HEADROOM 128 + #define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients #define MAX_FILTER_SIZE 256 @@ -317,10 +319,10 @@ typedef struct SwsContext { int dstY; ///< Last destination vertical line output from last slice. int flags; ///< Flags passed by the user to select scaler algorithm, optimizations, subsampling, etc... void *yuvTable; // pointer to the yuv->rgb table start so it can be freed() - uint8_t *table_rV[256]; - uint8_t *table_gU[256]; - int table_gV[256]; - uint8_t *table_bU[256]; + uint8_t *table_rV[256 + 2*YUVRGB_TABLE_HEADROOM]; + 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]; //Colorspace stuff int contrast, brightness, saturation; // for sws_getColorspaceDetails |