xref: /aosp_15_r20/external/libxaac/common/ixheaac_basic_ops_arr.h (revision 15dc779a375ca8b5125643b829a8aa4b70d7f451)
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 #ifndef IXHEAAC_BASIC_OPS_ARR_H
21 #define IXHEAAC_BASIC_OPS_ARR_H
22 
ixheaac_shr32_arr(WORD32 * word32_arr,WORD16 shift,WORD32 n)23 static PLATFORM_INLINE VOID ixheaac_shr32_arr(WORD32 *word32_arr, WORD16 shift, WORD32 n) {
24   WORD32 i;
25 
26   for (i = 0; i < n; i++) {
27     *word32_arr = ixheaac_shr32(*word32_arr, shift);
28     word32_arr++;
29   }
30 
31   return;
32 }
33 
ixheaac_shl32_arr_sat(WORD32 * word32_arr,WORD16 shift,WORD32 n)34 static PLATFORM_INLINE VOID ixheaac_shl32_arr_sat(WORD32 *word32_arr, WORD16 shift, WORD32 n) {
35   WORD32 i;
36 
37   for (i = 0; i < n; i++) {
38     *word32_arr = ixheaac_shl32_sat(*word32_arr, shift);
39     word32_arr++;
40   }
41 
42   return;
43 }
44 
ixheaac_shr16_arr(WORD16 * word16_arr,WORD16 shift,WORD32 n)45 static PLATFORM_INLINE VOID ixheaac_shr16_arr(WORD16 *word16_arr, WORD16 shift, WORD32 n) {
46   WORD32 i;
47 
48   for (i = 0; i < n; i++) {
49     *word16_arr = ixheaac_shr16(*word16_arr, shift);
50     word16_arr++;
51   }
52 
53   return;
54 }
55 
56 #endif /* IXHEAAC_BASIC_OPS_ARR_H */
57