mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
volume: Implement controlled processing for f64/1ch and f32/1-2ch in orc
This commit is contained in:
parent
988849a8b4
commit
0bf4abe581
2 changed files with 41 additions and 8 deletions
|
@ -521,10 +521,14 @@ volume_process_controlled_double (GstVolume * self, gpointer bytes,
|
|||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -547,10 +551,16 @@ volume_process_controlled_float (GstVolume * self, gpointer bytes,
|
|||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,3 +68,26 @@ convld t1, s1
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue