Documentation
¶
Overview ¶
Package fdsp ports the int32 primitives of libavutil/fixed_dsp.c that the fixed-point AAC decoder uses (avpriv_alloc_fixed_dsp @ d09d5afc3a). D1 needs vector_fmul_window; D2 adds the rest.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ButterfliesFixed ¶
ButterfliesFixed mirrors butterflies_fixed_c (libavutil/fixed_dsp.c:139-149 @ d09d5afc3a): v1[i], v2[i] = v1[i]+v2[i], v1[i]-v2[i]. The C casts v1 through unsigned to make the add/sub wraparound defined; Go int32 arithmetic wraps identically, so no cast is needed. Applied to the dequantized spectra for mid/side stereo.
func ScalarproductFixed ¶
ScalarproductFixed mirrors scalarproduct_fixed_c (libavutil/fixed_dsp.c: 126-137 @ d09d5afc3a): a 64-bit accumulator seeded with 0x40000000 so the final arithmetic >>31 rounds to nearest. The decoder uses it on the PNS noise fill to measure a band's energy.
func VectorFmulWindow ¶
VectorFmulWindow mirrors vector_fmul_window_c (libavutil/fixed_dsp.c:95-113 @ d09d5afc3a). It overlap-adds two half-frames under a 2*n window:
dst[i] = (src0[i]*win[2n-1-i] - src1[n-1-i]*win[i] + 0x40000000) >> 31 dst[2n-1-i] = (src0[i]*win[i] + src1[n-1-i]*win[2n-1-i] + 0x40000000) >> 31
In every decoder call dst is a different buffer from src0 and src1 (Output, Saved or temp vs the MDCT scratch), so there is no dst/src aliasing here. The reslicing below is only to hoist the loop's bounds checks (the encoder-phase BCE discipline).
Types ¶
This section is empty.