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
This fixes building with compilers that are strict about the pre-C99
rule about having all variable declarations before statements.
Change-Id: I06dd0cc42a6dbe90025c3c913a0c8d9ffb0acbcb
Don't do concatenation with strncat; the length parameter in strncat
is only for how many chars to append at most, not for the full output
buffer size. To safely use strncat, one would have to do
strncat(buf, str, sizeof(buf) - strlen(buf)).
By using snprintf, we guarantee that the buffer is null terminated, and
we don't need to use strnlen at all.
(If compatibility with older MSVC versions that lack snprintf, one
can use _snprintf instead and manually add the null termination.)
Change-Id: I1c2322c7a406ddd5e6551a96c460da60deeffda1
The ithread_exit wrapper function behaves inconsistently across
platforms; on windows, the argument is a thread handle, denoting
the thread that will be exited. On pthreads, ithread_exit only
terminates the current thread, not any other thread.
These both calls are at the end of each thread function (and the one
with a non-null parameter refers to the handle of the thread itself),
so the thread will exit immediately anyway.
Change-Id: I21e43c56874729452bd80b28ff351e3c5d3f087e
Fixed the following bugs
Issue 21145276
Issue 21144884
Issue 21181133
Issue 21181134
Decoder now returns error if the level in stream is higher than level at init
Change-Id: I8892c62bd98f7854d046510330c05a1e9ca826b2
Resolved warnings seen in x86 modules
Fixed alignment of few modules
Updated comments in few arm modules for consistency
Fixed warnings seen in clang build
Change-Id: I0623169b5e84a6a6f09c3d2212e754101272f5e9
Added support for encoding non-multiple of 16 dimensions
Added support for encoding dimensions smaller than 64x64
Aligned coeff data to 4 byte boundary
Bug: 20554276
Change-Id: I111093950f94698296d8499a2845cfe2db6c557b