Commit edca9928 authored by Sam Hocevar's avatar Sam Hocevar

. ultimisation des calculs de pr�diction dans la synchro

 . squelette du subtitle_decoder
parent 177c1590
...@@ -188,6 +188,8 @@ ac3_decoder_obj = ac3_decoder/ac3_decoder.o \ ...@@ -188,6 +188,8 @@ ac3_decoder_obj = ac3_decoder/ac3_decoder.o \
audio_decoder_obj = audio_decoder/audio_decoder.o \ audio_decoder_obj = audio_decoder/audio_decoder.o \
audio_decoder/audio_math.o audio_decoder/audio_math.o
subtitle_decoder_obj = subtitle_decoder/subtitle_decoder.o
#??generic_decoder_obj = generic_decoder/generic_decoder.o #??generic_decoder_obj = generic_decoder/generic_decoder.o
# remeber to add it to OBJ # remeber to add it to OBJ
...@@ -231,6 +233,7 @@ C_OBJ = $(interface_obj) \ ...@@ -231,6 +233,7 @@ C_OBJ = $(interface_obj) \
$(video_output_obj) \ $(video_output_obj) \
$(ac3_decoder_obj) \ $(ac3_decoder_obj) \
$(audio_decoder_obj) \ $(audio_decoder_obj) \
$(subtitle_decoder_obj) \
$(generic_decoder_obj) \ $(generic_decoder_obj) \
$(video_parser_obj) \ $(video_parser_obj) \
$(video_decoder_obj) \ $(video_decoder_obj) \
......
...@@ -22,7 +22,6 @@ typedef struct video_synchro_tab_s ...@@ -22,7 +22,6 @@ typedef struct video_synchro_tab_s
{ {
double mean; double mean;
double deviation; double deviation;
int count;
} video_synchro_tab_t; } video_synchro_tab_t;
......
...@@ -100,22 +100,20 @@ vpar_thread_t * vpar_CreateThread( /* video_cfg_t *p_cfg, */ input_thread_t *p_i ...@@ -100,22 +100,20 @@ vpar_thread_t * vpar_CreateThread( /* video_cfg_t *p_cfg, */ input_thread_t *p_i
* Initialize the synchro properties * Initialize the synchro properties
*/ */
p_vpar->synchro.modulo = 0; p_vpar->synchro.modulo = 0;
/* assume there were about 3 P and 4 B images between I's */ /* assume there were about 3 P and 6 B images between I's */
p_vpar->synchro.current_p_count = 1; p_vpar->synchro.current_p_count = 1;
p_vpar->synchro.p_count_predict = 3; p_vpar->synchro.p_count_predict = 3;
p_vpar->synchro.current_b_count = 1; p_vpar->synchro.current_b_count = 1;
p_vpar->synchro.b_count_predict = 4; p_vpar->synchro.b_count_predict = 6;
{ {
int i; int i;
for( i=0; i<6; i++) for( i=0; i<6; i++)
{ {
p_vpar->synchro.tab_p[i].mean = 3; p_vpar->synchro.tab_p[i].mean = 3;
p_vpar->synchro.tab_p[i].deviation = 1; p_vpar->synchro.tab_p[i].deviation = .5;
p_vpar->synchro.tab_p[i].count = 0;
p_vpar->synchro.tab_b[i].mean = 4; p_vpar->synchro.tab_b[i].mean = 6;
p_vpar->synchro.tab_b[i].deviation = 1; p_vpar->synchro.tab_b[i].deviation = .5;
p_vpar->synchro.tab_b[i].count = 0;
} }
} }
......
...@@ -50,14 +50,9 @@ ...@@ -50,14 +50,9 @@
*****************************************************************************/ *****************************************************************************/
double vpar_SynchroUpdateTab( video_synchro_tab_t * tab, int count ) 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->mean = ( tab->mean + 3 * count ) / 4;
/ tab->count; tab->deviation = ( tab->deviation + 3 * abs (tab->mean - count) ) / 4;
tab->deviation = ( (tab->count-1) * tab->deviation
+ abs (tab->mean - count) ) / tab->count;
return tab->deviation; return tab->deviation;
} }
...@@ -155,6 +150,7 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type, ...@@ -155,6 +150,7 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
intf_DbgMsg("vpar debug: synchro image %i - modulo is %i\n", i_coding_type, p_vpar->synchro.modulo); intf_DbgMsg("vpar debug: synchro image %i - modulo is %i\n", i_coding_type, p_vpar->synchro.modulo);
intf_DbgMsg("vpar debug: synchro predict P %e - predict B %e\n", p_vpar->synchro.p_count_predict, p_vpar->synchro.b_count_predict); intf_DbgMsg("vpar debug: synchro predict P %e - predict B %e\n", p_vpar->synchro.p_count_predict, p_vpar->synchro.b_count_predict);
return(0);
return( i_coding_type == I_CODING_TYPE ); return( i_coding_type == I_CODING_TYPE );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment