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
3a83b246
Commit
3a83b246
authored
Nov 26, 2011
by
Mans Rullgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnxhdenc: fix signed overflows
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
b6ae0866
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
dnxhdenc.c
libavcodec/dnxhdenc.c
+3
-2
No files found.
libavcodec/dnxhdenc.c
View file @
3a83b246
...
@@ -682,7 +682,8 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
...
@@ -682,7 +682,8 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
int
qscale
=
1
;
int
qscale
=
1
;
int
mb
=
y
*
ctx
->
m
.
mb_width
+
x
;
int
mb
=
y
*
ctx
->
m
.
mb_width
+
x
;
for
(
q
=
1
;
q
<
avctx
->
qmax
;
q
++
)
{
for
(
q
=
1
;
q
<
avctx
->
qmax
;
q
++
)
{
unsigned
score
=
ctx
->
mb_rc
[
q
][
mb
].
bits
*
lambda
+
(
ctx
->
mb_rc
[
q
][
mb
].
ssd
<<
LAMBDA_FRAC_BITS
);
unsigned
score
=
ctx
->
mb_rc
[
q
][
mb
].
bits
*
lambda
+
((
unsigned
)
ctx
->
mb_rc
[
q
][
mb
].
ssd
<<
LAMBDA_FRAC_BITS
);
if
(
score
<
min
)
{
if
(
score
<
min
)
{
min
=
score
;
min
=
score
;
qscale
=
q
;
qscale
=
q
;
...
@@ -709,7 +710,7 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
...
@@ -709,7 +710,7 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
lambda
=
(
lambda
+
last_higher
)
>>
1
;
lambda
=
(
lambda
+
last_higher
)
>>
1
;
else
else
lambda
-=
down_step
;
lambda
-=
down_step
;
down_step
*=
5
;
// XXX tune ?
down_step
=
FFMIN
((
int64_t
)
down_step
*
5
,
INT_MAX
);
up_step
=
1
<<
LAMBDA_FRAC_BITS
;
up_step
=
1
<<
LAMBDA_FRAC_BITS
;
lambda
=
FFMAX
(
1
,
lambda
);
lambda
=
FFMAX
(
1
,
lambda
);
if
(
lambda
==
last_lower
)
if
(
lambda
==
last_lower
)
...
...
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