Breif Description of nal_ref_idc Value in H.246 NALU
I am so sorry for my late update because of my study!
A quite update of myself: I have actually stopped working on H.264 and MP4 for some time but will probably pick up again in the near future.
As in the article Introduction to H.264: (1) NAL Unit, Suji Mani asked what is the exact meaning of different values in nal_ref_idc. In fact, nal_ref_idc is base on “Start Code Value” and represents the priority of the current frame (i.e. how important of the frame – the higher the value, the more important the frame). Here is a list of nal_ref_idc values with the corresponding Start Code Type:
|Start Code Type||nal_ref_idc values (in binary)||nal_ref_idc values (in decimal)|
|Picture header of I-frame||11||3|
|Slice data of I-frame||11||3|
|Picture header of P-frame||10||2|
|Slice data of P-frame||10||2|
|Picture header of B-frame||01||1|
|Slice data of B-frame||01||1|
|Video extension start code||00||0|
|User data start code||00||0|
|Video edit start code||00||0|
Let me clarify a bit. nal_ref_idc is actually telling you what is the type of the current frame, which implies that what information you could get in this frame.
The example in Introduction to H.264: (1) NAL Unit is the beginning of a H.246 raw data. Let’s check the example again.
forbidden_zero_bit = 0,
nal_ref_idc = 3,
nal_unit_type = 7 (Sequence Parameter Set, SPS)
As this is the beginning of a h.264 raw data, it is reasonable to say the first frame is a SPS (i.e. Start Code Type is Sequence Header). Hence, we have nal_rel_idc = 3.
I hope this may help you a bit.