Commit graph

69 commits

Author SHA1 Message Date
Vivek Jadhav
2f6371b3b8 libavcdec: Add support for 4096x4096 resolution
Bug:
Test: ./avcdec

Change-Id: Ie111f58e04bbd045e94167cdb978c571662567fb
2025-07-21 22:26:42 -07:00
Suyog Pawar
42068b0f6c libavc: Fix poc counts for idr slice
Test: Build
Change-Id: Ic9212b86efbc54724c09164776169bfeafb15d7b
2024-08-07 05:53:55 -07:00
Vivek Jadhav
972c0aa711 libavcdec: Fix timeout issue in AVC Decoder
Make use of cur_pps to compute the max number of frames
in decode gaps in frame num

Bug: oss-fuzz-61655
Test: avc_dec_fuzzer
2023-11-14 21:03:25 -08:00
Shivaansh Agrawal
0033e0fe5e Decoder: add support for QP and block_type map export in library
Bug: 175179303

Test: avcdec -c dec.cfg
Test: atest CtsMediaV2TestCases:CodecDecoderTest
Test: atest VtsHalMediaC2V1_0TargetVideoDecTest

Change-Id: I68f3a85aae1f4bca2c3e1eaad69d8eb7f23481b8
2022-05-17 09:55:20 +05:30
Shivaansh Agrawal
6efeedf063 Decoder: Fix integer overflow in parse slice
Bug: 165976727
Test: POC in bug description
Change-Id: Ia2c8ad5fe6e212d3910a9c91cda52c19f3fac120
2020-11-17 23:34:54 +05:30
Shivaansh Agrawal
2a28c97cd6 Decoder: Fix NPD issue in mmco function
Skip mmco buffer operations if mmco error in sequence

Bug: 168426116
Bug: 168426117
Test: POC in bug description
Change-Id: Ia4f3f48137152e211322ed97f2fafab2f45cb2c3
2020-09-16 17:07:13 +05:30
Ray Essick
adfbdd6c41 Merge "decoder: Update reorder depth to account for display latency" 2020-08-17 05:21:00 +00:00
Harish Mahendrakar
f792904577 decoder: Update reorder depth to account for display latency
Decoder returns output with an additional latency of 2.
reorder depth retured is now updated to account for this extra latency

Also move reorder_depth initialization to parse_sps()
Instead of initializing reorder_depth after decoding first picture,
initialize it in parse_sps().

Bug: 163127030
Test: poc in bug
Test: atest android.mediav2.cts

Change-Id: I94b35b2c5df5c910d0159548b168617946a19cc2
2020-08-13 19:23:26 -07:00
Shivaansh Agrawal
358b09305a decoder: fix integer overflow when setting i4_prev_max_display_seq
reset ps_dec->i4_prev_max_display_seq if out of int32 range
to avoid overflow

Bug: 143791121
Bug: 143791161
Test: POC in bug description
Change-Id: I3d8df556b003a7c739716bb33262ab3a6ca7b2d9
2020-07-29 04:39:31 +00:00
Aasaipriya Chandran
083b9fc086 Decoder: Fix Null dereference
Add checks to validate long term index and
max long term index parsed in MMCO commands.

Bug: 140358770
Bug: 140680655
Bug: 148772548
Bug: 152148135
Bug: 152434373
Bug: 152550528

