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 {
|
if !ctx.BottomField {
|
||||||
topFieldOrderCnt = vid.picOrderCntMsb + ctx.PicOrderCntLsb
|
topFieldOrderCnt = vid.picOrderCntMsb + ctx.PicOrderCntLsb
|
||||||
|
} else if ctx.FieldPic {
|
||||||
|
bottomFieldOrderCnt = vid.picOrderCntMsb + ctx.PicOrderCntLsb
|
||||||
} else {
|
} else {
|
||||||
if !ctx.FieldPic {
|
bottomFieldOrderCnt = topFieldOrderCnt + ctx.DeltaPicOrderCntBottom
|
||||||
bottomFieldOrderCnt = topFieldOrderCnt + ctx.DeltaPicOrderCntBottom
|
|
||||||
} else {
|
|
||||||
bottomFieldOrderCnt = vid.picOrderCntMsb + ctx.PicOrderCntLsb
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -154,10 +152,10 @@ func decodePicOrderCntType1(vid *VideoStream, ctx *SliceContext) (topFieldOrderC
|
||||||
if !ctx.FieldPic {
|
if !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]
|
||||||
} else if !ctx.BottomField {
|
} else if ctx.BottomField {
|
||||||
topFieldOrderCnt = expectedPicOrderCnt + ctx.DeltaPicOrderCnt[0]
|
|
||||||
} else {
|
|
||||||
bottomFieldOrderCnt = expectedPicOrderCnt + int(ctx.OffsetForTopToBottomField) + ctx.DeltaPicOrderCnt[0]
|
bottomFieldOrderCnt = expectedPicOrderCnt + int(ctx.OffsetForTopToBottomField) + ctx.DeltaPicOrderCnt[0]
|
||||||
|
} else {
|
||||||
|
topFieldOrderCnt = expectedPicOrderCnt + ctx.DeltaPicOrderCnt[0]
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue