mirror of https://bitbucket.org/ausocean/av.git
codec/h264/h264dec/decode.go: using else if structure instead of switch to derive value of vid.picOrderCntMsb
This commit is contained in:
parent
31179205b9
commit
0df182018a
|
@ -93,13 +93,11 @@ func decodePicOrderCntType0(vid *VideoStream, ctx *SliceContext) (topFieldOrderC
|
|||
panic("not implemented")
|
||||
}
|
||||
|
||||
switch {
|
||||
case (ctx.PicOrderCntLsb < prevPicOrderCntLsb) && ((prevPicOrderCntLsb - ctx.PicOrderCntLsb) >= (vid.maxPicOrderCntLsb / 2)):
|
||||
vid.picOrderCntMsb = prevPicOrderCntMsb + vid.maxPicOrderCntLsb
|
||||
case (ctx.PicOrderCntLsb > prevPicOrderCntLsb) && ((ctx.PicOrderCntLsb - prevPicOrderCntLsb) > (vid.maxPicOrderCntLsb / 2)):
|
||||
vid.picOrderCntMsb = prevPicOrderCntMsb - vid.maxPicOrderCntLsb
|
||||
default:
|
||||
vid.picOrderCntMsb = prevPicOrderCntMsb
|
||||
if ctx.PicOrderCntLsb < prevPicOrderCntLsb && (prevPicOrderCntLsb-ctx.PicOrderCntLsb) >= (vid.maxPicOrderCntLsb/2) {
|
||||
vid.picOrderCntMsb = prevPicOrderCntMsb + vid.maxPicOrderCntLsb
|
||||
} else if ctx.PicOrderCntLsb > prevPicOrderCntLsb && (ctx.PicOrderCntLsb-prevPicOrderCntLsb) > (vid.maxPicOrderCntLsb/2) {
|
||||
vid.picOrderCntMsb = prevPicOrderCntMsb - vid.maxPicOrderCntLsb
|
||||
}
|
||||
|
||||
if !ctx.BottomField {
|
||||
|
|
Loading…
Reference in New Issue