Test: poc in bug
Change-Id: I9052ce7721491fdd5fb4807ec33e399cee8c70cf
2020-06-12 17:21:26 +05:30
Automerger Merge Worker
826a705863 Merge "decoder: Fix minimum poc calculation check while adding to display" into oc-dev am: 9d7a036d7b am: cebf26ab4d am: f64194a96f am: ed2b83d989 am: 4b7a562681 am: 8c2ee3ea8b
Change-Id: Idf10b1ae11ad8f376d0b3f2587bebeeece6126f1
2020-01-09 05:04:07 +00:00
Automerger Merge Worker
8c2ee3ea8b Merge "decoder: Fix minimum poc calculation check while adding to display" into oc-dev am: 9d7a036d7b am: cebf26ab4d am: f64194a96f am: ed2b83d989 am: 4b7a562681
Change-Id: I0966eed6f66382e3fa7ccc19558734cc202ed0f3
2020-01-09 04:51:33 +00:00
Automerger Merge Worker
4b7a562681 Merge "decoder: Fix minimum poc calculation check while adding to display" into oc-dev am: 9d7a036d7b am: cebf26ab4d am: f64194a96f am: ed2b83d989
Change-Id: I7feff45df303f49d95b4d5b07019929dead2810c
2020-01-09 04:38:27 +00:00
Automerger Merge Worker
f64194a96f Merge "decoder: Fix minimum poc calculation check while adding to display" into oc-dev am: 9d7a036d7b am: cebf26ab4d
Change-Id: Ib8872212d43d41ae25f28992b6c02ab15cb72b26
2020-01-09 04:06:39 +00:00
Harish Mahendrakar
ffcf2a87d6 decoder: Fix minimum poc calculation check while adding to display
While adding the decoded buffer to display queue, allow buffer with
poc set to 0x7FFFFFFF

Bug: 145364230
Test: poc in bug
Change-Id: I2a15f73b8422cfa4fd3360bc21c0cea4542a3375
2020-01-02 10:22:38 -08:00
Chamarthi Kishore
7684b467b4 Merge changes I015ebe03,Idc0b0db5
am: 00fa4b6490

Change-Id: I71e761af5fd1551643418dd7979491c2a6b7a7ee
2019-10-31 18:59:50 -07:00
Chamarthi Kishore
ad2eaf8c7d libavc: Add MDCV, CLL, CCV and AVE SEI messages
This commit add support for encoding and decoding of MDCV, CLL, CCV and
AVE SEI messages

Test: avcenc -c enc.cfg, avcdec -c dec.cfg
Bug: 141931623

Change-Id: Idc0b0db5291482ae2bc19cdff65669c32374b02a
2019-10-24 17:20:00 +05:30
Harish Mahendrakar
59b642608e Fix integer overflows in computing poc and pic numbers am: 1d672d2bea am: f2157c2dc1
am: 684b6687dc

Change-Id: Iec8807289080cb3c9c6081ba1ff59001983773ba
2019-09-30 16:43:37 -07:00
Harish Mahendrakar
1d672d2bea Fix integer overflows in computing poc and pic numbers
Test: poc in bug
Bug: 135303936
Bug: 136568141

Change-Id: Ie426c678b60f2d078d0b39e73a44d42d931d7fe3
2019-09-30 18:25:07 +00:00
Rakesh Kumar
fe5a6ada3e Decoder: Add support for returning reorder_depth
Added support for returning reorder_depth for frames in decode order.

Bug: 138627015
Test: Verify reorder_depth returned for few clips

Change-Id: I9b68a9544d7d011cf93dfccd308c754b8e16e39e
2019-09-11 22:29:39 +00:00
Isha Kulkarni
89daff526a Decoder: Add error check for expected_poc in ih264d_decode_pic_order_cnt
Bug: 131625739
Test: Validate with poc in bug

Change-Id: I3e1c132e28ad35541a0b9c4632b1f43611b90dea
2019-05-29 13:46:13 -07:00
Isha Kulkarni
34769a5b08 Decoder: Fix Integer Sanitizer Issues
Bug: 118445723
Test: vendor
Change-Id: I719898beb93ca5d20d9822f685ac6d4920252cdf
2019-03-28 14:40:40 -07:00
Rakesh Kumar
590ff56ba5 Decoder: Memset allocated dynamic and static buffer to zero
Bug: 111407302
Bug: 111208713
Bug: 111128067
Bug: 111762807
Bug: 111762100
Bug: 111761624
Bug: 112328051
Bug: 112329563
Bug: 112326322
Bug: 112205113
Bug: 112204376
Test: manual
Change-Id: I35e6069a26ee5ef4c0fff111df255a5eddff78ae
2018-08-23 17:27:22 -07:00
Ritu Baldwa
49afc8f344 Fix signed integer overflow in prev_max_display_seq
Prev_max_display_seq accumulates max_poc, which results in integer overflow.
Resetting it to zero whenever overflow occurs.

