FFmpeg
Data Structures | Macros | Functions | Variables
wavpackenc.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"
#include "put_bits.h"
#include "bytestream.h"
#include "wavpackenc.h"
#include "wavpack.h"

Go to the source code of this file.

Data Structures

struct  WavPackExtraInfo
 
struct  WavPackWords
 
struct  WavPackEncodeContext
 

Macros

#define BITSTREAM_WRITER_LE
 
#define UPDATE_WEIGHT(weight, delta, source, result)
 
#define APPLY_WEIGHT_F(weight, sample)
 
#define APPLY_WEIGHT_I(weight, sample)   (((weight) * (sample) + 512) >> 10)
 
#define APPLY_WEIGHT(weight, sample)
 
#define CLEAR(destin)   memset(&destin, 0, sizeof(destin));
 
#define SHIFT_LSB   13
 
#define SHIFT_MASK   (0x1FU << SHIFT_LSB)
 
#define MAG_LSB   18
 
#define MAG_MASK   (0x1FU << MAG_LSB)
 
#define SRATE_LSB   23
 
#define SRATE_MASK   (0xFU << SRATE_LSB)
 
#define EXTRA_TRY_DELTAS   1
 
#define EXTRA_ADJUST_DELTAS   2
 
#define EXTRA_SORT_FIRST   4
 
#define EXTRA_BRANCHES   8
 
#define EXTRA_SORT_LAST   16
 
#define FLOAT_SHIFT_ONES   1
 
#define FLOAT_SHIFT_SAME   2
 
#define FLOAT_SHIFT_SENT   4
 
#define FLOAT_ZEROS_SENT   8
 
#define FLOAT_NEG_ZEROS   0x10
 
#define FLOAT_EXCEPTIONS   0x20
 
#define get_mantissa(f)   ((f) & 0x7fffff)
 
#define get_exponent(f)   (((f) >> 23) & 0xff)
 
#define get_sign(f)   (((f) >> 31) & 0x1)
 
#define count_bits(av)   ((av) ? 32 - ff_clz(av) : 0)
 
#define update_weight_d2(weight, delta, source, result)
 
#define update_weight_clip_d2(weight, delta, source, result)
 
#define WRITE_DECWEIGHT(type)
 
#define WRITE_DECSAMPLE(type)
 
#define WRITE_CHAN_ENTROPY(chan)
 
#define COPY_SAMPLES(type, offset, shift)
 
#define OFFSET(x)   offsetof(WavPackEncodeContext, x)
 
#define FLAGS   AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
 

Functions

static av_cold int wavpack_encode_init (AVCodecContext *avctx)
 
static void shift_mono (int32_t *samples, int nb_samples, int shift)
 
static void shift_stereo (int32_t *left, int32_t *right, int nb_samples, int shift)
 
static void process_float (WavPackEncodeContext *s, int32_t *sample)
 
static int scan_float (WavPackEncodeContext *s, int32_t *samples_l, int32_t *samples_r, int nb_samples)
 
static void scan_int23 (WavPackEncodeContext *s, int32_t *samples_l, int32_t *samples_r, int nb_samples)
 
static int scan_int32 (WavPackEncodeContext *s, int32_t *samples_l, int32_t *samples_r, int nb_samples)
 
static int8_t store_weight (int weight)
 
static int restore_weight (int8_t weight)
 
static int log2s (int32_t value)
 
static void decorr_mono (int32_t *in_samples, int32_t *out_samples, int nb_samples, struct Decorr *dpp, int dir)
 
static void reverse_mono_decorr (struct Decorr *dpp)
 
static uint32_t log2sample (uint32_t v, int limit, uint32_t *result)
 
static uint32_t log2mono (int32_t *samples, int nb_samples, int limit)
 
static uint32_t log2stereo (int32_t *samples_l, int32_t *samples_r, int nb_samples, int limit)
 
static void decorr_mono_buffer (int32_t *samples, int32_t *outsamples, int nb_samples, struct Decorr *dpp, int tindex)
 
static void recurse_mono (WavPackEncodeContext *s, WavPackExtraInfo *info, int depth, int delta, uint32_t input_bits)
 
