From 0df182018ae446b1245f7a65ad5d2dbf6a1d9b9e Mon Sep 17 00:00:00 2001 From: Saxon Date: Tue, 10 Sep 2019 11:32:46 +0930 Subject: [PATCH] codec/h264/h264dec/decode.go: using else if structure instead of switch to derive value of vid.picOrderCntMsb --- codec/h264/h264dec/decode.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 {