1/* { dg-do compile } */ 2/* { dg-options "-O1 -mtune=amdfam10 -fexpensive-optimizations -fgcse -foptimize-register-move -freorder-blocks -fschedule-insns2 -funswitch-loops -fgcse-las -fselective-scheduling2 -fsel-sched-pipelining -funroll-all-loops" } */ 3 4typedef char uint8_t; 5typedef uint32_t; 6typedef vo_frame_t; 7struct vo_frame_s 8{ 9 uint8_t base[3]; 10 int pitches[3];}; 11typedef struct 12{ 13void 14 (*proc_macro_block) 15 (void); 16} 17xine_xvmc_t; 18typedef struct 19{ 20 uint8_t ref[2][3]; 21int pmv; 22} 23motion_t; 24typedef struct 25{ 26 uint32_t bitstream_buf; 27 int bitstream_bits; 28 uint8_t * bitstream_ptr; 29 uint8_t dest[3]; 30 int pitches[3]; 31 int offset; 32 motion_t b_motion; 33 motion_t f_motion; 34 int v_offset; 35 int coded_picture_width; 36 int picture_structure; 37struct vo_frame_s *current_frame;} 38picture_t; 39typedef struct 40{ 41int xvmc_last_slice_code;} 42mpeg2dec_accel_t; 43static int bitstream_init (picture_t * picture, void *start) 44{ 45 picture->bitstream_ptr = start; 46 return (int) (long) start; 47} 48static slice_xvmc_init (picture_t * picture, int code) 49{ 50 int offset; 51 struct vo_frame_s *forward_reference_frame; 52 offset = picture->picture_structure == 2; 53 picture->pitches[0] = picture->current_frame->pitches[0]; 54 picture->pitches[1] = picture->current_frame->pitches[1]; 55 if (picture) 56 picture->f_motion.ref 57 [0] 58 [0] 59 = (char) (long) (forward_reference_frame->base + (offset ? picture->pitches[0] : 0)); 60 picture->f_motion.ref[0][1] = (offset); 61 if (picture->picture_structure) 62 picture->pitches[0] <<= picture->pitches[1] <<= 1; 63 offset = 0; 64 while (1) 65 { 66 if (picture->bitstream_buf >= 0x08000000) 67 break; 68 switch (picture->bitstream_buf >> 12) 69 { 70 case 8: 71 offset += 33; 72 picture->bitstream_buf 73 |= 74 picture->bitstream_ptr[1] << picture->bitstream_bits; 75 } 76 } 77 picture->offset = (offset); 78 while (picture->offset - picture->coded_picture_width >= 0) 79 { 80 picture->offset -= picture->coded_picture_width; 81 if (picture->current_frame) 82 { 83 picture->dest[0] += picture->pitches[0]; 84 picture->dest[1] += picture->pitches[1]; 85 } 86 picture->v_offset += 16; 87 } 88} 89 90void 91mpeg2_xvmc_slice 92 (mpeg2dec_accel_t * accel, picture_t * picture, int code, uint8_t buffer,int mba_inc) 93{ 94 xine_xvmc_t * xvmc = (xine_xvmc_t *) (long) bitstream_init (picture, (void *) (long) buffer); 95 slice_xvmc_init (picture, code); 96 while (1) 97 { 98 if (picture) 99 break; 100 switch (picture->bitstream_buf) 101 { 102 case 8: 103 mba_inc += accel->xvmc_last_slice_code = code; 104 xvmc->proc_macro_block (); 105 while (mba_inc) 106 ; 107 } 108 } 109} 110