Commit graph

57 commits

Author SHA1 Message Date
Marco Nelissen
4e0cdd450e Merge "Decoder: Padded gau1_ih264d_top_left_mb_part_indx_mod to avoid an out of bound read" into mnc-dev 2017-01-18 17:25:17 +00:00
TreeHugger Robot
e74ab7dba4 Merge "Decoder: Fixed DoS in header decode when no PPS is present" into mnc-dev 2017-01-18 00:23:33 +00:00
Harish Mahendrakar
b88f59d835 Decoder: Padded gau1_ih264d_top_left_mb_part_indx_mod to avoid an out of bound read
Change-Id: Ie8761de856ed8c7d08f3da61631c1bef446448e6
2017-01-17 16:12:12 -08:00
Harish Mahendrakar
2cd2f7a335 Decoder: Fixed DoS in header decode when no PPS is present
When the input does not contain PPS and decoder is in header decode
mode, decoder was entering an infinite loop.

Bug: 33621215
(cherry picked from commit 33e1b190d6db09bd72a9f0f51acef4b14eabd6ff)
2017-01-17 15:25:13 -08:00
Marco Nelissen
c4f317b873 Merge "Decoder: Fixed number of MB calculation for interlaced error streams" into mnc-dev 2017-01-17 20:27:24 +00:00
Harish Mahendrakar
99a85bb469 Decoder: Fixed an out of bound access while parsing SEI
Invalid SPS Id read was resulting in an out of bound read
Bug: 33552073
Change-Id: Ie5b80222fc7ac3a64475340371be0facdf999d7b

(cherry picked from commit d3d60c6a5d7ab605d19b9ac4b95bc227b7b870dc)
2017-01-13 10:33:18 -08:00
Marco Nelissen
9c2c615c92 Merge "Call ih264d_deblock_display only for valid process calls" into mnc-dev 2017-01-09 16:58:51 +00:00
Marco Nelissen
d1ebbd7139 Merge "Decoder: Fix in MB count in MBAff error handling" into mnc-dev 2017-01-09 15:58:25 +00:00
Harish Mahendrakar
e1cf7ea8ae Decoder: Fixed number of MB calculation for interlaced error streams
At the end of picture processing, if the current pic is partially
decoded, number of MBs to be processed was wrongly calculated for
interlaced cases.

Bug: 33129467
Change-Id: Ia81186c60d346f02663607f2dc14166781db6a69
2016-12-28 15:07:09 -08:00
Harish Mahendrakar
43e0aa2210 Decoder: Fix in MB count in MBAff error handling
Number of MBs to be marked as skip should be even for MBAff
error streams

Bug: 33450635
Change-Id: I6af59632e4b2d2882881fe8c52472164ea088f7a
2016-12-28 15:05:36 -08:00
Harish Mahendrakar
318368435f Call ih264d_deblock_display only for valid process calls
ih264d_deblock_display() should be called only if current
decoder call has got a picture buffer during start of pic

Bug: 33751193
Change-Id: I3bf2fdbb910bf7240484dae48b85d72833830d56
2016-12-28 15:03:10 -08:00
Harish Mahendrakar
902c15251f Decoder: Fixed cur_mb_info initialization in error cases
When number of MBs decoded in the current frame is zero and an error is
detected, MB info was unnecessarily decremented in multi-core case.

Bug: 33351708
Bug: 33298089
Bug: 33250932
Change-Id: I150c48c6fb382736f1de855ba5384c12bf84710d
2016-12-28 12:36:35 -08:00
Harish Mahendrakar
3ebff7dc62 Decoder: Fix in error concealment in the case of Mbaff clips
In case of MBAff clips, if error is detected after parsing odd MB,
then treat that odd MB also as error. All MBAff processing is done
as an MB-Pair.

Bug: 33298089
2016-12-28 12:36:15 -08:00
Harish Mahendrakar
56b5563f3e Decoder: Fix in the case of error in the first MB in frame.
In case of error in first MB in a frame, ps_dec->i4_submb_ofst
was decremented to result in negative offsets.

Bug: 33351708
2016-12-28 12:35:44 -08:00
Harish Mahendrakar
d1896deaf1 Decoder: Fix in returning incomplete frame error
In case a slice start code is found and picture decode is not complete
and a non slice NAL is encountered, then mark the current pic as incomplete

Bug: 33250932
Bug: 33139050

