[Mp4-tech] Regarding reference picture management
Gary Sullivan
garysull windows.microsoft.com
Tue Aug 14 12:39:17 EDT 2007
Pooja Sharma et al,
Answering question 1:
A major part of your problem in understanding the text seems to be that you're not paying attention to the exact proper names of variables and syntax elements.
frame_num is the syntax element value in the slice header of the current picture.
FrameNum (not Frame_num -- please at least be careful to copy terms and names correctly when asking such questions) is the value of frame_num that was associated with some particular previously decoded reference picture.
The syntax element frame_num counts upwards (some details left out) in a modulo fashion relative to the modulus MaxFrameNum (again, please be more careful to name things properly - you didn't quite get the name right).
Because you were not paying attention and copying names correctly, you switched the name of the syntax element frame_num with the variable name FrameNum in your quote of the pseudo-code in the standard. The correct pseudo-code is:
if( FrameNum > frame_num )
FrameNumWrap = FrameNum - MaxFrameNum (?8-28)
else
FrameNumWrap = FrameNum
So an example typical counting with MaxFrameNum equal to 256 might proceed as in 253, 254, 255, 0, 1, 2, etc.
As you can see, the frame_num of the first three pictures above is less than the frame_num of the next three pictures.
To deal with the modulus roll-over, when this occurs, FrameNumWrap (again please copy names properly) converts the frame numbers prior to the roll-over to negative values so that the sequence of values makes logical sense.
When decoding the second picture in that series, frame_num will be equal to 254 and the FrameNumWrap value will be 254.
When decoding the third picture in that series, frame_num will be equal to 255 and the FrameNumWrap values will be 253 and 254.
When decoding the fourth picture in that series, frame_num will be equal to 0 and the FrameNumWrap values will be -3, -2, and -1.
When decoding the fifth picture in that series, frame_num will be equal to 1 and the FrameNumWrap values will be -3, -2, -1, and 0.
When decoding the sixth picture in that series, frame_num will be equal to 2 and the FrameNumWrap values will be -3, -2, -1, 0 and 1.
I don't want to take time to answer questions 2 and 3. Really you should study very hard before taking up experts' time with such questions and you should be careful to phrase your questions very carefully exactly according to the proper terms used in the standard. My impression is that you have not yet tried hard enough.
Best Regards,
Gary Sullivan
________________________________
From: mp4-tech-bounces lists.mpegif.org [mailto:mp4-tech-bounces lists.mpegif.org] On Behalf Of Pooja Sharma
Sent: Tuesday, August 14, 2023 2:32 AM
To: mp4-tech lists.mpegif.org
Subject: [Mp4-tech] Regarding reference picture management
Hi All,
I am going through the decoding process for reference picture list constructions(H.264 standard) , i hav a few doubts if anyone can clarify.
1. I am not clear with the usage of variable frameNumWrap
As per the standard
if (Frame_num >frame_num)
framenumwrap = frame_num - Maxframenum
else
framenumwrap = frame_num
My doubt here is that under what conditions Frame_num can be greater than frame_num.
2. when field_pic_flag = 1, pic_num is derived as follows
pic_num = 2 x framenumwrap + 1 ........if the refernce field has the same parity as the current field..
Does it mean that when bottom_field_flag is 0 picnum = 2 x framenumwrap and when
bottom_field_flag =1 pic_num = 2 x framenumwrap + 1 ?
3.Can anyone explain the pseudo code described in expression 8-38 in reordering where it talks bout
some function PicNumF(refPicListX[cidx]).
Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/mp4-tech/attachments/20070814/3388841b/attachment.html
More information about the Mp4-tech
mailing list