diff --git a/codec/h264/h264dec/decode.go b/codec/h264/h264dec/decode.go index bd686efc..ac4ee928 100644 --- a/codec/h264/h264dec/decode.go +++ b/codec/h264/h264dec/decode.go @@ -122,12 +122,12 @@ func decodePicOrderCntType1(vid *VideoStream, ctx *SliceContext) (topFieldOrderC // TODO: this will be prevFrameNum when we do frames other than IDR. _ = vid.priorPic.FrameNum - if vid.idrPicFlag { - vid.frameNumOffset = 0 - } else { + if !vid.idrPicFlag { panic("not implemented") } + vid.frameNumOffset = 0 + absFrameNum := 0 if ctx.NumRefFramesInPicOrderCntCycle != 0 { absFrameNum = vid.frameNumOffset + ctx.FrameNum @@ -172,18 +172,13 @@ func decodePicOrderCntType2(vid *VideoStream, ctx *SliceContext) (topFieldOrderC // TODO: this will be prevFrameNum when we do frames other than IDR. _ = vid.priorPic.FrameNum - if vid.idrPicFlag { - vid.frameNumOffset = 0 - } else { + if !vid.idrPicFlag { panic("not implemented") } + vid.frameNumOffset = 0 - tempPicOrderCnt := 2 * (vid.frameNumOffset + ctx.FrameNum) - if vid.idrPicFlag { - tempPicOrderCnt = 0 - } else if ctx.RefIdc == 0 { - tempPicOrderCnt = 2*(vid.frameNumOffset+ctx.FrameNum) - 1 - } + // TODO: handle tempPicOrderCnt calculation for when not IDR. + var tempPicOrderCnt int if !ctx.FieldPic { topFieldOrderCnt = tempPicOrderCnt