kopia lustrzana https://github.com/f4exb/sdrangel
APT demod: allocate image row on heap to save one copy
rodzic
8b5ebbd1b5
commit
054e6feaa5
|
@ -81,14 +81,14 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
float m_pixels[APT_PROW_WIDTH];
|
||||
const float *m_pixels;
|
||||
int m_zenith;
|
||||
|
||||
MsgPixels(const float *pixels, int zenith) :
|
||||
Message(),
|
||||
m_pixels(pixels),
|
||||
m_zenith(zenith)
|
||||
{
|
||||
memcpy(m_pixels, pixels, sizeof(m_pixels));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -105,6 +105,7 @@ bool APTDemodImageWorker::handleMessage(const Message& cmd)
|
|||
const APTDemod::MsgPixels& pixelsMsg = (APTDemod::MsgPixels&) cmd;
|
||||
const float *pixels = pixelsMsg.getPixels();
|
||||
processPixels(pixels);
|
||||
delete[] pixels;
|
||||
return true;
|
||||
}
|
||||
else if (APTDemod::MsgResetDecoder::match(cmd))
|
||||
|
|
|
@ -122,7 +122,7 @@ void APTDemodSink::feed(const SampleVector::const_iterator& begin, const SampleV
|
|||
// 2 lines per second
|
||||
if (m_sampleCount >= APTDEMOD_AUDIO_SAMPLE_RATE)
|
||||
{
|
||||
float pixels[APT_PROW_WIDTH];
|
||||
float *pixels = new float[APT_PROW_WIDTH];
|
||||
apt_getpixelrow(pixels, m_row, &m_zenith, m_row == 0, getsamples, this);
|
||||
|
||||
if (getImageWorkerMessageQueue()) {
|
||||
|
|
Ładowanie…
Reference in New Issue