summaryrefslogtreecommitdiff
path: root/libavcodec/xsubdec.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2007-08-05 12:11:20 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2007-08-05 12:11:20 +0000
commitd6136c761822ab1fbcb8881080a6b98227b2cb14 (patch)
treee0e2e6efc640f0cc6f9d2d68cb8771258cf42855 /libavcodec/xsubdec.c
parent737c5ebfc8e67cdb6bc5e6d6bb6e9af13e7989f5 (diff)
get rid of xsubdec array and calculate value instead
Originally committed as revision 9938 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/xsubdec.c')
-rw-r--r--libavcodec/xsubdec.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c
index 2a858f60b4..f2ef39bf75 100644
--- a/libavcodec/xsubdec.c
+++ b/libavcodec/xsubdec.c
@@ -24,8 +24,6 @@ static uint64_t parse_timecode(AVCodecContext *avctx, uint8_t *buf) {
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 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
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