49 for (
i = 0, j = 0; j < 32;
i +=
channels, j++) {
60 if (
max == 0 &&
min == 0) {
81 for (
i = 0, j = 0; j < 32;
i +=
channels, j++) {
98 #define HEADER_SIZE 36
104 bytestream_put_be16(&buf, 0x8000);
106 bytestream_put_byte(&buf, 3);
108 bytestream_put_byte(&buf, 4);
109 bytestream_put_byte(&buf, avctx->
channels);
111 bytestream_put_be32(&buf, 0);
112 bytestream_put_be16(&buf,
c->cutoff);
113 bytestream_put_byte(&buf, 3);
114 bytestream_put_byte(&buf, 0);
115 bytestream_put_be32(&buf, 0);
116 bytestream_put_be32(&buf, 0);
117 bytestream_put_be16(&buf, 0);
155 bytestream_put_be16(&dst, 0x8001);
156 bytestream_put_be16(&dst, 0x000E);
157 bytestream_put_be64(&dst, 0x0);
158 bytestream_put_be32(&dst, 0x0);
159 bytestream_put_be16(&dst, 0x0);
169 if (!
c->header_parsed) {
176 c->header_parsed = 1;
179 for (ch = 0; ch < avctx->
channels; ch++) {
static enum AVSampleFormat sample_fmts[]
void ff_adx_calculate_coeffs(int cutoff, int sample_rate, int bits, int *coeff)
Calculate LPC coefficients based on cutoff frequency and sample rate.
static int adx_encode_header(AVCodecContext *avctx, uint8_t *buf, int bufsize)
static void adx_encode(ADXContext *c, uint8_t *adx, const int16_t *wav, ADXChannelState *prev, int channels)
static av_cold int adx_encode_init(AVCodecContext *avctx)
AVCodec ff_adpcm_adx_encoder
static int adx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Libavcodec external API header.
static av_cold int init(AVCodecContext *avctx)
static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)
#define ROUNDED_DIV(a, b)
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size)
Check AVPacket size and/or allocate data.
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVSampleFormat
Audio sample formats.
@ AV_SAMPLE_FMT_S16
signed 16 bits
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static void put_sbits(PutBitContext *pb, int n, int32_t value)
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
main external API structure.
int sample_rate
samples per second
int channels
number of audio channels
int frame_size
Number of samples per channel in an audio frame.
const char * name
Name of the codec implementation.
This structure describes decoded (raw) audio or video data.
int nb_samples
number of audio samples (per channel) described by this frame
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
This structure stores compressed data.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...