1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 #include "config.h"
20 #include "config_components.h"
29
31 const uint8_t permutation[64])
32 {
33 for (
int i = 0;
i < 64;
i++) {
35 dst[
i] = permutation[j];
36 }
37 }
38
41 {
43
44 #if ARCH_X86
46 perm_type))
47 return;
48 #endif
49
50 switch (perm_type) {
52 for (
i = 0;
i < 64;
i++)
53 idct_permutation[
i] =
i;
54 break;
56 for (
i = 0;
i < 64;
i++)
57 idct_permutation[
i] = (
i & 0x38) | ((
i & 6) >> 1) | ((
i & 1) << 2);
58 break;
60 for (
i = 0;
i < 64;
i++)
61 idct_permutation[
i] = ((
i & 7) << 3) | (
i >> 3);
62 break;
64 for (
i = 0;
i < 64;
i++)
65 idct_permutation[
i] = (
i & 0x24) | ((
i & 3) << 3) | ((
i >> 3) & 3);
66 break;
67 default:
69 "Internal error, IDCT permutation not set\n");
70 }
71 }
72
74 ptrdiff_t line_size)
75 {
77
78 /* read the pixels */
79 for (
i = 0;
i < 8;
i++) {
88
89 pixels += line_size;
91 }
92 }
93
95 int line_size)
96 {
98
99 /* read the pixels */
105
106 pixels += line_size;
108 }
109 }
110
112 int line_size)
113 {
115
116 /* read the pixels */
120
121 pixels += line_size;
123 }
124 }
125
127 uint8_t *av_restrict pixels,
128 ptrdiff_t line_size)
129 {
131
132 for (
i = 0;
i < 8;
i++) {
133 for (j = 0; j < 8; j++) {
135 *pixels = 0;
136 else if (*
block > 127)
137 *pixels = 255;
138 else
139 *pixels = (uint8_t) (*
block + 128);
141 pixels++;
142 }
143 pixels += (line_size - 8);
144 }
145 }
146
148 ptrdiff_t line_size)
149 {
151
152 /* read the pixels */
153 for (
i = 0;
i < 8;
i++) {
162 pixels += line_size;
164 }
165 }
166
168 int line_size)
169 {
171
172 /* read the pixels */
178 pixels += line_size;
180 }
181 }
182
184 int line_size)
185 {
187
188 /* read the pixels */
192 pixels += line_size;
194 }
195 }
196
198 {
201 }
203 {
206 }
207
209 {
212 }
214 {
217 }
218
220 {
222 }
224 {
226 }
227
229 {
231
237 }
else if (avctx->
lowres==2) {
242 }
else if (avctx->
lowres==3) {
247 } else {
249 /* 10-bit MPEG-4 Simple Studio Profile requires a higher precision IDCT
250 However, it only uses idct_put */
251 if (
c->mpeg4_studio_profile) {
255 } else {
259 }
266 } else {
272 #if CONFIG_FAANIDCT
278 #endif /* CONFIG_FAANIDCT */
279 } else { // accurate/default
284 }
285 }
286 }
287
291
294
295 #if ARCH_AARCH64
297 #elif ARCH_ALPHA
299 #elif ARCH_ARM
301 #elif ARCH_PPC
303 #elif ARCH_RISCV
305 #elif ARCH_X86
307 #elif ARCH_MIPS
309 #elif ARCH_LOONGARCH
311 #endif
312
315 }