X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fcookdata.h;h=c4c26fae5f8b455c6aa1a9087bcdf8d6c6a0200d;hb=40f81769aec24a93563cd547e02ba8478aa95849;hp=38beef41cd5ebf673eb9e4429e05bc469a685c6c;hpb=5b21bdabe43611385d1d55a21d5b1f607b133d29;p=ffmpeg diff --git a/libavcodec/cookdata.h b/libavcodec/cookdata.h index 38beef41cd5..c4c26fae5f8 100644 --- a/libavcodec/cookdata.h +++ b/libavcodec/cookdata.h @@ -3,30 +3,30 @@ * Copyright (c) 2003 Sascha Sommer * Copyright (c) 2005 Benjamin Larsson * - * This file is part of FFmpeg. + * This file is part of Libav. * - * FFmpeg is free software; you can redistribute it and/or + * Libav 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, + * Libav 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 + * License along with Libav; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** - * @file cookdata.h + * @file * Cook AKA RealAudio G2 compatible decoderdata */ -#ifndef FFMPEG_COOKDATA_H -#define FFMPEG_COOKDATA_H +#ifndef AVCODEC_COOKDATA_H +#define AVCODEC_COOKDATA_H #include @@ -36,12 +36,10 @@ static const int expbits_tab[8] = { 52,47,43,37,29,22,16,0, }; -static const float dither_tab[8] = { - 0.0, 0.0, 0.0, 0.0, 0.0, 0.176777, 0.25, 0.707107, +static const float dither_tab[9] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.176777, 0.25, 0.707107, 1.0 }; -static const float randsign[2] = {1.0, -1.0}; - static const float quant_centroid_tab[7][14] = { { 0.000, 0.392, 0.761, 1.120, 1.477, 1.832, 2.183, 2.541, 2.893, 3.245, 3.598, 3.942, 4.288, 4.724 }, { 0.000, 0.544, 1.060, 1.563, 2.068, 2.571, 3.072, 3.562, 4.070, 4.620, 0.000, 0.000, 0.000, 0.000 }, @@ -424,12 +422,12 @@ static const uint16_t cvh_huffcodes6[32] = { 0x003c,0x01fc,0x00fb,0x03fd,0x00fc,0x03fe,0x01fd,0x07ff, }; -static const uint16_t* cvh_huffcodes[7] = { +static const uint16_t* const cvh_huffcodes[7] = { cvh_huffcodes0, cvh_huffcodes1, cvh_huffcodes2, cvh_huffcodes3, cvh_huffcodes4, cvh_huffcodes5, cvh_huffcodes6, }; -static const uint8_t* cvh_huffbits[7] = { +static const uint8_t* const cvh_huffbits[7] = { cvh_huffbits0, cvh_huffbits1, cvh_huffbits2, cvh_huffbits3, cvh_huffbits4, cvh_huffbits5, cvh_huffbits6, }; @@ -490,12 +488,12 @@ static const uint8_t ccpl_huffbits6[63] = { 14,14,16, }; -static const uint16_t* ccpl_huffcodes[5] = { +static const uint16_t* const ccpl_huffcodes[5] = { ccpl_huffcodes2,ccpl_huffcodes3, ccpl_huffcodes4,ccpl_huffcodes5,ccpl_huffcodes6 }; -static const uint8_t* ccpl_huffbits[5] = { +static const uint8_t* const ccpl_huffbits[5] = { ccpl_huffbits2,ccpl_huffbits3, ccpl_huffbits4,ccpl_huffbits5,ccpl_huffbits6 }; @@ -512,23 +510,37 @@ static const int cplband[51] = { 19, }; -static const float cplscale2[3] = { +// The 1 and 0 at the beginning/end are to prevent overflows with +// bitstream-read indexes. E.g. if n_bits=5, we can access any +// index from [1, (1<