Commit Graph

25 Commits

Author SHA1 Message Date
Lynne
89a9042291
lavc/avfft: fix RDFT wrapper stride
Per the lavu/tx docs:

> * For forward transforms (R2C), stride must be the spacing between two
> * samples in bytes. For inverse transforms, the stride must be set
> * to the spacing between two complex values in bytes.

The code did the reverse.
The stride parameter is currently not respected for RDFT transforms,
but has to be correct, for a potential future change.
2024-04-10 13:22:18 +02:00
Lynne
90adef99ca
avfft: avoid overreads with RDFT API users
The new API requires an extra array member at the very end,
which old API users did not do.

This disables in-place RDFT transforms and instead
does the transform out of place by copying once, there shouldn't
be a significant loss of speed as our in-place FFT requires a reorder
which is likely more expensive in the majority of cases to do.
2024-02-09 23:20:29 +01:00
Sebastian Ramacher
250471ea17 avcoded/fft: Fix memory leak if ctx2 is used
Signed-off-by: James Almer <jamrial@gmail.com>
2023-11-12 14:47:56 -03:00
Sebastian Ramacher
a562cfee2e avcodec/fft: Use av_mallocz to avoid invalid free/uninit
Signed-off-by: James Almer <jamrial@gmail.com>
2023-11-12 14:47:56 -03:00
Andreas Rheinhardt
e3b355c0be avutil/mem: Don't include avutil.h
It is not necessary at all. So remove it.
This also breaks an inclusion cycle mem.h->avutil.h->common.h->mem.h.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-07 00:42:10 +02:00
Lynne
86aa34d339
avfft: wrap lavu/tx instead of ff_dct 2023-09-01 23:59:13 +02:00
Lynne
83ede01bb0
avfft: wrap lavu/tx instead of ff_rdft 2023-09-01 23:59:12 +02:00
Lynne
517e4fcca6
avfft: wrap lavu/tx instead of ff_mdct 2023-09-01 23:59:12 +02:00
Lynne
dfcd4bbf51
avfft: wrap lavu/tx instead of ff_fft 2023-09-01 23:59:11 +02:00
Derek Buitenhuis
96d616052b Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13'
* commit 'd12b5b2f135aade4099f4b26b0fe678656158c13':
  build: Split test programs off into separate files

Some conversions done by: James Almer <jamrial@gmail.com>
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-11 19:13:03 +01:00
Michael Niedermayer
9bc7ee8a98 avcodec/avfft: Add simple self test
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 19:07:29 +01:00
Nicolas George
04dcdc4640 lavc/avfft: init context to 0.
Prevent an invalid free in case of init failure.
2013-09-04 16:37:25 +02:00
Michael Niedermayer
b50ab3a4c7 Merge commit 'bd8ac882140a38868c33c000a430a1292a352533'
* commit 'bd8ac882140a38868c33c000a430a1292a352533':
  avcodec: Add av_cold attributes to end functions missing them

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-06 10:28:27 +02:00
Diego Biurrun
bd8ac88214 avcodec: Add av_cold attributes to end functions missing them 2013-05-05 20:51:28 +02:00
Michael Niedermayer
0aa095483d Merge commit '6fee1b90ce3bf4fbdfde7016e0890057c9000487'
* commit '6fee1b90ce3bf4fbdfde7016e0890057c9000487':
  avcodec: Add av_cold attributes to init functions missing them

Conflicts:
	libavcodec/aacpsy.c
	libavcodec/atrac3.c
	libavcodec/dvdsubdec.c
	libavcodec/ffv1.c
	libavcodec/ffv1enc.c
	libavcodec/h261enc.c
	libavcodec/h264_parser.c
	libavcodec/h264dsp.c
	libavcodec/h264pred.c
	libavcodec/libschroedingerenc.c
	libavcodec/libxvid_rc.c
	libavcodec/mpeg12.c
	libavcodec/mpeg12enc.c
	libavcodec/proresdsp.c
	libavcodec/rangecoder.c
	libavcodec/videodsp.c
	libavcodec/x86/proresdsp_init.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-05 11:34:29 +02:00
Diego Biurrun
6fee1b90ce avcodec: Add av_cold attributes to init functions missing them 2013-05-04 21:09:45 +02:00
Michael Niedermayer
d4a50a2100 Merge remote-tracking branch 'newdev/master'
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-03-21 03:33:28 +01:00
Mans Rullgard
0aded9484d Move dct and rdft definitions to separate files
This leaves fft.h with only the core FFT and MDCT definitions
thus making it more managable.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-20 17:15:33 +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
Måns Rullgård
e3a28ea5a9 avfft: remove useless parens
Originally committed as revision 24229 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-13 18:01:50 +00:00
Måns Rullgård
943ebf2c4e 100l: really fix fft external API init functions
Originally committed as revision 24228 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-13 06:54:31 +00:00
Måns Rullgård
b310844756 avfft: make init functions return NULL on failure as intended
Originally committed as revision 24219 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-12 19:54:16 +00:00
Vitor Sessak
e1484ebed6 Implement the discrete sine/cosine transforms DCT-I and DST-I
Originally committed as revision 22649 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-23 19:48:16 +00:00
Måns Rullgård
c70948315b Create a public API for FFT family of functions
Originally committed as revision 22291 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-07 21:56:45 +00:00