changeset 5487:3039b660bf35 libavcodec

get rid of xsubdec array and calculate value instead
author reimar
date Sun, 05 Aug 2007 12:11:20 +0000
parents 06486d4cfa88
children 0f736b1402ca
files xsubdec.c
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/xsubdec.c	Sun Aug 05 12:11:18 2007 +0000
+++ b/xsubdec.c	Sun Aug 05 12:11:20 2007 +0000
@@ -24,8 +24,6 @@
     return ms;
 }
 
-static const uint8_t runbits[8] = { 14, 14, 10, 10, 6, 6, 2, 2 };
-
 static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
                         uint8_t *buf, int buf_size) {
     AVSubtitle *sub = data;
@@ -85,7 +83,7 @@
     for (y = 0; y < h; y++) {
         for (x = 0; x < w; ) {
             int log2 = ff_log2_tab[show_bits(&gb, 8)];
-            int run = get_bits(&gb, runbits[log2]);
+            int run = get_bits(&gb, 14 - 4 * (log2 >> 1));
             int colour = get_bits(&gb, 2);
             run = FFMIN(run, w - x);
             // run length 0 means till end of row