FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
wavpack.h File Reference
#include <limits.h>
#include <stdint.h>
#include "libavutil/attributes.h"
#include "libavutil/intmath.h"

Go to the source code of this file.

Data Structures

struct  Decorr
 
struct  WvChannel
 

Macros

#define MAX_TERMS   16
 
#define MAX_TERM   8
 
#define WV_HEADER_SIZE   32
 
#define WV_MONO   0x00000004
 
#define WV_JOINT_STEREO   0x00000010
 
#define WV_CROSS_DECORR   0x00000020
 
#define WV_FLOAT_DATA   0x00000080
 
#define WV_INT32_DATA   0x00000100
 
#define WV_FALSE_STEREO   0x40000000
 
#define WV_DSD_DATA   0x80000000
 
#define WV_HYBRID_MODE   0x00000008
 
#define WV_HYBRID_SHAPE   0x00000008
 
#define WV_HYBRID_BITRATE   0x00000200
 
#define WV_HYBRID_BALANCE   0x00000400
 
#define WV_INITIAL_BLOCK   0x00000800
 
#define WV_FINAL_BLOCK   0x00001000
 
#define WV_MONO_DATA   (WV_MONO | WV_FALSE_STEREO)
 
#define WV_SINGLE_BLOCK   (WV_INITIAL_BLOCK | WV_FINAL_BLOCK)
 
#define WV_FLT_SHIFT_ONES   0x01
 
#define WV_FLT_SHIFT_SAME   0x02
 
#define WV_FLT_SHIFT_SENT   0x04
 
#define WV_FLT_ZERO_SENT   0x08
 
#define WV_FLT_ZERO_SIGN   0x10
 
#define WV_MAX_SAMPLES   150000
 
#define GET_MED(n)   ((c->median[n] >> 4) + 1)
 
#define DEC_MED(n)   c->median[n] -= ((int)(c->median[n] + (128U >> (n)) - 2) / (128 >> (n))) * 2U
 
#define INC_MED(n)   c->median[n] += ((int)(c->median[n] + (128U >> (n)) ) / (128 >> (n))) * 5U
 
#define UPDATE_WEIGHT_CLIP(weight, delta, samples, in)
 

Enumerations

enum  WP_ID_Flags { WP_IDF_MASK = 0x3F, WP_IDF_IGNORE = 0x20, WP_IDF_ODD = 0x40, WP_IDF_LONG = 0x80 }
 
enum  WP_ID {
  WP_ID_DUMMY = 0, WP_ID_ENCINFO, WP_ID_DECTERMS, WP_ID_DECWEIGHTS,
  WP_ID_DECSAMPLES, WP_ID_ENTROPY, WP_ID_HYBRID, WP_ID_SHAPING,
  WP_ID_FLOATINFO, WP_ID_INT32INFO, WP_ID_DATA, WP_ID_CORR,
  WP_ID_EXTRABITS, WP_ID_CHANINFO, WP_ID_DSD_DATA, WP_ID_SAMPLE_RATE = 0x27
}
 

Functions

static av_always_inline int wp_exp2 (int16_t val)
 
static av_always_inline int wp_log2 (uint32_t val)
 

Variables

static const int wv_rates [16]
 
const uint8_t ff_wp_exp2_table [256]
 
const uint8_t ff_wp_log2_table [256]
 

Macro Definition Documentation

◆ MAX_TERMS

#define MAX_TERMS   16

Definition at line 30 of file wavpack.h.

◆ MAX_TERM

#define MAX_TERM   8

Definition at line 31 of file wavpack.h.

◆ WV_HEADER_SIZE

#define WV_HEADER_SIZE   32

Definition at line 33 of file wavpack.h.

◆ WV_MONO

#define WV_MONO   0x00000004

Definition at line 35 of file wavpack.h.

◆ WV_JOINT_STEREO

#define WV_JOINT_STEREO   0x00000010

Definition at line 36 of file wavpack.h.

◆ WV_CROSS_DECORR

#define WV_CROSS_DECORR   0x00000020

Definition at line 37 of file wavpack.h.

◆ WV_FLOAT_DATA

#define WV_FLOAT_DATA   0x00000080

Definition at line 38 of file wavpack.h.

◆ WV_INT32_DATA

#define WV_INT32_DATA   0x00000100

Definition at line 39 of file wavpack.h.

◆ WV_FALSE_STEREO

#define WV_FALSE_STEREO   0x40000000

Definition at line 40 of file wavpack.h.

◆ WV_DSD_DATA

#define WV_DSD_DATA   0x80000000

Definition at line 41 of file wavpack.h.

◆ WV_HYBRID_MODE

#define WV_HYBRID_MODE   0x00000008

Definition at line 43 of file wavpack.h.

◆ WV_HYBRID_SHAPE

#define WV_HYBRID_SHAPE   0x00000008

Definition at line 44 of file wavpack.h.

◆ WV_HYBRID_BITRATE

#define WV_HYBRID_BITRATE   0x00000200

Definition at line 45 of file wavpack.h.

