 being 0 or 1). Output of this process is an incremented index refIdxLX. The following procedure is conducted to place the picture with long-term picture number long_term_pic_num into the index position refIdxLX, shift the position of any other remaining pictures to later in the list, and increment the value of refIdxLX. for( cldx cIdx-- ) RefPicListX| cIdx |=RefPicListX[cIdx-1] RefPicListX| refIdxLX++ = long-term reference picture with LongTermPicNum equal to long_term_pic_num nIdx = refIdxLX for( cIdx = refIdxLX; cIdx <=num_ref_idx_IX_active_minus1+1;cdx++) (8-38) if(LongTermPicNumF(RefPicListX[cIdx]) !=long_term_pic_num) RefPicListX[nIdx++]=RefPicListX[cIdx] where the function LongTermPicNumF(RefPicListX[cIdx ]) is derived as follows: If the picture RefPicListX[ cIdx is marked as "used for long-term reference", LongTermPicNumF(RefPicListX[cIdx]) is the LongTermPicNum of the picture RefPicListX[ cIdx Otherwise (the picture RefPicListX[ cIdx ] is not marked as "used for long-term reference"), LongTermPicNumF(RefPicListX[cIdx]) is equal to 2 * (MaxLongTermFrameIdx + 1). NOTE 1 - A value of (MaxLongTermFrameIdx + 1) can never be equal to long_term_pic_num. NOTE 2 - Within this pseudo-code procedure, the length of the list RefPicListX is temporarily made one element longer than the length needed for the final list. After the execution of this procedure, only elements 0 through num_ref_idx_IX_active_minus1 of the list need to be retained. 8.2.5 Decoded reference picture marking process This process is invoked for decoded pictures when nal_ref_idc is not equal to 0. NOTE 1 - The decoding process for gaps in frame_num that is specified in clause 8.2.5.2 may also be invoked when nal_ref_idc is equal to 0, as specified in clause 8. A decoded picture with not equal to 0, referred to as a reference picture, is marked as "used for short-term reference" or "used for long-term reference". For a decoded reference frame, both of its fields are marked the same as the frame. For a complementary reference field pair, the pair is 