History

lavu/tx: support in-place FFT transforms

This commit adds support for in-place FFT transforms. Since our internal transforms were all in-place anyway, this only changes the permutation on the input. Unfortunately, research papers were of no help here. All focused on dry hardware implementations, where permutes are free, or on software implementations where binary bloat is of no concern so storing dozen times the transforms for each permutation and version is not considered bad practice. Still, for a pure C implementation, it's only around 28% slower than the multi-megabyte FFTW3 in unaligned mode. Unlike a closed permutation like with PFA, split-radix FFT bit-reversals contain multiple NOPs, multiple simple swaps, and a few chained swaps, so regular single-loop single-state permute loops were not possible. Instead, we filter out parts of the input indices which are redundant. This allows for a single branch, and with some clever AVX512 asm, could possibly be SIMD'd without refactoring. The inplace_idx array is guaranteed to never be larger than the revtab array, and in practice only requires around log2(len) entries. The power-of-two MDCTs can be done in-place as well. And it's possible to eliminate a copy in the compound MDCTs too, however it'll be slower than doing them out of place, and we'd need to dirty the input array.

Lynne committed 5 years ago

Commit 5ca40d61 parent aa34e996 files · +93 −8Browse files

Showing the changes to doc/APIchanges (1 of 6 files). Show all

Unified · Split

doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2017-10-21 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182021-02-21 - xxxxxxxxxx - lavu 56.66.100 - tx.h
19 Add enum AVTXFlags and AVTXFlags.AV_TX_INPLACE
20
182021-02-14 - xxxxxxxxxx - lavd 58.12.100 - avdevice.h212021-02-14 - xxxxxxxxxx - lavd 58.12.100 - avdevice.h
19 Deprecated avdevice_capabilities_create() and22 Deprecated avdevice_capabilities_create() and
20 avdevice_capabilities_free().23 avdevice_capabilities_free().

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t