aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-09-13 04:24:49 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-10-28 02:22:42 +0200
commit1a106752f37cf9119615e0db908d13b714f565d2 (patch)
tree2b828a7359d3311e7cc9c8e0b855764d4c1b9cb5
parentab5d930762389f4200fb600c84580e6b79b2c153 (diff)
downloadffmpeg-1a106752f37cf9119615e0db908d13b714f565d2.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.c5
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);