st/omx/dec/h265: set the default reference picture set for reference
authorLeo Liu <leo.liu@amd.com>
Fri, 23 Sep 2016 15:42:16 +0000 (11:42 -0400)
committerLeo Liu <leo.liu@amd.com>
Tue, 4 Oct 2016 15:09:59 +0000 (11:09 -0400)
It will fix the corruption for frame, that only has one stort term ref
picture set, we set NULL rps for this case previously, causing taking
incorrect reference. Instead we should take that only short term set
as reference

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/gallium/state_trackers/omx/vid_dec_h265.c

index f3bf66f783cadcd43760186f52f03603e58519ba..acd225d99210f0fe2d8ad89613108800d70d05e1 100644 (file)
@@ -656,7 +656,7 @@ static void slice_header(vid_dec_PrivateType *priv, struct vl_rbsp *rbsp,
    struct pipe_h265_sps *sps;
    bool first_slice_segment_in_pic_flag;
    bool dependent_slice_segment_flag = false;
-   struct ref_pic_set *rps = NULL;
+   struct ref_pic_set *rps;
    unsigned poc_lsb, poc_msb, slice_prev_poc;
    unsigned max_poc_lsb, prev_poc_lsb, prev_poc_msb;
    unsigned num_st_rps;
@@ -789,7 +789,9 @@ static void slice_header(vid_dec_PrivateType *priv, struct vl_rbsp *rbsp,
 
       rps = (struct ref_pic_set *)
          priv->codec_data.h265.ref_pic_set_list + idx;
-   }
+   } else
+      rps = (struct ref_pic_set *)
+         priv->codec_data.h265.ref_pic_set_list;
 
    if (is_bla_picture(nal_unit_type)) {
       rps->num_neg_pics = 0;