c. ITU-T H.264 (01/2012) 8.2.5.1 Sequence of operations for decoded reference picture marking process Decoded reference picture marking proceeds in the following ordered steps: 1. All slices of the current picture are decoded. 2. Depending on whether the current picture is an IDR picture, the following applies: If the current picture is an IDR picture, the following ordered steps are specified: a. All reference pictures are marked as "unused for reference" b. Depending on long_term_reference_flag, the following applies: If long_term_reference_flag is equal to 0, the IDR picture is marked as "used for short-term reference" and MaxLongTermFrameIdx is set equal to "no long-term frame indices". Otherwise (long_term_reference_flag is equal to 1), the IDR picture is marked as "used for long-term reference", the LongTermFrameldx for the IDR picture is set equal to 0, and MaxLongTermFrameIdx is set equal to 0. Otherwise (the current picture is not an IDR picture), the following applies: adaptive_ref_pic_marking_mode_flag is equal to 0, the process specified in clause 8.2.5.3 is invoked. Otherwise (adaptive_ref_pic_marking_mode_flag is equal to 1), the process specified in clause 8.2.5.4 is invoked. 3. When the current picture is not an IDR picture and it was not marked as "used for long-term reference" by memory_management_control_operation, equal to 6, it is marked as "used for short-term reference". It is a requirement of bitstream conformance that, after marking the current decoded reference picture, the total number of frames with at least one field marked as "used for reference", plus the number of complementary field pairs with at least one field marked as "used for reference", plus the number of non-paired fields marked as "used for reference" shall not be greater than Max(max_num_ref_frames, 8.2.5.2 Decoding process for gaps in frame_num This process is invoked when frame num is not equal to PrevRefFrameNum and is not equal to (PrevRefFrameNum + % MaxFrameNum. NOTE 1 - Although this process is specified as a subc