GNOME Bugzilla – Bug 747005
audioconvert: avoid floating point calculations when mixing integer-formatted channels
Last modified: 2015-04-15 10:18:52 UTC
Created attachment 300569 [details] [review] optimization patch Currently, the channel mixer in the audioconvert element always uses floating point calculations. This patch is an optimization that uses fixed-point calculations for integer-formatted channels.
Review of attachment 300569 [details] [review]: Looks good to me :) Thanks! Do you have some numbers about how much it improves performance (on which hardware)?
I tested it on a Cortex-A8, single core, 800MHz. Input was a 96kHz flac file with 6 channels. The time used for my primary test case, this launch line: gst-launch-1.0 filesrc location="flac_96000khz_16bit_6ch.flac" ! decodebin ! audioconvert dithering=0 ! "audio/x-raw,channels=2" ! fakesink sync=false was reduced from ~29 seconds to ~9 seconds.
commit b2db18cda2e4e7951655cb2a34108a8523b6eca9 Author: Bernhard Miller <bernhard.miller@streamunlimited.com> Date: Mon Mar 30 11:24:46 2015 +0200 audioconvert: avoid float calculations when mixing integer-formatted channels The patch calculates a second channel mixing matrix from the current one. The matrix contains the original values * (2^10) as integers. This matrix is used when integer-formatted channels are mixed. On a ARM Cortex-A8, single core, 800MHz this improves performance in a testcase from 29s to 9s for downmixing 6 channels to stereo. https://bugzilla.gnome.org/show_bug.cgi?id=747005
Created attachment 301601 [details] [review] Fixup for the above patch The previous patch is using gint and gint32 synonymously, which can cause problems on 64bit systems. With the fixup, the int matrix now only uses gint.
What problems can it cause on 64 bit systems? On all I'm aware of, gint and gint32 are actually the same type. Still is more correct :) commit 1c01b50adaed506dbb2127590780e2eaa3fd6f0a Author: Bernhard Miller <bernhard.miller@streamunlimited.com> Date: Wed Apr 15 11:24:17 2015 +0200 audioconvert: fix mixed usage of gint and gint32 in int matrix This is a fixup for b2db18cda2e4e7951655cb2a34108a8523b6eca9 audioconvert: avoid float calculations when mixing integer-formatted channels The int matrix was using gint and gint32 synonymously, which can theoretically cause problems if gint and gint32 are actually different types. https://bugzilla.gnome.org/show_bug.cgi?id=747005