@ -33,8 +33,8 @@
# include "libavutil/common.h"
# include "avfft.h"
# include "imdct15.h"
# include "opus.h"
# include "opus_imdct.h"
// minimal iMDCT size to make SIMD opts easier
# define CELT_MIN_IMDCT_SIZE 120
@ -66,9 +66,9 @@ do { \
( d ) . im = - ri + ir ; \
} while ( 0 )
av_cold void ff_celt_ imdct_uninit ( Celt IMDCTContext * * ps )
av_cold void ff_imdct15 _uninit ( IMDCT15 Context * * ps )
{
Celt IMDCTContext * s = * ps ;
IMDCT15 Context * s = * ps ;
int i ;
if ( ! s )
@ -84,12 +84,12 @@ av_cold void ff_celt_imdct_uninit(CeltIMDCTContext **ps)
av_freep ( ps ) ;
}
static void celt_ imdct_half( Celt IMDCTContext * s , float * dst , const float * src ,
ptrdiff_t stride , float scale ) ;
static void imdct15 _half ( IMDCT15 Context * s , float * dst , const float * src ,
ptrdiff_t stride , float scale ) ;
av_cold int ff_celt_ imdct_init ( Celt IMDCTContext * * ps , int N )
av_cold int ff_imdct15 _init ( IMDCT15 Context * * ps , int N )
{
Celt IMDCTContext * s ;
IMDCT15 Context * s ;
int len2 = 15 * ( 1 < < N ) ;
int len = 2 * len2 ;
int i , j ;
@ -134,16 +134,17 @@ av_cold int ff_celt_imdct_init(CeltIMDCTContext **ps, int N)
for ( j = 15 ; j < 19 ; j + + )
s - > exptab [ 0 ] [ j ] = s - > exptab [ 0 ] [ j - 15 ] ;
s - > imdct_half = celt_ imdct_half;
s - > imdct_half = imdct15 _half ;
if ( ARCH_AARCH64 )
ff_celt_ imdct_init_aarch64 ( s ) ;
ff_imdct15 _init_aarch64 ( s ) ;
* ps = s ;
return 0 ;
fail :
ff_celt_ imdct_uninit ( & s ) ;
ff_imdct15 _uninit ( & s ) ;
return AVERROR ( ENOMEM ) ;
}
@ -180,7 +181,8 @@ static void fft5(FFTComplex *out, const FFTComplex *in, ptrdiff_t stride)
out [ 4 ] . im = in [ 0 ] . im + z [ 0 ] [ 3 ] . im + z [ 1 ] [ 2 ] . im + z [ 2 ] [ 1 ] . im + z [ 3 ] [ 0 ] . im ;
}
static void fft15 ( CeltIMDCTContext * s , FFTComplex * out , const FFTComplex * in , ptrdiff_t stride )
static void fft15 ( IMDCT15Context * s , FFTComplex * out , const FFTComplex * in ,
ptrdiff_t stride )
{
const FFTComplex * exptab = s - > exptab [ 0 ] ;
FFTComplex tmp [ 5 ] ;
@ -215,7 +217,7 @@ static void fft15(CeltIMDCTContext *s, FFTComplex *out, const FFTComplex *in, pt
/*
* FFT of the length 15 * ( 2 ^ N )
*/
static void fft_calc ( Celt IMDCTContext * s , FFTComplex * out , const FFTComplex * in ,
static void fft_calc ( IMDCT15 Context * s , FFTComplex * out , const FFTComplex * in ,
int N , ptrdiff_t stride )
{
if ( N ) {
@ -241,8 +243,8 @@ static void fft_calc(CeltIMDCTContext *s, FFTComplex *out, const FFTComplex *in,
fft15 ( s , out , in , stride ) ;
}
static void celt_ imdct_half( Celt IMDCTContext * s , float * dst , const float * src ,
ptrdiff_t stride , float scale )
static void imdct15 _half ( IMDCT15 Context * s , float * dst , const float * src ,
ptrdiff_t stride , float scale )
{
FFTComplex * z = ( FFTComplex * ) dst ;
const int len8 = s - > len4 / 2 ;