| 479 | } |
| 480 | |
| 481 | static int decode_subframe_lpc_33bps(FLACContext *s, int64_t *decoded, |
| 482 | int32_t *residual, int pred_order) |
| 483 | { |
| 484 | int i, ret; |
| 485 | int coeff_prec, qlevel; |
| 486 | int coeffs[32]; |
| 487 | |
| 488 | /* warm up samples */ |
| 489 | for (i = 0; i < pred_order; i++) { |
| 490 | decoded[i] = get_sbits64(&s->gb, 33); |
| 491 | } |
| 492 | |
| 493 | coeff_prec = get_bits(&s->gb, 4) + 1; |
| 494 | if (coeff_prec == 16) { |
| 495 | av_log(s->avctx, AV_LOG_ERROR, "invalid coeff precision\n"); |
| 496 | return AVERROR_INVALIDDATA; |
| 497 | } |
| 498 | qlevel = get_sbits(&s->gb, 5); |
| 499 | if (qlevel < 0) { |
| 500 | av_log(s->avctx, AV_LOG_ERROR, "qlevel %d not supported, maybe buggy stream\n", |
| 501 | qlevel); |
| 502 | return AVERROR_INVALIDDATA; |
| 503 | } |
| 504 | |
| 505 | for (i = 0; i < pred_order; i++) { |
| 506 | coeffs[pred_order - i - 1] = get_sbits(&s->gb, coeff_prec); |
| 507 | } |
| 508 | |
| 509 | if ((ret = decode_residuals(s, residual, pred_order)) < 0) |
| 510 | return ret; |
| 511 | |
| 512 | s->dsp.lpc33(decoded, residual, coeffs, pred_order, qlevel, s->blocksize); |
| 513 | |
| 514 | return 0; |
| 515 | } |
| 516 | |
| 517 | static inline int decode_subframe(FLACContext *s, int channel) |
| 518 | { |
no test coverage detected