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

Function decode_blocks_ind

libavcodec/alsdec.c:1004–1037  ·  view source on GitHub ↗

Decodes blocks independently. */

Source from the content-addressed store, hash-verified

1002/** Decodes blocks independently.
1003 */
1004static int decode_blocks_ind(ALSDecContext *ctx, unsigned int ra_frame,
1005 unsigned int c, const unsigned int *div_blocks,
1006 unsigned int *js_blocks)
1007{
1008 unsigned int b;
1009 ALSBlockData bd;
1010
1011 memset(&bd, 0, sizeof(ALSBlockData));
1012
1013 bd.ra_block = ra_frame;
1014 bd.use_ltp = ctx->use_ltp;
1015 bd.ltp_lag = ctx->ltp_lag;
1016 bd.ltp_gain = ctx->ltp_gain[0];
1017 bd.quant_cof = ctx->quant_cof[0];
1018 bd.lpc_cof = ctx->lpc_cof[0];
1019 bd.prev_raw_samples = ctx->prev_raw_samples;
1020 bd.raw_samples = ctx->raw_samples[c];
1021
1022
1023 for (b = 0; b < ctx->num_blocks; b++) {
1024 bd.shift_lsbs = 0;
1025 bd.block_length = div_blocks[b];
1026
1027 if (read_decode_block(ctx, &bd)) {
1028 // damaged block, write zero for the rest of the frame
1029 zero_remaining(b, ctx->num_blocks, div_blocks, bd.raw_samples);
1030 return -1;
1031 }
1032 bd.raw_samples += div_blocks[b];
1033 bd.ra_block = 0;
1034 }
1035
1036 return 0;
1037}
1038
1039
1040/** Decodes blocks dependently.

Callers 1

read_frame_dataFunction · 0.85

Calls 2

read_decode_blockFunction · 0.85
zero_remainingFunction · 0.85

Tested by

no test coverage detected