static void sort_mono (WavPackEncodeContext *s, WavPackExtraInfo *info)
 
static void delta_mono (WavPackEncodeContext *s, WavPackExtraInfo *info)
 
static int allocate_buffers2 (WavPackEncodeContext *s, int nterms)
 
static int allocate_buffers (WavPackEncodeContext *s)
 
static void analyze_mono (WavPackEncodeContext *s, int32_t *samples, int do_samples)
 
static void scan_word (WavPackEncodeContext *s, WvChannel *c, int32_t *samples, int nb_samples, int dir)
 
static int wv_mono (WavPackEncodeContext *s, int32_t *samples, int no_history, int do_samples)
 
static void decorr_stereo (int32_t *in_left, int32_t *in_right, int32_t *out_left, int32_t *out_right, int nb_samples, struct Decorr *dpp, int dir)
 
static void reverse_decorr (struct Decorr *dpp)
 
static void decorr_stereo_quick (int32_t *in_left, int32_t *in_right, int32_t *out_left, int32_t *out_right, int nb_samples, struct Decorr *dpp)
 
static void decorr_stereo_buffer (WavPackExtraInfo *info, int32_t *in_left, int32_t *in_right, int32_t *out_left, int32_t *out_right, int nb_samples, int tindex)
 
static void sort_stereo (WavPackEncodeContext *s, WavPackExtraInfo *info)
 
static void delta_stereo (WavPackEncodeContext *s, WavPackExtraInfo *info)
 
static void recurse_stereo (WavPackEncodeContext *s, WavPackExtraInfo *info, int depth, int delta, uint32_t input_bits)
 
static void analyze_stereo (WavPackEncodeContext *s, int32_t *in_left, int32_t *in_right, int do_samples)
 
static int wv_stereo (WavPackEncodeContext *s, int32_t *samples_l, int32_t *samples_r, int no_history, int do_samples)
 
static void encode_flush (WavPackEncodeContext *s)
 
static void wavpack_encode_sample (WavPackEncodeContext *s, WvChannel *c, int32_t sample)
 
static void pack_int32 (WavPackEncodeContext *s, int32_t *samples_l, int32_t *samples_r, int nb_samples)
 
static void pack_float_sample (WavPackEncodeContext *s, int32_t *sample)
 
static void pack_float (WavPackEncodeContext *s, int32_t *samples_l, int32_t *samples_r, int nb_samples)
 
static void decorr_stereo_pass2 (struct Decorr *dpp, int32_t *samples_l, int32_t *samples_r, int nb_samples)
 
static void decorr_stereo_pass_id2 (struct Decorr *dpp, int32_t *samples_l, int32_t *samples_r, int nb_samples)
 
static void put_metadata_block (PutByteContext *pb, int flags, int size)
 
static int wavpack_encode_block (WavPackEncodeContext *s, int32_t *samples_l, int32_t *samples_r, uint8_t *out, int out_size)
 
static void fill_buffer (WavPackEncodeContext *s, const int8_t *src, int32_t *dst, int nb_samples)
 
static void set_samplerate (WavPackEncodeContext *s)
 
static int wavpack_encode_frame (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
 
static av_cold int wavpack_encode_close (AVCodecContext *avctx)
 

Variables

static const AVOption options []
 
static const AVClass wavpack_encoder_class
 
const FFCodec ff_wavpack_encoder
 

Macro Definition Documentation

◆ BITSTREAM_WRITER_LE

#define BITSTREAM_WRITER_LE

Definition at line 21 of file wavpackenc.c.

◆ UPDATE_WEIGHT

#define UPDATE_WEIGHT (   weight,
  delta,
  source,
  result 
)
Value:
if ((source) && (result)) { \
int32_t s = (int32_t) ((source) ^ (result)) >> 31; \
weight = ((delta) ^ s) + ((weight) - s); \
}

Definition at line 35 of file wavpackenc.c.

◆ APPLY_WEIGHT_F

#define APPLY_WEIGHT_F (   weight,
  sample 
)
Value:
((((((sample) & 0xffff) * (weight)) >> 9) + \
((((sample) & ~0xffff) >> 9) * (weight)) + 1) >> 1)

