1 /*
2 * JPEG 2000 DSP functions
3 * Copyright (c) 2007 Kamil Nowosad
4 * Copyright (c) 2013 Nicolas Bertrand <nicoinattendu@gmail.com>
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 #include "config.h"
26
27 /* Inverse ICT parameters in float and integer.
28 * int value = (float value) * (1<<16) */
30 1.402f,
31 0.34413f,
32 0.71414f,
33 1.772f
34 };
35
37 91881,
38 22553,
39 46802,
40 116130
41 };
42
43 static void ict_float(
void *_src0,
void *_src1,
void *_src2,
int csize)
44 {
45 float *
src0 = _src0, *
src1 = _src1, *src2 = _src2;
48
49 for (
i = 0;
i < csize;
i++) {
57 }
58 }
59
60 static void ict_int(
void *_src0,
void *_src1,
void *_src2,
int csize)
61 {
65
66 for (
i = 0;
i < csize;
i++) {
67 i0 = *
src0 + *src2 + ((
int)((26345
U * *src2) + (1 << 15)) >> 16);
70 i2 = *
src0 + (2 * *
src1) + ((
int)((-14942
U * *
src1) + (1 << 15)) >> 16);
73 *src2++ = i2;
74 }
75 }
76
77 static void rct_int(
void *_src0,
void *_src1,
void *_src2,
int csize)
78 {
82
83 for (
i = 0;
i < csize;
i++) {
85 i0 = i1 + *src2;
89 *src2++ = i2;
90 }
91 }
92
94 {
98
99 if (ARCH_X86)
101 }