Change-Id: I9db4446338b307310805dba90c60c8cbdeee0739
2016-12-28 12:35:25 -08:00
Harish Mahendrakar
54cbe1b29b Decoder: Fix initialization of ps_next_dpb during reference list creation
ps_dpb_mgr->ps_dpb_ht_head is a linked list with
ps_dpb_mgr->u1_num_lt_ref_bufs number of valid buffers.
So ps_next_dbp has to be initialized to ps_dpb_mgr->ps_dpb_ht_head
for each u1_lt_index loop iteration

Bug: 33387820
Change-Id: I2dfd962bad5640a829afc123adbd0709e563e621
2016-12-28 12:33:39 -08:00
Harish Mahendrakar
d7eee555dc Decoder: Fix in checking for valid profile flags
Apart from Baseline, main and high profile, only extended profile
is supported provided, constraint_set0_flag or constraint_set1_flag are set to 1

Bug: 31999646
Change-Id: I3b62069efc49e222a7126fba0805fa9124aac8f2
2016-12-06 14:19:39 -08:00
Marco Nelissen
23d5bc6405 Merge "Decoder: Fixes in handling errors in Mbaff clips." into mnc-dev 2016-10-18 23:33:12 +00:00
TreeHugger Robot
b4a6d2037b Merge "Decoder: Ignore few dpb errors" into mnc-dev 2016-10-18 23:25:25 +00:00
Harish Mahendrakar
6676aeb419 Decoder: Fixes in handling errors in Mbaff clips.
Fixes mb_x, mb_y and first_mb_in_slice for Mbaff error streams

Bug: 30481714

Change-Id: Ie99f3b57e48a620a4bc7aee88031955a2e1b6753
2016-10-18 12:19:18 -07:00
Harish Mahendrakar
026745ef04 Decoder: Ignore few dpb errors
Ignore dpb errors, where decoder fails to release a non-existing picture
from reference lists. This is needed to decode streams where few pictures
are missing.

Change-Id: I8ece68cb1fa22473029e16158cd86ce7a197027a
2016-10-18 12:19:06 -07:00
Harish Mahendrakar
bc71ad2d43 Decoder: Fixes for handling errors in multi-slice MB Aff streams
Initialize default reference buffer for erroneous interlaced clips
Pick slice_type from decode thread slice structure
Call start_of_pic only once

Bug: 30822755
Change-Id: I553c646446d99a626d62351aa1b385355191cdc3
2016-09-22 08:29:34 -07:00
Harish Mahendrakar
c2e8ffe451 Fix in the case of invalid SPS PPS
Bug: 31092462
Change-Id: I0e2ab5a1088717bbf36f6b0cf859b5a6e0f59c5d
2016-09-21 09:50:06 -07:00
Harish Mahendrakar
b926905ee2 Fixed error concealment when no MBs are decoded in the current pic
Bug: 29493002
Change-Id: I3fae547ddb0616b4e6579580985232bd3d65881e
2016-07-13 17:32:27 -07:00
Ray Essick
daefcde2ed DO NOT MERGE ANYWHERE: Remove several memset() calls which overwrote buffers initialized
in buf_mgr_init().  Affects 6.0 only.
2016-06-23 22:07:15 +00:00
Robert Shih
b9d7cba8bf Merge "Decoder: Initialize first_pb_nal_in_pic for error slices" into mnc-dev 2016-06-21 18:47:11 +00:00
Harish Mahendrakar
7a54468cf8 Decoder: Initialize first_pb_nal_in_pic for error slices
first_pb_nal_in_pic was uninitialized for error clips

Bug: 29023649

Change-Id: Ie4e0a94059c5f675bf619e31534846e2c2ca58ae
2016-06-16 17:28:19 -07:00
Harish Mahendrakar
3a419eac8d Decoder: Do not conceal slices with invalid SPS/PPS
Bug: 28835995
2016-06-14 13:43:54 -07:00
Marco Nelissen
2e88a2aa67 Merge "Decoder: Fix slice number increment for error clips" into mnc-dev 2016-06-10 21:21:44 +00:00
Harish Mahendrakar
5e4f64c074 Decoder: Fix slice number increment for error clips
Bug: 28673410
2016-06-09 08:31:55 -07:00
Harish Mahendrakar
cdfd7573ec Fix slice params for interlaced video
Bug: 28165661
Change-Id: I912a86bd78ebf0617fd2bc6eb2b5a61afc17bf53
2016-05-25 02:25:00 +00:00
Harish Mahendrakar
eacafb943c Decoder: Set u1_long_term_reference_flag to 0 for error concealment
For MBs which are in error, set u1_long_term_reference_flag to zero.
This ensures latest frame is used for concealment

