diff options
author | Ian Caulfield <ian.caulfield@gmx.at> | 2007-07-17 12:33:14 +0000 |
---|---|---|
committer | Benoit Fouet <benoit.fouet@free.fr> | 2007-07-17 12:33:14 +0000 |
commit | 04d2e45f3f9a8eebde9a0aef3a3e4baeed59e9a3 (patch) | |
tree | e51166e08feb868df96d0a64af8f5a4f84853c8a /libavcodec/dvbsubdec.c | |
parent | 208e63b47907fac1cc5071c0167533cc525a6d5d (diff) | |
download | ffmpeg-04d2e45f3f9a8eebde9a0aef3a3e4baeed59e9a3.tar.gz |
create colorspace.h and use it where appropriate
patch by Ian Caulfield: /ian caulfield gmail com/
Originally committed as revision 9716 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dvbsubdec.c')
-rw-r--r-- | libavcodec/dvbsubdec.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index ffe1964c4f..4a33cab405 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -21,6 +21,7 @@ #include "avcodec.h" #include "dsputil.h" #include "bitstream.h" +#include "colorspace.h" //#define DEBUG //#define DEBUG_PACKET_CONTENTS @@ -894,29 +895,6 @@ static void dvbsub_parse_object_segment(AVCodecContext *avctx, } -#define SCALEBITS 10 -#define ONE_HALF (1 << (SCALEBITS - 1)) -#define FIX(x) ((int) ((x) * (1<<SCALEBITS) + 0.5)) - -#define YUV_TO_RGB1_CCIR(cb1, cr1)\ -{\ - cb = (cb1) - 128;\ - cr = (cr1) - 128;\ - r_add = FIX(1.40200*255.0/224.0) * cr + ONE_HALF;\ - g_add = - FIX(0.34414*255.0/224.0) * cb - FIX(0.71414*255.0/224.0) * cr + \ - ONE_HALF;\ - b_add = FIX(1.77200*255.0/224.0) * cb + ONE_HALF;\ -} - -#define YUV_TO_RGB2_CCIR(r, g, b, y1)\ -{\ - y = ((y1) - 16) * FIX(255.0/219.0);\ - r = cm[(y + r_add) >> SCALEBITS];\ - g = cm[(y + g_add) >> SCALEBITS];\ - b = cm[(y + b_add) >> SCALEBITS];\ -} - - static void dvbsub_parse_clut_segment(AVCodecContext *avctx, uint8_t *buf, int buf_size) { |