49 for (i = 0, j = 0; j < 32; i +=
channels, j++) {
60 if (max == 0 && min == 0) {
67 if (max / 7 > -min / 8)
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);
144 const int16_t *samples = frame ? (
const int16_t *)frame->
data[0] :
NULL;
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);
179 for (ch = 0; ch < avctx->
channels; ch++) {
This structure describes decoded (raw) audio or video data.
static void put_sbits(PutBitContext *pb, int n, int32_t value)
static av_cold int init(AVCodecContext *avctx)
static void adx_encode(ADXContext *c, uint8_t *adx, const int16_t *wav, ADXChannelState *prev, int channels)
void ff_adx_calculate_coeffs(int cutoff, int sample_rate, int bits, int *coeff)
Calculate LPC coefficients based on cutoff frequency and sample rate.
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size)
Check AVPacket size and/or allocate data.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
#define ROUNDED_DIV(a, b)
#define i(width, name, range_min, range_max)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
const char * name
Name of the codec implementation.
AVCodec ff_adpcm_adx_encoder
int frame_size
Number of samples per channel in an audio frame.
Libavcodec external API header.
AVSampleFormat
Audio sample formats.
int sample_rate
samples per second
main external API structure.
static int adx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static av_cold int adx_encode_init(AVCodecContext *avctx)
static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)
static int adx_encode_header(AVCodecContext *avctx, uint8_t *buf, int bufsize)
int channels
number of audio channels
static enum AVSampleFormat sample_fmts[]
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...