-/*****************************************************************************
- * SliceHeader : Parse the next slice structure
- *****************************************************************************/
-static __inline__ void SliceHeader( vpar_thread_t * p_vpar,
- int * pi_mb_address, int i_mb_base,
- u32 i_vert_code )
-{
- /* DC predictors initialization table */
- static int pi_dc_dct_reinit[4] = {128,256,512,1024};
-
- int i_mb_address_save = *pi_mb_address;
-
- /* slice_vertical_position_extension and priority_breakpoint already done */
- LoadQuantizerScale( p_vpar );
-
- if( GetBits( &p_vpar->bit_stream, 1 ) )
- {
- /* intra_slice, slice_id */
- RemoveBits( &p_vpar->bit_stream, 8 );
- /* extra_information_slice */
- while( GetBits( &p_vpar->bit_stream, 1 ) )
- {
- RemoveBits( &p_vpar->bit_stream, 8 );
- }
- }
- *pi_mb_address = (i_vert_code - 1)*p_vpar->sequence.i_mb_width;
-
- /* Reset DC coefficients predictors (ISO/IEC 13818-2 7.2.1). Why
- * does the reference decoder put 0 instead of the normative values ? */
- p_vpar->slice.pi_dc_dct_pred[0] = p_vpar->slice.pi_dc_dct_pred[1]
- = p_vpar->slice.pi_dc_dct_pred[2]
- = pi_dc_dct_reinit[p_vpar->picture.i_intra_dc_precision];
-
- /* Reset motion vector predictors (ISO/IEC 13818-2 7.6.3.4). */
- memset( p_vpar->slice.pppi_pmv, 0, 8*sizeof(int) );
-
- do
- {
- vpar_ParseMacroblock( p_vpar, pi_mb_address, i_mb_address_save,
- i_mb_base );
- i_mb_address_save = *pi_mb_address;
- }
- while( ShowBits( &p_vpar->bit_stream, 23 ) && !p_vpar->b_die );
- NextStartCode( p_vpar );
-}
-
-/*****************************************************************************
- * SliceHeaderXY : Parse the next slice structure
- *****************************************************************************
- * X = i_height > 2800 ?
- * Y = scalable_mode == SC_DP ?
- *****************************************************************************/
-static void SliceHeader00( vpar_thread_t * p_vpar,
- int * pi_mb_address, int i_mb_base,
- u32 i_vert_code )
-{
- SliceHeader( p_vpar, pi_mb_address, i_mb_base, i_vert_code );
-}
-
-static void SliceHeader01( vpar_thread_t * p_vpar,
- int * pi_mb_address, int i_mb_base,
- u32 i_vert_code )
-{
- RemoveBits( &p_vpar->bit_stream, 7 ); /* priority_breakpoint */
- SliceHeader( p_vpar, pi_mb_address, i_mb_base, i_vert_code );
-}
-
-static void SliceHeader10( vpar_thread_t * p_vpar,
- int * pi_mb_address, int i_mb_base,
- u32 i_vert_code )
-{
- i_vert_code += GetBits( &p_vpar->bit_stream, 3 ) << 7;
- SliceHeader( p_vpar, pi_mb_address, i_mb_base, i_vert_code );
-}
-
-static void SliceHeader11( vpar_thread_t * p_vpar,
- int * pi_mb_address, int i_mb_base,
- u32 i_vert_code )
-{
- i_vert_code += GetBits( &p_vpar->bit_stream, 3 ) << 7;
- RemoveBits( &p_vpar->bit_stream, 7 ); /* priority_breakpoint */
- SliceHeader( p_vpar, pi_mb_address, i_mb_base, i_vert_code );
-}
-