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
ff3dfbae
Commit
ff3dfbae
authored
Mar 30, 2002
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing 1/0
Originally committed as revision 370 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
14ae07d8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
mpegvideo.c
libavcodec/mpegvideo.c
+3
-3
No files found.
libavcodec/mpegvideo.c
View file @
ff3dfbae
...
...
@@ -1995,7 +1995,7 @@ static int rate_estimate_qscale(MpegEncContext *s)
s
->
short_term_qcount
++
;
short_term_q
=
s
->
short_term_qsum
/
s
->
short_term_qcount
;
long_term_q
=
s
->
qsum
/
s
->
qcount
*
s
->
total_bits
/
wanted_bits
;
long_term_q
=
s
->
qsum
/
s
->
qcount
*
(
s
->
total_bits
+
1
)
/
(
wanted_bits
+
1
);
//+1 to avoid nan & 0
// q= (long_term_q - short_term_q)*s->qcompress + short_term_q;
q
=
1
/
((
1
/
long_term_q
-
1
/
short_term_q
)
*
s
->
qcompress
+
1
/
short_term_q
);
...
...
@@ -2016,8 +2016,8 @@ static int rate_estimate_qscale(MpegEncContext *s)
s
->
qcount
++
;
s
->
last_pict_type
=
s
->
pict_type
;
//printf("q:%d diff:%d comp:%f rate_q:%d st_q:%
d
fvar:%d last_size:%d\n", qscale, (int)diff, br_compensation,
// rate_q,
(int)
short_term_q, s->mc_mb_var, s->frame_bits);
//printf("q:%d diff:%d comp:%f rate_q:%d st_q:%
f
fvar:%d last_size:%d\n", qscale, (int)diff, br_compensation,
// rate_q, short_term_q, s->mc_mb_var, s->frame_bits);
//printf("%d %d\n", s->bit_rate, (int)fps);
return
qscale
;
#else
...
...
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