volume: Implement f64 scaling with orc

This requires orc 0.4.10
This commit is contained in:
Sebastian Dröge 2010-10-01 10:44:37 +02:00
parent f5e9d8bb62
commit ac38fbc3a7
2 changed files with 7 additions and 6 deletions

View file

@ -502,13 +502,8 @@ volume_process_double (GstVolume * self, gpointer bytes, guint n_bytes)
{ {
gdouble *data = (gdouble *) bytes; gdouble *data = (gdouble *) bytes;
guint num_samples = n_bytes / sizeof (gdouble); guint num_samples = n_bytes / sizeof (gdouble);
int i;
gdouble vol = self->current_volume; orc_scalarmultiply_f64_ns (data, self->current_volume, num_samples);
for (i = 0; i < num_samples; i++) {
data[i] *= vol;
}
} }
static void static void

View file

@ -1,6 +1,12 @@
.init gst_volume_orc_init .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 .function orc_scalarmultiply_f32_ns
.dest 4 d1 float .dest 4 d1 float
.floatparam 4 p1 .floatparam 4 p1