diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-09-13 04:24:49 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-09-15 20:00:45 +0200 |
commit | 71bf0330505e2108935d05c5c018ec65eac4b946 (patch) | |
tree | febe94d3347c7a505b1e44810110265146d93b3f /libavcodec/dvdsubdec.c | |
parent | 384dcd66a2414622d6cd0d2be10d745aac4a5321 (diff) | |
download | ffmpeg-71bf0330505e2108935d05c5c018ec65eac4b946.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>
Diffstat (limited to 'libavcodec/dvdsubdec.c')
-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 f1ac9e353e..13d52c8c68 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -83,10 +83,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); |