mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 21:48:55 +00:00
Fix type punning.
Original commit message from CVS: Fix type punning.
This commit is contained in:
parent
90da904f1e
commit
7ec579da84
2 changed files with 8 additions and 8 deletions
|
@ -14,7 +14,7 @@
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
for(j = 0; j < num_samples; j++) {
|
for(j = 0; j < num_samples; j++) {
|
||||||
(*out_data)[j] = in_data[j];
|
out_data[j] = in_data[j];
|
||||||
squaresum += in_data[j] * in_data[j];
|
squaresum += in_data[j] * in_data[j];
|
||||||
}
|
}
|
||||||
RMS = sqrt (squaresum / (float) num_samples);
|
RMS = sqrt (squaresum / (float) num_samples);
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for(j = 0; j < num_samples; j++) {
|
for(j = 0; j < num_samples; j++) {
|
||||||
(*out_data)[j] = in_data[j];
|
out_data[j] = in_data[j];
|
||||||
squaresum += pow ((double) in_data[j] / 32767.0, 2);
|
squaresum += pow ((double) in_data[j] / 32767.0, 2);
|
||||||
}
|
}
|
||||||
RMS = sqrt (squaresum / (float) num_samples);
|
RMS = sqrt (squaresum / (float) num_samples);
|
||||||
|
|
|
@ -95,9 +95,9 @@ static void gst_level_set_property (GObject *object, guint prop_id, const GVa
|
||||||
static void gst_level_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
|
static void gst_level_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
|
||||||
|
|
||||||
static void gst_level_chain (GstPad *pad, GstBuffer *buf);
|
static void gst_level_chain (GstPad *pad, GstBuffer *buf);
|
||||||
static void inline gst_level_fast_16bit_chain (gint16* data, gint16** out_data,
|
static void inline gst_level_fast_16bit_chain (gint16* data, gint16* out_data,
|
||||||
guint numsamples);
|
guint numsamples);
|
||||||
static void inline gst_level_fast_8bit_chain (gint8* data, gint8** out_data,
|
static void inline gst_level_fast_8bit_chain (gint8* data, gint8* out_data,
|
||||||
guint numsamples);
|
guint numsamples);
|
||||||
|
|
||||||
static GstElementClass *parent_class = NULL;
|
static GstElementClass *parent_class = NULL;
|
||||||
|
@ -182,12 +182,12 @@ gst_level_chain (GstPad *pad, GstBuffer *buf)
|
||||||
g_print ("%s: ", gst_element_get_name (GST_ELEMENT (filter)));
|
g_print ("%s: ", gst_element_get_name (GST_ELEMENT (filter)));
|
||||||
switch (width) {
|
switch (width) {
|
||||||
case 16:
|
case 16:
|
||||||
gst_level_fast_16bit_chain (in_data, &out_data,
|
gst_level_fast_16bit_chain (in_data, out_data,
|
||||||
GST_BUFFER_SIZE (buf) / 2);
|
GST_BUFFER_SIZE (buf) / 2);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
gst_level_fast_8bit_chain ((gint8 *) in_data,
|
gst_level_fast_8bit_chain ((gint8 *) in_data,
|
||||||
(gint8 **) &out_data, GST_BUFFER_SIZE(buf));
|
(gint8 *) out_data, GST_BUFFER_SIZE(buf));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
|
@ -195,12 +195,12 @@ gst_level_chain (GstPad *pad, GstBuffer *buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void inline
|
static void inline
|
||||||
gst_level_fast_16bit_chain (gint16* in_data, gint16** out_data,
|
gst_level_fast_16bit_chain (gint16* in_data, gint16* out_data,
|
||||||
guint num_samples)
|
guint num_samples)
|
||||||
#include "filter.func"
|
#include "filter.func"
|
||||||
|
|
||||||
static void inline
|
static void inline
|
||||||
gst_level_fast_8bit_chain (gint8* in_data, gint8** out_data,
|
gst_level_fast_8bit_chain (gint8* in_data, gint8* out_data,
|
||||||
guint num_samples)
|
guint num_samples)
|
||||||
#include "filter.func"
|
#include "filter.func"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue