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

Function read_const_block_data

libavcodec/alsdec.c:536–556  ·  view source on GitHub ↗

Reads the block data for a constant block */

Source from the content-addressed store, hash-verified

534/** Reads the block data for a constant block
535 */
536static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
537{
538 ALSSpecificConfig *sconf = &ctx->sconf;
539 AVCodecContext *avctx = ctx->avctx;
540 GetBitContext *gb = &ctx->gb;
541
542 bd->const_val = 0;
543 bd->const_block = get_bits1(gb); // 1 = constant value, 0 = zero block (silence)
544 bd->js_blocks = get_bits1(gb);
545
546 // skip 5 reserved bits
547 skip_bits(gb, 5);
548
549 if (bd->const_block) {
550 unsigned int const_val_bits = sconf->floating ? 24 : avctx->bits_per_raw_sample;
551 bd->const_val = get_sbits_long(gb, const_val_bits);
552 }
553
554 // ensure constant block decoding by reusing this field
555 bd->const_block = 1;
556}
557
558
559/** Decodes the block data for a constant block

Callers 1

read_blockFunction · 0.85

Calls 3

get_bits1Function · 0.85
skip_bitsFunction · 0.85
get_sbits_longFunction · 0.85

Tested by

no test coverage detected