◆ WV_HYBRID_BALANCE

#define WV_HYBRID_BALANCE   0x00000400

Definition at line 46 of file wavpack.h.

◆ WV_INITIAL_BLOCK

#define WV_INITIAL_BLOCK   0x00000800

Definition at line 47 of file wavpack.h.

◆ WV_FINAL_BLOCK

#define WV_FINAL_BLOCK   0x00001000

Definition at line 48 of file wavpack.h.

◆ WV_MONO_DATA

#define WV_MONO_DATA   (WV_MONO | WV_FALSE_STEREO)

Definition at line 50 of file wavpack.h.

◆ WV_SINGLE_BLOCK

#define WV_SINGLE_BLOCK   (WV_INITIAL_BLOCK | WV_FINAL_BLOCK)

Definition at line 52 of file wavpack.h.

◆ WV_FLT_SHIFT_ONES

#define WV_FLT_SHIFT_ONES   0x01

Definition at line 54 of file wavpack.h.

◆ WV_FLT_SHIFT_SAME

#define WV_FLT_SHIFT_SAME   0x02

Definition at line 55 of file wavpack.h.

◆ WV_FLT_SHIFT_SENT

#define WV_FLT_SHIFT_SENT   0x04

Definition at line 56 of file wavpack.h.

◆ WV_FLT_ZERO_SENT

#define WV_FLT_ZERO_SENT   0x08

Definition at line 57 of file wavpack.h.

◆ WV_FLT_ZERO_SIGN

#define WV_FLT_ZERO_SIGN   0x10

Definition at line 58 of file wavpack.h.

◆ WV_MAX_SAMPLES

#define WV_MAX_SAMPLES   150000

Definition at line 60 of file wavpack.h.

◆ GET_MED

#define GET_MED (   n)    ((c->median[n] >> 4) + 1)

Definition at line 106 of file wavpack.h.

◆ DEC_MED

#define DEC_MED (   n)    c->median[n] -= ((int)(c->median[n] + (128U >> (n)) - 2) / (128 >> (n))) * 2U

Definition at line 107 of file wavpack.h.

◆ INC_MED

#define INC_MED (   n)    c->median[n] += ((int)(c->median[n] + (128U >> (n)) ) / (128 >> (n))) * 5U

Definition at line 108 of file wavpack.h.

◆ UPDATE_WEIGHT_CLIP

#define UPDATE_WEIGHT_CLIP (   weight,
  delta,
  samples,
  in 
)
Value:
if ((samples) && (in)) { \
if (((samples) ^ (in)) < 0) { \
(weight) -= (delta); \
if ((weight) < -1024) \
(weight) = -1024; \
} else { \
(weight) += (delta); \
if ((weight) > 1024) \
(weight) = 1024; \
} \
}

Definition at line 111 of file wavpack.h.

Enumeration Type Documentation

◆ WP_ID_Flags

Enumerator
WP_IDF_MASK 
WP_IDF_IGNORE 
WP_IDF_ODD 
WP_IDF_LONG 

Definition at line 62 of file wavpack.h.

◆ WP_ID

enum WP_ID
Enumerator
WP_ID_DUMMY 
WP_ID_ENCINFO 
WP_ID_DECTERMS 
WP_ID_DECWEIGHTS 
WP_ID_DECSAMPLES 
WP_ID_ENTROPY 
WP_ID_HYBRID 
WP_ID_SHAPING 
WP_ID_FLOATINFO 
WP_ID_INT32INFO 
WP_ID_DATA 
WP_ID_CORR 
WP_ID_EXTRABITS 
WP_ID_CHANINFO 
WP_ID_DSD_DATA 
WP_ID_SAMPLE_RATE 

Definition at line 69 of file wavpack.h.

Function Documentation

◆ wp_exp2()

static av_always_inline int wp_exp2 ( int16_t  val)
static

◆ wp_log2()

static av_always_inline int wp_log2 ( uint32_t  val)
static

Definition at line 150 of file wavpack.h.

Referenced by log2s(), and wv_get_value().

Variable Documentation

◆ wv_rates

const int wv_rates[16]
static
Initial value:
= {
6000, 8000, 9600, 11025, 12000, 16000, 22050, 24000,
32000, 44100, 48000, 64000, 88200, 96000, 192000, 0
}

Definition at line 124 of file wavpack.h.

Referenced by set_samplerate(), and wavpack_decode_block().

◆ ff_wp_exp2_table

const uint8_t ff_wp_exp2_table[256]

Definition at line 24 of file wavpackdata.c.

Referenced by wp_exp2().

◆ ff_wp_log2_table

const uint8_t ff_wp_log2_table[256]

Definition at line 43 of file wavpackdata.c.

Referenced by log2sample(), and wp_log2().

weight
static int weight(int i, int blen, int offset)
Definition: diracdec.c:1562
delta
float delta
Definition: vorbis_enc_data.h:430
samples
Filter the word “frame” indicates either a video frame or a group of audio samples
Definition: filter_design.txt:8