Commit Graph

117 Commits

Author SHA1 Message Date
Nicolas Gaullier
3153c441e1 avcodec/ac3: Remove unused fields
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2023-03-02 21:32:00 +01:00
Marth64
a4e5b94633
avcodec/eac3dec: add detection of Atmos spatial extension profile
Signed-off-by: Marth64 <marth64@proxyid.net>
2023-03-02 13:45:51 +01:00
Lynne
4cee7ebd75
ac3: convert to lavu/tx 2022-11-06 14:39:27 +01:00
Andreas Rheinhardt
9beba05311 avcodec/fmtconvert: Remove unused AVCodecContext parameter
Unused since d74a8cb7e4.

Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-21 20:26:40 +02:00
Vittorio Giovara
111ed1b16b ac3: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:39 -03:00
Anton Khirnov
e15371061d lavu/mem: move the DECLARE_ALIGNED macro family to mem_internal on next+1 bump
They are not properly namespaced and not intended for public use.
2021-01-01 14:14:57 +01:00
Paul B Mahol
0b86ea03d8 avcodec/ac3: fix out of array access introduced previously
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-03-30 10:14:48 +02:00
Paul B Mahol
ae92970976 avcodec/eac3: add support for dependent stream
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-03-29 10:19:03 +02:00
Michael Niedermayer
9351a156de avcodec/ac3dec: Keep track of band structure
It is needed in some corner cases that seem not to be forbidden
Fixes: out of array index
Fixes: 1538/clusterfuzz-testcase-minimized-4696904925446144

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 20:36:33 +02:00
Clément Bœsch
e39d4ff150 Merge commit '43717469f9daa402f6acb48997255827a56034e9'
* commit '43717469f9daa402f6acb48997255827a56034e9':
  ac3dsp: Reverse matrix in/out order in downmix()

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-22 11:29:46 +01:00
Jonathan Campbell
d5d474aea5 avcodec/ac3dec: add consistent noise generation option.
use av_lfg_init_from_data() to seed AC-3 dithering from the AC-3 frame
data to make it consistent given the same AC-3 frame, if option is set.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-22 02:29:16 +01:00
Justin Ruggles
43717469f9 ac3dsp: Reverse matrix in/out order in downmix()
Also use (float **) instead of (float (*)[2]). This matches the matrix
layout in libavresample so we can reuse assembly code between the two.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-10-01 00:45:55 +02:00
Nikolas Bowe
96cd6f672e avcodec/(e)ac3: Fix target_level for EAC3.
Currently when using target_level with EAC3 it produces silence. This small patch fixes target_level for decoding EAC3.

Example:
ffmpeg -y -i /tmp/test.wav -acodec eac3 -dialnorm -14 -ac 6 -b:a 384000 /tmp/test.m2ts
ffmpeg -y -target_level -24 -i /tmp/test.m2ts -acodec pcm_s16le -f matroska /tmp/out.mkv
ffplay /tmp/out.mkv

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-15 12:18:55 +02:00
Derek Buitenhuis
15cb52577a Merge commit 'fef2147b7a689b80d716c3edb9d4a18904865275'
* commit 'fef2147b7a689b80d716c3edb9d4a18904865275':
  eac3dec: don't call avpriv_request_sample every frame.

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-08 23:05:22 +01:00
Tim Walker
fef2147b7a eac3dec: don't call avpriv_request_sample every frame.
These errors neither prevent nor stop successful decoding
of the E-AC-3 stream's "core", causing avpriv_request_sample
to be called for every single frame in the bitstream.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-04-02 14:05:07 +02:00
Michael Niedermayer
29d147c94d Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'
* commit '059a934806d61f7af9ab3fd9f74994b838ea5eba':
  lavc: Consistently prefix input buffer defines

