st/omx/dec/h264: fix picture out-of-order with poc type 0 v2
authorLeo Liu <leo.liu@amd.com>
Mon, 23 Feb 2015 18:50:06 +0000 (13:50 -0500)
committerLeo Liu <leo.liu@amd.com>
Tue, 24 Feb 2015 15:39:49 +0000 (10:39 -0500)
poc counter should be reset with IDR frame,
otherwise there would be a re-order issue with
frames before and after IDR

v2: add commit message

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
src/gallium/state_trackers/omx/vid_dec_h264.c

index 7b57785c28f0dbe3d05c0b379d65bcadcdc195da..e01e8739740c0bf073cc032e78750758bfd3179a 100644 (file)
@@ -706,6 +706,11 @@ static void slice_header(vid_dec_PrivateType *priv, struct vl_rbsp *rbsp,
       if (pic_order_cnt_lsb != priv->codec_data.h264.pic_order_cnt_lsb)
          vid_dec_h264_EndFrame(priv);
 
+      if (IdrPicFlag) {
+         priv->codec_data.h264.pic_order_cnt_msb = 0;
+         priv->codec_data.h264.pic_order_cnt_lsb = 0;
+      }
+
       if ((pic_order_cnt_lsb < priv->codec_data.h264.pic_order_cnt_lsb) &&
           (priv->codec_data.h264.pic_order_cnt_lsb - pic_order_cnt_lsb) >= (max_pic_order_cnt_lsb / 2))
          pic_order_cnt_msb = priv->codec_data.h264.pic_order_cnt_msb + max_pic_order_cnt_lsb;