21 #define BITSTREAM_WRITER_LE
68 qm[0] -= dx[0]; qm[1] -= dx[1]; qm[2] -= dx[2]; qm[3] -= dx[3];
69 qm[4] -= dx[4]; qm[5] -= dx[5]; qm[6] -= dx[6]; qm[7] -= dx[7];
70 }
else if (c->
error > 0) {
71 qm[0] += dx[0]; qm[1] += dx[1]; qm[2] += dx[2]; qm[3] += dx[3];
72 qm[4] += dx[4]; qm[5] += dx[5]; qm[6] += dx[6]; qm[7] += dx[7];
75 sum += dl[0] * qm[0] + dl[1] * qm[1] + dl[2] * qm[2] + dl[3] * qm[3] +
76 dl[4] * qm[4] + dl[5] * qm[5] + dl[6] * qm[6] + dl[7] * qm[7];
78 dx[0] = dx[1]; dx[1] = dx[2]; dx[2] = dx[3]; dx[3] = dx[4];
79 dl[0] = dl[1]; dl[1] = dl[2]; dl[2] = dl[3]; dl[3] = dl[4];
81 dx[4] = ((dl[4] >> 30) | 1);
82 dx[5] = ((dl[5] >> 30) | 2) & ~1;
83 dx[6] = ((dl[6] >> 30) | 2) & ~1;
84 dx[7] = ((dl[7] >> 30) | 4) & ~3;
86 dl[4] = -dl[5]; dl[5] = -dl[6];
87 dl[6] = *in - dl[7]; dl[7] = *
in;
88 dl[5] += dl[6]; dl[4] += dl[5];
90 *in -= (sum >> c->
shift);
102 const int16_t *ptr = (
const int16_t *)frame->
data[0];
106 ret = ptr[sample] >> 8;
117 int ret, i, out_bytes, cur_chan = 0,
res = 0, samples = 0;
124 for (i = 0; i < avctx->
channels; i++) {
134 uint32_t k, unary, outval;
140 if (cur_chan < avctx->channels - 1)
147 #define PRED(x, k) (int32_t)((((uint64_t)x << k) - x) >> k)
156 outval = (value > 0) ? (value << 1) - 1: -value << 1;
160 rice->
sum0 += outval - (rice->
sum0 >> 4);
170 rice->
sum1 += outval - (rice->
sum1 >> 4);
176 unary = 1 + (outval >> k);
182 put_bits(&pb, unary, (1 << unary) - 1);
193 if (cur_chan < avctx->channels - 1)
205 avpkt->
size = out_bytes + 4;