1 The official guide to swresample for confused developers.
2 =========================================================
4 Current (simplified) Architecture:
5 ---------------------------------
8 __________________/|\___________
10 / input sample format convert v
14 | ___________/|\___________ _____________
16 | Rematrix | resample <---->| Buffers |
17 | \___________ | ___________/ |_____________|
20 v ___________/|\___________ _____________
22 | Rematrix | resample <---->| Buffers |
23 | \___________ | ___________/ |_____________|
28 \ output sample format convert v
29 \_________________ | ___________/
34 Planar/Packed convertion is done when needed during sample format convertion
35 Every step can be skipped without memcpy when its not needed.
36 Either Resampling and Rematrixing can be performed first depending on which
38 The Buffers are needed for resampling due to resamplng being a process that
39 requires future and past data, it thus also introduces inevitably a delay when
41 Internally 32bit float and 16bit int is supported currently, other formats can
43 Externally all sample formats in packed and planar configuration are supported
44 Its also trivial to add special converters for common cases
45 If only sample format and or packed/planar convertion is needed it
46 is performed from input to output directly in a single pass with no intermediates.