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
e708afd3
Commit
e708afd3
authored
Oct 08, 2011
by
Mans Rullgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
motion_est: fix some signed overflows
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
559c244d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
motion_est.c
libavcodec/motion_est.c
+2
-2
No files found.
libavcodec/motion_est.c
View file @
e708afd3
...
@@ -1016,7 +1016,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
...
@@ -1016,7 +1016,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
/* intra / predictive decision */
/* intra / predictive decision */
pix
=
c
->
src
[
0
][
0
];
pix
=
c
->
src
[
0
][
0
];
sum
=
s
->
dsp
.
pix_sum
(
pix
,
s
->
linesize
);
sum
=
s
->
dsp
.
pix_sum
(
pix
,
s
->
linesize
);
varc
=
s
->
dsp
.
pix_norm1
(
pix
,
s
->
linesize
)
-
(((
unsigned
)
(
sum
*
sum
)
)
>>
8
)
+
500
;
varc
=
s
->
dsp
.
pix_norm1
(
pix
,
s
->
linesize
)
-
(((
unsigned
)
sum
*
sum
)
>>
8
)
+
500
;
pic
->
mb_mean
[
s
->
mb_stride
*
mb_y
+
mb_x
]
=
(
sum
+
128
)
>>
8
;
pic
->
mb_mean
[
s
->
mb_stride
*
mb_y
+
mb_x
]
=
(
sum
+
128
)
>>
8
;
pic
->
mb_var
[
s
->
mb_stride
*
mb_y
+
mb_x
]
=
(
varc
+
128
)
>>
8
;
pic
->
mb_var
[
s
->
mb_stride
*
mb_y
+
mb_x
]
=
(
varc
+
128
)
>>
8
;
...
@@ -1178,7 +1178,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
...
@@ -1178,7 +1178,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
if
((
c
->
avctx
->
mb_cmp
&
0xFF
)
==
FF_CMP_SSE
){
if
((
c
->
avctx
->
mb_cmp
&
0xFF
)
==
FF_CMP_SSE
){
intra_score
=
varc
-
500
;
intra_score
=
varc
-
500
;
}
else
{
}
else
{
int
mean
=
(
sum
+
128
)
>>
8
;
unsigned
mean
=
(
sum
+
128
)
>>
8
;
mean
*=
0x01010101
;
mean
*=
0x01010101
;
for
(
i
=
0
;
i
<
16
;
i
++
){
for
(
i
=
0
;
i
<
16
;
i
++
){
...
...
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