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
This commit is contained in:
Ian Caulfield
2007-07-17 12:33:14 +00:00
committed by Benoit Fouet
parent 208e63b479
commit 04d2e45f3f
4 changed files with 110 additions and 121 deletions

View File

@ -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)
{