Coverage Report

Created: 2026-01-25 06:51

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libxaac/encoder/ixheaace_mps_vector_functions.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 <math.h>
22
#include "ixheaac_type_def.h"
23
#include "ixheaace_mps_common_fix.h"
24
#include "ixheaace_mps_defines.h"
25
#include "ixheaace_mps_common_define.h"
26
27
FLOAT32
28
ixheaace_mps_212_sum_up_cplx_pow_2_dim_2(ixheaace_cmplx_str inp[MAX_ANA_TIME_SLOT][MAX_QMF_BANDS],
29
                                         const WORD32 start_dim_1, const WORD32 stop_dim_1,
30
9.83M
                                         const WORD32 start_dim_2, const WORD32 stop_dim_2) {
31
9.83M
  WORD32 idx_1, idx_2;
32
33
9.83M
  FLOAT32 sum;
34
9.83M
  sum = 0.0f;
35
647M
  for (idx_1 = start_dim_1; idx_1 < stop_dim_1; idx_1++) {
36
1.27G
    for (idx_2 = start_dim_2; idx_2 < stop_dim_2; idx_2++) {
37
637M
      sum += inp[idx_1][idx_2].re * inp[idx_1][idx_2].re;
38
637M
      sum += inp[idx_1][idx_2].im * inp[idx_1][idx_2].im;
39
637M
    }
40
637M
  }
41
9.83M
  return (sum / 2);
42
9.83M
}
43
44
VOID ixheaace_mps_212_cplx_scalar_product(
45
    ixheaace_cmplx_str *const out, ixheaace_cmplx_str inp_1[MAX_ANA_TIME_SLOT][MAX_QMF_BANDS],
46
    ixheaace_cmplx_str inp_2[MAX_ANA_TIME_SLOT][MAX_QMF_BANDS], const WORD32 start_dim_1,
47
4.91M
    const WORD32 stop_dim_1, const WORD32 start_dim_2, const WORD32 stop_dim_2) {
48
4.91M
  WORD32 idx_1, idx_2;
49
4.91M
  FLOAT32 re_x, re_y, im_x, im_y, re, im;
50
4.91M
  re = 0.0f;
51
4.91M
  im = 0.0f;
52
53
323M
  for (idx_1 = start_dim_1; idx_1 < stop_dim_1; idx_1++) {
54
637M
    for (idx_2 = start_dim_2; idx_2 < stop_dim_2; idx_2++) {
55
318M
      re_x = inp_1[idx_1][idx_2].re;
56
318M
      im_x = inp_1[idx_1][idx_2].im;
57
318M
      re_y = inp_2[idx_1][idx_2].re;
58
318M
      im_y = inp_2[idx_1][idx_2].im;
59
318M
      re += (re_x * re_y) + (im_x * im_y);
60
318M
      im += (im_x * re_y) - (re_x * im_y);
61
318M
    }
62
318M
  }
63
64
4.91M
  out->re = re / 2;
65
4.91M
  out->im = im / 2;
66
4.91M
}
67
68
FLOAT32 ixheaace_mps_212_sum_up_cplx_pow_2(const ixheaace_cmplx_str *const inp,
69
5.90M
                                           const WORD32 len) {
70
5.90M
  WORD32 idx;
71
5.90M
  FLOAT32 sum;
72
5.90M
  sum = 0.0f;
73
74
352M
  for (idx = 0; idx < len; idx++) {
75
346M
    sum += inp[idx].re * inp[idx].re;
76
346M
    sum += inp[idx].im * inp[idx].im;
77
346M
  }
78
79
5.90M
  return (sum / 2);
80
5.90M
}