Commit graph

280 commits

Author SHA1 Message Date
Ray Essick
e8faa24c74 Merge "Decoder: Fixes in accessing mbaff flag in error cases" into mnc-dev am: 7ace2f5ca2
am: ba33452066

Change-Id: I47fd70b83a28156ed65f6a9badd4375129b8235e
2017-04-05 23:39:05 +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
98a81bb017 Merge "Fix in the case of MMCO 3 (long term reference idx)." into mnc-dev am: 64b617346c
am: bfb5f29471

Change-Id: I4cfe55a4216baa64986c4d1966375cc92f8ab22b
2017-04-05 21:16:25 +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
Ray Essick
f48987d2fc Merge "Decoder: Fixed error handling for dangling fields" into mnc-dev am: 78334b2a24
am: cd5ebec24a

Change-Id: I47c0da6fb3609c0f31d59366ce7b3f89adbdec18
2017-03-14 22:20:20 +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
33d9d00a3c resolve merge conflicts of 3654ad0 to mnc-dr-dev
am: 37345554fe

Change-Id: I7117544d1e2c909e353b7df3c42cfc25a9919ecf
2017-02-14 22:55:05 +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
ab79eb3973 Decoder: Fixed initialization of first_slice_in_pic am: 0b23c81c3d
am: 16fa990ce1

Change-Id: Id1b05214b3f7d67fea7b7d0a01cbb53b0182c30e
2017-02-14 17:04:36 +00:00
Harish Mahendrakar
26bb8b98ee Decoder: Moved end of pic processing to end of decode call am: 494561291a
am: ba7f9e2aed

Change-Id: I0d8d0bb4265e458dbe1932bf9fc5ff11e367d909
2017-02-14 17:03:15 +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
fb68ae8960 Decoder: Treat first slice in a picture as part of new picture always am: 8b5fd8f24e
am: 8b75cdae9b

Change-Id: Iaadac2cc30016f8a47d85b7b73c130761bb6f004
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
f086bb9a89 DO NOT MERGE: Decoder: Fixes an out of bound write in bitstream buffer am: 1f0ab0b089 -s ours
am: 4543cf41ad

Change-Id: I1e9aee3d7423476c5662e3e89dd6adb2e0ea89bb
2017-02-14 00:18:09 +00:00
Harish Mahendrakar
4543cf41ad DO NOT MERGE: Decoder: Fixes an out of bound write in bitstream buffer
am: 1f0ab0b089  -s ours

Change-Id: Ifeab263e38c6c3ff67d6e2fe432f0b1596c17844
2017-02-14 00:15:09 +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
Harish Mahendrakar
9d60a0c5da Decoder: Added a check for unsupported resolutions
Decoder now returns an error for resolutions greater than 3840x2176

Bug: 24542936

Change-Id: I38be0e4c5cf2a980bfd4c781f3b49171f73b5ccb
2017-02-13 15:30:46 -08:00
Harish Mahendrakar
1f0ab0b089 DO NOT MERGE: Decoder: Fixes an out of bound write in bitstream buffer
[this is for mnc-dev only, not any other mnc-*-dev flavors;
there is a different patch for mnc-dr-dev, nyc-* and going forward]

After emulation prevention, data is written as an int,
so at least 3 additional bytes should be available.
And since bitstream functions read 8 bytes ahead, 8 extra bytes
should be available in the bitstream buffer.

Bug: 33934721
Test: Ittiam testing, POC in the bug no longer fails
Change-Id: I444ec6f85d01b0bade9f827e15c4b476779d6c69
2017-02-13 14:44:11 -08:00
Ray Essick
f0bcc3dfaa Merge "Decoder: Return correct error code for slice header errors" into mnc-dev am: 51ecbcabfb
am: cf05624312

Change-Id: I642526e91c98d11d0838c3a662a3a14536577926
2017-02-13 19:23:36 +00:00
Ray Essick
0fbfecd7ce Merge "Decoder: Initialize default reference buffers for all pictures" into mnc-dev am: d61abc5195
am: 16306f7347

Change-Id: I8cc48a17cfd4d1c2d1f4234c36e88bc17d0b8daf
2017-02-13 19:23:27 +00:00
Harish Mahendrakar
f23ebcfab1 Fix in returning end of bitstream error for MBAFF am: 7950bf47b6
am: 73f74a84e1

Change-Id: Iac07d54ca71b79f6380c3f5c3d4106838bb76642
2017-02-13 19:23:18 +00:00
Ray Essick
cf05624312 Merge "Decoder: Return correct error code for slice header errors" into mnc-dev
am: 51ecbcabfb

Change-Id: Ib486869b38d66e1fb0fdeffe4316dce6a5ff9fd9
2017-02-13 19:21:06 +00:00
Ray Essick
16306f7347 Merge "Decoder: Initialize default reference buffers for all pictures" into mnc-dev
am: d61abc5195

Change-Id: Ieb21ecb1c3152bde97adc7cfcfc4d49afcafd93b
2017-02-13 19:20:57 +00:00
Harish Mahendrakar
73f74a84e1 Fix in returning end of bitstream error for MBAFF
am: 7950bf47b6

