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")
|
panic("not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
var tempPicOrderCnt int
|
tempPicOrderCnt := 2 * (vid.frameNumOffset + ctx.FrameNum)
|
||||||
switch {
|
if vid.idrPicFlag {
|
||||||
case vid.idrPicFlag:
|
|
||||||
tempPicOrderCnt = 0
|
tempPicOrderCnt = 0
|
||||||
case ctx.RefIdc == 0:
|
} else if ctx.RefIdc == 0 {
|
||||||
tempPicOrderCnt = 2*(vid.frameNumOffset+ctx.FrameNum) - 1
|
tempPicOrderCnt = 2*(vid.frameNumOffset+ctx.FrameNum) - 1
|
||||||
default:
|
|
||||||
tempPicOrderCnt = 2 * (vid.frameNumOffset + ctx.FrameNum)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch {
|
if !ctx.FieldPic {
|
||||||
case ctx.FieldPic:
|
|
||||||
topFieldOrderCnt = tempPicOrderCnt
|
topFieldOrderCnt = tempPicOrderCnt
|
||||||
bottomFieldOrderCnt = tempPicOrderCnt
|
bottomFieldOrderCnt = tempPicOrderCnt
|
||||||
case ctx.BottomField:
|
} else if ctx.BottomField {
|
||||||
bottomFieldOrderCnt = tempPicOrderCnt
|
bottomFieldOrderCnt = tempPicOrderCnt
|
||||||
default:
|
} else {
|
||||||
topFieldOrderCnt = tempPicOrderCnt
|
topFieldOrderCnt = tempPicOrderCnt
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue