codec/h264/h264dec/decode.go: using if else structure for derivation of topFieldOrderCnt and bottomFieldOrderCnt in decodePicOrderCntType1 function

This commit is contained in:
Saxon 2019-09-10 12:06:35 +09:30
parent 0df182018a
commit 40fa50d4f0
1 changed files with 3 additions and 4 deletions

View File

@ -151,13 +151,12 @@ func decodePicOrderCntType1(vid *VideoStream, ctx *SliceContext) (topFieldOrderC
expectedPicOrderCnt = expectedPicOrderCnt + int(ctx.OffsetForNonRefPic) expectedPicOrderCnt = expectedPicOrderCnt + int(ctx.OffsetForNonRefPic)
} }
switch { if !ctx.FieldPic {
case !ctx.FieldPic:
topFieldOrderCnt = expectedPicOrderCnt + ctx.DeltaPicOrderCnt[0] topFieldOrderCnt = expectedPicOrderCnt + ctx.DeltaPicOrderCnt[0]
bottomFieldOrderCnt = topFieldOrderCnt + int(ctx.OffsetForTopToBottomField) + ctx.DeltaPicOrderCnt[1] bottomFieldOrderCnt = topFieldOrderCnt + int(ctx.OffsetForTopToBottomField) + ctx.DeltaPicOrderCnt[1]
case !ctx.BottomField: } else if !ctx.BottomField {
topFieldOrderCnt = expectedPicOrderCnt + ctx.DeltaPicOrderCnt[0] topFieldOrderCnt = expectedPicOrderCnt + ctx.DeltaPicOrderCnt[0]
default: } else {
bottomFieldOrderCnt = expectedPicOrderCnt + int(ctx.OffsetForTopToBottomField) + ctx.DeltaPicOrderCnt[0] bottomFieldOrderCnt = expectedPicOrderCnt + int(ctx.OffsetForTopToBottomField) + ctx.DeltaPicOrderCnt[0]
} }
return return