FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
wavpackenc.c File Reference
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.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)
 
#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
 
AVCodec ff_wavpack_encoder
 

Macro Definition Documentation

#define BITSTREAM_WRITER_LE

Definition at line 21 of file wavpackenc.c.

#define UPDATE_WEIGHT (   weight,
  delta,
  source,
  result 
)
Value:
if ((source) && (result)) { \
int32_t s = (int32_t) ((source) ^ (result)) >> 31; \
weight = ((delta) ^ s) + ((weight) - s); \
}
const char * s
Definition: avisynth_c.h:768
float delta
int32_t
static int weight(int i, int blen, int offset)
Definition: diracdec.c:1523

Definition at line 32 of file wavpackenc.c.

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

#define APPLY_WEIGHT_F (   weight,
  sample 
)
Value:
((((((sample) & 0xffff) * (weight)) >> 9) + \
((((sample) & ~0xffff) >> 9) * (weight)) + 1) >> 1)
#define sample
static int weight(int i, int blen, int offset)
Definition: diracdec.c:1523

Definition at line 38 of file wavpackenc.c.

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

Definition at line 41 of file wavpackenc.c.

Referenced by decorr_stereo_pass_id2(), and decorr_stereo_quick().

#define APPLY_WEIGHT (   weight,
  sample 
)
Value:
((sample) != (short) (sample) ? \
#define APPLY_WEIGHT_F(weight, sample)
Definition: wavpackenc.c:38
#define sample
#define APPLY_WEIGHT_I(weight, sample)
Definition: wavpackenc.c:41
static int weight(int i, int blen, int offset)
Definition: diracdec.c:1523

Definition at line 43 of file wavpackenc.c.

Referenced by decorr_mono(), decorr_stereo(), decorr_stereo_pass2(), and wavpack_encode_block().

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

Definition at line 48 of file wavpackenc.c.

Referenced by wavpack_encode_block().

#define SHIFT_MASK   (0x1FU << SHIFT_LSB)

Definition at line 49 of file wavpackenc.c.

Referenced by wavpack_encode_block().

#define MAG_LSB   18
#define MAG_MASK   (0x1FU << MAG_LSB)
#define SRATE_LSB   23

Definition at line 54 of file wavpackenc.c.

Referenced by set_samplerate().

#define SRATE_MASK   (0xFU << SRATE_LSB)

Definition at line 55 of file wavpackenc.c.

Referenced by wavpack_encode_block().

#define EXTRA_TRY_DELTAS   1

Definition at line 57 of file wavpackenc.c.

Referenced by analyze_mono(), analyze_stereo(), and wavpack_encode_init().

#define EXTRA_ADJUST_DELTAS   2

Definition at line 58 of file wavpackenc.c.

Referenced by analyze_mono(), analyze_stereo(), and wavpack_encode_init().

#define EXTRA_SORT_FIRST   4

Definition at line 59 of file wavpackenc.c.

Referenced by analyze_mono(), analyze_stereo(), and wavpack_encode_init().

#define EXTRA_BRANCHES   8

Definition at line 60 of file wavpackenc.c.

Referenced by analyze_mono(), analyze_stereo(), and wavpack_encode_init().

#define EXTRA_SORT_LAST   16

Definition at line 61 of file wavpackenc.c.

Referenced by analyze_mono(), analyze_stereo(), and wavpack_encode_init().

#define FLOAT_SHIFT_ONES   1

Definition at line 212 of file wavpackenc.c.

Referenced by scan_float().

#define FLOAT_SHIFT_SAME   2

Definition at line 213 of file wavpackenc.c.

Referenced by pack_float_sample(), and scan_float().

#define FLOAT_SHIFT_SENT   4

Definition at line 214 of file wavpackenc.c.

Referenced by pack_float_sample(), and scan_float().

#define FLOAT_ZEROS_SENT   8

Definition at line 215 of file wavpackenc.c.

Referenced by pack_float_sample(), and scan_float().

#define FLOAT_NEG_ZEROS   0x10

Definition at line 216 of file wavpackenc.c.

Referenced by pack_float_sample(), and scan_float().

#define FLOAT_EXCEPTIONS   0x20

Definition at line 217 of file wavpackenc.c.

Referenced by process_float(), and scan_float().

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

Definition at line 219 of file wavpackenc.c.

Referenced by pack_float_sample(), process_float(), and scan_float().

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

Definition at line 220 of file wavpackenc.c.

Referenced by pack_float_sample(), process_float(), and scan_float().

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

Definition at line 221 of file wavpackenc.c.

Referenced by pack_float_sample(), process_float(), and scan_float().

#define count_bits (   av)
Value:
( \
(av) < (1 << 8) ? nbits_table[av] : \
( \
(av) < (1 << 16) ? nbits_table[(av) >> 8] + 8 : \
((av) < (1 << 24) ? nbits_table[(av) >> 16] + 16 : nbits_table[(av) >> 24] + 24) \
) \
)
static const int8_t nbits_table[]
Definition: wavpackenc.h:653

Definition at line 1972 of file wavpackenc.c.

Referenced by encode_flush(), and wavpack_encode_sample().

#define update_weight_d2 (   weight,
  delta,
  source,
  result 
)
Value:
if (source && result) \
weight -= (((source ^ result) >> 29) & 4) - 2;
static int weight(int i, int blen, int offset)
Definition: diracdec.c:1523

