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
4601e76a
Commit
4601e76a
authored
May 14, 2009
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix VBV delay for mpeg1/2 CBR.
Originally committed as revision 18820 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
0a8dedc9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+12
-2
No files found.
libavcodec/mpegvideo_enc.c
View file @
4601e76a
...
...
@@ -1305,11 +1305,21 @@ vbv_retry:
/* update mpeg1/2 vbv_delay for CBR */
if
(
s
->
avctx
->
rc_max_rate
&&
s
->
avctx
->
rc_min_rate
==
s
->
avctx
->
rc_max_rate
&&
s
->
out_format
==
FMT_MPEG1
&&
90000LL
*
(
avctx
->
rc_buffer_size
-
1
)
<=
s
->
avctx
->
rc_max_rate
*
0xFFFFLL
){
int
vbv_delay
;
int
vbv_delay
,
min_delay
;
double
inbits
=
s
->
avctx
->
rc_max_rate
*
av_q2d
(
s
->
avctx
->
time_base
);
int
minbits
=
s
->
frame_bits
-
8
*
(
s
->
vbv_delay_ptr
-
s
->
pb
.
buf
-
1
);
double
bits
=
s
->
rc_context
.
buffer_index
+
minbits
-
inbits
;
if
(
bits
<
0
)
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Internal error, negative bits
\n
"
);
assert
(
s
->
repeat_first_field
==
0
);
vbv_delay
=
lrintf
(
90000
*
s
->
rc_context
.
buffer_index
/
s
->
avctx
->
rc_max_rate
);
vbv_delay
=
bits
*
90000
/
s
->
avctx
->
rc_max_rate
;
min_delay
=
(
minbits
*
90000LL
+
s
->
avctx
->
rc_max_rate
-
1
)
/
s
->
avctx
->
rc_max_rate
;
vbv_delay
=
FFMAX
(
vbv_delay
,
min_delay
);
assert
(
vbv_delay
<
0xFFFF
);
s
->
vbv_delay_ptr
[
0
]
&=
0xF8
;
...
...
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