CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/ext/at3_standalone/atrac.h
Views: 1401
/*1* common functions for the ATRAC family of decoders2*3* Copyright (c) 2009-2013 Maxim Poliakovski4* Copyright (c) 2009 Benjamin Larsson5*6* This file is part of FFmpeg.7*8* FFmpeg is free software; you can redistribute it and/or9* modify it under the terms of the GNU Lesser General Public10* License as published by the Free Software Foundation; either11* version 2.1 of the License, or (at your option) any later version.12*13* FFmpeg is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU16* Lesser General Public License for more details.17*18* You should have received a copy of the GNU Lesser General Public19* License along with FFmpeg; if not, write to the Free Software20* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA21*/2223/**24* @file25* ATRAC common header26*/2728#include "compat.h"2930#ifndef AVCODEC_ATRAC_H31#define AVCODEC_ATRAC_H3233/**34* Gain control parameters for one subband.35*/36typedef struct AtracGainInfo {37int num_points; ///< number of gain control points38int lev_code[7]; ///< level at corresponding control point39int loc_code[7]; ///< location of gain control points40} AtracGainInfo;4142/**43* Gain compensation context structure.44*/45typedef struct AtracGCContext {46float gain_tab1[16]; ///< gain compensation level table47float gain_tab2[31]; ///< gain compensation interpolation table48int id2exp_offset; ///< offset for converting level index into level exponent49int loc_scale; ///< scale of location code = 2^loc_scale samples50int loc_size; ///< size of location code in samples51} AtracGCContext;5253extern float av_atrac_sf_table[64];5455/**56* Generate common tables.57*/58void ff_atrac_generate_tables(void);5960/**61* Initialize gain compensation context.62*63* @param gctx pointer to gain compensation context to initialize64* @param id2exp_offset offset for converting level index into level exponent65* @param loc_scale location size factor66*/67void ff_atrac_init_gain_compensation(AtracGCContext *gctx, int id2exp_offset,68int loc_scale);6970/**71* Apply gain compensation and perform the MDCT overlapping part.72*73* @param gctx pointer to gain compensation context74* @param in input buffer75* @param prev previous buffer to perform overlap against76* @param gc_now gain control information for current frame77* @param gc_next gain control information for next frame78* @param num_samples number of samples to process79* @param out output data goes here80*/81void ff_atrac_gain_compensation(AtracGCContext *gctx, float *in, float *prev,82AtracGainInfo *gc_now, AtracGainInfo *gc_next,83int num_samples, float *out);8485/**86* Quadrature mirror synthesis filter.87*88* @param inlo lower part of spectrum89* @param inhi higher part of spectrum90* @param nIn size of spectrum buffer91* @param pOut out buffer92* @param delayBuf delayBuf buffer93* @param temp temp buffer94*/95void ff_atrac_iqmf(float *inlo, float *inhi, unsigned int nIn, float *pOut,96float *delayBuf, float *temp);9798#endif /* AVCODEC_ATRAC_H */99100101