Reads the block data for a constant block */
| 534 | /** Reads the block data for a constant block |
| 535 | */ |
| 536 | static 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 |
no test coverage detected