1cabdff1aSopenharmony_ci/* 2cabdff1aSopenharmony_ci * This file is part of FFmpeg. 3cabdff1aSopenharmony_ci * 4cabdff1aSopenharmony_ci * FFmpeg is free software; you can redistribute it and/or 5cabdff1aSopenharmony_ci * modify it under the terms of the GNU Lesser General Public 6cabdff1aSopenharmony_ci * License as published by the Free Software Foundation; either 7cabdff1aSopenharmony_ci * version 2.1 of the License, or (at your option) any later version. 8cabdff1aSopenharmony_ci * 9cabdff1aSopenharmony_ci * FFmpeg is distributed in the hope that it will be useful, 10cabdff1aSopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of 11cabdff1aSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12cabdff1aSopenharmony_ci * Lesser General Public License for more details. 13cabdff1aSopenharmony_ci * 14cabdff1aSopenharmony_ci * You should have received a copy of the GNU Lesser General Public 15cabdff1aSopenharmony_ci * License along with FFmpeg; if not, write to the Free Software 16cabdff1aSopenharmony_ci * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17cabdff1aSopenharmony_ci */ 18cabdff1aSopenharmony_ci 19cabdff1aSopenharmony_ci#ifndef AVCODEC_MPEGAUDIODSP_H 20cabdff1aSopenharmony_ci#define AVCODEC_MPEGAUDIODSP_H 21cabdff1aSopenharmony_ci 22cabdff1aSopenharmony_ci#include <stddef.h> 23cabdff1aSopenharmony_ci#include <stdint.h> 24cabdff1aSopenharmony_ci 25cabdff1aSopenharmony_ci#include "libavutil/macros.h" 26cabdff1aSopenharmony_ci 27cabdff1aSopenharmony_citypedef struct MPADSPContext { 28cabdff1aSopenharmony_ci void (*apply_window_float)(float *synth_buf, float *window, 29cabdff1aSopenharmony_ci int *dither_state, float *samples, 30cabdff1aSopenharmony_ci ptrdiff_t incr); 31cabdff1aSopenharmony_ci void (*apply_window_fixed)(int32_t *synth_buf, int32_t *window, 32cabdff1aSopenharmony_ci int *dither_state, int16_t *samples, 33cabdff1aSopenharmony_ci ptrdiff_t incr); 34cabdff1aSopenharmony_ci void (*dct32_float)(float *dst, const float *src); 35cabdff1aSopenharmony_ci void (*dct32_fixed)(int *dst, const int *src); 36cabdff1aSopenharmony_ci 37cabdff1aSopenharmony_ci void (*imdct36_blocks_float)(float *out, float *buf, float *in, 38cabdff1aSopenharmony_ci int count, int switch_point, int block_type); 39cabdff1aSopenharmony_ci void (*imdct36_blocks_fixed)(int *out, int *buf, int *in, 40cabdff1aSopenharmony_ci int count, int switch_point, int block_type); 41cabdff1aSopenharmony_ci} MPADSPContext; 42cabdff1aSopenharmony_ci 43cabdff1aSopenharmony_civoid ff_mpadsp_init(MPADSPContext *s); 44cabdff1aSopenharmony_ci 45cabdff1aSopenharmony_ciextern int32_t ff_mpa_synth_window_fixed[]; 46cabdff1aSopenharmony_ciextern float ff_mpa_synth_window_float[]; 47cabdff1aSopenharmony_ci 48cabdff1aSopenharmony_ciextern const int32_t ff_mpa_enwindow[257]; 49cabdff1aSopenharmony_ci 50cabdff1aSopenharmony_civoid ff_mpa_synth_filter_fixed(MPADSPContext *s, 51cabdff1aSopenharmony_ci int32_t *synth_buf_ptr, int *synth_buf_offset, 52cabdff1aSopenharmony_ci int32_t *window, int *dither_state, 53cabdff1aSopenharmony_ci int16_t *samples, ptrdiff_t incr, 54cabdff1aSopenharmony_ci int32_t *sb_samples); 55cabdff1aSopenharmony_ci 56cabdff1aSopenharmony_civoid ff_mpa_synth_filter_float(MPADSPContext *s, 57cabdff1aSopenharmony_ci float *synth_buf_ptr, int *synth_buf_offset, 58cabdff1aSopenharmony_ci float *window, int *dither_state, 59cabdff1aSopenharmony_ci float *samples, ptrdiff_t incr, 60cabdff1aSopenharmony_ci float *sb_samples); 61cabdff1aSopenharmony_ci 62cabdff1aSopenharmony_civoid ff_mpadsp_init_aarch64(MPADSPContext *s); 63cabdff1aSopenharmony_civoid ff_mpadsp_init_arm(MPADSPContext *s); 64cabdff1aSopenharmony_civoid ff_mpadsp_init_ppc(MPADSPContext *s); 65cabdff1aSopenharmony_civoid ff_mpadsp_init_x86(MPADSPContext *s); 66cabdff1aSopenharmony_civoid ff_mpadsp_init_x86_tabs(void); 67cabdff1aSopenharmony_civoid ff_mpadsp_init_mipsfpu(MPADSPContext *s); 68cabdff1aSopenharmony_civoid ff_mpadsp_init_mipsdsp(MPADSPContext *s); 69cabdff1aSopenharmony_ci 70cabdff1aSopenharmony_civoid ff_mpa_synth_init_float(void); 71cabdff1aSopenharmony_civoid ff_mpa_synth_init_fixed(void); 72cabdff1aSopenharmony_ci 73cabdff1aSopenharmony_civoid ff_mpadsp_apply_window_float(float *synth_buf, float *window, 74cabdff1aSopenharmony_ci int *dither_state, float *samples, 75cabdff1aSopenharmony_ci ptrdiff_t incr); 76cabdff1aSopenharmony_civoid ff_mpadsp_apply_window_fixed(int32_t *synth_buf, int32_t *window, 77cabdff1aSopenharmony_ci int *dither_state, int16_t *samples, 78cabdff1aSopenharmony_ci ptrdiff_t incr); 79cabdff1aSopenharmony_ci 80cabdff1aSopenharmony_civoid ff_imdct36_blocks_float(float *out, float *buf, float *in, 81cabdff1aSopenharmony_ci int count, int switch_point, int block_type); 82cabdff1aSopenharmony_ci 83cabdff1aSopenharmony_civoid ff_imdct36_blocks_fixed(int *out, int *buf, int *in, 84cabdff1aSopenharmony_ci int count, int switch_point, int block_type); 85cabdff1aSopenharmony_ci 86cabdff1aSopenharmony_ci/** For SSE implementation, MDCT_BUF_SIZE/2 should be 128-bit aligned */ 87cabdff1aSopenharmony_ci#define MDCT_BUF_SIZE FFALIGN(36, 2*4) 88cabdff1aSopenharmony_ci 89cabdff1aSopenharmony_ciextern int ff_mdct_win_fixed[8][MDCT_BUF_SIZE]; 90cabdff1aSopenharmony_ciextern float ff_mdct_win_float[8][MDCT_BUF_SIZE]; 91cabdff1aSopenharmony_ci 92cabdff1aSopenharmony_ci#endif /* AVCODEC_MPEGAUDIODSP_H */ 93