various cosmetic fixes
Original commit message from CVS: various cosmetic fixes
This commit is contained in:
parent
c2fc8faa3d
commit
8f0c1ebdb2
@ -324,27 +324,28 @@ gst_level_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out)
|
|||||||
#define DEFINE_LEVEL_CALCULATOR(TYPE, RESOLUTION) \
|
#define DEFINE_LEVEL_CALCULATOR(TYPE, RESOLUTION) \
|
||||||
static void inline \
|
static void inline \
|
||||||
gst_level_calculate_##TYPE (TYPE * in, guint num, gint channels, \
|
gst_level_calculate_##TYPE (TYPE * in, guint num, gint channels, \
|
||||||
double *CS, double *peak) \
|
double *NCS, double *NPS) \
|
||||||
{ \
|
{ \
|
||||||
register int j; \
|
register int j; \
|
||||||
double squaresum = 0.0; /* square sum of the integer samples */ \
|
double squaresum = 0.0; /* square sum of the integer samples */ \
|
||||||
register double square = 0.0; /* Square */ \
|
register double square = 0.0; /* Square */ \
|
||||||
register double PSS = 0.0; /* Peak Square Sample */ \
|
register double peaksquare = 0.0; /* Peak Square Sample */ \
|
||||||
gdouble normalizer; /* divisor to get a [-1.0, 1.0] range */ \
|
gdouble normalizer; /* divisor to get a [-1.0, 1.0] range */ \
|
||||||
\
|
\
|
||||||
*CS = 0.0; /* Cumulative Square for this block */ \
|
*NCS = 0.0; /* Normalized Cumulative Square */ \
|
||||||
|
*NPS = 0.0; /* Normalized Peask Square */ \
|
||||||
\
|
\
|
||||||
normalizer = (double) (1 << RESOLUTION); \
|
normalizer = (double) (1 << (RESOLUTION * 2)); \
|
||||||
\
|
\
|
||||||
for (j = 0; j < num; j += channels) \
|
for (j = 0; j < num; j += channels) \
|
||||||
{ \
|
{ \
|
||||||
square = ((double) in[j]) * in[j]; \
|
square = ((double) in[j]) * in[j]; \
|
||||||
if (square > PSS) PSS = square; \
|
if (square > peaksquare) peaksquare = square; \
|
||||||
squaresum += square; \
|
squaresum += square; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
*CS = squaresum / (normalizer * normalizer); \
|
*NCS = squaresum / normalizer; \
|
||||||
*peak = PSS / (normalizer * normalizer); \
|
*NPS = peaksquare / normalizer; \
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_LEVEL_CALCULATOR (gint16, 15);
|
DEFINE_LEVEL_CALCULATOR (gint16, 15);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user