[Bug 746661] audioconvert is slow on architectures without 64-bit integer divide (e.g. armv7)

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Mar 23 19:04:50 PDT 2015


https://bugzilla.gnome.org/show_bug.cgi?id=746661

Ilya Konstantinov <ilya.konstantinov at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|gstreamer-bugs at lists.freede |ilya.konstantinov at gmail.com
                   |sktop.org                   |

--- Comment #3 from Ilya Konstantinov <ilya.konstantinov at gmail.com> ---
Created attachment 300167
  --> https://bugzilla.gnome.org/attachment.cgi?id=300167&action=edit
Patch - audioconvert: Avoid int division in quantization

I'm not sure why:
 1) we're adding bias twice in RPDF
 2) some dither values are chosen out of 2^n, others out of (2^n)+1

About (2), RPDF is supposed to be simply rolling a 6-face dice twice instead of
a 12-face dice once (TPDF), right?

I took the liberty to unify it. Let me know if I've done something stupid.

GIT COMMIT MESSAGE
------------------

Since range size is always 2^n, we can simply use modulo (implemented
with a bitmask).

The previous implementation used 64-bit integer division, which is
done in software on ARMv7. Although the divisor was constant, the
division could not be transformed into "multiplication by magic number"
since the dividend was 64-bit.

Further, we fix TPDF's noise range to be the same as RPDF's.
Previously, RPDF's noise ranged:
  { bias - dither, bias + dither }
while TPDF's noise ranged:
  { bias - dither/2, bias + dither/2 - 1 } +
  { bias - dither/2, bias + dither/2 - 1 } =
  { 2 * bias - dither, 2 * bias + dither - 2 }
Now, both range:
  { bias - dither, bias + dither - 1 }

Removing unused (expensive) gst_fast_random_(u)int32_range functions.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list