Bug: 28470138
Change-Id: I58eab5bc1da277823f3dbb4103ba50867f8935dc
2016-05-23 21:26:38 +00:00
Harish Mahendrakar
33db7a0f4e Decoder: Initialize slice parameters before concealing error MBs
Also memset ps_dec_op structure to zero.
For error input, this ensures dimensions are initialized to zero

Bug: 28165661
Change-Id: I66eb2ddc5e02e74b7ff04da5f749443920f37141
2016-05-20 15:27:35 -07:00
Marco Nelissen
37579218eb Merge "Decoder: Fix for handling invalid intra mode" into mnc-dev 2016-05-13 22:20:17 +00:00
Harish Mahendrakar
43a1cf620f DO NOT MERGE. AVC decoder: init structures
Memset few structures to zero to handle error clips

Bug: 27907656
Change-Id: I517841fc8b6d674f7e4e3ebaf60dd2e42f1152ae
2016-05-11 08:18:59 -07:00
Harish Mahendrakar
f38d14c5d9 Decoder: Fix for handling invalid intra mode
Bug: 28165659
Change-Id: I2291a287c27291695f4f3d6e753b6bbd7dfd9e42
2016-05-10 10:35:27 -07:00
Harish Mahendrakar
ef3da4e699 Decoder: Fix stack underflow in CAVLC 4x4 parse functions
Bug: 26399350
Change-Id: Id768751672a7b093ab6e53d4fc0b3188d470920e
2016-02-22 14:54:08 -08:00
Harish Mahendrakar
c7a1cf4e0b Ensure ih264d_start_of_pic() is not repeated in ih264d_mark_err_slice_skip()
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
2016-02-22 14:27:52 -08:00
Naveen Kumar Ponnusamy
943323f1d9 Return error when there are more mmco params than allocated size
Bug: 25818142

Change-Id: I5c1b23985eeca5192b42703c627ca3d060e4e13d
2016-01-13 21:18:46 +00:00
Harish Mahendrakar
4a524d3a8a Decoder Update mb count after mb map is set.
Bug: 25928803

Change-Id: Iccc58a7dd1c5c6ea656dfca332cfb8dddba4de37
2016-01-07 11:08:06 -08:00
Harish Mahendrakar
2ee0c1bced Return error in SPS/PPS parsing when extra bytes are read from input
Bug: 24157524

Change-Id: I4b319ef8e23e1ba5f84f52b92f40ba7fb1429101
2015-09-18 14:12:13 -07:00
Hamsalekha S
8a50328131 Support for level greater than level at init in Decoder
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
2015-07-31 18:53:17 +00:00
Hamsalekha S
e789d1d2e2 Decoder: Fixed issues shown by Valgrind
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
2015-07-31 18:52:32 +00:00
Martin Storsjo
086dd8ea90 Don't declare variables after statements
This fixes building with compilers that are strict about the pre-C99
rule about having all variable declarations before statements.

Change-Id: I06dd0cc42a6dbe90025c3c913a0c8d9ffb0acbcb
2015-06-25 08:25:58 -07:00
Martin Storsjo
85a43d2fcf Fix string handling for generating version strings
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
2015-06-25 08:25:52 -07:00
Martin Storsjo
56378a82a6 Remove an unused and unnecessary function prototype and associated define
Change-Id: I61b30d0934715cddd54b66ea3b023b2316a0106f
2015-06-25 08:25:51 -07:00
Martin Storsjo
796c0d475a Remove unnecessary calls to ithread_exit
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
2015-06-25 08:25:44 -07:00
Hamsalekha S
9f0dcba9b4 Improved error resilience in decoder
Fixed buffer management for error cases
Fixed end of picture detection logic for multiple slice error cases
Fixed handling of incomplete frame, missing slices.

Change-Id: Iae447667e4d88869a8bf992180cacd77870b9877
2015-06-25 08:25:44 -07:00
Hamsalekha S
c080d57996 Moved check for level after check for resolution change.
This is required for DRC tests in CTS .

Change-Id: Icd0fe10d97c6ee55f8358682a578bddb58590de4
2015-06-25 08:25:42 -07:00
Hamsalekha S
9327d0ea03 Added support for level 52
Change-Id: Ib2fa0b02b408a7bb21b3115e5b1c1317706a7354
2015-06-25 08:25:42 -07:00