From 98cfef330685207063517172888c5d37d6b4b03f Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Tue, 17 Sep 2024 22:13:11 +0200 Subject: [PATCH] gstfastspectrum: Change guint to guint64 --- 3rdparty/gstfastspectrum/gstfastspectrum.cpp | 28 ++++++++++---------- 3rdparty/gstfastspectrum/gstfastspectrum.h | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/3rdparty/gstfastspectrum/gstfastspectrum.cpp b/3rdparty/gstfastspectrum/gstfastspectrum.cpp index eb726aab8..bb51eb086 100644 --- a/3rdparty/gstfastspectrum/gstfastspectrum.cpp +++ b/3rdparty/gstfastspectrum/gstfastspectrum.cpp @@ -263,49 +263,49 @@ static gboolean gst_strawberry_fastspectrum_stop(GstBaseTransform *transform) { // Mixing data readers -static void gst_strawberry_fastspectrum_input_data_mixed_float(const guint8 *_in, double *out, const guint len, const double max_value, guint op, const guint nfft) { +static void gst_strawberry_fastspectrum_input_data_mixed_float(const guint8 *_in, double *out, const guint64 len, const double max_value, guint op, const guint nfft) { (void) max_value; const gfloat *in = reinterpret_cast(_in); guint ip = 0; - for (guint j = 0; j < len; j++) { + for (guint64 j = 0; j < len; j++) { out[op] = in[ip++]; op = (op + 1) % nfft; } } -static void gst_strawberry_fastspectrum_input_data_mixed_double(const guint8 *_in, double *out, const guint len, const double max_value, guint op, const guint nfft) { +static void gst_strawberry_fastspectrum_input_data_mixed_double(const guint8 *_in, double *out, const guint64 len, const double max_value, guint op, const guint nfft) { (void) max_value; const gdouble *in = reinterpret_cast(_in); guint ip = 0; - for (guint j = 0; j < len; j++) { + for (guint64 j = 0; j < len; j++) { out[op] = in[ip++]; op = (op + 1) % nfft; } } -static void gst_strawberry_fastspectrum_input_data_mixed_int32_max(const guint8 *_in, double *out, const guint len, const double max_value, guint op, const guint nfft) { +static void gst_strawberry_fastspectrum_input_data_mixed_int32_max(const guint8 *_in, double *out, const guint64 len, const double max_value, guint op, const guint nfft) { const gint32 *in = reinterpret_cast(_in); guint ip = 0; - for (guint j = 0; j < len; j++) { + for (guint64 j = 0; j < len; j++) { out[op] = in[ip++] / max_value; op = (op + 1) % nfft; } } -static void gst_strawberry_fastspectrum_input_data_mixed_int24_max(const guint8 *_in, double *out, const guint len, const double max_value, guint op, const guint nfft) { +static void gst_strawberry_fastspectrum_input_data_mixed_int24_max(const guint8 *_in, double *out, const guint64 len, const double max_value, guint op, const guint nfft) { - for (guint j = 0; j < len; j++) { + for (guint64 j = 0; j < len; j++) { #if G_BYTE_ORDER == G_BIG_ENDIAN guint32 value = GST_READ_UINT24_BE(_in); #else @@ -322,12 +322,12 @@ static void gst_strawberry_fastspectrum_input_data_mixed_int24_max(const guint8 } -static void gst_strawberry_fastspectrum_input_data_mixed_int16_max(const guint8 *_in, double *out, const guint len, const double max_value, guint op, const guint nfft) { +static void gst_strawberry_fastspectrum_input_data_mixed_int16_max(const guint8 *_in, double *out, const guint64 len, const double max_value, guint op, const guint nfft) { const gint16 *in = reinterpret_cast(_in); guint ip = 0; - for (guint j = 0; j < len; j++) { + for (guint64 j = 0; j < len; j++) { out[op] = in[ip++] / max_value; op = (op + 1) % nfft; } @@ -397,7 +397,7 @@ static GstFlowReturn gst_strawberry_fastspectrum_transform_ip(GstBaseTransform * const guint rate = GST_AUDIO_FILTER_RATE(fastspectrum); const guint bps = GST_AUDIO_FILTER_BPS(fastspectrum); - const guint bpf = GST_AUDIO_FILTER_BPF(fastspectrum); + const guint64 bpf = GST_AUDIO_FILTER_BPF(fastspectrum); const double max_value = static_cast((1UL << ((bps << 3) - 1)) - 1); const guint bands = fastspectrum->bands; const guint nfft = 2 * bands - 2; @@ -447,10 +447,10 @@ static GstFlowReturn gst_strawberry_fastspectrum_transform_ip(GstBaseTransform * while (size >= bpf) { // Run input_data for a chunk of data - guint fft_todo = nfft - (fastspectrum->num_frames % nfft); - guint msg_todo = fastspectrum->frames_todo - fastspectrum->num_frames; + guint64 fft_todo = nfft - (fastspectrum->num_frames % nfft); + guint64 msg_todo = fastspectrum->frames_todo - fastspectrum->num_frames; GST_LOG_OBJECT(fastspectrum, "message frames todo: %u, fft frames todo: %u, input frames %" G_GSIZE_FORMAT, msg_todo, fft_todo, (size / bpf)); - guint block_size = msg_todo; + guint64 block_size = msg_todo; if (block_size > (size / bpf)) { block_size = (size / bpf); } diff --git a/3rdparty/gstfastspectrum/gstfastspectrum.h b/3rdparty/gstfastspectrum/gstfastspectrum.h index 4c6f5dc71..056c9748e 100644 --- a/3rdparty/gstfastspectrum/gstfastspectrum.h +++ b/3rdparty/gstfastspectrum/gstfastspectrum.h @@ -43,7 +43,7 @@ G_BEGIN_DECLS #define GST_STRAWBERRY_FASTSPECTRUM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_FASTSPECTRUM, GstStrawberryFastSpectrumClass)) #define GST_IS_STRAWBERRY_FASTSPECTRUM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_FASTSPECTRUM)) -typedef void (*GstStrawberryFastSpectrumInputData)(const guint8 *in, double *out, guint len, double max_value, guint op, guint nfft); +typedef void (*GstStrawberryFastSpectrumInputData)(const guint8 *in, double *out, guint64 len, double max_value, guint op, guint nfft); using GstStrawberryFastSpectrumOutputCallback = std::function;