mirror of https://bitbucket.org/ausocean/av.git
Merged in combine-information (pull request #246)
codec/h264/h264dec/cavlc.go: added process to comgine level and run information Approved-by: Alan Noble <anoble@gmail.com>
This commit is contained in:
commit
2f6649b1f3
|
@ -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