Merge "decoder: Reset slice header at start of slice header decode" into oc-dev am: 930597cb2e am: 588f78b7d7 am: 7b1140f957 am: 399938e52e am: 7aa6102559
am: 8bfa119917

Change-Id: I03efa8acbeeed1e82a49ac632a78a777b3419452
diff --git a/common/ivd.h b/common/ivd.h
index fe39a78..a3dae2d 100644
--- a/common/ivd.h
+++ b/common/ivd.h
@@ -484,6 +484,17 @@
      * disp_buf_id
      */
     UWORD32                                 u4_disp_buf_id;
+
+    /**
+     * reorder_depth
+     */
+    WORD32                                  i4_reorder_depth;
+
+    /**
+     * display index
+     */
+    WORD32                                  i4_display_index;
+
 }ivd_video_decode_op_t;
 
 
diff --git a/decoder/ihevcd_decode.c b/decoder/ihevcd_decode.c
index 1295687..16ed36b 100644
--- a/decoder/ihevcd_decode.c
+++ b/decoder/ihevcd_decode.c
@@ -207,6 +207,8 @@
 
     ps_dec_op->u4_output_present = 0;
     ps_dec_op->u4_progressive_frame_flag = 1;
+    ps_dec_op->i4_display_index = -1;
+    ps_dec_op->i4_reorder_depth = -1;
     if(ps_codec->i4_sps_done)
     {
         sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id);
@@ -217,6 +219,8 @@
         {
             ps_dec_op->u4_progressive_frame_flag = 0;
         }
+        ps_dec_op->i4_reorder_depth =
+                        ps_sps->ai1_sps_max_num_reorder_pics[ps_sps->i1_sps_max_sub_layers - 1];
     }
 
     ps_dec_op->u4_is_ref_flag = 1;
@@ -224,7 +228,6 @@
     ps_dec_op->u4_is_ref_flag = 1;
 
     ps_dec_op->e4_fld_type = IV_FLD_TYPE_DEFAULT;
-
     ps_dec_op->u4_ts = (UWORD32)(-1);
     ps_dec_op->u4_disp_buf_id = ps_codec->i4_disp_buf_id;
     if(ps_codec->i4_flush_mode)
@@ -264,6 +267,7 @@
                     break;
             }
         }
+        ps_dec_op->i4_display_index = ps_disp_buf->i4_abs_poc;
         ps_dec_op->u4_output_present = 1;
         ps_dec_op->u4_ts = ps_disp_buf->u4_ts;
         if((ps_codec->i4_flush_mode == 0) && (ps_codec->s_parse.i4_end_of_frame == 0))