FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
wavpack.c File Reference

WavPack lossless audio decoder. More...

#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "get_bits.h"
#include "internal.h"
#include "thread.h"
#include "unary.h"
#include "bytestream.h"
#include "wavpack.h"

Go to the source code of this file.

Data Structures

struct  SavedContext
 
struct  WavpackFrameContext
 
struct  WavpackContext
 

Macros

#define BITSTREAM_READER_LE
 
#define WV_MAX_FRAME_DECODERS   14
 
#define LEVEL_DECAY(a)   (((a) + 0x80) >> 8)
 

Functions

static av_always_inline int get_tail (GetBitContext *gb, int k)
 
static void update_error_limit (WavpackFrameContext *ctx)
 
static int wv_get_value (WavpackFrameContext *ctx, GetBitContext *gb, int channel, int *last)
 
static int wv_get_value_integer (WavpackFrameContext *s, uint32_t *crc, int S)
 
static float wv_get_value_float (WavpackFrameContext *s, uint32_t *crc, int S)
 
static void wv_reset_saved_context (WavpackFrameContext *s)
 
static int wv_check_crc (WavpackFrameContext *s, uint32_t crc, uint32_t crc_extra_bits)
 
static int wv_unpack_stereo (WavpackFrameContext *s, GetBitContext *gb, void *dst_l, void *dst_r, const int type)
 
static int wv_unpack_mono (WavpackFrameContext *s, GetBitContext *gb, void *dst, const int type)
 
static av_cold int wv_alloc_frame_context (WavpackContext *c)
 
static av_cold int wavpack_decode_init (AVCodecContext *avctx)
 
static av_cold int wavpack_decode_end (AVCodecContext *avctx)
 
static int wavpack_decode_block (AVCodecContext *avctx, int block_no, AVFrame *frame, const uint8_t *buf, int buf_size)
 
static void wavpack_decode_flush (AVCodecContext *avctx)
 
static int wavpack_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
 

Variables

AVCodec ff_wavpack_decoder
 

Detailed Description

WavPack lossless audio decoder.

Definition in file wavpack.c.

Macro Definition Documentation

#define BITSTREAM_READER_LE

Definition at line 22 of file wavpack.c.

#define WV_MAX_FRAME_DECODERS   14

Definition at line 73 of file wavpack.c.

Referenced by wv_alloc_frame_context().

#define LEVEL_DECAY (   a)    (((a) + 0x80) >> 8)

Definition at line 86 of file wavpack.c.

Referenced by update_error_limit(), and wv_get_value().

Function Documentation

static av_always_inline int get_tail ( GetBitContext gb,
int  k 
)
static

Definition at line 88 of file wavpack.c.

Referenced by wv_get_value().

static void update_error_limit ( WavpackFrameContext ctx)
static

Definition at line 102 of file wavpack.c.

Referenced by wv_get_value().

static int wv_get_value ( WavpackFrameContext ctx,
GetBitContext gb,
int  channel,
int *  last 
)
static

Definition at line 136 of file wavpack.c.

Referenced by wv_unpack_mono(), and wv_unpack_stereo().

static int wv_get_value_integer ( WavpackFrameContext s,
uint32_t *  crc,
int  S 
)
inlinestatic

Definition at line 264 of file wavpack.c.

Referenced by wv_unpack_mono(), and wv_unpack_stereo().

static float wv_get_value_float ( WavpackFrameContext s,
uint32_t *  crc,
int  S 
)
static

Definition at line 288 of file wavpack.c.

Referenced by wv_unpack_mono(), and wv_unpack_stereo().

static void wv_reset_saved_context ( WavpackFrameContext s)
static
static int wv_check_crc ( WavpackFrameContext s,
uint32_t  crc,
uint32_t  crc_extra_bits 
)
inlinestatic

Definition at line 368 of file wavpack.c.

Referenced by wv_unpack_mono(), and wv_unpack_stereo().

static int wv_unpack_stereo ( WavpackFrameContext s,
GetBitContext gb,
void dst_l,
void dst_r,
const int  type 
)
inlinestatic

Definition at line 383 of file wavpack.c.

Referenced by wavpack_decode_block().

static int wv_unpack_mono ( WavpackFrameContext s,
GetBitContext gb,
void dst,
const int  type 
)
inlinestatic

Definition at line 516 of file wavpack.c.

Referenced by wavpack_decode_block().

static av_cold int wv_alloc_frame_context ( WavpackContext c)
static

Definition at line 585 of file wavpack.c.

Referenced by wavpack_decode_block().

static av_cold int wavpack_decode_init ( AVCodecContext avctx)
static

Definition at line 609 of file wavpack.c.

static av_cold int wavpack_decode_end ( AVCodecContext avctx)
static

Definition at line 620 of file wavpack.c.

static int wavpack_decode_block ( AVCodecContext avctx,
int  block_no,
AVFrame frame,
const uint8_t buf,
int  buf_size 
)
static

Definition at line 632 of file wavpack.c.

Referenced by wavpack_decode_frame().

static void wavpack_decode_flush ( AVCodecContext avctx)
static

Definition at line 1044 of file wavpack.c.

Referenced by wavpack_decode_frame().

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

Definition at line 1053 of file wavpack.c.

Variable Documentation

AVCodec ff_wavpack_decoder
Initial value:
= {
.name = "wavpack",
.long_name = NULL_IF_CONFIG_SMALL("WavPack"),
.priv_data_size = sizeof(WavpackContext),
}
static void flush(AVCodecContext *avctx)
static void wavpack_decode_flush(AVCodecContext *avctx)
Definition: wavpack.c:1044
static int init_thread_copy(AVCodecContext *avctx)
Definition: tta.c:390
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: avcodec.h:919
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
Definition: internal.h:215
static av_cold int wavpack_decode_end(AVCodecContext *avctx)
Definition: wavpack.c:620
static int wavpack_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: wavpack.c:1053
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
Definition: ccaption_dec.c:572
static av_cold int wavpack_decode_init(AVCodecContext *avctx)
Definition: wavpack.c:609
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:856

Definition at line 1119 of file wavpack.c.