Definition at line 41 of file wavpackenc.c.

◆ APPLY_WEIGHT_I

#define APPLY_WEIGHT_I (   weight,
  sample 
)    (((weight) * (sample) + 512) >> 10)

Definition at line 44 of file wavpackenc.c.

◆ APPLY_WEIGHT

#define APPLY_WEIGHT (   weight,
  sample 
)
Value:

Definition at line 46 of file wavpackenc.c.

◆ CLEAR

#define CLEAR (   destin)    memset(&destin, 0, sizeof(destin));

Definition at line 49 of file wavpackenc.c.

◆ SHIFT_LSB

#define SHIFT_LSB   13

Definition at line 51 of file wavpackenc.c.

◆ SHIFT_MASK

#define SHIFT_MASK   (0x1FU << SHIFT_LSB)

Definition at line 52 of file wavpackenc.c.

◆ MAG_LSB

#define MAG_LSB   18

Definition at line 54 of file wavpackenc.c.

◆ MAG_MASK

#define MAG_MASK   (0x1FU << MAG_LSB)

Definition at line 55 of file wavpackenc.c.

◆ SRATE_LSB

#define SRATE_LSB   23

Definition at line 57 of file wavpackenc.c.

◆ SRATE_MASK

#define SRATE_MASK   (0xFU << SRATE_LSB)

Definition at line 58 of file wavpackenc.c.

◆ EXTRA_TRY_DELTAS

#define EXTRA_TRY_DELTAS   1

Definition at line 60 of file wavpackenc.c.

◆ EXTRA_ADJUST_DELTAS

#define EXTRA_ADJUST_DELTAS   2

Definition at line 61 of file wavpackenc.c.

◆ EXTRA_SORT_FIRST

#define EXTRA_SORT_FIRST   4

Definition at line 62 of file wavpackenc.c.

◆ EXTRA_BRANCHES

#define EXTRA_BRANCHES   8

Definition at line 63 of file wavpackenc.c.

◆ EXTRA_SORT_LAST

#define EXTRA_SORT_LAST   16

Definition at line 64 of file wavpackenc.c.

◆ FLOAT_SHIFT_ONES

#define FLOAT_SHIFT_ONES   1

Definition at line 215 of file wavpackenc.c.

◆ FLOAT_SHIFT_SAME

#define FLOAT_SHIFT_SAME   2

Definition at line 216 of file wavpackenc.c.

◆ FLOAT_SHIFT_SENT

#define FLOAT_SHIFT_SENT   4

Definition at line 217 of file wavpackenc.c.

◆ FLOAT_ZEROS_SENT

#define FLOAT_ZEROS_SENT   8

Definition at line 218 of file wavpackenc.c.

◆ FLOAT_NEG_ZEROS

#define FLOAT_NEG_ZEROS   0x10

Definition at line 219 of file wavpackenc.c.

◆ FLOAT_EXCEPTIONS

#define FLOAT_EXCEPTIONS   0x20

Definition at line 220 of file wavpackenc.c.

◆ get_mantissa

#define get_mantissa (   f)    ((f) & 0x7fffff)

Definition at line 222 of file wavpackenc.c.

◆ get_exponent

#define get_exponent (   f)    (((f) >> 23) & 0xff)

Definition at line 223 of file wavpackenc.c.

◆ get_sign

#define get_sign (   f)    (((f) >> 31) & 0x1)

Definition at line 224 of file wavpackenc.c.

◆ count_bits

#define count_bits (   av)    ((av) ? 32 - ff_clz(av) : 0)

Definition at line 643 of file wavpackenc.c.

◆ update_weight_d2

#define update_weight_d2 (   weight,
  delta,
  source,
  result 
)
Value:
if (source && result) \
weight -= (((source ^ result) >> 29) & 4) - 2;

Definition at line 2340 of file wavpackenc.c.

◆ update_weight_clip_d2

#define update_weight_clip_d2 (   weight,
  delta,
  source,
  result 
)
Value:
if (source && result) { \
const int32_t s = (source ^ result) >> 31; \
if ((weight = (weight ^ s) + (2 - s)) > 1024) weight = 1024; \
weight = (weight ^ s) - s; \
}