Definition at line 2351 of file wavpackenc.c.

Referenced by decorr_stereo_pass_id2().

#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; \
}
const char * s
Definition: avisynth_c.h:768
int32_t
static int weight(int i, int blen, int offset)
Definition: diracdec.c:1523
if(ret< 0)
Definition: vf_mcdeint.c:279

Definition at line 2355 of file wavpackenc.c.

Referenced by decorr_stereo_pass_id2().

#define WRITE_DECWEIGHT (   type)
Value:
do { \
bytestream2_put_byte(&pb, temp); \
} while (0)
else temp
Definition: vf_mcdeint.c:256
GLint GLenum type
Definition: opengl_enc.c:105
static int8_t store_weight(int weight)
Definition: wavpackenc.c:521
static int restore_weight(int8_t weight)
Definition: wavpackenc.c:530

Referenced by wavpack_encode_block().

#define WRITE_DECSAMPLE (   type)
Value:
do { \
bytestream2_put_le16(&pb, temp); \
} while (0)
else temp
Definition: vf_mcdeint.c:256
static av_always_inline int wp_exp2(int16_t val)
Definition: wavpack.h:163
static int log2s(int32_t value)
Definition: wavpackenc.c:540
GLint GLenum type
Definition: opengl_enc.c:105

Referenced by wavpack_encode_block().

#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)
const char * s
Definition: avisynth_c.h:768
else temp
Definition: vf_mcdeint.c:256
static av_always_inline int wp_log2(uint32_t val)
Definition: wavpack.h:180
static av_always_inline int wp_exp2(int16_t val)
Definition: wavpack.h:163
for(j=16;j >0;--j)

Referenced by wavpack_encode_block().

#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)
static int shift(int a, int b)
Definition: sonic.c:82
#define src
Definition: vp8dsp.c:254
static const uint8_t offset[127][2]
Definition: vf_spp.c:92
GLint GLenum type
Definition: opengl_enc.c:105
for(j=16;j >0;--j)

Referenced by fill_buffer().

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

Definition at line 2959 of file wavpackenc.c.

Definition at line 2960 of file wavpackenc.c.

Function Documentation

static av_cold int wavpack_encode_init ( AVCodecContext avctx)
static

Definition at line 125 of file wavpackenc.c.

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

Definition at line 195 of file wavpackenc.c.

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

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

Definition at line 202 of file wavpackenc.c.

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

static void process_float ( WavPackEncodeContext s,
int32_t sample 
)
static

Definition at line 223 of file wavpackenc.c.

Referenced by scan_float().

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

Definition at line 264 of file wavpackenc.c.

Referenced by wavpack_encode_block().

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

Definition at line 350 of file wavpackenc.c.

Referenced by wavpack_encode_block().

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

Definition at line 431 of file wavpackenc.c.

Referenced by wavpack_encode_block().

static int8_t store_weight ( int  weight)
static
static int restore_weight ( int8_t  weight)
static

Definition at line 530 of file wavpackenc.c.

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

static int log2s ( int32_t  value)
static

Definition at line 540 of file wavpackenc.c.

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

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

Definition at line 545 of file wavpackenc.c.

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

static void reverse_mono_decorr ( struct Decorr dpp)
static

Definition at line 608 of file wavpackenc.c.

Referenced by decorr_mono_buffer(), and wv_mono().

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

Definition at line 640 of file wavpackenc.c.

Referenced by log2mono(), and log2stereo().

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

Definition at line 664 of file wavpackenc.c.

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

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

Definition at line 674 of file wavpackenc.c.

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

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

Definition at line 686 of file wavpackenc.c.

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

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

Definition at line 725 of file wavpackenc.c.

Referenced by analyze_mono().

static void sort_mono ( WavPackEncodeContext s,
WavPackExtraInfo info 
)
static

Definition at line 788 of file wavpackenc.c.

Referenced by analyze_mono().

static void delta_mono ( WavPackEncodeContext s,
WavPackExtraInfo info 
)
static

