Coverage Report

Created: 2026-01-09 06:51

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libxaac/encoder/ixheaace_psy_utils_spreading.c
Line
Count
Source
1
/******************************************************************************
2
 *                                                                            *
3
 * Copyright (C) 2023 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
21
#include "ixheaac_type_def.h"
22
#include "ixheaac_constants.h"
23
#include "ixheaace_aac_constants.h"
24
25
#include "ixheaace_psy_utils_spreading.h"
26
27
VOID ia_enhaacplus_enc_spreading_max(const WORD32 sfb_active, const FLOAT32 *ptr_mask_low_factor,
28
                                     const FLOAT32 *ptr_mask_high_factor,
29
1.97M
                                     FLOAT32 *ptr_spreaded_energy) {
30
1.97M
  WORD32 i;
31
1.97M
  FLOAT32 temp;
32
1.97M
  const FLOAT32 *ptr_mask_low = &ptr_mask_low_factor[sfb_active - 2];
33
1.97M
  const FLOAT32 *ptr_mask_high = &ptr_mask_high_factor[1];
34
1.97M
  FLOAT32 temp_nrg = ptr_spreaded_energy[0];
35
1.97M
  FLOAT32 *ptr_spreaded_temp = ptr_spreaded_energy;
36
37
42.9M
  for (i = sfb_active - 2; i >= 0; i--) {
38
40.9M
    FLOAT32 temp_mask = *ptr_mask_high++;
39
40.9M
    temp = (temp_mask * temp_nrg);
40
40.9M
    temp_nrg = *++ptr_spreaded_temp;
41
40.9M
    if (temp_nrg < temp) {
42
12.0M
      *ptr_spreaded_temp = temp;
43
12.0M
      temp_nrg = temp;
44
12.0M
    }
45
40.9M
  }
46
47
1.97M
  temp_nrg = ptr_spreaded_energy[sfb_active - 1];
48
49
42.9M
  for (i = sfb_active - 2; i >= 0; i--) {
50
40.9M
    FLOAT32 temp_mask = *ptr_mask_low--;
51
40.9M
    temp = (temp_mask * temp_nrg);
52
40.9M
    temp_nrg = ptr_spreaded_energy[i];
53
40.9M
    if (temp_nrg < temp) {
54
145k
      ptr_spreaded_energy[i] = temp;
55
145k
      temp_nrg = temp;
56
145k
    }
57
40.9M
  }
58
1.97M
}