Commit graph

170 commits

Author SHA1 Message Date
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
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
Ray Essick
7ace2f5ca2 Merge "Decoder: Fixes in accessing mbaff flag in error cases" into mnc-dev 2017-04-05 23:29:45 +00:00
Ray Essick
bfb5f29471 Merge "Fix in the case of MMCO 3 (long term reference idx)." into mnc-dev
am: 64b617346c

Change-Id: Ia57a698ac23ee4abeefe194c8585301941984771
2017-04-05 21:13:56 +00:00
Ray Essick
64b617346c Merge "Fix in the case of MMCO 3 (long term reference idx)." into mnc-dev 2017-04-05 21:09:18 +00:00
Harish Mahendrakar
0f2f2b5fde Decoder: Fixes in accessing mbaff flag in error cases
ps_dec->ps_cur_slice->u1_mbaff_frame_flag is updated in ih264d_start_of_pic().
So updated value should be used after calling ih264d_start_of_pic()

Bug: 33974623
Test: ran POC from bug
Change-Id: I0f1ff5e01ed39767f493f197791e51b0da74952f
(cherry picked from commit 3f6937a003)
2017-03-23 23:46:33 +00:00
Hamsalekha S
93954f5e9a Decoder: Fix in reference list initialization.
In the case of error, initialize the new reference list1 with the first
picture in default list0 instead of default list1, as first picture in
list1 could still be invalid.

Bug: 36035074

Change-Id: I7ab493ee7a157cbefcd4da8389ff1ff899c16b7f
2017-03-22 16:55:01 +00:00
Ray Essick
cd5ebec24a Merge "Decoder: Fixed error handling for dangling fields" into mnc-dev
am: 78334b2a24

Change-Id: Id5cb9826e72c59890526300ad9e8833b61691c20
2017-03-14 22:15:20 +00:00
Ray Essick
78334b2a24 Merge "Decoder: Fixed error handling for dangling fields" into mnc-dev 2017-03-14 22:08:38 +00:00
Hamsalekha S
46e96d40db Fix in the case of MMCO 3 (long term reference idx).
Increment number of long term reference buffers only when both top field
and bottom field have been set as long term.

[backport for M/N from master]

Bug: 35584425
Test: ran POC - no hang, no segfault.

Change-Id: I94e3857944da675eda38f8e1a9bd887f48bff524
(cherry picked from commit 6fa5df8811)
2017-03-04 20:13:09 +00:00
Marco Nelissen
37345554fe resolve merge conflicts of 3654ad0 to mnc-dr-dev
Bug: 33818508
Bug: 34013472
Change-Id: I2e99cbceba1c00555d624e8975522725e362362b
2017-02-14 13:49:16 -08:00
Marco Nelissen
3654ad0da5 Merge changes Iec2941f1,I38be0e4c into mnc-dev
* changes:
  Decoder: Add supported width check for MBaff streams
  Decoder: Added a check for unsupported resolutions
2017-02-14 21:30:39 +00:00
Harish Mahendrakar
16fa990ce1 Decoder: Fixed initialization of first_slice_in_pic
am: 0b23c81c3d

Change-Id: I55e49ca9616a151456342bad7673d0986098b448
2017-02-14 17:03:06 +00:00
Harish Mahendrakar
ba7f9e2aed Decoder: Moved end of pic processing to end of decode call
am: 494561291a

Change-Id: Id3867f5dd0788f12f6827ed311a309d1fa58c535
2017-02-14 17:00:16 +00:00
Harish Mahendrakar
8b75cdae9b Decoder: Treat first slice in a picture as part of new picture always
am: 8b5fd8f24e

Change-Id: Ia14e9fae4a08143ff86439b5440ab9cf5e3052e3
2017-02-14 17:00:07 +00:00
Harish Mahendrakar
0b23c81c3d Decoder: Fixed initialization of first_slice_in_pic
To handle some errors, first_slice_in_pic was being set to 2.
This is now cleaned up and first_slice_in_pic is set to 1 only once per pic.
This will ensure picture level initializations are done only once even in case
of error clips

Bug: 33717589
Bug: 33551775
Bug: 33716442
Bug: 33677995

Change-Id: If341436b3cbaa724017eedddd88c2e6fac36d8ba
2017-02-14 16:59:09 +00:00
Harish Mahendrakar
494561291a Decoder: Moved end of pic processing to end of decode call
ih264d_end_of_pic() was called after parsing slice of a new picture.
This is now being done at the end of decode of the current picture.
decode_gaps_in_frame_num which needs frame_num of new slice is now
done after decoding frame_num in new slice.

This helps in handling errors in picaff streams with gaps in frames

Bug: 33588051
Bug: 33641588
Bug: 34097231
Change-Id: I1a26e611aaa2c19e2043e05a210849bd21b22220
2017-02-14 16:58:07 +00:00
Harish Mahendrakar
8b5fd8f24e Decoder: Treat first slice in a picture as part of new picture always
This is needed to decode streams with consecutive IDRs.

Bug: 34097231
Test: successful run of POC in security bug
Change-Id: Ib737a4ef4b8c5bb7a57c90292102dd28af0615fe
2017-02-14 04:41:02 +00:00
Harish Mahendrakar
69b5191865 Decoder: Add supported width check for MBaff streams
In case of MBAff streams, decoder processes two rows at a time,
this limits maximum supported width to 1920 for MBAff streams.

Bug: 33818508
Bug: 34013472
Change-Id: Iec2941f116cf3c36b63013a930319960023a3b42
2017-02-13 15:30:57 -08:00