[FFmpeg-devel] [PATCH 05/10] libavcodec/ccaption_dec: combine ROLLUP modes as they are identical

Aman Gupta ffmpeg at tmm1.net
Wed Jan 6 08:41:37 CET 2016


From: Aman Gupta <aman at tmm1.net>

---
 libavcodec/ccaption_dec.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index 5d4c568..424b434 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -37,9 +37,7 @@
 enum cc_mode {
     CCMODE_POPON,
     CCMODE_PAINTON,
-    CCMODE_ROLLUP_2,
-    CCMODE_ROLLUP_3,
-    CCMODE_ROLLUP_4,
+    CCMODE_ROLLUP,
     CCMODE_TEXT,
 };
 
@@ -176,7 +174,7 @@ static av_cold int init_decoder(AVCodecContext *avctx)
 
     av_bprint_init(&ctx->buffer, 0, AV_BPRINT_SIZE_UNLIMITED);
     /* taking by default roll up to 2 */
-    ctx->mode = CCMODE_ROLLUP_2;
+    ctx->mode = CCMODE_ROLLUP;
     ctx->rollup = 2;
     ret = ff_ass_subtitle_header_default(avctx);
     if (ret < 0) {
@@ -266,9 +264,7 @@ static struct Screen *get_writing_screen(CCaptionSubContext *ctx)
         // use Inactive screen
         return ctx->screen + !ctx->active_screen;
     case CCMODE_PAINTON:
-    case CCMODE_ROLLUP_2:
-    case CCMODE_ROLLUP_3:
-    case CCMODE_ROLLUP_4:
+    case CCMODE_ROLLUP:
     case CCMODE_TEXT:
         // use active screen
         return ctx->screen + ctx->active_screen;
@@ -460,15 +456,15 @@ static void process_cc608(CCaptionSubContext *ctx, uint8_t hi, uint8_t lo)
             break;
         case 0x25:
             ctx->rollup = 2;
-            ctx->mode = CCMODE_ROLLUP_2;
+            ctx->mode = CCMODE_ROLLUP;
             break;
         case 0x26:
             ctx->rollup = 3;
-            ctx->mode = CCMODE_ROLLUP_3;
+            ctx->mode = CCMODE_ROLLUP;
             break;
         case 0x27:
             ctx->rollup = 4;
-            ctx->mode = CCMODE_ROLLUP_4;
+            ctx->mode = CCMODE_ROLLUP;
             break;
         case 0x29:
             /* resume direct captioning */
-- 
2.5.3



More information about the ffmpeg-devel mailing list