Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
a510abd5
Commit
a510abd5
authored
May 28, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
j2kdec:merge mct_decode from jpeg2000
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
c37d735c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
7 deletions
+41
-7
j2kdec.c
libavcodec/j2kdec.c
+41
-7
No files found.
libavcodec/j2kdec.c
View file @
a510abd5
...
...
@@ -831,26 +831,60 @@ static void dequantization_int(int x, int y, Jpeg2000Cblk *cblk,
}
}
/* Inverse ICT parameters in float and integer.
* int value = (float value) * (1<<16) */
static
const
float
f_ict_params
[
4
]
=
{
1
.
402
f
,
0
.
34413
f
,
0
.
71414
f
,
1
.
772
f
};
static
const
int
i_ict_params
[
4
]
=
{
91881
,
22553
,
46802
,
116130
};
static
void
mct_decode
(
Jpeg2000DecoderContext
*
s
,
Jpeg2000Tile
*
tile
)
{
int
i
,
*
src
[
3
],
i0
,
i1
,
i2
,
csize
=
1
;
int
i
,
csize
=
1
;
int32_t
*
src
[
3
],
i0
,
i1
,
i2
;
float
*
srcf
[
3
],
i0f
,
i1f
,
i2f
;
for
(
i
=
0
;
i
<
3
;
i
++
)
src
[
i
]
=
tile
->
comp
[
i
].
data
;
if
(
tile
->
codsty
[
0
].
transform
==
FF_DWT97
)
srcf
[
i
]
=
tile
->
comp
[
i
].
data
;
else
src
[
i
]
=
(
int32_t
*
)
tile
->
comp
[
i
].
data
;
for
(
i
=
0
;
i
<
2
;
i
++
)
csize
*=
tile
->
comp
[
0
].
coord
[
i
][
1
]
-
tile
->
comp
[
0
].
coord
[
i
][
0
];
if
(
tile
->
codsty
[
0
].
transform
==
FF_DWT97
)
{
switch
(
tile
->
codsty
[
0
].
transform
)
{
case
FF_DWT97
:
for
(
i
=
0
;
i
<
csize
;
i
++
)
{
i0
=
*
src
[
0
]
+
(
*
src
[
2
]
*
46802
>>
16
);
i1
=
*
src
[
0
]
-
(
*
src
[
1
]
*
22553
+
*
src
[
2
]
*
46802
>>
16
);
i2
=
*
src
[
0
]
+
(
116130
*
*
src
[
1
]
>>
16
);
i0f
=
*
srcf
[
0
]
+
(
f_ict_params
[
0
]
*
*
srcf
[
2
]);
i1f
=
*
srcf
[
0
]
-
(
f_ict_params
[
1
]
*
*
srcf
[
1
])
-
(
f_ict_params
[
2
]
*
*
srcf
[
2
]);
i2f
=
*
srcf
[
0
]
+
(
f_ict_params
[
3
]
*
*
srcf
[
1
]);
*
srcf
[
0
]
++
=
i0f
;
*
srcf
[
1
]
++
=
i1f
;
*
srcf
[
2
]
++
=
i2f
;
}
break
;
case
FF_DWT97_INT
:
for
(
i
=
0
;
i
<
csize
;
i
++
)
{
i0
=
*
src
[
0
]
+
(((
i_ict_params
[
0
]
*
*
src
[
2
])
+
(
1
<<
15
))
>>
16
);
i1
=
*
src
[
0
]
-
(((
i_ict_params
[
1
]
*
*
src
[
1
])
+
(
1
<<
15
))
>>
16
)
-
(((
i_ict_params
[
2
]
*
*
src
[
2
])
+
(
1
<<
15
))
>>
16
);
i2
=
*
src
[
0
]
+
(((
i_ict_params
[
3
]
*
*
src
[
1
])
+
(
1
<<
15
))
>>
16
);
*
src
[
0
]
++
=
i0
;
*
src
[
1
]
++
=
i1
;
*
src
[
2
]
++
=
i2
;
}
}
else
{
break
;
case
FF_DWT53
:
for
(
i
=
0
;
i
<
csize
;
i
++
)
{
i1
=
*
src
[
0
]
-
(
*
src
[
2
]
+
*
src
[
1
]
>>
2
);
i0
=
i1
+
*
src
[
2
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment