FFmpeg  4.3
Data Structures | Macros | Enumerations | Functions | Variables
wavpack.h File Reference
#include "libavutil/common.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]
 
static const uint8_t wp_exp2_table [256]
 
static const uint8_t wp_log2_table []
 

Macro Definition Documentation

◆ MAX_TERMS

#define MAX_TERMS   16

Definition at line 27 of file wavpack.h.

◆ MAX_TERM

#define MAX_TERM   8

Definition at line 28 of file wavpack.h.

◆ WV_HEADER_SIZE

#define WV_HEADER_SIZE   32

Definition at line 30 of file wavpack.h.

◆ WV_MONO

#define WV_MONO   0x00000004

Definition at line 32 of file wavpack.h.

◆ WV_JOINT_STEREO

#define WV_JOINT_STEREO   0x00000010

Definition at line 33 of file wavpack.h.

◆ WV_CROSS_DECORR

#define WV_CROSS_DECORR   0x00000020

Definition at line 34 of file wavpack.h.

◆ WV_FLOAT_DATA

#define WV_FLOAT_DATA   0x00000080

Definition at line 35 of file wavpack.h.

◆ WV_INT32_DATA

#define WV_INT32_DATA   0x00000100

Definition at line 36 of file wavpack.h.

◆ WV_FALSE_STEREO

#define WV_FALSE_STEREO   0x40000000

Definition at line 37 of file wavpack.h.

◆ WV_DSD_DATA

#define WV_DSD_DATA   0x80000000

Definition at line 38 of file wavpack.h.

◆ WV_HYBRID_MODE

#define WV_HYBRID_MODE   0x00000008

Definition at line 40 of file wavpack.h.

◆ WV_HYBRID_SHAPE

#define WV_HYBRID_SHAPE   0x00000008

Definition at line 41 of file wavpack.h.

◆ WV_HYBRID_BITRATE

#define WV_HYBRID_BITRATE   0x00000200

Definition at line 42 of file wavpack.h.

◆ WV_HYBRID_BALANCE

#define WV_HYBRID_BALANCE   0x00000400

Definition at line 43 of file wavpack.h.

◆ WV_INITIAL_BLOCK

#define WV_INITIAL_BLOCK   0x00000800

Definition at line 44 of file wavpack.h.

◆ WV_FINAL_BLOCK

#define WV_FINAL_BLOCK   0x00001000

Definition at line 45 of file wavpack.h.

◆ WV_MONO_DATA

#define WV_MONO_DATA   (WV_MONO | WV_FALSE_STEREO)

Definition at line 47 of file wavpack.h.

◆ WV_SINGLE_BLOCK

#define WV_SINGLE_BLOCK   (WV_INITIAL_BLOCK | WV_FINAL_BLOCK)

Definition at line 49 of file wavpack.h.

◆ WV_FLT_SHIFT_ONES

#define WV_FLT_SHIFT_ONES   0x01

Definition at line 51 of file wavpack.h.

◆ WV_FLT_SHIFT_SAME

#define WV_FLT_SHIFT_SAME   0x02

Definition at line 52 of file wavpack.h.

◆ WV_FLT_SHIFT_SENT

#define WV_FLT_SHIFT_SENT   0x04

Definition at line 53 of file wavpack.h.

◆ WV_FLT_ZERO_SENT

#define WV_FLT_ZERO_SENT   0x08

Definition at line 54 of file wavpack.h.

◆ WV_FLT_ZERO_SIGN

#define WV_FLT_ZERO_SIGN   0x10

Definition at line 55 of file wavpack.h.

◆ WV_MAX_SAMPLES

#define WV_MAX_SAMPLES   150000

Definition at line 57 of file wavpack.h.

◆ GET_MED

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

Definition at line 103 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 104 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 105 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 108 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 59 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 66 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 182 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 121 of file wavpack.h.

Referenced by set_samplerate(), and wavpack_decode_block().

◆ wp_exp2_table

const uint8_t wp_exp2_table[256]
static
Initial value:
= {
0x00, 0x01, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x06, 0x07, 0x08, 0x08, 0x09, 0x0a, 0x0b,
0x0b, 0x0c, 0x0d, 0x0e, 0x0e, 0x0f, 0x10, 0x10, 0x11, 0x12, 0x13, 0x13, 0x14, 0x15, 0x16, 0x16,
0x17, 0x18, 0x19, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1d, 0x1e, 0x1f, 0x20, 0x20, 0x21, 0x22, 0x23,
0x24, 0x24, 0x25, 0x26, 0x27, 0x28, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2c, 0x2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xf1, 0xf2, 0xf4, 0xf5, 0xf6, 0xf8, 0xf9, 0xfa, 0xfc, 0xfd, 0xff
}

Definition at line 127 of file wavpack.h.

Referenced by wp_exp2().

◆ wp_log2_table

const uint8_t wp_log2_table[]
static
Initial value:
= {
0x00, 0x01, 0x03, 0x04, 0x06, 0x07, 0x09, 0x0a, 0x0b, 0x0d, 0x0e, 0x10, 0x11, 0x12, 0x14, 0x15,
0x16, 0x18, 0x19, 0x1a, 0x1c, 0x1d, 0x1e, 0x20, 0x21, 0x22, 0x24, 0x25, 0x26, 0x28, 0x29, 0x2a,
0x2c, 0x2d, 0x2e, 0x2f, 0x31, 0x32, 0x33, 0x34, 0x36, 0x37, 0x38, 0x39, 0x3b, 0x3c, 0x3d, 0x3e,
0x3f, 0x41, 0x42, 0x43, 0x44, 0x45, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4d, 0x4e, 0x4f, 0x50, 0x51,
0x52, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63,
0x64, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x74, 0x75,
0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85,
0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95,
0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4,
0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb2,
0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc0,
0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcb, 0xcc, 0xcd, 0xce,
0xcf, 0xd0, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd8, 0xd9, 0xda, 0xdb,
0xdc, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe4, 0xe5, 0xe6, 0xe7, 0xe7,
0xe8, 0xe9, 0xea, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xee, 0xef, 0xf0, 0xf1, 0xf1, 0xf2, 0xf3, 0xf4,
0xf4, 0xf5, 0xf6, 0xf7, 0xf7, 0xf8, 0xf9, 0xf9, 0xfa, 0xfb, 0xfc, 0xfc, 0xfd, 0xfe, 0xff, 0xff
}

Definition at line 146 of file wavpack.h.

Referenced by log2sample(), and wp_log2().

samples
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new samples
Definition: fate.txt:139
weight
static int weight(int i, int blen, int offset)
Definition: diracdec.c:1560
in
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) #define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac) { } void ff_audio_convert_free(AudioConvert **ac) { if(! *ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);} AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) { AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method !=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2) { ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc) { av_free(ac);return NULL;} return ac;} in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar) { ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar ? ac->channels :1;} else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;} int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) { int use_generic=1;int len=in->nb_samples;int p;if(ac->dc) { av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in
Definition: audio_convert.c:326
delta
float delta
Definition: vorbis_enc_data.h:457