mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-01 02:56:34 -04:00
Pass buffers by reference to save significant text section code size.
752 bytes!
This commit is contained in:
parent
b03da8d693
commit
b0855b3c4d
2 changed files with 38 additions and 38 deletions
|
@ -199,8 +199,8 @@ void FIRC8xR16x24FS4Decim4::configure(
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer_c16_t FIRC8xR16x24FS4Decim4::execute(
|
buffer_c16_t FIRC8xR16x24FS4Decim4::execute(
|
||||||
buffer_c8_t src,
|
const buffer_c8_t& src,
|
||||||
buffer_c16_t dst
|
const buffer_c16_t& dst
|
||||||
) {
|
) {
|
||||||
vec2_s16* const z = static_cast<vec2_s16*>(__builtin_assume_aligned(z_.data(), 4));
|
vec2_s16* const z = static_cast<vec2_s16*>(__builtin_assume_aligned(z_.data(), 4));
|
||||||
const vec2_s16* const t = static_cast<vec2_s16*>(__builtin_assume_aligned(taps_.data(), 4));
|
const vec2_s16* const t = static_cast<vec2_s16*>(__builtin_assume_aligned(taps_.data(), 4));
|
||||||
|
@ -264,8 +264,8 @@ void FIRC8xR16x24FS4Decim8::configure(
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer_c16_t FIRC8xR16x24FS4Decim8::execute(
|
buffer_c16_t FIRC8xR16x24FS4Decim8::execute(
|
||||||
buffer_c8_t src,
|
const buffer_c8_t& src,
|
||||||
buffer_c16_t dst
|
const buffer_c16_t& dst
|
||||||
) {
|
) {
|
||||||
vec2_s16* const z = static_cast<vec2_s16*>(__builtin_assume_aligned(z_.data(), 4));
|
vec2_s16* const z = static_cast<vec2_s16*>(__builtin_assume_aligned(z_.data(), 4));
|
||||||
const vec2_s16* const t = static_cast<vec2_s16*>(__builtin_assume_aligned(taps_.data(), 4));
|
const vec2_s16* const t = static_cast<vec2_s16*>(__builtin_assume_aligned(taps_.data(), 4));
|
||||||
|
@ -322,8 +322,8 @@ void FIRC16xR16x16Decim2::configure(
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer_c16_t FIRC16xR16x16Decim2::execute(
|
buffer_c16_t FIRC16xR16x16Decim2::execute(
|
||||||
buffer_c16_t src,
|
const buffer_c16_t& src,
|
||||||
buffer_c16_t dst
|
const buffer_c16_t& dst
|
||||||
) {
|
) {
|
||||||
vec2_s16* const z = static_cast<vec2_s16*>(__builtin_assume_aligned(z_.data(), 4));
|
vec2_s16* const z = static_cast<vec2_s16*>(__builtin_assume_aligned(z_.data(), 4));
|
||||||
const vec2_s16* const t = static_cast<vec2_s16*>(__builtin_assume_aligned(taps_.data(), 4));
|
const vec2_s16* const t = static_cast<vec2_s16*>(__builtin_assume_aligned(taps_.data(), 4));
|
||||||
|
@ -376,8 +376,8 @@ void FIRC16xR16x32Decim8::configure(
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer_c16_t FIRC16xR16x32Decim8::execute(
|
buffer_c16_t FIRC16xR16x32Decim8::execute(
|
||||||
buffer_c16_t src,
|
const buffer_c16_t& src,
|
||||||
buffer_c16_t dst
|
const buffer_c16_t& dst
|
||||||
) {
|
) {
|
||||||
vec2_s16* const z = static_cast<vec2_s16*>(__builtin_assume_aligned(z_.data(), 4));
|
vec2_s16* const z = static_cast<vec2_s16*>(__builtin_assume_aligned(z_.data(), 4));
|
||||||
const vec2_s16* const t = static_cast<vec2_s16*>(__builtin_assume_aligned(taps_.data(), 4));
|
const vec2_s16* const t = static_cast<vec2_s16*>(__builtin_assume_aligned(taps_.data(), 4));
|
||||||
|
@ -423,7 +423,7 @@ buffer_c16_t FIRC16xR16x32Decim8::execute(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer_c16_t Complex8DecimateBy2CIC3::execute(buffer_c8_t src, buffer_c16_t dst) {
|
buffer_c16_t Complex8DecimateBy2CIC3::execute(const buffer_c8_t& src, const buffer_c16_t& dst) {
|
||||||
/* Decimates by two using a non-recursive third-order CIC filter.
|
/* Decimates by two using a non-recursive third-order CIC filter.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -480,7 +480,7 @@ buffer_c16_t Complex8DecimateBy2CIC3::execute(buffer_c8_t src, buffer_c16_t dst)
|
||||||
return { dst.p, src.count / 2, src.sampling_rate / 2 };
|
return { dst.p, src.count / 2, src.sampling_rate / 2 };
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer_c16_t TranslateByFSOver4AndDecimateBy2CIC3::execute(buffer_c8_t src, buffer_c16_t dst) {
|
buffer_c16_t TranslateByFSOver4AndDecimateBy2CIC3::execute(const buffer_c8_t& src, const buffer_c16_t& dst) {
|
||||||
/* Translates incoming complex<int8_t> samples by -fs/4,
|
/* Translates incoming complex<int8_t> samples by -fs/4,
|
||||||
* decimates by two using a non-recursive third-order CIC filter.
|
* decimates by two using a non-recursive third-order CIC filter.
|
||||||
*/
|
*/
|
||||||
|
@ -565,8 +565,8 @@ buffer_c16_t TranslateByFSOver4AndDecimateBy2CIC3::execute(buffer_c8_t src, buff
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer_c16_t DecimateBy2CIC3::execute(
|
buffer_c16_t DecimateBy2CIC3::execute(
|
||||||
buffer_c16_t src,
|
const buffer_c16_t& src,
|
||||||
buffer_c16_t dst
|
const buffer_c16_t& dst
|
||||||
) {
|
) {
|
||||||
/* Complex non-recursive 3rd-order CIC filter (taps 1,3,3,1).
|
/* Complex non-recursive 3rd-order CIC filter (taps 1,3,3,1).
|
||||||
* Gain of 8.
|
* Gain of 8.
|
||||||
|
@ -625,8 +625,8 @@ void FIR64AndDecimateBy2Real::configure(
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer_s16_t FIR64AndDecimateBy2Real::execute(
|
buffer_s16_t FIR64AndDecimateBy2Real::execute(
|
||||||
buffer_s16_t src,
|
const buffer_s16_t& src,
|
||||||
buffer_s16_t dst
|
const buffer_s16_t& dst
|
||||||
) {
|
) {
|
||||||
/* int16_t input (sample count "n" must be multiple of 4)
|
/* int16_t input (sample count "n" must be multiple of 4)
|
||||||
* -> int16_t output, decimated by 2.
|
* -> int16_t output, decimated by 2.
|
||||||
|
@ -658,8 +658,8 @@ buffer_s16_t FIR64AndDecimateBy2Real::execute(
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer_c16_t FIRAndDecimateComplex::execute(
|
buffer_c16_t FIRAndDecimateComplex::execute(
|
||||||
buffer_c16_t src,
|
const buffer_c16_t& src,
|
||||||
buffer_c16_t dst
|
const buffer_c16_t& dst
|
||||||
) {
|
) {
|
||||||
/* int16_t input (sample count "n" must be multiple of decimation_factor)
|
/* int16_t input (sample count "n" must be multiple of decimation_factor)
|
||||||
* -> int16_t output, decimated by decimation_factor.
|
* -> int16_t output, decimated by decimation_factor.
|
||||||
|
@ -768,8 +768,8 @@ buffer_c16_t FIRAndDecimateComplex::execute(
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer_s16_t DecimateBy2CIC4Real::execute(
|
buffer_s16_t DecimateBy2CIC4Real::execute(
|
||||||
buffer_s16_t src,
|
const buffer_s16_t& src,
|
||||||
buffer_s16_t dst
|
const buffer_s16_t& dst
|
||||||
) {
|
) {
|
||||||
auto src_p = src.p;
|
auto src_p = src.p;
|
||||||
auto dst_p = dst.p;
|
auto dst_p = dst.p;
|
||||||
|
|
|
@ -39,8 +39,8 @@ namespace decimate {
|
||||||
class Complex8DecimateBy2CIC3 {
|
class Complex8DecimateBy2CIC3 {
|
||||||
public:
|
public:
|
||||||
buffer_c16_t execute(
|
buffer_c16_t execute(
|
||||||
buffer_c8_t src,
|
const buffer_c8_t& src,
|
||||||
buffer_c16_t dst
|
const buffer_c16_t& dst
|
||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -51,8 +51,8 @@ private:
|
||||||
class TranslateByFSOver4AndDecimateBy2CIC3 {
|
class TranslateByFSOver4AndDecimateBy2CIC3 {
|
||||||
public:
|
public:
|
||||||
buffer_c16_t execute(
|
buffer_c16_t execute(
|
||||||
buffer_c8_t src,
|
const buffer_c8_t& src,
|
||||||
buffer_c16_t dst
|
const buffer_c16_t& dst
|
||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -63,8 +63,8 @@ private:
|
||||||
class DecimateBy2CIC3 {
|
class DecimateBy2CIC3 {
|
||||||
public:
|
public:
|
||||||
buffer_c16_t execute(
|
buffer_c16_t execute(
|
||||||
buffer_c16_t src,
|
const buffer_c16_t& src,
|
||||||
buffer_c16_t dst
|
const buffer_c16_t& dst
|
||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -81,8 +81,8 @@ public:
|
||||||
);
|
);
|
||||||
|
|
||||||
buffer_s16_t execute(
|
buffer_s16_t execute(
|
||||||
buffer_s16_t src,
|
const buffer_s16_t& src,
|
||||||
buffer_s16_t dst
|
const buffer_s16_t& dst
|
||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -112,8 +112,8 @@ public:
|
||||||
);
|
);
|
||||||
|
|
||||||
buffer_c16_t execute(
|
buffer_c16_t execute(
|
||||||
buffer_c8_t src,
|
const buffer_c8_t& src,
|
||||||
buffer_c16_t dst
|
const buffer_c16_t& dst
|
||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -144,8 +144,8 @@ public:
|
||||||
);
|
);
|
||||||
|
|
||||||
buffer_c16_t execute(
|
buffer_c16_t execute(
|
||||||
buffer_c8_t src,
|
const buffer_c8_t& src,
|
||||||
buffer_c16_t dst
|
const buffer_c16_t& dst
|
||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -170,8 +170,8 @@ public:
|
||||||
);
|
);
|
||||||
|
|
||||||
buffer_c16_t execute(
|
buffer_c16_t execute(
|
||||||
buffer_c16_t src,
|
const buffer_c16_t& src,
|
||||||
buffer_c16_t dst
|
const buffer_c16_t& dst
|
||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -196,8 +196,8 @@ public:
|
||||||
);
|
);
|
||||||
|
|
||||||
buffer_c16_t execute(
|
buffer_c16_t execute(
|
||||||
buffer_c16_t src,
|
const buffer_c16_t& src,
|
||||||
buffer_c16_t dst
|
const buffer_c16_t& dst
|
||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -235,8 +235,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer_c16_t execute(
|
buffer_c16_t execute(
|
||||||
buffer_c16_t src,
|
const buffer_c16_t& src,
|
||||||
buffer_c16_t dst
|
const buffer_c16_t& dst
|
||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -251,8 +251,8 @@ private:
|
||||||
class DecimateBy2CIC4Real {
|
class DecimateBy2CIC4Real {
|
||||||
public:
|
public:
|
||||||
buffer_s16_t execute(
|
buffer_s16_t execute(
|
||||||
buffer_s16_t src,
|
const buffer_s16_t& src,
|
||||||
buffer_s16_t dst
|
const buffer_s16_t& dst
|
||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue