Commit graph

187 commits

Author SHA1 Message Date
Hamsalekha S
a54dcc6338 Decoder: Fixed overflow in refernce list creation.
am: cbcd2846fa

Change-Id: Ic4d5c775bfeb8950f07145c9441130ea295bdfa5
2017-07-10 18:49:51 +00:00
Hamsalekha S
cbcd2846fa Decoder: Fixed overflow in refernce list creation.
Since the maximum value of long term index is 255,
the loop control variable needs to be 32 bit.

Bug: 38448381
Test: ran POC before/after applying fix
Change-Id: Iae3ecff38d4a922bde10fde33f1cfcafd2ea2680
2017-07-07 10:34:44 -07:00
Hamsalekha S
278ed70003 Initialize DPB structures to valid values.
am: b8d362561e

Change-Id: I6025560875e3234a3cc99d316e1ccd46109ef269
2017-06-26 21:40:11 +00:00
Hamsalekha S
b8d362561e Initialize DPB structures to valid values.
When the first frame is a B frame, the colocated picture
will now point to the current frame.

Test: run poc with and without this patch
Bug: 38115076
Change-Id: I48a8f128740551d6a9252931dafcf8c629ecad0d
2017-06-20 20:34:06 +00:00
Hamsalekha S
f0d2caa214 Added error check for output buffer size.
am: 3f6c941de5

Change-Id: I5b06314d7b3d0fb699160ba1326ecb31aedf3082
2017-06-19 20:02:48 +00:00
Hamsalekha S
3f6c941de5 Added error check for output buffer size.
The output buffer size given by the application, needs to be checked
in every process call. This is required in the case of resolution
change.

Bug: 36006815
Test: avcdec -i poc.bin
Change-Id: I16a92cdad23eb7b1e12c1a67c1b2599204f29249
2017-06-16 17:41:23 -07:00
Ray Essick
5ecccccbd7 Merge "Fixed hang in the case of multiple sps id." into mnc-dev
am: 16b019a620

Change-Id: Id1c0b6150c192718b69db226a373532f723843a7
2017-06-06 23:58:05 +00:00
Ray Essick
16b019a620 Merge "Fixed hang in the case of multiple sps id." into mnc-dev 2017-06-06 23:48:10 +00:00
Hamsalekha S
4bbbcfe76d Merge "Decoder: Fix in the case of MMCO 6" into mnc-dev
am: 6b3d20c032

Change-Id: I7cc789a4b548e19077559799096e927d44ffdbb0
2017-06-06 22:58:00 +00:00
TreeHugger Robot
6b3d20c032 Merge "Decoder: Fix in the case of MMCO 6" into mnc-dev 2017-06-06 22:54:33 +00:00
Hamsalekha S
a0cec24429 Decoder: Cleaned up parse sps function.
am: 4eb72f7c93

Change-Id: I7dd751c7a00e07e7930338e4c87366638b260697
2017-06-06 22:16:25 +00:00
Hamsalekha S
41489f9ece Decoder: Fix in the case of MMCO 6
Added an error check in the case of MMCO 6
(SET_LT_INDEX)

Bug: 38014992
Test: POC fails before / works after patch
Change-Id: I76e38a8e2ff0bab043b47f44f1f7b1d4fe60d416
(cherry picked from commit 9e4f0ce704)
2017-06-06 21:37:21 +00:00
Hamsalekha S
ec3f585000 Fixed hang in the case of multiple sps id.
The sps parameters used to detect change in
resolution/sps were incorrect. Made a fix to
use current sps from decoder context.

Bug: 38239864

Change-Id: I2d110e635ced32b3dc7f364e08a97d672fcbae37
(cherry picked from commit 8c6fe35f6d)
2017-06-06 21:22:17 +00:00
Hamsalekha S
4eb72f7c93 Decoder: Cleaned up parse sps function.
Postponed the initializations to decoder context
till the end of the parse sps function, after
all the error checks are done.

Bug: 37968755
Test: ran poc on ASAN-enabled build before/after
Change-Id: Ibee3383c28cede3edb68d2459565d6ce10683bbd
2017-06-06 21:05:07 +00:00
Marco Nelissen
d98f1cf41b Merge "Initializing reference list for every P/B slice." into mnc-dev
am: 3477b8e0d7

Change-Id: I0ccb9c141c7e7e1b8be6e8e6ddc1c333c10a8662
2017-06-06 20:27:41 +00:00
Marco Nelissen
3477b8e0d7 Merge "Initializing reference list for every P/B slice." into mnc-dev 2017-06-06 20:14:42 +00:00
Hamsalekha S
252ca18add Merge "Fix resolution change within a decode call." into mnc-dev
am: 7fc42b801c

