[gstreamer-bugs] [Bug 420079] [audioconvert] Uses biased rounding which results in distortions

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Sun Mar 25 03:13:07 PDT 2007


Do NOT reply to this via email (we are currently unable to handle email
responses and they WILL be discarded).

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=420079.
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

  GStreamer | gst-plugins-base | Ver: HEAD CVS


Sebastian Dröge changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #84910|0                           |1
        is obsolete|                            |




------- Comment #10 from Sebastian Dröge  2007-03-25 10:10 UTC -------
Created an attachment (id=85252)
 --> (http://bugzilla.gnome.org/attachment.cgi?id=85252&action=view)
audioconvert-rounding.patch

Ok, here is a finally correct version with fixed and new unit tests for
checking the rounding.

First of all, it doesn't matter at all if we have the temporary variable signed
or unsigned in the original code, thus I changed from guint32 to gint32 as I
need signed values for the rounding and this would otherwise require another
new variable.

Then the rounding that was implemented before did:
-1.2 => -2     1.2 => 1
-1.5 => -2     1.5 => 1
-1.7 => -2     1.7 => 1

The rounding that is implemented now in this patch does:
-1.2 => -1     1.2 => 1
-1.5 => -2     1.5 => 2
-1.7 => -2     1.7 => 2

I added two unit tests that check this for signed and unsigned targets, two
unit test for 16 bit width/depth <-> 8 bit depth, 16 bit width signed and
unsigned and one for testing 16 bit signed <-> unsigned.

Then I had to fix one of the unit tests as it relied on the old rounding.


Does this look fine for you, Jan?




More information about the Gstreamer-bugs mailing list