Commit graph

172 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
045d0c9156 libavc : Fix mutex initialization index in apv_proc_start_mutex
- Changed hardcoded index [0] to loop variable [i] in ithread_mutex_init call
- Ensures correct initialization of both mutexes in the loop

Test: ./avcdec

Change-Id: I95ccd1eec5f18b5391befbcedf3546a119681b54
2024-10-04 06:50:55 -07:00
srujan vandrangi
f27694faed decoder: join threads in flush mode
Test: avcdec
2023-09-25 08:47:41 -07:00
wujianxing1
283f9fcecb Correct comment spelling error.
Change-Id: Idd5e2c12da2b23f598c301bf6fb6a963c4420ae2
Signed-off-by: wujianxing1 <wujianxing1@xiaomi.corp-partner.google.com>
2023-08-11 15:54:38 -07:00
Srujan Vandrangi
5b04d419d2 decoder: join threads in reset()
Test: Build
2023-07-24 09:37:28 -07:00
Srujan Vandrangi
72e8241a64 decoder: replace KEEP_THREADS_ACTIVE macro with avc decoder struct variable
Bug: 289097296
Test: Build
2023-07-22 09:51:37 -07:00
Harish Mahendrakar
7164209291 Updates to Android.bp and some formatting fixes
- Only libavcdec is marked as available to apex modules instead
  of marking all decoder libraries to be available to apex modules.
- some formatting changes for consistency with neighboring lines.

Test: Builds
2023-03-08 20:27:18 -08:00
Harish Mahendrakar
a7c8d47643 Fix formatting in FGC commit 2023-02-21 12:36:55 -08:00
Shireesh Kadaramandalgi
b6b12cc5f0 libavc: Add support for FGC SEI message
- Decoder: Added support for FGC SEI parsing and exporting
2023-02-21 12:36:55 -08:00
Mallikarjun Kamble
8e41a50de4 libavc: Added support for SII SEI message
- Add SII flag and SII parameters for the encoder and decoder.
- Encoder: Added support for SII SEI
- Decoder: Added support for SII SEI parsing and exporting
2023-02-14 22:00:13 -08:00
Harish Mahendrakar
2219f68d19 decoder: Fix the size check for arguments to decode call.
Fixes #2
Test: avc_dec_fuzzer
2023-01-30 12:37:18 -08:00
Harish Mahendrakar
eb463e5aa2 cmake: Set C standard to C90 and move few macros to specific targets
- Set CMAKE_C_STANDARD to 90
  Because of this, moved some declarations to start of the block
- Move PROFILE_ENABLE and MD5_DISABLE to specific targets as these
  macros are not used when building libraries

Bug: 242076773
Test: Builds
Change-Id: Icd0b8a48f015a695185ce2220800348f7a7512f1
2022-08-30 20:00:54 +00: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
Manisha Jajoo
d1e64cc366 Decoder: add support for KEEP_THREADS_ACTIVE
Current design of AVC Decoder creates new threads
to process each frame. This CL adds support to reuse
the threads across frames.

Test: avcdec -c dec.cfg
Bug: 191124963

Change-Id: I087699c4c7ce6aa59a1d8b078ae196a50dcf889c
2022-02-09 17:59:29 +05:30
Shivaansh Agrawal
2205f2da33 Decoder: add support to use ih264d instead of ivd structures
Bug: 175759733
Test: avcdec -c dec.cfg
Change-Id: I410bb2213cb375c5eabcb3e23499d6ad43cf1c96
2021-02-25 05:31:40 +00:00
Harish Mahendrakar
a0036e742b decoder: Allow stride to be smaller than decode width
When cropping is enabled, application can request a stride that
is larger than display width but smaller than decode width.

Bug: 160397536
Test: stagefright -sS <clip in bug>

Change-Id: I453b2de0474f3ae4d021084729c33d52fc1090dc
2020-07-09 17:59:47 +00:00
Harish Mahendrakar
942e7f8896 decoder: Move initialization of dbp_mgr entries to init_decoder() am: 01da7b5a52 am: 41fcd228ae am: cce42ea920 am: 6c9873af88 am: 662efee177 am: 873bac42ec
am: 474797af3c

Change-Id: I315a135615fdace5bc573e9f585133a991b30c77
2019-11-05 17:11:11 -08:00
Harish Mahendrakar
474797af3c decoder: Move initialization of dbp_mgr entries to init_decoder() am: 01da7b5a52 am: 41fcd228ae am: cce42ea920 am: 6c9873af88 am: 662efee177
am: 873bac42ec

Change-Id: I6f5d7d5486926100a815ffcddd134cf998d35c79
2019-11-05 17:05:10 -08:00
Harish Mahendrakar
662efee177 decoder: Move initialization of dbp_mgr entries to init_decoder() am: 01da7b5a52 am: 41fcd228ae am: cce42ea920
am: 6c9873af88

