Coverage Report

Created: 2026-06-25 07:09

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
2.09M
                                     FLOAT32 *ptr_spreaded_energy) {
30
2.09M
  WORD32 i;
31
2.09M
  FLOAT32 temp;
32
2.09M
  const FLOAT32 *ptr_mask_low = &ptr_mask_low_factor[sfb_active - 2];
33
2.09M
  const FLOAT32 *ptr_mask_high = &ptr_mask_high_factor[1];
34
2.09M
  FLOAT32 temp_nrg = ptr_spreaded_energy[0];
35
2.09M
  FLOAT32 *ptr_spreaded_temp = ptr_spreaded_energy;
36
37
45.6M
  for (i = sfb_active - 2; i >= 0; i--) {
38
43.5M
    FLOAT32 temp_mask = *ptr_mask_high++;
39
43.5M
    temp = (temp_mask * temp_nrg);
40
43.5M
    temp_nrg = *++ptr_spreaded_temp;
41
43.5M
    if (temp_nrg < temp) {
42
10.4M
      *ptr_spreaded_temp = temp;
43
10.4M
      temp_nrg = temp;
44
10.4M
    }
45
43.5M
  }
46
47
2.09M
  temp_nrg = ptr_spreaded_energy[sfb_active - 1];
48
49
45.6M
  for (i = sfb_active - 2; i >= 0; i--) {
50
43.5M
    FLOAT32 temp_mask = *ptr_mask_low--;
51
43.5M
    temp = (temp_mask * temp_nrg);
52
43.5M
    temp_nrg = ptr_spreaded_energy[i];
53
43.5M
    if (temp_nrg < temp) {
54
122k
      ptr_spreaded_energy[i] = temp;
55
122k
      temp_nrg = temp;
56
122k
    }
57
43.5M
  }
58
2.09M
}