Changeset f6268f60f4d02aadbb8b14046f0aa96b39af63a8

Show
Ignore:
Timestamp:
08/08/00 00:18:24 (8 years ago)
Author:
Sam Hocevar <sam@videolan.org>
git-committer:
Sam Hocevar <sam@videolan.org> 965686704 +0000
git-parent:

[52d7937c89ef32288f99b79dcefd91dd48ae691a]

git-author:
Sam Hocevar <sam@videolan.org> 965686704 +0000
Message:
  • vlc.init becomes ~/.vlcrc
  • removed float operations in the video decoder, and all emms asm functions
  • borrowed linuxvideo's MMX motion compensation
  • fixed an undefined symbol in the MMX YUV plugin

Meuuh & Sam.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • AUTHORS

    racbd88f rf6268f6  
    33  Michel Lespinasse <walken@wrs.com> 
    44 
    5   Olivier Baxa <oli@via.ecp.fr> 
    6   Eric Estievenart <eric@via.ecp.fr> 
     5  Olivier Pomel <pomel@via.ecp.fr> 
    76 
    87  Jean-Philippe Grimaldi <jeanphi@via.ecp.fr> 
     
    1514  Ga�Hendryckx <jimmy@via.ecp.fr> 
    1615  Samuel Hocevar <sam@via.ecp.fr> 
     16  Brieuc Jeunhomme <bbp@via.ecp.fr> 
    1717  Michel Kaempf <maxx@via.ecp.fr> 
    1818 
    1919  St�ane Borel <stef@via.ecp.fr> 
    2020  Renaud Dartus <reno@via.ecp.fr> 
    21   Henri Fallon <henri@via.ecp.fr> 
    2221 
    23   Contributors include Aaron Holtzman for his ac3dec decoder, and the 
    24   LiViD team for a few lines of code we borrowed here and there. 
  • ChangeLog

    r52d7937 rf6268f6  
    66  * fixed functions that weren't properly inlined 
    77  * removed bloat from the MMX YUV plugin 
     8  * vlc.init becomes ~/.vlcrc 
     9  * removed float operations in the video decoder, and all emms asm functions 
     10  * borrowed linuxvideo's MMX motion compensation 
     11  * fixed an undefined symbol in the MMX YUV plugin 
    812 
    913Thu Jul 20 15:14:06 CEST 2000 
  • Makefile.in

    r52d7937 rf6268f6  
    157157# C Objects 
    158158#  
    159 interface_obj =        interface/main.o \ 
    160                        interface/interface.o \ 
    161                        interface/intf_msg.o \ 
    162                        interface/intf_cmd.o \ 
    163                        interface/intf_ctrl.o \ 
    164                        interface/intf_console.o 
    165  
    166 input_obj =               input/input_vlan.o \ 
    167                        input/input_file.o \ 
    168                        input/input_netlist.o \ 
    169                        input/input_network.o \ 
    170                        input/input_ctrl.o \ 
    171                        input/input_pcr.o \ 
    172                        input/input_psi.o \ 
    173                        input/input.o 
    174  
    175 audio_output_obj =     audio_output/audio_output.o 
    176  
    177 video_output_obj =     video_output/video_output.o \ 
    178                        video_output/video_text.o \ 
    179                        video_output/video_spu.o \ 
    180                        video_output/video_yuv.o 
    181  
    182 ac3_decoder_obj =      ac3_decoder/ac3_decoder_thread.o \ 
    183                        ac3_decoder/ac3_decoder.o \ 
    184                        ac3_decoder/ac3_parse.o \ 
    185                        ac3_decoder/ac3_exponent.o \ 
    186                        ac3_decoder/ac3_bit_allocate.o \ 
    187                        ac3_decoder/ac3_mantissa.o \ 
    188                        ac3_decoder/ac3_rematrix.o \ 
    189                        ac3_decoder/ac3_imdct.o \ 
    190                        ac3_decoder/ac3_downmix.o 
     159interface_obj =     interface/main.o \ 
     160                interface/interface.o \ 
     161                interface/intf_msg.o \ 
     162                interface/intf_cmd.o \ 
     163                interface/intf_ctrl.o \ 
     164                interface/intf_console.o 
     165 
     166input_obj =       input/input_vlan.o \ 
     167                input/input_file.o \ 
     168                input/input_netlist.o \ 
     169                input/input_network.o \ 
     170                input/input_ctrl.o \ 
     171                input/input_pcr.o \ 
     172                input/input_psi.o \ 
     173                input/input.o 
     174 
     175audio_output_obj =  audio_output/audio_output.o 
     176 
     177video_output_obj =  video_output/video_output.o \ 
     178                video_output/video_text.o \ 
     179                video_output/video_spu.o \ 
     180                video_output/video_yuv.o 
     181 
     182ac3_decoder_obj =   ac3_decoder/ac3_decoder_thread.o \ 
     183                ac3_decoder/ac3_decoder.o \ 
     184                ac3_decoder/ac3_parse.o \ 
     185                ac3_decoder/ac3_exponent.o \ 
     186                ac3_decoder/ac3_bit_allocate.o \ 
     187                ac3_decoder/ac3_mantissa.o \ 
     188                ac3_decoder/ac3_rematrix.o \ 
     189                ac3_decoder/ac3_imdct.o \ 
     190                ac3_decoder/ac3_downmix.o 
    191191                         
    192 lpcm_decoder_obj =     lpcm_decoder/lpcm_decoder_thread.o \ 
    193                        lpcm_decoder/lpcm_decoder.o 
    194  
    195 audio_decoder_obj =    audio_decoder/audio_decoder_thread.o \ 
    196                        audio_decoder/audio_decoder.o \ 
    197                        audio_decoder/audio_math.o 
    198  
    199 spu_decoder_obj =      spu_decoder/spu_decoder.o 
     192lpcm_decoder_obj =  lpcm_decoder/lpcm_decoder_thread.o \ 
     193                lpcm_decoder/lpcm_decoder.o 
     194 
     195audio_decoder_obj = audio_decoder/audio_decoder_thread.o \ 
     196                audio_decoder/audio_decoder.o \ 
     197                audio_decoder/audio_math.o 
     198 
     199spu_decoder_obj =   spu_decoder/spu_decoder.o 
    200200 
    201201#??generic_decoder_obj =        generic_decoder/generic_decoder.o 
    202202# remeber to add it to OBJ  
    203203 
    204 video_parser_obj =      video_parser/video_parser.o \ 
    205                         video_parser/vpar_headers.o \ 
    206                         video_parser/vpar_blocks.o \ 
    207                         video_parser/vpar_synchro.o \ 
    208                         video_parser/video_fifo.o 
    209  
    210 video_decoder_obj =     video_decoder/video_decoder.o \ 
    211                         video_decoder/vdec_motion.o \ 
    212                         video_decoder/vdec_motion_inner.o \ 
    213                                     video_decoder/vdec_idct.o 
    214  
    215 misc_obj =          misc/mtime.o \ 
    216                         misc/tests.o \ 
    217                         misc/rsc_files.o \ 
    218                         misc/netutils.o \ 
    219                         misc/playlist.o \ 
    220                         misc/plugins.o \ 
    221                         misc/decoder_fifo.o 
     204video_parser_obj =  video_parser/video_parser.o \ 
     205                video_parser/vpar_headers.o \ 
     206                video_parser/vpar_blocks.o \ 
     207                video_parser/vpar_synchro.o \ 
     208                video_parser/video_fifo.o 
     209 
     210ifneq (,$(findstring mmx,$(ARCH))) 
     211    vdec_motion_inner = video_decoder/vdec_motion_inner_mmx.o 
     212else 
     213    vdec_motion_inner = video_decoder/vdec_motion_inner.o 
     214endif 
     215 
     216video_decoder_obj = video_decoder/video_decoder.o \ 
     217                video_decoder/vdec_motion.o \ 
     218                video_decoder/vdec_idct.o \ 
     219                $(vdec_motion_inner) 
     220 
     221misc_obj =      misc/mtime.o \ 
     222                misc/tests.o \ 
     223                misc/rsc_files.o \ 
     224                misc/netutils.o \ 
     225                misc/playlist.o \ 
     226                misc/plugins.o \ 
     227                misc/decoder_fifo.o 
    222228 
    223229 
  • include/config.h.in

    re13aed0 rf6268f6  
    128128 
    129129/* Environment variable used to store startup script name and default value */ 
    130 #define INTF_INIT_SCRIPT_VAR            "vlc_init
    131 #define INTF_INIT_SCRIPT_DEFAULT        "vlc.init
     130#define INTF_INIT_SCRIPT_VAR            "vlcrc
     131#define INTF_INIT_SCRIPT_DEFAULT        ".vlcrc
    132132 
    133133/* Environment variable used to store channels file and default value */ 
     
    435435 *****************************************************************************/ 
    436436 
    437 #define VOUT_SYNCHRO_LEVEL_START        5 
    438 #define VOUT_SYNCHRO_LEVEL_MAX          15 
     437#define VOUT_SYNCHRO_LEVEL_START        5 << 10 
     438#define VOUT_SYNCHRO_LEVEL_MAX          15 << 10 
    439439#define VOUT_SYNCHRO_HEAP_IDEAL_SIZE    5 
     440 
  • include/vpar_blocks.h

    r9cb93a1 rf6268f6  
    167167void vpar_InitCodedPattern( struct vpar_thread_s * p_vpar ); 
    168168void vpar_InitDCTTables( struct vpar_thread_s * p_vpar ); 
    169 void vpar_PictureDataGENERIC( struct vpar_thread_s * p_vpar, int i_mb_base ); 
    170 #if (VPAR_OPTIM_LEVEL > 0) 
    171 void vpar_PictureData2I420F0( struct vpar_thread_s * p_vpar, int i_mb_base ); 
    172 void vpar_PictureData2P420F0( struct vpar_thread_s * p_vpar, int i_mb_base ); 
    173 void vpar_PictureData2B420F0( struct vpar_thread_s * p_vpar, int i_mb_base ); 
    174 #endif 
    175 #if (VPAR_OPTIM_LEVEL > 1) 
    176 void vpar_PictureData2I420TZ( struct vpar_thread_s * p_vpar, int i_mb_base ); 
    177 void vpar_PictureData2P420TZ( struct vpar_thread_s * p_vpar, int i_mb_base ); 
    178 void vpar_PictureData2B420TZ( struct vpar_thread_s * p_vpar, int i_mb_base ); 
    179 void vpar_PictureData2I420BZ( struct vpar_thread_s * p_vpar, int i_mb_base ); 
    180 void vpar_PictureData2P420BZ( struct vpar_thread_s * p_vpar, int i_mb_base ); 
    181 void vpar_PictureData2B420BZ( struct vpar_thread_s * p_vpar, int i_mb_base ); 
    182 #endif 
     169void vpar_PictureData( struct vpar_thread_s * p_vpar, int i_mb_base ); 
  • include/vpar_headers.h

    r9cb93a1 rf6268f6  
    5959    unsigned int        i_aspect_ratio;        /* height/width display ratio */ 
    6060    unsigned int        i_matrix_coefficients;/* coeffs of the YUV transform */ 
    61     float               r_frame_rate;       /* theoritical frame rate in fps */ 
     61    int                 i_frame_rate;  /* theoritical frame rate in fps*1001 */ 
    6262    boolean_t           b_mpeg2;                                    /* guess */ 
    6363    boolean_t           b_progressive;              /* progressive (ie. 
  • include/vpar_synchro.h

    r57e189e rf6268f6  
    6868    boolean_t     b_all_I; 
    6969    boolean_t     b_all_P; 
    70     double        displayable_p; 
     70    int           displayable_p; 
    7171    boolean_t     b_all_B; 
    72     double        displayable_b; 
     72    int           displayable_b; 
    7373 
    7474} video_synchro_t; 
     
    101101 
    102102    /* Dates needed to compute the date of the current frame 
    103      * We also use the stream frame rate (sequence.r_frame_rate) */ 
     103     * We also use the stream frame rate (sequence.i_frame_rate) */ 
    104104    mtime_t     i_current_frame_date; 
    105105    mtime_t     i_backward_frame_date; 
  • plugins/yuvmmx/video_yuv.c

    r52d7937 rf6268f6  
    132132void SetYUV( vout_thread_t *p_vout ) 
    133133{ 
    134     int         pi_gamma[256];                                /* gamma table */ 
    135134    int         i_index;                                  /* index in tables */ 
    136  
    137     /* Build gamma table */ 
    138     SetGammaTable( pi_gamma, p_vout->f_gamma ); 
    139135 
    140136    /* 
  • plugins/yuvmmx/video_yuv.h

    r52d7937 rf6268f6  
    5454 * Local prototypes 
    5555 *****************************************************************************/ 
    56 void SetGammaTable        ( int *pi_table, double f_gamma ); 
    5756void SetYUV               ( vout_thread_t *p_vout ); 
    5857void SetOffset            ( int i_width, int i_height, int i_pic_width, 
  • src/interface/intf_cmd.c

    r57e189e rf6268f6  
    159159    char    psz_line[INTF_MAX_CMD_SIZE];                             /* line */ 
    160160    char *  psz_index;                                    /* index in string */ 
     161    char *  psz_vlcrc;                                 /* full path to vlcrc */ 
    161162    int     i_err;                                        /* error indicator */ 
    162163 
    163164    /* Open file */ 
    164165    i_err = 0; 
    165     p_file = fopen( psz_filename, "r" ); 
     166 
     167    if( !( psz_index = getenv("HOME") ) ) 
     168    { 
     169        psz_index = "/"; 
     170    } 
     171    psz_vlcrc = malloc( strlen( psz_index ) + 1 + strlen( psz_filename ) + 1 ); 
     172    sprintf( psz_vlcrc, "%s/%s", psz_index, psz_filename ); 
     173     
     174    p_file = fopen( psz_vlcrc, "r" ); 
    166175    if( p_file == NULL ) 
    167176    { 
    168         intf_DbgMsg("intf warning: %s: %s\n", psz_filename, strerror(errno)); 
     177        intf_DbgMsg("intf warning: %s: %s\n", psz_vlcrc, strerror(errno)); 
    169178        return( -1 ); 
    170179    } 
     
    195204    if( !feof( p_file ) ) 
    196205    { 
    197         intf_ErrMsg("error: %s: %s\n", psz_filename, strerror(errno)); 
     206        intf_ErrMsg("error: %s: %s\n", psz_vlcrc, strerror(errno)); 
    198207        return( -1 ); 
    199208    } 
  • src/video_decoder/video_decoder.c

    r9cb93a1 rf6268f6  
    323323            "movq       %%mm2,(%0)\n\t" 
    324324 
    325             "emms" 
    326             :"+r" (p_data): "r" (p_block),"r" (i_incr+8)); 
     325            //"emms" 
     326            :"+r" (p_data): "r" (p_block),"r" (i_incr+8)); 
    327327} 
    328328#endif 
     
    390390            "packuswb   120(%1),%%mm0\n\t" 
    391391            "movq        %%mm0,(%0)\n\t" 
    392             "emms" 
     392            //"emms" 
    393393            :"+r" (p_data): "r" (p_block),"r" (i_incr+8)); 
    394394} 
  • src/video_output/video_output.c

    r52d7937 rf6268f6  
    16921692    if( p_vout->c_fps_samples > VOUT_FPS_SAMPLES ) 
    16931693    { 
    1694         sprintf( psz_buffer, "%.2f fps", (double) VOUT_FPS_SAMPLES * 1000000 / 
     1694        sprintf( psz_buffer, "%.2f fps/10", VOUT_FPS_SAMPLES * 1000000 * 10 / 
    16951695                 ( p_vout->p_fps_sample[ (p_vout->c_fps_samples - 1) % VOUT_FPS_SAMPLES ] - 
    16961696                   p_vout->p_fps_sample[ p_vout->c_fps_samples % VOUT_FPS_SAMPLES ] ) ); 
     
    19401940    static int i_panic_count = 0; 
    19411941    static int i_last_synchro_inc = 0; 
    1942     static float r_synchro_level = VOUT_SYNCHRO_LEVEL_START; 
     1942    static int i_synchro_level = VOUT_SYNCHRO_LEVEL_START; 
    19431943    static int i_truc = 10; 
    19441944 
     
    19661966    } 
    19671967 
    1968     if( i_truc > VOUT_SYNCHRO_LEVEL_MAX*2*2*2*2*2 || 
     1968    if( i_truc > VOUT_SYNCHRO_LEVEL_MAX >> 5 || 
    19691969        i_synchro_inc*i_last_synchro_inc < 0 ) 
    19701970    { 
     
    19861986    else if( i_delay > 100000 ) 
    19871987    { 
    1988         r_synchro_level += 1
     1988        i_synchro_level += 1 << 10
    19891989        if( i_delay > 130000 ) 
    1990             r_synchro_level += 1
    1991     } 
    1992  
    1993     r_synchro_level += (float)i_synchro_inc / i_truc; 
    1994     p_vout->i_synchro_level = (int)(r_synchro_level+0.5); 
    1995  
    1996     if( r_synchro_level > VOUT_SYNCHRO_LEVEL_MAX ) 
    1997     { 
    1998         r_synchro_level = VOUT_SYNCHRO_LEVEL_MAX; 
     1990            i_synchro_level += 1 << 10
     1991    } 
     1992 
     1993    i_synchro_level += ( i_synchro_inc << 10 ) / i_truc; 
     1994    p_vout->i_synchro_level = ( i_synchro_level + (1 << 9) ); 
     1995 
     1996    if( i_synchro_level > VOUT_SYNCHRO_LEVEL_MAX ) 
     1997    { 
     1998        i_synchro_level = VOUT_SYNCHRO_LEVEL_MAX; 
    19991999    } 
    20002000 
  • src/video_parser/video_parser.c

    r57e189e rf6268f6  
    292292    p_vpar->synchro.i_theorical_delay  = 40000; /* 25 fps */ 
    293293    /* assume we can display all Is and 2 Ps */ 
    294     p_vpar->synchro.b_all_I = 1
     294    p_vpar->synchro.b_all_I = 1 << 10
    295295    p_vpar->synchro.b_all_P = 0; 
    296     p_vpar->synchro.displayable_p = 2
     296    p_vpar->synchro.displayable_p = 2 << 10
    297297    p_vpar->synchro.b_all_B = 0; 
    298298    p_vpar->synchro.displayable_b = 0; 
    299299    /* assume there were about 3 P and 6 B images between I's */ 
    300     p_vpar->synchro.i_P_seen = p_vpar->synchro.i_P_kept = 1
    301     p_vpar->synchro.i_B_seen = p_vpar->synchro.i_B_kept = 1
     300    p_vpar->synchro.i_P_seen = p_vpar->synchro.i_P_kept = 1 << 10
     301    p_vpar->synchro.i_B_seen = p_vpar->synchro.i_B_kept = 1 << 10
    302302#endif 
    303303 
  • src/video_parser/vpar_blocks.c

    r9cb93a1 rf6268f6  
    619619 * DecodeMPEG1NonIntra : decode MPEG-1 non-intra blocks 
    620620 *****************************************************************************/ 
    621 static void DecodeMPEG1NonIntra( vpar_thread_t * p_vpar, 
     621static __inline__ void DecodeMPEG1NonIntra( vpar_thread_t * p_vpar, 
    622622                                            macroblock_t * p_mb, int i_b, 
    623623                                            int i_chroma_format ) 
     
    730730 * DecodeMPEG1Intra : decode MPEG-1 intra blocks 
    731731 *****************************************************************************/ 
    732 static void DecodeMPEG1Intra( vpar_thread_t * p_vpar, 
     732static __inline__ void DecodeMPEG1Intra( vpar_thread_t * p_vpar, 
    733733                                         macroblock_t * p_mb, int i_b , 
    734734                                         int i_chroma_format ) 
     
    877877 * DecodeMPEG2NonIntra : decode MPEG-2 non-intra blocks 
    878878 *****************************************************************************/ 
    879 static void DecodeMPEG2NonIntra( vpar_thread_t * p_vpar, 
     879static __inline__ void DecodeMPEG2NonIntra( vpar_thread_t * p_vpar, 
    880880                                            macroblock_t * p_mb, int i_b, 
    881881                                            int i_chroma_format ) 
     
    986986 * DecodeMPEG2Intra : decode MPEG-2 intra blocks 
    987987 *****************************************************************************/ 
    988 static void DecodeMPEG2Intra( vpar_thread_t * p_vpar, 
     988static __inline__ void DecodeMPEG2Intra( vpar_thread_t * p_vpar, 
    989989                                         macroblock_t * p_mb, int i_b, 
    990990                                         int i_chroma_format ) 
     
    11361136 * MotionCode : Parse the next motion code 
    11371137 ****************************************************************************/ 
    1138 static int MotionCode( vpar_thread_t * p_vpar ) 
     1138static __inline__ int MotionCode( vpar_thread_t * p_vpar ) 
    11391139{ 
    11401140    int i_code; 
     
    11851185 * DecodeMotionVector : Decode a motion_vector 
    11861186 ****************************************************************************/ 
    1187 static void DecodeMotionVector( int * pi_prediction, int i_r_size, 
     1187static __inline__ void DecodeMotionVector( int * pi_prediction, int i_r_size, 
    11881188        int i_motion_code, int i_motion_residual, int i_full_pel ) 
    11891189{ 
     
    12121212 * MotionVector : Parse the next motion_vector field 
    12131213 ****************************************************************************/ 
    1214 static void MotionVector( vpar_thread_t * p_vpar, 
     1214static __inline__ void MotionVector( vpar_thread_t * p_vpar, 
    12151215                                     macroblock_t * p_mb, int i_r, 
    12161216                                     int i_s, int i_full_pel, int i_structure ) 
     
    13221322 *****************************************************************************/ 
    13231323static void DecodeMVMPEG1( vpar_thread_t * p_vpar, 
    1324                             macroblock_t * p_mb, int i_s, int i_structure ) 
     1324                           macroblock_t * p_mb, int i_s, int i_structure ) 
    13251325{ 
    13261326    MotionVector( p_vpar, p_mb, 0, i_s, 
     
    13321332 *****************************************************************************/ 
    13331333static void DecodeMVMPEG2( vpar_thread_t * p_vpar, 
    1334                             macroblock_t * p_mb, int i_s, int i_structure ) 
     1334                           macroblock_t * p_mb, int i_s, int i_structure ) 
    13351335{ 
    13361336    if( p_vpar->mb.i_mv_count == 1 ) 
     
    13901390 * IMBType : macroblock_type in I pictures 
    13911391 *****************************************************************************/ 
    1392 static int IMBType( vpar_thread_t * p_vpar ) 
     1392static __inline__ int IMBType( vpar_thread_t * p_vpar ) 
    13931393{ 
    13941394    /* Take two bits for testing */ 
     
    14081408 * PMBType : macroblock_type in P pictures 
    14091409 *****************************************************************************/ 
    1410 static int PMBType( vpar_thread_t * p_vpar ) 
     1410static __inline__ int PMBType( vpar_thread_t * p_vpar ) 
    14111411{ 
    14121412    /* Testing on 6 bits */ 
     
    14221422 * BMBType : macroblock_type in B pictures 
    14231423 *****************************************************************************/ 
    1424 static int BMBType( vpar_thread_t * p_vpar ) 
     1424static __inline__ int BMBType( vpar_thread_t * p_vpar ) 
    14251425{ 
    14261426     /* Testing on 6 bits */ 
     
    14371437 * DMBType : macroblock_type in D pictures 
    14381438 *****************************************************************************/ 
    1439 static int DMBType( vpar_thread_t * p_vpar ) 
     1439static __inline__ int DMBType( vpar_thread_t * p_vpar ) 
    14401440{ 
    14411441    return GetBits( &p_vpar->bit_stream, 1 ); 
     
    14451445 * CodedPattern420 : coded_block_pattern with 4:2:0 chroma 
    14461446 *****************************************************************************/ 
    1447 static int CodedPattern420( vpar_thread_t * p_vpar ) 
     1447static __inline__ int CodedPattern420( vpar_thread_t * p_vpar ) 
    14481448{ 
    14491449    /* Take the max 9 bits length vlc code for testing */ 
     
    14601460 * CodedPattern422 : coded_block_pattern with 4:2:2 chroma 
    14611461 *****************************************************************************/ 
    1462 static int CodedPattern422( vpar_thread_t * p_vpar ) 
     1462static __inline__ int CodedPattern422( vpar_thread_t * p_vpar ) 
    14631463{ 
    14641464    int      i_vlc = ShowBits( &p_vpar->bit_stream, 9 ); 
     
    14741474 * CodedPattern444 : coded_block_pattern with 4:4:4 chroma 
    14751475 *****************************************************************************/ 
    1476 static int CodedPattern444( vpar_thread_t * p_vpar ) 
     1476static __inline__ int CodedPattern444( vpar_thread_t * p_vpar ) 
    14771477{ 
    14781478    int      i_vlc = ShowBits( &p_vpar->bit_stream, 9 ); 
     
    14871487 * InitMacroblock : Initialize macroblock values 
    14881488 *****************************************************************************/ 
    1489 static void InitMacroblock( vpar_thread_t * p_vpar, 
     1489static __inline__ void InitMacroblock( vpar_thread_t * p_vpar, 
    14901490                                       macroblock_t * p_mb, int i_coding_type, 
    14911491                                       int i_chroma_format, 
     
    15221522 * UpdateContext : Update the p_vpar contextual values 
    15231523 *****************************************************************************/ 
    1524 static void UpdateContext( vpar_thread_t * p_vpar, int i_structure ) 
     1524static __inline__ void UpdateContext( vpar_thread_t * p_vpar, int i_structure ) 
    15251525{ 
    15261526    /* Update macroblock real position. */ 
     
    15401540 * SkippedMacroblock : Generate a skipped macroblock with NULL motion vector 
    15411541 *****************************************************************************/ 
    1542 static void SkippedMacroblock( vpar_thread_t * p_vpar, int i_mb, 
     1542static __inline__ void SkippedMacroblock( vpar_thread_t * p_vpar, int i_mb, 
    15431543                                          int i_mb_base, int i_coding_type, 
    15441544                                          int i_chroma_format, 
     
    16001600 * MacroblockModes : Get the macroblock_modes structure 
    16011601 *****************************************************************************/ 
    1602 static void MacroblockModes( vpar_thread_t * p_vpar, 
     1602static __inline__ void MacroblockModes( vpar_thread_t * p_vpar, 
    16031603                                        macroblock_t * p_mb, 
    16041604                                        int i_chroma_format, 
     
    16831683    return;                                                             \ 
    16841684} 
    1685  
    16861685 
    16871686#define PARSEBLOCKS( MPEG1FUNC, MPEG2FUNC )                             \ 
     
    17471746} 
    17481747 
    1749 static void ParseMacroblock( 
     1748static __inline__ void ParseMacroblock( 
    17501749                           vpar_thread_t * p_vpar, 
    17511750                           int * pi_mb_address,     /* previous address to be 
     
    19791978 
    19801979/***************************************************************************** 
     1980 * ParseMacroblockVWXYZ : Parse the next macroblock ; specific functions 
     1981 ***************************************************************************** 
     1982 * V = MPEG2 ? 
     1983 * W = coding type ? 
     1984 * X = chroma format ? 
     1985 * Y = structure ? 
     1986 * Z = second field ? 
     1987 *****************************************************************************/ 
     1988void ParseMacroblockGENERIC( vpar_thread_t * p_vpar, int * pi_mb_address, 
     1989                             int i_mb_previous, int i_mb_base, 
     1990                             boolean_t b_mpeg2, int i_coding_type, 
     1991                             int i_chroma_format, int i_structure, 
     1992                             boolean_t b_second_field ) 
     1993{ 
     1994/*    ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base, 
     1995                     b_mpeg2, i_coding_type, i_chroma_format, 
     1996                     i_structure, b_second_field );*/ 
     1997} 
     1998 
     1999#if (VPAR_OPTIM_LEVEL > 0) 
     2000/* Optimizations for frame pictures */ 
     2001void ParseMacroblock2I420F0( vpar_thread_t * p_vpar, int * pi_mb_address,                                    int i_mb_previous, int i_mb_base, 
     2002                             boolean_t b_mpeg2, int i_coding_type, 
     2003                             int i_chroma_format, int i_structure, 
     2004                             boolean_t b_second_field ) 
     2005{ 
     2006    ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base, 
     2007                     1, I_CODING_TYPE, CHROMA_420, 
     2008                     FRAME_STRUCTURE, 0 ); 
     2009} 
     2010 
     2011void ParseMacroblock2P420F0( vpar_thread_t * p_vpar, int * pi_mb_address,                                    int i_mb_previous, int i_mb_base, 
     2012                             boolean_t b_mpeg2, int i_coding_type, 
     2013                             int i_chroma_format, int i_structure, 
     2014                             boolean_t b_second_field ) 
     2015{ 
     2016    ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base, 
     2017                     1, P_CODING_TYPE, CHROMA_420, 
     2018                     FRAME_STRUCTURE, 0 ); 
     2019} 
     2020 
     2021void ParseMacroblock2B420F0( vpar_thread_t * p_vpar, int * pi_mb_address,                                    int i_mb_previous, int i_mb_base, 
     2022                             boolean_t b_mpeg2, int i_coding_type, 
     2023                             int i_chroma_format, int i_structure, 
     2024                             boolean_t b_second_field ) 
     2025{ 
     2026    ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base, 
     2027                     1, B_CODING_TYPE, CHROMA_420, 
     2028                     FRAME_STRUCTURE, 0 ); 
     2029} 
     2030#endif 
     2031 
     2032#if (VPAR_OPTIM_LEVEL > 1) 
     2033/* Optimizations for field pictures */ 
     2034void ParseMacroblock2I420TZ( vpar_thread_t * p_vpar, int * pi_mb_address,                                    int i_mb_previous, int i_mb_base, 
     2035                             boolean_t b_mpeg2, int i_coding_type, 
     2036                             int i_chroma_format, int i_structure, 
     2037                             boolean_t b_second_field ) 
     2038{ 
     2039    ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base, 
     2040                     1, I_CODING_TYPE, CHROMA_420, 
     2041                     TOP_FIELD, (p_vpar->picture.i_structure != 
     2042                                 p_vpar->picture.i_current_structure) ); 
     2043} 
     2044 
     2045void ParseMacroblock2P420TZ( vpar_thread_t * p_vpar, int * pi_mb_address,                                    int i_mb_previous, int i_mb_base, 
     2046                             boolean_t b_mpeg2, int i_coding_type, 
     2047                             int i_chroma_format, int i_structure, 
     2048                             boolean_t b_second_field ) 
     2049{ 
     2050    ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base, 
     2051                     1, P_CODING_TYPE, CHROMA_420, 
     2052                     TOP_FIELD, (p_vpar->picture.i_structure != 
     2053                                 p_vpar->picture.i_current_structure) ); 
     2054} 
     2055 
     2056void ParseMacroblock2B420TZ( vpar_thread_t * p_vpar, int * pi_mb_address,                                    int i_mb_previous, int i_mb_base, 
     2057                             boolean_t b_mpeg2, int i_coding_type, 
     2058                             int i_chroma_format, int i_structure, 
     2059                             boolean_t b_second_field ) 
     2060{ 
     2061    ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base, 
     2062                     1, B_CODING_TYPE, CHROMA_420, 
     2063                     TOP_FIELD, (p_vpar->picture.i_structure != 
     2064                                 p_vpar->picture.i_current_structure) ); 
     2065} 
     2066 
     2067void ParseMacroblock2I420BZ( vpar_thread_t * p_vpar, int * pi_mb_address,                                    int i_mb_previous, int i_mb_base, 
     2068                             boolean_t b_mpeg2, int i_coding_type, 
     2069                             int i_chroma_format, int i_structure, 
     2070                             boolean_t b_second_field ) 
     2071{ 
     2072    ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base, 
     2073                     1, I_CODING_TYPE, CHROMA_420, 
     2074                     BOTTOM_FIELD, (p_vpar->picture.i_structure != 
     2075                                    p_vpar->picture.i_current_structure) ); 
     2076} 
     2077 
     2078void ParseMacroblock2P420BZ( vpar_thread_t * p_vpar, int * pi_mb_address,                                    int i_mb_previous, int i_mb_base, 
     2079                             boolean_t b_mpeg2, int i_coding_type, 
     2080                             int i_chroma_format, int i_structure, 
     2081                             boolean_t b_second_field ) 
     2082{ 
     2083    ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base, 
     2084                     1, P_CODING_TYPE, CHROMA_420, 
     2085                     BOTTOM_FIELD, (p_vpar->picture.i_structure != 
     2086                                    p_vpar->picture.i_current_structure) ); 
     2087} 
     2088 
     2089void ParseMacroblock2B420BZ( vpar_thread_t * p_vpar, int * pi_mb_address,                                    int i_mb_previous, int i_mb_base, 
     2090                             boolean_t b_mpeg2, int i_coding_type, 
     2091                             int i_chroma_format, int i_structure, 
     2092                             boolean_t b_second_field ) 
     2093{ 
     2094    ParseMacroblock( p_vpar, pi_mb_address, i_mb_previous, i_mb_base, 
     2095                     1, B_CODING_TYPE, CHROMA_420, 
     2096                     BOTTOM_FIELD, (p_vpar->picture.i_structure != 
     2097                                    p_vpar->picture.i_current_structure) ); 
     2098} 
     2099#endif 
     2100 
     2101/***************************************************************************** 
    19812102 * SliceHeader : Parse the next slice structure 
    19822103 *****************************************************************************/ 
    1983 static void SliceHeader( vpar_thread_t * p_vpar, 
     2104typedef void    (*f_parse_mb_t)( vpar_thread_t * p_vpar, int * pi_mb_address,                                    int i_mb_previous, int i_mb_base, 
     2105                                 boolean_t b_mpeg2, int i_coding_type, 
     2106                                 int i_chroma_format, int i_structure, 
     2107                                 boolean_t b_second_field ); 
     2108 
     2109static __inline__ void SliceHeader( vpar_thread_t * p_vpar, 
    19842110                                    int * pi_mb_address, int i_mb_base, 
    19852111                                    u32 i_vert_code, boolean_t b_high, 
     
    19892115                                    boolean_t b_second_field ) 
    19902116{ 
     2117    static f_parse_mb_t ppf_parse_mb[4][4] = 
     2118    { 
     2119        { 
     2120            NULL, NULL, NULL, NULL 
     2121        }, 
     2122        { 
     2123            /* TOP_FIELD */ 
     2124#if (VPAR_OPTIM_LEVEL > 1) 
     2125            NULL, ParseMacroblock2I420TZ, ParseMacroblock2P420TZ, 
     2126            ParseMacroblock2B420TZ 
     2127#else 
     2128            NULL, ParseMacroblockGENERIC, ParseMacroblockGENERIC, 
     2129            ParseMacroblockGENERIC 
     2130#endif 
     2131        }, 
     2132        { 
     2133            /* BOTTOM_FIELD */ 
     2134#if (VPAR_OPTIM_LEVEL > 1) 
     2135            NULL, ParseMacroblock2I420BZ, ParseMacroblock2P420BZ, 
     2136            ParseMacroblock2B420BZ 
     2137#else 
     2138            NULL, ParseMacroblockGENERIC, ParseMacroblockGENERIC, 
     2139            ParseMacroblockGENERIC 
     2140#endif 
     2141        }, 
     2142        { 
     2143            /* FRAME_PICTURE */ 
     2144#if (VPAR_OPTIM_LEVEL > 0) 
     2145            NULL, ParseMacroblock2I420F0, ParseMacroblock2P420F0, 
     2146            ParseMacroblock2B420F0 
     2147#else 
     2148            NULL, ParseMacroblockGENERIC, ParseMacroblockGENERIC, 
     2149            ParseMacroblockGENERIC 
     2150#endif 
     2151        } 
     2152    }; 
     2153 
    19912154    int                     i_mb_address_save = *pi_mb_address; 
    19922155 
     
    20402203            return; 
    20412204        } 
    2042         ParseMacroblock( p_vpar, pi_mb_address, i_mb_address_save, 
     2205 
     2206        if( p_vpar->sequence.i_chroma_format != CHROMA_420 
     2207            || !p_vpar->sequence.b_mpeg2 || p_vpar->sequence.i_height > 2800 
     2208            || p_vpar->sequence.i_scalable_mode == SC_DP ) 
     2209        { 
     2210            /* Weird stream. Use the slower generic function. */ 
     2211            ParseMacroblockGENERIC( p_vpar, pi_mb_address, i_mb_address_save, 
    20432212                         i_mb_base, b_mpeg2, i_coding_type, 
    20442213                         i_chroma_format, i_structure, 
    20452214                         b_second_field ); 
     2215        } 
     2216        else 
     2217        { 
     2218            /* Try to find an optimized function. */ 
     2219            if( ppf_parse_mb[p_vpar->picture.i_structure] 
     2220                            [p_vpar->picture.i_coding_type] == NULL ) 
     2221            { 
     2222                intf_ErrMsg( "vpar error: bad ppf_parse_mb function pointer (struct:%d, coding type:%d)\n", 
     2223                         p_vpar->picture.i_structure, p_vpar->picture.i_coding_type ); 
     2224            } 
     2225            else 
     2226            { 
     2227                ppf_parse_mb[p_vpar->picture.i_structure] 
     2228                            [p_vpar->picture.i_coding_type] 
     2229                       ( p_vpar, pi_mb_address, i_mb_address_save, 
     2230                         i_mb_base, b_mpeg2, i_coding_type, 
     2231                         i_chroma_format, i_structure, 
     2232                         b_second_field ); 
     2233            } 
     2234        } 
     2235 
    20462236        i_mb_address_save = *pi_mb_address; 
    20472237        if( p_vpar->picture.b_error ) 
     
    20572247 * PictureData : Parse off all macroblocks (ISO/IEC 13818-2 6.2.3.7) 
    20582248 *****************************************************************************/ 
    2059 static void PictureData( vpar_thread_t * p_vpar, int i_mb_base, 
    2060                                     boolean_t b_high, boolean_t b_dp_scalable, 
    2061                                     boolean_t b_mpeg2, int i_coding_type, 
    2062                                     int i_chroma_format, int i_structure, 
    2063                                     boolean_t b_second_field ) 
     2249void vpar_PictureData( vpar_thread_t * p_vpar, int i_mb_base ) 
    20642250{ 
    20652251    int         i_mb_address = 0;