mirror of https://bitbucket.org/ausocean/av.git
codec/h264/h264dec/decode.go: slightly simplified if-else statements regarding BottomField and FieldPic
This commit is contained in:
parent
117a75ae55
commit
4c7f36ee36
|
@ -102,12 +102,10 @@ func decodePicOrderCntType0(vid *VideoStream, ctx *SliceContext) (topFieldOrderC
|
|||
|
||||
if !ctx.BottomField {
|
||||
topFieldOrderCnt = vid.picOrderCntMsb + ctx.PicOrderCntLsb
|
||||
} else if ctx.FieldPic {
|
||||
bottomFieldOrderCnt = vid.picOrderCntMsb + ctx.PicOrderCntLsb
|
||||
} else {
|
||||
if !ctx.FieldPic {
|
||||
bottomFieldOrderCnt = topFieldOrderCnt + ctx.DeltaPicOrderCntBottom
|
||||
} else {
|
||||
bottomFieldOrderCnt = vid.picOrderCntMsb + ctx.PicOrderCntLsb
|
||||
}
|
||||
bottomFieldOrderCnt = topFieldOrderCnt + ctx.DeltaPicOrderCntBottom
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -154,10 +152,10 @@ func decodePicOrderCntType1(vid *VideoStream, ctx *SliceContext) (topFieldOrderC
|
|||
if !ctx.FieldPic {
|
||||
topFieldOrderCnt = expectedPicOrderCnt + ctx.DeltaPicOrderCnt[0]
|
||||
bottomFieldOrderCnt = topFieldOrderCnt + int(ctx.OffsetForTopToBottomField) + ctx.DeltaPicOrderCnt[1]
|
||||
} else if !ctx.BottomField {
|
||||
topFieldOrderCnt = expectedPicOrderCnt + ctx.DeltaPicOrderCnt[0]
|
||||
} else {
|
||||
} else if ctx.BottomField {
|
||||
bottomFieldOrderCnt = expectedPicOrderCnt + int(ctx.OffsetForTopToBottomField) + ctx.DeltaPicOrderCnt[0]
|
||||
} else {
|
||||
topFieldOrderCnt = expectedPicOrderCnt + ctx.DeltaPicOrderCnt[0]
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue