Commit Graph

52 Commits

Author SHA1 Message Date
Justin Ruggles 033a4a942a aacdec: Use float instead of int16_t for ltp_state to avoid needless rounding. 2011-05-15 17:42:05 -04:00
Alex Converse 767848d761 aacdec: remove sf_scale and sf_offset.
Instead, scalefactors are adjusted by the offset amount, removing the need
for sf_scale, and the MDCT scales are adjusted to compensate for the higher
scalefactors. Floating-point output will be handled by modifying the MDCT
scales.
2011-04-27 12:39:37 -04:00
Justin Ruggles 6271794041 aacdec: use a scale of 2 in the LTP MDCT rather than doubling the coefficient
table values from the spec.
2011-04-27 12:39:37 -04:00
Alex Converse d70fa4c423 Define POW_SF2_ZERO in aac.h and use for ff_aac_pow2sf_tabp[] offsets instead
of hardcoding 200 everywhere.
2011-04-27 12:39:37 -04:00
Alex Converse e4744b59aa Large intensity stereo and PNS indices are legal. Clip them instead of
erroring out. A magnitude of 100 corresponds to 2^25 so the will most
likely result in clipped output anyway.

None of the conformance streams fall in the range that need to be clipped.
2011-04-27 12:39:37 -04:00
Alex Converse 785c441828 Add some debug log messages to AAC extradata
On Wed, Apr 20, 2011 at 11:39 AM, Justin Ruggles
<justin.ruggles@gmail.com> wrote:
> On 04/20/2011 02:26 PM, Alex Converse wrote:
>
>> ---
>>  libavcodec/aacdec.c |   10 +++++++++-
>>  1 files changed, 9 insertions(+), 1 deletions(-)
>>
>>
>>
>> 0002-Add-some-Debug-log-messages-to-AAC-extradata.patch
>>
>>
>> diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
>> index c9761a1..3ec274f 100644
>> --- a/libavcodec/aacdec.c
>> +++ b/libavcodec/aacdec.c
>> @@ -79,7 +79,6 @@
>>             Parametric Stereo.
>>   */
>>
>> -
>>  #include "avcodec.h"
>>  #include "internal.h"
>>  #include "get_bits.h"
>
>
> stray whitespace change
>

oops, fixed

>From 94e8d0eea77480630f84368c97646cabc0f50628 Mon Sep 17 00:00:00 2001
From: Alex Converse <aconverse@google.com>
Date: Wed, 20 Apr 2011 11:23:34 -0700
Subject: [PATCH] Add some debug log messages to AAC extradata
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------1"

This is a multi-part message in MIME format.
--------------1
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit
2011-04-22 20:36:57 -07:00
Young Han Lee 9978ed7d6c aacdec: indentation cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-04-22 14:47:47 +02:00
Alex Converse 187a537904 Convert some undefined 1<<31 shifts into 1U<<31.
According to ISO 9899:1999 S 6.5.7/4:

