66 for (
int j = 0; j < 2; j++) {
69 &raw_quant_table[1], 2,
70 &raw_quant_table[0], 2, 1,
95 memset(
c->oldDSCF, 0,
sizeof(
c->oldDSCF));
99 c->bdsp.bswap_buf((uint32_t *) buf, (
const uint32_t *) avctx->
extradata, 4);
113 c->IS,
c->MSS,
c->gapless,
c->lastframelen,
c->maxbands);
114 c->frames_to_skip = 0;
154 case 3:
case 4:
case 5:
case 6:
case 7:
159 case 8:
case 9:
case 10:
case 11:
case 12:
160 case 13:
case 14:
case 15:
case 16:
case 17:
161 t = (1 << (idx - 2)) - 1;
179 int *got_frame_ptr,
AVPacket *avpkt)
181 const uint8_t *buf = avpkt->
data;
188 int off, ret, last_frame,
skip;
189 int bits_used, bits_avail;
191 memset(
bands, 0,
sizeof(*
bands) * (
c->maxbands + 1));
193 buf_size = avpkt->
size & ~3;
199 if (buf_size != avpkt->
size) {
201 "extra bytes at the end will be skipped.\n");
217 c->bdsp.bswap_buf((uint32_t *)
c->bits, (
const uint32_t *) buf,
224 for(
i = 0;
i <=
c->maxbands;
i++){
225 for(ch = 0; ch < 2; ch++){
241 for(
i = 0;
i <=
mb;
i++)
242 for(ch = 0; ch < 2; ch++)
246 for(
i = 0;
i <=
mb;
i++){
247 for(ch = 0; ch < 2; ch++){
249 bands[
i].scf_idx[ch][2] =
c->oldDSCF[ch][
i];
251 switch(
bands[
i].scfi[ch]){
268 c->oldDSCF[ch][
i] =
bands[
i].scf_idx[ch][2];
273 memset(
c->Q, 0,
sizeof(
c->Q));
276 for(ch = 0; ch < 2; ch++)
281 frame->nb_samples =
c->lastframelen;
284 bits_avail = buf_size * 8;
285 if (!last_frame && ((bits_avail < bits_used) || (bits_used + 32 <= bits_avail))) {
286 av_log(avctx,
AV_LOG_ERROR,
"Error decoding frame: used %i of %i bits\n", bits_used, bits_avail);
289 if(
c->frames_to_skip){
304 memset(
c->oldDSCF, 0,
sizeof(
c->oldDSCF));
305 c->frames_to_skip = 32;
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static const float bands[]
const FFCodec ff_mpc7_decoder
static av_cold void close(AVCodecParserContext *s)
Libavcodec external API header.
static void BS_FUNC skip(BSCTX *bc, unsigned int n)
Skip n bits in the buffer.
#define i(width, name, range_min, range_max)
Public libavutil channel layout APIs header.
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int(* init)(AVBSFContext *ctx)
static struct @346255127015250356166251341105367306144006377143 state
bitstream reader API header.
static av_always_inline int get_vlc2(GetBitContext *s, const VLCElem *table, int bits, int max_depth)
Parse a vlc code.
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static unsigned int get_bits1(GetBitContext *s)
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static int get_bits_count(const GetBitContext *s)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
Same behaviour av_fast_malloc but the buffer has additional AV_INPUT_BUFFER_PADDING_SIZE at the end w...
#define AV_CHANNEL_LAYOUT_STEREO
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
av_cold void ff_bswapdsp_init(BswapDSPContext *c)
void ff_mpc_dequantize_and_synth(MPCContext *c, int maxband, int16_t **out, int channels)
Macro definitions for various function/variable attributes.
common internal API header
static int ff_thread_once(char *control, void(*routine)(void))
Memory handling functions.
#define LOCAL_ALIGNED_16(t, v,...)
static int mpc7_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
static av_cold int mpc7_decode_close(AVCodecContext *avctx)
static int get_scale_idx(GetBitContext *gb, int ref)
static av_cold int mpc7_decode_init(AVCodecContext *avctx)
static VLCElem hdr_vlc[1<< MPC7_HDR_BITS]
static VLCElem scfi_vlc[1<< MPC7_SCFI_BITS]
static const VLCElem * quant_vlc[MPC7_QUANT_VLC_TABLES][2]
static av_cold void mpc7_decode_flush(AVCodecContext *avctx)
static void idx_to_quant(MPCContext *c, GetBitContext *gb, int idx, int *dst)
Fill samples for given subband.
static VLCElem dscf_vlc[1<< MPC7_DSCF_BITS]
static av_cold void mpc7_init_static(void)
static const uint8_t mpc7_scfi[MPC7_SCFI_SIZE *2]
static const int8_t mpc7_idx32[]
static const uint8_t mpc7_hdr[MPC7_HDR_SIZE *2]
static const uint8_t mpc7_dscf[MPC7_DSCF_SIZE *2]
static const uint8_t mpc7_quant_vlc_sizes[MPC7_QUANT_VLC_TABLES]
#define MPC7_QUANT_VLC_TABLES
static const uint8_t mpc7_quant_vlcs[177 *2 *2]
static const int8_t mpc7_idx51[]
static const int8_t mpc7_idx30[]
static const int8_t mpc7_quant_vlc_off[MPC7_QUANT_VLC_TABLES]
static const int8_t mpc7_idx50[]
static const int8_t mpc7_idx31[]
Musepack decoder MPEG Audio Layer 1/2 -like codec with frames of 1152 samples divided into 32 subband...
av_cold void ff_mpadsp_init(MPADSPContext *s)
void ff_mpa_synth_init_fixed(void)
An AVChannelLayout holds information about the channel layout of audio data.
int nb_channels
Number of channels in this layout.
main external API structure.
AVChannelLayout ch_layout
Audio channel layout.
enum AVSampleFormat sample_fmt
audio sample format
uint8_t * extradata
Out-of-band global headers that may be used by some codecs.
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
Subband structure - hold all variables for each subband.
For static VLCs, the number of bits can often be hardcoded at each get_vlc2() callsite.
#define avpriv_request_sample(...)
static int ref[MAX_W *MAX_W]
av_cold const VLCElem * ff_vlc_init_tables_from_lengths(VLCInitState *state, int nb_bits, int nb_codes, const int8_t *lens, int lens_wrap, const void *symbols, int symbols_wrap, int symbols_size, int offset, int flags)
#define VLC_INIT_STATE(_table)
#define VLC_INIT_STATIC_TABLE_FROM_LENGTHS(vlc_table, nb_bits, nb_codes, lens, lens_wrap, syms, syms_wrap, syms_size, offset, flags)
static const uint8_t quant_tables[]