Update avcodec to 20080825

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27555 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
David McPaul
2008-09-15 14:08:35 +00:00
parent 25074f9ff3
commit 7bfcce50a5
8 changed files with 1770 additions and 0 deletions
@@ -0,0 +1,108 @@
/*
* Musepack decoder core
* Copyright (c) 2006 Konstantin Shishkov
*
* 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
*/
/**
* @file mpc.c Musepack decoder core
* MPEG Audio Layer 1/2 -like codec with frames of 1152 samples
* divided into 32 subbands.
*/
#include "random.h"
#include "avcodec.h"
#include "bitstream.h"
#include "dsputil.h"
#ifdef CONFIG_MPEGAUDIO_HP
#define USE_HIGHPRECISION
#endif
#include "mpegaudio.h"
#include "mpc.h"
#include "mpcdata.h"
static DECLARE_ALIGNED_16(MPA_INT, mpa_window[512]);
void ff_mpc_init()
{
ff_mpa_synth_init(mpa_window);
}
/**
* Process decoded Musepack data and produce PCM
*/
static void mpc_synth(MPCContext *c, int16_t *out)
{
int dither_state = 0;
int i, ch;
OUT_INT samples[MPA_MAX_CHANNELS * MPA_FRAME_SIZE], *samples_ptr;
for(ch = 0; ch < 2; ch++){
samples_ptr = samples + ch;
for(i = 0; i < SAMPLES_PER_BAND; i++) {
ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
mpa_window, &dither_state,
samples_ptr, 2,
c->sb_samples[ch][i]);
samples_ptr += 64;
}
}
for(i = 0; i < MPC_FRAME_SIZE*2; i++)
*out++=samples[i];
}
void ff_mpc_dequantize_and_synth(MPCContext * c, int maxband, void *data)
{
int i, j, ch;
Band *bands = c->bands;
int off;
float mul;
/* dequantize */
memset(c->sb_samples, 0, sizeof(c->sb_samples));
off = 0;
for(i = 0; i <= maxband; i++, off += SAMPLES_PER_BAND){
for(ch = 0; ch < 2; ch++){
if(bands[i].res[ch]){
j = 0;
mul = mpc_CC[bands[i].res[ch]] * mpc_SCF[bands[i].scf_idx[ch][0]];
for(; j < 12; j++)
c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];
mul = mpc_CC[bands[i].res[ch]] * mpc_SCF[bands[i].scf_idx[ch][1]];
for(; j < 24; j++)
c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];
mul = mpc_CC[bands[i].res[ch]] * mpc_SCF[bands[i].scf_idx[ch][2]];
for(; j < 36; j++)
c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];
}
}
if(bands[i].msf){
int t1, t2;
for(j = 0; j < SAMPLES_PER_BAND; j++){
t1 = c->sb_samples[0][j][i];
t2 = c->sb_samples[1][j][i];
c->sb_samples[0][j][i] = t1 + t2;
c->sb_samples[1][j][i] = t1 - t2;
}
}
}
mpc_synth(c, data);
}
@@ -0,0 +1,80 @@
/*
* Musepack decoder
* Copyright (c) 2006 Konstantin Shishkov
*
* 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
*/
/**
* @file mpc.h Musepack decoder
* MPEG Audio Layer 1/2 -like codec with frames of 1152 samples
* divided into 32 subbands.
*/
#ifndef FFMPEG_MPC_H
#define FFMPEG_MPC_H
#include "random.h"
#include "avcodec.h"
#include "bitstream.h"
#include "dsputil.h"
#ifdef CONFIG_MPEGAUDIO_HP
#define USE_HIGHPRECISION
#endif
#include "mpegaudio.h"
#include "mpcdata.h"
#define BANDS 32
#define SAMPLES_PER_BAND 36
#define MPC_FRAME_SIZE (BANDS * SAMPLES_PER_BAND)
/** Subband structure - hold all variables for each subband */
typedef struct {
int msf; ///< mid-stereo flag
int res[2];
int scfi[2];
int scf_idx[2][3];
int Q[2];
}Band;
typedef struct {
DSPContext dsp;
GetBitContext gb;
int IS, MSS, gapless;
int lastframelen;
int maxbands, last_max_band;
int last_bits_used;
int oldDSCF[2][BANDS];
Band bands[BANDS];
int Q[2][MPC_FRAME_SIZE];
int cur_frame, frames;
uint8_t *bits;
int buf_size;
AVRandomState rnd;
int frames_to_skip;
/* for synthesis */
DECLARE_ALIGNED_16(MPA_INT, synth_buf[MPA_MAX_CHANNELS][512*2]);
int synth_buf_offset[MPA_MAX_CHANNELS];
DECLARE_ALIGNED_16(int32_t, sb_samples[MPA_MAX_CHANNELS][36][SBLIMIT]);
} MPCContext;
extern void ff_mpc_init();
extern void ff_mpc_dequantize_and_synth(MPCContext *c, int maxband, void *dst);
#endif /* FFMPEG_MPC_H */
@@ -0,0 +1,278 @@
/*
* Musepack SV7 decoder
* Copyright (c) 2006 Konstantin Shishkov
*
* 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
*/
/**
* @file mpc7.c Musepack SV7 decoder
* MPEG Audio Layer 1/2 -like codec with frames of 1152 samples
* divided into 32 subbands.
*/
#include "random.h"
#include "avcodec.h"
#include "bitstream.h"
#include "dsputil.h"
#ifdef CONFIG_MPEGAUDIO_HP
#define USE_HIGHPRECISION
#endif
#include "mpegaudio.h"
#include "mpc.h"
#include "mpc7data.h"
#define BANDS 32
#define SAMPLES_PER_BAND 36
#define MPC_FRAME_SIZE (BANDS * SAMPLES_PER_BAND)
static VLC scfi_vlc, dscf_vlc, hdr_vlc, quant_vlc[MPC7_QUANT_VLC_TABLES][2];
static av_cold int mpc7_decode_init(AVCodecContext * avctx)
{
int i, j;
MPCContext *c = avctx->priv_data;
GetBitContext gb;
uint8_t buf[16];
static int vlc_initialized = 0;
if(avctx->extradata_size < 16){
av_log(avctx, AV_LOG_ERROR, "Too small extradata size (%i)!\n", avctx->extradata_size);
return -1;
}
memset(c->oldDSCF, 0, sizeof(c->oldDSCF));
av_init_random(0xDEADBEEF, &c->rnd);
dsputil_init(&c->dsp, avctx);
c->dsp.bswap_buf((uint32_t*)buf, (const uint32_t*)avctx->extradata, 4);
ff_mpc_init();
init_get_bits(&gb, buf, 128);
c->IS = get_bits1(&gb);
c->MSS = get_bits1(&gb);
c->maxbands = get_bits(&gb, 6);
if(c->maxbands >= BANDS){
av_log(avctx, AV_LOG_ERROR, "Too many bands: %i\n", c->maxbands);
return -1;
}
skip_bits(&gb, 88);
c->gapless = get_bits1(&gb);
c->lastframelen = get_bits(&gb, 11);
av_log(avctx, AV_LOG_DEBUG, "IS: %d, MSS: %d, TG: %d, LFL: %d, bands: %d\n",
c->IS, c->MSS, c->gapless, c->lastframelen, c->maxbands);
c->frames_to_skip = 0;
if(vlc_initialized) return 0;
av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");
if(init_vlc(&scfi_vlc, MPC7_SCFI_BITS, MPC7_SCFI_SIZE,
&mpc7_scfi[1], 2, 1,
&mpc7_scfi[0], 2, 1, INIT_VLC_USE_STATIC)){
av_log(avctx, AV_LOG_ERROR, "Cannot init SCFI VLC\n");
return -1;
}
if(init_vlc(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE,
&mpc7_dscf[1], 2, 1,
&mpc7_dscf[0], 2, 1, INIT_VLC_USE_STATIC)){
av_log(avctx, AV_LOG_ERROR, "Cannot init DSCF VLC\n");
return -1;
}
if(init_vlc(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE,
&mpc7_hdr[1], 2, 1,
&mpc7_hdr[0], 2, 1, INIT_VLC_USE_STATIC)){
av_log(avctx, AV_LOG_ERROR, "Cannot init HDR VLC\n");
return -1;
}
for(i = 0; i < MPC7_QUANT_VLC_TABLES; i++){
for(j = 0; j < 2; j++){
if(init_vlc(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i],
&mpc7_quant_vlc[i][j][1], 4, 2,
&mpc7_quant_vlc[i][j][0], 4, 2, INIT_VLC_USE_STATIC)){
av_log(avctx, AV_LOG_ERROR, "Cannot init QUANT VLC %i,%i\n",i,j);
return -1;
}
}
}
vlc_initialized = 1;
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0;
}
/**
* Fill samples for given subband
*/
static inline void idx_to_quant(MPCContext *c, GetBitContext *gb, int idx, int *dst)
{
int i, i1, t;
switch(idx){
case -1:
for(i = 0; i < SAMPLES_PER_BAND; i++){
*dst++ = (av_random(&c->rnd) & 0x3FC) - 510;
}
break;
case 1:
i1 = get_bits1(gb);
for(i = 0; i < SAMPLES_PER_BAND/3; i++){
t = get_vlc2(gb, quant_vlc[0][i1].table, 9, 2);
*dst++ = mpc7_idx30[t];
*dst++ = mpc7_idx31[t];
*dst++ = mpc7_idx32[t];
}
break;
case 2:
i1 = get_bits1(gb);
for(i = 0; i < SAMPLES_PER_BAND/2; i++){
t = get_vlc2(gb, quant_vlc[1][i1].table, 9, 2);
*dst++ = mpc7_idx50[t];
*dst++ = mpc7_idx51[t];
}
break;
case 3: case 4: case 5: case 6: case 7:
i1 = get_bits1(gb);
for(i = 0; i < SAMPLES_PER_BAND; i++)
*dst++ = get_vlc2(gb, quant_vlc[idx-1][i1].table, 9, 2) - mpc7_quant_vlc_off[idx-1];
break;
case 8: case 9: case 10: case 11: case 12:
case 13: case 14: case 15: case 16: case 17:
t = (1 << (idx - 2)) - 1;
for(i = 0; i < SAMPLES_PER_BAND; i++)
*dst++ = get_bits(gb, idx - 1) - t;
break;
default: // case 0 and -2..-17
return;
}
}
static int mpc7_decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
const uint8_t * buf, int buf_size)
{
MPCContext *c = avctx->priv_data;
GetBitContext gb;
uint8_t *bits;
int i, ch, t;
int mb = -1;
Band *bands = c->bands;
int off;
int bits_used, bits_avail;
memset(bands, 0, sizeof(bands));
if(buf_size <= 4){
av_log(avctx, AV_LOG_ERROR, "Too small buffer passed (%i bytes)\n", buf_size);
}
bits = av_malloc(((buf_size - 1) & ~3) + FF_INPUT_BUFFER_PADDING_SIZE);
c->dsp.bswap_buf((uint32_t*)bits, (const uint32_t*)(buf + 4), (buf_size - 4) >> 2);
init_get_bits(&gb, bits, (buf_size - 4)* 8);
skip_bits(&gb, buf[0]);
/* read subband indexes */
for(i = 0; i <= c->maxbands; i++){
for(ch = 0; ch < 2; ch++){
if(i) t = get_vlc2(&gb, hdr_vlc.table, MPC7_HDR_BITS, 1) - 5;
if(!i || (t == 4)) bands[i].res[ch] = get_bits(&gb, 4);
else bands[i].res[ch] = bands[i-1].res[ch] + t;
}
if(bands[i].res[0] || bands[i].res[1]){
mb = i;
if(c->MSS) bands[i].msf = get_bits1(&gb);
}
}
/* get scale indexes coding method */
for(i = 0; i <= mb; i++)
for(ch = 0; ch < 2; ch++)
if(bands[i].res[ch]) bands[i].scfi[ch] = get_vlc2(&gb, scfi_vlc.table, MPC7_SCFI_BITS, 1);
/* get scale indexes */
for(i = 0; i <= mb; i++){
for(ch = 0; ch < 2; ch++){
if(bands[i].res[ch]){
bands[i].scf_idx[ch][2] = c->oldDSCF[ch][i];
t = get_vlc2(&gb, dscf_vlc.table, MPC7_DSCF_BITS, 1) - 7;
bands[i].scf_idx[ch][0] = (t == 8) ? get_bits(&gb, 6) : (bands[i].scf_idx[ch][2] + t);
switch(bands[i].scfi[ch]){
case 0:
t = get_vlc2(&gb, dscf_vlc.table, MPC7_DSCF_BITS, 1) - 7;
bands[i].scf_idx[ch][1] = (t == 8) ? get_bits(&gb, 6) : (bands[i].scf_idx[ch][0] + t);
t = get_vlc2(&gb, dscf_vlc.table, MPC7_DSCF_BITS, 1) - 7;
bands[i].scf_idx[ch][2] = (t == 8) ? get_bits(&gb, 6) : (bands[i].scf_idx[ch][1] + t);
break;
case 1:
t = get_vlc2(&gb, dscf_vlc.table, MPC7_DSCF_BITS, 1) - 7;
bands[i].scf_idx[ch][1] = (t == 8) ? get_bits(&gb, 6) : (bands[i].scf_idx[ch][0] + t);
bands[i].scf_idx[ch][2] = bands[i].scf_idx[ch][1];
break;
case 2:
bands[i].scf_idx[ch][1] = bands[i].scf_idx[ch][0];
t = get_vlc2(&gb, dscf_vlc.table, MPC7_DSCF_BITS, 1) - 7;
bands[i].scf_idx[ch][2] = (t == 8) ? get_bits(&gb, 6) : (bands[i].scf_idx[ch][1] + t);
break;
case 3:
bands[i].scf_idx[ch][2] = bands[i].scf_idx[ch][1] = bands[i].scf_idx[ch][0];
break;
}
c->oldDSCF[ch][i] = bands[i].scf_idx[ch][2];
}
}
}
/* get quantizers */
memset(c->Q, 0, sizeof(c->Q));
off = 0;
for(i = 0; i < BANDS; i++, off += SAMPLES_PER_BAND)
for(ch = 0; ch < 2; ch++)
idx_to_quant(c, &gb, bands[i].res[ch], c->Q[ch] + off);
ff_mpc_dequantize_and_synth(c, mb, data);
av_free(bits);
bits_used = get_bits_count(&gb);
bits_avail = (buf_size - 4) * 8;
if(!buf[1] && ((bits_avail < bits_used) || (bits_used + 32 <= bits_avail))){
av_log(NULL,0, "Error decoding frame: used %i of %i bits\n", bits_used, bits_avail);
return -1;
}
if(c->frames_to_skip){
c->frames_to_skip--;
*data_size = 0;
return buf_size;
}
*data_size = (buf[1] ? c->lastframelen : MPC_FRAME_SIZE) * 4;
return buf_size;
}
static void mpc7_decode_flush(AVCodecContext *avctx)
{
MPCContext *c = avctx->priv_data;
memset(c->oldDSCF, 0, sizeof(c->oldDSCF));
c->frames_to_skip = 32;
}
AVCodec mpc7_decoder = {
"mpc7",
CODEC_TYPE_AUDIO,
CODEC_ID_MUSEPACK7,
sizeof(MPCContext),
mpc7_decode_init,
NULL,
NULL,
mpc7_decode_frame,
.flush = mpc7_decode_flush,
.long_name = NULL_IF_CONFIG_SMALL("Musepack SV7"),
};
@@ -0,0 +1,171 @@
/*
* Musepack decoder
* Copyright (c) 2006 Konstantin Shishkov
*
* 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 FFMPEG_MPC7DATA_H
#define FFMPEG_MPC7DATA_H
#include <stdint.h>
static const int8_t mpc7_idx30[] = { -1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1};
static const int8_t mpc7_idx31[] = { -1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1};
static const int8_t mpc7_idx32[] = { -1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1};
static const int8_t mpc7_idx50[] = { -2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2};
static const int8_t mpc7_idx51[] = { -2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2};
#define MPC7_SCFI_SIZE 4
#define MPC7_SCFI_BITS 3
static const uint8_t mpc7_scfi[MPC7_SCFI_SIZE * 2] = {
0x2, 3, 0x1, 1, 0x3, 3, 0x0, 2
};
#define MPC7_DSCF_SIZE 16
#define MPC7_DSCF_BITS 6
static const uint8_t mpc7_dscf[MPC7_DSCF_SIZE * 2] = {
0x20, 6, 0x04, 5, 0x11, 5, 0x1E, 5, 0x0D, 4, 0x00, 3, 0x03, 3, 0x09, 4,
0x05, 3, 0x02, 3, 0x0E, 4, 0x03, 4, 0x1F, 5, 0x05, 5, 0x21, 6, 0x0C, 4
};
#define MPC7_HDR_SIZE 10
#define MPC7_HDR_BITS 9
static const uint8_t mpc7_hdr[MPC7_HDR_SIZE * 2] = {
0x5C, 8, 0x2F, 7, 0x0A, 5, 0x04, 4, 0x00, 2,
0x01, 1, 0x03, 3, 0x16, 6, 0xBB, 9, 0xBA, 9
};
#define MPC7_QUANT_VLC_TABLES 7
static const uint8_t mpc7_quant_vlc_sizes[MPC7_QUANT_VLC_TABLES * 2] = {
27, 25, 7, 9, 15, 31, 63
};
static const uint8_t mpc7_quant_vlc_off[MPC7_QUANT_VLC_TABLES] = {
0, 0, 3, 4, 7, 15, 31
};
static const uint16_t mpc7_quant_vlc[MPC7_QUANT_VLC_TABLES][2][64 * 2] = {
{
{
0x0036, 6, 0x0009, 5, 0x0020, 6, 0x0005, 5, 0x000A, 4, 0x0007, 5,
0x0034, 6, 0x0000, 5, 0x0023, 6, 0x000A, 5, 0x0006, 4, 0x0004, 5,
0x000B, 4, 0x0007, 3, 0x000C, 4, 0x0003, 5, 0x0007, 4, 0x000B, 5,
0x0022, 6, 0x0001, 5, 0x0035, 6, 0x0006, 5, 0x0009, 4, 0x0002, 5,
0x0021, 6, 0x0008, 5, 0x0037, 6
},
{
0x0067, 8, 0x003E, 7, 0x00E1, 9, 0x0037, 7, 0x0003, 4, 0x0034, 7,
0x0065, 8, 0x003C, 7, 0x00E3, 9, 0x0018, 6, 0x0000, 4, 0x003D, 7,
0x0004, 4, 0x0001, 1, 0x0005, 4, 0x003F, 7, 0x0001, 4, 0x003B, 7,
0x00E2, 9, 0x0039, 7, 0x0064, 8, 0x0035, 7, 0x0002, 4, 0x0036, 7,
0x00E0, 9, 0x003A, 7, 0x0066, 8
}
},
{
{
0x0059, 7, 0x002F, 6, 0x000F, 5, 0x0000, 5, 0x005B, 7, 0x0004, 5,
0x0006, 4, 0x000D, 4, 0x0004, 4, 0x0005, 5, 0x0014, 5, 0x000C, 4,
0x0004, 3, 0x000F, 4, 0x000E, 5, 0x0003, 5, 0x0003, 4, 0x000E, 4,
0x0005, 4, 0x0001, 5, 0x005A, 7, 0x0002, 5, 0x0015, 5, 0x002E, 6,
0x0058, 7
},
{
0x0399, 10, 0x0071, 7, 0x0033, 6, 0x00E7, 8, 0x039A, 10, 0x0068, 7,
0x001E, 5, 0x0000, 3, 0x001D, 5, 0x0069, 7, 0x0032, 6, 0x0001, 3,
0x0002, 2, 0x0003, 3, 0x0031, 6, 0x006B, 7, 0x001B, 5, 0x0002, 3,
0x001F, 5, 0x0070, 7, 0x0398, 10, 0x006A, 7, 0x0030, 6, 0x0072, 7,
0x039B, 10
}
},
{
{
0x000C, 4, 0x0004, 3, 0x0000, 2, 0x0001, 2, 0x0007, 3, 0x0005, 3, 0x000D, 4
},
{
0x0004, 5, 0x0003, 4, 0x0002, 2, 0x0003, 2, 0x0001, 2, 0x0000, 3, 0x0005, 5
}
},
{
{
0x0005, 4, 0x0000, 3, 0x0004, 3, 0x0006, 3, 0x0007, 3, 0x0005, 3, 0x0003, 3, 0x0001, 3, 0x0004, 4
},
{
0x0009, 5, 0x000C, 4, 0x0003, 3, 0x0000, 2, 0x0002, 2, 0x0007, 3, 0x000D, 4, 0x0005, 4, 0x0008, 5
}
},
{
{
0x0039, 6, 0x0017, 5, 0x0008, 4, 0x000A, 4, 0x000D, 4, 0x0000, 3,
0x0002, 3, 0x0003, 3, 0x0001, 3, 0x000F, 4, 0x000C, 4, 0x0009, 4,
0x001D, 5, 0x0016, 5, 0x0038, 6,
},
{
0x00E5, 8, 0x0038, 6, 0x0007, 5, 0x0002, 4, 0x0000, 3, 0x0003, 3,
0x0005, 3, 0x0006, 3, 0x0004, 3, 0x0002, 3, 0x000F, 4, 0x001D, 5,
0x0006, 5, 0x0073, 7, 0x00E4, 8,
},
},
{
{
0x0041, 7, 0x0006, 6, 0x002C, 6, 0x002D, 6, 0x003B, 6, 0x000D, 5,
0x0011, 5, 0x0013, 5, 0x0017, 5, 0x0015, 5, 0x001A, 5, 0x001E, 5,
0x0000, 4, 0x0002, 4, 0x0005, 4, 0x0007, 4, 0x0003, 4, 0x0004, 4,
0x001F, 5, 0x001C, 5, 0x0019, 5, 0x001B, 5, 0x0018, 5, 0x0014, 5,
0x0012, 5, 0x000C, 5, 0x0002, 5, 0x003A, 6, 0x0021, 6, 0x0007, 6,
0x0040, 7
},
{
0x1948, 13, 0x194A, 13, 0x0328, 10, 0x0195, 9, 0x00CB, 8, 0x0066, 7,
0x0031, 6, 0x0009, 5, 0x000F, 5, 0x001F, 5, 0x0002, 4, 0x0006, 4,
0x0008, 4, 0x000B, 4, 0x000D, 4, 0x0000, 3, 0x000E, 4, 0x000A, 4,
0x0009, 4, 0x0005, 4, 0x0003, 4, 0x001E, 5, 0x000E, 5, 0x0008, 5,
0x0030, 6, 0x0067, 7, 0x00C9, 8, 0x00C8, 8, 0x0653, 11, 0x1949, 13,
0x194B, 13
}
},
{
{
0x0067, 8, 0x0099, 8, 0x00B5, 8, 0x00E9, 8, 0x0040, 7, 0x0041, 7,
0x004D, 7, 0x0051, 7, 0x005B, 7, 0x0071, 7, 0x0070, 7, 0x0018, 6,
0x001D, 6, 0x0023, 6, 0x0025, 6, 0x0029, 6, 0x002C, 6, 0x002E, 6,
0x0033, 6, 0x0031, 6, 0x0036, 6, 0x0037, 6, 0x0039, 6, 0x003C, 6,
0x0000, 5, 0x0002, 5, 0x000A, 5, 0x0005, 5, 0x0009, 5, 0x0006, 5,
0x000D, 5, 0x0007, 5, 0x000B, 5, 0x000F, 5, 0x0008, 5, 0x0004, 5,
0x0003, 5, 0x0001, 5, 0x003F, 6, 0x003E, 6, 0x003D, 6, 0x0035, 6,
0x003B, 6, 0x0034, 6, 0x0030, 6, 0x002F, 6, 0x002B, 6, 0x002A, 6,
0x0027, 6, 0x0024, 6, 0x0021, 6, 0x001C, 6, 0x0075, 7, 0x0065, 7,
0x0064, 7, 0x0050, 7, 0x0045, 7, 0x0044, 7, 0x0032, 7, 0x00E8, 8,
0x00B4, 8, 0x0098, 8, 0x0066, 8
},
{
0x37A4, 14, 0x37AD, 14, 0x37A6, 14, 0x37AE, 14, 0x0DEA, 12, 0x02F0, 10,
0x02F1, 10, 0x00A0, 9, 0x00A2, 9, 0x01BC, 9, 0x007A, 8, 0x00DF, 8,
0x003C, 7, 0x0049, 7, 0x006E, 7, 0x000E, 6, 0x0018, 6, 0x0019, 6,
0x0022, 6, 0x0025, 6, 0x0036, 6, 0x0003, 5, 0x0009, 5, 0x000B, 5,
0x0010, 5, 0x0013, 5, 0x0015, 5, 0x0018, 5, 0x001A, 5, 0x001D, 5,
0x001F, 5, 0x0002, 4, 0x0000, 4, 0x001E, 5, 0x001C, 5, 0x0019, 5,
0x0016, 5, 0x0014, 5, 0x000E, 5, 0x000D, 5, 0x0008, 5, 0x0006, 5,
0x0002, 5, 0x002E, 6, 0x0023, 6, 0x001F, 6, 0x0015, 6, 0x000F, 6,
0x005F, 7, 0x0048, 7, 0x0029, 7, 0x00BD, 8, 0x007B, 8, 0x0179, 9,
0x00A1, 9, 0x037B, 10, 0x0147, 10, 0x0146, 10, 0x0DE8, 12, 0x37AF, 14,
0x37A7, 14, 0x37AC, 14, 0x37A5, 14
}
}
};
#endif /* FFMPEG_MPC7DATA_H */
@@ -0,0 +1,366 @@
/*
* Musepack SV8 decoder
* Copyright (c) 2007 Konstantin Shishkov
*
* 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
*/
/**
* @file mpc8.c Musepack SV8 decoder
* MPEG Audio Layer 1/2 -like codec with frames of 1152 samples
* divided into 32 subbands.
*/
#include "random.h"
#include "avcodec.h"
#include "bitstream.h"
#include "dsputil.h"
#ifdef CONFIG_MPEGAUDIO_HP
#define USE_HIGHPRECISION
#endif
#include "mpegaudio.h"
#include "mpc.h"
#include "mpcdata.h"
#include "mpc8data.h"
#include "mpc8huff.h"
static VLC band_vlc, scfi_vlc[2], dscf_vlc[2], res_vlc[2];
static VLC q1_vlc, q2_vlc[2], q3_vlc[2], quant_vlc[4][2], q9up_vlc;
static const int q3_offsets[2] = { MPC8_Q3_OFFSET, MPC8_Q4_OFFSET };
static const int quant_offsets[6] = { MPC8_Q5_OFFSET, MPC8_Q6_OFFSET, MPC8_Q7_OFFSET, MPC8_Q8_OFFSET };
static inline int mpc8_dec_base(GetBitContext *gb, int k, int n)
{
int code = get_bits(gb, mpc8_cnk_len[k-1][n-1] - 1);
if (code >= mpc8_cnk_lost[k-1][n-1])
code = ((code << 1) | get_bits1(gb)) - mpc8_cnk_lost[k-1][n-1];
return code;
}
static inline int mpc8_dec_enum(GetBitContext *gb, int k, int n)
{
int bits = 0;
const uint32_t * C = mpc8_cnk[k-1];
int code = mpc8_dec_base(gb, k, n);
do {
n--;
if (code >= C[n]) {
bits |= 1 << n;
code -= C[n];
C -= 32;
k--;
}
} while(k > 0);
return bits;
}
static inline int mpc8_get_mod_golomb(GetBitContext *gb, int m)
{
if(mpc8_cnk_len[0][m] < 1) return 0;
return mpc8_dec_base(gb, 1, m+1);
}
static int mpc8_get_mask(GetBitContext *gb, int size, int t)
{
int mask = 0;
if(t && t != size)
mask = mpc8_dec_enum(gb, FFMIN(t, size - t), size);
if((t << 1) > size) mask = ~mask;
return mask;
}
static av_cold int mpc8_decode_init(AVCodecContext * avctx)
{
int i;
MPCContext *c = avctx->priv_data;
GetBitContext gb;
static int vlc_initialized = 0;
if(avctx->extradata_size < 2){
av_log(avctx, AV_LOG_ERROR, "Too small extradata size (%i)!\n", avctx->extradata_size);
return -1;
}
memset(c->oldDSCF, 0, sizeof(c->oldDSCF));
av_init_random(0xDEADBEEF, &c->rnd);
dsputil_init(&c->dsp, avctx);
ff_mpc_init();
init_get_bits(&gb, avctx->extradata, 16);
skip_bits(&gb, 3);//sample rate
c->maxbands = get_bits(&gb, 5) + 1;
skip_bits(&gb, 4);//channels
c->MSS = get_bits1(&gb);
c->frames = 1 << (get_bits(&gb, 3) * 2);
if(vlc_initialized) return 0;
av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");
init_vlc(&band_vlc, MPC8_BANDS_BITS, MPC8_BANDS_SIZE,
mpc8_bands_bits, 1, 1,
mpc8_bands_codes, 1, 1, INIT_VLC_USE_STATIC);
init_vlc(&q1_vlc, MPC8_Q1_BITS, MPC8_Q1_SIZE,
mpc8_q1_bits, 1, 1,
mpc8_q1_codes, 1, 1, INIT_VLC_USE_STATIC);
init_vlc(&q9up_vlc, MPC8_Q9UP_BITS, MPC8_Q9UP_SIZE,
mpc8_q9up_bits, 1, 1,
mpc8_q9up_codes, 1, 1, INIT_VLC_USE_STATIC);
init_vlc(&scfi_vlc[0], MPC8_SCFI0_BITS, MPC8_SCFI0_SIZE,
mpc8_scfi0_bits, 1, 1,
mpc8_scfi0_codes, 1, 1, INIT_VLC_USE_STATIC);
init_vlc(&scfi_vlc[1], MPC8_SCFI1_BITS, MPC8_SCFI1_SIZE,
mpc8_scfi1_bits, 1, 1,
mpc8_scfi1_codes, 1, 1, INIT_VLC_USE_STATIC);
init_vlc(&dscf_vlc[0], MPC8_DSCF0_BITS, MPC8_DSCF0_SIZE,
mpc8_dscf0_bits, 1, 1,
mpc8_dscf0_codes, 1, 1, INIT_VLC_USE_STATIC);
init_vlc(&dscf_vlc[1], MPC8_DSCF1_BITS, MPC8_DSCF1_SIZE,
mpc8_dscf1_bits, 1, 1,
mpc8_dscf1_codes, 1, 1, INIT_VLC_USE_STATIC);
init_vlc_sparse(&q3_vlc[0], MPC8_Q3_BITS, MPC8_Q3_SIZE,
mpc8_q3_bits, 1, 1,
mpc8_q3_codes, 1, 1,
mpc8_q3_syms, 1, 1, INIT_VLC_USE_STATIC);
init_vlc_sparse(&q3_vlc[1], MPC8_Q4_BITS, MPC8_Q4_SIZE,
mpc8_q4_bits, 1, 1,
mpc8_q4_codes, 1, 1,
mpc8_q4_syms, 1, 1, INIT_VLC_USE_STATIC);
for(i = 0; i < 2; i++){
init_vlc(&res_vlc[i], MPC8_RES_BITS, MPC8_RES_SIZE,
&mpc8_res_bits[i], 1, 1,
&mpc8_res_codes[i], 1, 1, INIT_VLC_USE_STATIC);
init_vlc(&q2_vlc[i], MPC8_Q2_BITS, MPC8_Q2_SIZE,
&mpc8_q2_bits[i], 1, 1,
&mpc8_q2_codes[i], 1, 1, INIT_VLC_USE_STATIC);
init_vlc(&quant_vlc[0][i], MPC8_Q5_BITS, MPC8_Q5_SIZE,
&mpc8_q5_bits[i], 1, 1,
&mpc8_q5_codes[i], 1, 1, INIT_VLC_USE_STATIC);
init_vlc(&quant_vlc[1][i], MPC8_Q6_BITS, MPC8_Q6_SIZE,
&mpc8_q6_bits[i], 1, 1,
&mpc8_q6_codes[i], 1, 1, INIT_VLC_USE_STATIC);
init_vlc(&quant_vlc[2][i], MPC8_Q7_BITS, MPC8_Q7_SIZE,
&mpc8_q7_bits[i], 1, 1,
&mpc8_q7_codes[i], 1, 1, INIT_VLC_USE_STATIC);
init_vlc(&quant_vlc[3][i], MPC8_Q8_BITS, MPC8_Q8_SIZE,
&mpc8_q8_bits[i], 1, 1,
&mpc8_q8_codes[i], 1, 1, INIT_VLC_USE_STATIC);
}
vlc_initialized = 1;
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0;
}
static int mpc8_decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
const uint8_t * buf, int buf_size)
{
MPCContext *c = avctx->priv_data;
GetBitContext gb2, *gb = &gb2;
int i, j, k, ch, cnt, res, t;
Band *bands = c->bands;
int off;
int maxband, keyframe;
int last[2];
keyframe = c->cur_frame == 0;
if(keyframe){
memset(c->Q, 0, sizeof(c->Q));
c->last_bits_used = 0;
}
init_get_bits(gb, buf, buf_size * 8);
skip_bits(gb, c->last_bits_used & 7);
if(keyframe)
maxband = mpc8_get_mod_golomb(gb, c->maxbands + 1);
else{
maxband = c->last_max_band + get_vlc2(gb, band_vlc.table, MPC8_BANDS_BITS, 2);
if(maxband > 32) maxband -= 33;
}
c->last_max_band = maxband;
/* read subband indexes */
if(maxband){
last[0] = last[1] = 0;
for(i = maxband - 1; i >= 0; i--){
for(ch = 0; ch < 2; ch++){
last[ch] = get_vlc2(gb, res_vlc[last[ch] > 2].table, MPC8_RES_BITS, 2) + last[ch];
if(last[ch] > 15) last[ch] -= 17;
bands[i].res[ch] = last[ch];
}
}
if(c->MSS){
int mask;
cnt = 0;
for(i = 0; i < maxband; i++)
if(bands[i].res[0] || bands[i].res[1])
cnt++;
t = mpc8_get_mod_golomb(gb, cnt);
mask = mpc8_get_mask(gb, cnt, t);
for(i = maxband - 1; i >= 0; i--)
if(bands[i].res[0] || bands[i].res[1]){
bands[i].msf = mask & 1;
mask >>= 1;
}
}
}
for(i = maxband; i < c->maxbands; i++)
bands[i].res[0] = bands[i].res[1] = 0;
if(keyframe){
for(i = 0; i < 32; i++)
c->oldDSCF[0][i] = c->oldDSCF[1][i] = 1;
}
for(i = 0; i < maxband; i++){
if(bands[i].res[0] || bands[i].res[1]){
cnt = !!bands[i].res[0] + !!bands[i].res[1] - 1;
if(cnt >= 0){
t = get_vlc2(gb, scfi_vlc[cnt].table, scfi_vlc[cnt].bits, 1);
if(bands[i].res[0]) bands[i].scfi[0] = t >> (2 * cnt);
if(bands[i].res[1]) bands[i].scfi[1] = t & 3;
}
}
}
for(i = 0; i < maxband; i++){
for(ch = 0; ch < 2; ch++){
if(!bands[i].res[ch]) continue;
if(c->oldDSCF[ch][i]){
bands[i].scf_idx[ch][0] = get_bits(gb, 7) - 6;
c->oldDSCF[ch][i] = 0;
}else{
t = get_vlc2(gb, dscf_vlc[1].table, MPC8_DSCF1_BITS, 2);
if(t == 64)
t += get_bits(gb, 6);
bands[i].scf_idx[ch][0] = ((bands[i].scf_idx[ch][2] + t - 25) & 0x7F) - 6;
}
for(j = 0; j < 2; j++){
if((bands[i].scfi[ch] << j) & 2)
bands[i].scf_idx[ch][j + 1] = bands[i].scf_idx[ch][j];
else{
t = get_vlc2(gb, dscf_vlc[0].table, MPC8_DSCF0_BITS, 2);
if(t == 31)
t = 64 + get_bits(gb, 6);
bands[i].scf_idx[ch][j + 1] = ((bands[i].scf_idx[ch][j] + t - 25) & 0x7F) - 6;
}
}
}
}
for(i = 0, off = 0; i < maxband; i++, off += SAMPLES_PER_BAND){
for(ch = 0; ch < 2; ch++){
res = bands[i].res[ch];
switch(res){
case -1:
for(j = 0; j < SAMPLES_PER_BAND; j++)
c->Q[ch][off + j] = (av_random(&c->rnd) & 0x3FC) - 510;
break;
case 0:
break;
case 1:
for(j = 0; j < SAMPLES_PER_BAND; j += SAMPLES_PER_BAND / 2){
cnt = get_vlc2(gb, q1_vlc.table, MPC8_Q1_BITS, 2);
t = mpc8_get_mask(gb, 18, cnt);
for(k = 0; k < SAMPLES_PER_BAND / 2; k++, t <<= 1)
c->Q[ch][off + j + k] = (t & 0x20000) ? (get_bits1(gb) << 1) - 1 : 0;
}
break;
case 2:
cnt = 6;//2*mpc8_thres[res]
for(j = 0; j < SAMPLES_PER_BAND; j += 3){
t = get_vlc2(gb, q2_vlc[cnt > 3].table, MPC8_Q2_BITS, 2);
c->Q[ch][off + j + 0] = mpc8_idx50[t];
c->Q[ch][off + j + 1] = mpc8_idx51[t];
c->Q[ch][off + j + 2] = mpc8_idx52[t];
cnt = (cnt >> 1) + mpc8_huffq2[t];
}
break;
case 3:
case 4:
for(j = 0; j < SAMPLES_PER_BAND; j += 2){
t = get_vlc2(gb, q3_vlc[res - 3].table, MPC8_Q3_BITS, 2) + q3_offsets[res - 3];
c->Q[ch][off + j + 1] = t >> 4;
c->Q[ch][off + j + 0] = (t & 8) ? (t & 0xF) - 16 : (t & 0xF);
}
break;
case 5:
case 6:
case 7:
case 8:
cnt = 2 * mpc8_thres[res];
for(j = 0; j < SAMPLES_PER_BAND; j++){
t = get_vlc2(gb, quant_vlc[res - 5][cnt > mpc8_thres[res]].table, quant_vlc[res - 5][cnt > mpc8_thres[res]].bits, 2) + quant_offsets[res - 5];
c->Q[ch][off + j] = t;
cnt = (cnt >> 1) + FFABS(c->Q[ch][off + j]);
}
break;
default:
for(j = 0; j < SAMPLES_PER_BAND; j++){
c->Q[ch][off + j] = get_vlc2(gb, q9up_vlc.table, MPC8_Q9UP_BITS, 2);
if(res != 9){
c->Q[ch][off + j] <<= res - 9;
c->Q[ch][off + j] |= get_bits(gb, res - 9);
}
c->Q[ch][off + j] -= (1 << (res - 2)) - 1;
}
}
}
}
ff_mpc_dequantize_and_synth(c, maxband, data);
c->cur_frame++;
c->last_bits_used = get_bits_count(gb);
if(c->cur_frame >= c->frames)
c->cur_frame = 0;
*data_size = MPC_FRAME_SIZE * 4;
return c->cur_frame ? c->last_bits_used >> 3 : buf_size;
}
AVCodec mpc8_decoder = {
"mpc8",
CODEC_TYPE_AUDIO,
CODEC_ID_MUSEPACK8,
sizeof(MPCContext),
mpc8_decode_init,
NULL,
NULL,
mpc8_decode_frame,
.long_name = NULL_IF_CONFIG_SMALL("Musepack SV8"),
};
@@ -0,0 +1,121 @@
/*
* Musepack SV8 decoder
* Copyright (c) 2007 Konstantin Shishkov
*
* 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 FFMPEG_MPC8DATA_H
#define FFMPEG_MPC8DATA_H
#include <stdint.h>
static const int8_t mpc8_idx50[125] = {
-2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2,
-2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2,
-2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2,
-2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2,
-2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2
};
static const int8_t mpc8_idx51[125] = {
-2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
-2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
-2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
-2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
-2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2
};
static const int8_t mpc8_idx52[125] = {
-2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
};
static const unsigned int mpc8_thres[] = {0, 0, 3, 0, 0, 1, 3, 4, 8};
static const int8_t mpc8_huffq2[5*5*5] = {
6, 5, 4, 5, 6, 5, 4, 3, 4, 5, 4, 3, 2, 3, 4, 5, 4, 3, 4, 5, 6, 5, 4, 5,
6, 5, 4, 3, 4, 5, 4, 3, 2, 3, 4, 3, 2, 1, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3,
4, 5, 4, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 2, 3, 4, 3,
2, 3, 4, 5, 4, 3, 4, 5, 4, 3, 2, 3, 4, 3, 2, 1, 2, 3, 4, 3, 2, 3, 4, 5,
4, 3, 4, 5, 6, 5, 4, 5, 6, 5, 4, 3, 4, 5, 4, 3, 2, 3, 4, 5, 4, 3, 4, 5,
6, 5, 4, 5, 6
};
static const uint32_t mpc8_cnk[16][32] =
{
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31},
{0, 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465},
{0, 0, 0, 1, 4, 10, 20, 35, 56, 84, 120, 165, 220, 286, 364, 455, 560, 680, 816, 969, 1140, 1330, 1540, 1771, 2024, 2300, 2600, 2925, 3276, 3654, 4060, 4495},
{0, 0, 0, 0, 1, 5, 15, 35, 70, 126, 210, 330, 495, 715, 1001, 1365, 1820, 2380, 3060, 3876, 4845, 5985, 7315, 8855, 10626, 12650, 14950, 17550, 20475, 23751, 27405, 31465},
{0, 0, 0, 0, 0, 1, 6, 21, 56, 126, 252, 462, 792, 1287, 2002, 3003, 4368, 6188, 8568, 11628, 15504, 20349, 26334, 33649, 42504, 53130, 65780, 80730, 98280, 118755, 142506, 169911},
{0, 0, 0, 0, 0, 0, 1, 7, 28, 84, 210, 462, 924, 1716, 3003, 5005, 8008, 12376, 18564, 27132, 38760, 54264, 74613, 100947, 134596, 177100, 230230, 296010, 376740, 475020, 593775, 736281},
{0, 0, 0, 0, 0, 0, 0, 1, 8, 36, 120, 330, 792, 1716, 3432, 6435, 11440, 19448, 31824, 50388, 77520, 116280, 170544, 245157, 346104, 480700, 657800, 888030, 1184040, 1560780, 2035800, 2629575},
{0, 0, 0, 0, 0, 0, 0, 0, 1, 9, 45, 165, 495, 1287, 3003, 6435, 12870, 24310, 43758, 75582, 125970, 203490, 319770, 490314, 735471, 1081575, 1562275, 2220075, 3108105, 4292145, 5852925, 7888725},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 10, 55, 220, 715, 2002, 5005, 11440, 24310, 48620, 92378, 167960, 293930, 497420, 817190, 1307504, 2042975, 3124550, 4686825, 6906900, 10015005, 14307150, 20160075},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11, 66, 286, 1001, 3003, 8008, 19448, 43758, 92378, 184756, 352716, 646646, 1144066, 1961256, 3268760, 5311735, 8436285, 13123110, 20030010, 30045015, 44352165},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 78, 364, 1365, 4368, 12376, 31824, 75582, 167960, 352716, 705432, 1352078, 2496144, 4457400, 7726160, 13037895, 21474180, 34597290, 54627300, 84672315},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 13, 91, 455, 1820, 6188, 18564, 50388, 125970, 293930, 646646, 1352078, 2704156, 5200300, 9657700, 17383860, 30421755, 51895935, 86493225, 141120525},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 14, 105, 560, 2380, 8568, 27132, 77520, 203490, 497420, 1144066, 2496144, 5200300, 10400600, 20058300, 37442160, 67863915, 119759850, 206253075},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 15, 120, 680, 3060, 11628, 38760, 116280, 319770, 817190, 1961256, 4457400, 9657700, 20058300, 40116600, 77558760, 145422675, 265182525},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 16, 136, 816, 3876, 15504, 54264, 170544, 490314, 1307504, 3268760, 7726160, 17383860, 37442160, 77558760, 155117520, 300540195},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 153, 969, 4845, 20349, 74613, 245157, 735471, 2042975, 5311735, 13037895, 30421755, 67863915, 145422675, 300540195}
};
const static uint8_t mpc8_cnk_len[16][33] =
{
{0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6},
{0, 0, 2, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0},
{0, 0, 0, 2, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 0},
{0, 0, 0, 0, 3, 4, 6, 7, 7, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 0},
{0, 0, 0, 0, 0, 3, 5, 6, 7, 8, 9, 10, 11, 11, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 0},
{0, 0, 0, 0, 0, 0, 3, 5, 7, 8, 9, 10, 11, 12, 13, 13, 14, 15, 15, 16, 16, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 0},
{0, 0, 0, 0, 0, 0, 0, 3, 6, 7, 9, 10, 11, 12, 13, 14, 15, 15, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 8, 9, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 22, 23, 23, 23, 24, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 8, 10, 11, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 21, 22, 23, 23, 24, 24, 25, 25, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 9, 10, 12, 13, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 24, 25, 25, 26, 26, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 9, 11, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 23, 24, 25, 26, 26, 27, 27, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 9, 11, 13, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 25, 26, 27, 28, 28, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 10, 12, 14, 15, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 27, 28, 29, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 10, 12, 14, 16, 17, 19, 20, 21, 23, 24, 25, 26, 27, 28, 28, 29, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 8, 10, 12, 14, 16, 18, 19, 21, 22, 23, 25, 26, 27, 28, 29, 30, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 10, 13, 15, 17, 18, 20, 21, 23, 24, 25, 27, 28, 29, 30, 0}
};
const static uint32_t mpc8_cnk_lost[16][33] =
{
{0, 0, 1, 0, 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 31},
{0, 0, 1, 2, 6, 1, 11, 4, 28, 19, 9, 62, 50, 37, 23, 8, 120, 103, 85, 66, 46, 25, 3, 236, 212, 187, 161, 134, 106, 77, 47, 16, 0},
{0, 0, 0, 0, 6, 12, 29, 8, 44, 8, 91, 36, 226, 148, 57, 464, 344, 208, 55, 908, 718, 508, 277, 24, 1796, 1496, 1171, 820, 442, 36, 3697, 3232, 0},
{0, 0, 0, 0, 3, 1, 29, 58, 2, 46, 182, 17, 309, 23, 683, 228, 1716, 1036, 220, 3347, 2207, 877, 7529, 5758, 3734, 1434, 15218, 12293, 9017, 5363, 1303, 29576, 0},
{0, 0, 0, 0, 0, 2, 11, 8, 2, 4, 50, 232, 761, 46, 1093, 3824, 2004, 7816, 4756, 880, 12419, 6434, 31887, 23032, 12406, 65292, 50342, 32792, 12317, 119638, 92233, 60768, 0},
{0, 0, 0, 0, 0, 0, 1, 4, 44, 46, 50, 100, 332, 1093, 3187, 184, 4008, 14204, 5636, 26776, 11272, 56459, 30125, 127548, 85044, 31914, 228278, 147548, 49268, 454801, 312295, 142384, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 28, 8, 182, 232, 332, 664, 1757, 4944, 13320, 944, 15148, 53552, 14792, 91600, 16987, 178184, 43588, 390776, 160546, 913112, 536372, 61352, 1564729, 828448, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 7, 19, 91, 17, 761, 1093, 1757, 3514, 8458, 21778, 55490, 5102, 58654, 204518, 33974, 313105, 1015577, 534877, 1974229, 1086199, 4096463, 2535683, 499883, 6258916, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 9, 36, 309, 46, 3187, 4944, 8458, 16916, 38694, 94184, 230358, 26868, 231386, 789648, 54177, 1069754, 3701783, 1481708, 6762211, 2470066, 13394357, 5505632, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 62, 226, 23, 1093, 184, 13320, 21778, 38694, 77388, 171572, 401930, 953086, 135896, 925544, 3076873, 8340931, 3654106, 13524422, 3509417, 22756699, 2596624, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 50, 148, 683, 3824, 4008, 944, 55490, 94184, 171572, 343144, 745074, 1698160, 3931208, 662448, 3739321, 12080252, 32511574, 12481564, 49545413, 5193248, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 37, 57, 228, 2004, 14204, 15148, 5102, 230358, 401930, 745074, 1490148, 3188308, 7119516, 16170572, 3132677, 15212929, 47724503, 127314931, 42642616, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 23, 464, 1716, 7816, 5636, 53552, 58654, 26868, 953086, 1698160, 3188308, 6376616, 13496132, 29666704, 66353813, 14457878, 62182381, 189497312, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 8, 344, 1036, 4756, 26776, 14792, 204518, 231386, 135896, 3931208, 7119516, 13496132, 26992264, 56658968, 123012781, 3252931, 65435312, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 208, 220, 880, 11272, 91600, 33974, 789648, 925544, 662448, 16170572, 29666704, 56658968, 113317936, 236330717, 508019104, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 103, 55, 3347, 12419, 56459, 16987, 313105, 54177, 3076873, 3739321, 3132677, 66353813, 123012781, 236330717, 0}
};
#endif /* FFMPEG_MPC8DATA_H */
@@ -0,0 +1,578 @@
/*
* Musepack SV8 decoder
* Copyright (c) 2007 Konstantin Shishkov
*
* 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 FFMPEG_MPC8HUFF_H
#define FFMPEG_MPC8HUFF_H
#include <stdint.h>
#define MPC8_BANDS_SIZE 33
#define MPC8_BANDS_BITS 9
static const uint8_t mpc8_bands_codes[MPC8_BANDS_SIZE] = {
0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04,
0x05, 0x06, 0x01, 0x02, 0x03, 0x00, 0x04, 0x05,
0x06, 0x07, 0x08, 0x01, 0x09, 0x0A, 0x0B, 0x07,
0x08, 0x09, 0x06, 0x07, 0x05, 0x05, 0x03, 0x03,
0x01,
};
static const int8_t mpc8_bands_bits[MPC8_BANDS_SIZE] = {
1, 3, 5, 6, 7, 8, 8, 9,
10, 11, 12, 12, 12, 13, 12, 12,
12, 12, 12, 13, 12, 12, 12, 11,
11, 11, 10, 10, 9, 8, 6, 5,
2,
};
#define MPC8_SCFI0_SIZE 4
#define MPC8_SCFI0_BITS 3
static const uint8_t mpc8_scfi0_codes[MPC8_SCFI0_SIZE] = {
0x00, 0x01, 0x01, 0x01,
};
static const int8_t mpc8_scfi0_bits[MPC8_SCFI0_SIZE] = {
3, 3, 1, 2,
};
#define MPC8_SCFI1_SIZE 16
#define MPC8_SCFI1_BITS 7
static const uint8_t mpc8_scfi1_codes[MPC8_SCFI1_SIZE] = {
0x01, 0x00, 0x02, 0x03, 0x01, 0x03, 0x04, 0x05,
0x04, 0x06, 0x02, 0x02, 0x05, 0x07, 0x03, 0x03,
};
static const int8_t mpc8_scfi1_bits[MPC8_SCFI1_SIZE] = {
6, 7, 6, 6, 7, 5, 5, 5,
6, 5, 2, 3, 6, 5, 3, 2,
};
#define MPC8_DSCF0_SIZE 64
#define MPC8_DSCF0_BITS 9
static const uint8_t mpc8_dscf0_codes[MPC8_DSCF0_SIZE] = {
0x03, 0x04, 0x05, 0x04, 0x05, 0x06, 0x05, 0x06,
0x07, 0x08, 0x09, 0x07, 0x08, 0x09, 0x0A, 0x07,
0x08, 0x09, 0x0A, 0x07, 0x08, 0x09, 0x0A, 0x06,
0x07, 0x05, 0x04, 0x05, 0x06, 0x06, 0x07, 0x0A,
0x08, 0x05, 0x06, 0x07, 0x09, 0x07, 0x08, 0x09,
0x0B, 0x0B, 0x0C, 0x0D, 0x0B, 0x0C, 0x0D, 0x0B,
0x0C, 0x0D, 0x07, 0x08, 0x09, 0x06, 0x07, 0x03,
0x04, 0x05, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
};
static const int8_t mpc8_dscf0_bits[MPC8_DSCF0_SIZE] = {
12, 12, 12, 11, 11, 11, 10, 10,
10, 10, 10, 9, 9, 9, 9, 8,
8, 8, 8, 7, 7, 7, 7, 6,
6, 5, 4, 4, 5, 4, 4, 10,
4, 3, 3, 3, 4, 5, 6, 6,
7, 8, 8, 8, 9, 9, 9, 10,
10, 10, 11, 11, 11, 12, 12, 13,
13, 13, 14, 14, 14, 14, 14, 14,
};
#define MPC8_DSCF1_SIZE 65
#define MPC8_DSCF1_BITS 9
static const uint8_t mpc8_dscf1_codes[MPC8_DSCF1_SIZE] = {
0x00, 0x03, 0x04, 0x04, 0x05, 0x06, 0x05, 0x06,
0x07, 0x08, 0x07, 0x08, 0x09, 0x0A, 0x07, 0x08,
0x09, 0x0A, 0x07, 0x08, 0x09, 0x06, 0x07, 0x05,
0x06, 0x04, 0x03, 0x03, 0x04, 0x03, 0x04, 0x05,
0x06, 0x07, 0x05, 0x04, 0x05, 0x05, 0x07, 0x08,
0x09, 0x0A, 0x0B, 0x0B, 0x0C, 0x0D, 0x0B, 0x0C,
0x0D, 0x09, 0x0A, 0x0B, 0x0C, 0x07, 0x08, 0x09,
0x05, 0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05,
0x0D,
};
static const int8_t mpc8_dscf1_bits[MPC8_DSCF1_SIZE] = {
15, 14, 14, 13, 13, 13, 12, 12,
12, 12, 11, 11, 11, 11, 10, 10,
10, 10, 9, 9, 9, 8, 8, 7,
7, 6, 5, 4, 4, 3, 3, 3,
3, 3, 4, 5, 5, 6, 7, 8,
8, 9, 9, 10, 10, 10, 11, 11,
11, 12, 12, 12, 12, 13, 13, 13,
14, 14, 14, 15, 15, 15, 15, 15,
12,
};
#define MPC8_RES_SIZE 17
#define MPC8_RES_BITS 9
static const uint8_t mpc8_res_codes[2][MPC8_RES_SIZE] = {
{
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01,
0x01,
},
{
0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x00, 0x01, 0x02, 0x03, 0x01, 0x01, 0x01, 0x01,
0x03,
}
};
static const int8_t mpc8_res_bits[2][MPC8_RES_SIZE] = {
{
1, 2, 4, 5, 6, 7, 9, 10,
11, 12, 13, 14, 15, 16, 16, 8,
3,
},
{
2, 2, 3, 5, 7, 8, 10, 12,
14, 14, 14, 14, 11, 9, 6, 4,
2,
}
};
#define MPC8_Q1_SIZE 19
#define MPC8_Q1_BITS 9
static const uint8_t mpc8_q1_codes[MPC8_Q1_SIZE] = {
0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x03, 0x04, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x00, 0x01,
};
static const int8_t mpc8_q1_bits[MPC8_Q1_SIZE] = {
6, 4, 4, 3, 3, 3, 3, 3,
4, 4, 4, 5, 7, 8, 9, 10,
11, 12, 12,
};
#define MPC8_Q9UP_SIZE 256
#define MPC8_Q9UP_BITS 9
static const uint8_t mpc8_q9up_codes[MPC8_Q9UP_SIZE] = {
0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
0x10, 0x11, 0x12, 0x26, 0x27, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D,
0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x28, 0x26, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E,
0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E,
0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46,
0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E,
0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56,
0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E,
0x5F, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
0x67, 0x68, 0x69, 0x6A, 0x56, 0x57, 0x58, 0x59,
0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x61,
0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x3E,
0x3F, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
0x78, 0x79, 0x7A, 0x6B, 0x7B, 0x6C, 0x6D, 0x6E,
0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76,
0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E,
0x7F, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86,
0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E,
0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E,
0x9F, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6,
0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0x27, 0x28, 0x29,
0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31,
0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41,
0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
0x4A, 0x4B, 0x06, 0x07, 0x08, 0x09, 0x00, 0x01,
};
static const int8_t mpc8_q9up_bits[MPC8_Q9UP_SIZE] = {
10, 10, 10, 10, 10, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 8, 8, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
8, 9, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 6,
6, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 8, 7, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 10, 10, 10, 10, 11, 11,
};
#define MPC8_Q2_SIZE 125
#define MPC8_Q2_BITS 9
static const uint8_t mpc8_q2_codes[2][MPC8_Q2_SIZE] = {
{
0x02, 0x03, 0x0F, 0x04, 0x00, 0x05, 0x0C, 0x12,
0x0D, 0x06, 0x07, 0x13, 0x15, 0x14, 0x08, 0x09,
0x0E, 0x15, 0x0F, 0x0A, 0x03, 0x0B, 0x10, 0x0C,
0x01, 0x0D, 0x10, 0x16, 0x11, 0x0E, 0x12, 0x0F,
0x10, 0x16, 0x13, 0x17, 0x11, 0x08, 0x12, 0x18,
0x14, 0x13, 0x14, 0x17, 0x15, 0x0F, 0x16, 0x19,
0x17, 0x10, 0x11, 0x1A, 0x18, 0x1B, 0x12, 0x1C,
0x15, 0x09, 0x16, 0x1D, 0x19, 0x0A, 0x07, 0x0B,
0x1A, 0x1E, 0x17, 0x0C, 0x18, 0x1F, 0x13, 0x20,
0x1B, 0x21, 0x14, 0x11, 0x18, 0x22, 0x19, 0x12,
0x1A, 0x19, 0x1A, 0x1B, 0x1B, 0x23, 0x1C, 0x0D,
0x1D, 0x24, 0x1C, 0x1C, 0x1E, 0x1F, 0x1D, 0x13,
0x1E, 0x25, 0x1F, 0x14, 0x02, 0x15, 0x15, 0x16,
0x04, 0x17, 0x20, 0x26, 0x21, 0x18, 0x16, 0x27,
0x1D, 0x28, 0x19, 0x1A, 0x22, 0x29, 0x23, 0x1B,
0x03, 0x1C, 0x17, 0x1D, 0x05,
},
{
0x02, 0x03, 0x0F, 0x04, 0x00, 0x05, 0x0C, 0x0D,
0x0E, 0x06, 0x07, 0x0F, 0x1E, 0x10, 0x10, 0x08,
0x11, 0x12, 0x13, 0x09, 0x03, 0x0A, 0x11, 0x0B,
0x01, 0x0C, 0x14, 0x15, 0x16, 0x0D, 0x17, 0x12,
0x0E, 0x13, 0x18, 0x19, 0x14, 0x0F, 0x10, 0x1A,
0x1B, 0x15, 0x11, 0x16, 0x1C, 0x0E, 0x1D, 0x1E,
0x1F, 0x0F, 0x12, 0x20, 0x1F, 0x21, 0x13, 0x22,
0x12, 0x13, 0x14, 0x23, 0x20, 0x15, 0x0F, 0x16,
0x21, 0x24, 0x17, 0x18, 0x19, 0x25, 0x14, 0x26,
0x22, 0x27, 0x15, 0x10, 0x28, 0x29, 0x2A, 0x11,
0x2B, 0x17, 0x1A, 0x18, 0x2C, 0x2D, 0x1B, 0x1C,
0x19, 0x2E, 0x2F, 0x1A, 0x1D, 0x1B, 0x30, 0x12,
0x31, 0x32, 0x33, 0x13, 0x02, 0x14, 0x15, 0x16,
0x04, 0x17, 0x34, 0x35, 0x36, 0x18, 0x16, 0x37,
0x23, 0x38, 0x19, 0x1A, 0x39, 0x3A, 0x3B, 0x1B,
0x03, 0x1C, 0x17, 0x1D, 0x05,
}
};
static const int8_t mpc8_q2_bits[2][MPC8_Q2_SIZE] = {
{
12, 11, 10, 11, 13, 11, 9, 8,
9, 11, 11, 8, 7, 8, 11, 11,
9, 8, 9, 11, 12, 11, 10, 11,
13, 11, 9, 8, 9, 11, 9, 6,
6, 7, 9, 8, 6, 4, 6, 8,
9, 6, 6, 7, 9, 11, 9, 8,
9, 11, 10, 8, 7, 8, 10, 8,
6, 4, 6, 8, 7, 4, 3, 4,
7, 8, 6, 4, 6, 8, 10, 8,
7, 8, 10, 11, 9, 8, 9, 11,
9, 6, 6, 6, 9, 8, 6, 4,
6, 8, 9, 7, 6, 6, 9, 11,
9, 8, 9, 11, 13, 11, 10, 11,
12, 11, 9, 8, 9, 11, 10, 8,
7, 8, 11, 11, 9, 8, 9, 11,
13, 11, 10, 11, 12,
},
{
11, 10, 9, 10, 12, 10, 8, 8,
8, 10, 10, 8, 7, 8, 9, 10,
8, 8, 8, 10, 11, 10, 9, 10,
12, 10, 8, 8, 8, 10, 8, 6,
5, 6, 8, 8, 6, 5, 5, 8,
8, 6, 5, 6, 8, 10, 8, 8,
8, 10, 9, 8, 7, 8, 9, 8,
5, 5, 5, 8, 7, 5, 4, 5,
7, 8, 5, 5, 5, 8, 9, 8,
7, 8, 9, 10, 8, 8, 8, 10,
8, 6, 5, 6, 8, 8, 5, 5,
6, 8, 8, 6, 5, 6, 8, 10,
8, 8, 8, 10, 12, 10, 10, 10,
11, 10, 8, 8, 8, 10, 9, 8,
7, 8, 10, 10, 8, 8, 8, 10,
12, 10, 9, 10, 11,
}
};
#define MPC8_Q3_SIZE 49
#define MPC8_Q3_BITS 9
#define MPC8_Q3_OFFSET -48
static const uint8_t mpc8_q3_codes[MPC8_Q3_SIZE] = {
0x07, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x0F,
0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x13, 0x12, 0x11,
0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09,
0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A,
0x09, 0x08, 0x07, 0x06, 0x05, 0x09, 0x08, 0x07,
0x06, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x01,
0x00,
};
static const int8_t mpc8_q3_bits[MPC8_Q3_SIZE] = {
3, 4, 4, 4, 4, 4, 4, 5,
5, 5, 5, 5, 5, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6,
7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 8, 8, 8,
8, 8, 8, 8, 8, 9, 9, 9,
9,
};
static const int8_t mpc8_q3_syms[MPC8_Q3_SIZE] = {
48, 65, 64, 49, 63, 32, 47, 80,
79, 50, 62, 33, 16, 82, 81, 95,
94, 66, 78, 34, 46, 17, 31, 30,
97, 96, 111, 67, 77, 51, 61, 35,
45, 18, 1, 0, 15, 98, 110, 83,
93, 19, 29, 2, 14, 99, 109, 3,
13,
};
#define MPC8_Q4_SIZE 81
#define MPC8_Q4_BITS 9
#define MPC8_Q4_OFFSET -64
static const uint8_t mpc8_q4_codes[MPC8_Q4_SIZE] = {
0x0F, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17,
0x16, 0x15, 0x14, 0x13, 0x12, 0x23, 0x22, 0x21,
0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19,
0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11,
0x10, 0x0F, 0x0E, 0x0D, 0x19, 0x18, 0x17, 0x16,
0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E,
0x0D, 0x0C, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12,
0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A,
0x09, 0x08, 0x07, 0x06, 0x05, 0x09, 0x08, 0x07,
0x06, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x01,
0x00,
};
static const int8_t mpc8_q4_bits[MPC8_Q4_SIZE] = {
4, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 9, 9, 9,
9, 9, 9, 9, 9, 10, 10, 10,
10,
};
static const int8_t mpc8_q4_syms[MPC8_Q4_SIZE] = {
64, 96, 81, 80, 95, 66, 65, 79,
78, 49, 48, 63, 32, 113, 112, 98,
97, 111, 110, 83, 82, 94, 93, 67,
77, 51, 50, 62, 61, 34, 33, 47,
46, 17, 16, 31, 128, 114, 127, 126,
99, 109, 68, 76, 35, 45, 18, 30,
0, 15, 130, 129, 143, 142, 115, 125,
100, 108, 84, 92, 52, 60, 36, 44,
19, 29, 2, 1, 14, 131, 141, 116,
124, 20, 28, 3, 13, 132, 140, 4,
12,
};
#define MPC8_Q5_SIZE 15
#define MPC8_Q5_BITS 7
#define MPC8_Q5_OFFSET -7
static const uint8_t mpc8_q5_codes[2][MPC8_Q5_SIZE] = {
{
0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03,
0x04, 0x05, 0x03, 0x03, 0x03, 0x02, 0x03,
},
{
0x00, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x05,
0x06, 0x07, 0x04, 0x05, 0x03, 0x02, 0x03,
}
};
static const int8_t mpc8_q5_bits[2][MPC8_Q5_SIZE] = {
{
7, 7, 6, 5, 4, 3, 3, 2,
3, 3, 4, 5, 6, 7, 7,
},
{
6, 6, 5, 4, 4, 3, 3, 3,
3, 3, 4, 4, 5, 6, 6,
}
};
#define MPC8_Q6_SIZE 31
#define MPC8_Q6_BITS 9
#define MPC8_Q6_OFFSET -15
static const uint8_t mpc8_q6_codes[2][MPC8_Q6_SIZE] = {
{
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x04, 0x03,
0x04, 0x05, 0x05, 0x06, 0x04, 0x05, 0x04, 0x03,
0x05, 0x06, 0x07, 0x07, 0x06, 0x07, 0x08, 0x09,
0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07,
},
{
0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x05, 0x04,
0x05, 0x06, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x07, 0x08, 0x09,
0x06, 0x07, 0x05, 0x06, 0x07, 0x02, 0x03,
}
};
static const int8_t mpc8_q6_bits[2][MPC8_Q6_SIZE] = {
{
9, 9, 9, 9, 8, 8, 7, 6,
6, 6, 5, 5, 4, 4, 3, 2,
3, 4, 4, 5, 6, 6, 6, 6,
7, 8, 8, 9, 9, 9, 9,
},
{
8, 8, 7, 7, 7, 6, 6, 5,
5, 5, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 5, 5, 5,
6, 6, 7, 7, 7, 8, 8,
}
};
#define MPC8_Q7_SIZE 63
#define MPC8_Q7_BITS 9
#define MPC8_Q7_OFFSET -31
static const uint8_t mpc8_q7_codes[2][MPC8_Q7_SIZE] = {
{
0x00, 0x01, 0x02, 0x08, 0x09, 0x03, 0x04, 0x05,
0x06, 0x07, 0x0A, 0x0B, 0x0C, 0x0D, 0x0A, 0x0B,
0x0C, 0x0D, 0x0E, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
0x0A, 0x0B, 0x0C, 0x08, 0x09, 0x06, 0x04, 0x03,
0x05, 0x07, 0x0A, 0x0B, 0x0D, 0x0E, 0x0F, 0x0F,
0x10, 0x11, 0x12, 0x0F, 0x13, 0x10, 0x11, 0x12,
0x13, 0x0E, 0x0F, 0x10, 0x11, 0x08, 0x09, 0x0A,
0x0B, 0x0C, 0x12, 0x13, 0x0D, 0x0E, 0x0F,
},
{
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x09, 0x0A,
0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x0C, 0x0D,
0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D,
0x1E, 0x1F, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
0x17, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x09, 0x0A,
0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x02, 0x03,
}
};
static const int8_t mpc8_q7_bits[2][MPC8_Q7_SIZE] = {
{
10, 10, 10, 9, 9, 10, 10, 10,
10, 10, 9, 9, 9, 9, 8, 8,
8, 8, 8, 7, 7, 7, 7, 7,
6, 6, 6, 5, 5, 4, 3, 2,
3, 4, 5, 5, 6, 6, 6, 7,
7, 7, 7, 8, 7, 8, 8, 8,
8, 9, 9, 9, 9, 10, 10, 10,
10, 10, 9, 9, 10, 10, 10,
},
{
9, 9, 8, 8, 8, 8, 8, 8,
8, 7, 7, 7, 7, 7, 6, 6,
6, 6, 6, 6, 6, 6, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 6, 6, 6, 6, 6, 6,
6, 7, 7, 7, 7, 7, 8, 8,
8, 8, 8, 8, 8, 9, 9,
}
};
#define MPC8_Q8_SIZE 127
#define MPC8_Q8_BITS 9
#define MPC8_Q8_OFFSET -63
static const uint8_t mpc8_q8_codes[2][MPC8_Q8_SIZE] = {
{
0x03, 0x04, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x1A,
0x0F, 0x1B, 0x10, 0x00, 0x01, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0A, 0x0B, 0x11, 0x0C, 0x12, 0x13,
0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1C, 0x1A,
0x1B, 0x1C, 0x1D, 0x1E, 0x1D, 0x1E, 0x1F, 0x20,
0x21, 0x22, 0x23, 0x24, 0x19, 0x25, 0x1A, 0x1B,
0x1C, 0x1D, 0x1E, 0x1F, 0x14, 0x15, 0x16, 0x17,
0x0E, 0x0F, 0x10, 0x11, 0x0B, 0x07, 0x04, 0x03,
0x05, 0x0C, 0x0D, 0x12, 0x13, 0x14, 0x15, 0x18,
0x19, 0x1A, 0x1B, 0x20, 0x21, 0x22, 0x23, 0x24,
0x25, 0x26, 0x27, 0x26, 0x27, 0x28, 0x29, 0x2A,
0x2B, 0x2C, 0x2D, 0x2E, 0x1F, 0x20, 0x2F, 0x21,
0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
0x0D, 0x0E, 0x2A, 0x0F, 0x10, 0x11, 0x12, 0x02,
0x13, 0x03, 0x04, 0x05, 0x2B, 0x2C, 0x30, 0x31,
0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33,
},
{
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x15, 0x16,
0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E,
0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E,
0x2F, 0x30, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B,
0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33,
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B,
0x3C, 0x3D, 0x3E, 0x31, 0x3F, 0x32, 0x33, 0x34,
0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C,
0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44,
0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x16,
0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E,
0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x27, 0x28, 0x29, 0x04, 0x05, 0x06, 0x07,
}
};
static const int8_t mpc8_q8_bits[2][MPC8_Q8_SIZE] = {
{
11, 11, 10, 10, 10, 10, 10, 9,
10, 9, 10, 12, 12, 11, 11, 11,
11, 11, 11, 11, 10, 11, 10, 10,
10, 10, 10, 10, 10, 10, 9, 10,
10, 10, 10, 10, 9, 9, 9, 9,
9, 9, 9, 9, 8, 9, 8, 8,
8, 8, 8, 8, 7, 7, 7, 7,
6, 6, 6, 6, 5, 4, 3, 2,
3, 5, 5, 6, 6, 6, 6, 7,
7, 7, 7, 8, 8, 8, 8, 8,
8, 8, 8, 9, 9, 9, 9, 9,
9, 9, 9, 9, 10, 10, 9, 10,
10, 10, 10, 10, 10, 10, 10, 10,
11, 11, 10, 11, 11, 11, 11, 12,
11, 12, 12, 12, 10, 10, 9, 9,
10, 10, 10, 10, 10, 10, 10,
},
{
9, 9, 9, 9, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 7, 6, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 9, 9, 9, 9,
}
};
#endif /* FFMPEG_MPC8HUFF_H */
@@ -0,0 +1,68 @@
/*
* Musepack decoder
* Copyright (c) 2006 Konstantin Shishkov
*
* 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 FFMPEG_MPCDATA_H
#define FFMPEG_MPCDATA_H
#include <stdint.h>
static const float mpc_CC[18] = {
65536.0000, 21845.3333, 13107.2000, 9362.2857, 7281.7778, 4369.0667, 2114.0645,
1040.2539, 516.0315, 257.0039, 128.2505, 64.0626, 32.0156, 16.0039, 8.0010,
4.0002, 2.0001, 1.0000
};
static const float mpc_SCF[128] = {
307.330047607421875000, 255.999984741210937500, 213.243041992187500000, 177.627334594726562500,
147.960128784179687500, 123.247924804687500000, 102.663139343261718750, 85.516410827636718750,
71.233520507812500000, 59.336143493652343750, 49.425861358642578125, 41.170787811279296875,
34.294471740722656250, 28.566631317138671875, 23.795452117919921875, 19.821151733398437500,
16.510635375976562500, 13.753040313720703125, 11.456016540527343750, 9.542640686035156250,
7.948835372924804688, 6.621226310729980469, 5.515353679656982422, 4.594182968139648438,
3.826865673065185547, 3.187705039978027344, 2.655296564102172852, 2.211810588836669922,
1.842395424842834473, 1.534679770469665527, 1.278358578681945801, 1.064847946166992188,
0.886997759342193604, 0.738851964473724365, 0.615449428558349609, 0.512657463550567627,
0.427033752202987671, 0.355710864067077637, 0.296300262212753296, 0.246812388300895691,
0.205589950084686279, 0.171252459287643433, 0.142649993300437927, 0.118824683129787445,
0.098978661000728607, 0.082447312772274017, 0.068677015602588654, 0.057206626981496811,
0.047652013599872589, 0.039693206548690796, 0.033063672482967377, 0.027541399002075195,
0.022941453382372856, 0.019109787419438362, 0.015918083488941193, 0.013259455561637878,
0.011044870130717754, 0.009200163185596466, 0.007663558237254620, 0.006383595988154411,
0.005317411851137877, 0.004429301247000694, 0.003689522389322519, 0.003073300700634718,
0.002560000168159604, 0.002132430672645569, 0.001776273478753865, 0.001479601487517357,
0.001232479466125369, 0.001026631565764546, 0.000855164253152907, 0.000712335284333676,
0.000593361502978951, 0.000494258652906865, 0.000411707907915115, 0.000342944724252447,
0.000285666319541633, 0.000237954518524930, 0.000198211506358348, 0.000165106350323185,
0.000137530398205854, 0.000114560163638089, 0.000095426403277088, 0.000079488345363643,
0.000066212254751008, 0.000055153526773211, 0.000045941822463647, 0.000038268648495432,
0.000031877043511486, 0.000026552961571724, 0.000022118103515822, 0.000018423952496960,
0.000015346795407822, 0.000012783583770215, 0.000010648477655195, 0.000008869976227288,
0.000007388518497464, 0.000006154492893984, 0.000005126573796588, 0.000004270336830814,
0.000003557107902452, 0.000002963002089018, 0.000002468123511790, 0.000002055899130937,
0.000001712524181130, 0.000001426499579793, 0.000001188246528727, 0.000000989786371974,
0.000000824472920158, 0.000000686770022185, 0.000000572066142013, 0.000000476520028769,
0.000000396931966407, 0.000000330636652279, 0.000000275413924555, 0.000000229414467867,
0.000000191097811353, 0.000000159180785886, 0.000000132594522029, 0.000000110448674207,
0.000000092001613439, 0.000000076635565449, 0.000000063835940978, 0.000000053174105119,
0.000000044293003043, 0.000000036895215771, 0.000000030733001921, 0.000000025599996789
};
#endif /* FFMPEG_MPCDATA_H */