diff --git a/codec/h264/h264dec/decode.go b/codec/h264/h264dec/decode.go index abecbb7e..25c81c75 100644 --- a/codec/h264/h264dec/decode.go +++ b/codec/h264/h264dec/decode.go @@ -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 + if ctx.PicOrderCntLsb < prevPicOrderCntLsb && (prevPicOrderCntLsb-ctx.PicOrderCntLsb) >= (vid.maxPicOrderCntLsb/2) { vid.picOrderCntMsb = prevPicOrderCntMsb + vid.maxPicOrderCntLsb - case (ctx.PicOrderCntLsb > prevPicOrderCntLsb) && ((ctx.PicOrderCntLsb - prevPicOrderCntLsb) > (vid.maxPicOrderCntLsb / 2)): + } else if ctx.PicOrderCntLsb > prevPicOrderCntLsb && (ctx.PicOrderCntLsb-prevPicOrderCntLsb) > (vid.maxPicOrderCntLsb/2) { vid.picOrderCntMsb = prevPicOrderCntMsb - vid.maxPicOrderCntLsb - default: - vid.picOrderCntMsb = prevPicOrderCntMsb } if !ctx.BottomField {