Definition at line 2344 of file wavpackenc.c.

◆ WRITE_DECWEIGHT

#define WRITE_DECWEIGHT (   type)
Value:
do { \
temp = store_weight(type); \
bytestream2_put_byte(&pb, temp); \
type = restore_weight(temp); \
} while (0)

◆ WRITE_DECSAMPLE

#define WRITE_DECSAMPLE (   type)
Value:
do { \
temp = log2s(type); \
type = wp_exp2(temp); \
bytestream2_put_le16(&pb, temp); \
} while (0)

◆ WRITE_CHAN_ENTROPY

#define WRITE_CHAN_ENTROPY (   chan)
Value:
do { \
for (i = 0; i < 3; i++) { \
temp = wp_log2(s->w.c[chan].median[i]); \
bytestream2_put_le16(&pb, temp); \
s->w.c[chan].median[i] = wp_exp2(temp); \
} \
} while (0)

◆ COPY_SAMPLES

#define COPY_SAMPLES (   type,
  offset,
  shift 
)
Value:
do { \
const type *sptr = (const type *)src; \
for (i = 0; i < nb_samples; i++) \
dst[i] = (sptr[i] - offset) >> shift; \
} while (0)

◆ OFFSET

#define OFFSET (   x)    offsetof(WavPackEncodeContext, x)

Definition at line 2956 of file wavpackenc.c.

◆ FLAGS

Definition at line 2957 of file wavpackenc.c.

Function Documentation

◆ wavpack_encode_init()

static av_cold int wavpack_encode_init ( AVCodecContext avctx)
static

Definition at line 128 of file wavpackenc.c.

◆ shift_mono()

static void shift_mono ( int32_t samples,
int  nb_samples,
int  shift 
)
static

Definition at line 198 of file wavpackenc.c.

Referenced by scan_float(), scan_int23(), scan_int32(), and wavpack_encode_block().

◆ shift_stereo()

static void shift_stereo ( int32_t left,
int32_t right,
int  nb_samples,
int  shift 
)
static

Definition at line 205 of file wavpackenc.c.

Referenced by scan_float(), scan_int23(), scan_int32(), and wavpack_encode_block().

◆ process_float()

static void process_float ( WavPackEncodeContext s,
int32_t sample 
)
static

Definition at line 226 of file wavpackenc.c.

Referenced by scan_float().

◆ scan_float()

static int scan_float ( WavPackEncodeContext s,
int32_t samples_l,
int32_t samples_r,
int  nb_samples 
)
static

Definition at line 267 of file wavpackenc.c.

Referenced by wavpack_encode_block().

◆ scan_int23()

static void scan_int23 ( WavPackEncodeContext s,
int32_t samples_l,
int32_t samples_r,
int  nb_samples 
)
static

Definition at line 353 of file wavpackenc.c.

Referenced by wavpack_encode_block().

◆ scan_int32()

static int scan_int32 ( WavPackEncodeContext s,
int32_t samples_l,
int32_t samples_r,
int  nb_samples 
)
static

Definition at line 434 of file wavpackenc.c.

Referenced by wavpack_encode_block().

◆ store_weight()

static int8_t store_weight ( int  weight)
static

◆ restore_weight()

static int restore_weight ( int8_t  weight)
static

Definition at line 533 of file wavpackenc.c.

Referenced by decorr_mono(), decorr_stereo(), and decorr_stereo_quick().

◆ log2s()

static int log2s ( int32_t  value)
static

Definition at line 543 of file wavpackenc.c.

Referenced by decorr_mono(), decorr_stereo(), and decorr_stereo_quick().

◆ decorr_mono()

static void decorr_mono ( int32_t in_samples,
int32_t out_samples,
int  nb_samples,
struct Decorr dpp,
int  dir 
)
static

Definition at line 548 of file wavpackenc.c.

Referenced by analyze_mono(), decorr_mono_buffer(), and wv_mono().

◆ reverse_mono_decorr()

static void reverse_mono_decorr ( struct Decorr dpp)
static

