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 435435 - [alaw] use tables for ALAW (G.711) encoding and decoding
[alaw] use tables for ALAW (G.711) encoding and decoding
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal enhancement
: 0.10.7
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-05-03 07:37 UTC by Laurent Glayal
Modified: 2007-09-25 16:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add static table encoding/decoding for alaw (2.61 KB, application/x-gzip)
2007-05-03 07:39 UTC, Laurent Glayal
Details

Description Laurent Glayal 2007-05-03 07:37:47 UTC
Hi,
here is a patch to encode/decode ALAW using pre-calculated tables and not functions, this method is less CPU intensive, it uses more memory ( 2ko max for encoding) but this cost seems to be interesting even for embedded systems.

Regards.
Comment 1 Laurent Glayal 2007-05-03 07:39:11 UTC
Created attachment 87436 [details]
add static table encoding/decoding for alaw
Comment 2 Laurent Glayal 2007-05-03 07:58:29 UTC
Tables/additionnal code are from libsndfile, this code is originally LGPL.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2007-05-07 14:53:54 UTC
laurent, is such a table also available for mulaw?
Comment 4 Laurent Glayal 2007-05-09 06:18:18 UTC
Yes and 'Yes But', Yes for decoding, it's an array with 128 entries , But for encoding the algorithm is not exactly the same, the table is larger (~8192 entries). It's possible to use a table for ulaw but with an overhead of 8kB of memory... All code is in file 'ulaw.c' of the libsndfile project (http://www.mega-nerd.com/libsndfile/).
Regards.

Comment 5 Tim-Philipp Müller 2007-09-25 16:07:11 UTC
Committed, thanks:

 2007-09-25  Tim-Philipp Müller  <tim at centricular dot net>

        Based on patch by: Laurent Glayal  <spglegle yahoo fr>

        * gst/law/alaw-decode.c:
        * gst/law/alaw-encode.c:
          Use static tables for A-Law decoding and encoding; this makes
          A-Law decoding and encoding less CPU-intensive, but increases
          the binary size a bit. Leaving old code around for now,
          selectable by a define in the code. Fixes #435435.

Please create a clone of this bug for the mulaw stuff if you think tables are desirable to have there too.