From 46e7f9d303e8f8393a6b15be717be1959bcee0f9 Mon Sep 17 00:00:00 2001 From: Saxon Date: Mon, 9 Sep 2019 09:11:50 +0930 Subject: [PATCH] codec/h264/h264dec/cavlc.go: simplified some logic regarding appending of values onto levelVal based on trailing_ones_sign_flag --- codec/h264/h264dec/cavlc.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/codec/h264/h264dec/cavlc.go b/codec/h264/h264dec/cavlc.go index 820ec67c..e1932548 100644 --- a/codec/h264/h264dec/cavlc.go +++ b/codec/h264/h264dec/cavlc.go @@ -56,11 +56,7 @@ func parseLevelInformation(br *bits.BitReader, totalCoeff, trailingOnes int) ([] if err != nil { return nil, fmt.Errorf("could not read trailing_ones_sign_flag, failed with error: %v", err) } - if b == 0 { - levelVal = append(levelVal, 1) - continue - } - levelVal = append(levelVal, -1) + levelVal = append(levelVal, 1-int(b)*2) } var suffixLen int