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 71bf033050)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2018-09-13 04:24:49 +02:00
parent 7da37aa980
commit 9afcf994f6
1 changed files with 1 additions and 4 deletions

View File

@ -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);