Definition at line 611 of file wavpackenc.c.

Referenced by decorr_mono_buffer(), and wv_mono().

◆ log2sample()

static uint32_t log2sample ( uint32_t  v,
int  limit,
uint32_t *  result 
)
static

Definition at line 645 of file wavpackenc.c.

Referenced by log2mono(), and log2stereo().

◆ log2mono()

static uint32_t log2mono ( int32_t samples,
int  nb_samples,
int  limit 
)
static

Definition at line 661 of file wavpackenc.c.

Referenced by analyze_mono(), delta_mono(), recurse_mono(), sort_mono(), and wv_mono().

◆ log2stereo()

static uint32_t log2stereo ( int32_t samples_l,
int32_t samples_r,
int  nb_samples,
int  limit 
)
static

Definition at line 671 of file wavpackenc.c.

Referenced by analyze_stereo(), delta_stereo(), recurse_stereo(), sort_stereo(), and wv_stereo().

◆ decorr_mono_buffer()

static void decorr_mono_buffer ( int32_t samples,
int32_t outsamples,
int  nb_samples,
struct Decorr dpp,
int  tindex 
)
static

Definition at line 683 of file wavpackenc.c.

Referenced by delta_mono(), recurse_mono(), and sort_mono().

◆ recurse_mono()

static void recurse_mono ( WavPackEncodeContext s,
WavPackExtraInfo info,
int  depth,
int  delta,
uint32_t  input_bits 
)
static

Definition at line 722 of file wavpackenc.c.

Referenced by analyze_mono().

◆ sort_mono()

static void sort_mono ( WavPackEncodeContext s,
WavPackExtraInfo info 
)
static

Definition at line 785 of file wavpackenc.c.

Referenced by analyze_mono().

◆ delta_mono()

static void delta_mono ( WavPackEncodeContext s,
WavPackExtraInfo info 
)
static

Definition at line 832 of file wavpackenc.c.

Referenced by analyze_mono().

◆ allocate_buffers2()

static int allocate_buffers2 ( WavPackEncodeContext s,
int  nterms 
)
static

Definition at line 885 of file wavpackenc.c.

Referenced by analyze_mono(), and analyze_stereo().

◆ allocate_buffers()

static int allocate_buffers ( WavPackEncodeContext s)
static

Definition at line 905 of file wavpackenc.c.

Referenced by wv_mono(), and wv_stereo().

◆ analyze_mono()

static void analyze_mono ( WavPackEncodeContext s,
int32_t samples,
int  do_samples 
)
static

Definition at line 935 of file wavpackenc.c.

Referenced by wv_mono().

◆ scan_word()

static void scan_word ( WavPackEncodeContext s,
WvChannel c,
int32_t samples,
int  nb_samples,
int  dir 
)
static

Definition at line 987 of file wavpackenc.c.

Referenced by wv_mono(), and wv_stereo().

◆ wv_mono()

static int wv_mono ( WavPackEncodeContext s,
int32_t samples,
int  no_history,
int  do_samples 
)
static

Definition at line 1019 of file wavpackenc.c.

Referenced by wavpack_encode_block().

◆ decorr_stereo()

static void decorr_stereo ( int32_t in_left,
int32_t in_right,
int32_t out_left,
int32_t out_right,
int  nb_samples,
struct Decorr dpp,
int  dir 
)
static

Definition at line 1125 of file wavpackenc.c.

Referenced by analyze_stereo(), decorr_stereo_buffer(), and wv_stereo().

◆ reverse_decorr()

static void reverse_decorr ( struct Decorr dpp)
static

Definition at line 1318 of file wavpackenc.c.

Referenced by decorr_stereo_buffer(), and wv_stereo().

◆ decorr_stereo_quick()

static void decorr_stereo_quick ( int32_t in_left,
int32_t in_right,
int32_t out_left,
int32_t out_right,
int  nb_samples,
struct Decorr dpp 
)
static

Definition at line 1362 of file wavpackenc.c.

Referenced by analyze_stereo(), decorr_stereo_buffer(), and wv_stereo().

◆ decorr_stereo_buffer()

