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>
pull/296/head
Michael Niedermayer 7 years ago
parent 384dcd66a2
commit 71bf033050
  1. 5
      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);

Loading…
Cancel
Save