01org/libyami — pull request #43 by zhongcong (2014-06-13 08:12:28+00:00)
Title: h264dec: fix long term ref picture mark as unused for reference bug.

Follow 8.2.5.4.4 All pictures for which LongTermFrameIdx
is greater than max_long_term_frame_idx_plus1 ? 1 and
that are marked as "used for long-term reference" are
marked as "unused for reference".

VaapiPictureH264 use int32_t hold longTermFrameIdx,
but uint32_t is used to held longTermFrameIdx in
*execRefPicMarkingAdaptive1* function, and some clips
have nagtive longTermFrameIdx(-1) when mmco equals to 4,
like MR3_TANDBERG_B.264.

No long term ref picture will be marked as "unused for reference",
because DPBLayer->longRef[i]->longTermFrameIdx can not larger than
(unsigned -1).

Code is as follows:
/*
* for (i = 0; i < DPBLayer->longRefCount; i++) {
* if (DPBLayer->longRef[i]->m_longTermFrameIdx <=
* longTermFrameIdx)
* continue;
* setH264PictureReference(DPBLayer->longRef[i], 0, false);
* ARRAY_REMOVE_INDEX(DPBLayer->longRef, i);
* i--;
* }
*/

Signed-off-by: Zhong Cong