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
3b3c1ed0
Commit
3b3c1ed0
authored
Jul 31, 2013
by
Timothy Gu
Committed by
Michael Niedermayer
Jul 31, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libxvid: Add SSIM displaying through a libxvidcore plugin
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
ccb212b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
encoders.texi
doc/encoders.texi
+37
-0
libxvid.c
libavcodec/libxvid.c
+19
-0
No files found.
doc/encoders.texi
View file @
3b3c1ed0
...
@@ -1336,6 +1336,43 @@ be better than any of the two specified individually. In other
...
@@ -1336,6 +1336,43 @@ be better than any of the two specified individually. In other
words, the resulting quality will be the worse one of the two
words, the resulting quality will be the worse one of the two
effects.
effects.
@item ssim
Set structural similarity (SSIM) displaying method. Possible values:
@table @samp
@item off
Disable displaying of SSIM information.
@item avg
Output average SSIM at the end of encoding to stdout. The format of
showing the average SSIM is:
@example
Average SSIM: %f
@end example
For users who are not familiar with C, %f means a float number, or
a decimal (e.g. 0.939232).
@item frame
Output both per-frame SSIM data during encoding and average SSIM at
the end of encoding to stdout. The format of per-frame information
is:
@example
SSIM: avg: %1.3f min: %1.3f max: %1.3f
@end example
For users who are not familiar with C, %1.3f means a float number
rounded to 3 digits after the dot (e.g. 0.932).
@end table
@item ssim_acc
Set SSIM accuracy. Valid options are integers within the range of
0-4, while 0 gives the most accurate result and 4 computes the
fastest.
@end table
@end table
@section png
@section png
...
...
libavcodec/libxvid.c
View file @
3b3c1ed0
...
@@ -65,6 +65,8 @@ struct xvid_context {
...
@@ -65,6 +65,8 @@ struct xvid_context {
unsigned
char
*
inter_matrix
;
/**< I-Frame Quant Matrix */
unsigned
char
*
inter_matrix
;
/**< I-Frame Quant Matrix */
int
lumi_aq
;
/**< Lumi masking as an aq method */
int
lumi_aq
;
/**< Lumi masking as an aq method */
int
variance_aq
;
/**< Variance adaptive quantization */
int
variance_aq
;
/**< Variance adaptive quantization */
int
ssim
;
/**< SSIM information display mode */
int
ssim_acc
;
/**< SSIM accuracy. 0: accurate. 4: fast. */
};
};
/**
/**
...
@@ -359,6 +361,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
...
@@ -359,6 +361,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
xvid_plugin_2pass2_t
rc2pass2
=
{
0
};
xvid_plugin_2pass2_t
rc2pass2
=
{
0
};
xvid_plugin_lumimasking_t
masking_l
=
{
0
};
/* For lumi masking */
xvid_plugin_lumimasking_t
masking_l
=
{
0
};
/* For lumi masking */
xvid_plugin_lumimasking_t
masking_v
=
{
0
};
/* For variance AQ */
xvid_plugin_lumimasking_t
masking_v
=
{
0
};
/* For variance AQ */
xvid_plugin_ssim_t
ssim
=
{
0
};
xvid_gbl_init_t
xvid_gbl_init
=
{
0
};
xvid_gbl_init_t
xvid_gbl_init
=
{
0
};
xvid_enc_create_t
xvid_enc_create
=
{
0
};
xvid_enc_create_t
xvid_enc_create
=
{
0
};
xvid_enc_plugin_t
plugins
[
7
];
xvid_enc_plugin_t
plugins
[
7
];
...
@@ -553,6 +556,17 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
...
@@ -553,6 +556,17 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
"Both lumi_aq and variance_aq are enabled. The resulting quality"
"Both lumi_aq and variance_aq are enabled. The resulting quality"
"will be the worse one of the two effects made by the AQ.
\n
"
);
"will be the worse one of the two effects made by the AQ.
\n
"
);
/* SSIM */
if
(
x
->
ssim
)
{
plugins
[
xvid_enc_create
.
num_plugins
].
func
=
xvid_plugin_ssim
;
ssim
.
b_printstat
=
(
x
->
ssim
==
2
);
ssim
.
acc
=
x
->
ssim_acc
;
ssim
.
cpu_flags
=
xvid_gbl_init
.
cpu_flags
;
ssim
.
b_visualize
=
0
;
plugins
[
xvid_enc_create
.
num_plugins
].
param
=
&
ssim
;
xvid_enc_create
.
num_plugins
++
;
}
/* Frame Rate and Key Frames */
/* Frame Rate and Key Frames */
xvid_correct_framerate
(
avctx
);
xvid_correct_framerate
(
avctx
);
xvid_enc_create
.
fincr
=
avctx
->
time_base
.
num
;
xvid_enc_create
.
fincr
=
avctx
->
time_base
.
num
;
...
@@ -788,6 +802,11 @@ static av_cold int xvid_encode_close(AVCodecContext *avctx) {
...
@@ -788,6 +802,11 @@ static av_cold int xvid_encode_close(AVCodecContext *avctx) {
static
const
AVOption
options
[]
=
{
static
const
AVOption
options
[]
=
{
{
"lumi_aq"
,
"Luminance masking AQ"
,
OFFSET
(
lumi_aq
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
1
,
VE
},
{
"lumi_aq"
,
"Luminance masking AQ"
,
OFFSET
(
lumi_aq
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
1
,
VE
},
{
"variance_aq"
,
"Variance AQ"
,
OFFSET
(
variance_aq
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
1
,
VE
},
{
"variance_aq"
,
"Variance AQ"
,
OFFSET
(
variance_aq
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
1
,
VE
},
{
"ssim"
,
"Show SSIM information to stdout"
,
OFFSET
(
ssim
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
2
,
VE
,
"ssim"
},
{
"off"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
0
},
INT_MIN
,
INT_MAX
,
VE
,
"ssim"
},
{
"avg"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
1
},
INT_MIN
,
INT_MAX
,
VE
,
"ssim"
},
{
"frame"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
2
},
INT_MIN
,
INT_MAX
,
VE
,
"ssim"
},
{
"ssim_acc"
,
"SSIM accuracy"
,
OFFSET
(
ssim_acc
),
AV_OPT_TYPE_INT
,
{
.
i64
=
2
},
0
,
4
,
VE
},
{
NULL
},
{
NULL
},
};
};
...
...
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