Change-Id: Ib6f3680beb6e5d837f2140eed3107a23491f99f6
2017-06-06 17:39:59 +00:00
TreeHugger Robot
7fc42b801c Merge "Fix resolution change within a decode call." into mnc-dev 2017-06-06 17:32:41 +00:00
Hamsalekha S
fe18375850 Fix resolution change within a decode call.
If resolution changes within a decode call,due to multiple
sps, the decoder hangs as the the application will
give the same data again in the next decode call. This
results in a hang. Fixed this by flaging an error,
when sps/resoultion changes within a process call.

Bug: 38487564
Test: ran POC on patched O-based system w/o hanging
Change-Id: I30095b2e8bf573c1a58a316a23b1a5e6a4af589b
2017-06-05 13:28:44 -07:00
TreeHugger Robot
0a91df5eca Merge "DO NOT MERGE Decoder: Fixed allocation size of pred info buffer" into mnc-dev 2017-06-02 18:40:21 +00:00
TreeHugger Robot
94660850f0 Merge "Decoder: Fixed allocation size of pred info buffer" into mnc-dr-dev 2017-06-02 18:40:21 +00:00
Hamsalekha S
f9d3f9af8f Initializing reference list for every P/B slice.
Reference list needs to be initialized for every P/B
slice, to ensure colocated picture always points to a
valid picture buffer, even in the case of error.

Bug: 36279112

Change-Id: I051d7e725b0af209cc7bb333db8da3518adf78a0
2017-06-02 10:22:52 -07:00
Marco Nelissen
a0ae601cb3 Merge "Decoder: Initialize MB info buffer to zero." into mnc-dr-dev 2017-05-17 17:12:37 +00:00
Hamsalekha S
65077f6cfe Merge "Decoder: Fix end of bitstream error." into mnc-dev
am: 810356f4de

Change-Id: Ibca3bfa3cd3dc50a53c02a2d972cf41b10ac5848
2017-05-16 20:49:45 +00:00
TreeHugger Robot
810356f4de Merge "Decoder: Fix end of bitstream error." into mnc-dev 2017-05-16 20:36:28 +00:00
Marco Nelissen
db8f1ae73f Merge "Decoder: Fix allocation for Mbaff weight matrix" into mnc-dr-dev 2017-05-16 15:22:17 +00:00
Marco Nelissen
cb89747145 Merge "DO NOT MERGE Decoder: Fix allocation for Mbaff weight matrix" into mnc-dev 2017-05-16 15:22:10 +00:00
Hamsalekha S
9041bb17f7 Decoder: Initialize MB info buffer to zero.
Initialize the buffer used to store inter mb info
(reference index, weights etc) to zero.

Bug: 36035683

Change-Id: I23561a6a7fe852c0563a631d7ec6ab022cd78ccc
(cherry picked from commit 2575ae6c98)
2017-05-15 19:43:33 +00:00
TreeHugger Robot
b0399be998 Merge "DO NOT MERGE Fixed bug during resolution change" into mnc-dev 2017-05-15 18:45:41 +00:00
Hamsalekha S
6b8184944b DO NOT MERGE Fixed bug during resolution change
Modifies how i4_header_decoded is decoder context is used, to ensure
that resolution change is detected even if PPS has not been decoded.

This retrofits parts of the below mentioned 'merged-in' commits
which solve this for mnc-dr and later versions of the library. The retrofit
required dropping portions that affected code introduced in a later baseline.

Bug: 35583675
Test: provided input file no longer hangs
Change-Id: I8fa30543759c5762b18e2380513e2ce616c858ef
Merged-In: I0d248212aaf6635f34a70ad36657416a0c623d32
Merged-In: Ifd21ebe1827d6d0c13018983c46c4301c2bb1669
2017-05-15 10:22:55 -07:00
Hamsalekha S
9a5c62841e Merge "Decoder: Fixed flag u1_top_bottom_decoded." into mnc-dev
am: cc07eaa5d2

Change-Id: Ie410da29e20aed95d674aaaeddd683e1f616c448
2017-05-12 22:51:00 +00:00
TreeHugger Robot
cc07eaa5d2 Merge "Decoder: Fixed flag u1_top_bottom_decoded." into mnc-dev 2017-05-12 22:06:48 +00:00
Marco Nelissen
f7e747727c Merge "Decoder: Initialize MB info buffer to zero." into mnc-dev 2017-05-12 21:38:45 +00:00
Hamsalekha S
07db35ad5a Decoder: Fix allocation for Mbaff weight matrix
Increased the allocation size for Mbaff weight
matrix buffer

Bug: 36996978

Change-Id: I21cf2cb1010abdc6346f743f5237ae1730c4bf41
2017-05-12 14:11:10 -07:00
Hamsalekha S
60be1fe459 DO NOT MERGE Decoder: Fix allocation for Mbaff weight matrix
Increased the allocation size for Mbaff weight
matrix buffer

Bug: 36996978

Change-Id: I66c8ab24ec4083f16a86ffc9c0e36f5fd7785f92
2017-05-12 14:08:44 -07:00
Hamsalekha S
0f6a1883e8 Decoder: Added an error check while parsing PPS.
am: 62f98981ff

