From: Sebastian Dröge Date: Fri, 1 Oct 2010 08:44:37 +0000 (+0200) Subject: volume: Implement f64 scaling with orc X-Git-Tag: RELEASE-0.10.31~109 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac38fbc3a732a575eb647b42db5f1f65c34cf04a;p=platform%2Fupstream%2Fgst-plugins-base.git volume: Implement f64 scaling with orc This requires orc 0.4.10 --- diff --git a/gst/volume/gstvolume.c b/gst/volume/gstvolume.c index fab1787..796210e 100644 --- a/gst/volume/gstvolume.c +++ b/gst/volume/gstvolume.c @@ -502,13 +502,8 @@ volume_process_double (GstVolume * self, gpointer bytes, guint n_bytes) { gdouble *data = (gdouble *) bytes; guint num_samples = n_bytes / sizeof (gdouble); - int i; - - gdouble vol = self->current_volume; - for (i = 0; i < num_samples; i++) { - data[i] *= vol; - } + orc_scalarmultiply_f64_ns (data, self->current_volume, num_samples); } static void diff --git a/gst/volume/gstvolumeorc.orc b/gst/volume/gstvolumeorc.orc index 2de5566..c05a2fb 100644 --- a/gst/volume/gstvolumeorc.orc +++ b/gst/volume/gstvolumeorc.orc @@ -1,6 +1,12 @@ .init gst_volume_orc_init +.function orc_scalarmultiply_f64_ns +.dest 8 d1 double +.floatparam 8 p1 + +muld d1, d1, p1 + .function orc_scalarmultiply_f32_ns .dest 4 d1 float .floatparam 4 p1