Commit Graph

55 Commits

Author SHA1 Message Date
Geoff Hill b69486ea18 avcodec/ac3: Implement float_to_fixed24 for aarch64 NEON
Signed-off-by: Geoff Hill <geoff@geoffhill.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-04-08 13:36:28 +03:00
James Almer 567c67c6c8 avcodec/ac3dsp: make len a size_t in float_to_fixed24
Should simplify asm implementations, and prevent UB on at least win64.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-11-22 18:33:00 -03:00
Rémi Denis-Courmont 89c10d8d20 lavc/ac3: add R-V Zbb extract_exponents 2023-10-05 18:13:00 +03:00
Andreas Rheinhardt 76d8f0dd14 avcodec/ac3dsp: Remove unused parameter
Forgotten in fd98594a88.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-29 23:37:13 +02:00
Andreas Rheinhardt 40e6575aa3 all: Replace if (ARCH_FOO) checks by #if ARCH_FOO
This is more spec-compliant because it does not rely
on dead-code elimination by the compiler. Especially
MSVC has problems with this, as can be seen in
https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html
or
https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/297022.html

This commit does not eliminate every instance where we rely
on dead code elimination: It only tackles branching to
the initialization of arch-specific dsp code, not e.g. all
uses of CONFIG_ and HAVE_ checks. But maybe it is already
enough to compile FFmpeg with MSVC with whole-programm-optimizations
enabled (if one does not disable too many components).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-15 04:56:37 +02:00
Andreas Rheinhardt 104abea646 avcodec/ac3: Move non-(de|en)coder-only parts out of ac3.h
Move AC3HeaderInfo into ac3_parser_internal.h and the rest
into a new header ac3defs.h.

This also breaks an include cycle of ac3.h and ac3tab.h
(the latter now only needs ac3defs.h).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-15 18:13:56 +02:00
Andreas Rheinhardt 25c8507818 Remove/replace some unnecessary avcodec.h inclusions
Also remove other unnecessary headers and include headers directly while
at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 15:29:46 +02:00
Lynne 9e05421dbe
ac3enc_fixed: drop unnecessary fixed-point DSP code 2021-01-14 01:44:20 +01: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
James Almer 91ccd38c0b avcodec/ac3dsp: add special-case handling for the C downmix_fixed function
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-03-28 23:09:17 -03:00
Clément Bœsch c66bd8f3ff Merge commit 'b57e38f52cc3f31a27105c28887d57cd6812c3eb'
* commit 'b57e38f52cc3f31a27105c28887d57cd6812c3eb':
  ac3dsp: x86: Replace inline asm for in-decoder downmixing with standalone asm

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-22 12:49:29 +01:00
Clément Bœsch fd5e1d132b Merge commit 'a9ba59591ed509fb7e6decfde8da4cbfd4ddf4b8'
* commit 'a9ba59591ed509fb7e6decfde8da4cbfd4ddf4b8':
  ac3dsp: Add some special-case handling for the C downmix function

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-22 11:30:53 +01: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
Justin Ruggles b57e38f52c ac3dsp: x86: Replace inline asm for in-decoder downmixing with standalone asm
Adds a wrapper function for downmixing which detects channel count changes
and updates the selected downmix function accordingly.

Simplification and porting to current x86inc infrastructure by Diego Biurrun.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-10-01 00:46:25 +02:00
Justin Ruggles a9ba59591e ac3dsp: Add some special-case handling for the C downmix function
This is about 200% faster for in-decoder downmixing of 5.0 and 5.1 content.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-10-01 00:46:18 +02: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
Clément Bœsch c01f1157ac Merge commit '0f40c9098498ad90dbbd2380eb4269015e84bde4'
* commit '0f40c9098498ad90dbbd2380eb4269015e84bde4':
  Drop pointless assert.h #includes

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-21 15:26:20 +02:00
Diego Biurrun 0f40c90984 Drop pointless assert.h #includes 2016-05-03 15:45:10 +02:00
Michael Niedermayer 66d79aa2e1 Merge commit '9abc80f1ed673141326341e26a05c3e1f78576d0'
* commit '9abc80f1ed673141326341e26a05c3e1f78576d0':
  libavcodec: Make use of av_clip functions

Conflicts:
	libavcodec/takdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-21 11:27:24 +01:00