Change-Id: I2976869f34cf2a20078c3fe4504db9e6c5a3035d
2017-05-12 20:56:41 +00:00
Hamsalekha S
62f98981ff Decoder: Added an error check while parsing PPS.
Added an error check while parsing PPS syntax element
second_chroma_qp_index_offset.

Bug: 37207120

Change-Id: Icba6b7bcf5940505717ee61134ed801c221b6e26
2017-05-12 20:46:28 +00:00
Hamsalekha S
7703822731 Decoder: Fixed flag u1_top_bottom_decoded.
Fixed initialization of flag u1_top_bottom_decoded
in decoder context. This flag indicates if top
field and botton field is decoded.

Bug: 36993291
Test: avcdec --input poc.h264 --output /dev/null
Change-Id: I9f8a2620683abd8b15e4780d76d4849394710716
2017-05-12 20:14:46 +00:00
Hamsalekha S
9008aed514 Decoder: Fixed allocation size of pred info buffer
Buffer allocation size for pred info was increased
in the case number reference frames equal to 1.

Bug: 36998372
Change-Id: I1f84a16703422109d40bed8436f35d0c2069c088
2017-05-12 17:58:03 +00:00
Ray Essick
126058dcb2 Merge changes from topic 'b35583675-mnc-dr' into mnc-dr-dev
* changes:
  DO NOT MERGE Fixed bug in the case of resolution change.
  DO NOT MERGE Handle level/profile/num_ref_frames/num_reorder change at the same resolution
2017-05-12 17:42:26 +00:00
Hamsalekha S
2e01924cd6 Decoder: Fix end of bitstream error.
The end of bistream error check was fixed for
odd number of macroblocks in Mbaff frames.

Bug: 37008096
Test: Ittiam-verified
Change-Id: I058d74a3c1d1511968c2b36802dfc5c102947919
2017-05-11 17:11:25 -07:00
Hamsalekha S
6a5cb80068 DO NOT MERGE Decoder: Fixed allocation size of pred info buffer
Buffer allocation size for pred info was increased
in the case number reference frames equal to 1.

Bug: 36998372
Change-Id: I1f84a16703422109d40bed8436f35d0c2069c088
2017-05-11 15:09:57 -07:00
Hamsalekha S
b421b4bc3b Decoder: Initialize MB info buffer to zero.
Initialize the buffer used to store inter mb info
(reference index, weights etc) to zero.

Bug: 36035683

Change-Id: Ie3ea4307de45813edd553b590df44323be46534f
2017-05-11 12:07:10 -07:00
Harish Mahendrakar
cbaa0dc3f9 Fix stack buffer overflow in ih264d_process_intra_mb
am: f69e34419b

Change-Id: I154d8dd94d11be2d34b8085c30e24f6bec62d9eb
2017-05-10 16:20:37 +00:00
Harish Mahendrakar
f69e34419b Fix stack buffer overflow in ih264d_process_intra_mb
Aligned the sizes of au1_ngbr_pels to ensure SSE42 functions do not
result in stack buffer overflow

Bug: 36490809

Change-Id: I0bfe493f94647046013759b3ec9db3c627ac471e
2017-05-10 15:58:24 +00:00
Hamsalekha S
8454dbfccd DO NOT MERGE Fixed bug in the case of resolution change.
Modified the way i4_header_decoded in decoder context
is used, to ensure that resolution change is detected
even if PPS has not been decoded.

Cherry pick of Change-Id: Ibb3f8dfbeb66a999fd81720a7d2a02dd951a55c4
which went into master post-N.

Bug: 35583675
Test: ran POC, no longer hangs
Change-Id: Ifd21ebe1827d6d0c13018983c46c4301c2bb1669
2017-04-12 10:26:46 -07:00
Wonsik Kim
142221a3f9 DO NOT MERGE Handle level/profile/num_ref_frames/num_reorder change at the same resolution
Cherry pick of Change-Id: Ifa78c3125ab207ce5e39166f4891cba0d3a4e39c
which went into master (post-n). This needed backporting to M so that
the final fix for 35583675 could be integrated.

Bug: 35583675
Test: ran POC without failure
Change-Id: I0d248212aaf6635f34a70ad36657416a0c623d32
2017-04-12 10:23:33 -07:00
Marco Nelissen
9208f9461f Merge "Decoder: Fix in reference list initialization." into mnc-dev
am: 0015860fdc

Change-Id: I731793974cd3607fed07cb7895234e5f9484a0ea
2017-04-06 23:10:11 +00:00
Marco Nelissen
0015860fdc Merge "Decoder: Fix in reference list initialization." into mnc-dev 2017-04-06 23:00:48 +00:00
Ray Essick
ba33452066 Merge "Decoder: Fixes in accessing mbaff flag in error cases" into mnc-dev
am: 7ace2f5ca2

Change-Id: I5dde0d284cb06fa2faddae483900df1102d9bc52
2017-04-05 23:36:35 +00:00