summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVenkatarama Avadhani <venkatarama.avadhani@ittiam.com>2017-05-30 09:18:44 +0530
committerIvan Kutepov <its.kutepov@gmail.com>2017-08-13 19:02:59 +0300
commitabe50940c95727d1b878216190aff7d11abd37d1 (patch)
tree4d02e14ac6c4d9ed70274216680af11ee595d7e0
parent4f5d50b9cc0cbf5a67e386c163e48775279d3eae (diff)
downloadandroid_external_libmpeg2-abe50940c95727d1b878216190aff7d11abd37d1.tar.gz
android_external_libmpeg2-abe50940c95727d1b878216190aff7d11abd37d1.tar.bz2
android_external_libmpeg2-abe50940c95727d1b878216190aff7d11abd37d1.zip
Update mbs_left In Case Of Missing Slice
If a vertical slice position is read different from the current decode position, the u2_mb_y and u2_mb_x values were updated but the number of MBs left to decode was not. Adding code to do the same. Bug: 37273547 Change-Id: I8e4df576525eb0536446532967eb1fdbd4f5af4a (cherry picked from commit f013a814f7765f3da1f26acfe003d3f16402735c)
-rw-r--r--decoder/impeg2d_dec_hdr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/decoder/impeg2d_dec_hdr.c b/decoder/impeg2d_dec_hdr.c
index a1b61ab..99c659c 100644
--- a/decoder/impeg2d_dec_hdr.c
+++ b/decoder/impeg2d_dec_hdr.c
@@ -796,6 +796,12 @@ IMPEG2D_ERROR_CODES_T impeg2d_dec_slice(dec_state_t *ps_dec)
{
ps_dec->u2_mb_y = u4_slice_vertical_position;
ps_dec->u2_mb_x = 0;
+
+ /* Update the number of MBs left, since we have probably missed a slice
+ * (that's why we see a mismatch between u2_mb_y and current position).
+ */
+ ps_dec->u2_num_mbs_left = (ps_dec->u2_num_vert_mb - ps_dec->u2_mb_y)
+ * ps_dec->u2_num_horiz_mb;
}
ps_dec->u2_first_mb = 1;