Change-Id: Ie95d6b810f751847eed7bc2c17c120a891b88fef
2019-11-05 16:52:06 -08:00
Chamarthi Kishore
7684b467b4 Merge changes I015ebe03,Idc0b0db5
am: 00fa4b6490

Change-Id: I71e761af5fd1551643418dd7979491c2a6b7a7ee
2019-10-31 18:59:50 -07:00
Harish Mahendrakar
01da7b5a52 decoder: Move initialization of dbp_mgr entries to init_decoder()
Earlier these were only initialized during static buffer allocations.
Initializing them in init_decoder() will ensure that these get
initialized to default values during reset() as well. Without this,
in some error cases, there is a possibility of heap-use-after free,
when resolution changes and these pointers point to memory that is freed

Bug: 142602711
Test: poc in bug
Change-Id: Ie39fee0eca56bf32cdc558099bf167d05eb89620
2019-10-29 19:52:49 -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
Rakesh Kumar
eecfff5a7a Decoder: Add support for returning reorder_depth
am: fe5a6ada3e

Change-Id: Ia677a6ed414fa77ec1f67106261723bef6ea7f97
2019-09-12 11:11:24 -07: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
Dan Willemsen
90ca457b95 Stop using __DATE__/__TIME__ on all builds
am: d8383dc45e

Change-Id: I58f071c0270bb7d080639f902ff772095ab2c139
2019-08-28 19:32:02 -07:00
Dan Willemsen
d8383dc45e Stop using __DATE__/__TIME__ on all builds
We're beginning to use remote caches with Android builds, so I'm turning
on -Werror=date-time so that host builds are also reproducible.

Test: treehugger
Test: mmma external/libavc
Change-Id: I581f3abf528a7bb5df6ee9963f4d72e2b4bb8a6c
2019-08-27 19:47:33 -07:00
TreeHugger Robot
6cb07e106a Merge "decoder: Remove skip picture support" into qt-dev 2019-05-04 21:16:35 +00:00
TreeHugger Robot
a09be99800 Merge "Decoder: Add missing error checks for parsing sps or pps" into qt-dev 2019-05-04 19:37:30 +00:00
Harish Mahendrakar
4f95fc0b9c decoder: Remove skip picture support
SKIP_P and SKIP_PB support was experimental and is not used
in libstagefright

Bug: 130541597
Test: poc in bug
Change-Id: If13b435e80d13d57de2fee0aa07ea7e6abca481b
2019-05-01 13:18:27 -07:00
Ritu Baldwa
b3427a4c49 Decoder: Add missing error checks for parsing sps or pps
Return error to application if valid sps or pps has not been decoded.
Also add check to prevent parsing of pps, if valid sps is not present.

Test: Tested a few clips with missing sps/pps
Bug: 129746168
Bug: 130575087

Change-Id: I1a6409d1cffc66c1b910d2102ab10a94e0227107
2019-05-01 13:01:23 -07:00
Harish Mahendrakar
54160a6d3e decoder: Treat unsupported feature errors as fatal errors
This will ensure clips with supported bitdepth or unsupport color
formats are not attempted to be decoded till end of the sequence.

Bug: 130578045
Test: adb shell stagefright -s -S /sdcard/crowd422_h264.mp4
Test: Ensure decoder doesn't attemp decoding all frames

Change-Id: I118ef2141f77986f6ec65c91dfeaa7ef17646c43
2019-04-30 17:14:01 -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
Ray Essick
e31fa45761 Merge "Decoder: Adding Error Check for Output Buffer Size in Shared Display Mode." into mnc-dev am: afc729db25 am: 1fb89d8488 am: 56f836a29c am: 33675f68d6 am: 547804d647 am: 7adc4d57f1 am: cfe44b34c0 am: 17b987beec
am: bce27b7e66

Change-Id: I6755dedeb1a32a32e85627602783ca77cd966fc7
2018-01-08 22:49:54 +00:00
Ray Essick
7adc4d57f1 Merge "Decoder: Adding Error Check for Output Buffer Size in Shared Display Mode." into mnc-dev am: afc729db25 am: 1fb89d8488 am: 56f836a29c am: 33675f68d6
am: 547804d647

Change-Id: I22c555cc975abbfa80aa38810c9e7a0f59ce3450
2018-01-08 22:41:22 +00:00
Ray Essick
1fb89d8488 Merge "Decoder: Adding Error Check for Output Buffer Size in Shared Display Mode." into mnc-dev
am: afc729db25

Change-Id: Ic57cdca65a505c45bec9c6ff8dd9b5d9dab5fec7
2018-01-08 22:27:38 +00:00
Ritu Baldwa
3692aceb1b Decoder: Adding Error Check for Output Buffer Size in Shared Display Mode.
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 in shared display mode.

Bug: 70294343
Bug: 70350193
Bug: 70526411
Bug: 70526485
Test: manual
Change-Id: I2c1e59425e84ac62a874e5ee180e1b98f0a4058f
2018-01-02 14:25:27 -08:00
Harish Mahendrakar
423b7db2fb Merge "Decoder: Handle dec_hdl memory allocation failure gracefully" into mnc-dr-dev am: ac0d9cecb5 am: f63836fed1 am: 5448bcea3e am: f87d4848af am: 18ae83b015 am: 04b8990195 am: 7fc07418ef
am: faf7af464e

