From c1bf1ba843e1a14445135f7da9118bdeb00471e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 1 Oct 2010 10:42:27 +0200 Subject: [PATCH] volume: Improve f32 scaling by using only a single array Passing the same array as dest and src is invalid anyway because they're maked with the restrict qualifier. --- gst/volume/gstvolume.c | 4 +--- gst/volume/gstvolumeorc.orc | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/gst/volume/gstvolume.c b/gst/volume/gstvolume.c index c37eeea..fab1787 100644 --- a/gst/volume/gstvolume.c +++ b/gst/volume/gstvolume.c @@ -497,8 +497,6 @@ gst_volume_init (GstVolume * self, GstVolumeClass * g_class) gst_base_transform_set_gap_aware (GST_BASE_TRANSFORM (self), TRUE); } -#define USE_ORC - static void volume_process_double (GstVolume * self, gpointer bytes, guint n_bytes) { @@ -536,7 +534,7 @@ volume_process_float (GstVolume * self, gpointer bytes, guint n_bytes) gfloat *data = (gfloat *) bytes; guint num_samples = n_bytes / sizeof (gfloat); - orc_scalarmultiply_f32_ns (data, data, self->current_volume, num_samples); + orc_scalarmultiply_f32_ns (data, self->current_volume, num_samples); } static void diff --git a/gst/volume/gstvolumeorc.orc b/gst/volume/gstvolumeorc.orc index 8e100a4..2de5566 100644 --- a/gst/volume/gstvolumeorc.orc +++ b/gst/volume/gstvolumeorc.orc @@ -3,10 +3,9 @@ .function orc_scalarmultiply_f32_ns .dest 4 d1 float -.source 4 s1 float .floatparam 4 p1 -mulf d1, s1, p1 +mulf d1, d1, p1 .function orc_process_int16 -- 2.7.4