mirror of https://bitbucket.org/ausocean/av.git
codec/h264/h264dec: got rid of unneeded closure and renamed suffix to s
This commit is contained in:
parent
08d3f6c3d1
commit
4a2c3487c7
|
@ -796,8 +796,7 @@ func unaryExpGolombBinarization(v, uCoff, k int, signedValFlag bool) ([]int, err
|
|||
// using the the algorithm as described by pseudo code 9-6 in section 9.3.2.3.
|
||||
// TODO: could probably reduce allocations.
|
||||
func suffix(v, uCoff, k int, signedValFlag bool) []int {
|
||||
var suffix []int
|
||||
put := func(p int) { suffix = append(suffix, p) }
|
||||
var s []int
|
||||
|
||||
if absi(v) >= uCoff {
|
||||
sufS := absi(v) - uCoff
|
||||
|
@ -805,13 +804,13 @@ func suffix(v, uCoff, k int, signedValFlag bool) []int {
|
|||
|
||||
for {
|
||||
if sufS >= (1 << uint(k)) {
|
||||
put(1)
|
||||
s = append(s, 1)
|
||||
sufS = sufS - (1 << uint(k))
|
||||
k++
|
||||
} else {
|
||||
put(0)
|
||||
s = append(s, 0)
|
||||
for k = k - 1; k >= 0; k-- {
|
||||
put((sufS >> uint(k)) & 1)
|
||||
s = append(s, (sufS>>uint(k))&1)
|
||||
}
|
||||
stop = true
|
||||
}
|
||||
|
@ -823,11 +822,11 @@ func suffix(v, uCoff, k int, signedValFlag bool) []int {
|
|||
|
||||
if signedValFlag && v != 0 {
|
||||
if v > 0 {
|
||||
put(0)
|
||||
s = append(s, 0)
|
||||
} else {
|
||||
put(1)
|
||||
s = append(s, 1)
|
||||
}
|
||||
}
|
||||
|
||||
return suffix
|
||||
return s
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue