mirror of https://bitbucket.org/ausocean/av.git
codec/h264/h264dec/decode.go: using if else structures for topFieldOrderCnt/bottomFieldOrderCnt value derivations in decodePicOrderCntType2
This commit is contained in:
parent
40fa50d4f0
commit
5939db6f1b
|
@ -178,24 +178,21 @@ func decodePicOrderCntType2(vid *VideoStream, ctx *SliceContext) (topFieldOrderC
|
|||
panic("not implemented")
|
||||
}
|
||||
|
||||
var tempPicOrderCnt int
|
||||
switch {
|
||||
case vid.idrPicFlag:
|
||||
tempPicOrderCnt := 2 * (vid.frameNumOffset + ctx.FrameNum)
|
||||
if vid.idrPicFlag {
|
||||
tempPicOrderCnt = 0
|
||||
case ctx.RefIdc == 0:
|
||||
} else if ctx.RefIdc == 0 {
|
||||
tempPicOrderCnt = 2*(vid.frameNumOffset+ctx.FrameNum) - 1
|
||||
default:
|
||||
tempPicOrderCnt = 2 * (vid.frameNumOffset + ctx.FrameNum)
|
||||
}
|
||||
|
||||
switch {
|
||||
case ctx.FieldPic:
|
||||
if !ctx.FieldPic {
|
||||
topFieldOrderCnt = tempPicOrderCnt
|
||||
bottomFieldOrderCnt = tempPicOrderCnt
|
||||
case ctx.BottomField:
|
||||
} else if ctx.BottomField {
|
||||
bottomFieldOrderCnt = tempPicOrderCnt
|
||||
default:
|
||||
} else {
|
||||
topFieldOrderCnt = tempPicOrderCnt
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue