Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
16a74985
Commit
16a74985
authored
Jan 10, 2010
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
davinci encoder: add fps measurements for debugging (remove later when done)
parent
fd13030d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
modules/codec/davinci/encoder.c
modules/codec/davinci/encoder.c
+36
-0
No files found.
modules/codec/davinci/encoder.c
View file @
16a74985
...
...
@@ -69,6 +69,12 @@ struct encoder_sys_t
XDM_BufDesc
in
;
XDM_BufDesc
out
;
/* stats */
mtime_t
i_pts_start
;
mtime_t
i_pts_end
;
int
i_fps
;
int
i_pics
;
};
/*****************************************************************************
...
...
@@ -195,6 +201,7 @@ static int GetVideoEncoderSettings( encoder_t *p_enc, const char *psz_codec )
p_enc
->
i_iframes
=
var_CreateGetInteger
(
p_enc
,
ENC_CFG_PREFIX
"keyint"
);
p_enc
->
i_tolerance
=
var_CreateGetInteger
(
p_enc
,
ENC_CFG_PREFIX
"tolerance"
);
p_enc
->
i_tolerance
*=
1024
;
/* bits per second */
p_sys
->
i_fps
=
25
;
/* Configure encoder */
params
.
size
=
sizeof
(
params
);
...
...
@@ -260,6 +267,34 @@ static int GetVideoEncoderSettings( encoder_t *p_enc, const char *psz_codec )
return
VLC_SUCCESS
;
}
static
inline
void
calculate_fps
(
encoder_t
*
p_enc
)
{
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
p_sys
->
i_pics
++
;
if
(
p_sys
->
i_pics
==
1
)
{
p_sys
->
i_pts_start
=
mdate
();
}
if
(
p_sys
->
i_pics
==
p_sys
->
i_fps
)
{
mtime_t
i_diff
;
/* in us */
double
f_fps
;
p_sys
->
i_pts_end
=
mdate
();
/* in us */
i_diff
=
(
p_sys
->
i_pts_end
-
p_sys
->
i_pts_start
);
f_fps
=
(
double
)((
i_diff
/
(
int64_t
)
p_sys
->
i_pics
));
/* 1 frame per us */
f_fps
=
((
double
)
1
/
f_fps
)
*
(
double
)
1000000
;
msg_Info
(
p_enc
,
"%d frames per %"
PRId64
" micro seconds (%4.2f fps)"
,
p_sys
->
i_pics
,
i_diff
,
f_fps
);
/* reset timers */
p_sys
->
i_pics
=
0
;
p_sys
->
i_pts_start
=
p_sys
->
i_pts_end
=
(
mtime_t
)
0
;
}
}
static
inline
void
davinci_CopyPictureToXDM
(
encoder_t
*
p_enc
,
XDM_BufDesc
*
p_buf
,
picture_t
*
p_pic
)
{
VLC_UNUSED
(
p_enc
);
...
...
@@ -383,6 +418,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pic )
/* Print some info */
//msg_Dbg( p_enc, "Bytes generated: %d", (int)out_args.bytesGenerated );
calculate_fps
(
p_enc
);
/* Put everything in the block */
if
(
out_args
.
bytesGenerated
<=
0
)
...
...
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