/* * Header file for hardcoded PCM tables * * Copyright (c) 2010 Reimar Döffinger <[email protected]> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVCODEC_PCM_TABLEGEN_H #define AVCODEC_PCM_TABLEGEN_H #include <stdint.h> #include "libavutil/attributes.h" /* from g711.c by SUN microsystems (unrestricted use) */ #define SIGN_BIT … #define QUANT_MASK … #define NSEGS … #define SEG_SHIFT … #define SEG_MASK … #define BIAS … #define VIDC_SIGN_BIT … #define VIDC_QUANT_MASK … #define VIDC_QUANT_SHIFT … #define VIDC_SEG_SHIFT … #define VIDC_SEG_MASK … /* alaw2linear() - Convert an A-law value to 16-bit linear PCM */ static av_cold int alaw2linear(unsigned char a_val) { … } static av_cold int ulaw2linear(unsigned char u_val) { … } static av_cold int vidc2linear(unsigned char u_val) { … } #if CONFIG_HARDCODED_TABLES #define pcm_alaw_tableinit … #define pcm_ulaw_tableinit … #define pcm_vidc_tableinit … #include "libavcodec/pcm_tables.h" #else /* 16384 entries per table */ static uint8_t linear_to_alaw[16384]; static uint8_t linear_to_ulaw[16384]; static uint8_t linear_to_vidc[16384]; static av_cold void build_xlaw_table(uint8_t *linear_to_xlaw, int (*xlaw2linear)(unsigned char), int mask) { … } static void pcm_alaw_tableinit(void) { … } static void pcm_ulaw_tableinit(void) { … } static void pcm_vidc_tableinit(void) { … } #endif /* CONFIG_HARDCODED_TABLES */ #endif /* AVCODEC_PCM_TABLEGEN_H */