Coverage Report

Created: 2026-10-17 07:12

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libxaac/decoder/ixheaacd_pns_js_thumb.c
Line
Count
Source
1
/******************************************************************************
2
 *                                                                            *
3
 * Copyright (C) 2018 The Android Open Source Project
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at:
8
 *
9
 * http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 *
17
 *****************************************************************************
18
 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19
*/
20
#include <string.h>
21
#include <stdio.h>
22
#include <stdlib.h>
23
#include "ixheaacd_sbr_common.h"
24
#include "ixheaac_type_def.h"
25
#include "ixheaac_constants.h"
26
#include "ixheaac_basic_ops32.h"
27
#include "ixheaac_basic_ops16.h"
28
#include "ixheaac_basic_ops40.h"
29
#include "ixheaac_basic_ops.h"
30
31
#include "ixheaacd_bitbuffer.h"
32
33
#include "ixheaacd_error_codes.h"
34
#include "ixheaacd_defines.h"
35
#include "ixheaacd_aac_rom.h"
36
#include "ixheaacd_common_rom.h"
37
#include "ixheaacd_basic_funcs.h"
38
#include "ixheaacd_aac_imdct.h"
39
#include "ixheaac_basic_op.h"
40
#include "ixheaacd_intrinsics.h"
41
42
#include "ixheaacd_pulsedata.h"
43
44
#include "ixheaacd_pns.h"
45
#include "ixheaacd_drc_data_struct.h"
46
47
#include "ixheaacd_lt_predict.h"
48
#include "ixheaacd_cnst.h"
49
#include "ixheaacd_ec_defines.h"
50
#include "ixheaacd_ec_struct_def.h"
51
#include "ixheaacd_channelinfo.h"
52
#include "ixheaacd_drc_dec.h"
53
#include "ixheaacd_sbrdecoder.h"
54
#include "ixheaacd_block.h"
55
56
#include "ixheaacd_channel.h"
57
58
#include "ixheaacd_audioobjtypes.h"
59
#include "ixheaacd_latmdemux.h"
60
#include "ixheaacd_aacdec.h"
61
#include "ixheaacd_tns.h"
62
#include "ixheaacd_function_selector.h"
63
64
static PLATFORM_INLINE WORD16 ixheaacd_is_correlation(
65
606k
    ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info, WORD16 pns_band) {
66
606k
  ia_pns_correlation_info_struct *ptr_corr_info =
67
606k
      ptr_aac_dec_channel_info->pstr_pns_corr_info;
68
69
606k
  return ((ptr_corr_info->correlated[(pns_band >> PNS_BAND_FLAGS_SHIFT)] >>
70
606k
           (pns_band & PNS_BAND_FLAGS_MASK)) &
71
606k
          1);
72
606k
}
73
74
VOID ixheaacd_gen_rand_vec(WORD32 scale, WORD shift, WORD32 *ptr_spec_coef,
75
606k
                           WORD32 sfb_width, WORD32 *seed) {
76
606k
  WORD nrg_scale;
77
606k
  WORD32 nrg = 0;
78
606k
  WORD32 *spec = ptr_spec_coef;
79
606k
  WORD32 sfb;
80
81
7.30M
  for (sfb = 0; sfb <= sfb_width; sfb++) {
82
6.70M
    *seed = (WORD32)(((WORD64)1664525 * (WORD64)(*seed)) + (WORD64)1013904223);
83
84
6.70M
    *spec = (*seed >> 3);
85
86
6.70M
    nrg = ixheaac_add32_sat(nrg, ixheaac_mult32_shl_sat(*spec, *spec));
87
88
6.70M
    spec++;
89
6.70M
  }
90
91
606k
  nrg_scale = ixheaac_norm32(nrg);
92
93
606k
  if (nrg_scale > 0) {
94
606k
    nrg_scale &= ~1;
95
606k
    nrg = ixheaac_shl32_sat(nrg, nrg_scale);
96
606k
    shift = shift - (nrg_scale >> 1);
97
606k
  }
98
99
606k
  nrg = ixheaacd_sqrt(nrg);
100
606k
  scale = ixheaac_div32_pos_normb(scale, nrg);
101
102
606k
  spec = ptr_spec_coef;
103
104
606k
  if (shift < -31) {
105
20.1k
    shift = -31;
106
20.1k
  }
107
7.30M
  for (sfb = 0; sfb <= sfb_width; sfb++) {
108
6.70M
    *spec = ixheaac_shr32_dir_sat_limit(ixheaac_mult32_shl_sat(*spec, scale),
109
6.70M
                                         shift);
110
6.70M
    spec++;
111
6.70M
  }
112
606k
}
113
114
VOID ixheaacd_pns_process(ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info[CHANNELS],
115
329k
                          WORD32 channel, ia_aac_dec_tables_struct *ptr_aac_tables) {
116
329k
  ia_pns_info_struct *ptr_pns_info =
117
329k
      &ptr_aac_dec_channel_info[channel]->str_pns_info;
118
329k
  ia_ics_info_struct *ptr_ics_info =
119
329k
      &ptr_aac_dec_channel_info[channel]->str_ics_info;
120
329k
  WORD16 maximum_bins_short = ptr_ics_info->frame_length >> 3;
121
329k
  WORD32 *ptr_scale_mant_tab =
122
329k
      ptr_aac_tables->pstr_block_tables->scale_mant_tab;
123
124
329k
  if (ptr_pns_info->pns_active) {
125
41.9k
    const WORD16 *swb_offset =
126
41.9k
        ptr_aac_tables->str_aac_sfb_info[ptr_ics_info->window_sequence]
127
41.9k
            .sfb_index;
128
129
41.9k
    WORD num_win_group, grp_len, sfb;
130
41.9k
    WORD32 *spec = &ptr_aac_dec_channel_info[channel]->ptr_spec_coeff[0];
131
132
92.7k
    for (num_win_group = 0; num_win_group < ptr_ics_info->num_window_groups;
133
50.8k
         num_win_group++) {
134
50.8k
      grp_len = ptr_ics_info->window_group_length[num_win_group];
135
136
50.8k
      for (grp_len = 0;
137
141k
           grp_len < ptr_ics_info->window_group_length[num_win_group];
138
90.8k
           grp_len++) {
139
1.59M
        for (sfb = 0; sfb < ptr_ics_info->max_sfb; sfb++) {
140
1.50M
          WORD16 pns_band = ((num_win_group << 4) + sfb);
141
142
1.50M
          if (ptr_aac_dec_channel_info[channel]
143
1.50M
                  ->str_pns_info.pns_used[pns_band]) {
144
606k
            WORD32 scale_mant;
145
606k
            WORD32 scale_exp;
146
606k
            WORD32 sfb_width = swb_offset[sfb + 1] - swb_offset[sfb] - 1;
147
606k
            WORD32 *ptr_spec = &spec[swb_offset[sfb]];
148
149
606k
            scale_mant = ptr_scale_mant_tab[ptr_aac_dec_channel_info[channel]
150
606k
                                                ->ptr_scale_factor[pns_band] &
151
606k
                                            PNS_SCALE_MANT_TAB_MASK];
152
606k
            scale_exp = add_d(sub_d(31, (ptr_aac_dec_channel_info[channel]
153
606k
                                             ->ptr_scale_factor[pns_band] >>
154
606k
                                         PNS_SCALEFACTOR_SCALING)),
155
606k
                              PNS_SCALE_MANT_TAB_SCALING);
156
157
606k
            if (ixheaacd_is_correlation(ptr_aac_dec_channel_info[LEFT],
158
606k
                                        pns_band)) {
159
51.0k
              if (channel == 0) {
160
36.1k
                ptr_aac_dec_channel_info[LEFT]
161
36.1k
                    ->pstr_pns_corr_info->random_vector[pns_band] =
162
36.1k
                    ptr_aac_dec_channel_info[LEFT]
163
36.1k
                        ->pstr_pns_rand_vec_data->current_seed;
164
165
36.1k
                ixheaacd_gen_rand_vec(
166
36.1k
                    scale_mant, scale_exp, ptr_spec, sfb_width,
167
36.1k
                    &(ptr_aac_dec_channel_info[LEFT]
168
36.1k
                          ->pstr_pns_rand_vec_data->current_seed));
169
36.1k
              }
170
171
14.8k
              else {
172
14.8k
                ixheaacd_gen_rand_vec(
173
14.8k
                    scale_mant, scale_exp, ptr_spec, sfb_width,
174
14.8k
                    &(ptr_aac_dec_channel_info[LEFT]
175
14.8k
                          ->pstr_pns_corr_info->random_vector[pns_band]));
176
14.8k
              }
177
178
51.0k
            }
179
180
555k
            else {
181
555k
              ixheaacd_gen_rand_vec(
182
555k
                  scale_mant, scale_exp, ptr_spec, sfb_width,
183
555k
                  &(ptr_aac_dec_channel_info[LEFT]
184
555k
                        ->pstr_pns_rand_vec_data->current_seed));
185
555k
            }
186
606k
          }
187
1.50M
        }
188
189
90.8k
        if (maximum_bins_short == 120)
190
30.4k
          spec += maximum_bins_short;
191
60.4k
        else
192
60.4k
          spec += 128;
193
90.8k
      }
194
50.8k
    }
195
41.9k
  }
196
197
329k
  if (channel == 0) {
198
295k
    ptr_aac_dec_channel_info[0]->pstr_pns_rand_vec_data->pns_frame_number++;
199
295k
  }
200
329k
}
201
202
VOID ixheaacd_tns_decode_coef(const ia_filter_info_struct *filter,
203
                              WORD16 *parcor_coef,
204
41.9k
                              ia_aac_dec_tables_struct *ptr_aac_tables) {
205
41.9k
  WORD order, resolution;
206
41.9k
  WORD16 *ptr_par_coef = parcor_coef;
207
41.9k
  WORD16 *tns_coeff_ptr;
208
41.9k
  WORD8 ixheaacd_drc_offset = 4;
209
41.9k
  WORD8 *ptr_coef = (WORD8 *)filter->coef;
210
211
41.9k
  resolution = filter->resolution;
212
41.9k
  tns_coeff_ptr = ptr_aac_tables->pstr_block_tables->tns_coeff3_16;
213
214
41.9k
  if (resolution) {
215
27.3k
    tns_coeff_ptr = ptr_aac_tables->pstr_block_tables->tns_coeff4_16;
216
27.3k
    ixheaacd_drc_offset = ixheaacd_drc_offset << 1;
217
27.3k
  }
218
219
291k
  for (order = 0; order < filter->order; order++) {
220
249k
    WORD8 temp = *ptr_coef++;
221
249k
    *ptr_par_coef++ = tns_coeff_ptr[temp + ixheaacd_drc_offset];
222
249k
  }
223
41.9k
}
224
225
VOID ixheaacd_tns_decode_coef_ld(const ia_filter_info_struct *filter,
226
                                 WORD32 *parcor_coef,
227
0
                                 ia_aac_dec_tables_struct *ptr_aac_tables) {
228
0
  WORD order, resolution;
229
0
  WORD32 *ptr_par_coef = parcor_coef;
230
0
  WORD32 *tns_coeff_ptr;
231
0
  WORD8 offset = 4;
232
0
  WORD8 *ptr_coef = (WORD8 *)filter->coef;
233
234
0
  resolution = filter->resolution;
235
0
  tns_coeff_ptr = ptr_aac_tables->pstr_block_tables->tns_coeff3;
236
237
0
  if (resolution) {
238
0
    tns_coeff_ptr = ptr_aac_tables->pstr_block_tables->tns_coeff4;
239
0
    offset = offset << 1;
240
0
  }
241
242
0
  for (order = 0; order < filter->order; order++) {
243
0
    WORD8 temp = *ptr_coef++;
244
0
    *ptr_par_coef++ = tns_coeff_ptr[temp + offset];
245
0
  }
246
0
}
247
248
VOID ixheaacd_aac_tns_process(
249
    ia_aac_dec_channel_info_struct *ptr_aac_dec_channel_info, WORD32 num_ch,
250
    ia_aac_dec_tables_struct *ptr_aac_tables, WORD32 object_type,
251
94.8k
    WORD32 ar_flag, WORD32 *predicted_spectrum) {
252
94.8k
  WORD i;
253
94.8k
  WORD16 scale_lpc;
254
255
94.8k
  ia_tns_info_aac_struct *ptr_tns_info =
256
94.8k
      &ptr_aac_dec_channel_info->str_tns_info;
257
94.8k
  WORD32 *spec = ptr_aac_dec_channel_info->ptr_spec_coeff;
258
94.8k
  WORD32 *scratch_buf = ptr_aac_dec_channel_info->scratch_buf_ptr;
259
260
94.8k
  WORD win, filt, start, stop, size, scale_spec;
261
94.8k
  ia_ics_info_struct *ptr_ics_info = &ptr_aac_dec_channel_info->str_ics_info;
262
94.8k
  WORD num_window, tns_max_bands, win_seq;
263
94.8k
  WORD16 maximum_bins_short = ptr_ics_info->frame_length >> 3;
264
94.8k
  WORD position;
265
266
94.8k
  WORD32 parcor_coef[MAX_ORDER + 1];
267
94.8k
  WORD16 parcor_coef_16[MAX_ORDER + 1];
268
269
94.8k
  WORD32 lpc_coef[MAX_ORDER + 1];
270
94.8k
  WORD16 lpc_coef_16[MAX_ORDER + 1];
271
272
94.8k
  const WORD16 *ptr_sfb_table;
273
274
94.8k
  WORD16 max_bin_long = ptr_ics_info->frame_length;
275
276
94.8k
  win_seq = ptr_ics_info->window_sequence == 0
277
94.8k
                ? 0
278
94.8k
                : (ptr_ics_info->window_sequence % 2 == 0);
279
280
94.8k
  if (ar_flag)
281
81.5k
    spec = ptr_aac_dec_channel_info->ptr_spec_coeff;
282
13.3k
  else {
283
13.3k
    spec = predicted_spectrum;
284
13.3k
  }
285
286
94.8k
  if (object_type == AOT_ER_AAC_ELD || object_type == AOT_ER_AAC_LD ||
287
49.6k
      object_type == AOT_AAC_LTP) {
288
49.6k
    if (512 == ptr_ics_info->frame_length) {
289
34.3k
      tns_max_bands =
290
34.3k
          ptr_aac_tables->pstr_block_tables
291
34.3k
              ->tns_max_bands_tbl_ld[ptr_ics_info->sampling_rate_index];
292
34.3k
      win_seq = 1;
293
34.3k
      num_window = win_seq;
294
34.3k
    } else if (480 == ptr_ics_info->frame_length) {
295
8.06k
      tns_max_bands =
296
8.06k
          ptr_aac_tables->pstr_block_tables
297
8.06k
              ->tns_max_bands_tbl_480[ptr_ics_info->sampling_rate_index];
298
8.06k
      win_seq = 1;
299
8.06k
      num_window = win_seq;
300
8.06k
    } else {
301
7.18k
      tns_max_bands =
302
7.18k
          ptr_aac_tables->pstr_block_tables
303
7.18k
              ->tns_max_bands_tbl[ptr_ics_info->sampling_rate_index][win_seq];
304
305
7.18k
      num_window = win_seq ? 8 : 1;
306
7.18k
    }
307
49.6k
  } else {
308
45.2k
    tns_max_bands =
309
45.2k
        ptr_aac_tables->pstr_block_tables
310
45.2k
            ->tns_max_bands_tbl[ptr_ics_info->sampling_rate_index][win_seq];
311
312
45.2k
    num_window = win_seq ? 8 : 1;
313
45.2k
  }
314
315
94.8k
  ptr_sfb_table =
316
94.8k
      ptr_aac_tables->str_aac_sfb_info[ptr_ics_info->window_sequence].sfb_index;
317
318
271k
  for (win = 0; win < num_window; win++) {
319
176k
    WORD n_filt = ptr_tns_info->n_filt[win];
320
321
274k
    for (filt = 0; filt < n_filt; filt++) {
322
98.1k
      ia_filter_info_struct *filter = &ptr_tns_info->str_filter[win][filt];
323
324
98.1k
      if (filter->order <= 0) {
325
16.2k
        continue;
326
16.2k
      }
327
328
81.9k
      if ((object_type == AOT_ER_AAC_LD) || (object_type == AOT_AAC_LTP) ||
329
42.1k
          (num_ch > 2)) {
330
40.0k
        ixheaacd_tns_decode_coefficients(filter, parcor_coef, ptr_aac_tables);
331
332
41.9k
      } else {
333
41.9k
        ixheaacd_tns_decode_coef(filter, parcor_coef_16, ptr_aac_tables);
334
41.9k
      }
335
336
81.9k
      start = ixheaac_min32(ixheaac_min32(filter->start_band, tns_max_bands),
337
81.9k
                             ptr_ics_info->max_sfb);
338
339
81.9k
      start = ptr_sfb_table[start];
340
341
81.9k
      stop = ixheaac_min32(ixheaac_min32(filter->stop_band, tns_max_bands),
342
81.9k
                            ptr_ics_info->max_sfb);
343
344
81.9k
      stop = ptr_sfb_table[stop];
345
346
81.9k
      size = (stop - start);
347
348
81.9k
      if (size <= 0) {
349
13.6k
        continue;
350
13.6k
      }
351
68.2k
      if ((object_type == AOT_ER_AAC_LD) || (object_type == AOT_AAC_LTP) ||
352
34.2k
          (num_ch > 2)) {
353
34.2k
        ixheaacd_tns_parcor_to_lpc(parcor_coef, lpc_coef, &scale_lpc,
354
34.2k
                                   filter->order);
355
356
34.2k
      } else {
357
33.9k
        (*ixheaacd_tns_parcor_lpc_convert)(parcor_coef_16, lpc_coef_16,
358
33.9k
                                           &scale_lpc, filter->order);
359
33.9k
      }
360
361
68.2k
      {
362
68.2k
        WORD32 *ptr_tmp;
363
364
68.2k
        if (maximum_bins_short == 120)
365
17.6k
          ptr_tmp = spec + (win * maximum_bins_short) + start;
366
50.6k
        else
367
50.6k
          ptr_tmp = spec + (win << 7) + start;
368
369
68.2k
        scale_spec = (*ixheaacd_calc_max_spectral_line)(ptr_tmp, size);
370
68.2k
      }
371
372
68.2k
      if (filter->direction == -1) {
373
35.7k
        position = stop - 1;
374
375
35.7k
        if (maximum_bins_short == 120) {
376
13.9k
          if (((win * maximum_bins_short) + position) < filter->order) continue;
377
21.7k
        } else {
378
21.7k
          if (((win << 7) + position) < filter->order) continue;
379
21.7k
        }
380
381
35.7k
      } else {
382
32.5k
        position = start;
383
32.5k
        if (maximum_bins_short == 120) {
384
3.63k
          if ((((win * maximum_bins_short) + position) + filter->order) > max_bin_long)
385
0
            continue;
386
28.8k
        } else {
387
28.8k
          if ((((win << 7) + position) + filter->order) > MAX_BINS_LONG) continue;
388
28.8k
        }
389
32.5k
      }
390
391
65.4k
      if ((num_ch <= 2) &&
392
64.3k
          ((object_type != AOT_ER_AAC_LD) && (object_type != AOT_AAC_LTP)))
393
31.1k
        scale_spec = ((scale_spec - 4) - scale_lpc);
394
34.2k
      else {
395
34.2k
        if (scale_spec > 17)
396
1.22k
          scale_spec = ((scale_spec - 6) - scale_lpc);
397
33.0k
        else if (scale_spec > 11)
398
549
          scale_spec = ((scale_spec - 5) - scale_lpc);
399
32.5k
        else
400
32.5k
          scale_spec = ((scale_spec - 4) - scale_lpc);
401
34.2k
      }
402
403
65.4k
      if (scale_spec > 0) {
404
21.9k
        scale_spec = ixheaac_min32(scale_spec, 31);
405
406
21.9k
        if ((object_type == AOT_ER_AAC_LD) || (object_type == AOT_AAC_LTP) ||
407
14.3k
            (num_ch > 2)) {
408
7.59k
          if (ar_flag)
409
6.35k
          {
410
6.35k
            if (maximum_bins_short == 120) {
411
845
              (*ixheaacd_tns_ar_filter_fixed)(&spec[(win * maximum_bins_short) + position],
412
845
                                              size, filter->direction,
413
845
                                              (WORD32 *)lpc_coef, filter->order,
414
845
                                              (WORD32)scale_lpc, scale_spec);
415
5.50k
            } else {
416
5.50k
              (*ixheaacd_tns_ar_filter_fixed)(&spec[(win << 7) + position], size,
417
5.50k
                                              filter->direction,
418
5.50k
                                              (WORD32 *)lpc_coef, filter->order,
419
5.50k
                                              (WORD32)scale_lpc, scale_spec);
420
5.50k
            }
421
6.35k
          } else {
422
1.24k
            if (maximum_bins_short == 120) {
423
20
              ixheaacd_tns_ma_filter_fixed_ld(&spec[(win * maximum_bins_short) + position],
424
20
                                              size, filter->direction, lpc_coef,
425
20
                                              filter->order, scale_lpc);
426
1.22k
            } else {
427
1.22k
              ixheaacd_tns_ma_filter_fixed_ld(&spec[(win << 7) + position], size,
428
1.22k
                                              filter->direction, lpc_coef,
429
1.22k
                                              filter->order, scale_lpc);
430
1.22k
            }
431
1.24k
          }
432
14.3k
        } else {
433
14.3k
          if (object_type == AOT_ER_AAC_ELD) scale_spec = scale_spec - 1;
434
14.3k
          if (maximum_bins_short == 120) {
435
10.2k
            (*ixheaacd_tns_ar_filter)(&spec[(win * maximum_bins_short) + position], size,
436
10.2k
                                      filter->direction, lpc_coef_16,
437
10.2k
                                      filter->order, (WORD32)scale_lpc,
438
10.2k
                                      scale_spec, scratch_buf);
439
10.2k
          } else {
440
4.05k
            (*ixheaacd_tns_ar_filter)(&spec[(win << 7) + position], size,
441
4.05k
                                      filter->direction, lpc_coef_16,
442
4.05k
                                      filter->order, (WORD32)scale_lpc,
443
4.05k
                                      scale_spec, scratch_buf);
444
4.05k
          }
445
14.3k
        }
446
21.9k
      }
447
448
43.5k
      else {
449
43.5k
        WORD32 *ptr_tmp;
450
451
43.5k
        if (maximum_bins_short == 120)
452
4.70k
          ptr_tmp = spec + (win * maximum_bins_short) + start;
453
38.8k
        else
454
38.8k
          ptr_tmp = spec + (win >> 7) + start;
455
456
43.5k
        scale_spec = -scale_spec;
457
43.5k
        scale_spec = ixheaac_min32(scale_spec, 31);
458
459
6.68M
        for (i = size; i != 0; i--) {
460
6.64M
          *ptr_tmp = (*ptr_tmp >> scale_spec);
461
6.64M
          ptr_tmp++;
462
6.64M
        }
463
464
43.5k
        if ((object_type == AOT_ER_AAC_LD) || (object_type == AOT_AAC_LTP) ||
465
26.6k
            num_ch > 2) {
466
26.6k
          if (ar_flag) {
467
11.5k
            if (maximum_bins_short == 120) {
468
462
              (*ixheaacd_tns_ar_filter_fixed)(
469
462
                  &spec[(win * maximum_bins_short) + position], size, filter->direction,
470
462
                  (WORD32 *)lpc_coef, filter->order, scale_lpc, 0);
471
11.0k
            } else {
472
11.0k
              (*ixheaacd_tns_ar_filter_fixed)(
473
11.0k
                  &spec[(win << 7) + position], size, filter->direction,
474
11.0k
                  (WORD32 *)lpc_coef, filter->order, scale_lpc, 0);
475
11.0k
            }
476
15.1k
          } else {
477
15.1k
            if (maximum_bins_short == 120) {
478
11
              ixheaacd_tns_ma_filter_fixed_ld(&spec[(win * maximum_bins_short) + position],
479
11
                                              size, filter->direction, lpc_coef,
480
11
                                              filter->order, scale_lpc);
481
15.1k
            } else {
482
15.1k
              ixheaacd_tns_ma_filter_fixed_ld(&spec[(win << 7) + position], size,
483
15.1k
                                              filter->direction, lpc_coef,
484
15.1k
                                              filter->order, scale_lpc);
485
15.1k
            }
486
15.1k
          }
487
26.6k
        } else {
488
16.8k
          if (object_type == AOT_ER_AAC_ELD) {
489
2.52k
            scale_lpc = scale_lpc - 1;
490
2.52k
          }
491
492
16.8k
          if (maximum_bins_short == 120) {
493
4.22k
            (*ixheaacd_tns_ar_filter)(&spec[(win * maximum_bins_short) + position], size,
494
4.22k
                                      filter->direction, lpc_coef_16,
495
4.22k
                                      filter->order, scale_lpc, 0, scratch_buf);
496
12.6k
          } else {
497
12.6k
            (*ixheaacd_tns_ar_filter)(&spec[(win << 7) + position], size,
498
12.6k
                                      filter->direction, lpc_coef_16,
499
12.6k
                                      filter->order, scale_lpc, 0, scratch_buf);
500
12.6k
          }
501
16.8k
        }
502
503
43.5k
        if (maximum_bins_short == 120)
504
4.70k
          ptr_tmp = spec + (win * maximum_bins_short) + start;
505
38.8k
        else
506
38.8k
          ptr_tmp = spec + (win << 7) + start;
507
508
6.68M
        for (i = size; i != 0; i--) {
509
6.64M
          *ptr_tmp = (*ptr_tmp << scale_spec);
510
6.64M
          ptr_tmp++;
511
6.64M
        }
512
43.5k
      }
513
65.4k
    }
514
176k
  }
515
94.8k
}