#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"
#include "put_bits.h"
#include "lpc.h"
#include "mathops.h"
#include "alac_data.h"
Go to the source code of this file.
|
static void | init_sample_buffers (AlacEncodeContext *s, int channels, const uint8_t *samples[2]) |
|
static void | encode_scalar (AlacEncodeContext *s, int x, int k, int write_sample_size) |
|
static void | write_element_header (AlacEncodeContext *s, enum AlacRawDataBlockType element, int instance) |
|
static void | calc_predictor_params (AlacEncodeContext *s, int ch) |
|
static int | estimate_stereo_mode (int32_t *left_ch, int32_t *right_ch, int n) |
|
static void | alac_stereo_decorrelation (AlacEncodeContext *s) |
|
static void | alac_linear_predictor (AlacEncodeContext *s, int ch) |
|
static void | alac_entropy_coder (AlacEncodeContext *s, int ch) |
|
static void | write_element (AlacEncodeContext *s, enum AlacRawDataBlockType element, int instance, const uint8_t *samples0, const uint8_t *samples1) |
|
static int | write_frame (AlacEncodeContext *s, AVPacket *avpkt, uint8_t *const *samples) |
|
static av_always_inline int | get_max_frame_size (int frame_size, int ch, int bps) |
|
static av_cold int | alac_encode_close (AVCodecContext *avctx) |
|
static av_cold int | alac_encode_init (AVCodecContext *avctx) |
|
static int | alac_encode_frame (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) |
|
◆ DEFAULT_FRAME_SIZE
#define DEFAULT_FRAME_SIZE 4096 |
◆ ALAC_EXTRADATA_SIZE
#define ALAC_EXTRADATA_SIZE 36 |
◆ ALAC_FRAME_HEADER_SIZE
#define ALAC_FRAME_HEADER_SIZE 55 |
◆ ALAC_FRAME_FOOTER_SIZE
#define ALAC_FRAME_FOOTER_SIZE 3 |
◆ ALAC_ESCAPE_CODE
#define ALAC_ESCAPE_CODE 0x1FF |
◆ ALAC_MAX_LPC_ORDER
#define ALAC_MAX_LPC_ORDER 30 |
◆ DEFAULT_MAX_PRED_ORDER
#define DEFAULT_MAX_PRED_ORDER 6 |
◆ DEFAULT_MIN_PRED_ORDER
#define DEFAULT_MIN_PRED_ORDER 4 |
◆ ALAC_MAX_LPC_PRECISION
#define ALAC_MAX_LPC_PRECISION 9 |
◆ ALAC_MIN_LPC_SHIFT
#define ALAC_MIN_LPC_SHIFT 0 |
◆ ALAC_MAX_LPC_SHIFT
#define ALAC_MAX_LPC_SHIFT 9 |
◆ ALAC_CHMODE_LEFT_RIGHT
#define ALAC_CHMODE_LEFT_RIGHT 0 |
◆ ALAC_CHMODE_LEFT_SIDE
#define ALAC_CHMODE_LEFT_SIDE 1 |
◆ ALAC_CHMODE_RIGHT_SIDE
#define ALAC_CHMODE_RIGHT_SIDE 2 |
◆ ALAC_CHMODE_MID_SIDE
#define ALAC_CHMODE_MID_SIDE 3 |
◆ COPY_SAMPLES
#define COPY_SAMPLES |
( |
|
type | ) |
|
Value: do { \
int32_t *bptr =
s->sample_buf[ch]; \
for (
i = 0;
i <
s->frame_size;
i++) \
} \
} while (0)
◆ OFFSET
◆ AE
◆ init_sample_buffers()
static void init_sample_buffers |
( |
AlacEncodeContext * |
s, |
|
|
int |
channels, |
|
|
const uint8_t * |
samples[2] |
|
) |
| |
|
static |
◆ encode_scalar()
static void encode_scalar |
( |
AlacEncodeContext * |
s, |
|
|
int |
x, |
|
|
int |
k, |
|
|
int |
write_sample_size |
|
) |
| |
|
static |
◆ write_element_header()
◆ calc_predictor_params()
◆ estimate_stereo_mode()
static int estimate_stereo_mode |
( |
int32_t * |
left_ch, |
|
|
int32_t * |
right_ch, |
|
|
int |
n |
|
) |
| |
|
static |
◆ alac_stereo_decorrelation()
◆ alac_linear_predictor()
◆ alac_entropy_coder()
◆ write_element()
◆ write_frame()
◆ get_max_frame_size()
static av_always_inline int get_max_frame_size |
( |
int |
frame_size, |
|
|
int |
ch, |
|
|
int |
bps |
|
) |
| |
|
static |
◆ alac_encode_close()
◆ alac_encode_init()
◆ alac_encode_frame()
◆ options
◆ alacenc_class
Initial value:= {
.class_name = "alacenc",
}
Definition at line 630 of file alacenc.c.
◆ ff_alac_encoder
#define DEFAULT_MIN_PRED_ORDER
static av_cold int alac_encode_init(AVCodecContext *avctx)
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
#define DEFAULT_MAX_PRED_ORDER
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
static const AVClass alacenc_class
#define FF_CODEC_ENCODE_CB(func)
static int alac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
#define CODEC_LONG_NAME(str)
#define LIBAVUTIL_VERSION_INT
const char * av_default_item_name(void *ptr)
Return the context name.
static const AVOption options[]
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
static int shift(int a, int b)
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
#define ALAC_MAX_LPC_ORDER
#define i(width, name, range_min, range_max)
const AVChannelLayout ff_alac_ch_layouts[ALAC_MAX_CHANNELS+1]
AVSampleFormat
Audio sample formats.
@ AV_OPT_TYPE_INT
Underlying C type is int.
Filter the word “frame” indicates either a video frame or a group of audio samples
static av_cold int alac_encode_close(AVCodecContext *avctx)
#define AV_CODEC_CAP_SMALL_LAST_FRAME
Codec can be fed a final frame with a smaller size.