X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fsbr.h;h=a47ad6eedb7151c2c3c8fc4b34dd7819d4dda491;hb=30f8da29bf609d741bbebd33b2a5003c426ab919;hp=cbf3e23e6b0e24564a0ac2ede84e8b80d68cbd57;hpb=2912e87a6c9264d556734e2bf94a99c64cf9b102;p=ffmpeg diff --git a/libavcodec/sbr.h b/libavcodec/sbr.h index cbf3e23e6b0..a47ad6eedb7 100644 --- a/libavcodec/sbr.h +++ b/libavcodec/sbr.h @@ -32,17 +32,18 @@ #include #include "fft.h" #include "aacps.h" +#include "sbrdsp.h" /** * Spectral Band Replication header - spectrum parameters that invoke a reset if they differ from the previous header. */ -typedef struct { +typedef struct SpectrumParameters { uint8_t bs_start_freq; uint8_t bs_stop_freq; uint8_t bs_xover_band; /** - * @defgroup bs_header_extra_1 Variables associated with bs_header_extra_1 + * @name Variables associated with bs_header_extra_1 * @{ */ uint8_t bs_freq_scale; @@ -56,9 +57,9 @@ typedef struct { /** * Spectral Band Replication per channel data */ -typedef struct { +typedef struct SBRData { /** - * @defgroup aac_bitstream Main bitstream data variables + * @name Main bitstream data variables * @{ */ unsigned bs_frame_class; @@ -74,11 +75,11 @@ typedef struct { /** @} */ /** - * @defgroup state State variables + * @name State variables * @{ */ - DECLARE_ALIGNED(16, float, synthesis_filterbank_samples)[SBR_SYNTHESIS_BUF_SIZE]; - DECLARE_ALIGNED(16, float, analysis_filterbank_samples) [1312]; + DECLARE_ALIGNED(32, float, synthesis_filterbank_samples)[SBR_SYNTHESIS_BUF_SIZE]; + DECLARE_ALIGNED(32, float, analysis_filterbank_samples) [1312]; int synthesis_filterbank_samples_offset; ///l_APrev and l_A int e_a[2]; @@ -87,8 +88,9 @@ typedef struct { ///QMF values of the original signal float W[2][32][32][2]; ///QMF output of the HF adjustor - float Y[2][38][64][2]; - float g_temp[42][48]; + int Ypos; + DECLARE_ALIGNED(16, float, Y)[2][38][64][2]; + DECLARE_ALIGNED(16, float, g_temp)[42][48]; float q_temp[42][48]; uint8_t s_indexmapped[8][48]; ///Envelope scalefactors @@ -109,14 +111,14 @@ typedef struct { /** * Spectral Band Replication */ -typedef struct { +typedef struct SpectralBandReplication { int sample_rate; int start; int reset; SpectrumParameters spectrum_params; int bs_amp_res_header; /** - * @defgroup bs_header_extra_2 variables associated with bs_header_extra_2 + * @name Variables associated with bs_header_extra_2 * @{ */ unsigned bs_limiter_bands; @@ -131,6 +133,7 @@ typedef struct { unsigned kx[2]; ///M' and M respectively, M is the number of QMF subbands that use SBR. unsigned m[2]; + unsigned kx_and_m_pushed; ///The number of frequency bands in f_master unsigned n_master; SBRData data[2]; @@ -155,15 +158,15 @@ typedef struct { uint8_t patch_num_subbands[6]; uint8_t patch_start_subband[6]; ///QMF low frequency input to the HF generator - float X_low[32][40][2]; + DECLARE_ALIGNED(16, float, X_low)[32][40][2]; ///QMF output of the HF generator - float X_high[64][40][2]; + DECLARE_ALIGNED(16, float, X_high)[64][40][2]; ///QMF values of the reconstructed signal DECLARE_ALIGNED(16, float, X)[2][2][38][64]; ///Zeroth coefficient used to filter the subband signals - float alpha0[64][2]; + DECLARE_ALIGNED(16, float, alpha0)[64][2]; ///First coefficient used to filter the subband signals - float alpha1[64][2]; + DECLARE_ALIGNED(16, float, alpha1)[64][2]; ///Dequantized envelope scalefactors, remapped float e_origmapped[7][48]; ///Dequantized noise scalefactors, remapped @@ -177,9 +180,10 @@ typedef struct { ///Sinusoidal levels float s_m[7][48]; float gain[7][48]; - DECLARE_ALIGNED(16, float, qmf_filter_scratch)[5][64]; + DECLARE_ALIGNED(32, float, qmf_filter_scratch)[5][64]; FFTContext mdct_ana; FFTContext mdct; + SBRDSPContext dsp; } SpectralBandReplication; #endif /* AVCODEC_SBR_H */