50 for (i = 0, j = 0; j < 32; i += channels, j++) {
64 if (max == 0 && min == 0) {
69 if (max / 7 > -min / 8)
81 put_sbits(&pb, 4, av_clip(data[i] / scale, -8, 7));
85 #define HEADER_SIZE 36 91 bytestream_put_be16(&buf, 0x8000);
93 bytestream_put_byte(&buf, 3);
95 bytestream_put_byte(&buf, 4);
96 bytestream_put_byte(&buf, avctx->
channels);
98 bytestream_put_be32(&buf, 0);
99 bytestream_put_be16(&buf, c->
cutoff);
100 bytestream_put_byte(&buf, 3);
101 bytestream_put_byte(&buf, 0);
102 bytestream_put_be32(&buf, 0);
103 bytestream_put_be32(&buf, 0);
104 bytestream_put_be16(&buf, 0);
128 const AVFrame *frame,
int *got_packet_ptr)
131 const int16_t *samples = (
const int16_t *)frame->
data[0];
133 int ch, out_size, ret;
152 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 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_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. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
AVCodec ff_adpcm_adx_encoder
int ff_alloc_packet(AVPacket *avpkt, int size)
Check AVPacket size and/or allocate data.
if(ac->has_optimized_func)
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 init(AVCodecParserContext *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
This structure stores compressed data.