[FFmpeg-cvslog] avcodec/dvdsubdec: Avoid branch in decode_run_8bit()
Michael Niedermayer
git at videolan.org
Thu Nov 1 02:55:14 EET 2018
ffmpeg | branch: release/3.3 | Michael Niedermayer <michael at niedermayer.cc> | Thu Sep 13 04:24:49 2018 +0200| [46875255bc957832bbd3cabf593471c5a16f2e55] | committer: Michael Niedermayer
avcodec/dvdsubdec: Avoid branch in decode_run_8bit()
Speed improvment 35.5 sec -> 34.7sec
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 71bf0330505e2108935d05c5c018ec65eac4b946)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=46875255bc957832bbd3cabf593471c5a16f2e55
---
libavcodec/dvdsubdec.c | 5 +----
1 file changed, 1 insertion(+), 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);
More information about the ffmpeg-cvslog
mailing list