diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-09-13 04:24:49 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-10-07 21:34:00 +0200 |
commit | 9afcf994f6f79eee1ff4e80c9b7c04115eb1a3b5 (patch) | |
tree | bc491f77988a392ae920de959845831f9b2bd3e9 /libavcodec | |
parent | 7da37aa9804afd2fcaf25a1deb7863dec35ae809 (diff) | |
download | ffmpeg-9afcf994f6f79eee1ff4e80c9b7c04115eb1a3b5.tar.gz |
avcodec/dvdsubdec: Avoid branch in decode_run_8bit()
Speed improvment 35.5 sec -> 34.7sec
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 71bf0330505e2108935d05c5c018ec65eac4b946)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dvdsubdec.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index e18113c20c..a5107096df 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -82,10 +82,7 @@ static int decode_run_8bit(GetBitContext *gb, int *color) { int len; int has_run = get_bits1(gb); - if (get_bits1(gb)) - *color = get_bits(gb, 8); - else - *color = get_bits(gb, 2); + *color = get_bits(gb, 2 + 6*get_bits1(gb)); if (has_run) { if (get_bits1(gb)) { len = get_bits(gb, 7); |