diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-09-13 04:24:49 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-10-23 01:44:40 +0200 |
commit | 1049ccec344945fd86131de8fe827a3602d453ce (patch) | |
tree | 5d014dcf5a68d8d3cea331c893c14e7948fdd4c7 | |
parent | fcab1b996a219ea49f2f7eaf606cf2ce1adc1958 (diff) | |
download | ffmpeg-1049ccec344945fd86131de8fe827a3602d453ce.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>
-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 917adc3dfe..696a668167 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); |