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
82b019ce
Commit
82b019ce
authored
Dec 22, 2005
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better f_code guessing in 2nd pass
Originally committed as revision 4766 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
50c6f6cd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
mpegvideo.c
libavcodec/mpegvideo.c
+3
-2
mpegvideo.h
libavcodec/mpegvideo.h
+1
-1
ratecontrol.c
libavcodec/ratecontrol.c
+11
-0
No files found.
libavcodec/mpegvideo.c
View file @
82b019ce
...
...
@@ -5298,9 +5298,10 @@ static void encode_picture(MpegEncContext *s, int picture_number)
s
->
no_rounding
^=
1
;
}
if
(
s
->
flags
&
CODEC_FLAG_PASS2
)
if
(
s
->
flags
&
CODEC_FLAG_PASS2
)
{
estimate_qp
(
s
,
1
);
else
if
(
!
(
s
->
flags
&
CODEC_FLAG_QSCALE
)){
ff_get_2pass_fcode
(
s
);
}
else
if
(
!
(
s
->
flags
&
CODEC_FLAG_QSCALE
)){
RateControlContext
*
rcc
=
&
s
->
rc_context
;
if
(
s
->
pict_type
==
B_TYPE
)
...
...
libavcodec/mpegvideo.h
View file @
82b019ce
...
...
@@ -980,6 +980,6 @@ double ff_eval(char *s, double *const_value, const char **const_name,
double
(
**
func2
)(
void
*
,
double
,
double
),
char
**
func2_name
,
void
*
opaque
);
int
ff_vbv_update
(
MpegEncContext
*
s
,
int
frame_size
);
void
ff_get_2pass_fcode
(
MpegEncContext
*
s
);
#endif
/* AVCODEC_MPEGVIDEO_H */
libavcodec/ratecontrol.c
View file @
82b019ce
...
...
@@ -607,6 +607,17 @@ static void adaptive_quantization(MpegEncContext *s, double q){
s
->
lambda_table
[
mb_xy
]
=
intq
;
}
}
void
ff_get_2pass_fcode
(
MpegEncContext
*
s
){
RateControlContext
*
rcc
=
&
s
->
rc_context
;
int
picture_number
=
s
->
picture_number
;
RateControlEntry
*
rce
;
rce
=
&
rcc
->
entry
[
picture_number
];
s
->
f_code
=
rce
->
f_code
;
s
->
b_code
=
rce
->
b_code
;
}
//FIXME rd or at least approx for dquant
float
ff_rate_estimate_qscale
(
MpegEncContext
*
s
,
int
dry_run
)
...
...
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