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 394859 - [audiopanorama] New simple method for adjusting the panorama
[audiopanorama] New simple method for adjusting the panorama
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal enhancement
: 0.10.6
Assigned To: Tim-Philipp Müller
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-01-09 23:23 UTC by Sebastian Dröge (slomo)
Modified: 2007-01-16 08:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
audiobalance-sources.diff (16.37 KB, patch)
2007-01-09 23:24 UTC, Sebastian Dröge (slomo)
none Details | Review
audiobalance-tests.diff (15.73 KB, patch)
2007-01-09 23:24 UTC, Sebastian Dröge (slomo)
none Details | Review
audiobalance-docs.diff (51.52 KB, patch)
2007-01-09 23:24 UTC, Sebastian Dröge (slomo)
none Details | Review
audiobalance-makefile.diff (852 bytes, patch)
2007-01-10 06:59 UTC, Sebastian Dröge (slomo)
none Details | Review
audiopanorama-simple.diff (11.68 KB, patch)
2007-01-11 19:30 UTC, Sebastian Dröge (slomo)
none Details | Review
audiopanorama-tests.diff (9.66 KB, patch)
2007-01-11 19:30 UTC, Sebastian Dröge (slomo)
committed Details | Review
audiopanora-simple.diff (11.65 KB, patch)
2007-01-13 10:26 UTC, Sebastian Dröge (slomo)
committed Details | Review
audiopanorama-switch.diff (3.28 KB, patch)
2007-01-15 08:30 UTC, Sebastian Dröge (slomo)
none Details | Review
/audiopanorama-funcarray.diff (4.27 KB, patch)
2007-01-15 18:16 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2007-01-09 23:23:54 UTC
Hi,
the attached patches add the audiobalance element to the audiofx plugin, add a unit test and add the docs to the docs build system.

The element and unit test is mostly a copy of audiopanorama with the only changes in the processing functions. Maybe this can be generalized into a new base class at some point.

I hope it's not necessary to get this through plugins-bad before as it's just an audiofx addition :/

The difference between audiopanorama and audiobalance is, that audiopanorama moves the sound in the stereo panorama based and psychoacoutics while audiobalance only changes the volume of each channel. For some use cases the former is useful, for other's the latter and a balance element was requested more than once on IRC.

Bye
Comment 1 Sebastian Dröge (slomo) 2007-01-09 23:24:07 UTC
Created attachment 79905 [details] [review]
audiobalance-sources.diff
Comment 2 Sebastian Dröge (slomo) 2007-01-09 23:24:30 UTC
Created attachment 79906 [details] [review]
audiobalance-tests.diff
Comment 3 Sebastian Dröge (slomo) 2007-01-09 23:24:50 UTC
Created attachment 79907 [details] [review]
audiobalance-docs.diff
Comment 4 Sebastian Dröge (slomo) 2007-01-10 06:59:24 UTC
Created attachment 79922 [details] [review]
audiobalance-makefile.diff

I apperantly forgot to add the Makefile.am changes in the first patch... here they are ;)
Comment 5 Tim-Philipp Müller 2007-01-10 23:30:56 UTC
> The element and unit test is mostly a copy of audiopanorama with the only
> changes in the processing functions. Maybe this can be generalized into a new
> base class at some point.

Any reason not to make audiopanorama derive from audiobalance or vice versa then? Seems a bit unnecessary to duplicate all this code if only the processing funcs are different.

> I hope it's not necessary to get this through plugins-bad before as it's just
> an audiofx addition :/

Don't think this is a problem.
Comment 6 Sebastian Dröge (slomo) 2007-01-11 10:13:50 UTC
After talking with Stefan about it yesterday and some further thoughts I guess the best would be to implement it in the audiopanorama element and add a property to switch between both methods... obviously having the current one as default.

This probably makes the most sense as the differences between the output of both methods are not that large and there's no clear definition of what pan is and what balance.

The property should probably be called "method" with the values "psychoacoustic" and "naive" with the former as default.

