Michael Niedermayer
fbdb0313f5
ac3dec: fix non-optimal dithering of zero bit mantissas
...
Use a noise range of -0.707 to 0.707 instead of -0.5 to 0.5
Based on patch by: Mathias Rauen <madshi@gmail.com> and commit by Justin Ruggles (04ea5491
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Mathias Rauen
04ea5491a8
ac3dec: fix non-optimal dithering of zero bit mantissas
...
Use a noise range of -0.707 to 0.707 instead of -0.5 to 0.5
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
12 years ago
Justin Ruggles
e034cc6c60
lavc: Move vector_fmul_window to AVFloatDSPContext
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Michael Niedermayer
b888cea9cb
ac3dec: split out pointer update loop for saftey
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
511cf612ac
miscellaneous typo fixes
12 years ago
Michael Niedermayer
d28dfa2d42
ac3dec: fix outptr increment.
...
Fixes decoding regression
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
2fb240ddb6
ac3dec: fix out of array read
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
7aabeea9ba
ac3dec: fix bugs in direct buffer use.
...
This fixes potentially exploitable out of array writes.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Mans Rullgard
30b3916425
ac3dec: make downmix() take array of pointers to channel data
12 years ago
Mans Rullgard
b8f3ab8e6a
ac3dec: output planar float only
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Mans Rullgard
ec5da7aee2
ac3dec: decode directly into output buffers
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
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
Diego Biurrun
717addecad
Use proper return values in case of missing features
12 years ago
Justin Ruggles
56b6a43056
ac3dec: ensure get_buffer() gets a buffer for the correct number of channels
...
If there is an error during frame parsing, but AVCodecContext.channels was
changed and AC3DecodeContext.out_channels was set previously, the two may not
match.
Fixes CVE-2012-2802
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
12 years ago
Mans Rullgard
97cb9236cf
ac3: move ac3_downmix() from dsputil to ac3dsp
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Martin Storsjö
c7b610aa0b
avopt: Explicitly store float/double option defaults in .dbl
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
12 years ago
Marton Balint
b99e9ee938
ac3dec: set decode_error_flags field in ac3 codec
...
Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
2c22701c37
ac3dec: Check number of output channels.
...
Fixes out of array write.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Diego Biurrun
a92be9b856
Replace memset(0) by zero initializations.
...
Also remove one pointless zero initialization in rangecoder.c.
13 years ago
Justin Ruggles
3798205a77
mov: set channel layout for AC-3 streams based on the 'dac3' atom info
...
fixes Bug 225
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
e6d9fa66f1
ac3dec: Move center and surround mix level tables to the parser.
...
That way all mix levels as exported by avpriv_ac3_parse_header()
will have the same meaning.
Previously the 3-bit center mix level for E-AC-3 was used to index in a
4-entry table, leading to out-of-array reads.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
Signed-off-by: Alex Converse <alex.converse@gmail.com>
13 years ago
Anton Khirnov
f326501a65
lavc: remove disabled FF_API_DRC_SCALE cruft.
13 years ago
Michael Niedermayer
99a42f3fa9
ac3dec: Move center&surround mix level tables to parser.
...
That way all mix levels as exported by the parser
will have the same meaning.
Previously the 3bit center mix level for eac3 was
used to index in a 4 entry table leading to out of array reads.
this change removes the table and offsets the ac3 variable by 4
so it matches the meanings for eac3 except the reserved case.
The reserved case is then explicitly handled.
Idea-by: Justin Ruggles <justin.ruggles@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Diego Biurrun
3dc99a18d4
cosmetics: drop some pointless parentheses
13 years ago
Michael Niedermayer
eda3758c87
ac3dec: update checked AV_EF flags.
...
A user who wishes to use default error concealment cannot set the
AV_EF_CRCCHECK flag because not every CRC in every format is a
reliable indicator of bitstream damage. In some formats crcrs
can be nonsensical in absence of any damage. We thus add the
AV_EF_CAREFUL flag in addition to the AV_EF_CRCCHECK flag to
allow a user to enable this reliable CRC check without having to
enable all CRC checks in all formats.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Chris Berov
541d083a40
ac3dec: cosmetics: pretty-printing
...
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
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
Dustin Brody
9abc98737f
lavc: replace references to deprecated AVCodecContext.error_recognition to use AVCodecContext.err_recognition
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
13 years ago
Anton Khirnov
6f89efeaa7
lavc: use avpriv_ prefix for ff_ac3_parse_header.
...
It's used in lavf.
13 years ago
Anton Khirnov
145f741e11
AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_*
13 years ago
Mans Rullgard
633ddb8519
ac3dec: use get_sbits() instead of manually sign-extending
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
13 years ago
Anton Khirnov
a4ea00d021
lavc/lavf: use unique private classes.
...
This is needed by the new AVOptions API.
13 years ago
Anton Khirnov
feedc0754b
ac3dec: actually use drc_scale private option
13 years ago
Reimar Döffinger
459fe331e9
ac3dec: avoid pointless alloc and indirection for input_buffer
...
Since we now always allocate it, it can simply be made part of the context
instead.
13 years ago
Michael Niedermayer
931187e117
ac3dec: export center & suroundmix levels
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Anton Khirnov
9b83919f44
ac3dec: add a drc_scale private option
...
Deprecate corresponding AVCodecContext option.
This is the first test of decoder private options.
14 years ago
Justin Ruggles
e6c52cee54
Replace usages of av_get_bits_per_sample_fmt() with av_get_bytes_per_sample().
...
av_get_bits_per_sample_fmt() is deprecated.
14 years ago
Justin Ruggles
9aa8193a23
Add floating-point sample format support to the ac3, eac3, dca, aac, and vorbis
...
decoders.
Based on patches by clsid2 in ffdshow-tryout.
14 years ago
Reimar Döffinger
636ee66f1c
Fix data_size handling for AC3 and dca decoders.
...
They use now code identical to the AAC decoder.
The AC3 decoder previously did not check the data_size and
the dca decoder checked against and set wrong values for float.
14 years ago
Reimar Döffinger
4c7ad768e1
ac3dec: allow selecting float output at runtime.
14 years ago
Justin Ruggles
4c64c8e95a
ac3dec: fix processing of delta bit allocation information.
...
The number of dba segments is the coded value + 1.
The coupling dba offset starts at the first coupling band, not at zero.
14 years ago
Reimar Döffinger
6e075dcaf8
ac3dec: avoid pointless alloc and indirection for input_buffer
...
Since we now always allocate it, it can simply be made part of the context
instead.
14 years ago
clsid2
0e09997fa4
Libavcodec AC3/E-AC3/DTS decoders now output floating point data.
...
git-svn-id: https://ffdshow-tryout.svn.sourceforge.net/svnroot/ffdshow-tryout@3769 3b938f2f-1a1a-0410-8054-a526ea5ff92c
14 years ago
Mans Rullgard
6d9f52b2cd
ac3: move ff_ac3_bit_alloc_calc_bap to ac3dsp
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Justin Ruggles
991f3de1bb
ac3enc: Add codec-specific options for writing AC-3 metadata.
14 years ago
Justin Ruggles
be18738801
Get audio_service_type for AC-3 based on bitstream mode in the AC-3 parser
...
and decoder, and vice-versa for the AC-3 encoder.
14 years ago
Reimar Döffinger
4c886d613d
Detect byte-swapped AC-3 and support decoding it directly.
...
This allows the AC-3 decoder to be used directly with RealMedia
decoders that unlike the libavformat one do not byte-swap automatically.
Since the new code is only used in case we would fail directly otherwise
there should be no risk for regressions.
14 years ago
Justin Ruggles
40728b5169
cosmetics: indentation
14 years ago