Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
552b0b2c
Commit
552b0b2c
authored
May 01, 2017
by
Debargha Mukherjee
Committed by
Yaowu Xu
May 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some integer sanitization issues
BUG=aomedia:484 Change-Id: Ifc33faf23e355c499f1221e4d7f3425a1e28246d
parent
d74b56c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
+18
-14
av1/common/mv.h
av1/common/mv.h
+18
-14
No files found.
av1/common/mv.h
View file @
552b0b2c
...
...
@@ -205,7 +205,7 @@ static INLINE int_mv gm_get_motion_vector(const WarpedMotionParams *gm,
const
int
unify_bsize
=
CONFIG_CB4X4
;
int_mv
res
;
const
int32_t
*
mat
=
gm
->
wmmat
;
int
x
c
,
y
c
,
x
,
y
;
int
x
,
y
,
t
x
,
t
y
;
if
(
gm
->
wmtype
==
TRANSLATION
)
{
res
.
as_mv
.
row
=
gm
->
wmmat
[
0
]
>>
GM_TRANS_ONLY_PREC_DIFF
;
...
...
@@ -227,22 +227,26 @@ static INLINE int_mv gm_get_motion_vector(const WarpedMotionParams *gm,
assert
(
gm
->
wmmat
[
5
]
==
gm
->
wmmat
[
2
]);
assert
(
gm
->
wmmat
[
4
]
==
-
gm
->
wmmat
[
3
]);
}
xc
=
mat
[
2
]
*
x
+
mat
[
3
]
*
y
+
mat
[
0
];
yc
=
mat
[
4
]
*
x
+
mat
[
5
]
*
y
+
mat
[
1
];
if
(
gm
->
wmtype
>
AFFINE
)
{
const
int
Z
=
mat
[
6
]
*
x
+
mat
[
7
]
*
y
+
(
1
<<
WARPEDMODEL_ROW3HOMO_PREC_BITS
);
xc
<<=
(
WARPEDMODEL_ROW3HOMO_PREC_BITS
-
WARPEDMODEL_PREC_BITS
);
yc
<<=
(
WARPEDMODEL_ROW3HOMO_PREC_BITS
-
WARPEDMODEL_PREC_BITS
);
xc
=
xc
>
0
?
(
xc
+
Z
/
2
)
/
Z
:
(
xc
-
Z
/
2
)
/
Z
;
yc
=
yc
>
0
?
(
yc
+
Z
/
2
)
/
Z
:
(
yc
-
Z
/
2
)
/
Z
;
int
xc
=
(
int
)((
int64_t
)
mat
[
2
]
*
x
+
(
int64_t
)
mat
[
3
]
*
y
+
mat
[
0
]);
int
yc
=
(
int
)((
int64_t
)
mat
[
4
]
*
x
+
(
int64_t
)
mat
[
5
]
*
y
+
mat
[
1
]);
const
int
Z
=
(
int
)((
int64_t
)
mat
[
6
]
*
x
+
(
int64_t
)
mat
[
7
]
*
y
+
(
1
<<
WARPEDMODEL_ROW3HOMO_PREC_BITS
));
xc
*=
1
<<
(
WARPEDMODEL_ROW3HOMO_PREC_BITS
-
WARPEDMODEL_PREC_BITS
);
yc
*=
1
<<
(
WARPEDMODEL_ROW3HOMO_PREC_BITS
-
WARPEDMODEL_PREC_BITS
);
xc
=
(
int
)(
xc
>
0
?
((
int64_t
)
xc
+
Z
/
2
)
/
Z
:
((
int64_t
)
xc
-
Z
/
2
)
/
Z
);
yc
=
(
int
)(
yc
>
0
?
((
int64_t
)
yc
+
Z
/
2
)
/
Z
:
((
int64_t
)
yc
-
Z
/
2
)
/
Z
);
tx
=
convert_to_trans_prec
(
allow_hp
,
xc
)
-
(
x
<<
3
);
ty
=
convert_to_trans_prec
(
allow_hp
,
yc
)
-
(
y
<<
3
);
}
else
{
const
int
xc
=
(
mat
[
2
]
-
(
1
<<
WARPEDMODEL_PREC_BITS
))
*
x
+
mat
[
3
]
*
y
+
mat
[
0
];
const
int
yc
=
mat
[
4
]
*
x
+
(
mat
[
5
]
-
(
1
<<
WARPEDMODEL_PREC_BITS
))
*
y
+
mat
[
1
];
tx
=
convert_to_trans_prec
(
allow_hp
,
xc
);
ty
=
convert_to_trans_prec
(
allow_hp
,
yc
);
}
int
tx
=
convert_to_trans_prec
(
allow_hp
,
xc
)
-
(
x
<<
3
);
int
ty
=
convert_to_trans_prec
(
allow_hp
,
yc
)
-
(
y
<<
3
);
res
.
as_mv
.
row
=
ty
;
res
.
as_mv
.
col
=
tx
;
return
res
;
...
...
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