The result of E1 << E2 is E1 left-shifted E2 bit positions; vacated bits
are filled with zeros. If E1 has an unsigned type, the value of the
result is E1× 2^E2, reduced modulo one more than the maximum value
representable in the result type. If E1 has a signed type and
nonnegative value, and E1× 2^E2 is representable in the result type, then
that is the resulting value; otherwise, the behavior is undefined.
2011-04-11 21:47:42 -07:00
Janne Grunau d6f66edd65 Revert "aac_latm_dec: use aac context and aac m4ac"
This reverts commit 36864ac354 since it
breaks LATM decoding in ffplay.
2011-04-05 12:21:50 +02:00
Mans Rullgard 4538729afe Move sine windows to a separate file
These windows do not really belong in fft/mdct files and were
easily confused with the similarly named tables used by rdft.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-20 13:25:19 +00:00
Mans Rullgard a45fbda994 Move ff_kbd_window_init() to a separate file
This function is not tightly coupled to mdct, and it's in the way
of making a fixed-point mdct implementation.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 19:49:27 +00:00
Mans Rullgard 26f548bb59 fft: remove inline wrappers for function pointers
This removes the rather pointless wrappers (one not even inline)
for calling the fft_calc and related function pointers.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 19:49:18 +00:00
Mans Rullgard 2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Thadeu Lima de Souza Cascardo 36864ac354 aac_latm_dec: use aac context and aac m4ac
When decoding latm config, use the corresponding aac context and its
m4ac instead of using NULL and a local variable. This fixes decoding of
audio in MPEG TS from SBTVD (the Brazillian Digital TV Sytem), when
there is no extradata. This is the case when using the decoder with
gst-ffmpeg and a GStreamer mpegts demuxer.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-07 12:25:36 -05:00
Young Han Lee e22910b21a aacdec: Reduce the size of buf_mdct.
It was doubled in size for the LTP implementation. This brings it back
down to its original size.
2011-02-21 16:35:22 -08:00
Young Han Lee 9707f84fa7 aacdec: dsputilize the scalar multiplication in intensity stereo 2011-02-19 00:57:09 -08:00
Young Han Lee ead15f1dc1 aacdec: Implement LTP support.
Ported from gsoc svn.
2011-02-14 21:43:42 -08:00
Anton Khirnov b2ed95ec48 Replace remaining occurrences of CODEC_TYPE_* with AVMEDIA_TYPE*
Tested to compile with lavc major bump.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-03 13:37:09 +00:00
Justin Ruggles c73d99e672 Separate format conversion DSP functions from DSPContext.
This will be beneficial for use with the audio conversion API without
requiring it to depend on all of dsputil.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-02 02:44:53 +00:00
Justin Ruggles 80ba1ddb58 Remove unneeded add bias from 3 functions.
DSPContext.vector_fmul_window()
DCADSPContext.lfe_fir()
SynthFilterContext.synth_filter_float()

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-01-31 20:28:42 +00:00
Alex Converse e5c82df80e aacdec: Convert some loop copies into memcpy()s.
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-01-28 17:00:36 +00:00
Justin Ruggles b5ec638343 cosmetics: indentation and spacing 2011-01-28 00:21:46 +00:00
Justin Ruggles 9d06d7bce3 Remove the add bias hack for the C version of DSPContext.float_to_int16_*(). 2011-01-28 00:07:35 +00:00
Diego Elio Pettenò d36beb3f69 Add ff_ prefix to data symbols of encoders, decoders, hwaccel, parsers, bsf.
None of these symbols should be accessed directly, so declare them as
hidden.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-01-26 16:08:45 +00:00
Mans Rullgard f162e988aa Remove redundant checks against MIN_CACHE_BITS
With the removal of the libmpeg2 bitstream reader, MIN_CACHE_BITS
is always >= 25, so tests against smaller values can be removed.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-01-23 16:41:04 +00:00
Stefano Sabatini 5d6e4c160a Replace deprecated symbols SAMPLE_FMT_* with AV_SAMPLE_FMT_*, and enum
SampleFormat with AVSampleFormat.

Originally committed as revision 25730 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-12 11:04:40 +00:00
Alex Converse ebb7f7de82 aaclatm: Eliminate dummy packets due to muxlength calculation.
Muxlength does not include the 3 bytes of AudioSyncStream() before the
AudioMuxElement(). If these three bytes are not accounted for the last three
bytes of the LATM packet are sent back to the decoder again.

Fixes issue244/mux2.share.ts

Originally committed as revision 25685 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-07 03:05:12 +00:00
Janne Grunau bbdee6e5f9 aacdec: consume the audio specific config during LATM parsing
Spotted by Alex after Carl Eugen found errors some samples. There no errors or
noticeable artifacts in the samples I used during development.

Originally committed as revision 25676 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-04 21:00:01 +00:00
Janne Grunau 94c7870947 aacdec: change type of data in decode_audio_specific_config parameters
AVCodecContext.extradata is uint8_t*, silence a warning

Originally committed as revision 25644 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-02 08:33:10 +00:00
Janne Grunau 136e19e1cf Add single stream LATM/LOAS decoder
The decoder is just a wrapper around the AAC decoder.
based on patch by Paul Kendall { paul <ät> kcbbs gen nz }

