Commit graph

77 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
Rakesh Kumar
ba74b083b4 libavc: Fix dynamic color aspects support
Test: atest android.mediav2.cts.DecoderDynamicColorAspectTest

Change-Id: Id64ddb874efe1ab51cd9b2359bfa9526bc1ccd6e
2024-11-11 18:23:04 -08:00
Rakesh Kumar
7d6f8576e0 libavcdec: Fix integer overflow issue in ui_max_frame_num
In avc MaxFrameNum can be 65536 which is of 17 bits due to which
interger overflow was happening for i2_max_frm_num and
ui_max_frame_num. This has been fixed.

Bug: 369676522
Test: poc in bug description

Change-Id: I858eea6bf8eea1e2cee6d4a7c28a84705eb51792
2024-10-24 08:16:56 -07:00
Haripriya Deshmukh
828cdb77ba libavc: Add dynamic color aspects support
Bug: 325468696
Test: atest android.mediav2.cts.DecoderDynamicColorAspectTest

Change-Id: Ib33d57a1f8109a149926841fed1a3d2ff454b668
2024-04-23 23:04:49 -07: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
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
Xin Li
f59c3864fe Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855
Bug: 172690556
Merged-In: I829eb4215ea9aa15adf66e8bbdb37ec88a9bb6a4
Change-Id: I2e739d3606ba9f0938ebc2363cb9443ec3dec912
2020-11-23 13:14:11 -08:00
Treehugger Robot
f7225b7fa5 Merge "Decoder: Fix unsigned integer overflow" 2020-10-09 20:06:04 +00:00
Hamsalekha S
3fe5adf3ad Decoder: Fix heap buffer overflow. am: 0b601e1a4f
Original change: 12266630

Change-Id: I829eb4215ea9aa15adf66e8bbdb37ec88a9bb6a4
2020-09-27 17:43:42 +00:00
Manisha Jajoo
8217d22de9 Decoder: Fix unsigned integer overflow
Fix integer overflow issues in parse functions

Test: poc in bug

Bug: 143791646
Bug: 150045816

Change-Id: Ie0bde7a5cf266fe327b1d5e43fffe28f6e402188
2020-08-28 15:02:17 +05:30
Xin Li
70bf1e5994 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I49c82ad516931b8a7c90dc446a5df5e6ee52e56f
Change-Id: I609894770235673dc005d118062b9f8b4af08ba8
2020-08-27 10:16:27 -07:00
Treehugger Robot
af2a7b6799 Merge "Decoder: Integer overflow fixes in parsing Qp and weights" am: 2baef25896 am: b69aa3f39f
Original change: 1131173

Change-Id: I21f1cd7e8d6c8776ad6383d762999873c643eac2
2020-08-20 16:19:02 +00:00
Treehugger Robot
2baef25896 Merge "Decoder: Integer overflow fixes in parsing Qp and weights" 2020-08-20 15:24:02 +00:00
Ray Essick
25e267d467 Merge "decoder: Update reorder depth to account for display latency" am: adfbdd6c41 am: b2016b613a
Original change: 1398927

Change-Id: I62f01df061adfc72175dd67bba14dc3d955d9ccf
2020-08-17 05:52:27 +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
Harish Mahendrakar
08b77b2351 Decoder: Integer overflow fixes in parsing Qp and weights
Error checks for syntax elements related to QP,
luma and chroma prediction weights have been modified
to fix overflow

Bug: 136568141
Bug: 143801227
Bug: 143791288

Test: POC in bug description

Change-Id: I88e886ba4bcda69079f1b0a8344005fe1aa51366
2020-08-06 23:10:15 -07:00
Hamsalekha S
0b601e1a4f Decoder: Fix heap buffer overflow.
Fix bitstream buffer overflow in the function
ih264d_parse_sei_message

Bug: 152895390

Test: POC in bug

Change-Id: I41ff1f7b2834c2d09e546b8e3d37e4cd4abfa28d
2020-07-29 23:47:11 +00:00
Chamarthi Kishore
68dce05ea6 Merge changes I015ebe03,Idc0b0db5 am: 00fa4b6490 am: 7684b467b4
am: d49fffd5f4