Change-Id: If45518b6d58c393313dbcb425f7aa2e7bec02056
2017-02-13 19:20:47 +00:00
Ray Essick
51ecbcabfb Merge "Decoder: Return correct error code for slice header errors" into mnc-dev 2017-02-13 19:15:36 +00:00
Ray Essick
d61abc5195 Merge "Decoder: Initialize default reference buffers for all pictures" into mnc-dev 2017-02-13 19:15:31 +00:00
Harish Mahendrakar
9a00f562a6 Decoder: Return correct error code for slice header errors
Return ERROR_INV_SLICE_HDR_T instead of ERROR_INV_SPS_PPS_T for slice
header errors.

Bug: 34097915
Change-Id: I45d14a71f2322ff349058baaf65fb0f3c1140fba
2017-02-13 19:14:59 +00:00
Harish Mahendrakar
f634481e94 Decoder: Initialize default reference buffers for all pictures
Reference buffer is now initialized to default value for
each pic before decoding the first slice in the pic

Bug: 34097866
Change-Id: Id64b123af2188217ce833f11db0e6c0681d41dfd
2017-02-13 19:14:50 +00:00
Harish Mahendrakar
7950bf47b6 Fix in returning end of bitstream error for MBAFF
In case of MBAFF streams, slices should terminate on
even MB boundary. If bytes are exhausted with odd number
of MBs decoded for MBAff, then treat that as error.

Bug: 33933140

Change-Id: Ifc26b66ff8ebdb3aec5c0d6c512e4cac3f54c5b7
2017-02-13 19:14:18 +00:00
Harish Mahendrakar
0aab4958fb Decoder: Fixes an out of bound write in bitstream buffer
am: 33ef7de9dd

Change-Id: If2ca8f044536549a32df1400c12099fa6bc562f1
2017-02-13 18:44:45 +00:00
Harish Mahendrakar
33ef7de9dd Decoder: Fixes an out of bound write in bitstream buffer
[for mnc-dr-dev and later;  mnc-dev gets a different patch]

After emulation prevention, data is written as an int,
so at least 3 additional bytes should be available.
And since bitstream functions read 8 bytes ahead, 8 extra bytes
should be available in the bitstream buffer.

Bug: 33934721

Change-Id: I444ec6f85d01b0bade9f827e15c4b476779d6c69
2017-01-19 09:17:00 -08:00
Ray Essick
ecfc52702b Merge "Decoder: Initialize ps_cur_slice->u1_mbaff_frame_flag correctly for error cases" into mnc-dev am: 43a184ad48
am: ab0e425406

Change-Id: I1174c079ff971a216438395ee42338a3fa151716
2017-01-18 21:13:19 +00:00
Harish Mahendrakar
18a58ec2b6 Decoder: Initialize ps_cur_slice->u1_mbaff_frame_flag correctly for error cases am: 1d5640f2f9
am: 5a26569fa3

Change-Id: Idd2a9b5a617326d2ee38908ba768085dad257f04
2017-01-18 21:13:12 +00:00
Ray Essick
ab0e425406 Merge "Decoder: Initialize ps_cur_slice->u1_mbaff_frame_flag correctly for error cases" into mnc-dev
am: 43a184ad48

Change-Id: I8886826d4c30c0dbfe0ace25ca87cca3fa015c7e
2017-01-18 21:11:12 +00:00
Harish Mahendrakar
5a26569fa3 Decoder: Initialize ps_cur_slice->u1_mbaff_frame_flag correctly for error cases
am: 1d5640f2f9

Change-Id: I32e960c752ccbc991f8ce04455618a534f1f52c7
2017-01-18 21:11:11 +00:00
Ray Essick
43a184ad48 Merge "Decoder: Initialize ps_cur_slice->u1_mbaff_frame_flag correctly for error cases" into mnc-dev 2017-01-18 21:00:19 +00:00
Marco Nelissen
7d4a72d887 Merge "DO NOT MERGE Decoder: Increase memory allocation for weights & offsets for interlaced clips" into mnc-dev am: d5424f66e3
am: ce26193738

Change-Id: I10906db63e6b8a747a2b5d3400132492b59d0e67
2017-01-18 18:54:04 +00:00
Harish Mahendrakar
d6086cb6ed DO NOT MERGE Decoder: Increase memory allocation for weights & offsets for interlaced clips am: 74f03b639e -s ours
am: 4aa4a30de2

Change-Id: I2a9fda1380d536f4a0353e6abe69d84519be0efe
2017-01-18 18:53:56 +00:00
Marco Nelissen
ce26193738 Merge "DO NOT MERGE Decoder: Increase memory allocation for weights & offsets for interlaced clips" into mnc-dev
am: d5424f66e3

Change-Id: Id752d251dda25afb5bd70f1d21b1e6b1bb14b631
2017-01-18 18:51:57 +00:00
Harish Mahendrakar
4aa4a30de2 DO NOT MERGE Decoder: Increase memory allocation for weights & offsets for interlaced clips
am: 74f03b639e  -s ours

Change-Id: If7fe4b318a65a452068b79ee1bc6577ea701ebe5
2017-01-18 18:51:57 +00:00