Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #13021: macports-mplayer-mmx.diff

File macports-mplayer-mmx.diff, 1.9 KB (added by qhwt macports@…, 12 months ago)
  • libavcodec/i386/dsputil_mmx.c

    old new  
    631631} 
    632632 
    633633static inline void transpose4x4(uint8_t *dst, uint8_t *src, int dst_stride, int src_stride){ 
     634#if 1 
     635  /* borrowed from: http://lists-archives.org/mplayer-dev-eng/14875-compiling-with-intel-c.html */ 
     636  /* Ugly, but uses a minimal number of operands just to fit into Intel C limits */ 
     637  asm volatile("movd (%1), %%mm0               \n\t" 
     638               "mov %3, %%eax                  \n\t" 
     639               "movd (%1, %%eax), %%mm1        \n\t" 
     640               "add %3, %%eax                  \n\t" 
     641               "movd (%1, %%eax), %%mm2        \n\t" 
     642               "add %3, %%eax                  \n\t" 
     643               "movd (%1, %%eax), %%mm3        \n\t" 
     644               "punpcklbw %%mm1, %%mm0         \n\t" 
     645               "punpcklbw %%mm3, %%mm2         \n\t" 
     646               "movq %%mm0, %%mm1              \n\t" 
     647               "punpcklwd %%mm2, %%mm0         \n\t" 
     648               "punpckhwd %%mm2, %%mm1         \n\t" 
     649               "movd %%mm0, (%0)               \n\t" 
     650               "punpckhdq %%mm0, %%mm0         \n\t" 
     651               "mov %2, %%eax                  \n\t" 
     652               "movd %%mm0, (%0, %%eax)        \n\t" 
     653               "add %2, %%eax                  \n\t" 
     654               "movd %%mm1, (%0, %%eax)        \n\t" 
     655               "punpckhdq %%mm1, %%mm1         \n\t" 
     656               "add %2, %%eax                  \n\t" 
     657               "movd %%mm1, (%0, %%eax)        \n\t" 
     658               :: "r" (dst), "r" (src), "r"(dst_stride), "r"(src_stride) 
     659               : "eax"); 
     660#else 
    634661    asm volatile( //FIXME could save 1 instruction if done as 8x4 ... 
    635662        "movd  %4, %%mm0                \n\t" 
    636663        "movd  %5, %%mm1                \n\t" 
     
    657684           "m" (*(uint32_t*)(src + 2*src_stride)), 
    658685           "m" (*(uint32_t*)(src + 3*src_stride)) 
    659686    ); 
     687#endif 
    660688} 
    661689 
    662690static void h263_h_loop_filter_mmx(uint8_t *src, int stride, int qscale){