Bug: 73337834
Test: boot
Change-Id: Ia3f6d30f1a6e7fac05d073e30e38ce2ca4e4f52a
2018-04-16 10:08:46 -07:00
Ritu Baldwa
6b66cac7a8 Decoder: Fixed memory overflow in shared display mode. am: c3b026a87d am: 0183e8df10 am: 53b26e4caa am: 64df5835a4 am: f55fa2495d am: 01f26b3531 am: 8467cf1390 am: bc664e6fa7 am: 6c5f746f25 am: f8f4968473
am: 134620a49b

Change-Id: I439af220021b31b98a96d7f2f2e54c8576fca4c7
2018-01-08 20:24:46 +00:00
Ritu Baldwa
f8f4968473 Decoder: Fixed memory overflow in shared display mode. am: c3b026a87d am: 0183e8df10 am: 53b26e4caa am: 64df5835a4 am: f55fa2495d am: 01f26b3531 am: 8467cf1390 am: bc664e6fa7
am: 6c5f746f25

Change-Id: I7e9a589a39a5491448d497908190334c58d1f064
2018-01-08 20:18:41 +00:00
Ritu Baldwa
0183e8df10 Decoder: Fixed memory overflow in shared display mode.
am: c3b026a87d

Change-Id: I2b1d09b719db6dc4e5ee32be6653b4a64e89ebd5
2018-01-08 19:56:05 +00:00
Ritu Baldwa
c3b026a87d Decoder: Fixed memory overflow in shared display mode.
The factor multiplication should happen only at the source,
not at the destination.

Bug: 71375536
Test: manual
Change-Id: Ib5f00b87150a0533880346fac5464b0b1a802c36
2018-01-05 11:09:27 -08:00
Hamsalekha S
f96761b52d Decoder: Fixed allocation of pv_map_ref_idx_to_poc_buf. am: a925a6b539 am: bf8b7083e9 am: ebae2ef7bd am: d5ad4f8c04 am: 6f82dff7b9 am: 0716eeeb7f am: 0b64261f4c am: d2e5daaede am: 61ddc9e202 am: 6d73354309
am: 79b56d80d5

Change-Id: Ic7cfdc087bf9c3de52c5d6cf9a25dfe25db4a936
2017-07-15 01:16:34 +00:00
Hamsalekha S
61ddc9e202 Decoder: Fixed allocation of pv_map_ref_idx_to_poc_buf. am: a925a6b539 am: bf8b7083e9 am: ebae2ef7bd am: d5ad4f8c04 am: 6f82dff7b9 am: 0716eeeb7f am: 0b64261f4c
am: d2e5daaede

Change-Id: Ic1a04ff426ec654e28d142ced625011b7ff9fbe1
2017-07-15 01:04:04 +00:00
Hamsalekha S
a925a6b539 Decoder: Fixed allocation of pv_map_ref_idx_to_poc_buf.
Increased allocation to include reference list1 also by
default. In the case of error, we could get B_SLICES
even in BASE_PROFILE. The initialization in the
dec_slice_struct_t slice structure has also been
modified accordingly.

Test: run poc with and without this patch
Bug: 38496660
Change-Id: I3451d79bbcd9f0d7a80981a9897f877b7f0812bd
2017-07-13 17:49:14 +00:00
Hamsalekha S
f15bb32866 Decoder : Fix memory leak when sps changes.
ih264d_allocate_dynamic_bufs is now called only once
after every ih264d_init_decoder call. This is possible
since we support only identical( all the critical
parameters will be same) sps in our sps array.