static void decorr_stereo_buffer ( WavPackExtraInfo info,
int32_t in_left,
int32_t in_right,
int32_t out_left,
int32_t out_right,
int  nb_samples,
int  tindex 
)
static

Definition at line 1498 of file wavpackenc.c.

Referenced by delta_stereo(), recurse_stereo(), and sort_stereo().

◆ sort_stereo()

static void sort_stereo ( WavPackEncodeContext s,
WavPackExtraInfo info 
)
static

Definition at line 1550 of file wavpackenc.c.

Referenced by analyze_stereo().

◆ delta_stereo()

static void delta_stereo ( WavPackEncodeContext s,
WavPackExtraInfo info 
)
static

Definition at line 1607 of file wavpackenc.c.

Referenced by analyze_stereo().

◆ recurse_stereo()

static void recurse_stereo ( WavPackEncodeContext s,
WavPackExtraInfo info,
int  depth,
int  delta,
uint32_t  input_bits 
)
static

Definition at line 1667 of file wavpackenc.c.

Referenced by analyze_stereo().

◆ analyze_stereo()

static void analyze_stereo ( WavPackEncodeContext s,
int32_t in_left,
int32_t in_right,
int  do_samples 
)
static

Definition at line 1740 of file wavpackenc.c.

Referenced by wv_stereo().

◆ wv_stereo()

static int wv_stereo ( WavPackEncodeContext s,
int32_t samples_l,
int32_t samples_r,
int  no_history,
int  do_samples 
)
static

Definition at line 1809 of file wavpackenc.c.

Referenced by wavpack_encode_block().

◆ encode_flush()

static void encode_flush ( WavPackEncodeContext s)
static

Definition at line 1969 of file wavpackenc.c.

Referenced by wavpack_encode_block(), and wavpack_encode_sample().

◆ wavpack_encode_sample()

static void wavpack_encode_sample ( WavPackEncodeContext s,
WvChannel c,
int32_t  sample 
)
static

Definition at line 2042 of file wavpackenc.c.

Referenced by wavpack_encode_block().

◆ pack_int32()

static void pack_int32 ( WavPackEncodeContext s,
int32_t samples_l,
int32_t samples_r,
int  nb_samples 
)
static

Definition at line 2135 of file wavpackenc.c.

Referenced by wavpack_encode_block().

◆ pack_float_sample()

static void pack_float_sample ( WavPackEncodeContext s,
int32_t sample 
)
static

Definition at line 2160 of file wavpackenc.c.

Referenced by pack_float().

◆ pack_float()

static void pack_float ( WavPackEncodeContext s,
int32_t samples_l,
int32_t samples_r,
int  nb_samples 
)
static

Definition at line 2215 of file wavpackenc.c.

Referenced by wavpack_encode_block().

◆ decorr_stereo_pass2()

static void decorr_stereo_pass2 ( struct Decorr dpp,
int32_t samples_l,
int32_t samples_r,
int  nb_samples 
)
static

Definition at line 2232 of file wavpackenc.c.

Referenced by wavpack_encode_block().

◆ decorr_stereo_pass_id2()

static void decorr_stereo_pass_id2 ( struct Decorr dpp,
int32_t samples_l,
int32_t samples_r,
int  nb_samples 
)
static

Definition at line 2351 of file wavpackenc.c.

Referenced by wavpack_encode_block().

◆ put_metadata_block()

static void put_metadata_block ( PutByteContext pb,
int  flags,
int  size 
)
static

Definition at line 2460 of file wavpackenc.c.

Referenced by wavpack_encode_block().

◆ wavpack_encode_block()

static int wavpack_encode_block ( WavPackEncodeContext s,
int32_t samples_l,
int32_t samples_r,
uint8_t *  out,
int  out_size 
)
static

Definition at line 2469 of file wavpackenc.c.

Referenced by wavpack_encode_frame().

◆ fill_buffer()

static void fill_buffer ( WavPackEncodeContext s,
const int8_t *  src,
int32_t dst,
int  nb_samples 
)
static

Definition at line 2823 of file wavpackenc.c.

Referenced by wavpack_encode_frame().

