fdsp

package
v0.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: LGPL-2.1 Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func ButterfliesFixed(v1, v2 []int32, n int)

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

func ScalarproductFixed(v1, v2 []int32) int32

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

func VectorFmulWindow(dst, src0, src1, win []int32, n int)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL