Lines Matching refs:blk
273 int blk, ch; in ff_ac3_compute_coupling_strategy() local
279 for (blk = 0; blk < s->num_blocks; blk++) { in ff_ac3_compute_coupling_strategy()
280 AC3Block *block = &s->blocks[blk]; in ff_ac3_compute_coupling_strategy()
289 for (blk = 0; blk < s->num_blocks; blk++) { in ff_ac3_compute_coupling_strategy()
290 AC3Block *block = &s->blocks[blk]; in ff_ac3_compute_coupling_strategy()
302 block->new_cpl_strategy = !blk; in ff_ac3_compute_coupling_strategy()
303 if (blk) { in ff_ac3_compute_coupling_strategy()
305 if (block->channel_in_cpl[ch] != s->blocks[blk-1].channel_in_cpl[ch]) { in ff_ac3_compute_coupling_strategy()
313 if (!blk || (block->cpl_in_use && !got_cpl_snr)) { in ff_ac3_compute_coupling_strategy()
325 for (blk = 0; blk < s->num_blocks; blk++) { in ff_ac3_compute_coupling_strategy()
326 AC3Block *block = &s->blocks[blk]; in ff_ac3_compute_coupling_strategy()
345 int blk, bnd, i; in ac3_apply_rematrixing() local
352 for (blk = 0; blk < s->num_blocks; blk++) { in ac3_apply_rematrixing()
353 AC3Block *block = &s->blocks[blk]; in ac3_apply_rematrixing()
427 int ch, blk, blk1; in compute_exp_strategy() local
438 for (blk = 1; blk < s->num_blocks; blk++, exp += AC3_MAX_COEFS) { in compute_exp_strategy()
440 if (!s->blocks[blk-1].cpl_in_use) { in compute_exp_strategy()
441 exp_strategy[blk] = EXP_NEW; in compute_exp_strategy()
443 } else if (!s->blocks[blk].cpl_in_use) { in compute_exp_strategy()
444 exp_strategy[blk] = EXP_REUSE; in compute_exp_strategy()
447 } else if (s->blocks[blk].channel_in_cpl[ch] != s->blocks[blk-1].channel_in_cpl[ch]) { in compute_exp_strategy()
448 exp_strategy[blk] = EXP_NEW; in compute_exp_strategy()
452 exp_strategy[blk] = EXP_REUSE; in compute_exp_strategy()
453 …if (ch == CPL_CH && exp_diff > (EXP_DIFF_THRESHOLD * (s->blocks[blk].end_freq[ch] - s->start_freq[… in compute_exp_strategy()
454 exp_strategy[blk] = EXP_NEW; in compute_exp_strategy()
456 exp_strategy[blk] = EXP_NEW; in compute_exp_strategy()
461 blk = 0; in compute_exp_strategy()
462 while (blk < s->num_blocks) { in compute_exp_strategy()
463 blk1 = blk + 1; in compute_exp_strategy()
466 exp_strategy[blk] = exp_strategy_reuse_tab[s->num_blks_code][blk1-blk-1]; in compute_exp_strategy()
467 blk = blk1; in compute_exp_strategy()
473 for (blk = 1; blk < s->num_blocks; blk++) in compute_exp_strategy()
474 s->exp_strategy[ch][blk] = EXP_REUSE; in compute_exp_strategy()
566 int blk, blk1, ch, cpl; in encode_exponents() local
575 blk = 0; in encode_exponents()
576 while (blk < s->num_blocks) { in encode_exponents()
577 AC3Block *block = &s->blocks[blk]; in encode_exponents()
580 blk++; in encode_exponents()
584 blk1 = blk + 1; in encode_exponents()
588 s->exp_ref_block[ch][blk] = blk; in encode_exponents()
590 s->exp_ref_block[ch][blk1] = blk; in encode_exponents()
593 num_reuse_blocks = blk1 - blk - 1; in encode_exponents()
599 encode_exponents_blk_ch(exp, nb_coefs, exp_strategy[blk], cpl); in encode_exponents()
602 blk = blk1; in encode_exponents()
616 int blk, ch; in count_exponent_bits() local
620 for (blk = 0; blk < s->num_blocks; blk++) { in count_exponent_bits()
621 AC3Block *block = &s->blocks[blk]; in count_exponent_bits()
623 int exp_strategy = s->exp_strategy[ch][blk]; in count_exponent_bits()
648 int blk, ch, i, cpl; in ac3_group_exponents() local
654 for (blk = 0; blk < s->num_blocks; blk++) { in ac3_group_exponents()
655 AC3Block *block = &s->blocks[blk]; in ac3_group_exponents()
657 int exp_strategy = s->exp_strategy[ch][blk]; in ac3_group_exponents()
723 int blk; in count_frame_bits_fixed() local
771 for (blk = 0; blk < s->num_blocks; blk++) { in count_frame_bits_fixed()
795 if (!blk) in count_frame_bits_fixed()
865 int blk, ch; in count_frame_bits() local
897 for (blk = 1; blk < s->num_blocks; blk++) { in count_frame_bits()
898 AC3Block *block = &s->blocks[blk]; in count_frame_bits()
909 for (blk = 0; blk < s->num_blocks; blk++) in count_frame_bits()
910 frame_bits += 2 * s->blocks[blk].cpl_in_use; in count_frame_bits()
925 for (blk = 0; blk < s->num_blocks; blk++) { in count_frame_bits()
926 AC3Block *block = &s->blocks[blk]; in count_frame_bits()
965 if (!s->eac3 || blk > 0) in count_frame_bits()
967 if (s->blocks[blk].new_rematrixing_strategy) in count_frame_bits()
973 if (s->exp_strategy[ch][blk] != EXP_REUSE) { in count_frame_bits()
1010 int blk, ch; in bit_alloc_masking() local
1012 for (blk = 0; blk < s->num_blocks; blk++) { in bit_alloc_masking()
1013 AC3Block *block = &s->blocks[blk]; in bit_alloc_masking()
1018 if (s->exp_strategy[ch][blk] != EXP_REUSE) { in bit_alloc_masking()
1040 int blk, ch; in reset_block_bap() local
1048 for (blk = 0; blk < s->num_blocks; blk++) in reset_block_bap()
1049 s->ref_bap[ch][blk] = ref_bap + AC3_MAX_COEFS * s->exp_ref_block[ch][blk]; in reset_block_bap()
1065 int blk; in count_mantissa_bits_init() local
1067 for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) { in count_mantissa_bits_init()
1068 memset(mant_cnt[blk], 0, sizeof(mant_cnt[blk])); in count_mantissa_bits_init()
1069 mant_cnt[blk][1] = mant_cnt[blk][2] = 2; in count_mantissa_bits_init()
1070 mant_cnt[blk][4] = 1; in count_mantissa_bits_init()
1089 int blk; in count_mantissa_bits_update_ch() local
1091 for (blk = 0; blk < s->num_blocks; blk++) { in count_mantissa_bits_update_ch()
1092 AC3Block *block = &s->blocks[blk]; in count_mantissa_bits_update_ch()
1095 s->ac3dsp.update_bap_counts(mant_cnt[blk], in count_mantissa_bits_update_ch()
1096 s->ref_bap[ch][blk] + start, in count_mantissa_bits_update_ch()
1133 int blk, ch; in bit_alloc() local
1138 for (blk = 0; blk < s->num_blocks; blk++) { in bit_alloc()
1139 AC3Block *block = &s->blocks[blk]; in bit_alloc()
1146 if (s->exp_strategy[ch][blk] != EXP_REUSE) { in bit_alloc()
1150 ff_ac3_bap_tab, s->ref_bap[ch][blk]); in bit_alloc()
1369 int blk, ch, ch0=0, got_cpl; in ac3_quantize_mantissas() local
1371 for (blk = 0; blk < s->num_blocks; blk++) { in ac3_quantize_mantissas()
1372 AC3Block *block = &s->blocks[blk]; in ac3_quantize_mantissas()
1383 s->blocks[s->exp_ref_block[ch][blk]].exp[ch], in ac3_quantize_mantissas()
1384 s->ref_bap[ch][blk], block->qmant[ch], in ac3_quantize_mantissas()
1452 static void output_audio_block(AC3EncodeContext *s, int blk) in output_audio_block() argument
1455 AC3Block *block = &s->blocks[blk]; in output_audio_block()
1525 if (!s->eac3 || blk > 0) in output_audio_block()
1537 put_bits(&s->pb, 2, s->exp_strategy[ch][blk]); in output_audio_block()
1539 put_bits(&s->pb, 1, s->exp_strategy[s->lfe_channel][blk]); in output_audio_block()
1544 if (s->exp_strategy[ch][blk] != EXP_REUSE && !block->channel_in_cpl[ch]) in output_audio_block()
1553 if (s->exp_strategy[ch][blk] == EXP_REUSE) in output_audio_block()
1560 …nb_groups = exponent_group_tab[cpl][s->exp_strategy[ch][blk]-1][block->end_freq[ch]-s->start_freq[… in output_audio_block()
1571 baie = (blk == 0); in output_audio_block()
1623 b = s->ref_bap[ch][blk][i]; in output_audio_block()
1730 int blk; in ac3_output_frame() local
1736 for (blk = 0; blk < s->num_blocks; blk++) in ac3_output_frame()
1737 output_audio_block(s, blk); in ac3_output_frame()
2115 int blk, ch; in ff_ac3_encode_close() local
2137 for (blk = 0; blk < s->num_blocks; blk++) { in ff_ac3_encode_close()
2138 AC3Block *block = &s->blocks[blk]; in ff_ac3_encode_close()
2352 int blk, ch, av_uninit(cpl_start); in set_bandwidth() local
2367 for (blk = 0; blk < s->num_blocks; blk++) in set_bandwidth()
2368 s->blocks[blk].end_freq[ch] = s->bandwidth_code * 3 + 73; in set_bandwidth()
2373 for (blk = 0; blk < s->num_blocks; blk++) in set_bandwidth()
2374 s->blocks[blk].end_freq[ch] = 7; in set_bandwidth()
2414 for (blk = 0; blk < s->num_blocks; blk++) in set_bandwidth()
2415 s->blocks[blk].end_freq[CPL_CH] = s->cpl_end_freq; in set_bandwidth()
2422 int blk, ch; in allocate_buffers() local
2446 for (blk = 0; blk < s->num_blocks; blk++) { in allocate_buffers()
2447 AC3Block *block = &s->blocks[blk]; in allocate_buffers()
2466 block->grouped_exp[ch] = &s->grouped_exp_buffer[128 * (blk * channels + ch)]; in allocate_buffers()
2467 block->psd[ch] = &s->psd_buffer [AC3_MAX_COEFS * (blk * channels + ch)]; in allocate_buffers()
2468 block->band_psd[ch] = &s->band_psd_buffer [64 * (blk * channels + ch)]; in allocate_buffers()
2469 block->mask[ch] = &s->mask_buffer [64 * (blk * channels + ch)]; in allocate_buffers()
2470 block->qmant[ch] = &s->qmant_buffer [AC3_MAX_COEFS * (blk * channels + ch)]; in allocate_buffers()
2472 block->cpl_coord_exp[ch] = &s->cpl_coord_exp_buffer [16 * (blk * channels + ch)]; in allocate_buffers()
2473 block->cpl_coord_mant[ch] = &s->cpl_coord_mant_buffer[16 * (blk * channels + ch)]; in allocate_buffers()
2477 … block->exp[ch] = &s->exp_buffer [AC3_MAX_COEFS * (s->num_blocks * ch + blk)]; in allocate_buffers()
2478 … block->mdct_coef[ch] = &s->mdct_coef_buffer [AC3_MAX_COEFS * (s->num_blocks * ch + blk)]; in allocate_buffers()
2485 for (blk = 0; blk < s->num_blocks; blk++) { in allocate_buffers()
2486 AC3Block *block = &s->blocks[blk]; in allocate_buffers()
2490 … block->fixed_coef[ch] = &s->fixed_coef_buffer[AC3_MAX_COEFS * (s->num_blocks * ch + blk)]; in allocate_buffers()
2493 for (blk = 0; blk < s->num_blocks; blk++) { in allocate_buffers()
2494 AC3Block *block = &s->blocks[blk]; in allocate_buffers()