mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-30 22:27:51 +02:00
compression
This commit is contained in:
@ -12,11 +12,16 @@ namespace dsp {
|
||||
public:
|
||||
DynamicRangeCompressor() {}
|
||||
|
||||
DynamicRangeCompressor(stream<complex_t>* in, PCMType pcmType) { init(in, pcmType); }
|
||||
DynamicRangeCompressor(stream<complex_t>* in, PCMType pcmType) {
|
||||
init(in, pcmType);
|
||||
}
|
||||
|
||||
void init(stream<complex_t>* in, PCMType pcmType) {
|
||||
_in = in;
|
||||
_pcmType = pcmType;
|
||||
|
||||
out.setBufferSize((sizeof(dsp::complex_t) * STREAM_BUFFER_SIZE) + 8);
|
||||
|
||||
generic_block<DynamicRangeCompressor>::registerInput(_in);
|
||||
generic_block<DynamicRangeCompressor>::registerOutput(&out);
|
||||
generic_block<DynamicRangeCompressor>::_block_init = true;
|
||||
|
@ -31,6 +31,13 @@ namespace dsp {
|
||||
volk_free(readBuf);
|
||||
}
|
||||
|
||||
void setBufferSize(int samples) {
|
||||
volk_free(writeBuf);
|
||||
volk_free(readBuf);
|
||||
writeBuf = (T*)volk_malloc(samples * sizeof(T), volk_get_alignment());
|
||||
readBuf = (T*)volk_malloc(samples * sizeof(T), volk_get_alignment());
|
||||
}
|
||||
|
||||
bool swap(int size) {
|
||||
{
|
||||
// Wait to either swap or stop
|
||||
|
Reference in New Issue
Block a user