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
ba2a0abb
Commit
ba2a0abb
authored
Jan 18, 2000
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d�but de la synchro. �a n'influe pas sur le reste pour le moment, mais
la base des algos � deux balles est l�.
parent
dd4339a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
123 additions
and
3 deletions
+123
-3
include/vpar_synchro.h
include/vpar_synchro.h
+21
-1
src/input/input.c
src/input/input.c
+1
-0
src/video_parser/vpar_synchro.c
src/video_parser/vpar_synchro.c
+101
-2
No files found.
include/vpar_synchro.h
View file @
ba2a0abb
...
@@ -16,10 +16,30 @@
...
@@ -16,10 +16,30 @@
*****************************************************************************/
*****************************************************************************/
/*****************************************************************************
/*****************************************************************************
* video_synchro_t : timers for the video synchro
* video_synchro_t
and video_synchro_tab_s
: timers for the video synchro
*****************************************************************************/
*****************************************************************************/
typedef
struct
video_synchro_tab_s
{
double
mean
;
double
deviation
;
int
count
;
}
video_synchro_tab_t
;
typedef
struct
video_synchro_s
typedef
struct
video_synchro_s
{
{
int
modulo
;
/* P images since the last I */
int
current_p_count
;
double
p_count_predict
;
/* B images since the last I */
int
current_b_count
;
double
b_count_predict
;
/* 1 for linear count, 2 for binary count, 3 for ternary count */
video_synchro_tab_t
tab_p
[
6
];
video_synchro_tab_t
tab_b
[
6
];
}
video_synchro_t
;
}
video_synchro_t
;
...
...
src/input/input.c
View file @
ba2a0abb
...
@@ -995,6 +995,7 @@ static __inline__ void input_DemuxPES( input_thread_t *p_input,
...
@@ -995,6 +995,7 @@ static __inline__ void input_DemuxPES( input_thread_t *p_input,
break
;
break
;
case
AC3_AUDIO_ES
:
case
AC3_AUDIO_ES
:
/* we skip 4 bytes at the beginning of the AC3 payload */
p_ts
->
i_payload_start
+=
4
;
p_ts
->
i_payload_start
+=
4
;
p_fifo
=
&
(((
ac3dec_thread_t
*
)(
p_es_descriptor
->
p_dec
))
->
fifo
);
p_fifo
=
&
(((
ac3dec_thread_t
*
)(
p_es_descriptor
->
p_dec
))
->
fifo
);
break
;
break
;
...
...
src/video_parser/vpar_synchro.c
View file @
ba2a0abb
...
@@ -39,10 +39,108 @@
...
@@ -39,10 +39,108 @@
#include "vpar_synchro.h"
#include "vpar_synchro.h"
#include "video_parser.h"
#include "video_parser.h"
#define MAX_COUNT 3
/*
/*
* Local prototypes
* Local prototypes
*/
*/
/*****************************************************************************
* vpar_SynchroUpdateTab : Update a mean table in the synchro structure
*****************************************************************************/
double
vpar_SynchroUpdateTab
(
video_synchro_tab_t
*
tab
,
int
count
)
{
if
(
tab
->
count
<
MAX_COUNT
)
tab
->
count
++
;
tab
->
mean
=
(
(
tab
->
count
-
1
)
*
tab
->
mean
+
count
)
/
tab
->
count
;
tab
->
deviation
=
(
(
tab
->
count
-
1
)
*
tab
->
deviation
+
abs
(
tab
->
mean
-
count
)
)
/
tab
->
count
;
}
/*****************************************************************************
* vpar_SynchroUpdateStructures : Update the synchro structures
*****************************************************************************/
void
vpar_SynchroUpdateStructures
(
video_synchro_tab_t
*
tab
,
int
i_coding_type
)
{
double
candidate_deviation
;
double
optimal_deviation
;
double
predict
;
switch
(
i_coding_type
)
{
case
P_CODING_TYPE
:
p_vpar
->
synchro
.
current_p_count
++
;
break
;
case
B_CODING_TYPE
:
p_vpar
->
synchro
.
current_b_count
++
;
break
;
case
I_CODING_TYPE
:
/* update all the structures for P images */
optimal_deviation
=
vpar_SynchroUpdateTab
(
&
p_vpar
->
synchro
.
tab_p
[
0
],
p_vpar
->
synchro
.
current_p_count
);
predict
=
p_vpar
->
synchro
.
tab_p
[
0
].
mean
;
candidate_deviation
=
vpar_SynchroUpdateTab
(
&
p_vpar
->
synchro
.
tab_p
[
1
+
(
modulo
&
0x1
)],
p_vpar
->
synchro
.
current_p_count
);
if
(
candidate_deviation
<
optimal_deviation
)
{
optimal_deviation
=
candidate_deviation
;
predict
=
p_vpar
->
synchro
.
tab_p
[
1
+
(
modulo
&
0x1
)].
mean
;
}
candidate_deviation
=
vpar_SynchroUpdateTab
(
&
p_vpar
->
synchro
.
tab_p
[
3
+
(
modulo
%
3
)],
p_vpar
->
synchro
.
current_p_count
);
if
(
candidate_deviation
<
optimal_deviation
)
{
optimal_deviation
=
candidate_deviation
;
predict
=
p_vpar
->
synchro
.
tab_p
[
1
+
(
modulo
&
0x1
)].
mean
;
}
p_vpar
->
synchro
.
p_count_predict
=
predict
;
/* update all the structures for B images */
optimal_deviation
=
vpar_SynchroUpdateTab
(
&
p_vpar
->
synchro
.
tab_b
[
0
],
p_vpar
->
synchro
.
current_b_count
);
predict
=
p_vpar
->
synchro
.
tab_b
[
0
].
mean
;
candidate_deviation
=
vpar_SynchroUpdateTab
(
&
p_vpar
->
synchro
.
tab_b
[
1
+
(
modulo
&
0x1
)],
p_vpar
->
synchro
.
current_b_count
);
if
(
candidate_deviation
<
optimal_deviation
)
{
optimal_deviation
=
candidate_deviation
;
predict
=
p_vpar
->
synchro
.
tab_b
[
1
+
(
modulo
&
0x1
)].
mean
;
}
candidate_deviation
=
vpar_SynchroUpdateTab
(
&
p_vpar
->
synchro
.
tab_b
[
3
+
(
modulo
%
3
)],
p_vpar
->
synchro
.
current_b_count
);
if
(
candidate_deviation
<
optimal_deviation
)
{
optimal_deviation
=
candidate_deviation
;
predict
=
p_vpar
->
synchro
.
tab_b
[
1
+
(
modulo
&
0x1
)].
mean
;
}
p_vpar
->
synchro
.
b_count_predict
=
predict
;
break
;
}
p_vpar
->
synchro
.
modulo
++
;
}
/*****************************************************************************
/*****************************************************************************
* vpar_SynchroChoose : Decide whether we will decode a picture or not
* vpar_SynchroChoose : Decide whether we will decode a picture or not
*****************************************************************************/
*****************************************************************************/
...
@@ -60,6 +158,7 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
...
@@ -60,6 +158,7 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
void
vpar_SynchroTrash
(
vpar_thread_t
*
p_vpar
,
int
i_coding_type
,
void
vpar_SynchroTrash
(
vpar_thread_t
*
p_vpar
,
int
i_coding_type
,
int
i_structure
)
int
i_structure
)
{
{
vpar_SynchroUpdateStructures
(
p_vpar
,
i_coding_type
,
i_structure
);
}
}
...
@@ -69,6 +168,8 @@ void vpar_SynchroTrash( vpar_thread_t * p_vpar, int i_coding_type,
...
@@ -69,6 +168,8 @@ void vpar_SynchroTrash( vpar_thread_t * p_vpar, int i_coding_type,
mtime_t
vpar_SynchroDecode
(
vpar_thread_t
*
p_vpar
,
int
i_coding_type
,
mtime_t
vpar_SynchroDecode
(
vpar_thread_t
*
p_vpar
,
int
i_coding_type
,
int
i_structure
)
int
i_structure
)
{
{
vpar_SynchroUpdateStructures
(
p_vpar
,
i_coding_type
,
i_structure
);
return
mdate
()
+
3000000
;
return
mdate
()
+
3000000
;
}
}
...
@@ -80,5 +181,3 @@ void vpar_SynchroEnd( vpar_thread_t * p_vpar )
...
@@ -80,5 +181,3 @@ void vpar_SynchroEnd( vpar_thread_t * p_vpar )
}
}
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