Changeset f6268f60f4d02aadbb8b14046f0aa96b39af63a8
- Timestamp:
- 08/08/00 00:18:24 (8 years ago)
- git-parent:
- Files:
-
- AUTHORS (modified) (2 diffs)
- ChangeLog (modified) (1 diff)
- Makefile.in (modified) (1 diff)
- include/config.h.in (modified) (2 diffs)
- include/vpar_blocks.h (modified) (1 diff)
- include/vpar_headers.h (modified) (1 diff)
- include/vpar_synchro.h (modified) (2 diffs)
- plugins/yuvmmx/video_yuv.c (modified) (1 diff)
- plugins/yuvmmx/video_yuv.h (modified) (1 diff)
- src/interface/intf_cmd.c (modified) (2 diffs)
- src/video_decoder/video_decoder.c (modified) (2 diffs)
- src/video_output/video_output.c (modified) (4 diffs)
- src/video_parser/video_parser.c (modified) (1 diff)
- src/video_parser/vpar_blocks.c (modified) (30 diffs)
- src/video_parser/vpar_headers.c (modified) (6 diffs)
- src/video_parser/vpar_synchro.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
AUTHORS
racbd88f rf6268f6 3 3 Michel Lespinasse <walken@wrs.com> 4 4 5 Olivier Baxa <oli@via.ecp.fr> 6 Eric Estievenart <eric@via.ecp.fr> 5 Olivier Pomel <pomel@via.ecp.fr> 7 6 8 7 Jean-Philippe Grimaldi <jeanphi@via.ecp.fr> … … 15 14 Ga�Hendryckx <jimmy@via.ecp.fr> 16 15 Samuel Hocevar <sam@via.ecp.fr> 16 Brieuc Jeunhomme <bbp@via.ecp.fr> 17 17 Michel Kaempf <maxx@via.ecp.fr> 18 18 19 19 St�ane Borel <stef@via.ecp.fr> 20 20 Renaud Dartus <reno@via.ecp.fr> 21 Henri Fallon <henri@via.ecp.fr>22 21 23 Contributors include Aaron Holtzman for his ac3dec decoder, and the24 LiViD team for a few lines of code we borrowed here and there.ChangeLog
r52d7937 rf6268f6 6 6 * fixed functions that weren't properly inlined 7 7 * 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 8 12 9 13 Thu Jul 20 15:14:06 CEST 2000 Makefile.in
r52d7937 rf6268f6 157 157 # C Objects 158 158 # 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.o165 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.o174 175 audio_output_obj = audio_output/audio_output.o176 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.o181 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.o159 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 191 191 192 lpcm_decoder_obj = lpcm_decoder/lpcm_decoder_thread.o \193 lpcm_decoder/lpcm_decoder.o194 195 audio_decoder_obj = audio_decoder/audio_decoder_thread.o \196 audio_decoder/audio_decoder.o \197 audio_decoder/audio_math.o198 199 spu_decoder_obj = spu_decoder/spu_decoder.o192 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 200 200 201 201 #??generic_decoder_obj = generic_decoder/generic_decoder.o 202 202 # remeber to add it to OBJ 203 203 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 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 ifneq (,$(findstring mmx,$(ARCH))) 211 vdec_motion_inner = video_decoder/vdec_motion_inner_mmx.o 212 else 213 vdec_motion_inner = video_decoder/vdec_motion_inner.o 214 endif 215 216 video_decoder_obj = video_decoder/video_decoder.o \ 217 video_decoder/vdec_motion.o \ 218 video_decoder/vdec_idct.o \ 219 $(vdec_motion_inner) 220 221 misc_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 222 228 223 229 include/config.h.in
re13aed0 rf6268f6 128 128 129 129 /* 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" 132 132 133 133 /* Environment variable used to store channels file and default value */ … … 435 435 *****************************************************************************/ 436 436 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 439 439 #define VOUT_SYNCHRO_HEAP_IDEAL_SIZE 5 440 include/vpar_blocks.h
r9cb93a1 rf6268f6 167 167 void vpar_InitCodedPattern( struct vpar_thread_s * p_vpar ); 168 168 void 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 169 void vpar_PictureData( struct vpar_thread_s * p_vpar, int i_mb_base ); include/vpar_headers.h
r9cb93a1 rf6268f6 59 59 unsigned int i_aspect_ratio; /* height/width display ratio */ 60 60 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 */ 62 62 boolean_t b_mpeg2; /* guess */ 63 63 boolean_t b_progressive; /* progressive (ie. include/vpar_synchro.h
r57e189e rf6268f6 68 68 boolean_t b_all_I; 69 69 boolean_t b_all_P; 70 doubledisplayable_p;70 int displayable_p; 71 71 boolean_t b_all_B; 72 doubledisplayable_b;72 int displayable_b; 73 73 74 74 } video_synchro_t; … … 101 101 102 102 /* 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) */ 104 104 mtime_t i_current_frame_date; 105 105 mtime_t i_backward_frame_date; plugins/yuvmmx/video_yuv.c
r52d7937 rf6268f6 132 132 void SetYUV( vout_thread_t *p_vout ) 133 133 { 134 int pi_gamma[256]; /* gamma table */135 134 int i_index; /* index in tables */ 136 137 /* Build gamma table */138 SetGammaTable( pi_gamma, p_vout->f_gamma );139 135 140 136 /* plugins/yuvmmx/video_yuv.h
r52d7937 rf6268f6 54 54 * Local prototypes 55 55 *****************************************************************************/ 56 void SetGammaTable ( int *pi_table, double f_gamma );57 56 void SetYUV ( vout_thread_t *p_vout ); 58 57 void SetOffset ( int i_width, int i_height, int i_pic_width, src/interface/intf_cmd.c
r57e189e rf6268f6 159 159 char psz_line[INTF_MAX_CMD_SIZE]; /* line */ 160 160 char * psz_index; /* index in string */ 161 char * psz_vlcrc; /* full path to vlcrc */ 161 162 int i_err; /* error indicator */ 162 163 163 164 /* Open file */ 164 165 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" ); 166 175 if( p_file == NULL ) 167 176 { 168 intf_DbgMsg("intf warning: %s: %s\n", psz_ filename, strerror(errno));177 intf_DbgMsg("intf warning: %s: %s\n", psz_vlcrc, strerror(errno)); 169 178 return( -1 ); 170 179 } … … 195 204 if( !feof( p_file ) ) 196 205 { 197 intf_ErrMsg("error: %s: %s\n", psz_ filename, strerror(errno));206 intf_ErrMsg("error: %s: %s\n", psz_vlcrc, strerror(errno)); 198 207 return( -1 ); 199 208 } src/video_decoder/video_decoder.c
r9cb93a1 rf6268f6 323 323 "movq %%mm2,(%0)\n\t" 324 324 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)); 327 327 } 328 328 #endif … … 390 390 "packuswb 120(%1),%%mm0\n\t" 391 391 "movq %%mm0,(%0)\n\t" 392 "emms"392 //"emms" 393 393 :"+r" (p_data): "r" (p_block),"r" (i_incr+8)); 394 394 } src/video_output/video_output.c
r52d7937 rf6268f6 1692 1692 if( p_vout->c_fps_samples > VOUT_FPS_SAMPLES ) 1693 1693 { 1694 sprintf( psz_buffer, "%.2f fps ", (double) VOUT_FPS_SAMPLES * 1000000 /1694 sprintf( psz_buffer, "%.2f fps/10", VOUT_FPS_SAMPLES * 1000000 * 10 / 1695 1695 ( p_vout->p_fps_sample[ (p_vout->c_fps_samples - 1) % VOUT_FPS_SAMPLES ] - 1696 1696 p_vout->p_fps_sample[ p_vout->c_fps_samples % VOUT_FPS_SAMPLES ] ) ); … … 1940 1940 static int i_panic_count = 0; 1941 1941 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; 1943 1943 static int i_truc = 10; 1944 1944 … … 1966 1966 } 1967 1967 1968 if( i_truc > VOUT_SYNCHRO_LEVEL_MAX *2*2*2*2*2||1968 if( i_truc > VOUT_SYNCHRO_LEVEL_MAX >> 5 || 1969 1969 i_synchro_inc*i_last_synchro_inc < 0 ) 1970 1970 { … … 1986 1986 else if( i_delay > 100000 ) 1987 1987 { 1988 r_synchro_level += 1;1988 i_synchro_level += 1 << 10; 1989 1989 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; 1999 1999 } 2000 2000 src/video_parser/video_parser.c
r57e189e rf6268f6 292 292 p_vpar->synchro.i_theorical_delay = 40000; /* 25 fps */ 293 293 /* 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; 295 295 p_vpar->synchro.b_all_P = 0; 296 p_vpar->synchro.displayable_p = 2 ;296 p_vpar->synchro.displayable_p = 2 << 10; 297 297 p_vpar->synchro.b_all_B = 0; 298 298 p_vpar->synchro.displayable_b = 0; 299 299 /* 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; 302 302 #endif 303 303 src/video_parser/vpar_blocks.c
r9cb93a1 rf6268f6 619 619 * DecodeMPEG1NonIntra : decode MPEG-1 non-intra blocks 620 620 *****************************************************************************/ 621 static void DecodeMPEG1NonIntra( vpar_thread_t * p_vpar,621 static __inline__ void DecodeMPEG1NonIntra( vpar_thread_t * p_vpar, 622 622 macroblock_t * p_mb, int i_b, 623 623 int i_chroma_format ) … … 730 730 * DecodeMPEG1Intra : decode MPEG-1 intra blocks 731 731 *****************************************************************************/ 732 static void DecodeMPEG1Intra( vpar_thread_t * p_vpar,732 static __inline__ void DecodeMPEG1Intra( vpar_thread_t * p_vpar, 733 733 macroblock_t * p_mb, int i_b , 734 734 int i_chroma_format ) … … 877 877 * DecodeMPEG2NonIntra : decode MPEG-2 non-intra blocks 878 878 *****************************************************************************/ 879 static void DecodeMPEG2NonIntra( vpar_thread_t * p_vpar,879 static __inline__ void DecodeMPEG2NonIntra( vpar_thread_t * p_vpar, 880 880 macroblock_t * p_mb, int i_b, 881 881 int i_chroma_format ) … … 986 986 * DecodeMPEG2Intra : decode MPEG-2 intra blocks 987 987 *****************************************************************************/ 988 static void DecodeMPEG2Intra( vpar_thread_t * p_vpar,988 static __inline__ void DecodeMPEG2Intra( vpar_thread_t * p_vpar, 989 989 macroblock_t * p_mb, int i_b, 990 990 int i_chroma_format ) … … 1136 1136 * MotionCode : Parse the next motion code 1137 1137 ****************************************************************************/ 1138 static int MotionCode( vpar_thread_t * p_vpar )1138 static __inline__ int MotionCode( vpar_thread_t * p_vpar ) 1139 1139 { 1140 1140 int i_code; … … 1185 1185 * DecodeMotionVector : Decode a motion_vector 1186 1186 ****************************************************************************/ 1187 static void DecodeMotionVector( int * pi_prediction, int i_r_size,1187 static __inline__ void DecodeMotionVector( int * pi_prediction, int i_r_size, 1188 1188 int i_motion_code, int i_motion_residual, int i_full_pel ) 1189 1189 { … … 1212 1212 * MotionVector : Parse the next motion_vector field 1213 1213 ****************************************************************************/ 1214 static void MotionVector( vpar_thread_t * p_vpar,1214 static __inline__ void MotionVector( vpar_thread_t * p_vpar, 1215 1215 macroblock_t * p_mb, int i_r, 1216 1216 int i_s, int i_full_pel, int i_structure ) … … 1322 1322 *****************************************************************************/ 1323 1323 static 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 ) 1325 1325 { 1326 1326 MotionVector( p_vpar, p_mb, 0, i_s, … … 1332 1332 *****************************************************************************/ 1333 1333 static 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 ) 1335 1335 { 1336 1336 if( p_vpar->mb.i_mv_count == 1 ) … … 1390 1390 * IMBType : macroblock_type in I pictures 1391 1391 *****************************************************************************/ 1392 static int IMBType( vpar_thread_t * p_vpar )1392 static __inline__ int IMBType( vpar_thread_t * p_vpar ) 1393 1393 { 1394 1394 /* Take two bits for testing */ … … 1408 1408 * PMBType : macroblock_type in P pictures 1409 1409 *****************************************************************************/ 1410 static int PMBType( vpar_thread_t * p_vpar )1410 static __inline__ int PMBType( vpar_thread_t * p_vpar ) 1411 1411 { 1412 1412 /* Testing on 6 bits */ … … 1422 1422 * BMBType : macroblock_type in B pictures 1423 1423 *****************************************************************************/ 1424 static int BMBType( vpar_thread_t * p_vpar )1424 static __inline__ int BMBType( vpar_thread_t * p_vpar ) 1425 1425 { 1426 1426 /* Testing on 6 bits */ … … 1437 1437 * DMBType : macroblock_type in D pictures 1438 1438 *****************************************************************************/ 1439 static int DMBType( vpar_thread_t * p_vpar )1439 static __inline__ int DMBType( vpar_thread_t * p_vpar ) 1440 1440 { 1441 1441 return GetBits( &p_vpar->bit_stream, 1 ); … … 1445 1445 * CodedPattern420 : coded_block_pattern with 4:2:0 chroma 1446 1446 *****************************************************************************/ 1447 static int CodedPattern420( vpar_thread_t * p_vpar )1447 static __inline__ int CodedPattern420( vpar_thread_t * p_vpar ) 1448 1448 { 1449 1449 /* Take the max 9 bits length vlc code for testing */ … … 1460 1460 * CodedPattern422 : coded_block_pattern with 4:2:2 chroma 1461 1461 *****************************************************************************/ 1462 static int CodedPattern422( vpar_thread_t * p_vpar )1462 static __inline__ int CodedPattern422( vpar_thread_t * p_vpar ) 1463 1463 { 1464 1464 int i_vlc = ShowBits( &p_vpar->bit_stream, 9 ); … … 1474 1474 * CodedPattern444 : coded_block_pattern with 4:4:4 chroma 1475 1475 *****************************************************************************/ 1476 static int CodedPattern444( vpar_thread_t * p_vpar )1476 static __inline__ int CodedPattern444( vpar_thread_t * p_vpar ) 1477 1477 { 1478 1478 int i_vlc = ShowBits( &p_vpar->bit_stream, 9 ); … … 1487 1487 * InitMacroblock : Initialize macroblock values 1488 1488 *****************************************************************************/ 1489 static void InitMacroblock( vpar_thread_t * p_vpar,1489 static __inline__ void InitMacroblock( vpar_thread_t * p_vpar, 1490 1490 macroblock_t * p_mb, int i_coding_type, 1491 1491 int i_chroma_format, … … 1522 1522 * UpdateContext : Update the p_vpar contextual values 1523 1523 *****************************************************************************/ 1524 static void UpdateContext( vpar_thread_t * p_vpar, int i_structure )1524 static __inline__ void UpdateContext( vpar_thread_t * p_vpar, int i_structure ) 1525 1525 { 1526 1526 /* Update macroblock real position. */ … … 1540 1540 * SkippedMacroblock : Generate a skipped macroblock with NULL motion vector 1541 1541 *****************************************************************************/ 1542 static void SkippedMacroblock( vpar_thread_t * p_vpar, int i_mb,1542 static __inline__ void SkippedMacroblock( vpar_thread_t * p_vpar, int i_mb, 1543 1543 int i_mb_base, int i_coding_type, 1544 1544 int i_chroma_format, … … 1600 1600 * MacroblockModes : Get the macroblock_modes structure 1601 1601 *****************************************************************************/ 1602 static void MacroblockModes( vpar_thread_t * p_vpar,1602 static __inline__ void MacroblockModes( vpar_thread_t * p_vpar, 1603 1603 macroblock_t * p_mb, 1604 1604 int i_chroma_format, … … 1683 1683 return; \ 1684 1684 } 1685 1686 1685 1687 1686 #define PARSEBLOCKS( MPEG1FUNC, MPEG2FUNC ) \ … … 1747 1746 } 1748 1747 1749 static void ParseMacroblock(1748 static __inline__ void ParseMacroblock( 1750 1749 vpar_thread_t * p_vpar, 1751 1750 int * pi_mb_address, /* previous address to be … … 1979 1978 1980 1979 /***************************************************************************** 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 *****************************************************************************/ 1988 void 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 */ 2001 void 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 2011 void 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 2021 void 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 */ 2034 void 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 2045 void 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 2056 void 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 2067 void 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 2078 void 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 2089 void 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 /***************************************************************************** 1981 2102 * SliceHeader : Parse the next slice structure 1982 2103 *****************************************************************************/ 1983 static void SliceHeader( vpar_thread_t * p_vpar, 2104 typedef 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 2109 static __inline__ void SliceHeader( vpar_thread_t * p_vpar, 1984 2110 int * pi_mb_address, int i_mb_base, 1985 2111 u32 i_vert_code, boolean_t b_high, … … 1989 2115 boolean_t b_second_field ) 1990 2116 { 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 1991 2154 int i_mb_address_save = *pi_mb_address; 1992 2155 … … 2040 2203 return; 2041 2204 } 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, 2043 2212 i_mb_base, b_mpeg2, i_coding_type, 2044 2213 i_chroma_format, i_structure, 2045 2214 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 2046 2236 i_mb_address_save = *pi_mb_address; 2047 2237 if( p_vpar->picture.b_error ) … … 2057 2247 * PictureData : Parse off all macroblocks (ISO/IEC 13818-2 6.2.3.7) 2058 2248 *****************************************************************************/ 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 ) 2249 void vpar_PictureData( vpar_thread_t * p_vpar, int i_mb_base ) 2064 2250 { 2065 2251 int i_mb_address = 0;