Originally committed as revision 25642 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-02 08:32:04 +00:00
Janne Grunau 6c003e6de8 aacdec: pass avctx as logging context for decode_audio_specific_config
Use avctx in all called functions. This allows passing a NULL AACContext
for LATM since the AACContext is only used in output_configure() which
is skipped for LATM parsing.

Originally committed as revision 25641 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-02 08:30:31 +00:00
Janne Grunau 66a71d989f aacdec: refactor the actual aac decoding code into its own function
aac_decode_frame() remains as AVPacket handling a wrapper. The actual
decoding function takes a GetBitContext as input and will be used be the
AAC LATM decoder to avoid copying the unaligned AAC bitstream.

Originally committed as revision 25640 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-02 08:29:43 +00:00
Janne Grunau be63b4ba22 aacdec: return consumed bits in decode_audio_specific_config
Originally committed as revision 25639 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-02 08:28:55 +00:00
Janne Grunau 37d289530f aacdec: add MPEG4AudioConfig as parameter for decode_audio_specific_config
This will be used by the latm decoder to avoid AACContext changes during
audio specific config parsing.

Originally committed as revision 25638 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-02 08:28:28 +00:00
Alex Converse bb2d8e9f05 aacdec: Rework channel mapping compatibility hacks.
For a PCE based configuration map the channels solely based on tags.
For an indexed configuration map the channels solely based on position.

This works with all known exotic samples including al17, elem_id0, bad_concat,
and lfe_is_sce.

Originally committed as revision 25098 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-09-10 18:01:48 +00:00
Alex Converse 81824fe059 aacdec: Only load and write each predictor variable once.
This is slightly faster and opens the door for further optimization.

Originally committed as revision 24475 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-24 02:57:08 +00:00
Alex Converse 70c99adb48 aacdec: 4% faster main profile decoding.
Originally committed as revision 24474 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-24 02:41:47 +00:00
Alex Converse 1ac6da3988 aacdec: Eliminate the use of doubles in the MAIN predictor.
Originally committed as revision 24226 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-12 21:36:41 +00:00
Alex Converse 531cfe6e85 aacdec: Eliminate the use of doubles in decode_cce().
Originally committed as revision 24225 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-12 21:36:10 +00:00
Alex Converse 93c6ff6c8c aacdec: Use a LUT to generate CCE scale.
Originally committed as revision 24224 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-12 21:35:43 +00:00
Alex Converse 3cac899af9 Split the ADTS header decoder off of the ADTS parser.
The AAC decoder and ADTS-to-ASC BSF both require the header decoder
but not full parsing capabilities.

Originally committed as revision 24217 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-12 18:52:03 +00:00
Alex Converse 7167bc94cb aacdec: Remove the warning about non-meaningful window transitions.
It created false positives on seeks and where the first frame is STOP or SHORT.
It failed to warn in illegal SHORT->LONG transitions. In general it created
much confusion and many junk bug reports from the users.

Originally committed as revision 24214 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-12 18:24:22 +00:00
Måns Rullgård 38b0410902 aacdec: remove checks for impossible error conditions
Originally committed as revision 24097 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-07 20:23:56 +00:00
Diego Biurrun 09f6a45dc2 Remove non-existing stray arguments from Doxygen function documentation.
Originally committed as revision 23976 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-02 11:19:29 +00:00
Alex Converse e29af81818 aactab: Tablegenify ff_aac_pow2sf_tab.
Originally committed as revision 23740 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-23 19:30:01 +00:00
Alex Converse 19ed4b8647 aacdec: cosmetics: (more) whitespace
Originally committed as revision 23676 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-21 04:14:20 +00:00
Alex Converse d4e355d5c9 aacdec: cosmetics: whitespace
Originally committed as revision 23675 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-21 04:10:18 +00:00
Alex Converse ed99e54d67 aacdec: Factorize if (elem_type < TYPE_DSE).
Originally committed as revision 23674 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-21 04:07:19 +00:00
Alex Converse fda36b5944 aacdec: Handle the first frame being empty case.
Originally committed as revision 23673 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-21 04:05:09 +00:00
Alex Converse a20639017b Add HE-AAC v2 support to the AAC decoder.
Originally committed as revision 23647 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-19 14:14:51 +00:00