FFmpeg
|
#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 |
#define BITSTREAM_WRITER_LE |
Definition at line 21 of file wavpackenc.c.
Definition at line 32 of file wavpackenc.c.
Referenced by decorr_mono(), decorr_stereo(), decorr_stereo_pass2(), decorr_stereo_quick(), and wavpack_encode_block().
Definition at line 41 of file wavpackenc.c.
Referenced by decorr_stereo_pass_id2(), and decorr_stereo_quick().
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)); |
Definition at line 46 of file wavpackenc.c.
Referenced by decorr_mono_buffer(), decorr_stereo_buffer(), delta_mono(), delta_stereo(), recurse_mono(), recurse_stereo(), sort_mono(), sort_stereo(), wavpack_encode_block(), wavpack_encode_sample(), wv_mono(), and wv_stereo().
#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 |
Definition at line 51 of file wavpackenc.c.
Referenced by analyze_mono(), analyze_stereo(), scan_float(), scan_int23(), scan_int32(), wavpack_encode_block(), wavpack_encode_frame(), wv_mono(), and wv_stereo().
#define MAG_MASK (0x1FU << MAG_LSB) |
Definition at line 52 of file wavpackenc.c.
Referenced by analyze_mono(), analyze_stereo(), scan_float(), scan_int23(), scan_int32(), wavpack_encode_block(), wv_mono(), and wv_stereo().
#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 207 of file wavpackenc.c.
Referenced by scan_float().
#define FLOAT_SHIFT_SAME 2 |
Definition at line 208 of file wavpackenc.c.
Referenced by pack_float_sample(), and scan_float().
#define FLOAT_SHIFT_SENT 4 |
Definition at line 209 of file wavpackenc.c.
Referenced by pack_float_sample(), and scan_float().
#define FLOAT_ZEROS_SENT 8 |
Definition at line 210 of file wavpackenc.c.
Referenced by pack_float_sample(), and scan_float().
#define FLOAT_NEG_ZEROS 0x10 |
Definition at line 211 of file wavpackenc.c.
Referenced by pack_float_sample(), and scan_float().
#define FLOAT_EXCEPTIONS 0x20 |
Definition at line 212 of file wavpackenc.c.
Referenced by process_float(), and scan_float().
#define get_mantissa | ( | f | ) | ((f) & 0x7fffff) |
Definition at line 214 of file wavpackenc.c.
Referenced by pack_float_sample(), process_float(), and scan_float().
#define get_exponent | ( | f | ) | (((f) >> 23) & 0xff) |
Definition at line 215 of file wavpackenc.c.
Referenced by pack_float_sample(), process_float(), and scan_float().
#define get_sign | ( | f | ) | (((f) >> 31) & 0x1) |
Definition at line 216 of file wavpackenc.c.
Referenced by pack_float_sample(), process_float(), and scan_float().
#define count_bits | ( | av | ) |
Definition at line 1967 of file wavpackenc.c.
Referenced by encode_flush(), and wavpack_encode_sample().
Definition at line 2351 of file wavpackenc.c.
Referenced by decorr_stereo_pass_id2().
Definition at line 2355 of file wavpackenc.c.
Referenced by decorr_stereo_pass_id2().
#define WRITE_DECWEIGHT | ( | type | ) |
Referenced by wavpack_encode_block().
#define WRITE_DECSAMPLE | ( | type | ) |
#define WRITE_CHAN_ENTROPY | ( | chan | ) |
#define OFFSET | ( | x | ) | offsetof(WavPackEncodeContext, x) |
Definition at line 2953 of file wavpackenc.c.
#define FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM |
Definition at line 2954 of file wavpackenc.c.
|
static |
Definition at line 125 of file wavpackenc.c.
Definition at line 190 of file wavpackenc.c.
Referenced by scan_float(), scan_int23(), scan_int32(), and wavpack_encode_block().
Definition at line 197 of file wavpackenc.c.
Referenced by scan_float(), scan_int23(), scan_int32(), and wavpack_encode_block().
|
static |
Definition at line 218 of file wavpackenc.c.
Referenced by scan_float().
|
static |
Definition at line 259 of file wavpackenc.c.
Referenced by wavpack_encode_block().
|
static |
Definition at line 345 of file wavpackenc.c.
Referenced by wavpack_encode_block().
|
static |
Definition at line 426 of file wavpackenc.c.
Referenced by wavpack_encode_block().
|
static |
Definition at line 516 of file wavpackenc.c.
Referenced by decorr_mono(), decorr_stereo(), decorr_stereo_quick(), and wavpack_encode_block().
|
static |
Definition at line 525 of file wavpackenc.c.
Referenced by decorr_mono(), decorr_stereo(), and decorr_stereo_quick().
|
static |
Definition at line 535 of file wavpackenc.c.
Referenced by decorr_mono(), decorr_stereo(), and decorr_stereo_quick().
|
static |
Definition at line 540 of file wavpackenc.c.
Referenced by analyze_mono(), decorr_mono_buffer(), and wv_mono().
Definition at line 603 of file wavpackenc.c.
Referenced by decorr_mono_buffer(), and wv_mono().
|
static |
Definition at line 635 of file wavpackenc.c.
Referenced by log2mono(), and log2stereo().
|
static |
Definition at line 659 of file wavpackenc.c.
Referenced by analyze_mono(), delta_mono(), recurse_mono(), sort_mono(), and wv_mono().
|
static |
Definition at line 669 of file wavpackenc.c.
Referenced by analyze_stereo(), delta_stereo(), recurse_stereo(), sort_stereo(), and wv_stereo().
|
static |
Definition at line 681 of file wavpackenc.c.
Referenced by delta_mono(), recurse_mono(), and sort_mono().
|
static |
Definition at line 720 of file wavpackenc.c.
Referenced by analyze_mono().
|
static |
Definition at line 783 of file wavpackenc.c.
Referenced by analyze_mono().
|
static |
Definition at line 830 of file wavpackenc.c.
Referenced by analyze_mono().
|
static |
Definition at line 883 of file wavpackenc.c.
Referenced by analyze_mono(), and analyze_stereo().
|
static |
Definition at line 903 of file wavpackenc.c.
Referenced by wv_mono(), and wv_stereo().
|
static |
Definition at line 933 of file wavpackenc.c.
Referenced by wv_mono().
|
static |
Definition at line 985 of file wavpackenc.c.
Referenced by wv_mono(), and wv_stereo().
|
static |
Definition at line 1017 of file wavpackenc.c.
Referenced by wavpack_encode_block().
|
static |
Definition at line 1123 of file wavpackenc.c.
Referenced by analyze_stereo(), decorr_stereo_buffer(), and wv_stereo().
Definition at line 1316 of file wavpackenc.c.
Referenced by decorr_stereo_buffer(), and wv_stereo().
|
static |
Definition at line 1360 of file wavpackenc.c.
Referenced by analyze_stereo(), decorr_stereo_buffer(), and wv_stereo().
|
static |
Definition at line 1496 of file wavpackenc.c.
Referenced by delta_stereo(), recurse_stereo(), and sort_stereo().
|
static |
Definition at line 1548 of file wavpackenc.c.
Referenced by analyze_stereo().
|
static |
Definition at line 1605 of file wavpackenc.c.
Referenced by analyze_stereo().
|
static |
Definition at line 1665 of file wavpackenc.c.
Referenced by analyze_stereo().
|
static |
Definition at line 1738 of file wavpackenc.c.
Referenced by wv_stereo().
|
static |
Definition at line 1807 of file wavpackenc.c.
Referenced by wavpack_encode_block().
|
static |
Definition at line 1975 of file wavpackenc.c.
Referenced by wavpack_encode_block(), and wavpack_encode_sample().
|
static |
Definition at line 2048 of file wavpackenc.c.
Referenced by wavpack_encode_block().
|
static |
Definition at line 2141 of file wavpackenc.c.
Referenced by wavpack_encode_block().
|
static |
Definition at line 2170 of file wavpackenc.c.
Referenced by pack_float().
|
static |
Definition at line 2226 of file wavpackenc.c.
Referenced by wavpack_encode_block().
|
static |
Definition at line 2243 of file wavpackenc.c.
Referenced by wavpack_encode_block().
|
static |
Definition at line 2362 of file wavpackenc.c.
Referenced by wavpack_encode_block().
|
static |
Definition at line 2471 of file wavpackenc.c.
Referenced by wavpack_encode_block().
|
static |
Definition at line 2480 of file wavpackenc.c.
Referenced by wavpack_encode_frame().
|
static |
Definition at line 2819 of file wavpackenc.c.
Referenced by wavpack_encode_frame().
|
static |
Definition at line 2848 of file wavpackenc.c.
Referenced by wavpack_encode_frame().
|
static |
Definition at line 2860 of file wavpackenc.c.
|
static |
Definition at line 2919 of file wavpackenc.c.
|
static |
Definition at line 2955 of file wavpackenc.c.
|
static |
Definition at line 2966 of file wavpackenc.c.
AVCodec ff_wavpack_encoder |
Definition at line 2973 of file wavpackenc.c.