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
2b60e75b
Commit
2b60e75b
authored
Jan 29, 2012
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transcode: add likely/unlikely in video process
parent
9394c716
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
modules/stream_out/transcode/video.c
modules/stream_out/transcode/video.c
+12
-12
No files found.
modules/stream_out/transcode/video.c
View file @
2b60e75b
...
@@ -579,7 +579,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
...
@@ -579,7 +579,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
picture_t
*
p_pic
,
*
p_pic2
=
NULL
;
picture_t
*
p_pic
,
*
p_pic2
=
NULL
;
*
out
=
NULL
;
*
out
=
NULL
;
if
(
in
==
NULL
)
if
(
unlikely
(
in
==
NULL
)
)
{
{
if
(
p_sys
->
i_threads
==
0
)
if
(
p_sys
->
i_threads
==
0
)
{
{
...
@@ -606,7 +606,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
...
@@ -606,7 +606,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
if
(
p_stream
->
p_sout
->
i_out_pace_nocontrol
&&
p_sys
->
b_hurry_up
)
if
(
p_stream
->
p_sout
->
i_out_pace_nocontrol
&&
p_sys
->
b_hurry_up
)
{
{
mtime_t
current_date
=
mdate
();
mtime_t
current_date
=
mdate
();
if
(
current_date
+
50000
>
p_pic
->
date
)
if
(
unlikely
(
current_date
+
50000
>
p_pic
->
date
)
)
{
{
msg_Dbg
(
p_stream
,
"late picture skipped (%"
PRId64
")"
,
msg_Dbg
(
p_stream
,
"late picture skipped (%"
PRId64
")"
,
current_date
+
50000
-
p_pic
->
date
);
current_date
+
50000
-
p_pic
->
date
);
...
@@ -622,8 +622,8 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
...
@@ -622,8 +622,8 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
mtime_t
i_pts
;
mtime_t
i_pts
;
i_pts
=
date_Get
(
&
id
->
interpolated_pts
)
+
1
;
i_pts
=
date_Get
(
&
id
->
interpolated_pts
)
+
1
;
if
(
p_pic
->
date
-
i_pts
>
MASTER_SYNC_MAX_DRIFT
if
(
unlikely
(
p_pic
->
date
-
i_pts
>
MASTER_SYNC_MAX_DRIFT
||
p_pic
->
date
-
i_pts
<
-
MASTER_SYNC_MAX_DRIFT
)
||
p_pic
->
date
-
i_pts
<
-
MASTER_SYNC_MAX_DRIFT
)
)
{
{
msg_Dbg
(
p_stream
,
"drift is too high, resetting master sync"
);
msg_Dbg
(
p_stream
,
"drift is too high, resetting master sync"
);
date_Set
(
&
id
->
interpolated_pts
,
p_pic
->
date
);
date_Set
(
&
id
->
interpolated_pts
,
p_pic
->
date
);
...
@@ -635,7 +635,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
...
@@ -635,7 +635,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
/* Set the pts of the frame being encoded */
/* Set the pts of the frame being encoded */
p_pic
->
date
=
i_pts
;
p_pic
->
date
=
i_pts
;
if
(
i_video_drift
<
(
i_master_drift
-
50000
)
)
if
(
unlikely
(
i_video_drift
<
(
i_master_drift
-
50000
)
)
)
{
{
#if 0
#if 0
msg_Dbg( p_stream, "dropping frame (%i)",
msg_Dbg( p_stream, "dropping frame (%i)",
...
@@ -644,7 +644,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
...
@@ -644,7 +644,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
picture_Release
(
p_pic
);
picture_Release
(
p_pic
);
continue
;
continue
;
}
}
else
if
(
i_video_drift
>
(
i_master_drift
+
50000
)
)
else
if
(
unlikely
(
i_video_drift
>
(
i_master_drift
+
50000
)
)
)
{
{
#if 0
#if 0
msg_Dbg( p_stream, "adding frame (%i)",
msg_Dbg( p_stream, "adding frame (%i)",
...
@@ -703,16 +703,16 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
...
@@ -703,16 +703,16 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
{
{
/* We can't modify the picture, we need to duplicate it */
/* We can't modify the picture, we need to duplicate it */
picture_t
*
p_tmp
=
video_new_buffer_decoder
(
id
->
p_decoder
);
picture_t
*
p_tmp
=
video_new_buffer_decoder
(
id
->
p_decoder
);
if
(
p_tmp
)
if
(
likely
(
p_tmp
)
)
{
{
picture_Copy
(
p_tmp
,
p_pic
);
picture_Copy
(
p_tmp
,
p_pic
);
picture_Release
(
p_pic
);
picture_Release
(
p_pic
);
p_pic
=
p_tmp
;
p_pic
=
p_tmp
;
}
}
}
}
if
(
!
p_sys
->
p_spu_blend
)
if
(
unlikely
(
!
p_sys
->
p_spu_blend
)
)
p_sys
->
p_spu_blend
=
filter_NewBlend
(
VLC_OBJECT
(
p_sys
->
p_spu
),
&
fmt
);
p_sys
->
p_spu_blend
=
filter_NewBlend
(
VLC_OBJECT
(
p_sys
->
p_spu
),
&
fmt
);
if
(
p_sys
->
p_spu_blend
)
if
(
likely
(
p_sys
->
p_spu_blend
)
)
picture_BlendSubpicture
(
p_pic
,
p_sys
->
p_spu_blend
,
p_subpic
);
picture_BlendSubpicture
(
p_pic
,
p_sys
->
p_spu_blend
,
p_subpic
);
subpicture_Delete
(
p_subpic
);
subpicture_Delete
(
p_subpic
);
}
}
...
@@ -729,8 +729,8 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
...
@@ -729,8 +729,8 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
if
(
p_sys
->
b_master_sync
)
if
(
p_sys
->
b_master_sync
)
{
{
mtime_t
i_pts
=
date_Get
(
&
id
->
interpolated_pts
)
+
1
;
mtime_t
i_pts
=
date_Get
(
&
id
->
interpolated_pts
)
+
1
;
if
(
p_pic
->
date
-
i_pts
>
MASTER_SYNC_MAX_DRIFT
if
(
unlikely
(
p_pic
->
date
-
i_pts
>
MASTER_SYNC_MAX_DRIFT
||
p_pic
->
date
-
i_pts
<
-
MASTER_SYNC_MAX_DRIFT
)
||
p_pic
->
date
-
i_pts
<
-
MASTER_SYNC_MAX_DRIFT
)
)
{
{
msg_Dbg
(
p_stream
,
"drift is too high, resetting master sync"
);
msg_Dbg
(
p_stream
,
"drift is too high, resetting master sync"
);
date_Set
(
&
id
->
interpolated_pts
,
p_pic
->
date
);
date_Set
(
&
id
->
interpolated_pts
,
p_pic
->
date
);
...
@@ -745,7 +745,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
...
@@ -745,7 +745,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
{
{
/* We can't modify the picture, we need to duplicate it */
/* We can't modify the picture, we need to duplicate it */
p_pic2
=
video_new_buffer_decoder
(
id
->
p_decoder
);
p_pic2
=
video_new_buffer_decoder
(
id
->
p_decoder
);
if
(
p_pic2
!=
NULL
)
if
(
unlikely
(
p_pic2
!=
NULL
)
)
{
{
picture_Copy
(
p_pic2
,
p_pic
);
picture_Copy
(
p_pic2
,
p_pic
);
p_pic2
->
date
=
i_pts
;
p_pic2
->
date
=
i_pts
;
...
...
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