Imported Debian version 2.4.3~trusty1
[deb_ffmpeg.git] / ffmpeg / doc / swresample.txt
CommitLineData
2ba45a60
DM
1 The official guide to swresample for confused developers.
2 =========================================================
3
4Current (simplified) Architecture:
5---------------------------------
6 Input
7 v
8 __________________/|\___________
9 / | \
10 / input sample format convert v
11 / | ___________/
12 | |/
13 | v
14 | ___________/|\___________ _____________
15 | / | \ | |
16 | Rematrix | resample <---->| Buffers |
17 | \___________ | ___________/ |_____________|
18 v \|/
19Special Converter v
20 v ___________/|\___________ _____________
21 | / | \ | |
22 | Rematrix | resample <---->| Buffers |
23 | \___________ | ___________/ |_____________|
24 | \|/
25 | v
26 | |\___________
27 \ | \
28 \ output sample format convert v
29 \_________________ | ___________/
30 \|/
31 v
32 Output
33
34Planar/Packed conversion is done when needed during sample format conversion.
35Every step can be skipped without memcpy when it is not needed.
36Either Resampling and Rematrixing can be performed first depending on which
37way it is faster.
38The Buffers are needed for resampling due to resamplng being a process that
39requires future and past data, it thus also introduces inevitably a delay when
40used.
41Internally 32bit float and 16bit int is supported currently, other formats can
42easily be added.
43Externally all sample formats in packed and planar configuration are supported
44It's also trivial to add special converters for common cases.
45If only sample format and/or packed/planar conversion is needed, it
46is performed from input to output directly in a single pass with no intermediates.