mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
volume: Convert parts of the controlled processing to orc
This commit is contained in:
parent
ac38fbc3a7
commit
988849a8b4
2 changed files with 24 additions and 10 deletions
|
@ -49,8 +49,14 @@
|
|||
#include <gst/controller/gstcontroller.h>
|
||||
#include <gst/audio/audio.h>
|
||||
#include <gst/audio/gstaudiofilter.h>
|
||||
#include "gstvolumeorc.h"
|
||||
|
||||
#ifdef HAVE_ORC
|
||||
#include <orc/orcfunctions.h>
|
||||
#else
|
||||
#define orc_memset memset
|
||||
#endif
|
||||
|
||||
#include "gstvolumeorc.h"
|
||||
#include "gstvolume.h"
|
||||
|
||||
/* some defines for audio processing */
|
||||
|
@ -973,17 +979,11 @@ volume_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
|
|||
gst_object_unref (volume_csource);
|
||||
volume_csource = NULL;
|
||||
} else {
|
||||
guint i;
|
||||
|
||||
for (i = 0; i < nsamples; i++)
|
||||
self->volumes[i] = self->current_volume;
|
||||
orc_memset_f64 (self->volumes, self->current_volume, nsamples);
|
||||
}
|
||||
|
||||
if (mute_csource) {
|
||||
guint i;
|
||||
|
||||
for (i = 0; i < nsamples; i++)
|
||||
self->volumes[i] *= (1.0 - self->mutes[i]);
|
||||
orc_prepare_volumes (self->volumes, self->mutes, nsamples);
|
||||
}
|
||||
|
||||
self->process_controlled (self, data, self->volumes, channels, size);
|
||||
|
@ -994,7 +994,7 @@ volume_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
|
|||
}
|
||||
|
||||
if (self->current_volume == 0.0 || self->current_mute) {
|
||||
memset (data, 0, size);
|
||||
orc_memset (data, 0, size);
|
||||
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_GAP);
|
||||
} else if (self->current_volume != 1.0) {
|
||||
self->process (self, data, size);
|
||||
|
|
|
@ -53,4 +53,18 @@ mulsbw t1, d1, p1
|
|||
shrsw t1, t1, 5
|
||||
convssswb d1, t1
|
||||
|
||||
.function orc_memset_f64
|
||||
.dest 8 d1 gdouble
|
||||
.floatparam 8 p1
|
||||
|
||||
copyq d1, p1
|
||||
|
||||
.function orc_prepare_volumes
|
||||
.dest 8 d1 gdouble
|
||||
.source 4 s1 gboolean
|
||||
.temp 8 t1
|
||||
|
||||
convld t1, s1
|
||||
subd t1, 0x3FF0000000000000L, t1
|
||||
muld d1, d1, t1
|
||||
|
||||
|
|
Loading…
Reference in a new issue