Peter Meerwald 9abc80f1ed libavcodec: Make use of av_clip functions
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-02-21 00:54:40 +01: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 1c788eaca9 Merge commit '831a1180785a786272cdcefb71566a770bfb879e'
* commit '831a1180785a786272cdcefb71566a770bfb879e':
  Update dsputil- and SIMD-related comments to match reality more closely

Conflicts:
	libavcodec/x86/hpeldsp.asm
	libavutil/arm/float_dsp_init_arm.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-13 23:59:56 +01:00
Diego Biurrun 831a118078 Update dsputil- and SIMD-related comments to match reality more closely 2014-03-13 05:50:29 -07:00
Michael Niedermayer 8e70fdab36 Merge commit '4958f35a2ebc307049ff2104ffb944f5f457feb3'
* commit '4958f35a2ebc307049ff2104ffb944f5f457feb3':
  dsputil: Move apply_window_int16 to ac3dsp

Conflicts:
	libavcodec/arm/ac3dsp_init_arm.c
	libavcodec/arm/ac3dsp_neon.S
	libavcodec/x86/ac3dsp_init.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-09 04:12:40 +01:00
Diego Biurrun 4958f35a2e dsputil: Move apply_window_int16 to ac3dsp
The (optimized) functions are used nowhere else.
2013-12-08 17:57:15 +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
Mans Rullgard 30b3916425 ac3dec: make downmix() take array of pointers to channel data 2012-12-09 15:52:01 +00:00
Bojan Zivkovic a74ae4691a mips: Optimization of AC3 FP encoder and EAC3 FP decoder
Signed-off-by: Bojan Zivkovic <bojan@mips.com>
Reveiwed-by: Vitor Sessak <vitor1001@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-19 22:24:44 +01:00
Michael Niedermayer 52dc18d414 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  x86: vc1: call ff_vc1dsp_init_x86() under if (ARCH_X86)
  x86: cavs: call ff_cavsdsp_init_x86() under if (ARCH_X86)
  x86: call most of the x86 dsp init functions under if (ARCH_X86)
  doc: support the new website layout
  doc: remove a warning from filters.texi
  doc: initial nut documentation
  segment: drop global headers setting
  lavu: fix typo in Makefile

Conflicts:
	doc/Makefile
	doc/filters.texi
	doc/t2h.init
	libavcodec/fmtconvert.c
	libavcodec/proresdsp.c
	libavcodec/x86/Makefile
	libavcodec/x86/vc1dsp_mmx.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-08 21:46:34 +02:00
Janne Grunau f101eab1be x86: call most of the x86 dsp init functions under if (ARCH_X86)
Rename the called dsp init functions to *_init_x86.
2012-10-08 11:54:05 +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 4c677df27c Merge remote-tracking branch 'qatar/master'
* qatar/master: (22 commits)
  frwu: Employ more meaningful return values.
  fraps: Use av_fast_padded_malloc() instead of av_realloc()
  mjpegdec: use av_fast_padded_malloc()
  eatqi: use av_fast_padded_malloc()
  asv1: use av_fast_padded_malloc()
  avcodec: Add av_fast_padded_malloc().
  swscale: enable dithering in MMX functions.
  swscale: make rgb24 function macros slightly smaller.
  avcodec.h: Remove some disabled cruft.
  swscale: remove obsolete comment.
  swscale-test: Drop unused argc and argv arguments from main().
  zmbv: Employ more meaningful return values.
  zmbvenc: Employ more meaningful return values.
  vc1: prevent null pointer dereference on broken files
  zmbv: check av_realloc() return values and avoid memleaks on ENOMEM
  truespeech: align buffer
  ac3: Do not read past the end of ff_ac3_band_start_tab.
  dv: Fix small stack overread related to CVE-2011-3929 and CVE-2011-3936.
  dv: Fix null pointer dereference due to ach=0
  dv: check stype
  ...

Conflicts:
	doc/APIchanges
	libavcodec/asv1.c
	libavcodec/avcodec.h
	libavcodec/eatqi.c
	libavcodec/fraps.c
	libavcodec/frwu.c
	libavcodec/zmbv.c
	libavformat/dv.c
	libswscale/swscale.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-02 02:24:09 +01:00
