Also memset ps_dec_op structure to zero.
For error input, this ensures dimensions are initialized to zero
Bug: 28165661
Change-Id: I66eb2ddc5e02e74b7ff04da5f749443920f37141
am: 3fa6dfb504
* commit '3fa6dfb504':
Decoder: Memset few structures to zero to handle error clips
Change-Id: I466a1bea95cb6b89a12ffd8530a533817263432b
am: 370bd8625d
* commit '370bd8625d':
Decoder: Memset few structures to zero to handle error clips
Change-Id: Id2892ab521dfa71cfdba6536a19a6308b29e3088
In case of error in handling MMCO commpands/reference list creation,
ih264d_start_of_pic() was called again in ih264d_mark_err_slice_skip() resulting in
leaking a picture or an MV buffer in buffer manager.
To fix this, ensure prev_slice_err is set to 1 only if u4_pic_buf_got is zero, before
calling ih264d_mark_err_slice_skip() at the end of picture decode.
This will ensure ih264d_start_of_pic() is not repeated
Bug: 25818142
Change-Id: I7d5a9179533581eec663bc6a19a2901e7cce6af3
This removes unnecessary changes from build to build.
Bug: 24204119
Change-Id: I25258314fe56ea186d38d756fb5fb04aa689a812
(cherry picked from commit f197ccb756)
Decoder may read 8 extra bytes at the end of this buffer, though it will never be used
Setting it to zero will ensure unitialized reads are avoided
Change-Id: I724239861cb9fa64f3a70cb5450e094cb3afa20c
Once all the MBs are decoded, simply break from decode loops and do not signal an error
This will handle cases where there may be extra bytes at the end of picture data
Change-Id: I6d8ec918df5375f135e60f85b9a56ab2a5313a64
Fixed a NULL pointer reference, when flush is called before
decoding any pictures.
This was seen in following CTS test,
android.media.cts.DecoderTest#testCodecResetsH264WithSurface
Fixed code formatting issues in ih264d_set_flush_mode
Updated the testbench to call flush before decoding starts
Bug: 24405410
Change-Id: Ib04e0b15573b2482c9d5b43c8bc7dd30d8f8efdd
Memory allocations are now done based on contents of SPS
API changed to move allocations inside the library
Also changed strlen to strnlen
Bug: 24221026
Change-Id: I9130457f564cddb4da7ec6399cc9fe88ee871217
Added support to check num_ref_frames in SPS
and num_reorder_frames in VUI before returning error for level
Bug: 22860270
Change-Id: I392bab419385ca239836d200f9f2b064915a8a46
The slice header structure has now been initialized to 0
Fixed bug in closing of threads in the case of error.
Bug: 22860270
Change-Id: I777e0b73ad2f083c72be179984f5c1cb00ededb6
If ENTROPY_TRACE is defined, the value parameter gets evaluated
twice. Since this parameter includes ++, the pointer gets incremented
twice.
This fixes encoding with trace enabled.
Bug: 22860270
Change-Id: I3d71ac33d007301e488d264a33c7b5c4d4ff2b56
Now no picture in a gop will depend on any picture in the previous gop
All calls to force an IDR are respected as soon as possible
Bug: 22860270
Change-Id: Id2bcd5687c3fb786336a01894c1b9228d67a87a6
Even if this 4x4 block isn't at the bottom or right border,
the other 4x4 intra blocks within the same macroblock may
use it for intra prediction.
This fixes intra coded macroblocks in b-frames.
Bug: 22860270
Change-Id: Ifdf48c1b2bbf232e785d6d5b8244aacba1ad3dd6
Previously, if this field wasn't set, the invalid coding mode
could lead to crashes later.
Bug: 22860270
Change-Id: If8dd2f8d5f2fbdd6bb76772344f959df23159167
BIPRED ME was discarding the halfpel motion vector components
in cost computation. That is fixed now.
Bug: 22860270
Change-Id: If6c77096d701a258920b14134ff120fd1540f254
The stored i4_mb_distortion that was used as i4_max_sad previously
might come from a different coding mode - even if
pf_ime_compute_sad_16x16 returns early when i4_mb_distortion is
larger than ps_mb_ctxt_bi->i4_mb_distortion, the calculated i4_mb_cost
can still end up smaller than ps_mb_ctxt_bi->i4_mb_cost.
Therefore, set i4_max_sad to INT_MAX to avoid the early exit in
pf_ime_compute_sad_16x16 here, since it can't be used reliably (and
returning early can end up choosing a suboptimal mode).
This makes sure that the encoded output is identical when the SIMD
optimized routines are disabled, when using B-frames.
Bug: 22860270
Change-Id: I9b8d524f88020e557541700133c7a0b48fe6a3b8
When encoding in header mode, the s_inp_buf struct that was written
to ps_video_encode_op->s_ive_op.s_inp_buf was completely uninitialized.
In ih264e_input_queue_update, make sure to initialize u4_is_last
when skipping frames.
Bug: 22860270
Change-Id: I87e677acd00baf4f732ca7d35ee192e7f1f73994