1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-12 19:18:44 +02:00
Commit Graph

20 Commits

Author SHA1 Message Date
Jun Zhao
1213840265 lavc/aacsbr: fix make checkheaders warning
move the the function aacsbr_tableinit definition from header file
to .c file to fix make checkheaders warning.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-06-10 08:46:18 +08:00
James Almer
e9a3880613 Merge commit 'ba30b74686f0cb6c9dd465ac4820059c48bf9d08'
* commit 'ba30b74686f0cb6c9dd465ac4820059c48bf9d08':
  aac: Validate the sbr sample rate before using the value

See cf5f4c5169

Merged-by: James Almer <jamrial@gmail.com>
2017-09-27 23:49:06 -03:00
Michael Niedermayer
87b08ee6d2 avcodec/aacsbr_template: Do not change bs_num_env before its checked
Fixes: 1489/clusterfuzz-testcase-minimized-5075102901207040
Fixes: out of array access

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-13 18:07:33 +02:00
Michael Niedermayer
a8ad83b793 avcodec/aacsbr_template: Do not leave bs_num_env invalid
Fixes out of array read
Fixes: 1349/clusterfuzz-testcase-minimized-5370707196248064

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-06 00:33:19 +02:00
Alex Converse
2c8a3aa985 aacsbr: Turnoff in the event of over read.
Aliased compressed AAC bytes are almost certainly not meaningful SBR
data. In the wild this causes harsh artifacts switching HE-AAC streams
that don't have SBR headers aligned with segment boundaries.

Turning off SBR falls back to a default set of upsampling parameters
that can function as a sort of error concealment. This is consistent
with how the decoder handles other sorts of errors.
2017-03-21 09:38:36 -07:00
Clément Bœsch
842e7853c7 Merge commit '42c4c2d2a6dc48adb0e901ef5617acfba0a3a18e'
* commit '42c4c2d2a6dc48adb0e901ef5617acfba0a3a18e':
  aac: Drop broken cruft

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-19 15:54:44 +01:00
Alex Converse
3bb24fc344 aacsbr: Associate SBR data with AAC elements on init
Quiets some log spam on pure upsampling mode.

Fixes ticket 5163.
2017-02-13 09:31:13 -08:00
Rostislav Pehlivanov
a04ae469e7 aacsbr: reduce element type mismatch warning severity
All HE-AAC samples with an LFE channel make this warning get spammed on
every frame. Turning off SBR for LFE channels makes sense (since it has
much less coefficients than normal channels do), so this error print is
of no value in this case.
It makes sense to keep the error in other cases, hence why it's still
around, degraded to warning severity since the decoder will still
attempt to decode without SBR.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-06-08 21:01:04 +01:00
Michael Niedermayer
625b582d5a avcodec/aacsbr_template: Add Check to read_sbr_envelope()
The limit is a conservative guess, the spec does not seem to specify a limit

Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-12 19:05:07 +01:00
Michael Niedermayer
b78885a3c5 avcodec/aacsbr: Split the env_facs table
This also removes a #ifdef and special case for the fixed point case

Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-12 12:19:07 +01:00
Andreas Cadhalpun
fdc94db37e sbr_qmf_analysis: sanitize input for 32-bit imdct
If the input contains too many too large values, the imdct can overflow.
Even if it didn't, the output would be larger than the valid range of 29
bits.

Note that this is a very delicate limit: Allowing values up to 1<<25
does not prevent input larger than 1<<29 from arriving at
sbr_sum_square, while limiting values to 1<<23 breaks the
fate-aac-fixed-al_sbr_hq_cm_48_5.1 test.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-11 00:04:04 +01:00
Andreas Cadhalpun
ff8816f717 aacsbr: ensure strictly monotone time borders
This fixes a division by zero in the aac_fixed decoder.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-11 00:04:04 +01:00
Andreas Cadhalpun
1c3e43a627 aacsbr: don't call sbr_dequant twice without intermediate read_sbr_data
Doing that doesn't make sense, because the only purpose of sbr_dequant
is to process the data from read_sbr_data.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-20 23:25:24 +01:00
Michael Niedermayer
d877b88f51 avcodec/aacsbr_template: Check values read in read_sbr_noise()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-19 13:12:43 +01:00
Michael Niedermayer
bfd0e02dd6 avcodec/aacsbr: Split pre dequantization noise factors table
This allows removing a special case for the fixed point decoder and will
make error checks simpler

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-19 13:12:20 +01:00
Michael Niedermayer
dcf1cf5d24 avcodec/aacsbr: Use FLOAT_0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08 11:05:48 +01:00
Ganesh Ajjanagadde
fd0bf457b7 avcodec/aacsbr_template: replace qsort with AV_QSORT
When sbr->reset is set in encode_frame, a bunch of qsort calls might get made.
Thus, there is the potential of calling qsort whenever the spectral
contents change.

AV_QSORT is substantially faster due to the inlining of the comparison callback.
Thus, the increase in performance should be worth the increase in binary size.

Tested with FATE.

Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-04 08:15:24 -05:00
Djordje Pesut
5fd81cf6f0 avcodec: Implementation of AAC_fixed_decoder (PS-module)
Add fixed point implementation.

Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-22 21:51:28 +02:00
Djordje Pesut
f85bc147fb avcodec: Implementation of AAC_fixed_decoder (SBR-module)
Add fixed poind code.

Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-20 17:20:16 +02:00
Djordje Pesut
5499467d5d avcodec: Template creation for AAC decoder (SBR-module)
Move the existing code to a new template file.

Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-20 17:20:16 +02:00