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"
28
30 const uint8_t *src_scantable)
31 {
33
35
36 for (
i = 0;
i < 64;
i++) {
37 int j = src_scantable[
i];
39 }
40
41 end = -1;
42 for (
i = 0;
i < 64;
i++) {
44 if (j > end)
45 end = j;
47 }
48 }
49
52 {
54
55 if (ARCH_X86)
57 perm_type))
58 return;
59
60 switch (perm_type) {
62 for (
i = 0;
i < 64;
i++)
63 idct_permutation[
i] =
i;
64 break;
66 for (
i = 0;
i < 64;
i++)
67 idct_permutation[
i] = (
i & 0x38) | ((
i & 6) >> 1) | ((
i & 1) << 2);
68 break;
70 for (
i = 0;
i < 64;
i++)
71 idct_permutation[
i] = ((
i & 7) << 3) | (
i >> 3);
72 break;
74 for (
i = 0;
i < 64;
i++)
75 idct_permutation[
i] = (
i & 0x24) | ((
i & 3) << 3) | ((
i >> 3) & 3);
76 break;
77 default:
79 "Internal error, IDCT permutation not set\n");
80 }
81 }
82
84 ptrdiff_t line_size)
85 {
87
88 /* read the pixels */
89 for (
i = 0;
i < 8;
i++) {
98
99 pixels += line_size;
101 }
102 }
103
105 int line_size)
106 {
108
109 /* read the pixels */
115
116 pixels += line_size;
118 }
119 }
120
122 int line_size)
123 {
125
126 /* read the pixels */
130
131 pixels += line_size;
133 }
134 }
135
137 uint8_t *av_restrict pixels,
138 ptrdiff_t line_size)
139 {
141
142 for (
i = 0;
i < 8;
i++) {
143 for (j = 0; j < 8; j++) {
145 *pixels = 0;
146 else if (*
block > 127)
147 *pixels = 255;
148 else
149 *pixels = (uint8_t) (*
block + 128);
151 pixels++;
152 }
153 pixels += (line_size - 8);
154 }
155 }
156
158 ptrdiff_t line_size)
159 {
161
162 /* read the pixels */
163 for (
i = 0;
i < 8;
i++) {
172 pixels += line_size;
174 }
175 }
176
178 int line_size)
179 {
181
182 /* read the pixels */
188 pixels += line_size;
190 }
191 }
192
194 int line_size)
195 {
197
198 /* read the pixels */
202 pixels += line_size;
204 }
205 }
206
208 {
211 }
213 {
216 }
217
219 {
222 }
224 {
227 }
228
230 {
232 }
234 {
236 }
237
239 {
241
247 }
else if (avctx->
lowres==2) {
252 }
else if (avctx->
lowres==3) {
257 } else {
259 /* 10-bit MPEG-4 Simple Studio Profile requires a higher precision IDCT
260 However, it only uses idct_put */
261 if (
c->mpeg4_studio_profile) {
265 } else {
269 }
276 } else {
282 #if CONFIG_FAANIDCT
288 #endif /* CONFIG_FAANIDCT */
289 } else { // accurate/default
290 /* Be sure FF_IDCT_NONE will select this one, since it uses FF_IDCT_PERM_NONE */
295 }
296 }
297 }
298
302
305
306 if (ARCH_AARCH64)
308 if (ARCH_ALPHA)
310 if (ARCH_ARM)
312 if (ARCH_PPC)
314 if (ARCH_X86)
316 if (ARCH_MIPS)
318
321 }