Change-Id: I68e929751f26ccbbe9af1104f84bebc07530c6af
2017-11-03 19:25:07 +00:00
Harish Mahendrakar
18ae83b015 Merge "Decoder: Handle dec_hdl memory allocation failure gracefully" into mnc-dr-dev am: ac0d9cecb5 am: f63836fed1 am: 5448bcea3e
am: f87d4848af

Change-Id: Ia060e78fe7cd7b4233733910f08caadbea05ff3d
2017-11-03 19:07:04 +00:00
TreeHugger Robot
ac0d9cecb5 Merge "Decoder: Handle dec_hdl memory allocation failure gracefully" into mnc-dr-dev 2017-11-03 18:57:47 +00:00
Harish Mahendrakar
7720b3fe3d Decoder: Handle dec_hdl memory allocation failure gracefully
If memory allocation for dec_hdl fails, return gracefully
with an error code. All other allocation failures are
handled correctly.

Bug: 68300072
Test: ran poc before/after
Change-Id: I118ae71f4aded658441f1932bd4ede3536f5028b
2017-11-01 09:57:48 -07:00
Hamsalekha S
a1f8cef8c4 Decoder: Increased allocation and added checks in sei parsing. am: f2b70d3537 am: 8d32a711ac am: a0827a3bb1 am: cd831159ce am: 2a3efcfcde am: 013d98b763 am: 48d8b5bbc9
am: ccc5298ffb

Change-Id: I83547b11f6da1c33f0ac304690924eacc2ba2920
2017-10-31 18:23:49 +00:00
Hamsalekha S
2a3efcfcde Decoder: Increased allocation and added checks in sei parsing. am: f2b70d3537 am: 8d32a711ac am: a0827a3bb1
am: cd831159ce

Change-Id: I49ada0ebdcca121f739c753dbedaca8e80ea6da5
2017-10-31 18:10:47 +00:00
Ray Essick
27e6efc8ec DO NOT MERGE Decoder: Increased allocation and added checks in sei parsing.
This prevents heap overflow while parsing sei_message.

Bug: 63122634
Test: ran PoC on unpatched/patched
Change-Id: I4785927b68cb17a3ca51e23aeaf96aacacf116d3
Merged-In: I61c1ff4ac053a060be8c24da4671db985cac628c
2017-10-17 15:09:06 -07:00
Hamsalekha S
f2b70d3537 Decoder: Increased allocation and added checks in sei parsing.
This prevents heap overflow while parsing sei_message.

Bug: 63122634
Test: ran PoC on unpatched/patched
Change-Id: I61c1ff4ac053a060be8c24da4671db985cac628c
2017-10-17 15:03:19 -07:00
TreeHugger Robot
6a09a35355 Merge "DO NOT MERGE Decoder: Modified setting of error code in set flush api." into mnc-dev 2017-10-03 22:51:37 +00:00
Ritu Baldwa
1541dcc79c DO NOT MERGE Decoder: Modified setting of error code in set flush api.
Fixed incorrect use of ps_dec->pv_dec_out to set error code.

Bug: 66372937
Test: at vendor
Merged-In: Ib04e0b15573b2482c9d5b43c8bc7dd30d8f8efdd
Change-Id: I7b66ee010089399c050a75d6d67feb03da0b8b3e
2017-10-03 14:57:06 -07:00
Ritu Baldwa
ed7a63fbcc DO NOT MERGE Decoder: Increased memory allocation.
ps_dec->u1_recon_mb_grp is twice the width in case of mbaff,
increasing relevant allocations accordingly.

Increased allocation of intra-prediction buffer to
include padding.

Bug: 64964675
Test: POC from bug report
Change-Id: Ic4a6151bb12ac1122c228220b9150b2a372aae21
2017-09-29 11:49:50 -07:00
Harish Mahendrakar
31b397c813 Added an out of bound check on u4_num_bufs in input argument am: aa11ab9fdb am: 50ec420228 am: 0514a1ebfb am: fa8bb9d89c am: 96228ba3b9 am: 4a6a743d40 am: 4ed04c7bb1 am: b9027e8cc1
am: 859498bb08

Change-Id: I364cdcdd56d88f411892723935683d16ffcd0321
2017-09-11 22:39:38 +00:00
Hamsalekha S
1d6b06a73a Decoder: Conceal picture only if valid picture buffer is obtained. am: 5df744afde am: 7f78e3aa9a am: 8810e9db7f am: 1ab3e51baf am: 32c369cc3f am: fd327a47fb am: b10090d47a
am: 2825c578d3

Change-Id: I1bf0cb0c96c45b419c06bd9b1d202b1ff08193e4
2017-09-11 22:39:14 +00:00