#include "vlc_thread.h"
#include "intf_msg.h"
-#include "debug.h" /* ?? temporaire, requis par netlist.h */
+#include "debug.h" /* XXX?? temporaire, requis par netlist.h */
#include "input.h"
#include "input_netlist.h"
26, 27, 29, 32, 35, 40, 48, 58,
26, 27, 29, 34, 38, 46, 56, 69,
27, 29, 35, 38, 46, 56, 69, 83
-};
+};
#else
int pi_default_intra_quant[] =
{
5632, 9232, 9031, 8730, 8192, 7040, 5542, 3390,
5230, 7533, 7621, 7568, 7040, 6321, 5225, 3219,
3602, 5189, 5250, 5539, 5265, 5007, 4199, 2638,
- 1907, 2841, 3230, 3156, 3249, 3108, 2638, 1617
+ 1907, 2841, 3230, 3156, 3249, 3108, 2638, 1617
};
#endif
4096, 5680, 5344, 4816, 4096, 3216, 2224, 1136,
3216, 4464, 4208, 3792, 3216, 2528, 1744, 880,
2224, 3072, 2896, 2608, 2224, 1744, 1200, 608,
- 1136, 1568, 1472, 1328, 1136, 880, 608, 304
+ 1136, 1568, 1472, 1328, 1136, 880, 608, 304
};
#endif
vout_UnlinkPicture( p_vpar->p_vout, p_vpar->sequence.p_forward );
if( p_vpar->sequence.p_backward != NULL )
{
+#ifdef POLUX_SYNCHRO
vout_DatePicture( p_vpar->p_vout, p_vpar->sequence.p_backward,
vpar_SynchroDate( p_vpar ) );
+#endif
+#ifdef SAM_SYNCHRO
+ vout_DatePicture( p_vpar->p_vout, p_vpar->sequence.p_backward,
+ vpar_SynchroDate( p_vpar ) );
+#endif
+#ifdef MEUUH_SYNCHRO
+ mtime_t date;
+ date = vpar_SynchroDate( p_vpar );
+ vout_DatePicture( p_vpar->p_vout, p_vpar->sequence.p_backward,
+ date );
+ if( p_vpar->synchro.i_coding_type == I_CODING_TYPE )
+ vpar_SynchroKludge( p_vpar, date );
+#endif
}
p_vpar->sequence.p_forward = p_vpar->sequence.p_backward;
p_vpar->sequence.p_backward = p_newref;
if( p_newref != NULL )
vout_LinkPicture( p_vpar->p_vout, p_newref );
+#ifdef MEUUH_SYNCHRO
+ p_vpar->synchro.i_coding_type = i_coding_type;
+#endif
+ }
+ else if( p_newref != NULL )
+ {
+ /* Put date immediately. */
+ vout_DatePicture( p_vpar->p_vout, p_newref, vpar_SynchroDate(p_vpar) );
}
}
/*****************************************************************************
* ReferenceReplace : Replace the last reference pointer when we destroy
- * a picture
+ * a picture
*****************************************************************************/
static void __inline__ ReferenceReplace( vpar_thread_t * p_vpar,
int i_coding_type,
static __inline__ void LoadMatrix( vpar_thread_t * p_vpar, quant_matrix_t * p_matrix )
{
int i_dummy;
-
+
if( !p_matrix->b_allocated )
{
/* Allocate a piece of memory to load the matrix. */
}
p_matrix->b_allocated = 1;
}
-
+
for( i_dummy = 0; i_dummy < 64; i_dummy++ )
{
p_matrix->pi_matrix[pi_scan[SCAN_ZIGZAG][i_dummy]]
free( p_matrix->pi_matrix );
p_matrix->b_allocated = 0;
}
-
+
p_matrix->pi_matrix = pi_array;
}
*****************************************************************************/
static void SequenceHeader( vpar_thread_t * p_vpar )
{
-#define RESERVED -1
+#define RESERVED -1
static float r_frame_rate_table[16] =
{
0.0,
#undef RESERVED
int i_height_save, i_width_save;
-
+
i_height_save = p_vpar->sequence.i_height;
i_width_save = p_vpar->sequence.i_width;
/* We don't need bit_rate_value, marker_bit, vbv_buffer_size,
* constrained_parameters_flag */
RemoveBits( &p_vpar->bit_stream, 30 );
-
+
/*
* Quantization matrices
*/
/* Use default matrix. */
LinkMatrix( &p_vpar->sequence.intra_quant, pi_default_intra_quant );
}
-
+
if( GetBits( &p_vpar->bit_stream, 1 ) ) /* load_non_intra_quantizer_matrix */
{
LoadMatrix( p_vpar, &p_vpar->sequence.nonintra_quant );
/* Use default matrix. */
LinkMatrix( &p_vpar->sequence.nonintra_quant, pi_default_nonintra_quant );
}
-
+
/* Unless later overwritten by a matrix extension, we have the same
* matrices for luminance and chrominance. */
LinkMatrix( &p_vpar->sequence.chroma_intra_quant,
/* Turn the MPEG2 flag on */
p_vpar->sequence.b_mpeg2 = 1;
-
+
/* Parse sequence_extension */
RemoveBits32( &p_vpar->bit_stream );
/* extension_start_code_identifier, profile_and_level_indication */
if( p_vpar->sequence.i_width != i_width_save
|| p_vpar->sequence.i_height != i_height_save )
{
- /* What do we do in case of a size change ??? */
+ /* FIXME: What do we do in case of a size change ?? */
}
#endif
#ifdef VDEC_SMP
int i_mb;
#endif
-
+
RemoveBits( &p_vpar->bit_stream, 10 ); /* temporal_reference */
p_vpar->picture.i_coding_type = GetBits( &p_vpar->bit_stream, 3 );
RemoveBits( &p_vpar->bit_stream, 16 ); /* vbv_delay */
RemoveBits( &p_vpar->bit_stream, 8 );
}
- /*
+ /*
* Picture Coding Extension
*/
NextStartCode( p_vpar );
RemoveBits32( &p_vpar->bit_stream );
/* extension_start_code_identifier */
RemoveBits( &p_vpar->bit_stream, 4 );
-
+
p_vpar->picture.ppi_f_code[0][0] = GetBits( &p_vpar->bit_stream, 4 );
p_vpar->picture.ppi_f_code[0][1] = GetBits( &p_vpar->bit_stream, 4 );
p_vpar->picture.ppi_f_code[1][0] = GetBits( &p_vpar->bit_stream, 4 );
* chroma_420_type (obsolete) */
RemoveBits( &p_vpar->bit_stream, 1 );
p_vpar->picture.b_progressive_frame = GetBits( &p_vpar->bit_stream, 1 );
-
+
/* composite_display_flag */
if( GetBits( &p_vpar->bit_stream, 1 ) )
{
#endif
vout_DestroyPicture( p_vpar->p_vout, p_vpar->picture.p_picture );
}
-
+
p_vpar->picture.i_current_structure = 0;
intf_DbgMsg("vpar debug: odd number of field picture.\n");
p_vpar->picture.i_coding_type, i_structure );
}
}
+#ifdef POLUX_SYNCHRO
+ else if( !p_vpar->picture.i_current_structure )
+ {
+ vpar_SynchroTrash( p_vpar, p_vpar->picture.i_coding_type, i_structure );
+ }
+#endif
if( !b_parsable )
{
/* Update the reference pointers. */
ReferenceUpdate( p_vpar, p_vpar->picture.i_coding_type, NULL );
-
+#ifndef POLUX_SYNCHRO
/* Warn Synchro we have trashed a picture. */
vpar_SynchroTrash( p_vpar, p_vpar->picture.i_coding_type, i_structure );
-
+#endif
/* Update context. */
if( i_structure != FRAME_STRUCTURE )
p_vpar->picture.i_current_structure = i_structure;
{
/* This is a new frame. Get a structure from the video_output. */
while( ( P_picture = vout_CreatePicture( p_vpar->p_vout,
- 99+p_vpar->sequence.i_chroma_format, /*???*/
+ 99+p_vpar->sequence.i_chroma_format, /*XXX??*/
p_vpar->sequence.i_width,
p_vpar->sequence.i_height ) )
== NULL )
/* Initialize values. */
vpar_SynchroDecode( p_vpar, p_vpar->picture.i_coding_type, i_structure );
- if( p_vpar->picture.i_coding_type == B_CODING_TYPE )
- {
- /* Put date immediately. */
- vout_DatePicture( p_vpar->p_vout, P_picture,
- vpar_SynchroDate( p_vpar ) );
- }
P_picture->i_aspect_ratio = p_vpar->sequence.i_aspect_ratio;
P_picture->i_matrix_coefficients = p_vpar->sequence.i_matrix_coefficients;
p_vpar->picture.i_l_stride = ( p_vpar->sequence.i_width
#ifdef VDEC_SMP
memset( p_vpar->picture.pp_mb, 0, MAX_MB*sizeof(macroblock_t *) );
#endif
-/* FIXME ! remove asap */
+/* FIXME ! remove asap ?? */
//memset( P_picture->p_data, 0, (p_vpar->sequence.i_mb_size*384));
/* Update the reference pointers. */
ReferenceUpdate( p_vpar, p_vpar->picture.i_coding_type, P_picture );
#ifdef VDEC_SMP
- /* Link referenced pictures for the decoder
+ /* Link referenced pictures for the decoder
* They are unlinked in vpar_ReleaseMacroblock() & vpar_DestroyMacroblock() */
if( p_vpar->picture.i_coding_type == P_CODING_TYPE ||
p_vpar->picture.i_coding_type == B_CODING_TYPE )
if( p_vpar->picture.i_coding_type == B_CODING_TYPE )
{
vout_LinkPicture( p_vpar->p_vout, p_vpar->sequence.p_backward );
- }
+ }
#endif
}
p_vpar->picture.i_current_structure |= i_structure;
else
{
/* Try to find an optimized function. */
- ppf_picture_data[p_vpar->picture.i_structure]
- [p_vpar->picture.i_coding_type]( p_vpar, i_mb_base );
+ if( ppf_picture_data[p_vpar->picture.i_structure][p_vpar->picture.i_coding_type] == NULL )
+ {
+ fprintf( stderr, "vpar error: bad ppf_picture_data function pointer (struct:%d, coding type:%d)\n",
+ p_vpar->picture.i_structure, p_vpar->picture.i_coding_type );
+ }
+ else
+ {
+ ppf_picture_data[p_vpar->picture.i_structure]
+ [p_vpar->picture.i_coding_type]( p_vpar, i_mb_base );
+ }
}
if( p_vpar->b_die || p_vpar->b_error )