codec/h264/h264dec/cavlc.go: simplified logic in loop to count leading zeros in formCoeffTokenMap

This commit is contained in:
Saxon 2019-09-13 11:21:00 +09:30
parent 88857ec5b9
commit 89452d55d3
1 changed files with 2 additions and 4 deletions

View File

@ -108,15 +108,13 @@ func formCoeffTokenMap(lines [][]string) ([nColumns]tokenMap, error) {
// Count the leading zeros.
var nZeros int
for _, c := range v {
if c == ' ' {
continue
if c == '1' {
break
}
if c == '0' {
nZeros++
continue
}
break
}
// This will be the value of the coeff_token (without leading zeros).