Signal resolution change when u1_frame_mbs_only_flag
in SPS changes.

Bug: 62897300
Test: compilation, boot
Change-Id: I0cf71fe9de72b5dadca2d1daf881d821786f94e3
2017-07-07 10:48:53 -07:00
Hamsalekha S
109b5b4226 Merge "Decoder: Fixed allocation size of pred info buffer" into mnc-dr-dev am: 94660850f0 am: a09bbc27eb am: f838a72c3e am: c33c094303 am: 41b9730003 am: daeae82702 am: 7475b6d9ae
am: 56d23c97dc

Change-Id: Ib0f02533bb604ace34f4d2516fab9a00e0eb32fd
2017-06-02 19:10:29 +00:00
Hamsalekha S
04882a6ea6 Merge "Decoder: Fixed allocation size of pred info buffer" into mnc-dr-dev am: 94660850f0 am: a09bbc27eb am: f838a72c3e am: c33c094303 am: 41b9730003 am: daeae82702 am: 7475b6d9ae
am: 56d23c97dc

Change-Id: I81e77d7c248bf5c2951c81d85e0bfd7ed0f9d124
2017-06-02 19:10:29 +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
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
Marco Nelissen
b6433595df Merge "Decoder: Initialize MB info buffer to zero." into nyc-dev am: 31bd7f7fe6 am: 049aabf9c5 am: 3ff76c0667 am: e8c0283013
am: 27f44e43a4

Change-Id: I4ae4e3c8c5e6045cdbe10a2e850c41f8240fbe5a
2017-05-13 02:04:21 +00:00
Marco Nelissen
1010c9a53c Merge "Decoder: Initialize MB info buffer to zero." into nyc-dev am: 31bd7f7fe6 am: 049aabf9c5 am: 3ff76c0667 am: e8c0283013
am: 27f44e43a4

Change-Id: I4b407d9c77c859893079bf8d63df4b689b07caa5
2017-05-13 02:04:20 +00:00
Marco Nelissen
31bd7f7fe6 Merge "Decoder: Initialize MB info buffer to zero." into nyc-dev 2017-05-13 01:44:26 +00: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
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
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
Hamsalekha S
2575ae6c98 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
2017-04-11 09:22:16 -07:00
Ray Essick
b21679eaf8 Merge "Decoder: Fixed error handling for dangling fields" into mnc-dev am: 78334b2a24 am: cd5ebec24a am: f48987d2fc am: 1cbcdd7f16 am: 3a669baf18 am: 691577d923 am: 979ad81ebd am: db0571cb3d
am: 2c1d937449

Change-Id: I092a8ae67d4746e134f006ebcbe4af4ec442026f
2017-03-14 22:56:22 +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
Harish Mahendrakar
57f60a16d5 Decoder: Fixed error handling for dangling fields
In case of dangling fields with gaps in frames enabled,
field pic in cur_slice was wrongly set to 0.

This would cause dangling field to be concealed as a frame, which would
result in a number of MB mismatch and hence a hang.

Bug: 34097672
Change-Id: Ia9b7f72c4676188c45790b2dfbb4fe2c2d2c01f8
2017-02-08 22:40:36 +00:00
Harish Mahendrakar
74f03b639e DO NOT MERGE Decoder: Increase memory allocation for weights & offsets for interlaced clips
Bug: 33816782
Change-Id: I10f8b2a7691aeb55365901c166e765ab22ec6106
2017-01-17 23:25:11 +00:00
Harish Mahendrakar
1a13168ca3 Decoder: Fixed error handling for dangling fields
In case of dangling fields with gaps in frames enabled,
field pic in cur_slice was wrongly set to 0.

This would cause dangling field to be concealed as a frame, which would
result in a number of MB mismatch and hence a hang.

Bug: 34097672
Change-Id: Ia9b7f72c4676188c45790b2dfbb4fe2c2d2c01f8
2017-01-17 09:55:34 -08:00