- /* stereo: 4 bytes (8 samples) for left, 4 bytes for right, 4 bytes left, ... */
- if(avctx->trellis > 0) {
- FF_ALLOC_OR_GOTO(avctx, buf, 2*n*8, error);
- adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n*8);
- if(avctx->channels == 2)
- adpcm_compress_trellis(avctx, samples+1, buf + n*8, &c->status[1], n*8);
- for(i=0; i<n; i++) {
- *dst++ = buf[8*i+0] | (buf[8*i+1] << 4);
- *dst++ = buf[8*i+2] | (buf[8*i+3] << 4);
- *dst++ = buf[8*i+4] | (buf[8*i+5] << 4);
- *dst++ = buf[8*i+6] | (buf[8*i+7] << 4);
- if (avctx->channels == 2) {
- uint8_t *buf1 = buf + n*8;
- *dst++ = buf1[8*i+0] | (buf1[8*i+1] << 4);
- *dst++ = buf1[8*i+2] | (buf1[8*i+3] << 4);
- *dst++ = buf1[8*i+4] | (buf1[8*i+5] << 4);
- *dst++ = buf1[8*i+6] | (buf1[8*i+7] << 4);
- }
+ /* stereo: 4 bytes (8 samples) for left,
+ 4 bytes for right, 4 bytes left, ... */
+ if (avctx->trellis > 0) {
+ FF_ALLOC_OR_GOTO(avctx, buf, 2 * n * 8, error);
+ adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n * 8);
+ if (avctx->channels == 2)
+ adpcm_compress_trellis(avctx, samples + 1, buf + n * 8,
+ &c->status[1], n * 8);
+ for (i = 0; i < n; i++) {
+ *dst++ = buf[8 * i + 0] | (buf[8 * i + 1] << 4);
+ *dst++ = buf[8 * i + 2] | (buf[8 * i + 3] << 4);
+ *dst++ = buf[8 * i + 4] | (buf[8 * i + 5] << 4);
+ *dst++ = buf[8 * i + 6] | (buf[8 * i + 7] << 4);
+ if (avctx->channels == 2) {
+ uint8_t *buf1 = buf + n * 8;
+ *dst++ = buf1[8 * i + 0] | (buf1[8 * i + 1] << 4);
+ *dst++ = buf1[8 * i + 2] | (buf1[8 * i + 3] << 4);
+ *dst++ = buf1[8 * i + 4] | (buf1[8 * i + 5] << 4);
+ *dst++ = buf1[8 * i + 6] | (buf1[8 * i + 7] << 4);