• Home
  • Raw
  • Download

Lines Matching refs:cpe

240 static void encode_ms_info(PutBitContext *pb, ChannelElement *cpe)  in encode_ms_info()  argument
244 put_bits(pb, 2, cpe->ms_mode); in encode_ms_info()
245 if (cpe->ms_mode == 1) in encode_ms_info()
246 for (w = 0; w < cpe->ch[0].ics.num_windows; w += cpe->ch[0].ics.group_len[w]) in encode_ms_info()
247 for (i = 0; i < cpe->ch[0].ics.max_sfb; i++) in encode_ms_info()
248 put_bits(pb, 1, cpe->ms_mask[w*16 + i]); in encode_ms_info()
254 static void adjust_frame_information(ChannelElement *cpe, int chans) in adjust_frame_information() argument
260 IndividualChannelStream *ics = &cpe->ch[ch].ics; in adjust_frame_information()
262 cpe->ch[ch].pulse.num_pulse = 0; in adjust_frame_information()
265 … for (cmaxsfb = ics->num_swb; cmaxsfb > 0 && cpe->ch[ch].zeroes[w*16+cmaxsfb-1]; cmaxsfb--) in adjust_frame_information()
277 if (!cpe->ch[ch].zeroes[w2*16 + g]) { in adjust_frame_information()
282 cpe->ch[ch].zeroes[w*16 + g] = i; in adjust_frame_information()
287 if (chans > 1 && cpe->common_window) { in adjust_frame_information()
288 IndividualChannelStream *ics0 = &cpe->ch[0].ics; in adjust_frame_information()
289 IndividualChannelStream *ics1 = &cpe->ch[1].ics; in adjust_frame_information()
295 if (cpe->ms_mask[w+i]) in adjust_frame_information()
298 cpe->ms_mode = 0; in adjust_frame_information()
300 cpe->ms_mode = msc < ics0->max_sfb * ics0->num_windows ? 1 : 2; in adjust_frame_information()
304 static void apply_intensity_stereo(ChannelElement *cpe) in apply_intensity_stereo() argument
307 IndividualChannelStream *ics = &cpe->ch[0].ics; in apply_intensity_stereo()
308 if (!cpe->common_window) in apply_intensity_stereo()
314 int p = -1 + 2 * (cpe->ch[1].band_type[w*16+g] - 14); in apply_intensity_stereo()
315 float scale = cpe->ch[0].is_ener[w*16+g]; in apply_intensity_stereo()
316 if (!cpe->is_mask[w*16 + g]) { in apply_intensity_stereo()
320 if (cpe->ms_mask[w*16 + g]) in apply_intensity_stereo()
323 float sum = (cpe->ch[0].coeffs[start+i] + p*cpe->ch[1].coeffs[start+i])*scale; in apply_intensity_stereo()
324 cpe->ch[0].coeffs[start+i] = sum; in apply_intensity_stereo()
325 cpe->ch[1].coeffs[start+i] = 0.0f; in apply_intensity_stereo()
333 static void apply_mid_side_stereo(ChannelElement *cpe) in apply_mid_side_stereo() argument
336 IndividualChannelStream *ics = &cpe->ch[0].ics; in apply_mid_side_stereo()
337 if (!cpe->common_window) in apply_mid_side_stereo()
347 if (!cpe->ms_mask[w*16 + g] || cpe->is_mask[w*16 + g] in apply_mid_side_stereo()
348 || cpe->ch[0].band_type[w*16 + g] >= NOISE_BT in apply_mid_side_stereo()
349 || cpe->ch[1].band_type[w*16 + g] >= NOISE_BT) { in apply_mid_side_stereo()
354 float L = (cpe->ch[0].coeffs[start+i] + cpe->ch[1].coeffs[start+i]) * 0.5f; in apply_mid_side_stereo()
355 float R = L - cpe->ch[1].coeffs[start+i]; in apply_mid_side_stereo()
356 cpe->ch[0].coeffs[start+i] = L; in apply_mid_side_stereo()
357 cpe->ch[1].coeffs[start+i] = R; in apply_mid_side_stereo()
559 ChannelElement *cpe; in aac_encode_frame() local
589 cpe = &s->cpe[i]; in aac_encode_frame()
593 sce = &cpe->ch[ch]; in aac_encode_frame()
670 … if (!(fabs(cpe->ch[ch].coeffs[k]) < 1E16)) { // Ensure headroom for energy calculation in aac_encode_frame()
695 cpe = &s->cpe[i]; in aac_encode_frame()
696 cpe->common_window = 0; in aac_encode_frame()
697 memset(cpe->is_mask, 0, sizeof(cpe->is_mask)); in aac_encode_frame()
698 memset(cpe->ms_mask, 0, sizeof(cpe->ms_mask)); in aac_encode_frame()
702 sce = &cpe->ch[ch]; in aac_encode_frame()
726 s->coder->mark_pns(s, avctx, &cpe->ch[ch]); in aac_encode_frame()
727 s->coder->search_for_quantizers(avctx, s, &cpe->ch[ch], s->lambda); in aac_encode_frame()
733 cpe->common_window = 1; in aac_encode_frame()
736 cpe->common_window = 0; in aac_encode_frame()
742 sce = &cpe->ch[ch]; in aac_encode_frame()
756 s->coder->search_for_is(s, avctx, cpe); in aac_encode_frame()
757 if (cpe->is_mode) is_mode = 1; in aac_encode_frame()
758 apply_intensity_stereo(cpe); in aac_encode_frame()
762 sce = &cpe->ch[ch]; in aac_encode_frame()
766 if (cpe->ch[ch].ics.predictor_present) pred_mode = 1; in aac_encode_frame()
769 s->coder->adjust_common_pred(s, cpe); in aac_encode_frame()
771 sce = &cpe->ch[ch]; in aac_encode_frame()
780 s->coder->search_for_ms(s, cpe); in aac_encode_frame()
781 else if (cpe->common_window) in aac_encode_frame()
782 memset(cpe->ms_mask, 1, sizeof(cpe->ms_mask)); in aac_encode_frame()
783 apply_mid_side_stereo(cpe); in aac_encode_frame()
785 adjust_frame_information(cpe, chans); in aac_encode_frame()
788 sce = &cpe->ch[ch]; in aac_encode_frame()
791 s->coder->search_for_ltp(s, sce, cpe->common_window); in aac_encode_frame()
796 s->coder->adjust_common_ltp(s, cpe); in aac_encode_frame()
799 put_bits(&s->pb, 1, cpe->common_window); in aac_encode_frame()
800 if (cpe->common_window) { in aac_encode_frame()
801 put_ics_info(s, &cpe->ch[0].ics); in aac_encode_frame()
803 s->coder->encode_main_pred(s, &cpe->ch[0]); in aac_encode_frame()
805 s->coder->encode_ltp_info(s, &cpe->ch[0], 1); in aac_encode_frame()
806 encode_ms_info(&s->pb, cpe); in aac_encode_frame()
807 if (cpe->ms_mode) ms_mode = 1; in aac_encode_frame()
812 encode_individual_channel(avctx, s, &cpe->ch[ch], cpe->common_window); in aac_encode_frame()
866 cpe = &s->cpe[i]; in aac_encode_frame()
868 … memcpy(cpe->ch[ch].coeffs, cpe->ch[ch].pcoeffs, sizeof(cpe->ch[ch].coeffs)); in aac_encode_frame()
910 av_freep(&s->cpe); in aac_encode_end()
939 !FF_ALLOCZ_TYPED_ARRAY(s->cpe, s->chan_map[0])) in alloc_buffers()