Documentation
¶
Overview ¶
Package dnnmath provides the activation, exponent and input-quantization kernels libopus' neural-network code (DRED, OSCE) relies on. Each kernel keeps a scalar path that mirrors the generic libopus build and, on arm64, a NEON path matching the SIMD reference so the DNN output is bit-exact per tier.
Index ¶
- func CeltLog(x float32) float32
- func CeltSin(x float32) float32
- func Cgemv8x4QuantizeInput(x float32) int8
- func Cgemv8x4QuantizeInputScalar(x float32) int8
- func Exp2Approx(x float32) float32
- func ExpApprox(x float32) float32
- func ExpVectorApprox(out, in []float32, n int)
- func ExpVectorScalarApprox(out, in []float32, n int)
- func SigmoidScalarApprox(x float32) float32
- func SigmoidVectorApprox(out, in []float32, n int)
- func SigmoidVectorScalarApprox(out, in []float32, n int)
- func SoftmaxApprox(out, in []float32, n int)
- func TanhApprox(x float32) float32
- func TanhScalarApprox(x float32) float32
- func TanhVectorApprox(out, in []float32, n int)
- func TanhVectorScalarApprox(out, in []float32, n int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CeltLog ¶
CeltLog mirrors libopus' floating-point celt_log() macro when FLOAT_APPROX is enabled in the reference build.
func Cgemv8x4QuantizeInput ¶
Cgemv8x4QuantizeInput mirrors libopus' cgemv8x4 input quantizer for the active DNN vector path. ARM NEON uses nearest-even conversion after a float32 multiply; the scalar fallback uses floor(0.5 + 127*x).
func Cgemv8x4QuantizeInputScalar ¶
Cgemv8x4QuantizeInputScalar mirrors libopus' generic cgemv8x4 input quantizer.
func Exp2Approx ¶
Exp2Approx mirrors libopus' DNN lpcnet_exp2() cubic approximation.
func ExpVectorApprox ¶
ExpVectorApprox mirrors libopus' active vector exponent kernel. In libopus this helper is named softmax(), and ACTIVATION_EXP uses it without the normalisation step.
func ExpVectorScalarApprox ¶
ExpVectorScalarApprox mirrors libopus' generic DNN exponent kernel.
func SigmoidScalarApprox ¶
SigmoidScalarApprox mirrors libopus' generic DNN sigmoid path.
func SigmoidVectorApprox ¶
SigmoidVectorApprox mirrors libopus' active vector sigmoid helper, including the NEON tail path used when N is not a multiple of four.
func SigmoidVectorScalarApprox ¶
SigmoidVectorScalarApprox mirrors libopus' generic DNN sigmoid helper.
func SoftmaxApprox ¶
SoftmaxApprox mirrors libopus' pinned ACTIVATION_SOFTMAX path. The 1.6.1 nnet.c build defines SOFTMAX_HACK, so softmax activations copy inputs unchanged. ACTIVATION_EXP still uses ExpVectorApprox's exponent kernel.
func TanhApprox ¶
TanhApprox mirrors libopus' DNN ACTIVATION_TANH path.
func TanhScalarApprox ¶
TanhScalarApprox mirrors libopus' generic DNN tanh path.
func TanhVectorApprox ¶
TanhVectorApprox mirrors libopus' active vector tanh helper, including the NEON tail path used when N is not a multiple of four.
func TanhVectorScalarApprox ¶
TanhVectorScalarApprox mirrors libopus' generic DNN tanh helper.
Types ¶
This section is empty.