Skip to content

OutputStageStateQ15 ​

Struct

Source: ApuCore.h

Description ​

Block-local snapshot of the integer output stage.

The stage is the only reader and writer of its own state, and it runs on every sample, so the render loop copies it out of the class once per block and writes it back once. Read through this, the ten recursion words plus the coefficients, the trim and the three flags cost twenty-two member loads and stores per sample for six multiplies of arithmetic; held in a local, the compiler is free to keep the words that stay live across iterations in registers.

It holds no new state and changes no arithmetic: every field is a verbatim copy of a member below, and captureOutputStageState / restoreOutputStageState are the only two places that move between them. That mechanical copy is what makes the hoist bit-exact — a member added to the stage must be added to this struct and to both helpers, never handled inline at a call site.

Properties ​

NameTypeDescription
chainActivebooloutputFilterActive_
lpfActivebooloutputLpfActive_
legacyHpfEnabledboolhpfEnabled_
legacyRQ15int32_thpfRQ15_, the historical pole
hpf1RQ15int32_toutHpf1RQ15_
hpf2RQ15int32_toutHpf2RQ15_
lpfB0Q15int32_toutLpfB0Q15_
lpfB1Q15int32_toutLpfB1Q15_
lpfB2Q15int32_toutLpfB2Q15_
lpfA1Q15int32_toutLpfA1Q15_
lpfA2Q15int32_toutLpfA2Q15_
trimQ15int32_toutTrimQ15_
legacyPrevInQ15int32_thpfPrevInQ15
legacyPrevOutQ15int32_thpfPrevOutQ15
hpf1PrevInQ15int32_toutHpf1PrevInQ15_
hpf1PrevOutQ15int32_toutHpf1PrevOutQ15_
hpf2PrevInQ15int32_toutHpf2PrevInQ15_
hpf2PrevOutQ15int32_toutHpf2PrevOutQ15_
lpfX1Q15int32_toutLpfX1Q15_
lpfX2Q15int32_toutLpfX2Q15_
lpfY1Q15int32_toutLpfY1Q15_
lpfY2Q15int32_toutLpfY2Q15_

Released under the MIT License.