diff options
author | Venkatarama Avadhani <venkatarama.avadhani@ittiam.com> | 2017-10-09 23:27:11 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-10-09 23:27:11 +0000 |
commit | 8ffb648d7a8499f59d7018abe5943c815abb6b8e (patch) | |
tree | d88b4ab0ad5a5bcf5f4d1e3a6a968ae4d858e4e9 | |
parent | e9e57473da57c0a28e2e20a6100cb1c863d789bc (diff) | |
parent | 6885bab2daa8b37a750e40074ae084fbffa128de (diff) | |
download | libmpeg2-8ffb648d7a8499f59d7018abe5943c815abb6b8e.tar.gz |
Merge "Update num_mbs_left When mb_x is Reset." into mnc-dev am: f7cc570a1d
am: 6885bab2da
Change-Id: I66f689c95e3256a65837af91a2ed4c3179039e99
-rw-r--r-- | decoder/impeg2d_pnb_pic.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/decoder/impeg2d_pnb_pic.c b/decoder/impeg2d_pnb_pic.c index 570f0d2..a3ae436 100644 --- a/decoder/impeg2d_pnb_pic.c +++ b/decoder/impeg2d_pnb_pic.c @@ -122,6 +122,33 @@ WORD32 impeg2d_dec_p_mb_params(dec_state_t *ps_dec) impeg2d_dec_skip_mbs(ps_dec, (UWORD16)(u2_mb_addr_incr - 1)); } + else + { + + /****************************************************************/ + /* Section 6.3.17 */ + /* The first MB of a slice cannot be skipped */ + /* But the mb_addr_incr can be > 1, because at the beginning of */ + /* a slice, it indicates the offset from the last MB in the */ + /* previous row. Hence for the first slice in a row, the */ + /* mb_addr_incr needs to be 1. */ + /****************************************************************/ + /* MB_x is set to zero whenever MB_y changes. */ + ps_dec->u2_mb_x = u2_mb_addr_incr - 1; + /* For error resilience */ + ps_dec->u2_mb_x = MIN(ps_dec->u2_mb_x, (ps_dec->u2_num_horiz_mb - 1)); + 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_mb_x; + + /****************************************************************/ + /* mb_addr_incr is forced to 1 because in this decoder it is used */ + /* more as an indicator of the number of MBs skipped than the */ + /* as defined by the standard (Section 6.3.17) */ + /****************************************************************/ + u2_mb_addr_incr = 1; + ps_dec->u2_first_mb = 0; + + } } u4_next_word = (UWORD16)impeg2d_bit_stream_nxt(ps_stream,16); @@ -286,6 +313,8 @@ WORD32 impeg2d_dec_pnb_mb_params(dec_state_t *ps_dec) ps_dec->u2_mb_x = u2_mb_addr_incr - 1; /* For error resilience */ ps_dec->u2_mb_x = MIN(ps_dec->u2_mb_x, (ps_dec->u2_num_horiz_mb - 1)); + 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_mb_x; /****************************************************************/ /* mb_addr_incr is forced to 1 because in this decoder it is used */ |