]>
Commit | Line | Data |
---|---|---|
45516216 | 1 | typedef unsigned char uint8_t; |
2 | typedef struct vo_frame_s vo_frame_t; | |
3 | struct vo_frame_s { | |
4 | uint8_t *base[3]; | |
5 | }; | |
6 | typedef struct dfb_frame_s dfb_frame_t; | |
7 | typedef enum { | |
8 | MF_NONE = 0x0000000, MF_B = 0x00000001, MF_C = 0x00000002, MF_S = 0x00000004, MF_ALL = 0x00000007 } | |
9 | MixerFlags; | |
10 | struct dfb_frame_s { | |
11 | vo_frame_t vo_frame; | |
12 | int area; | |
13 | uint8_t *out_plane[3]; | |
14 | MixerFlags mixer_set; | |
15 | }; | |
16 | static void __mmx_yuy2_be_yuy2 ( dfb_frame_t *frame ) { | |
17 | uint8_t *S = frame->vo_frame.base[0]; | |
18 | uint8_t *D = frame->out_plane[0]; | |
19 | int n = frame->area/4; | |
20 | __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"); | |
21 | } |