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
60532348
Commit
60532348
authored
Nov 21, 2015
by
Clément Bœsch
Committed by
Clément Bœsch
Dec 04, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mpegvideo: use constants for rc_strategy
parent
010caed2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
mpegvideo.h
libavcodec/mpegvideo.h
+9
-1
ratecontrol.c
libavcodec/ratecontrol.c
+7
-3
No files found.
libavcodec/mpegvideo.h
View file @
60532348
...
...
@@ -557,6 +557,12 @@ typedef struct MpegEncContext {
#define FF_MPV_FLAG_NAQ 0x0010
#define FF_MPV_FLAG_MV0 0x0020
enum
rc_strategy
{
MPV_RC_STRATEGY_FFMPEG
,
MPV_RC_STRATEGY_XVID
,
NB_MPV_RC_STRATEGY
};
#ifndef FF_MPV_OFFSET
#define FF_MPV_OFFSET(x) offsetof(MpegEncContext, x)
#endif
...
...
@@ -592,7 +598,9 @@ typedef struct MpegEncContext {
{"lmax", "maximum Lagrange factor (VBR)", FF_MPV_OFFSET(lmax), AV_OPT_TYPE_INT, {.i64 = 31*FF_QP2LAMBDA }, 0, INT_MAX, FF_MPV_OPT_FLAGS }, \
{"ibias", "intra quant bias", FF_MPV_OFFSET(intra_quant_bias), AV_OPT_TYPE_INT, {.i64 = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \
{"pbias", "inter quant bias", FF_MPV_OFFSET(inter_quant_bias), AV_OPT_TYPE_INT, {.i64 = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \
{"rc_strategy", "ratecontrol method", FF_MPV_OFFSET(rc_strategy), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, FF_MPV_OPT_FLAGS }, \
{"rc_strategy", "ratecontrol method", FF_MPV_OFFSET(rc_strategy), AV_OPT_TYPE_INT, {.i64 = MPV_RC_STRATEGY_FFMPEG }, 0, NB_MPV_RC_STRATEGY-1, FF_MPV_OPT_FLAGS, "rc_strategy" }, \
{ "ffmpeg", "default native rate control", 0, AV_OPT_TYPE_CONST, { .i64 = MPV_RC_STRATEGY_FFMPEG }, 0, 0, FF_MPV_OPT_FLAGS, "rc_strategy" }, \
{ "xvid", "libxvid (2 pass only)", 0, AV_OPT_TYPE_CONST, { .i64 = MPV_RC_STRATEGY_XVID }, 0, 0, FF_MPV_OPT_FLAGS, "rc_strategy" }, \
{"motion_est", "motion estimation algorithm", FF_MPV_OFFSET(motion_est), AV_OPT_TYPE_INT, {.i64 = FF_ME_EPZS }, FF_ME_ZERO, FF_ME_XONE, FF_MPV_OPT_FLAGS, "motion_est" }, \
{ "zero", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_ZERO }, 0, 0, FF_MPV_OPT_FLAGS, "motion_est" }, \
{ "epzs", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_EPZS }, 0, 0, FF_MPV_OPT_FLAGS, "motion_est" }, \
...
...
libavcodec/ratecontrol.c
View file @
60532348
...
...
@@ -233,8 +233,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
return
-
1
;
}
#if FF_API_RC_STRATEGY
av_assert0
(
MPV_RC_STRATEGY_XVID
==
FF_RC_STRATEGY_XVID
);
#endif
// FIXME maybe move to end
if
((
s
->
avctx
->
flags
&
AV_CODEC_FLAG_PASS2
)
&&
s
->
rc_strategy
==
1
)
{
if
((
s
->
avctx
->
flags
&
AV_CODEC_FLAG_PASS2
)
&&
s
->
rc_strategy
==
MPV_RC_STRATEGY_XVID
)
{
#if CONFIG_LIBXVID
return
ff_xvid_rate_control_init
(
s
);
#else
...
...
@@ -314,7 +318,7 @@ av_cold void ff_rate_control_uninit(MpegEncContext *s)
av_freep
(
&
rcc
->
entry
);
#if CONFIG_LIBXVID
if
((
s
->
avctx
->
flags
&
AV_CODEC_FLAG_PASS2
)
&&
s
->
rc_strategy
==
1
)
if
((
s
->
avctx
->
flags
&
AV_CODEC_FLAG_PASS2
)
&&
s
->
rc_strategy
==
MPV_RC_STRATEGY_XVID
)
ff_xvid_rate_control_uninit
(
s
);
#endif
}
...
...
@@ -767,7 +771,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
emms_c
();
#if CONFIG_LIBXVID
if
((
s
->
avctx
->
flags
&
AV_CODEC_FLAG_PASS2
)
&&
s
->
rc_strategy
==
1
)
if
((
s
->
avctx
->
flags
&
AV_CODEC_FLAG_PASS2
)
&&
s
->
rc_strategy
==
MPV_RC_STRATEGY_XVID
)
return
ff_xvid_rate_estimate_qscale
(
s
,
dry_run
);
#endif
...
...
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