pcm/Normalizer: use std::size_t
This commit is contained in:
parent
e6fedcbd10
commit
1298a82f4f
|
@ -5,17 +5,17 @@
|
||||||
#include "Normalizer.hxx"
|
#include "Normalizer.hxx"
|
||||||
|
|
||||||
void
|
void
|
||||||
PcmNormalizer::ProcessS16(int16_t *audio, unsigned int count) noexcept
|
PcmNormalizer::ProcessS16(int16_t *audio, std::size_t count) noexcept
|
||||||
{
|
{
|
||||||
int16_t *ap;
|
int16_t *ap;
|
||||||
unsigned int i;
|
std::size_t i;
|
||||||
int curGain = gain[pos];
|
int curGain = gain[pos];
|
||||||
int newGain;
|
int newGain;
|
||||||
int peakVal = 1;
|
int peakVal = 1;
|
||||||
int peakPos = 0;
|
int peakPos = 0;
|
||||||
int slot = (pos + 1) % bufsz;
|
int slot = (pos + 1) % bufsz;
|
||||||
int *clipped_ = clipped + slot;
|
int *clipped_ = clipped + slot;
|
||||||
unsigned int ramp = count;
|
std::size_t ramp = count;
|
||||||
int delta;
|
int delta;
|
||||||
|
|
||||||
ap = audio;
|
ap = audio;
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
class PcmNormalizer {
|
class PcmNormalizer {
|
||||||
|
@ -25,11 +26,11 @@ class PcmNormalizer {
|
||||||
//! History of clip amounts
|
//! History of clip amounts
|
||||||
int *const clipped;
|
int *const clipped;
|
||||||
|
|
||||||
unsigned int pos = 0;
|
std::size_t pos = 0;
|
||||||
const unsigned int bufsz;
|
const std::size_t bufsz;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PcmNormalizer(unsigned history=400) noexcept
|
PcmNormalizer(std::size_t history=400) noexcept
|
||||||
:peaks(new int[history]{}),
|
:peaks(new int[history]{}),
|
||||||
gain(new int[history]{}),
|
gain(new int[history]{}),
|
||||||
clipped(new int[history]{}),
|
clipped(new int[history]{}),
|
||||||
|
@ -44,7 +45,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Process 16-bit signed data
|
//! Process 16-bit signed data
|
||||||
void ProcessS16(int16_t *data, unsigned int count) noexcept;
|
void ProcessS16(int16_t *data, std::size_t count) noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! TODO: Compressor_Process_int32, Compressor_Process_float, others as needed
|
//! TODO: Compressor_Process_int32, Compressor_Process_float, others as needed
|
||||||
|
|
Loading…
Reference in New Issue