summaryrefslogtreecommitdiff
path: root/libavcodec/dvbsub.c
diff options
context:
space:
mode:
authorIan Caulfield <ian.caulfield@gmx.at>2007-07-17 12:33:14 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2007-07-17 12:33:14 +0000
commit04d2e45f3f9a8eebde9a0aef3a3e4baeed59e9a3 (patch)
treee51166e08feb868df96d0a64af8f5a4f84853c8a /libavcodec/dvbsub.c
parent208e63b47907fac1cc5071c0167533cc525a6d5d (diff)
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/dvbsub.c')
-rw-r--r--libavcodec/dvbsub.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/libavcodec/dvbsub.c b/libavcodec/dvbsub.c
index 745cfc6e4c..aed7d1d453 100644
--- a/libavcodec/dvbsub.c
+++ b/libavcodec/dvbsub.c
@@ -20,6 +20,7 @@
*/
#include "avcodec.h"
#include "bytestream.h"
+#include "colorspace.h"
typedef struct DVBSubtitleContext {
int hide_state;
@@ -193,22 +194,6 @@ static void dvb_encode_rle4(uint8_t **pq,
*pq = q;
}
-#define SCALEBITS 10
-#define ONE_HALF (1 << (SCALEBITS - 1))
-#define FIX(x) ((int) ((x) * (1<<SCALEBITS) + 0.5))
-
-#define RGB_TO_Y_CCIR(r, g, b) \
-((FIX(0.29900*219.0/255.0) * (r) + FIX(0.58700*219.0/255.0) * (g) + \
- FIX(0.11400*219.0/255.0) * (b) + (ONE_HALF + (16 << SCALEBITS))) >> SCALEBITS)
-
-#define RGB_TO_U_CCIR(r1, g1, b1, shift)\
-(((- FIX(0.16874*224.0/255.0) * r1 - FIX(0.33126*224.0/255.0) * g1 + \
- FIX(0.50000*224.0/255.0) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128)
-
-#define RGB_TO_V_CCIR(r1, g1, b1, shift)\
-(((FIX(0.50000*224.0/255.0) * r1 - FIX(0.41869*224.0/255.0) * g1 - \
- FIX(0.08131*224.0/255.0) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128)
-
static int encode_dvb_subtitles(DVBSubtitleContext *s,
uint8_t *outbuf, AVSubtitle *h)
{