FFmpeg
Functions | Variables
mpc8.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/lfg.h"
#include "avcodec.h"
#include "get_bits.h"
#include "internal.h"
#include "mpegaudiodsp.h"
#include "mpc.h"
#include "mpc8data.h"
#include "mpc8huff.h"

Go to the source code of this file.

Functions

static int mpc8_dec_base (GetBitContext *gb, int k, int n)
 
static int mpc8_dec_enum (GetBitContext *gb, int k, int n)
 
static int mpc8_get_mod_golomb (GetBitContext *gb, int m)
 
static int mpc8_get_mask (GetBitContext *gb, int size, int t)
 
static av_cold int mpc8_decode_init (AVCodecContext *avctx)
 
static int mpc8_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
 
static av_cold void mpc8_decode_flush (AVCodecContext *avctx)
 

Variables

static VLC band_vlc
 
static VLC scfi_vlc [2]
 
static VLC dscf_vlc [2]
 
static VLC res_vlc [2]
 
static VLC q1_vlc
 
static VLC q2_vlc [2]
 
static VLC q3_vlc [2]
 
static VLC quant_vlc [4][2]
 
static VLC 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 const uint16_t vlc_offsets [13]
 
AVCodec ff_mpc8_decoder
 

Detailed Description

MPEG Audio Layer 1/2 -like codec with frames of 1152 samples divided into 32 subbands.

Definition in file mpc8.c.

Function Documentation

◆ mpc8_dec_base()

static int mpc8_dec_base ( GetBitContext gb,
int  k,
int  n 
)
inlinestatic

Definition at line 45 of file mpc8.c.

Referenced by mpc8_dec_enum(), and mpc8_get_mod_golomb().

◆ mpc8_dec_enum()

static int mpc8_dec_enum ( GetBitContext gb,
int  k,
int  n 
)
inlinestatic

Definition at line 56 of file mpc8.c.

Referenced by mpc8_get_mask().

◆ mpc8_get_mod_golomb()

static int mpc8_get_mod_golomb ( GetBitContext gb,
int  m 
)
inlinestatic

Definition at line 75 of file mpc8.c.

Referenced by mpc8_decode_frame().

◆ mpc8_get_mask()

static int mpc8_get_mask ( GetBitContext gb,
int  size,
int  t 
)
static

Definition at line 81 of file mpc8.c.

Referenced by mpc8_decode_frame().

◆ mpc8_decode_init()

static av_cold int mpc8_decode_init ( AVCodecContext avctx)
static

Definition at line 96 of file mpc8.c.

◆ mpc8_decode_frame()

static int mpc8_decode_frame ( AVCodecContext avctx,
void *  data,
int got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 239 of file mpc8.c.

◆ mpc8_decode_flush()

static av_cold void mpc8_decode_flush ( AVCodecContext avctx)
static

Definition at line 439 of file mpc8.c.

Variable Documentation

◆ band_vlc

VLC band_vlc
static

Definition at line 39 of file mpc8.c.

Referenced by mpc8_decode_frame(), and mpc8_decode_init().

◆ scfi_vlc

VLC scfi_vlc[2]
static

Definition at line 39 of file mpc8.c.

Referenced by mpc8_decode_frame(), and mpc8_decode_init().

◆ dscf_vlc

VLC dscf_vlc[2]
static

Definition at line 39 of file mpc8.c.

Referenced by mpc8_decode_frame(), and mpc8_decode_init().

◆ res_vlc

VLC res_vlc[2]
static

Definition at line 39 of file mpc8.c.

Referenced by mpc8_decode_frame(), and mpc8_decode_init().

◆ q1_vlc

VLC q1_vlc
static

Definition at line 40 of file mpc8.c.

Referenced by mpc8_decode_frame(), and mpc8_decode_init().

◆ q2_vlc

VLC q2_vlc[2]
static

Definition at line 40 of file mpc8.c.

Referenced by mpc8_decode_frame(), and mpc8_decode_init().

◆ q3_vlc

VLC q3_vlc[2]
static

Definition at line 40 of file mpc8.c.

Referenced by mpc8_decode_frame(), and mpc8_decode_init().

◆ quant_vlc

VLC quant_vlc[4][2]
static

Definition at line 40 of file mpc8.c.

Referenced by mpc8_decode_frame(), and mpc8_decode_init().

◆ q9up_vlc

VLC q9up_vlc
static

Definition at line 40 of file mpc8.c.

Referenced by mpc8_decode_frame(), and mpc8_decode_init().

◆ q3_offsets

const int q3_offsets[2] = { MPC8_Q3_OFFSET, MPC8_Q4_OFFSET }
static

Definition at line 42 of file mpc8.c.

Referenced by mpc8_decode_frame().

◆ quant_offsets

const int quant_offsets[6] = { MPC8_Q5_OFFSET, MPC8_Q6_OFFSET, MPC8_Q7_OFFSET, MPC8_Q8_OFFSET }
static

Definition at line 43 of file mpc8.c.

Referenced by mpc8_decode_frame().

◆ vlc_offsets

const uint16_t vlc_offsets[13]
static
Initial value:
= {
0, 640, 1184, 1748, 2298, 2426, 2554, 3066, 3578, 4106, 4618, 5196, 5708
}

Definition at line 92 of file mpc8.c.

Referenced by mpc8_decode_init().

◆ ff_mpc8_decoder

AVCodec ff_mpc8_decoder
Initial value:
= {
.name = "mpc8",
.long_name = NULL_IF_CONFIG_SMALL("Musepack SV8"),
.priv_data_size = sizeof(MPCContext),
.capabilities = AV_CODEC_CAP_DR1,
}

Definition at line 445 of file mpc8.c.

init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
sample_fmts
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:686
mpc8_decode_flush
static av_cold void mpc8_decode_flush(AVCodecContext *avctx)
Definition: mpc8.c:439
MPCContext
Definition: mpc.h:52
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:42
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
mpc8_decode_frame
static int mpc8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: mpc8.c:239
flush
static void flush(AVCodecContext *avctx)
Definition: aacdec_template.c:500
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:981
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:59
AV_SAMPLE_FMT_S16P
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: samplefmt.h:67
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
AV_CODEC_ID_MUSEPACK8
@ AV_CODEC_ID_MUSEPACK8
Definition: avcodec.h:598
mpc8_decode_init
static av_cold int mpc8_decode_init(AVCodecContext *avctx)
Definition: mpc8.c:96