Conflicts:
	doc/examples/decoding_encoding.c
	libavcodec/4xm.c
	libavcodec/aac_adtstoasc_bsf.c
	libavcodec/aacdec.c
	libavcodec/aacenc.c
	libavcodec/ac3dec.h
	libavcodec/asvenc.c
	libavcodec/avcodec.h
	libavcodec/avpacket.c
	libavcodec/dvdec.c
	libavcodec/ffv1enc.c
	libavcodec/g2meet.c
	libavcodec/gif.c
	libavcodec/h264.c
	libavcodec/h264_mp4toannexb_bsf.c
	libavcodec/huffyuvdec.c
	libavcodec/huffyuvenc.c
	libavcodec/jpeglsenc.c
	libavcodec/libxvid.c
	libavcodec/mdec.c
	libavcodec/motionpixels.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/noise_bsf.c
	libavcodec/nuv.c
	libavcodec/nvenc.c
	libavcodec/options.c
	libavcodec/parser.c
	libavcodec/pngenc.c
	libavcodec/proresenc_kostya.c
	libavcodec/qsvdec.c
	libavcodec/svq1enc.c
	libavcodec/tiffenc.c
	libavcodec/truemotion2.c
	libavcodec/utils.c
	libavcodec/utvideoenc.c
	libavcodec/vc1dec.c
	libavcodec/wmalosslessdec.c
	libavformat/adxdec.c
	libavformat/aiffdec.c
	libavformat/apc.c
	libavformat/apetag.c
	libavformat/avidec.c
	libavformat/bink.c
	libavformat/cafdec.c
	libavformat/flvdec.c
	libavformat/id3v2.c
	libavformat/isom.c
	libavformat/matroskadec.c
	libavformat/mov.c
	libavformat/mpc.c
	libavformat/mpc8.c
	libavformat/mpegts.c
	libavformat/mvi.c
	libavformat/mxfdec.c
	libavformat/mxg.c
	libavformat/nutdec.c
	libavformat/oggdec.c
	libavformat/oggparsecelt.c
	libavformat/oggparseflac.c
	libavformat/oggparseopus.c
	libavformat/oggparsespeex.c
	libavformat/omadec.c
	libavformat/rawdec.c
	libavformat/riffdec.c
	libavformat/rl2.c
	libavformat/rmdec.c
	libavformat/rtpdec_latm.c
	libavformat/rtpdec_mpeg4.c
	libavformat/rtpdec_qdm2.c
	libavformat/rtpdec_svq3.c
	libavformat/sierravmd.c
	libavformat/smacker.c
	libavformat/smush.c
	libavformat/spdifenc.c
	libavformat/takdec.c
	libavformat/tta.c
	libavformat/utils.c
	libavformat/vqf.c
	libavformat/westwood_vqa.c
	libavformat/xmv.c
	libavformat/xwma.c
	libavformat/yop.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27 23:15:19 +02:00
Vittorio Giovara
059a934806 lavc: Consistently prefix input buffer defines
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27 15:24:59 +01:00
Andreas Cadhalpun
7b05b5093e ac3dec_fixed: always use the USE_FIXED=1 variant of the AC3DecodeContext
The AC3DecodeContext has a float (USE_FIXED=0) and an integer
(USE_FIXED=1) variant, both of which can be present in the same binary.
This is not only very confusing, but it also breaks horribly, when one
variant is used by code expecting the other.

This currently happens, because eac3dec.c is only compiled for the float
variant, but also used from ac3dec_fixed.c, which uses the integer
variant.

The result is memory corruption, leading to crashes.

So compile eac3dec.c once for each variant and adapt it, so that it
works with the integer variant.

A loss of precission and scaling bug has been fixed by the committer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 04:27:06 +01:00
Michael Niedermayer
8bce5c8e74 avcodec/ac3dec: Use avpriv_float_dsp_alloc()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-20 22:30:48 +01:00
Jean-Francois Thibert
12df9b9a15 Improved AC3 decoder level support (heavy drc, dialnorm)
Added support for AC3 heavy dynamic range compression used
to restrict the output range and added a setting to specify
the output target level and use the dialog normalization
field to apply it in the digital domain.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-27 14:31:39 +02:00
Michael Niedermayer
35bb74900b Merge commit 'c67b449bebbe0b35c73b203683e77a0a649bc765'
* commit 'c67b449bebbe0b35c73b203683e77a0a649bc765':
  dsputil: Split bswap*_buf() off into a separate context

Conflicts:
	configure
	libavcodec/4xm.c
	libavcodec/ac3dec.c
	libavcodec/ac3dec.h
	libavcodec/apedec.c
	libavcodec/eamad.c
	libavcodec/flacenc.c
	libavcodec/fraps.c
	libavcodec/huffyuv.c
	libavcodec/huffyuvdec.c
	libavcodec/motionpixels.c
	libavcodec/truemotion2.c
	libavcodec/x86/Makefile
	libavcodec/x86/dsputil_init.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 13:31:26 +02:00
Diego Biurrun
c67b449beb dsputil: Split bswap*_buf() off into a separate context 2014-06-22 18:22:31 -07:00
Michael Niedermayer
b219142921 avcodec/ac3: rename identifier used to select the fixed point variant
the CONFIG_ prefix is used by configure, using it for other things
is potentially confusing to the reader

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Nedeljko Babic <nbabic@mips.com>
2014-04-01 19:58:31 +02:00
Nedeljko Babic
696e34a6e1 libavcodec: Implementation of AC3 fixedpoint decoder
Signed-off-by: Nedeljko Babic <nbabic@mips.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-01 19:01:57 +02:00
Michael Niedermayer
3a5a039ade Merge commit 'c229f571fd3c7d7b567c27c87b2bbcdaee1b0e9f'
* commit 'c229f571fd3c7d7b567c27c87b2bbcdaee1b0e9f':
  (e)ac3: parse and store the Lt/Rt and LFE mix levels.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-19 21:37:06 +01:00
