ADXContext *c = avctx->priv_data;
const int16_t *samples = data;
uint8_t *dst = frame;
- int rest = avctx->frame_size;
if (!c->header_parsed) {
int hdrsize = adx_encode_header(avctx, dst, buf_size);
}
if (avctx->channels == 1) {
- while (rest >= 32) {
adx_encode(c, dst, samples, c->prev, avctx->channels);
dst += 18;
- samples += 32;
- rest -= 32;
- }
} else {
- while (rest >= 32*2) {
adx_encode(c, dst, samples, c->prev, avctx->channels);
adx_encode(c, dst + 18, samples + 1, c->prev + 1, avctx->channels);
dst += 18*2;
- samples += 32*2;
- rest -= 32*2;
- }
}
return dst - frame;
}