Change-Id: I0da6b5b695adb949b28ca9d29f806cd11625d2eb
2019-10-31 19:11:43 -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
7befa935af Added error check while parsing scaling_list
Test: poc in bug
Bug: 134405507
Change-Id: Ic3289a4fb1652dd35be5e2b59dbc41f2c888786f
2019-07-22 13:55:21 -07: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
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
Harish Mahendrakar
7a6b55da22 [automerger] decoder: Signal IVD_RES_CHANGED error for change in crop params am: 442a01bf37 am: 1d7d7f9bf6 am: acacf063c2 am: f33c02ed73 am: c09d3f99ab am: 145ae0d049
am: 4402b34a4f

Change-Id: I16ce7cfc21dcb0ccf10b4ce8109a61e272765120
2018-11-27 12:10:36 -08:00
Harish Mahendrakar
442a01bf37 decoder: Signal IVD_RES_CHANGED error for change in crop params
IVD_RES_CHANGED was not signaled when crop parameters changed, i.e.
display dimensions changed without change in decode dimensions.

In such cases, if output buffer was allocated as per the current
dimension being decoded, without IVD_RES_CHANGED signalled, there can be
an OOB write if the new buffer is smaller than the frame being returned
as output

Bug: 118399205
Test: vendor
Change-Id: Ia750a99cda08a3254a6f8ea8b55d07e655b34d05
2018-11-10 10:16:06 -08:00
Android Build Merger (Role)
57cd27cc9b Merge changes from topic "am-8231d92f-aea1-4f7d-b84c-789126fb6fa2" into oc-dev am: 3fffe3c300
am: 5759ea0b59

Change-Id: I30df7ac1808586db869dc0093f0586aa80eb348b
2018-01-31 22:38:58 +00:00
Android Build Merger (Role)
731580450e [automerger] Decoder: Fixed reset values in parse sps. am: 9c32ad7126
Change-Id: Ia8766fd9f4b9a2cb5f7bb13e221d8c0f9b366d66
2018-01-18 18:44:16 +00:00
Ritu Baldwa
9c32ad7126 Decoder: Fixed reset values in parse sps.
Memset to zero whenever new sps occurs.

Bug: 70897394
Test: manual
Change-Id: I5936fd55265ff8ad2b275a72b175cdb540bb7933
2018-01-18 10:43:26 -08:00
Hamsalekha S
7e756b120b Decoder: Detect change of mbaff flag in SPS am: d524ba0310 am: c30baf4986 am: 16388ca052 am: 7a94552676 am: e6d5d77d9a am: 2e965b33b3 am: 8ffbcc3c8c am: 2b0c57b966 am: cea907a84c am: 338efffb84
am: 4eae360793

Change-Id: Icc302025dac4b4d6328abe3c8451be683250cb85
2017-10-31 18:42:06 +00:00
Hamsalekha S
c30baf4986 Decoder: Detect change of mbaff flag in SPS
am: d524ba0310

Change-Id: I818230d7fb1763b54d4920f9000663ec72286b6d
2017-10-31 18:02:16 +00:00
Hamsalekha S
d524ba0310 Decoder: Detect change of mbaff flag in SPS
Change in Mbaff flag needs re-initialization of NMB group
and other variables in decoder context.

Bug: 64380237
Test: ran poc on ASAN before/after
Change-Id: I0fc65e4dfc3cc2c15528ec52da1782ecec61feab
2017-10-30 14:19:41 -07:00
Lajos Molnar
8a7f15c3d4 support 4K max dimension
This is required for handling 4K thumbnails that may be rotated.

Bug: 64939294
Change-Id: Ia33d8e1ce7fb07b5ec6bf604d30cd8f75c3228ae
2017-08-24 19:07:58 -07: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
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
a0cec24429 Decoder: Cleaned up parse sps function.
am: 4eb72f7c93

Change-Id: I7dd751c7a00e07e7930338e4c87366638b260697
2017-06-06 22:16:25 +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
Hamsalekha S
a7b1d1c722 Merge "Fix resolution change within a decode call." into mnc-dev am: 7fc42b801c am: 252ca18add am: 4c6288e861 am: 90fc697c82 am: 8b3d043280 am: d603f906d2 am: e1b496babb am: 85b8159cf0
am: 6edcc25a5a

Change-Id: I72143bf248487f085dbf816f9b2795c837dbb575
2017-06-06 18:30:46 +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
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
Hamsalekha S
8c6fe35f6d 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
2017-05-25 19:18:23 -07:00
Hamsalekha S
b521d67114 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-05-26 00:10:04 +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
0f6a1883e8 Decoder: Added an error check while parsing PPS.
am: 62f98981ff

Change-Id: I2976869f34cf2a20078c3fe4504db9e6c5a3035d
2017-05-12 20:56:41 +00:00