l. NOTE 1 - When gaps_in_frame_num_value_allowed_flag is equal to 1, encoders should use reference picture list modification to ensure proper operation of the decoding process (particularly when pic_order_cnt_type is equal to 0, in which case PicOrderCnt() is not inferred for "non-existing" frames). Rec. ITU-T H.264 (01/2012) The reference picture list RefPicList0 is ordered such that short-term reference entries have lower indices than long-term reference entries. It is ordered as follows: 1. Let entryShortTerm be a variable ranging over all reference entries that are currently marked as "used for short-term reference". When some values of entryShortTerm are present having PicOrderCnt( entryShortTerm ) less than PicOrderCnt( CurrPic), these values of entryShortTerm are placed at the beginning of refPicList0 in descending order of PicOrderCnt( entryShortTerm). All of the remaining values of entryShortTerm (when present) are then appended to refPicList0 in ascending order of PicOrderCnt( entryShortTerm ). 2. The long-term reference entries are ordered starting with the long-term reference entry that has the lowest LongTermPicNum value and proceeding through in ascending order to the long-term reference entry that has the highest LongTermPicNum value. The reference picture list RefPicList1 is ordered SO that short-term reference entries have lower indices than long-term reference entries. It is ordered as follows: 1. Let entryShortTerm be a variable ranging over all reference entries that are currently marked as "used for short-term reference". When some values of entryShortTerm are present having PicOrderCnt( entryShortTerm ) greater than PicOrderCnt( CurrPic), these values of entryShortTerm are placed at the beginning of refPicList1 in ascending order of PicOrderCnt( entryShortTerm ). All of the remaining values of entryShortTerm (when present) are then appended to refPicList1 in descending order of PicOrderCnt( entryShortTerm ). 2. Long-term reference entries are ordered starting with the long-term reference fra