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
71b5f442
Commit
71b5f442
authored
Sep 01, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libx264: add 'deblock' private option
Deprecate AVCodecContext.deblockalpha/deblockbeta
parent
f83c4518
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
8 deletions
+20
-8
avcodec.h
libavcodec/avcodec.h
+4
-2
libx264.c
libavcodec/libx264.c
+14
-6
options.c
libavcodec/options.c
+2
-0
No files found.
libavcodec/avcodec.h
View file @
71b5f442
...
@@ -2456,13 +2456,14 @@ typedef struct AVCodecContext {
...
@@ -2456,13 +2456,14 @@ typedef struct AVCodecContext {
*/
*/
float
complexityblur
;
float
complexityblur
;
#if FF_API_X264_GLOBAL_OPTS
/**
/**
* in-loop deblocking filter alphac0 parameter
* in-loop deblocking filter alphac0 parameter
* alpha is in the range -6...6
* alpha is in the range -6...6
* - encoding: Set by user.
* - encoding: Set by user.
* - decoding: unused
* - decoding: unused
*/
*/
int
deblockalpha
;
attribute_deprecated
int
deblockalpha
;
/**
/**
* in-loop deblocking filter beta parameter
* in-loop deblocking filter beta parameter
...
@@ -2470,7 +2471,8 @@ typedef struct AVCodecContext {
...
@@ -2470,7 +2471,8 @@ typedef struct AVCodecContext {
* - encoding: Set by user.
* - encoding: Set by user.
* - decoding: unused
* - decoding: unused
*/
*/
int
deblockbeta
;
attribute_deprecated
int
deblockbeta
;
#endif
/**
/**
* macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4
* macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4
...
...
libavcodec/libx264.c
View file @
71b5f442
...
@@ -60,6 +60,7 @@ typedef struct X264Context {
...
@@ -60,6 +60,7 @@ typedef struct X264Context {
int
fast_pskip
;
int
fast_pskip
;
int
aud
;
int
aud
;
int
mbtree
;
int
mbtree
;
char
*
deblock
;
}
X264Context
;
}
X264Context
;
static
void
X264_log
(
void
*
p
,
int
level
,
const
char
*
fmt
,
va_list
args
)
static
void
X264_log
(
void
*
p
,
int
level
,
const
char
*
fmt
,
va_list
args
)
...
@@ -184,6 +185,12 @@ static av_cold int X264_close(AVCodecContext *avctx)
...
@@ -184,6 +185,12 @@ static av_cold int X264_close(AVCodecContext *avctx)
return
0
;
return
0
;
}
}
#define PARSE_X264_OPT(name, var)\
if (x4->var && x264_param_parse(&x4->params, name, x4->var) < 0) {\
av_log(avctx, AV_LOG_ERROR, "Error parsing option '%s' with value '%s'.\n", name, x4->var);\
return AVERROR(EINVAL);\
}
static
av_cold
int
X264_init
(
AVCodecContext
*
avctx
)
static
av_cold
int
X264_init
(
AVCodecContext
*
avctx
)
{
{
X264Context
*
x4
=
avctx
->
priv_data
;
X264Context
*
x4
=
avctx
->
priv_data
;
...
@@ -198,8 +205,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
...
@@ -198,8 +205,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4
->
params
.
i_keyint_min
=
x4
->
params
.
i_keyint_max
;
x4
->
params
.
i_keyint_min
=
x4
->
params
.
i_keyint_max
;
x4
->
params
.
b_deblocking_filter
=
avctx
->
flags
&
CODEC_FLAG_LOOP_FILTER
;
x4
->
params
.
b_deblocking_filter
=
avctx
->
flags
&
CODEC_FLAG_LOOP_FILTER
;
x4
->
params
.
i_deblocking_filter_alphac0
=
avctx
->
deblockalpha
;
x4
->
params
.
i_deblocking_filter_beta
=
avctx
->
deblockbeta
;
x4
->
params
.
rc
.
f_complexity_blur
=
avctx
->
complexityblur
;
x4
->
params
.
rc
.
f_complexity_blur
=
avctx
->
complexityblur
;
...
@@ -310,6 +315,10 @@ static av_cold int X264_init(AVCodecContext *avctx)
...
@@ -310,6 +315,10 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4
->
params
.
analyse
.
i_weighted_pred
=
avctx
->
weighted_p_pred
;
x4
->
params
.
analyse
.
i_weighted_pred
=
avctx
->
weighted_p_pred
;
if
(
avctx
->
bframebias
)
if
(
avctx
->
bframebias
)
x4
->
params
.
i_bframe_bias
=
avctx
->
bframebias
;
x4
->
params
.
i_bframe_bias
=
avctx
->
bframebias
;
if
(
avctx
->
deblockalpha
)
x4
->
params
.
i_deblocking_filter_alphac0
=
avctx
->
deblockalpha
;
if
(
avctx
->
deblockbeta
)
x4
->
params
.
i_deblocking_filter_beta
=
avctx
->
deblockbeta
;
x4
->
params
.
analyse
.
b_ssim
=
avctx
->
flags2
&
CODEC_FLAG2_SSIM
;
x4
->
params
.
analyse
.
b_ssim
=
avctx
->
flags2
&
CODEC_FLAG2_SSIM
;
x4
->
params
.
b_intra_refresh
=
avctx
->
flags2
&
CODEC_FLAG2_INTRA_REFRESH
;
x4
->
params
.
b_intra_refresh
=
avctx
->
flags2
&
CODEC_FLAG2_INTRA_REFRESH
;
x4
->
params
.
i_bframe_pyramid
=
avctx
->
flags2
&
CODEC_FLAG2_BPYRAMID
?
X264_B_PYRAMID_NORMAL
:
X264_B_PYRAMID_NONE
;
x4
->
params
.
i_bframe_pyramid
=
avctx
->
flags2
&
CODEC_FLAG2_BPYRAMID
?
X264_B_PYRAMID_NORMAL
:
X264_B_PYRAMID_NONE
;
...
@@ -345,10 +354,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
...
@@ -345,10 +354,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4
->
params
.
rc
.
i_aq_mode
=
x4
->
aq_mode
;
x4
->
params
.
rc
.
i_aq_mode
=
x4
->
aq_mode
;
if
(
x4
->
aq_strength
>=
0
)
if
(
x4
->
aq_strength
>=
0
)
x4
->
params
.
rc
.
f_aq_strength
=
x4
->
aq_strength
;
x4
->
params
.
rc
.
f_aq_strength
=
x4
->
aq_strength
;
if
(
x4
->
psy_rd
&&
x264_param_parse
(
&
x4
->
params
,
"psy-rd"
,
x4
->
psy_rd
)
<
0
)
{
PARSE_X264_OPT
(
"psy-rd"
,
psy_rd
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error parsing option 'psy-rd' with value '%s'.
\n
"
,
x4
->
psy_rd
);
PARSE_X264_OPT
(
"deblock"
,
deblock
);
return
AVERROR
(
EINVAL
);
}
if
(
x4
->
psy
>=
0
)
if
(
x4
->
psy
>=
0
)
x4
->
params
.
analyse
.
b_psy
=
x4
->
psy
;
x4
->
params
.
analyse
.
b_psy
=
x4
->
psy
;
if
(
x4
->
rc_lookahead
>=
0
)
if
(
x4
->
rc_lookahead
>=
0
)
...
@@ -474,6 +481,7 @@ static const AVOption options[] = {
...
@@ -474,6 +481,7 @@ static const AVOption options[] = {
{
"fast-pskip"
,
NULL
,
OFFSET
(
fast_pskip
),
FF_OPT_TYPE_INT
,
{
-
1
},
-
1
,
1
,
VE
},
{
"fast-pskip"
,
NULL
,
OFFSET
(
fast_pskip
),
FF_OPT_TYPE_INT
,
{
-
1
},
-
1
,
1
,
VE
},
{
"aud"
,
"Use access unit delimiters."
,
OFFSET
(
aud
),
FF_OPT_TYPE_INT
,
{
-
1
},
-
1
,
1
,
VE
},
{
"aud"
,
"Use access unit delimiters."
,
OFFSET
(
aud
),
FF_OPT_TYPE_INT
,
{
-
1
},
-
1
,
1
,
VE
},
{
"mbtree"
,
"Use macroblock tree ratecontrol."
,
OFFSET
(
mbtree
),
FF_OPT_TYPE_INT
,
{
-
1
},
-
1
,
1
,
VE
},
{
"mbtree"
,
"Use macroblock tree ratecontrol."
,
OFFSET
(
mbtree
),
FF_OPT_TYPE_INT
,
{
-
1
},
-
1
,
1
,
VE
},
{
"deblock"
,
"Loop filter parameters, in <alpha:beta> form."
,
OFFSET
(
deblock
),
FF_OPT_TYPE_STRING
,
{
0
},
0
,
0
,
VE
},
{
NULL
},
{
NULL
},
};
};
...
...
libavcodec/options.c
View file @
71b5f442
...
@@ -413,8 +413,10 @@ static const AVOption options[]={
...
@@ -413,8 +413,10 @@ static const AVOption options[]={
#endif
#endif
{
"skiprd"
,
"RD optimal MB level residual skipping"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG2_SKIP_RD
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags2"
},
{
"skiprd"
,
"RD optimal MB level residual skipping"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG2_SKIP_RD
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags2"
},
{
"complexityblur"
,
"reduce fluctuations in qp (before curve compression)"
,
OFFSET
(
complexityblur
),
FF_OPT_TYPE_FLOAT
,
{.
dbl
=
20
.
0
},
FLT_MIN
,
FLT_MAX
,
V
|
E
},
{
"complexityblur"
,
"reduce fluctuations in qp (before curve compression)"
,
OFFSET
(
complexityblur
),
FF_OPT_TYPE_FLOAT
,
{.
dbl
=
20
.
0
},
FLT_MIN
,
FLT_MAX
,
V
|
E
},
#if FF_API_X264_GLOBAL_OPTS
{
"deblockalpha"
,
"in-loop deblocking filter alphac0 parameter"
,
OFFSET
(
deblockalpha
),
FF_OPT_TYPE_INT
,
{.
dbl
=
DEFAULT
},
-
6
,
6
,
V
|
E
},
{
"deblockalpha"
,
"in-loop deblocking filter alphac0 parameter"
,
OFFSET
(
deblockalpha
),
FF_OPT_TYPE_INT
,
{.
dbl
=
DEFAULT
},
-
6
,
6
,
V
|
E
},
{
"deblockbeta"
,
"in-loop deblocking filter beta parameter"
,
OFFSET
(
deblockbeta
),
FF_OPT_TYPE_INT
,
{.
dbl
=
DEFAULT
},
-
6
,
6
,
V
|
E
},
{
"deblockbeta"
,
"in-loop deblocking filter beta parameter"
,
OFFSET
(
deblockbeta
),
FF_OPT_TYPE_INT
,
{.
dbl
=
DEFAULT
},
-
6
,
6
,
V
|
E
},
#endif
{
"partitions"
,
"macroblock subpartition sizes to consider"
,
OFFSET
(
partitions
),
FF_OPT_TYPE_FLAGS
,
{.
dbl
=
DEFAULT
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"partitions"
},
{
"partitions"
,
"macroblock subpartition sizes to consider"
,
OFFSET
(
partitions
),
FF_OPT_TYPE_FLAGS
,
{.
dbl
=
DEFAULT
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"partitions"
},
{
"parti4x4"
,
NULL
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
X264_PART_I4X4
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"partitions"
},
{
"parti4x4"
,
NULL
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
X264_PART_I4X4
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"partitions"
},
{
"parti8x8"
,
NULL
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
X264_PART_I8X8
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"partitions"
},
{
"parti8x8"
,
NULL
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
X264_PART_I8X8
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"partitions"
},
...
...
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