annotate libvo/rgb15to16mmx.c @ 1951:b2b85982fc0e

MTRR autoconfigure
author nick
date Tue, 25 Sep 2001 07:20:42 +0000
parents 3b5f5d1c5041
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 // Original by Strepto/Astral
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2 // ported to gcc & bugfixed : A'rpi
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
4 #include <inttypes.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5 //#include "attributes.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6 #include "mmx.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
7
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
8 void rgb15to16_mmx(char* s0,char* d0,int count){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9 static uint64_t mask_b = 0x001F001F001F001FLL; // 00000000 00011111 xxB
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 static uint64_t mask_rg = 0x7FE07FE07FE07FE0LL; // 01111111 11100000 RGx
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
11 register char* s=s0+count;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
12 register char* d=d0+count;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
13 register int offs=-count;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14 movq_m2r (mask_b, mm4);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 movq_m2r (mask_rg, mm5);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
16 while(offs<0){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 movq_m2r (*(s+offs), mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18 movq_r2r (mm0, mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20 movq_m2r (*(s+8+offs), mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 movq_r2r (mm2, mm3);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23 pand_r2r (mm4, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24 pand_r2r (mm5, mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26 psllq_i2r(1,mm1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27 pand_r2r (mm4, mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
28
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
29 pand_r2r (mm5, mm3);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30 por_r2r (mm1, mm0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32 psllq_i2r(1,mm3);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33 movq_r2m (mm0,*(d+offs));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35 por_r2r (mm3,mm2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36 movq_r2m (mm2,*(d+8+offs));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38 offs+=16;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40 emms();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42