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
44972e22
Commit
44972e22
authored
Jul 20, 2016
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ratecontrol: Move mpegenc-only function where it is used
parent
b4bb9593
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
23 deletions
+23
-23
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+23
-1
ratecontrol.c
libavcodec/ratecontrol.c
+0
-21
ratecontrol.h
libavcodec/ratecontrol.h
+0
-1
No files found.
libavcodec/mpegvideo_enc.c
View file @
44972e22
...
...
@@ -1671,6 +1671,28 @@ static int frame_start(MpegEncContext *s)
return
0
;
}
static
void
write_pass1_stats
(
MpegEncContext
*
s
)
{
snprintf
(
s
->
avctx
->
stats_out
,
256
,
"in:%d out:%d type:%d q:%d itex:%d ptex:%d mv:%d misc:%d "
"fcode:%d bcode:%d mc-var:%d var:%d icount:%d skipcount:%d "
"hbits:%d;
\n
"
,
s
->
current_picture_ptr
->
f
->
display_picture_number
,
s
->
current_picture_ptr
->
f
->
coded_picture_number
,
s
->
pict_type
,
s
->
current_picture
.
f
->
quality
,
s
->
i_tex_bits
,
s
->
p_tex_bits
,
s
->
mv_bits
,
s
->
misc_bits
,
s
->
f_code
,
s
->
b_code
,
s
->
current_picture
.
mc_mb_var_sum
,
s
->
current_picture
.
mb_var_sum
,
s
->
i_count
,
s
->
skip_count
,
s
->
header_bits
);
}
int
ff_mpv_encode_picture
(
AVCodecContext
*
avctx
,
AVPacket
*
pkt
,
const
AVFrame
*
pic_arg
,
int
*
got_packet
)
{
...
...
@@ -1783,7 +1805,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
if
(
s
->
avctx
->
flags
&
AV_CODEC_FLAG_PASS1
)
ff_
write_pass1_stats
(
s
);
write_pass1_stats
(
s
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
s
->
current_picture_ptr
->
encoding_error
[
i
]
=
s
->
current_picture
.
encoding_error
[
i
];
...
...
libavcodec/ratecontrol.c
View file @
44972e22
...
...
@@ -46,27 +46,6 @@ static int init_pass2(MpegEncContext *s);
static
double
get_qscale
(
MpegEncContext
*
s
,
RateControlEntry
*
rce
,
double
rate_factor
,
int
frame_num
);
void
ff_write_pass1_stats
(
MpegEncContext
*
s
)
{
snprintf
(
s
->
avctx
->
stats_out
,
256
,
"in:%d out:%d type:%d q:%d itex:%d ptex:%d mv:%d misc:%d "
"fcode:%d bcode:%d mc-var:%d var:%d icount:%d skipcount:%d hbits:%d;
\n
"
,
s
->
current_picture_ptr
->
f
->
display_picture_number
,
s
->
current_picture_ptr
->
f
->
coded_picture_number
,
s
->
pict_type
,
s
->
current_picture
.
f
->
quality
,
s
->
i_tex_bits
,
s
->
p_tex_bits
,
s
->
mv_bits
,
s
->
misc_bits
,
s
->
f_code
,
s
->
b_code
,
s
->
current_picture
.
mc_mb_var_sum
,
s
->
current_picture
.
mb_var_sum
,
s
->
i_count
,
s
->
skip_count
,
s
->
header_bits
);
}
static
inline
double
qp2bits
(
RateControlEntry
*
rce
,
double
qp
)
{
if
(
qp
<=
0
.
0
)
{
...
...
libavcodec/ratecontrol.h
View file @
44972e22
...
...
@@ -91,7 +91,6 @@ struct MpegEncContext;
/* rate control */
int
ff_rate_control_init
(
struct
MpegEncContext
*
s
);
float
ff_rate_estimate_qscale
(
struct
MpegEncContext
*
s
,
int
dry_run
);
void
ff_write_pass1_stats
(
struct
MpegEncContext
*
s
);
void
ff_rate_control_uninit
(
struct
MpegEncContext
*
s
);
int
ff_vbv_update
(
struct
MpegEncContext
*
s
,
int
frame_size
);
void
ff_get_2pass_fcode
(
struct
MpegEncContext
*
s
);
...
...
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