I'll attach a patch for this later today if there are no objections...
Comment 7 Sebastian Dröge (slomo) 2007-01-11 19:30:09 UTC
Created attachment 80058 [details] [review]
audiopanorama-simple.diff
Comment 8 Sebastian Dröge (slomo) 2007-01-11 19:30:32 UTC
Created attachment 80059 [details] [review]
audiopanorama-tests.diff
Comment 9 Sebastian Dröge (slomo) 2007-01-11 19:31:40 UTC
Here are the two patches, one adds the simple method to audiopanorama, the other adds unit tests for this method.

Changing the method while processing is possible.
Comment 10 Sebastian Dröge (slomo) 2007-01-13 10:26:24 UTC
Created attachment 80171 [details] [review]
audiopanora-simple.diff

Not very useful to declare the method property as GST_CONTROLLABLE...
Comment 11 Tim-Philipp Müller 2007-01-13 15:52:50 UTC
Thanks, committed:

 2007-01-13  Tim-Philipp Müller  <tim at centricular dot net>

        Patch by: Sebastian Dröge <slomo circular-chaos org>

        * gst/audiofx/audiopanorama.c:
        (gst_audio_panorama_method_get_type),
        (gst_audio_panorama_class_init), (gst_audio_panorama_init),
        (gst_audio_panorama_set_process_function),
        (gst_audio_panorama_set_property),
        (gst_audio_panorama_get_property), (gst_audio_panorama_set_caps),
        (gst_audio_panorama_transform_m2s_int_simple),
        (gst_audio_panorama_transform_s2s_int_simple),
        (gst_audio_panorama_transform_m2s_float_simple),
        (gst_audio_panorama_transform_s2s_float_simple):
        * gst/audiofx/audiopanorama.h:
          Add 'method' property and provide a simple (non-psychoacustic)
          processing method (#394859).

        * tests/check/elements/audiopanorama.c: (GST_START_TEST),
        (panorama_suite):
          Tests for new method.

Comment 12 Stefan Sauer (gstreamer, gtkdoc dev) 2007-01-15 08:13:21 UTC
* I would have used switch-case instead of if (filter->method == METHOD_SIMPLE), that helps future changes.
* if you have pointers (URLs) to the differences of the algorithms, lets put them into the docs.
* it wold also be good if we could give guidance when to use which method (is one faster that the other or is it purely matter of taste)
Comment 13 Sebastian Dröge (slomo) 2007-01-15 08:30:34 UTC
Created attachment 80297 [details] [review]
audiopanorama-switch.diff

patch for 1)
Comment 14 Sebastian Dröge (slomo) 2007-01-15 08:37:53 UTC
3) The simple method is probably marginally faster but IMHO not enough that someone can notice it... it's probably only a matter of taste and what your understanding of panning/balance is.
2) I don't have any concrete docs about it, only random webpages... some saying that panning/balance is what the old method does, some saying that it is what the simple method does in a very non-formal way... nothing worth quoting, sorry :/
Comment 15 Tim-Philipp Müller 2007-01-15 09:08:54 UTC
Since we're talking about minute style details in gst_audio_panorama_set_process_function(): you could just as well use a function array, which would be considerably shorter ;)
Comment 16 Sebastian Dröge (slomo) 2007-01-15 09:23:11 UTC
Right... I'll do it tonight :P
And I'll add to the docs that it's mostly a matter of taste which method one should use and that one should just compare both for their usage
Comment 17 Sebastian Dröge (slomo) 2007-01-15 18:16:50 UTC
Created attachment 80327 [details] [review]
/audiopanorama-funcarray.diff

here is it ;)
Comment 18 Stefan Sauer (gstreamer, gtkdoc dev) 2007-01-16 08:29:13 UTC
Thanks for the patch. Applied.

2007-01-16  Stefan Kost  <ensonic@users.sf.net>

	Patch by: Sebastian Dröge <slomo circular-chaos org>

	* gst/audiofx/audiopanorama.c: (gst_audio_panorama_class_init),
	(gst_audio_panorama_set_process_function):
	  Use a function array for process methods, add more docs and define the
	  startindex of enums.