Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 683a7ff9 authored by Chia-chi Yeh's avatar Chia-chi Yeh Committed by Android (Google) Code Review
Browse files

Merge "Visualizer: Fix the conversion from 8-bit sample to 16-bit sample." into gingerbread

parents ee93169e 67f41771
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -209,8 +209,8 @@ status_t Visualizer::doFft(uint8_t *fft, uint8_t *waveform)
    int32_t nonzero = 0;

    for (uint32_t i = 0; i < mCaptureSize; i += 2) {
        workspace[i >> 1] = (waveform[i] ^ 0x80) << 23;
        workspace[i >> 1] |= (waveform[i + 1] ^ 0x80) << 7;
        workspace[i >> 1] =
                ((waveform[i] ^ 0x80) << 24) | ((waveform[i + 1] ^ 0x80) << 8);
        nonzero |= workspace[i >> 1];
    }

@@ -219,8 +219,8 @@ status_t Visualizer::doFft(uint8_t *fft, uint8_t *waveform)
    }

    for (uint32_t i = 0; i < mCaptureSize; i += 2) {
        fft[i] = workspace[i >> 1] >> 23;
        fft[i + 1] = workspace[i >> 1] >> 7;
        fft[i] = workspace[i >> 1] >> 24;
        fft[i + 1] = workspace[i >> 1] >> 8;
    }

    return NO_ERROR;