Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
dav1d
Commits
1d3f6364
Commit
1d3f6364
authored
Dec 12, 2018
by
Janne Grunau
Browse files
inv_identity: avoid signed int overflow for 12-bit files
Fixes
#220
.
parent
c3ee7290
Pipeline
#3507
passed with stages
in 5 minutes and 42 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/itx_1d.c
View file @
1d3f6364
...
...
@@ -824,7 +824,7 @@ inv_identity4_1d(const coef *const in, const ptrdiff_t in_s,
coef
*
const
out
,
const
ptrdiff_t
out_s
,
const
int
range
)
{
for
(
int
i
=
0
;
i
<
4
;
i
++
)
out
[
out_s
*
i
]
=
(
in
[
in_s
*
i
]
*
5793
+
2048
)
>>
12
;
out
[
out_s
*
i
]
=
in
[
in_s
*
i
]
+
(
(
in
[
in_s
*
i
]
*
1697
+
2048
)
>>
12
)
;
}
static
void
NOINLINE
...
...
@@ -840,7 +840,7 @@ inv_identity16_1d(const coef *const in, const ptrdiff_t in_s,
coef
*
const
out
,
const
ptrdiff_t
out_s
,
const
int
range
)
{
for
(
int
i
=
0
;
i
<
16
;
i
++
)
out
[
out_s
*
i
]
=
(
in
[
in_s
*
i
]
*
2
*
5793
+
2048
)
>>
1
2
;
out
[
out_s
*
i
]
=
2
*
in
[
in_s
*
i
]
+
((
in
[
in_s
*
i
]
*
1697
+
1024
)
>>
1
1
)
;
}
static
void
NOINLINE
...
...
Write
Preview
Supports
Markdown
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