Michael Niedermayer
02d6d05339
dcadec: check xch_base_channel against channel_order_tab.
...
Fix null pointer dereference
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
594d4d5df3
lavc: add a wrapper for AVCodecContext.get_buffer().
...
It will be useful in the upcoming transition to refcounted AVFrames.
12 years ago
Michael Niedermayer
ff7e2342bb
dcadec: fix reading from prior to an array
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
3b2cd83a82
dcadec: check lfe field
...
Fix out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
5d47850bbd
dcadec: skip QMF on unused channels
...
When the extra rear channel is present but unused, the
s->channel_order_tab[] value for that channel is -1. The QMF can be
skipped for the extra channel, and doing so avoids an out-of-array read
on s->samples_chanptr[].
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
12 years ago
Michael Niedermayer
42dde253ec
dcadec: fix av_log level
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
a0212ecf84
dcadec: check layout & channel count for consistency.
...
Fixes out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Justin Ruggles
a903f8f087
Include libavutil/channel_layout.h instead of libavutil/audioconvert.h
...
Also reorder some other #include when applicable.
12 years ago
Justin Ruggles
8ac0f6767b
dcadec: allow the decoder to change the channel layout mid-stream
12 years ago
Nick Brereton
09ea482d5d
Fix #1827 , segfault with XXCH samples when downsampling.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
b4e6265136
dcadec: skip QMF on unused channels
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Justin Ruggles
61d5313d94
dca: allocate a secondary buffer for extra channels when downmixing
...
The output AVFrame buffer only has data for the downmix channels.
Fixes a segfault when decoding dca with request_channels == 2.
12 years ago
Justin Ruggles
64c312aa29
dcadec: use float planar sample format
12 years ago
Diego Biurrun
1218777ffd
avcodec: Convert some commented-out printf/av_log instances to av_dlog
12 years ago
Michael Niedermayer
36c2694d83
dcadec: fix "set but not used" variable
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
12 years ago
Diego Biurrun
19cf7163c1
dca: Switch dca_sample_rates to avpriv_ prefix; it is used across libs
12 years ago
Diego Biurrun
9e4bca16f8
dca: Move tables used outside of dcadec.c to a separate file.
12 years ago
Diego Biurrun
13a79cf84e
dca: Rename dca.c ---> dcadec.c
...
This will allow adding dca.c with tables used from other files.
12 years ago
Nick Brereton
e03077c432
Fix DCA-XXCH extension scaling for embedded downmixes.
...
Reviewed-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Nick Brereton
73154feec1
Fix ordering of XXCH downmix coefficients.
...
Reviewed-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Hendrik Leppkes
65219c3851
dca: map xxch side channels to AV_CH_SIDE_LEFT/RIGHT instead of REAR.
...
This fixes decoding of certain 7.1 DTS-HD HRA files, as well as matches the spec better.
Table 6-22 in the DTS spec labels the two channels "Left/Right surround on side", and not rear.
Reviewed-by: Benjamin Larsson <benjamin@southpole.se>
Reviewed-by: Nick Brereton <nick@nbrereton.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
e8e733adcc
dca: favor native over ffmpeg in table name
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
84d73e9d5d
dca: fix project reference in table name
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Nick Brereton
cd8bef969a
Generate channel layout, reordering for DTS-XXCH extension and, undo embedded downmixes
...
Reviewed-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Nick Brereton
16f6c16ac0
Parse & decode DTS XXCH frames
...
Reviewed-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Justin Ruggles
cb5042d02c
float_dsp: Move vector_fmac_scalar() from libavcodec to libavutil
13 years ago
Nick Brereton
8036a69e6b
Decode XBR extension in first asset
...
Reviewed-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
8e77c3846e
dcadec: fix global array overread.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Kostya Shishkov
681e726865
dca: include libavutil/mathematics.h for possibly missing M_SQRT1_2
13 years ago
Ronald S. Bultje
93b53ffb1a
dca: don't use av_clip_uintp2().
...
The argument is not a literal, thus causing the ARM v6 or later
builds to break.
13 years ago
Ronald S. Bultje
e6ffd997cb
dca: prevent accessing static arrays with invalid indexes.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
13 years ago
Justin Ruggles
11ac796f7a
dca_parser: parse the sample rate and frame durations
13 years ago
Michael Niedermayer
d7bce4a274
dca: dont overread dca_default_coeffs.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
51db9a97e9
dca: Check scale_sum.
...
Fixes a out of array read.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
d6bc273bac
dca: Check LFEScaleIndex.
...
Its not clear from the spec what to do with values larger than 127
so iam opting for the safe side and ask for a sample.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Martin Storsjö
9cf0841ef3
dsputil: Add ff_ prefix to the dsputil*_init* functions
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Michael Niedermayer
53918a1c54
dca: Fix uninitialized variable warnings.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Shitiz Garg
f37b4efe03
dca: K&R formatting cosmetics
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
13 years ago
Justin Ruggles
0eea212943
Add avcodec_decode_audio4().
...
Deprecate avcodec_decode_audio3().
Implement audio support in avcodec_default_get_buffer().
Implement the new audio decoder API in all audio decoders.
13 years ago
Alex Converse
999e7ebd23
dca: Replace oversized unused get_bits() with skip_bits_long().
13 years ago
Mans Rullgard
cc276c85d1
Make channel layout masks unsigned
...
It makes more sense for a bit mask to use an unsigned type.
The change should be source and binary compatible on all
supported systems, hence micro version bump.
Fixes a few invalid shifts.
Signed-off-by: Mans Rullgard <mans@mansr.com>
13 years ago
Mans Rullgard
00a856e3f9
dca: ARMv6 optimised decode_blockcode()
...
This is a hand-tuned version of the code with impossible parts of
the FASTDIV function ommitted.
2-5% faster overall on Cortex-A8.
Signed-off-by: Mans Rullgard <mans@mansr.com>
13 years ago
Justin Ruggles
272fcc32bb
dca: handle errors from dca_decode_block()
...
Return error if core block decoding fails.
Do not enable XCh if XCh extension block decoding fails.
13 years ago
Justin Ruggles
aae6eead6a
dca: return error if the frame header is invalid
13 years ago
Justin Ruggles
f44059d260
dca: return proper error codes instead of -1
13 years ago
Carl Eugen Hoyos
246c8dac3e
Fix dca decoding for many samples after last commit.
...
Still be less verbose about channel count change from 0 channels.
13 years ago
Carl Eugen Hoyos
ad2d597292
Be less verbose about dca channel number changes.
...
Only inform the user that the number of channels changed if it was set
before.
13 years ago
Carl Eugen Hoyos
81cd96caee
Remove unused dca context variable.
13 years ago
Hendrik Leppkes
7b6ae0e849
dca: allow the channel count to change.
...
(cherry picked from commit 42e78d2296752293cd08c5727f76c3b37c68fb24)
Review-by: Benjamin Larsson
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago