After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 396057 - [audiofx] New audioinvert element
[audiofx] New audioinvert element
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal enhancement
: 0.10.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-01-13 11:11 UTC by Sebastian Dröge (slomo)
Modified: 2007-01-23 19:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
audioinvert-sources.diff (12.97 KB, patch)
2007-01-13 11:11 UTC, Sebastian Dröge (slomo)
none Details | Review
audioinvert-tests.diff (9.96 KB, patch)
2007-01-13 11:12 UTC, Sebastian Dröge (slomo)
committed Details | Review
audioinvert-docs.diff (2.23 KB, patch)
2007-01-13 11:12 UTC, Sebastian Dröge (slomo)
committed Details | Review
audioinvert-sources.diff (12.97 KB, patch)
2007-01-18 10:30 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2007-01-13 11:11:17 UTC
Hi,
attached are patches against plugins-good CVS that add a audioinvert element to audiofx, adds unit tests and docs.

audioinvert swaps the upper and lower half of audio samples. There's a degree property to set the degree of inversion. 0 is passthrough, 0.5 creates silence, 1.0 gives completely inverted samples.

Mixing an inverted sample on top ofthe original with a slight delay can produce effects that sound like resonance. Creating a stereo sample from a mono source, with one channel inverted produces wide-stereo sounds.

The method to calculate the samples is (in the float case):
sample = sample*(1-degree) + (-sample) * degree

Bye
Comment 1 Sebastian Dröge (slomo) 2007-01-13 11:11:40 UTC
Created attachment 80172 [details] [review]
audioinvert-sources.diff
Comment 2 Sebastian Dröge (slomo) 2007-01-13 11:12:04 UTC
Created attachment 80173 [details] [review]
audioinvert-tests.diff
Comment 3 Sebastian Dröge (slomo) 2007-01-13 11:12:27 UTC
Created attachment 80174 [details] [review]
audioinvert-docs.diff
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2007-01-16 09:08:35 UTC
forgot to mention, that I once removed invert from SoundFX as this is equivalent to Amplify using a negative factor. I later readded it, as it was beyond what some people could figure out. I wonder wheter having the implementation in Bug397162 is enough.
Comment 5 Sebastian Dröge (slomo) 2007-01-18 10:30:22 UTC
Created attachment 80578 [details] [review]
audioinvert-sources.diff

trivial fix for the docs
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2007-01-23 13:20:09 UTC
looks good, please commit!
Comment 7 Sebastian Dröge (slomo) 2007-01-23 18:19:09 UTC
Thanks for reviewing... commited:

2007-01-23  Sebastian Dröge  <slomo@circular-chaos.org>

        reviewed by: Stefan Kost  <ensonic@users.sf.net>

        * gst/audiofx/Makefile.am:
        * gst/audiofx/audiofx.c: (plugin_init):
        * gst/audiofx/audioinvert.c: (gst_audio_invert_base_init),
        (gst_audio_invert_class_init), (gst_audio_invert_init),
        (gst_audio_invert_set_property), (gst_audio_invert_get_property),
        (gst_audio_invert_set_caps), (gst_audio_invert_transform_int),
        (gst_audio_invert_transform_float),
        (gst_audio_invert_transform_ip):
        * gst/audiofx/audioinvert.h:
        Add new audiofx element "audioinvert". This element swaps the upper
        and lower half of samples and can be used for example for a
        wide-stereo effect. Fixes #396057
        * docs/plugins/Makefile.am:
        * docs/plugins/gst-plugins-good-plugins-docs.sgml:
        * docs/plugins/gst-plugins-good-plugins-sections.txt:
        * docs/plugins/gst-plugins-good-plugins.args:
        * docs/plugins/inspect/plugin-audiofx.xml:
        Add docs for the audioinvert element and add them to the build system.
        * tests/check/Makefile.am:
        * tests/check/elements/audioinvert.c: (setup_invert),
        (cleanup_invert), (GST_START_TEST), (invert_suite), (main):
        Add unit test suite for the audioinvert element.
Comment 8 Sebastian Dröge (slomo) 2007-01-23 19:03:06 UTC
...and now that I can close bugs really close this one :)