Mans Rullgard 034b03e7a0 ac3: Do not read past the end of ff_ac3_band_start_tab.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Alex Converse <alex.converse@gmail.com>
2012-01-31 18:32:14 -08:00
Michael Niedermayer d8cae42d72 Merge remote-tracking branch 'mans/ac3'
* mans/ac3:
  ac3enc: slightly faster quantize_mantissas_blk_ch()
  ac3enc: NEON optimised sum_square_butterfly_float
  ac3enc: neon optimised sum_square_butterfly_int32
  ac3enc: move inner loop of compute_rematrixing_strategy to ac3dsp

Conflicts:
	libavcodec/ac3enc_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-22 11:11:08 +02:00
Mans Rullgard f507a9fe00 ac3enc: move inner loop of compute_rematrixing_strategy to ac3dsp 2011-07-06 00:29:59 +01:00
Michael Niedermayer 3074f03a07 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  get_bits: remove x86 inline asm in A32 bitstream reader
  doc: Remove outdated information about our issue tracker
  avidec: Factor out the sync fucntionality.
  fate-aac: Expand coverage.
  ac3dsp: add x86-optimized versions of ac3dsp.extract_exponents().
  ac3dsp: simplify extract_exponents() now that it does not need to do clipping.
  ac3enc: clip coefficients after MDCT.
  ac3enc: add int32_t array clipping function to DSPUtil, including x86 versions.
  swscale: for >8bit scaling, read in native bit-depth.
  matroskadec: matroska_read_seek after after EBML_STOP leads to failure.
  doxygen: fix usage of @file directive in libavutil/{dict,file}.h
  doxygen: Help doxygen parser to understand the DECLARE_ALIGNED and offsetof macros

Conflicts:
	doc/issue_tracker.txt
	libavformat/avidec.c
	libavutil/dict.h
	libswscale/swscale.c
	libswscale/utils.c
	tests/ref/lavfi/pixfmts_scale

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-02 03:24:32 +02:00
Justin Ruggles 8b7b2d6aae ac3dsp: simplify extract_exponents() now that it does not need to do clipping. 2011-07-01 13:02:11 -04:00
Michael Niedermayer b8a43bc1b5 Merge remote-tracking branch 'qatar/master' into master
* qatar/master: (27 commits)
  ac3enc: fix LOCAL_ALIGNED usage in count_mantissa_bits()
  ac3dsp: do not use the ff_* prefix when referencing ff_ac3_bap_bits.
  ac3dsp: fix loop condition in ac3_update_bap_counts_c()
  ARM: unbreak build
  ac3enc: modify mantissa bit counting to keep bap counts for all values of bap instead of just 0 to 4.
  ac3enc: split mantissa bit counting into a separate function.
  ac3enc: store per-block/channel bap pointers by reference block in a 2D array rather than in the AC3Block struct.
  get_bits: add av_unused tag to cache variable
  sws: replace all long with int.
  ARM: aacdec: fix constraints on inline asm
  ARM: remove unnecessary volatile from inline asm
  ARM: add "cc" clobbers to inline asm where needed
  ARM: improve FASTDIV asm
  ac3enc: use LOCAL_ALIGNED macro
  APIchanges: fill in git hash for av_get_pix_fmt_name (0420bd7).
  lavu: add av_get_pix_fmt_name() convenience function
  cmdutils: remove OPT_FUNC2
  swscale: fix crash in bilinear scaling.
  vpxenc: add VP8E_SET_STATIC_THRESHOLD mapping
  webm: support stereo videos in matroska/webm muxer
  ...

Conflicts:
	Changelog
	cmdutils.c
	cmdutils.h
	doc/APIchanges
	doc/muxers.texi
	ffmpeg.c
	ffplay.c
	libavcodec/ac3enc.c
	libavcodec/ac3enc_float.c
	libavcodec/avcodec.h
	libavcodec/get_bits.h
	libavcodec/libvpxenc.c
	libavcodec/version.h
	libavdevice/libdc1394.c
	libavformat/matroskaenc.c
	libavutil/avutil.h
	libswscale/rgb2rgb.c
	libswscale/swscale.c
	libswscale/swscale_template.c
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-29 03:34:35 +02:00
Justin Ruggles dc0ad40de2 ac3dsp: fix loop condition in ac3_update_bap_counts_c() 2011-05-28 14:41:21 -04:00
Justin Ruggles 6ca23db9cc ac3enc: modify mantissa bit counting to keep bap counts for all values of bap
instead of just 0 to 4.

This does all the actual bit counting as a final step.
2011-05-28 12:39:28 -04:00
Michael Niedermayer c3f5b81125 Merge remote branch 'qatar/master'
* qatar/master:
  ALPHA: Replace sized int_fast integer types with plain int/unsigned.
