72 int need32 = s->bps > 16;
76 if (need32 || want32) {
160 int metadata_type, metadata_size, ret;
190 int metadata_last, metadata_size;
191 const uint8_t *buf_end = buf + buf_size;
195 if (buf_end - buf < 4)
199 if (buf_end - buf < metadata_size) {
203 buf += metadata_size;
204 }
while (!metadata_last);
206 return buf_size - (buf_end - buf);
211 int i, tmp, partition, method_type, rice_order;
212 int rice_bits, rice_esc;
216 if (method_type > 1) {
225 if (pred_order > samples) {
227 pred_order, samples);
231 rice_bits = 4 + method_type;
232 rice_esc = (1 << rice_bits) - 1;
234 decoded += pred_order;
236 for (partition = 0; partition < (1 << rice_order); partition++) {
238 if (tmp == rice_esc) {
254 int pred_order,
int bps)
260 for (i = 0; i < pred_order; i++) {
268 a = decoded[pred_order-1];
270 b = a - decoded[pred_order-2];
272 c = b - decoded[pred_order-2] + decoded[pred_order-3];
274 d = c - decoded[pred_order-2] + 2*decoded[pred_order-3] - decoded[pred_order-4];
276 switch (pred_order) {
280 for (i = pred_order; i < blocksize; i++)
281 decoded[i] = a += decoded[i];
284 for (i = pred_order; i < blocksize; i++)
285 decoded[i] = a += b += decoded[i];
288 for (i = pred_order; i < blocksize; i++)
289 decoded[i] = a += b += c += decoded[i];
292 for (i = pred_order; i < blocksize; i++)
293 decoded[i] = a += b += c += d += decoded[i];
307 int coeff_prec, qlevel;
311 for (i = 0; i < pred_order; i++) {
316 if (coeff_prec == 16) {
327 for (i = 0; i < pred_order; i++) {
328 coeffs[pred_order - i - 1] =
get_sbits(&s->
gb, coeff_prec);
342 int type, wasted = 0;
367 "Invalid number of wasted bits > available bits (%d) - left=%d\n",
385 }
else if (type == 1) {
388 }
else if ((type >= 8) && (type <= 12)) {
391 }
else if (type >= 32) {
402 decoded[i] <<= wasted;
419 if (s->channels && fi.channels != s->channels && s->
got_streaminfo) {
431 if (!s->bps && !fi.bps) {
437 }
else if (s->bps && fi.bps != s->bps) {
448 if (!s->max_blocksize)
457 if (!s->samplerate && !fi.samplerate) {
459 " or frame header\n");
462 if (fi.samplerate == 0)
463 fi.samplerate = s->samplerate;
478 for (i = 0; i < s->channels; i++) {
492 int *got_frame_ptr,
AVPacket *avpkt)
495 int buf_size = avpkt->
size;
502 if (s->max_framesize == 0) {
541 if (bytes_read > buf_size) {
545 if (bytes_read < buf_size) {
547 buf_size - bytes_read, buf_size);