Tim Walker
c229f571fd (e)ac3: parse and store the Lt/Rt and LFE mix levels. 2014-01-19 19:12:42 +01:00
Michael Niedermayer
7b3c78b5e6 Merge commit '13345fc1f86fc3615789e196d5a339c1c27c9068'
* commit '13345fc1f86fc3615789e196d5a339c1c27c9068':
  (e)ac3: parse and store the Dolby Surround, Surround EX and Headphone mode flags.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-05 23:06:53 +01:00
Tim Walker
13345fc1f8 (e)ac3: parse and store the Dolby Surround, Surround EX and Headphone mode flags. 2014-01-05 16:41:56 +01:00
Michael Niedermayer
94194bdcd7 Merge commit 'd4df02131b5522a99a4e6035368484e809706ed5'
* commit 'd4df02131b5522a99a4e6035368484e809706ed5':
  ac3dec: Remove write-only channel_layout field from AC3DecodeContext

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-23 13:45:09 +01:00
Tim Walker
d4df02131b ac3dec: Remove write-only channel_layout field from AC3DecodeContext
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-11-22 23:27:34 +01:00
Christophe Gisquet
b6293e2798 fmtconvert: Explicitly use int32_t instead of int
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-17 11:02:47 +03:00
Christophe Gisquet
f49564c607 fmtconvert: int32_t input to int32_to_float_fmul_scalar
It was previously declared as int.
Does not change fate results for x86.

Conflicts:

	libavcodec/ppc/fmtconvert_altivec.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-18 18:01:16 +02:00
Michael Niedermayer
4789955ec4 Merge commit 'e57daa876bf0cf50782550e366e589441cd8c2bd'
* commit 'e57daa876bf0cf50782550e366e589441cd8c2bd':
  adpcm: decode directly to the user-provided AVFrame
  ac3: decode directly to the user-provided AVFrame
  aac: decode directly to the user-provided AVFrame
  8svx: decode directly to the user-provided AVFrame

Conflicts:
	libavcodec/8svx.c
	libavcodec/ac3dec.c
	libavcodec/adpcm.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-13 11:27:54 +01:00
Justin Ruggles
55d2e12aef ac3: decode directly to the user-provided AVFrame 2013-02-12 12:21:21 -05:00
Michael Niedermayer
5c7e9e16c9 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavc: Move vector_fmul_window to AVFloatDSPContext
  rtpdec_mpeg4: Check the remaining amount of data before reading

Conflicts:
	libavcodec/dsputil.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-16 12:38:41 +01:00
Justin Ruggles
e034cc6c60 lavc: Move vector_fmul_window to AVFloatDSPContext
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-16 10:45:45 +01:00
Michael Niedermayer
a933698457 Merge commit '30b39164256999efc8d77edc85e2e0b963c24834'
* commit '30b39164256999efc8d77edc85e2e0b963c24834':
  ac3dec: make downmix() take array of pointers to channel data

Conflicts:
	libavcodec/ac3dsp.c
	libavcodec/ac3dsp.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-10 02:06:50 +01:00
Michael Niedermayer
b7d8484f27 Merge commit 'b8f3ab8e6a7ce3627764da53b809628c828d4047'
* commit 'b8f3ab8e6a7ce3627764da53b809628c828d4047':
  ac3dec: output planar float only
  svq3: make slice type value unsigned to match svq3_get_ue_golomb return type
  configure: Have protocols select network code instead of depending on it

Conflicts:
	libavcodec/svq3.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-10 01:32:37 +01:00
Mans Rullgard
30b3916425 ac3dec: make downmix() take array of pointers to channel data 2012-12-09 15:52:01 +00:00
Mans Rullgard
b8f3ab8e6a ac3dec: output planar float only
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-12-09 15:52:01 +00:00
Michael Niedermayer
55c49afc42 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  yuv4mpeg: return proper error codes.
  Give all anonymously typedeffed structs in headers a name
  fate: Add parseutils test
  parseutils-test: Drop random colors from parsing test
  vf_pad/scale: use double precision for aspect ratios.
  build: error on variable-length arrays
  ppc: swscale: rework yuv2planeX_altivec()
  ppc: fmtconvert: kill VLA in float_to_int16_interleave_altivec()
  x86: dsputil: kill VLA in gmc_mmx()
  libspeexenc: Updated commentary to reflect recent changes
  libspeexenc: Add an option for enabling DTX
  doc/APIchanges: fill in missing dates and hashes.
  lavr: bump major to 1 and declare it stable.
  lavr: change the type of the data buffers to uint8_t**.
  lavc: deprecate the audio resampling API.

