Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
libvpx
Commits
e758f9d4
Commit
e758f9d4
authored
Jan 18, 2017
by
Peter Boström
Committed by
Gerrit Code Review
Jan 18, 2017
Browse files
Merge "Add CSV per-frame stats to vpxdec."
parents
70c9b3c6
a981cb28
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
5 deletions
+32
-5
vpxdec.c
vpxdec.c
+32
-5
No files found.
vpxdec.c
View file @
e758f9d4
...
...
@@ -94,16 +94,21 @@ static const arg_def_t outbitdeptharg =
#endif
static
const
arg_def_t
svcdecodingarg
=
ARG_DEF
(
NULL
,
"svc-decode-layer"
,
1
,
"Decode SVC stream up to given spatial layer"
);
static
const
arg_def_t
framestatsarg
=
ARG_DEF
(
NULL
,
"framestats"
,
1
,
"Output per-frame stats (.csv format)"
);
static
const
arg_def_t
*
all_args
[]
=
{
&
codecarg
,
&
use_yv12
,
&
use_i420
,
&
flipuvarg
,
&
rawvideo
,
&
noblitarg
,
&
progressarg
,
&
limitarg
,
&
skiparg
,
&
postprocarg
,
&
summaryarg
,
&
outputfile
,
&
threadsarg
,
&
frameparallelarg
,
&
verbosearg
,
&
scalearg
,
&
fb_arg
,
&
md5arg
,
&
error_concealment
,
&
continuearg
,
&
codecarg
,
&
use_yv12
,
&
use_i420
,
&
flipuvarg
,
&
rawvideo
,
&
noblitarg
,
&
progressarg
,
&
limitarg
,
&
skiparg
,
&
postprocarg
,
&
summaryarg
,
&
outputfile
,
&
threadsarg
,
&
frameparallelarg
,
&
verbosearg
,
&
scalearg
,
&
fb_arg
,
&
md5arg
,
&
error_concealment
,
&
continuearg
,
#if CONFIG_VP9_HIGHBITDEPTH
&
outbitdeptharg
,
#endif
&
svcdecodingarg
,
NULL
&
svcdecodingarg
,
&
framestatsarg
,
NULL
};
#if CONFIG_VP8_DECODER
...
...
@@ -527,6 +532,8 @@ static int main_loop(int argc, const char **argv_) {
char
outfile_name
[
PATH_MAX
]
=
{
0
};
FILE
*
outfile
=
NULL
;
FILE
*
framestats_file
=
NULL
;
MD5Context
md5_ctx
;
unsigned
char
md5_digest
[
16
];
...
...
@@ -603,6 +610,12 @@ static int main_loop(int argc, const char **argv_) {
else
if
(
arg_match
(
&
arg
,
&
svcdecodingarg
,
argi
))
{
svc_decoding
=
1
;
svc_spatial_layer
=
arg_parse_uint
(
&
arg
);
}
else
if
(
arg_match
(
&
arg
,
&
framestatsarg
,
argi
))
{
framestats_file
=
fopen
(
arg
.
val
,
"w"
);
if
(
!
framestats_file
)
{
die
(
"Error: Could not open --framestats file (%s) for writing.
\n
"
,
arg
.
val
);
}
}
#if CONFIG_VP8_DECODER
else
if
(
arg_match
(
&
arg
,
&
addnoise_level
,
argi
))
{
...
...
@@ -761,6 +774,8 @@ static int main_loop(int argc, const char **argv_) {
frame_avail
=
1
;
got_data
=
0
;
if
(
framestats_file
)
fprintf
(
framestats_file
,
"bytes,qp
\n
"
);
/* Decode file */
while
(
frame_avail
||
got_data
)
{
vpx_codec_iter_t
iter
=
NULL
;
...
...
@@ -786,6 +801,16 @@ static int main_loop(int argc, const char **argv_) {
if
(
!
keep_going
)
goto
fail
;
}
if
(
framestats_file
)
{
int
qp
;
if
(
vpx_codec_control
(
&
decoder
,
VPXD_GET_LAST_QUANTIZER
,
&
qp
))
{
warn
(
"Failed VPXD_GET_LAST_QUANTIZER: %s"
,
vpx_codec_error
(
&
decoder
));
if
(
!
keep_going
)
goto
fail
;
}
fprintf
(
framestats_file
,
"%d,%d
\n
"
,
(
int
)
bytes_in_buffer
,
qp
);
}
vpx_usec_timer_mark
(
&
timer
);
dx_time
+=
vpx_usec_timer_elapsed
(
&
timer
);
}
else
{
...
...
@@ -1018,6 +1043,8 @@ fail2:
free
(
ext_fb_list
.
ext_fb
);
fclose
(
infile
);
if
(
framestats_file
)
fclose
(
framestats_file
);
free
(
argv
);
return
ret
;
...
...
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