Commit graph

134 commits

Author SHA1 Message Date
akshayragir833
3dfa708b6e
Loudness leveling support for encoder and decoder (#99)
* Loudness leveling support for encoder and decoder

- Addition of loudness leveling support to encoder and
  decoder as per ISO/IEC 23003-4:2020/Amd.2:2023(E)

Testing:

Encoder: Smoke-test

Decoder: CTS and Conformance for x86, x86_64, armv7 and armv8 are
         passing

* Addressed review comments

* Addressed minor nits in documentation

---------

Co-authored-by: Akshay Ragir <100833@ittiam.com>
2025-07-28 17:40:45 +05:30
ShashankPathmudi
e6fd2784fc
Decoder Enhancements (#77)
[x] Aligned buffer access for persistent memory.
2024-01-16 21:38:46 +05:30
Shashank Pathmudi
947ad9f32b Fix for divide-by-zero in impd_parse_dwnmix_instructions
These changes handle the divide-by-zero runtime error reported
while calculating the downmix coefficients because
base channel count was coming zero.

Bug: ossFuzz:63420
Test: poc in bug
2023-10-26 10:17:24 +05:30
Yash Patil
5b0bee231b Fix for Use-of-uninitialized-value in impd_drc_set_preselection
These changes handles the runtime error reported when
one of the buffer was not initialized correctly.

Bug: ossFuzz:62388
Test: poc in bug
2023-09-22 19:04:19 +05:30
Nikhil Bhavikatti
797de4d1e9
USAC along with DRC support for libxaac encoder (#37) 2023-07-14 13:04:15 +05:30
Harish Mahendrakar
0233db3f5e cleanup cmake files 2023-04-28 09:34:42 +05:30
Jyothi Swaroop Kumar Nallapaneni
03c53b0e08 CMake support for Platforms and Fuzzer 2023-02-09 12:22:18 +05:30
Shashank Pathmudi
b7f88cbb46 DRC configuration updates for xHEAAC decoder 2022-11-02 14:35:50 +05:30
Sowmya Sree Reddy G
270720de5e ELDv2 support for EXHEAAC decoder 2022-10-10 10:15:43 +05:30
Nikhil Bhavikatti
daf6b8a35c DRC feature updates 2022-09-27 15:39:18 +05:30
Sachin
8701172d14 Select Expert and Anchor Loudness measurement.
Changes to switch to  Expert Panel as  measurement system
and Anchor Loudness as measurement method depending on stream.

Bug: 175435457
Test: atest CtsMediaTestCases:DecoderTest
Test: atest CtsMediaTestCases:DecoderTestAacDrc
Test: atest CtsMediaTestCases:DecoderTestXheAac
Test: atest CtsMediaTestCases:DecoderTestAacFormat
Test: atest CtsMediaV2TestCases:CodecDecoderTest
2022-01-20 11:53:40 +05:30
Sachin
a281ecf0cd Update Boost and attenuation values for MPEG-D DRC
Extend API Support to change MPEG-D DRC values for boost
and attenuation from plugin.

Bug: 175435457
Test: atest CtsMediaTestCases:DecoderTest
Test: atest CtsMediaTestCases:DecoderTestAacDrc
Test: atest CtsMediaTestCases:DecoderTestXheAac
Test: atest CtsMediaTestCases:DecoderTestAacFormat
Test: atest CtsMediaV2TestCases:CodecDecoderTest
2022-01-20 11:52:31 +05:30
Sachin
ebe61f8ba1 Extend API support for Album Mode.
To extend API support to handle album
mode configuration.

Bug: 175435457
Test: atest CtsMediaTestCases:DecoderTest
Test: atest CtsMediaTestCases:DecoderTestAacDrc
Test: atest CtsMediaTestCases:DecoderTestXheAac
Test: atest CtsMediaTestCases:DecoderTestAacFormat
Test: atest CtsMediaV2TestCases:CodecDecoderTest
2022-01-20 11:51:19 +05:30
Sachin
f7ec92a2c9 Obtain Loudness Info from MPEG-4/MPEG-D DRC stream
Extend API support to query loudness Info
obtained from MPEG-4/MPEG-D DRC stream.

Bug: 175435457
Test: atest CtsMediaTestCases:DecoderTest
Test: atest CtsMediaTestCases:DecoderTestAacDrc
Test: atest CtsMediaTestCases:DecoderTestXheAac
Test: atest CtsMediaTestCases:DecoderTestAacFormat
Test: atest CtsMediaV2TestCases:CodecDecoderTest
2022-01-20 11:50:10 +05:30
Rajat Kumar
117d5bda52 Removal of pointer arithmetic code sections.
Code changes to replace  sections that work on pointer
arithmetic logic to avoid undefined behavior.

Bug:Based on manual review
Test:xaacdec

Change-Id: I02bcb356d76b11cd2912478c4263d5918c37e1a6
2020-10-08 20:31:21 +05:30
Rajat Kumar
6398ab8de5 Fix for infinite loop in drc selection process
DRC should not permit the configurations that
exceed the total supported complexity.

Bug: 167279883
Test: poc in bug

Change-Id: Icffa42cdcd9184d434b7a0bfa1b11ebd5ec4af71
2020-10-05 22:57:31 +05:30
Ray Essick
e5c5475c98 Merge "Fix to handle segv in impd_filter_banks_process" 2020-09-30 16:54:42 +00:00
Rajat kumar
f2d380ca2e Fix to handle segv in impd_filter_banks_process
Added check to ensure array size of
buf_interpolation->lpcm_gains does not
exceed allotted size.

Bug: 161819862
Test: poc in bug

Change-Id: I7e554d70ada8d92ee3496c0fbdfc78cee55e4697
2020-09-12 01:21:42 +05:30
Rajat kumar
794c837036 Fix for array out of bound access in impd_drc_get_gain
Add necessary checks to avoid any possible array
out of bounds operation in the impd_drc_get_gain
function.

Bug: 161820233
Test: poc in bug

Change-Id: Ie55fbbc18c76f224983d1032641de4df4dce3fb3
2020-09-11 21:50:48 +05:30
Rajat Kumar
bcbd383251 Fix to handle missing checks on error returned
Added missing return checks and converted
functions to void which doesn't return anything
other than zero.

Test: Review
Test: atest android.media.cts.DecoderTest
Bug:131183694

Change-Id: Iea7bb9959fffd7a0e4f345f86581a1328e04a38e
Merged-In: Iea7bb9959fffd7a0e4f345f86581a1328e04a38e
2020-09-10 12:48:42 -07:00
Rajat Kumar
514510a33c Fix for build errors with -Wunreachable-code-loop-increment flag am: 750dd58c8d am: ce1b551e99
Change-Id: I0bfff50cf05734d3033f9ac9581807f44c05b6e4
2020-05-15 02:56:25 +00:00
Rajat Kumar
750dd58c8d Fix for build errors with -Wunreachable-code-loop-increment flag
For loop was redundant as the execution
was being done for once. Hence removed in the
present fix.

Bug: 156359506
Test: Build with -Wunreachable-code-loop-increment flag added
Test: xaacdec

Change-Id: I252551cff09fa9b033ef715127ee153645e3055f
2020-05-14 23:34:56 +05:30
Ray Essick
45895b998a Typos: persistant -> persistent
Bug: 141290162
Test: build
Change-Id: I204e2a069cc306736f2a6e2dbc92b132a5c919ef
2020-04-02 09:04:46 -07:00
Tripti Tiwari
72b91f378a Fix for Segv in impd_down_mix function in xaac.
Enough size was not allocated for DRC payload.
Added appropriate size to persistence memory to accommodate maximum
length of DRC payload data. Also added reset for bit-handler elements
after execute call.

Bug:141290162
Test: poc in bug

Change-Id: I61176076056899310a3306818cd5ad4624a4bab0
2020-04-02 09:00:29 -07:00
Rajat Kumar
fdeb26a3f5 Fix for infinite loop in impd_apply_gains_and_add function
if (iEnd == iStart) is true until end line of loop,
and (drc_gain_last == shape_filter_block[g].drc_gain_last)
is also true, this make iEnd unchanged for ever
and the while loop will go into infinite iterations.
Hence added a check to break for the same.

Bug:148433653
Bug:151817831
Test:poc in bug

Change-Id: I2a59cde98abee0f28510a5b50ef44b3efd02c079
2020-03-29 17:08:20 -07:00
TreeHugger Robot
7862de4bd2 Merge "Fix for array out of bound in decoder/drc_src/impd_drc_eq.c" into rvc-dev 2020-03-19 19:07:47 +00:00
Sushanth Patil
40fb6f798f Fix for array out of bound in decoder/drc_src/impd_drc_eq.c
Error return check was missing, which caused an
unchecked value to propagate and lead to array OOB.

Bug: 151407605
Test: poc in bug

Change-Id: I0ab9ced7504314e0a31fbe7138c0b95ecbc8cd84
2020-03-18 20:56:48 +00:00
Rajat Kumar
ed2dbffd88 Fix for array out of bound for type 'ia_filt_cascade_td_struct[4]'
Value is read from the bit stream and used as index
before checking for bounds, added the same as fix here.

Bug: 151412914
Test: poc in bug

Change-Id: I2f484398d87bee0a525e4f31b4f0da4c1b13bb1d
2020-03-18 09:09:45 -07:00
Rajat Kumar
5426a0bf19 Fix for read buffer overflow in impd_filter_banks_process
str_node[k].time is used as index later, added a check
where its calculated.

Bug:146948608
Test:poc in bug

Change-Id: I35ca08ad19045deca44b5b5c55532a84f5a58ed3
2020-03-07 15:00:27 -08:00
Rajat Kumar
f60122a142 Fix for array out of bound in impd_drc_parse_coeff func
Variable num_gain_max_values was used as index in
impd_init_table function without checked
for bounds. Added check to prevent out of bound array
access.

Bug:141524702
Test: poc in bug

Change-Id: Ia902153ef614db6dbd002572cdbdb62421580588
(cherry picked from commit 566b69f066)
2020-03-04 17:23:02 +00:00
Rajat Kumar
74fa48f677 Fix for SBO in impd_drc_selection_process_drcset_selection.c
Index k is incremented and used as an index of
selection_candidate_info_step_2 array. k can be
max (str_drc_instruction_str->dwnmix_id_count *
selection_candidate_step_2_count), this can be
more than max size of selection_candidate_info_step_2
array.

Hence added a check before assignment as fix.

Bug:147331996
Test:poc in bug

Change-Id: I1ffa88eddfcef93ab15a08599270924d54cdf1de
2020-02-20 16:58:14 -08:00
TreeHugger Robot
1207285ca0 Merge "Fix for segv in impd_filter_banks_process function" 2020-01-29 20:41:46 +00:00
TreeHugger Robot
3938795985 Merge "Fix for array bound overflow in ia_gain_set_params_struct." 2020-01-16 01:26:59 +00:00
TreeHugger Robot
da4f7feef2 Merge "Fix for array out of bound in parse drc instruction func" 2020-01-16 00:50:46 +00:00
TreeHugger Robot
3214d04ad9 Merge "Fix for array oob in ia_shape_filter_block_params_struct" 2020-01-15 20:06:21 +00:00
TreeHugger Robot
6606e742ba Merge "Fix for oob in ia_drc_instructions_struct" 2020-01-15 19:58:59 +00:00
Rajat Kumar
09fd1c3c1f Fix for array out of bound in parse drc instruction func
target_channel_count read from bit stream is being
used as index without bound check. Hence the check
has been added.

Bug:142693847
Test: poc in bug

Change-Id: I9d6c832e75b9cb78fe4989516d13707f1ecf7f91
2020-01-11 19:10:09 -08:00
Rajat kumar
4a19deca5d Fix for array bound overflow in ia_gain_set_params_struct.
Max value of
str_p_loc_drc_coefficients_uni_drc->gain_set_count_plus
is used as index without checking for upper bound.
Hence added a check here.

Bug:144665190
Test:poc in bug

Change-Id: Ibd8dfe91910eb4d7548cf3236065eb38121b60c8
2020-01-11 19:03:43 -08:00
Rajat kumar
7924f0cb44 Fix for array oob in ia_shape_filter_block_params_struct
pstr_gain_modifiers->shape_filter_idx is read from
bitstream and used as an index before been checked
for bound. Hence added a check.

Bug:145043907
Test:poc in bug

Change-Id: I9a46c4227017328f2c3aa6e7d911889c01efef91
2020-01-11 17:22:27 -08:00
Rajat kumar
7d0a228c3e Fix for segv in impd_filter_banks_process function
str_node[k].time calculated here is used as an index
to access buf_interpolation->lpcm_gains array. Added a
check here so that the access does not go out of bound.

Bug:145043038
Test:poc in bug

Change-Id: I7620efcfb79e9a34b175b2cdf60c1674c279135d
2020-01-11 17:07:02 -08:00
Rajat Kumar
86d7dd791e Fix for oob in ia_drc_instructions_struct
drc_config->drc_instructions_uni_drc_count
+ drc_config->dwnmix_instructions_count is
used as index in the function
impd_drc_gen_instructions_for_drc_off,
without checked for bounds.

Hence the check has been added here.

Bug:143517852
Test: poc in bug

Change-Id: I1134236b421d97097a5deb25dbf889f25e7a29ef
2020-01-11 16:50:54 -08:00
Rajat Kumar
bdaf57013d Fix for array out of bound access in gain_set_param structure
Added check before accessing the index.

Bug:141289121
Test: poc in bug

Change-Id: Ifd7bfcb2e978317069efea43ba64f2fb60b9e644
2020-01-09 14:48:29 -08:00
TreeHugger Robot
e57f919f8a Merge "Fix to add few bound checks in DRC, based on code review" 2019-11-14 01:43:53 +00:00
Rajat Kumar
c2cb9c2424 Fix to add few bound checks in DRC, based on code review
Added few checks to avoid out of bound access and
and remove few redundant checks based on review.

Bug:130279444
Test: atest android.media.cts.DecoderTestXheAac
Test: atest android.media.cts.DecoderTestAacDrc

Change-Id: If9a7917eea5d68d4c484d02fca4c755ffa6a9123
2019-11-13 14:23:08 -08:00
Rajat Kumar
dc6af3edb4 Fix for array out of bound in drc dynamic payload.
str_spline_nodes->num_nodes was not checked for bound,
before using as index. Added bound check before access.

Bug:141215451
Test: poc in bug

Change-Id: I9cd78035521731a3f338dc52ebf0afc3a3e5d3ff
2019-11-13 14:12:14 -08:00
Rajat Kumar
fb6a48906e Fix for array out of bound in impd_drc_static_payload.c
channel_layout->base_channel_count was not checked
for bounds after it is read from bit stream.
Corresponding check has been added here.

Bug:140979418
Test: poc in bug

Change-Id: I57e6a4ea9a39c64e82c3add0d20a85716ad20cc1
2019-11-02 07:03:49 -07:00
Rajat Kumar
93ade1f683 Fix to define all tables as const in libxaac
libxaac had few tables which were not declared as constants.
Added const and did corresponding changes to build and
execute.

Bug:128433649
Test: Manual Review

Change-Id: I1babf22a45fbd595c5a9c67804ecdc0317ebb96c
2019-07-17 12:24:16 -07:00
Rajat Kumar
f6b2d77787 Fixes to incorporate latest conformance criteria
Bug:128648229
Test: atest android.media.cts.DecoderTestXheAac
Test: atest android.media.cts.DecoderTestAacDrc
Change-Id: Ic85bacc660c91096e29cd0cbe24323f4a6109c9a
2019-07-03 10:23:20 -07:00
Rajat Kumar
7bee3616b8 Fix to remove unused codes from MPEG-D DRC.
MPEG-D DRC integrated with USAC does work only in
time domain.
Hence removed the above related code in this patch.

Bug:130262151
Test: atest android.media.cts.DecoderTestXheAac
Test: atest android.media.cts.DecoderTestAacDrc

Change-Id: Ib51ef29fb7a1fe7a09718d48e2c9e7cda268ae7b
2019-05-15 15:18:34 -07:00
Ray Essick
360bd4fd75 Merge changes from topic "b124323156"
* changes:
  Initialize all allocated memory blocks to zero
  Update cfi blacklist to include few more assembly functions
  LDR changed to MOV instruction in armv8 and armv7 assemblies
2019-04-02 22:13:05 +00:00