/src/libxaac/decoder/ixheaacd_mps_res_huffman.h
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 | | #ifndef IXHEAACD_MPS_RES_HUFFMAN_H |
21 | | #define IXHEAACD_MPS_RES_HUFFMAN_H |
22 | | |
23 | | #define _SWAP(a, b) \ |
24 | 2.58k | (b = (((WORD32)a[0] << 24) | ((WORD32)a[1] << 16) | ((WORD32)a[2] << 8) | ((WORD32)a[3]))) |
25 | | |
26 | | extern UWORD32 ixheaacd_res_aac_showbits_32(UWORD8 *p_read_next); |
27 | | |
28 | | static PLATFORM_INLINE WORD32 ixheaacd_res_exts(UWORD32 a, WORD32 shift_left, |
29 | 20.4k | WORD32 shift_right) { |
30 | 20.4k | WORD32 x; |
31 | 20.4k | x = (UWORD32)a << shift_left; |
32 | 20.4k | x = (WORD32)x >> shift_right; |
33 | | |
34 | 20.4k | return x; |
35 | 20.4k | } Unexecuted instantiation: ixheaacd_mps_res_channel.c:ixheaacd_res_exts Unexecuted instantiation: ixheaacd_mps_res_longblock.c:ixheaacd_res_exts ixheaacd_mps_res_block.c:ixheaacd_res_exts Line | Count | Source | 29 | 20.4k | WORD32 shift_right) { | 30 | 20.4k | WORD32 x; | 31 | 20.4k | x = (UWORD32)a << shift_left; | 32 | 20.4k | x = (WORD32)x >> shift_right; | 33 | | | 34 | 20.4k | return x; | 35 | 20.4k | } |
|
36 | | |
37 | | static PLATFORM_INLINE UWORD32 ixheaacd_aac_read_2bytes(UWORD8 **p_read_next, WORD32 *r_bit_pos, |
38 | 32 | WORD32 *readword) { |
39 | 32 | UWORD8 *v = *p_read_next; |
40 | 32 | WORD32 bits_consumed = *r_bit_pos; |
41 | | |
42 | 32 | if ((bits_consumed - 16) >= 0) { |
43 | 3 | *readword = (*readword << 8) | *v; |
44 | 3 | v++; |
45 | 3 | *readword = (*readword << 8) | *v; |
46 | 3 | v++; |
47 | 3 | bits_consumed -= 16; |
48 | 29 | } else if ((bits_consumed - 8) >= 0) { |
49 | 29 | *readword = (*readword << 8) | *v; |
50 | 29 | v++; |
51 | 29 | bits_consumed -= 8; |
52 | 29 | } |
53 | | |
54 | 32 | *r_bit_pos = bits_consumed; |
55 | 32 | *p_read_next = v; |
56 | 32 | return 1; |
57 | 32 | } Unexecuted instantiation: ixheaacd_mps_res_channel.c:ixheaacd_aac_read_2bytes ixheaacd_mps_res_longblock.c:ixheaacd_aac_read_2bytes Line | Count | Source | 38 | 32 | WORD32 *readword) { | 39 | 32 | UWORD8 *v = *p_read_next; | 40 | 32 | WORD32 bits_consumed = *r_bit_pos; | 41 | | | 42 | 32 | if ((bits_consumed - 16) >= 0) { | 43 | 3 | *readword = (*readword << 8) | *v; | 44 | 3 | v++; | 45 | 3 | *readword = (*readword << 8) | *v; | 46 | 3 | v++; | 47 | 3 | bits_consumed -= 16; | 48 | 29 | } else if ((bits_consumed - 8) >= 0) { | 49 | 29 | *readword = (*readword << 8) | *v; | 50 | 29 | v++; | 51 | 29 | bits_consumed -= 8; | 52 | 29 | } | 53 | | | 54 | 32 | *r_bit_pos = bits_consumed; | 55 | 32 | *p_read_next = v; | 56 | 32 | return 1; | 57 | 32 | } |
Unexecuted instantiation: ixheaacd_mps_res_block.c:ixheaacd_aac_read_2bytes |
58 | | |
59 | | #endif /* IXHEAACD_MPS_RES_HUFFMAN_H */ |