mirror of https://bitbucket.org/ausocean/av.git
codec/h264/h264dec/cavlc.go: added process to comgine level and run information
This commit is contained in:
parent
614f42ec2c
commit
445649311b
|
@ -127,3 +127,21 @@ func parseLevelInformation(br *bits.BitReader, totalCoeff, trailingOnes int) ([]
|
|||
}
|
||||
return levelVal, nil
|
||||
}
|
||||
|
||||
// combineLevelRunInfo combines the level and run information obtained prior
|
||||
// using the process defined in section 9.2.4 of the specifications and returns
|
||||
// the corresponding coeffLevel list.
|
||||
func combineLevelRunInfo(levelVal, runVal []int, totalCoeff int) []int {
|
||||
coeffNum := -1
|
||||
i := totalCoeff - 1
|
||||
var coeffLevel []int
|
||||
for j := 0; j < totalCoeff; j++ {
|
||||
coeffNum += runVal[i] + 1
|
||||
if coeffNum >= len(coeffLevel) {
|
||||
coeffLevel = append(coeffLevel, make([]int, (coeffNum+1)-len(coeffLevel))...)
|
||||
}
|
||||
coeffLevel[coeffNum] = levelVal[i]
|
||||
i++
|
||||
}
|
||||
return coeffLevel
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue