[svn] / branches / dev-api-4 / xvidcore / src / motion / ppc_asm / sad_altivec.c Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/src/motion/ppc_asm/sad_altivec.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 115, Thu Apr 11 10:18:40 2002 UTC revision 195, Wed Jun 12 20:38:41 2002 UTC
# Line 17  Line 17 
17      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18    
19    
20      $Id: sad_altivec.c,v 1.2 2002-04-11 10:18:40 canard Exp $      $Id: sad_altivec.c,v 1.3 2002-06-12 20:38:40 edgomez Exp $
21      $Source: /home/xvid/cvs_copy/cvs-server-root/xvid/xvidcore/src/motion/ppc_asm/sad_altivec.c,v $      $Source: /home/xvid/cvs_copy/cvs-server-root/xvid/xvidcore/src/motion/ppc_asm/sad_altivec.c,v $
22      $Date: 2002-04-11 10:18:40 $      $Date: 2002-06-12 20:38:40 $
23      $Author: canard $      $Author: edgomez $
24    
25  */  */
26    
# Line 39  Line 39 
39  static const vector unsigned char perms[2] = {  static const vector unsigned char perms[2] = {
40          (vector unsigned char)( /* Used when cur is aligned */          (vector unsigned char)( /* Used when cur is aligned */
41                  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,                  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
42                  0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17                                                             0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17),
         ),  
43          (vector unsigned char)( /* Used when cur is unaligned */          (vector unsigned char)( /* Used when cur is unaligned */
44                  0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,                  0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
45                  0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f                                                             0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f),
         ),  
46  };  };
47    
48  #ifdef G_REG  #ifdef G_REG
49  void sadInit_altivec(void)  void
50    sadInit_altivec(void)
51  {  {
52          perm0 = perms[0];          perm0 = perms[0];
53          perm1 = perms[1];          perm1 = perms[1];
54          zerovec = (vector unsigned int)(0);          zerovec = (vector unsigned int)(0);
55  }  }
56  static inline const vector unsigned char get_perm(unsigned long i)  static inline const vector unsigned char
57    get_perm(unsigned long i)
58  {  {
59          return i ? perm1 : perm0;          return i ? perm1 : perm0;
60  }  }
61    
62  #define ZERODEF  #define ZERODEF
63  #define ZEROVEC zerovec  #define ZEROVEC zerovec
64  #else  #else
65  void sadInit_altivec(void) { }  void
66  static inline const vector unsigned char get_perm(unsigned long i)  sadInit_altivec(void)
67    {
68    }
69    static inline const vector unsigned char
70    get_perm(unsigned long i)
71  {  {
72          return perms[i];          return perms[i];
73  }  }
74    
75  #define ZERODEF vector unsigned int zerovec = (vector unsigned int)(0)  #define ZERODEF vector unsigned int zerovec = (vector unsigned int)(0)
76  #define ZEROVEC zerovec  #define ZEROVEC zerovec
77  #endif  #endif
# Line 93  Line 99 
99    vector unsigned int sad;    vector unsigned int sad;
100    vector signed int sumdiffs, best_vec;    vector signed int sumdiffs, best_vec;
101    unsigned long result;    unsigned long result;
102    
103    ZERODEF;    ZERODEF;
104    
105  #ifdef DEBUG  #ifdef DEBUG
# Line 170  Line 177 
177    vector unsigned char perm_cur;    vector unsigned char perm_cur;
178    vector unsigned char perm_ref1, perm_ref2;    vector unsigned char perm_ref1, perm_ref2;
179    unsigned long result;    unsigned long result;
180    
181    ZERODEF;    ZERODEF;
182    
183  #ifdef DEBUG  #ifdef DEBUG
# Line 222  Line 230 
230    vector unsigned char t2,t3,t4, mn;    vector unsigned char t2,t3,t4, mn;
231    vector unsigned int mean, dev;    vector unsigned int mean, dev;
232    vector signed int sumdiffs;    vector signed int sumdiffs;
233    vector unsigned char c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15;          vector unsigned char c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
234                    c13, c14, c15;
235    unsigned long result;    unsigned long result;
236    
237    ZERODEF;    ZERODEF;
238    
239    mean = (vector unsigned int)(ZEROVEC);    mean = (vector unsigned int)(ZEROVEC);
# Line 248  Line 258 
258    MEAN16(15);    MEAN16(15);
259    
260    sumdiffs = vec_sums((vector signed int) mean, (vector signed int) ZEROVEC);    sumdiffs = vec_sums((vector signed int) mean, (vector signed int) ZEROVEC);
261    mn = vec_perm((vector unsigned char)sumdiffs, (vector unsigned char)sumdiffs,          mn = vec_perm((vector unsigned char) sumdiffs,
262          (vector unsigned char)(14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14));                                    (vector unsigned char) sumdiffs, (vector unsigned char) (14,
263                                                                                                                                                       14,
264                                                                                                                                                       14,
265                                                                                                                                                       14,
266                                                                                                                                                       14,
267                                                                                                                                                       14,
268                                                                                                                                                       14,
269                                                                                                                                                       14,
270                                                                                                                                                       14,
271                                                                                                                                                       14,
272                                                                                                                                                       14,
273                                                                                                                                                       14,
274                                                                                                                                                       14,
275                                                                                                                                                       14,
276                                                                                                                                                       14,
277                                                                                                                                                       14));
278    DEV16(0);    DEV16(0);
279    DEV16(1);    DEV16(1);
280    DEV16(2);    DEV16(2);

Legend:
Removed from v.115  
changed lines
  Added in v.195

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4