guint i, j;
gdouble vol;
- for (i = 0; i < num_samples; i++) {
- vol = *volume++;
- for (j = 0; j < channels; j++) {
- *data++ *= vol;
+ if (channels == 1) {
+ orc_process_controlled_f64_1ch (data, volume, num_samples);
+ } else {
+ for (i = 0; i < num_samples; i++) {
+ vol = *volume++;
+ for (j = 0; j < channels; j++) {
+ *data++ *= vol;
+ }
}
}
}
guint i, j;
gdouble vol;
- for (i = 0; i < num_samples; i++) {
- vol = *volume++;
- for (j = 0; j < channels; j++) {
- *data++ *= vol;
+ if (channels == 1) {
+ orc_process_controlled_f32_1ch (data, volume, num_samples);
+ } else if (channels == 2) {
+ orc_process_controlled_f32_2ch (data, volume, num_samples);
+ } else {
+ for (i = 0; i < num_samples; i++) {
+ vol = *volume++;
+ for (j = 0; j < channels; j++) {
+ *data++ *= vol;
+ }
}
}
}
subd t1, 0x3FF0000000000000L, t1
muld d1, d1, t1
+.function orc_process_controlled_f64_1ch
+.dest 8 d1 gdouble
+.source 8 s1 gdouble
+
+muld d1, d1, s1
+
+.function orc_process_controlled_f32_1ch
+.dest 4 d1 gfloat
+.source 8 s1 gdouble
+.temp 4 t1
+
+convdf t1, s1
+mulf d1, d1, t1
+
+.function orc_process_controlled_f32_2ch
+.dest 8 d1 gfloat
+.source 8 s1 gdouble
+.temp 4 t1
+.temp 8 t2
+
+convdf t1, s1
+mergelq t2, t1, t1
+x2 mulf d1, d1, t2