Duplicate  DPX image encoder
Duplicate  DPX decoder: read sample aspect ratio
Duplciate  DPX decoder: add buffer size checks.
  ac3enc: clip large coefficient values and negative exponents rather than using av_assert2().
  ac3enc: do not store a bandwidth code for each channel.
  ac3enc: remove bandwidth reduction as fallback for bit allocation failure.
  ac3enc: merge compute_exp_strategy_ch() into compute_exp_strategy()
  ac3enc: return error if frame+exponent bits are too large instead of using av_assert2().
  ac3enc: differentiate between current block and reference block in bit_alloc()
  ac3enc: simplify exponent_init() by calculating exponent_group_tab[] based on exponent group sizes.
  ac3enc: simplify stereo rematrixing decision options
Include both URLs:  Update URL to fate samples

Conflicts:
	Changelog
	doc/fate.txt
	libavcodec/ac3enc.c
	libavcodec/dpxenc.c
	libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-02 03:45:58 +02:00
Justin Ruggles 63b1866ae1 ac3enc: clip large coefficient values and negative exponents rather than using
av_assert2().
2011-05-01 13:32:04 -04:00
Michael Niedermayer 434f248723 Merge remote branch 'qatar/master'
* qatar/master: (22 commits)
  ac3enc: move extract_exponents inner loop to ac3dsp
  avio: deprecate url_get_filename().
  avio: deprecate url_max_packet_size().
  avio: make url_get_file_handle() internal.
  avio: make url_filesize() internal.
  avio: make url_close() internal.
  avio: make url_seek() internal.
  avio: cosmetics, move AVSEEK_SIZE/FORCE declarations together
  avio: make url_write() internal.
  avio: make url_read_complete() internal.
  avio: make url_read() internal.
  avio: make url_open() internal.
  avio: make url_connect internal.
  avio: make url_alloc internal.
  applehttp: Merge two for loops
  applehttp: Restructure the demuxer to use a custom AVIOContext
  applehttp: Move finished and target_duration to the variant struct
  aacenc: reduce the number of loop index variables
  avio: deprecate url_open_protocol
  avio: deprecate url_poll and URLPollEntry
  ...

Conflicts:
	libavformat/applehttp.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-05 02:31:56 +02:00
Mans Rullgard 2310ee4b1c ac3enc: move extract_exponents inner loop to ac3dsp
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-04-04 18:27:22 +01:00
Michael Niedermayer 445fdc0140 Merge remote-tracking branch 'newdev/master'
* newdev/master:
  ac3enc: move compute_mantissa_size() to ac3dsp
  ac3enc: move mant*_cnt and qmant*_ptr out of AC3EncodeContext
  Remove support for stripping executables
  ac3enc: NEON optimised float_to_fixed24
  ac3: move ff_ac3_bit_alloc_calc_bap to ac3dsp
  dfa: protect pointer range checks against overflows.
Duplicate:  mimic: implement multithreading.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-03-30 03:09:08 +02:00
Mans Rullgard 52fd16a264 ac3enc: move compute_mantissa_size() to ac3dsp
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-30 01:21:56 +01:00
Mans Rullgard 6d9f52b2cd ac3: move ff_ac3_bit_alloc_calc_bap to ac3dsp
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-29 19:31:45 +01:00
Michael Niedermayer 797ef671dd Merge remote-tracking branch 'newdev/master'
* newdev/master:
  matroskadec: set default duration for simple block
  When building for MinGW32 disable strict ANSI compliancy.
  ARM: fix ff_apply_window_int16_neon() prototype
  configure: check for --as-needed support early
  ARM: NEON optimised apply_window_int16()
  ac3enc: NEON optimised shift functions
  ac3enc: NEON optimised ac3_max_msb_abs_int16 and ac3_exponent_min
  mpeg12.c: fix slice threading for mpeg2 field picture mode.
  ffmetadec.c: fix compiler warnings.
  configure: Don't explicitly disable ffplay or in/outdevices on dos
  configure: Remove the explicit disabling of ffserver
  configure: Add fork as a dependency to ffserver

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-03-25 02:57:41 +01:00
Mans Rullgard f4855a904e ac3enc: NEON optimised ac3_max_msb_abs_int16 and ac3_exponent_min 2011-03-24 16:30:49 +00:00