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/aac_defines.h
Views: 1401
/*1* AAC defines2*3* This file is part of FFmpeg.4*5* FFmpeg is free software; you can redistribute it and/or6* modify it under the terms of the GNU Lesser General Public7* License as published by the Free Software Foundation; either8* version 2.1 of the License, or (at your option) any later version.9*10* FFmpeg is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU13* Lesser General Public License for more details.14*15* You should have received a copy of the GNU Lesser General Public16* License along with FFmpeg; if not, write to the Free Software17* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA18*/1920#ifndef AVCODEC_AAC_DEFINES_H21#define AVCODEC_AAC_DEFINES_H2223#ifndef USE_FIXED24#define USE_FIXED 025#endif2627#if USE_FIXED2829#include "libavutil/softfloat.h"3031#define FFT_FLOAT 032#define FFT_FIXED_32 13334#define AAC_RENAME(x) x ## _fixed35#define AAC_RENAME_32(x) x ## _fixed_3236typedef int INTFLOAT;37typedef int64_t INT64FLOAT;38typedef int16_t SHORTFLOAT;39typedef SoftFloat AAC_FLOAT;40typedef int AAC_SIGNE;41#define FIXR(a) ((int)((a) * 1 + 0.5))42#define FIXR10(a) ((int)((a) * 1024.0 + 0.5))43#define Q23(a) (int)((a) * 8388608.0 + 0.5)44#define Q30(x) (int)((x)*1073741824.0 + 0.5)45#define Q31(x) (int)((x)*2147483648.0 + 0.5)46#define RANGE15(x) x47#define GET_GAIN(x, y) (-(y) << (x)) + 102448#define AAC_MUL16(x, y) (int)(((int64_t)(x) * (y) + 0x8000) >> 16)49#define AAC_MUL26(x, y) (int)(((int64_t)(x) * (y) + 0x2000000) >> 26)50#define AAC_MUL30(x, y) (int)(((int64_t)(x) * (y) + 0x20000000) >> 30)51#define AAC_MUL31(x, y) (int)(((int64_t)(x) * (y) + 0x40000000) >> 31)52#define AAC_MADD28(x, y, a, b) (int)((((int64_t)(x) * (y)) + \53((int64_t)(a) * (b)) + \540x8000000) >> 28)55#define AAC_MADD30(x, y, a, b) (int)((((int64_t)(x) * (y)) + \56((int64_t)(a) * (b)) + \570x20000000) >> 30)58#define AAC_MADD30_V8(x, y, a, b, c, d, e, f) (int)((((int64_t)(x) * (y)) + \59((int64_t)(a) * (b)) + \60((int64_t)(c) * (d)) + \61((int64_t)(e) * (f)) + \620x20000000) >> 30)63#define AAC_MSUB30(x, y, a, b) (int)((((int64_t)(x) * (y)) - \64((int64_t)(a) * (b)) + \650x20000000) >> 30)66#define AAC_MSUB30_V8(x, y, a, b, c, d, e, f) (int)((((int64_t)(x) * (y)) + \67((int64_t)(a) * (b)) - \68((int64_t)(c) * (d)) - \69((int64_t)(e) * (f)) + \700x20000000) >> 30)71#define AAC_MSUB31_V3(x, y, z) (int)((((int64_t)(x) * (z)) - \72((int64_t)(y) * (z)) + \730x40000000) >> 31)74#define AAC_HALF_SUM(x, y) (x) >> 1 + (y) >> 175#define AAC_SRA_R(x, y) (int)(((x) + (1 << ((y) - 1))) >> (y))7677#else7879#define FFT_FLOAT 180#define FFT_FIXED_32 08182typedef float INTFLOAT;83typedef float INT64FLOAT;84typedef float SHORTFLOAT;85typedef float AAC_FLOAT;86typedef unsigned AAC_SIGNE;87#define FIXR(x) ((float)(x))88#define FIXR10(x) ((float)(x))89#define Q23(x) x90#define Q30(x) x91#define Q31(x) x92#define RANGE15(x) (32768.0 * (x))93#define GET_GAIN(x, y) powf((x), -(y))94#define AAC_MUL16(x, y) ((x) * (y))95#define AAC_MUL26(x, y) ((x) * (y))96#define AAC_MUL30(x, y) ((x) * (y))97#define AAC_MUL31(x, y) ((x) * (y))98#define AAC_MADD28(x, y, a, b) ((x) * (y) + (a) * (b))99#define AAC_MADD30(x, y, a, b) ((x) * (y) + (a) * (b))100#define AAC_MADD30_V8(x, y, a, b, c, d, e, f) ((x) * (y) + (a) * (b) + \101(c) * (d) + (e) * (f))102#define AAC_MSUB30(x, y, a, b) ((x) * (y) - (a) * (b))103#define AAC_MSUB30_V8(x, y, a, b, c, d, e, f) ((x) * (y) + (a) * (b) - \104(c) * (d) - (e) * (f))105#define AAC_MSUB31_V3(x, y, z) ((x) - (y)) * (z)106#define AAC_HALF_SUM(x, y) ((x) + (y)) * 0.5f107#define AAC_SRA_R(x, y) (x)108109#endif /* USE_FIXED */110111#endif /* AVCODEC_AAC_DEFINES_H */112113114