Browse Source

DATV: Replace DVB-S2 SOF VLA buffer with std::vector

Replace the variable-length array used for SOF symbol buffering in the
DVB-S2 frame receiver with a std::vector allocation.

Use vector::data() when passing the buffer to the existing pointer-based
conjugate product function. This removes another non-standard VLA usage and
improves C++ portability without changing behavior.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.0.0
Robin Getz 4 months ago
parent
commit
1e72e94bb5
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 4
      plugins/channelrx/demoddatv/leansdr/dvbs2.h

4
plugins/channelrx/demoddatv/leansdr/dvbs2.h

@ -1450,7 +1450,7 @@ struct s2_frame_receiver : runnable @@ -1450,7 +1450,7 @@ struct s2_frame_receiver : runnable
{
sampler_state ss = *pss;
float power = 0;
std::complex<T> symbs[sof.LENGTH];
std::vector<std::complex<T>> symbs(sof.LENGTH);
for (int i=0; i<sof.LENGTH; ++i)
{
@ -1458,7 +1458,7 @@ struct s2_frame_receiver : runnable @@ -1458,7 +1458,7 @@ struct s2_frame_receiver : runnable
power += cnorm2(symbs[i]);
}
std::complex<float> c = conjprod(sof.symbols, symbs, sof.LENGTH);
std::complex<float> c = conjprod(sof.symbols, symbs.data(), sof.LENGTH);
c *= 1.0f / sof.LENGTH;
align_phase(pss, c);
float signal_amp = sqrtf(power/sof.LENGTH);

Loading…
Cancel
Save