Conflicts:
	cmdutils.h
	configure
	doc/APIchanges
	ffplay.c
	libavcodec/dwt.h
	libavcodec/libspeexenc.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavformat/asf.h
	tests/fate/libavutil.mak
	tests/ref/fate/parseutils

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-06 13:45:08 +02:00
Diego Biurrun
e4cbf7529b Give all anonymously typedeffed structs in headers a name
Anonymous structs cannot be forward declared and have no benefit.
2012-10-06 09:27:11 +02:00
Michael Niedermayer
e3e09f2bad Merge remote-tracking branch 'qatar/master'
* qatar/master:
  os_support: Choose between direct.h and io.h using a configure check
  os_support: Include io.h instead of direct.h on mingw32ce
  x86: ac3dsp: Only refer to the ac3_downmix_sse symbol if it has been declared
  swscale: Remove two bogus asserts
  ac3: move ac3_downmix() from dsputil to ac3dsp
  lavr/audio_mix_matrix: acknowledge the existence of LFE2.
  mlp_parser: avoid mapping multiple disctinct TrueHD channels to the same Libav channel.
  lavu/audioconvert: add a second low frequency channel.

Conflicts:
	doc/APIchanges
	libavcodec/ac3dsp.c
	libavcodec/ac3dsp.h
	libavcodec/mlp_parser.c
	libavutil/audioconvert.c
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-13 15:35:50 +02:00
Mans Rullgard
97cb9236cf ac3: move ac3_downmix() from dsputil to ac3dsp
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-09-12 23:39:50 +01:00
Michael Niedermayer
e4de71677f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  aac_latm: reconfigure decoder on audio specific config changes
  latmdec: fix audio specific config parsing
  Add avcodec_decode_audio4().
  avcodec: change number of plane pointers from 4 to 8 at next major bump.
  Update developers documentation with coding conventions.
  svq1dec: avoid undefined get_bits(0) call
  ARM: h264dsp_neon cosmetics
  ARM: make some NEON macros reusable
  Do not memcpy raw video frames when using null muxer
  fate: update asf seektest
  vp8: flush buffers on size changes.
  doc: improve general documentation for MacOSX
  asf: use packet dts as approximation of pts
  asf: do not call av_read_frame
  rtsp: Initialize the media_type_mask in the rtp guessing demuxer
  Cleaned up alacenc.c

Conflicts:
	doc/APIchanges
	doc/developer.texi
	libavcodec/8svx.c
	libavcodec/aacdec.c
	libavcodec/ac3dec.c
	libavcodec/avcodec.h
	libavcodec/nellymoserdec.c
	libavcodec/tta.c
	libavcodec/utils.c
	libavcodec/version.h
	libavcodec/wmadec.c
	libavformat/asfdec.c
	tests/ref/seek/lavf_asf

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-03 03:00:30 +01:00
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.
2011-12-02 17:40:40 -05:00
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.
2011-09-06 12:43:16 -04:00
Michael Niedermayer
931187e117 ac3dec: export center & suroundmix levels
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-13 01:13:41 +02:00
Michael Niedermayer
3602ad7ee6 Merge commit '142e76f1055de5dde44696e71a5f63f2cb11dedf'
* commit '142e76f1055de5dde44696e71a5f63f2cb11dedf':
  swscale: fix crash with dithering due incorrect offset calculation.
  matroskadec: fix stupid typo (!= -> ==)
  build: remove duplicates from order-only directory prerequisite list
  build: rework rules for things in the tools dir
  configure: fix --cpu=host with gcc 4.6
  ARM: use const macro to define constant data in asm
  bitdepth: simplify FUNC/FUNCC macros
  dsputil: remove ff_emulated_edge_mc macro used in one place
  9/10-bit: simplify clipping macros
  matroskadec: reindent
  matroskadec: defer parsing of cues element until we seek.
  lavc: add support for codec-specific defaults.
  lavc: make avcodec_alloc_context3 officially public.
  lavc: remove a half-working attempt at different defaults for audio/video codecs.
  ac3dec: add a drc_scale private option
  lavf: add avformat_find_stream_info()
  lavc: introduce avcodec_open2() as a replacement for avcodec_open().

Conflicts:
	Makefile
	libavcodec/utils.c
	libavformat/avformat.h
	libswscale/swscale_internal.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-11 04:23:25 +02:00
Anton Khirnov
9b83919f44 ac3dec: add a drc_scale private option
Deprecate corresponding AVCodecContext option.

This is the first test of decoder private options.
2011-07-10 17:07:12 +02:00