annotate ffmpeg/libavcodec/mpc.h @ 13:844d341cf643 tip

Back up before ISMIR
author Yading Song <yading.song@eecs.qmul.ac.uk>
date Thu, 31 Oct 2013 13:17:06 +0000
parents 6840f77b83aa
children
rev   line source
yading@10 1 /*
yading@10 2 * Musepack decoder
yading@10 3 * Copyright (c) 2006 Konstantin Shishkov
yading@10 4 *
yading@10 5 * This file is part of FFmpeg.
yading@10 6 *
yading@10 7 * FFmpeg is free software; you can redistribute it and/or
yading@10 8 * modify it under the terms of the GNU Lesser General Public
yading@10 9 * License as published by the Free Software Foundation; either
yading@10 10 * version 2.1 of the License, or (at your option) any later version.
yading@10 11 *
yading@10 12 * FFmpeg is distributed in the hope that it will be useful,
yading@10 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
yading@10 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
yading@10 15 * Lesser General Public License for more details.
yading@10 16 *
yading@10 17 * You should have received a copy of the GNU Lesser General Public
yading@10 18 * License along with FFmpeg; if not, write to the Free Software
yading@10 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
yading@10 20 */
yading@10 21
yading@10 22 /**
yading@10 23 * @file
yading@10 24 * Musepack decoder
yading@10 25 * MPEG Audio Layer 1/2 -like codec with frames of 1152 samples
yading@10 26 * divided into 32 subbands.
yading@10 27 */
yading@10 28
yading@10 29 #ifndef AVCODEC_MPC_H
yading@10 30 #define AVCODEC_MPC_H
yading@10 31
yading@10 32 #include "libavutil/lfg.h"
yading@10 33 #include "avcodec.h"
yading@10 34 #include "get_bits.h"
yading@10 35 #include "dsputil.h"
yading@10 36 #include "mpegaudio.h"
yading@10 37 #include "mpegaudiodsp.h"
yading@10 38
yading@10 39 #define BANDS 32
yading@10 40 #define SAMPLES_PER_BAND 36
yading@10 41 #define MPC_FRAME_SIZE (BANDS * SAMPLES_PER_BAND)
yading@10 42
yading@10 43 /** Subband structure - hold all variables for each subband */
yading@10 44 typedef struct Band {
yading@10 45 int msf; ///< mid-stereo flag
yading@10 46 int res[2];
yading@10 47 int scfi[2];
yading@10 48 int scf_idx[2][3];
yading@10 49 int Q[2];
yading@10 50 }Band;
yading@10 51
yading@10 52 typedef struct MPCContext {
yading@10 53 DSPContext dsp;
yading@10 54 MPADSPContext mpadsp;
yading@10 55 GetBitContext gb;
yading@10 56 int IS, MSS, gapless;
yading@10 57 int lastframelen;
yading@10 58 int maxbands, last_max_band;
yading@10 59 int last_bits_used;
yading@10 60 int oldDSCF[2][BANDS];
yading@10 61 Band bands[BANDS];
yading@10 62 int Q[2][MPC_FRAME_SIZE];
yading@10 63 int cur_frame, frames;
yading@10 64 uint8_t *bits;
yading@10 65 int buf_size;
yading@10 66 AVLFG rnd;
yading@10 67 int frames_to_skip;
yading@10 68 /* for synthesis */
yading@10 69 DECLARE_ALIGNED(16, MPA_INT, synth_buf)[MPA_MAX_CHANNELS][512*2];
yading@10 70 int synth_buf_offset[MPA_MAX_CHANNELS];
yading@10 71 DECLARE_ALIGNED(16, int32_t, sb_samples)[MPA_MAX_CHANNELS][36][SBLIMIT];
yading@10 72 } MPCContext;
yading@10 73
yading@10 74 void ff_mpc_init(void);
yading@10 75 void ff_mpc_dequantize_and_synth(MPCContext *c, int maxband, int16_t **out, int channels);
yading@10 76
yading@10 77 #endif /* AVCODEC_MPC_H */