1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
| cc_library_static {
| name: "libmpeg2dec",
| vendor_available: true,
| shared_libs: ["liblog", "libcutils"],
|
| cflags: [
| "-D_LIB",
| "-DMULTICORE",
| "-fPIC",
|
| "-O3",
| "-DANDROID",
| "-Werror",
| ],
|
| export_include_dirs: [
| "decoder",
| "common",
| ],
|
| srcs: [
| "common/impeg2_buf_mgr.c",
| "common/impeg2_disp_mgr.c",
| "common/impeg2_format_conv.c",
| "common/impeg2_globals.c",
| "common/impeg2_idct.c",
| "common/impeg2_inter_pred.c",
| "common/impeg2_job_queue.c",
| "common/impeg2_mem_func.c",
| "common/ithread.c",
| "decoder/impeg2d_api_main.c",
| "decoder/impeg2d_bitstream.c",
| "decoder/impeg2d_debug.c",
| "decoder/impeg2d_dec_hdr.c",
| "decoder/impeg2d_decoder.c",
| "decoder/impeg2d_d_pic.c",
| "decoder/impeg2d_function_selector_generic.c",
| "decoder/impeg2d_globals.c",
| "decoder/impeg2d_i_pic.c",
| "decoder/impeg2d_mc.c",
| "decoder/impeg2d_mv_dec.c",
| "decoder/impeg2d_pic_proc.c",
| "decoder/impeg2d_pnb_pic.c",
| "decoder/impeg2d_vld.c",
| "decoder/impeg2d_vld_tables.c",
| "decoder/impeg2d_deinterlace.c",
| "common/icv_sad.c",
| "common/icv_variance.c",
| "common/ideint.c",
| "common/ideint_cac.c",
| "common/ideint_debug.c",
| "common/ideint_function_selector_generic.c",
| "common/ideint_utils.c",
| ],
|
| arch: {
| arm: {
| local_include_dirs: [
| "decoder/arm",
| "common/arm",
| ],
|
| srcs: [
| "decoder/arm/impeg2d_function_selector.c",
| "common/arm/ideint_function_selector.c",
| ],
|
| neon: {
| srcs: [
| "decoder/arm/impeg2d_function_selector_a9q.c",
| "common/arm/ideint_function_selector_a9.c",
| "common/arm/icv_sad_a9.s",
| "common/arm/icv_variance_a9.s",
| "common/arm/ideint_spatial_filter_a9.s",
| "common/arm/ideint_cac_a9.s",
| "common/arm/impeg2_format_conv.s",
| "common/arm/impeg2_idct.s",
| "common/arm/impeg2_inter_pred.s",
| "common/arm/impeg2_mem_func.s",
| ],
| cflags: [
| "-UDISABLE_NEON",
| "-UDEFAULT_ARCH",
| "-DDEFAULT_ARCH=D_ARCH_ARM_A9Q",
| ],
| },
|
| cflags: [
| "-DDISABLE_NEONINTR",
| "-DARM",
| "-DARMGCC",
|
| // These are overriden by armv7_a_neon
| "-DDISABLE_NEON",
| "-DDEFAULT_ARCH=D_ARCH_ARM_NONEON",
| ],
| instruction_set: "arm",
| },
|
| arm64: {
| cflags: [
| "-DARMV8",
| "-DDISABLE_NEONINTR",
| "-DARM",
| "-DARMGCC",
|
| "-DDEFAULT_ARCH=D_ARCH_ARMV8_GENERIC",
| ],
| local_include_dirs: [
| "decoder/arm",
| "common/armv8",
| ],
|
| srcs: [
| "decoder/arm/impeg2d_function_selector.c",
| "decoder/arm/impeg2d_function_selector_av8.c",
| "common/arm/ideint_function_selector.c",
| "common/arm/ideint_function_selector_av8.c",
| "common/armv8/icv_sad_av8.s",
| "common/armv8/icv_variance_av8.s",
| "common/armv8/ideint_spatial_filter_av8.s",
| "common/armv8/ideint_cac_av8.s",
| "common/armv8/impeg2_neon_macros.s",
| "common/armv8/impeg2_format_conv.s",
| "common/armv8/impeg2_idct.s",
| "common/armv8/impeg2_inter_pred.s",
| "common/armv8/impeg2_mem_func.s",
| ],
| },
|
| mips: {
| local_include_dirs: ["common/mips"],
|
| srcs: [
| "decoder/mips/impeg2d_function_selector.c",
| "common/mips/ideint_function_selector.c",
| ],
| },
|
| mips64: {
| local_include_dirs: ["common/mips"],
|
| srcs: [
| "decoder/mips/impeg2d_function_selector.c",
| "common/mips/ideint_function_selector.c",
| ],
| },
|
| x86: {
| cflags: [
| "-DX86",
| "-DDISABLE_AVX2",
| "-msse4.2",
| "-mno-avx",
| "-DDEFAULT_ARCH=D_ARCH_X86_SSE42",
| ],
|
| local_include_dirs: [
| "decoder/x86",
| "common/x86",
| ],
|
| srcs: [
| "decoder/x86/impeg2d_function_selector.c",
| "decoder/x86/impeg2d_function_selector_avx2.c",
| "decoder/x86/impeg2d_function_selector_ssse3.c",
| "decoder/x86/impeg2d_function_selector_sse42.c",
| "common/x86/ideint_function_selector.c",
| "common/x86/ideint_function_selector_ssse3.c",
| "common/x86/ideint_function_selector_sse42.c",
| "common/x86/icv_variance_ssse3.c",
| "common/x86/icv_sad_ssse3.c",
| "common/x86/ideint_cac_ssse3.c",
| "common/x86/ideint_spatial_filter_ssse3.c",
| "common/x86/impeg2_idct_recon_sse42_intr.c",
| "common/x86/impeg2_inter_pred_sse42_intr.c",
| "common/x86/impeg2_mem_func_sse42_intr.c",
| ],
| },
|
| x86_64: {
| cflags: [
| "-DX86",
| "-DDISABLE_AVX2",
| "-msse4.2",
| "-mno-avx",
| "-DDEFAULT_ARCH=D_ARCH_X86_SSE42",
| ],
|
| local_include_dirs: [
| "decoder/x86",
| "common/x86",
| ],
|
| srcs: [
| "decoder/x86/impeg2d_function_selector.c",
| "decoder/x86/impeg2d_function_selector_avx2.c",
| "decoder/x86/impeg2d_function_selector_ssse3.c",
| "decoder/x86/impeg2d_function_selector_sse42.c",
| "common/x86/ideint_function_selector.c",
| "common/x86/ideint_function_selector_ssse3.c",
| "common/x86/ideint_function_selector_sse42.c",
| "common/x86/icv_variance_ssse3.c",
| "common/x86/icv_sad_ssse3.c",
| "common/x86/ideint_cac_ssse3.c",
| "common/x86/ideint_spatial_filter_ssse3.c",
| "common/x86/impeg2_idct_recon_sse42_intr.c",
| "common/x86/impeg2_inter_pred_sse42_intr.c",
| "common/x86/impeg2_mem_func_sse42_intr.c",
| ],
| },
| },
| sanitize: {
| integer_overflow: true,
| misc_undefined: ["bounds"],
| // Enable CFI if this becomes a shared library.
| // cfi: true,
| blacklist: "libmpeg2dec_blacklist.txt",
| },
| }
|
| subdirs = ["test"]
|
|