◆ set_samplerate()

static void set_samplerate ( WavPackEncodeContext s)
static

Definition at line 2852 of file wavpackenc.c.

Referenced by wavpack_encode_frame().

◆ wavpack_encode_frame()

static int wavpack_encode_frame ( AVCodecContext avctx,
AVPacket avpkt,
const AVFrame frame,
int *  got_packet_ptr 
)
static

Definition at line 2864 of file wavpackenc.c.

◆ wavpack_encode_close()

static av_cold int wavpack_encode_close ( AVCodecContext avctx)
static

Definition at line 2922 of file wavpackenc.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "joint_stereo", "", OFFSET(joint), AV_OPT_TYPE_BOOL, {.i64=-1}, -1, 1, FLAGS },
{ "optimize_mono", "", OFFSET(optimize_mono), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ NULL },
}

Definition at line 2958 of file wavpackenc.c.

◆ wavpack_encoder_class

const AVClass wavpack_encoder_class
static
Initial value:
= {
.class_name = "WavPack encoder",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 2964 of file wavpackenc.c.

◆ ff_wavpack_encoder

const FFCodec ff_wavpack_encoder
Initial value:

Definition at line 2971 of file wavpackenc.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
restore_weight
static int restore_weight(int8_t weight)
Definition: wavpackenc.c:533
OFFSET
#define OFFSET(x)
Definition: wavpackenc.c:2956
AV_SAMPLE_FMT_S32P
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition: samplefmt.h:65
wavpack_encoder_class
static const AVClass wavpack_encoder_class
Definition: wavpackenc.c:2964
wavpack_encode_close
static av_cold int wavpack_encode_close(AVCodecContext *avctx)
Definition: wavpackenc.c:2922
weight
const h264_weight_func weight
Definition: h264dsp_init.c:33
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:320
wp_log2
static av_always_inline int wp_log2(uint32_t val)
Definition: wavpack.h:151
s
#define s(width, name)
Definition: cbs_vp9.c:198
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition: codec.h:159
wp_exp2
static av_always_inline int wp_exp2(int16_t val)
Definition: wavpack.h:134
store_weight
static int8_t store_weight(int weight)
Definition: wavpackenc.c:524
log2s
static int log2s(int32_t value)
Definition: wavpackenc.c:543
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
result
and forward the result(frame or status change) to the corresponding input. If nothing is possible
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
wavpack_encode_init
static av_cold int wavpack_encode_init(AVCodecContext *avctx)
Definition: wavpackenc.c:128
source
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a source
Definition: filter_design.txt:255
wavpack_encode_frame
static int wavpack_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: wavpackenc.c:2864
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
AV_SAMPLE_FMT_U8P
@ AV_SAMPLE_FMT_U8P
unsigned 8 bits, planar
Definition: samplefmt.h:63
shift
static int shift(int a, int b)
Definition: bonk.c:261
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:83
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
sample
#define sample
Definition: flacdsp_template.c:44
offset
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
Definition: writing_filters.txt:86
AV_SAMPLE_FMT_S16P
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: samplefmt.h:64
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
delta
float delta
Definition: vorbis_enc_data.h:430
APPLY_WEIGHT_I
#define APPLY_WEIGHT_I(weight, sample)
Definition: wavpackenc.c:44
WavPackEncodeContext
Definition: wavpackenc.c:78
temp
else temp
Definition: vf_mcdeint.c:263
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
int32_t
int32_t
Definition: audioconvert.c:56
APPLY_WEIGHT_F
#define APPLY_WEIGHT_F(weight, sample)
Definition: wavpackenc.c:41
AV_CODEC_ID_WAVPACK
@ AV_CODEC_ID_WAVPACK
Definition: codec_id.h:465
FLAGS
#define FLAGS
Definition: wavpackenc.c:2957
AV_CODEC_CAP_SMALL_LAST_FRAME
#define AV_CODEC_CAP_SMALL_LAST_FRAME
Codec can be fed a final frame with a smaller size.
Definition: codec.h:81
src
#define src
Definition: vp8dsp.c:248
options
static const AVOption options[]
Definition: wavpackenc.c:2958