]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dvbsub.c
Update comment to version, negotiated with Diego, and
[ffmpeg] / libavcodec / dvbsub.c
index 745cfc6e4c3452f72dbf6bb11d0d1db400465518..f7a719a04587d73eddb5811c9ec965a50d6a2cea 100644 (file)
@@ -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)
 {
@@ -405,16 +390,6 @@ static int encode_dvb_subtitles(DVBSubtitleContext *s,
     return q - outbuf;
 }
 
-static int dvbsub_init_decoder(AVCodecContext *avctx)
-{
-    return 0;
-}
-
-static int dvbsub_close_decoder(AVCodecContext *avctx)
-{
-    return 0;
-}
-
 static int dvbsub_encode(AVCodecContext *avctx,
                        unsigned char *buf, int buf_size, void *data)
 {
@@ -431,7 +406,7 @@ AVCodec dvbsub_encoder = {
     CODEC_TYPE_SUBTITLE,
     CODEC_ID_DVB_SUBTITLE,
     sizeof(DVBSubtitleContext),
-    dvbsub_init_decoder,
+    NULL,
     dvbsub_encode,
-    dvbsub_close_decoder,
+    .long_name = "DVB subtitles",
 };