Definition at line 835 of file wavpackenc.c.

Referenced by analyze_mono().

static int allocate_buffers2 ( WavPackEncodeContext s,
int  nterms 
)
static

Definition at line 888 of file wavpackenc.c.

Referenced by analyze_mono(), and analyze_stereo().

static int allocate_buffers ( WavPackEncodeContext s)
static

Definition at line 908 of file wavpackenc.c.

Referenced by wv_mono(), and wv_stereo().

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

Definition at line 938 of file wavpackenc.c.

Referenced by wv_mono().

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

Definition at line 990 of file wavpackenc.c.

Referenced by wv_mono(), and wv_stereo().

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

Definition at line 1022 of file wavpackenc.c.

Referenced by wavpack_encode_block().

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 1128 of file wavpackenc.c.

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

static void reverse_decorr ( struct Decorr dpp)
static

Definition at line 1321 of file wavpackenc.c.

Referenced by decorr_stereo_buffer(), and wv_stereo().

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 1365 of file wavpackenc.c.

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

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 1501 of file wavpackenc.c.

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

static void sort_stereo ( WavPackEncodeContext s,
WavPackExtraInfo info 
)
static

Definition at line 1553 of file wavpackenc.c.

Referenced by analyze_stereo().

static void delta_stereo ( WavPackEncodeContext s,
WavPackExtraInfo info 
)
static

Definition at line 1610 of file wavpackenc.c.

Referenced by analyze_stereo().

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

Definition at line 1670 of file wavpackenc.c.

Referenced by analyze_stereo().

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

Definition at line 1743 of file wavpackenc.c.

Referenced by 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 1812 of file wavpackenc.c.

Referenced by wavpack_encode_block().

static void encode_flush ( WavPackEncodeContext s)
static

Definition at line 1980 of file wavpackenc.c.

Referenced by wavpack_encode_block(), and wavpack_encode_sample().

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

Definition at line 2053 of file wavpackenc.c.

Referenced by wavpack_encode_block().

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

Definition at line 2146 of file wavpackenc.c.

Referenced by wavpack_encode_block().

static void pack_float_sample ( WavPackEncodeContext s,
int32_t sample 
)
static

Definition at line 2171 of file wavpackenc.c.

Referenced by pack_float().

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

Definition at line 2226 of file wavpackenc.c.

Referenced by wavpack_encode_block().

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

Definition at line 2243 of file wavpackenc.c.

Referenced by wavpack_encode_block().

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

Definition at line 2362 of file wavpackenc.c.

Referenced by wavpack_encode_block().

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

Definition at line 2471 of file wavpackenc.c.

Referenced by 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 2480 of file wavpackenc.c.

Referenced by wavpack_encode_frame().

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

Definition at line 2824 of file wavpackenc.c.

Referenced by wavpack_encode_frame().

static void set_samplerate ( WavPackEncodeContext s)
static

Definition at line 2853 of file wavpackenc.c.

Referenced by wavpack_encode_frame().

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

Definition at line 2865 of file wavpackenc.c.

static av_cold int wavpack_encode_close ( AVCodecContext avctx)
static

Definition at line 2925 of file wavpackenc.c.

Variable Documentation

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 },
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: wavpackenc.c:2959
#define FLAGS
Definition: wavpackenc.c:2960

Definition at line 2961 of file wavpackenc.c.

const AVClass wavpack_encoder_class
static
Initial value:
= {
.class_name = "WavPack encoder",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
static const AVOption options[]
Definition: wavpackenc.c:2961

Definition at line 2967 of file wavpackenc.c.

AVCodec ff_wavpack_encoder
Initial value:
= {
.name = "wavpack",
.long_name = NULL_IF_CONFIG_SMALL("WavPack"),
.priv_data_size = sizeof(WavPackEncodeContext),
.priv_class = &wavpack_encoder_class,
}
float, planar
Definition: samplefmt.h:69
static av_cold int wavpack_encode_close(AVCodecContext *avctx)
Definition: wavpackenc.c:2925
static int wavpack_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: wavpackenc.c:2865
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static av_cold int wavpack_encode_init(AVCodecContext *avctx)
Definition: wavpackenc.c:125
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#define AV_CODEC_CAP_SMALL_LAST_FRAME
Codec can be fed a final frame with a smaller size.
Definition: avcodec.h:989
signed 32 bits, planar
Definition: samplefmt.h:68
unsigned 8 bits, planar
Definition: samplefmt.h:66
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
static const AVClass wavpack_encoder_class
Definition: wavpackenc.c:2967
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:701
signed 16 bits, planar
Definition: samplefmt.h:67

Definition at line 2974 of file wavpackenc.c.