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 *src_scantable)
32 {
34
36
37 for (
i = 0;
i < 64;
i++) {
38 int j = src_scantable[
i];
40 }
41
42 end = -1;
43 for (
i = 0;
i < 64;
i++) {
45 if (j > end)
46 end = j;
48 }
49 }
50
53 {
55
56 #if ARCH_X86
58 perm_type))
59 return;
60 #endif
61
62 switch (perm_type) {
64 for (
i = 0;
i < 64;
i++)
65 idct_permutation[
i] =
i;
66 break;
68 for (
i = 0;
i < 64;
i++)
69 idct_permutation[
i] = (
i & 0x38) | ((
i & 6) >> 1) | ((
i & 1) << 2);
70 break;
72 for (
i = 0;
i < 64;
i++)
73 idct_permutation[
i] = ((
i & 7) << 3) | (
i >> 3);
74 break;
76 for (
i = 0;
i < 64;
i++)
77 idct_permutation[
i] = (
i & 0x24) | ((
i & 3) << 3) | ((
i >> 3) & 3);
78 break;
79 default:
81 "Internal error, IDCT permutation not set\n");
82 }
83 }
84
86 ptrdiff_t line_size)
87 {
89
90 /* read the pixels */
91 for (
i = 0;
i < 8;
i++) {
100
101 pixels += line_size;
103 }
104 }
105
107 int line_size)
108 {
110
111 /* read the pixels */
117
118 pixels += line_size;
120 }
121 }
122
124 int line_size)
125 {
127
128 /* read the pixels */
132
133 pixels += line_size;
135 }
136 }
137
139 uint8_t *av_restrict pixels,
140 ptrdiff_t line_size)
141 {
143
144 for (
i = 0;
i < 8;
i++) {
145 for (j = 0; j < 8; j++) {
147 *pixels = 0;
148 else if (*
block > 127)
149 *pixels = 255;
150 else
151 *pixels = (uint8_t) (*
block + 128);
153 pixels++;
154 }
155 pixels += (line_size - 8);
156 }
157 }
158
160 ptrdiff_t line_size)
161 {
163
164 /* read the pixels */
165 for (
i = 0;
i < 8;
i++) {
174 pixels += line_size;
176 }
177 }
178
180 int line_size)
181 {
183
184 /* read the pixels */
190 pixels += line_size;
192 }
193 }
194
196 int line_size)
197 {
199
200 /* read the pixels */
204 pixels += line_size;
206 }
207 }
208
210 {
213 }
215 {
218 }
219
221 {
224 }
226 {
229 }
230
232 {
234 }
236 {
238 }
239
241 {
243
249 }
else if (avctx->
lowres==2) {
254 }
else if (avctx->
lowres==3) {
259 } else {
261 /* 10-bit MPEG-4 Simple Studio Profile requires a higher precision IDCT
262 However, it only uses idct_put */
263 if (
c->mpeg4_studio_profile) {
267 } else {
271 }
278 } else {
284 #if CONFIG_FAANIDCT
290 #endif /* CONFIG_FAANIDCT */
291 } else { // accurate/default
296 }
297 }
298 }
299
303
306
307 #if ARCH_AARCH64
309 #elif ARCH_ALPHA
311 #elif ARCH_ARM
313 #elif ARCH_PPC
315 #elif ARCH_X86
317 #elif ARCH_MIPS
319 #elif ARCH_LOONGARCH
321 #endif
322
325 }