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 687378 - Optimize audioconvert on simple endian conversions
Optimize audioconvert on simple endian conversions
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-11-01 21:55 UTC by rohde
Modified: 2012-12-12 16:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Optimize audioconvert on simple endian conversions (13.32 KB, patch)
2012-11-01 21:55 UTC, rohde
rejected Details | Review
Optimize audioconvert on simple endian conversions, try 2 (17.42 KB, patch)
2012-11-02 06:31 UTC, rohde
needs-work Details | Review

Description rohde 2012-11-01 21:55:35 UTC
Created attachment 227843 [details] [review]
Optimize audioconvert on simple endian conversions

When doing simple endian conversion between S16LE/S16BE and S32BE/S32LE we can do a simple endian swap and nothing more.

This patch adds an optimization to handle these cases.
Comment 1 rohde 2012-11-02 03:52:56 UTC
Review of attachment 227843 [details] [review]:

Patch forgets to check that signedness is equal. Please ignore.
Comment 2 rohde 2012-11-02 06:31:38 UTC
Created attachment 227872 [details] [review]
Optimize audioconvert on simple endian conversions, try 2
Comment 3 Sebastian Dröge (slomo) 2012-11-02 08:28:44 UTC
Review of attachment 227872 [details] [review]:

::: gst/audioconvert/audioconvert.c
@@ +682,3 @@
+  /* in some cases we only need to do endian conversion.
+   * This is a minor optimization to catch that case. */
+  ctx->fast_endian_conversion = NULL;

Maybe call this ctx->fast_path?

@@ +685,3 @@
+  if (ctx->mix_passthrough &&
+      GST_AUDIO_FORMAT_INFO_IS_INTEGER (in->finfo) &&
+      GST_AUDIO_FORMAT_INFO_IS_INTEGER (out->finfo) &&

This will work for floats too

@@ +695,3 @@
+    } else if (in_depth == 32 && out_depth == 32) {
+      ctx->fast_endian_conversion =
+          (AudioConvertFastEndian) audio_convert_orc_32_swap;

For S32 the fast paths shouldn't be that useful. audioconvert will already do exactly that with the normal code path.

@@ +700,3 @@
+        GST_AUDIO_FORMAT_INFO_IS_SIGNED (in->finfo)) {
+      ctx->fast_endian_conversion =
+          (AudioConvertFastEndian) audio_convert_orc_s16_s32_swap;

This works for unsigned too, and for output_endianness!=G_BYTE_ORDER. Also for $something to S32 native-endianness the normal audioconvert code path will already do exactly this.

::: gst/audioconvert/gstaudioconvertorc.orc
@@ +602,3 @@
+swapl d1, s1
+
+.function audio_convert_orc_s16_s32_swap

There should already be a function that converts S16 non-host-endianness to S32 host-endianness
Comment 4 Sebastian Dröge (slomo) 2012-12-12 16:33:19 UTC
Are you planning to continue to work on this?
Comment 5 rohde 2012-12-12 16:35:02 UTC
(In reply to comment #4)
> Are you planning to continue to work on this?

Nope. Feel free to close it.