2011-09-30 16:10:28 +00:00
|
|
|
The official guide to swresample for confused developers.
|
|
|
|
=========================================================
|
|
|
|
|
|
|
|
Current (simplified) Architecture:
|
|
|
|
---------------------------------
|
|
|
|
Input
|
|
|
|
v
|
|
|
|
__________________/|\___________
|
|
|
|
/ | \
|
|
|
|
/ input sample format convert v
|
|
|
|
/ | ___________/
|
|
|
|
| |/
|
|
|
|
| v
|
|
|
|
| ___________/|\___________ _____________
|
|
|
|
| / | \ | |
|
|
|
|
| Rematrix | resample <---->| Buffers |
|
|
|
|
| \___________ | ___________/ |_____________|
|
|
|
|
v \|/
|
|
|
|
Special Converter v
|
|
|
|
v ___________/|\___________ _____________
|
|
|
|
| / | \ | |
|
|
|
|
| Rematrix | resample <---->| Buffers |
|
|
|
|
| \___________ | ___________/ |_____________|
|
|
|
|
| \|/
|
|
|
|
| v
|
|
|
|
| |\___________
|
|
|
|
\ | \
|
|
|
|
\ output sample format convert v
|
|
|
|
\_________________ | ___________/
|
|
|
|
\|/
|
|
|
|
v
|
|
|
|
Output
|
|
|
|
|
2012-10-01 20:44:53 +00:00
|
|
|
Planar/Packed conversion is done when needed during sample format conversion.
|
2012-03-12 22:30:13 +00:00
|
|
|
Every step can be skipped without memcpy when its not needed.
|
2011-09-30 16:10:28 +00:00
|
|
|
Either Resampling and Rematrixing can be performed first depending on which
|
|
|
|
way its faster.
|
|
|
|
The Buffers are needed for resampling due to resamplng being a process that
|
|
|
|
requires future and past data, it thus also introduces inevitably a delay when
|
|
|
|
used.
|
|
|
|
Internally 32bit float and 16bit int is supported currently, other formats can
|
2012-10-01 20:44:53 +00:00
|
|
|
easily be added.
|
2011-09-30 16:10:28 +00:00
|
|
|
Externally all sample formats in packed and planar configuration are supported
|
2012-10-01 20:44:53 +00:00
|
|
|
It's also trivial to add special converters for common cases.
|
|
|
|
If only sample format and/or packed/planar conversion is needed, it
|
2011-10-05 22:32:01 +00:00
|
|
|
is performed from input to output directly in a single pass with no intermediates.
|