MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / decode_subframe_lpc_33bps

Function decode_subframe_lpc_33bps

libavcodec/flacdec.c:481–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479}
480
481static 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
517static inline int decode_subframe(FLACContext *s, int channel)
518{

Callers 1

decode_subframeFunction · 0.85

Calls 5

get_sbits64Function · 0.85
av_logFunction · 0.85
get_sbitsFunction · 0.85
decode_residualsFunction · 0.85
get_bitsFunction · 0.70

Tested by

no test coverage detected