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