typedef unsigned char uint8_t; typedef struct vo_frame_s vo_frame_t; struct vo_frame_s { uint8_t *base[3]; }; typedef struct dfb_frame_s dfb_frame_t; typedef enum { MF_NONE = 0x0000000, MF_B = 0x00000001, MF_C = 0x00000002, MF_S = 0x00000004, MF_ALL = 0x00000007 } MixerFlags; struct dfb_frame_s { vo_frame_t vo_frame; int area; uint8_t *out_plane[3]; MixerFlags mixer_set; }; static void __mmx_yuy2_be_yuy2 ( dfb_frame_t *frame ) { uint8_t *S = frame->vo_frame.base[0]; uint8_t *D = frame->out_plane[0]; int n = frame->area/4; __asm__ __volatile__( "movq wmask, %%mm2\n\t" "psllw $8, %%mm2\n\t" "pxor %%mm7, %%mm7\n\t" ".align 16\n" "1:\n\t" "movq (%1), %%mm0\n\t" "movq %%mm0, %%mm1\n\t" "pand wmask, %%mm1\n\t" "testl $3, %3\n\t" "jz 2f\n\t" "psubw proc_table, %%mm1\n\t" "psllw $3, %%mm1\n\t" "pmulhw proc_table+24, %%mm1\n\t" "paddw proc_table+8, %%mm1\n\t" "packuswb %%mm1, %%mm1\n\t" "punpcklbw %%mm7, %%mm1\n\t" ".align 8\n" "2:\n\t" "pand %%mm2, %%mm0\n\t" "testl $4, %3\n\t" "jz 3f\n\t" "psrlw $8, %%mm0\n\t" "psubw proc_table+16, %%mm0\n\t" "psllw $3, %%mm0\n\t" "pmulhw proc_table+32, %%mm0\n\t" "paddw proc_table+16, %%mm0\n\t" "packuswb %%mm0, %%mm0\n\t" "punpcklbw %%mm7, %%mm0\n\t" "psllw $8, %%mm0\n\t" ".align 8\n" "3:\n\t" "por %%mm1, %%mm0\n\t" "movq %%mm0, (%0)\n\t" "addl $8, %0\n\t" "addl $8, %1\n\t" "decl %2\n\t" "jnz 1b\n\t" "emms" : "=&D" (D), "=&S" (S), "=&c" (n) : "q" (frame->mixer_set), "0" (D), "1" (S), "2" (n) : "memory"); }