FFmpeg audio API

From MultimediaWiki
Revision as of 05:53, 18 December 2007 by Merbanan (talk | contribs) (doxygen comments for the mixing init template)
Jump to navigation Jump to search

This page is for discussion regarding the reworking of the FFmpeg audio API to accommodate the requirements needed for today's audio codecs.

Features needed

  • Generalized channel mixing (SIMD optimized) - users should be able to set their own channel mixing coefficients.
  • Codec alterable channel mixing coefficients - the codec should be able to set and update the channel mixing coefficients during runtime (DCA supports this feature, maybe AC-3 also).
  • Output channel request function - specify the number of output channels, default should be >2 channels mapped to 2 channels
  • Channel reordering - currently there are different orders depending on the codec.
  • SIMD optimized interleaving
  • Allow planar output - don't duplicate the interleaving code in every codec
  • Support bit depths other than 16-bit - 8-bit/24-bit/32-bit/float
  • Channel selection - ability to access one channel from a multichannel stream

Feature wish list

  • Dolby Pro Logic Surround Sound decoding.
  • Add a better FFT routine. (Would the KISS implementation be a good candidate?)
  • Fixed point MDCT/FFT implementations
  • Custom audio filter support. (Basing it on the video filter API ideas?)
  • Proper API for enabling SIMD optimized code.

Current ideas

Threads with previous discussions in the subject:


Downmixing templates

/** Initialization routine for the libavcodec multichannel audio mixer
 *
 * @param mix                            pointer to the mixing context
 * @param inchannels                     number of inchannels, this is set by the input stream
 * @param outchannels                    number of outchannels, this is set by the user
 * @param mixing_coeff_index_matrix      table with inchannels*outchannels index elements, a negative index means that the mixing coeffs should be negated (ie L-R)
 * @param mixing_coeffs_table            32bit table with mixing coeffs
 */
void ff_downmix_init(DMIXContext* mix, unsigned int inchannels, unsigned int outchannels, int8_t* mixing_coeff_index_matrix, void* mixing_coeffs_table);