Simplify rotate_block()
[ffmpeg.git] / libavcodec / dvdsubdec.c
index 6fdbc19..1421c6b 100644 (file)
@@ -42,11 +42,6 @@ static void yuv_a_to_rgba(const uint8_t *ycbcr, const uint8_t *alpha, uint32_t *
     }
 }
 
-static int dvdsub_init_decoder(AVCodecContext *avctx)
-{
-    return 0;
-}
-
 static int decode_run_2bit(GetBitContext *gb, int *color)
 {
     unsigned int v, t;
@@ -348,8 +343,8 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
                 } else {
                     sub_header->rects[0].rgba_palette = av_malloc(4 * 4);
                     sub_header->rects[0].nb_colors = 4;
-                guess_palette(sub_header->rects[0].rgba_palette,
-                              colormap, alpha, 0xffff00);
+                    guess_palette(sub_header->rects[0].rgba_palette,
+                                  colormap, alpha, 0xffff00);
                 }
                 sub_header->rects[0].x = x1;
                 sub_header->rects[0].y = y1;
@@ -443,11 +438,6 @@ static int find_smallest_bounding_rectangle(AVSubtitle *s)
     return 1;
 }
 
-static int dvdsub_close_decoder(AVCodecContext *avctx)
-{
-    return 0;
-}
-
 #ifdef DEBUG
 #undef fprintf
 static void ppm_save(const char *filename, uint8_t *bitmap, int w, int h,
@@ -479,7 +469,7 @@ static void ppm_save(const char *filename, uint8_t *bitmap, int w, int h,
 
 static int dvdsub_decode(AVCodecContext *avctx,
                          void *data, int *data_size,
-                         uint8_t *buf, int buf_size)
+                         const uint8_t *buf, int buf_size)
 {
     AVSubtitle *sub = (void *)data;
     int is_menu;
@@ -512,8 +502,9 @@ AVCodec dvdsub_decoder = {
     CODEC_TYPE_SUBTITLE,
     CODEC_ID_DVD_SUBTITLE,
     0,
-    dvdsub_init_decoder,
     NULL,
-    dvdsub_close_decoder,
+    NULL,
+    NULL,
     dvdsub_decode,
+    .long_name = "DVD subtitles",
 };