Revision 582552fb

View differences:

postproc/swscale.c
1724 1724
	//FIXME factorize
1725 1725

  
1726 1726
#ifdef HAVE_ALTIVEC
1727
	yuv2rgb_altivec_init_tables (c, inv_table);
1727
	yuv2rgb_altivec_init_tables (c, inv_table, brightness, contrast, saturation);
1728 1728
#endif	
1729 1729
	return 0;
1730 1730
}
postproc/swscale_internal.h
23 23
#include <altivec.h>
24 24
#endif
25 25

  
26
#ifdef CONFIG_DARWIN
27
#define AVV(x...) (x)
28
#else
29
#define AVV(x...) {x}
30
#endif
31

  
26 32
#include "../mp_msg.h"
27 33

  
28 34
#define MSG_WARN(args...) mp_msg(MSGT_SWS,MSGL_WARN, ##args )
postproc/yuv2rgb_altivec.c
119 119
*/
120 120
static
121 121
const vector unsigned char
122
  perm_rgb_0 = (vector unsigned char)(0x00,0x01,0x10,0x02,0x03,0x11,0x04,0x05,
122
  perm_rgb_0 = (const vector unsigned char)AVV(0x00,0x01,0x10,0x02,0x03,0x11,0x04,0x05,
123 123
				      0x12,0x06,0x07,0x13,0x08,0x09,0x14,0x0a),
124
  perm_rgb_1 = (vector unsigned char)(0x0b,0x15,0x0c,0x0d,0x16,0x0e,0x0f,0x17,
124
  perm_rgb_1 = (const vector unsigned char)AVV(0x0b,0x15,0x0c,0x0d,0x16,0x0e,0x0f,0x17,
125 125
				      0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f),
126
  perm_rgb_2 = (vector unsigned char)(0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
126
  perm_rgb_2 = (const vector unsigned char)AVV(0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
127 127
				      0x00,0x01,0x18,0x02,0x03,0x19,0x04,0x05),
128
  perm_rgb_3 = (vector unsigned char)(0x1a,0x06,0x07,0x1b,0x08,0x09,0x1c,0x0a,
128
  perm_rgb_3 = (const vector unsigned char)AVV(0x1a,0x06,0x07,0x1b,0x08,0x09,0x1c,0x0a,
129 129
				      0x0b,0x1d,0x0c,0x0d,0x1e,0x0e,0x0f,0x1f);
130 130

  
131 131
#define vec_merge3(x2,x1,x0,y0,y1,y2)    \
......
198 198

  
199 199
#define vec_unh(x) \
200 200
  (vector signed short) \
201
    vec_perm(x,(typeof(x))(0),\
202
             (vector unsigned char)(0x10,0x00,0x10,0x01,0x10,0x02,0x10,0x03,\
201
    vec_perm(x,(typeof(x))AVV(0),\
202
             (vector unsigned char)AVV(0x10,0x00,0x10,0x01,0x10,0x02,0x10,0x03,\
203 203
                                    0x10,0x04,0x10,0x05,0x10,0x06,0x10,0x07))
204 204
#define vec_unl(x) \
205 205
  (vector signed short) \
206
    vec_perm(x,(typeof(x))(0),\
207
             (vector unsigned char)(0x10,0x08,0x10,0x09,0x10,0x0A,0x10,0x0B,\
206
    vec_perm(x,(typeof(x))AVV(0),\
207
             (vector unsigned char)AVV(0x10,0x08,0x10,0x09,0x10,0x0A,0x10,0x0B,\
208 208
                                    0x10,0x0C,0x10,0x0D,0x10,0x0E,0x10,0x0F))
209 209

  
210 210
#define vec_clip(x) \
211
  vec_max (vec_min (x, (typeof(x))(255)), (typeof(x))(0))
211
  vec_max (vec_min (x, (typeof(x))AVV(235)), (typeof(x))AVV(16))
212 212

  
213 213
#define vec_packclp_a(x,y) \
214 214
  (vector unsigned char)vec_pack (vec_clip (x), vec_clip (y))
215 215

  
216 216
#define vec_packclp(x,y) \
217 217
  (vector unsigned char)vec_packs \
218
      ((vector unsigned short)vec_max (x,(vector signed short) (0)), \
219
       (vector unsigned short)vec_max (y,(vector signed short) (0)))
218
      ((vector unsigned short)vec_max (x,(vector signed short) AVV(0)), \
219
       (vector unsigned short)vec_max (y,(vector signed short) AVV(0)))
220 220

  
221
//#define out_pixels(a,b,c,ptr) vec_mstrgb32(typeof(a),((typeof (a))(0)),a,a,a,ptr)
221
//#define out_pixels(a,b,c,ptr) vec_mstrgb32(typeof(a),((typeof (a))AVV(0)),a,a,a,ptr)
222 222

  
223 223

  
224 224
static inline void cvtyuvtoRGB (SwsContext *c,
......
228 228
  vector signed   short vx,ux,uvx;
229 229

  
230 230
  Y = vec_mradds (Y, c->CY, c->OY);
231

  
232
  U = vec_sub (U,(vector signed short)(128));
233
  V = vec_sub (V,(vector signed short)(128));
231
  U  = vec_sub (U,(vector signed short)
232
  			vec_splat((vector signed short)AVV(128),0));
233
  V  = vec_sub (V,(vector signed short)
234
  			vec_splat((vector signed short)AVV(128),0));
234 235

  
235 236
  //   ux  = (CBU*(u<<c->CSHIFT)+0x4000)>>15;
236 237
  ux = vec_sl (U, c->CSHIFT);
......
324 325
      align_perm = vec_lvsl (0, vi);					   \
325 326
      v = (vector signed char)vec_perm (vivP[0], vivP[1], align_perm);	   \
326 327
									   \
327
      u  = (vector signed char)vec_sub (u, (vector signed char)(128));	   \
328
      v  = (vector signed char)vec_sub (v, (vector signed char)(128));	   \
328
      u  = (vector signed char)						   \
329
     		vec_sub (u,(vector signed char)                            \
330
				vec_splat((vector signed char)AVV(128),0));\
331
      v  = (vector signed char)						   \
332
     		vec_sub (v,(vector signed char)				   \
333
				vec_splat((vector signed char)AVV(128),0));\
334
									   \
329 335
      U  = vec_unpackh (u);						   \
330 336
      V  = vec_unpackh (v);						   \
331 337
									   \
......
342 348
									   \
343 349
	/*   ux  = (CBU*(u<<CSHIFT)+0x4000)>>15 */			   \
344 350
	ux = vec_sl (U, lCSHIFT);					   \
345
	ux = vec_mradds (ux, lCBU, (vector signed short)(0));		   \
351
	ux = vec_mradds (ux, lCBU, (vector signed short)AVV(0));		   \
346 352
	ux0  = vec_mergeh (ux,ux);					   \
347 353
	ux1  = vec_mergel (ux,ux);					   \
348 354
									   \
349 355
	/* vx  = (CRV*(v<<CSHIFT)+0x4000)>>15;	*/			   \
350 356
	vx = vec_sl (V, lCSHIFT);					   \
351
	vx = vec_mradds (vx, lCRV, (vector signed short)(0));		   \
357
	vx = vec_mradds (vx, lCRV, (vector signed short)AVV(0));		   \
352 358
	vx0  = vec_mergeh (vx,vx);					   \
353 359
	vx1  = vec_mergel (vx,vx);					   \
354 360
									   \
355 361
	/* uvx = ((CGU*u) + (CGV*v))>>15 */				   \
356
	uvx = vec_mradds (U, lCGU, (vector signed short)(0));		   \
362
	uvx = vec_mradds (U, lCGU, (vector signed short)AVV(0));		   \
357 363
	uvx = vec_mradds (V, lCGV, uvx);				   \
358 364
	uvx0 = vec_mergeh (uvx,uvx);					   \
359 365
	uvx1 = vec_mergel (uvx,uvx);					   \
......
403 409
}
404 410

  
405 411

  
406
#define out_abgr(a,b,c,ptr)  vec_mstrgb32(typeof(a),((typeof (a))(0)),c,b,a,ptr)
407
#define out_bgra(a,b,c,ptr)  vec_mstrgb32(typeof(a),c,b,a,((typeof (a))(0)),ptr)
408
#define out_rgba(a,b,c,ptr)  vec_mstrgb32(typeof(a),a,b,c,((typeof (a))(0)),ptr)
409
#define out_argb(a,b,c,ptr)  vec_mstrgb32(typeof(a),((typeof (a))(0)),a,b,c,ptr)
412
#define out_abgr(a,b,c,ptr)  vec_mstrgb32(typeof(a),((typeof (a))AVV(0)),c,b,a,ptr)
413
#define out_bgra(a,b,c,ptr)  vec_mstrgb32(typeof(a),c,b,a,((typeof (a))AVV(0)),ptr)
414
#define out_rgba(a,b,c,ptr)  vec_mstrgb32(typeof(a),a,b,c,((typeof (a))AVV(0)),ptr)
415
#define out_argb(a,b,c,ptr)  vec_mstrgb32(typeof(a),((typeof (a))AVV(0)),a,b,c,ptr)
410 416
#define out_rgb24(a,b,c,ptr) vec_mstrgb24(a,b,c,ptr)
411
#define out_bgr24(a,b,c,ptr) vec_mstrgb24(c,b,a,ptr)
417
#define out_bgr24(a,b,c,ptr) vec_mstbgr24(c,b,a,ptr)
412 418

  
413 419
DEFCSP420_CVT (yuv2_abgr32, out_abgr)
420
#if 1
414 421
DEFCSP420_CVT (yuv2_bgra32, out_argb)
422
#else
423
static int altivec_yuv2_bgra32 (SwsContext *c,                                  
424
				unsigned char **in, int *instrides,	   
425
				int srcSliceY,	int srcSliceH,		   
426
				unsigned char **oplanes, int *outstrides)  
427
{									   
428
  int w = c->srcW;							   
429
  int h = srcSliceH;							   
430
  int i,j;								   
431
  int instrides_scl[3];							   
432
  vector unsigned char y0,y1;						   
433
									   
434
  vector signed char  u,v;						   
435
									   
436
  vector signed short Y0,Y1,Y2,Y3;					   
437
  vector signed short U,V;						   
438
  vector signed short vx,ux,uvx;					   
439
  vector signed short vx0,ux0,uvx0;					   
440
  vector signed short vx1,ux1,uvx1;					   
441
  vector signed short R0,G0,B0;						   
442
  vector signed short R1,G1,B1;						   
443
  vector unsigned char R,G,B;						   
444
									   
445
  vector unsigned char *uivP, *vivP;			   		   
446
  vector unsigned char align_perm;					   
447
									   
448
  vector signed short 							   
449
    lCY  = c->CY,							   
450
    lOY  = c->OY,							   
451
    lCRV = c->CRV,							   
452
    lCBU = c->CBU,							   
453
    lCGU = c->CGU,							   
454
    lCGV = c->CGV;							   
455
									   
456
  vector unsigned short lCSHIFT = c->CSHIFT;				   
457
									   
458
  ubyte *y1i   = in[0];							   
459
  ubyte *y2i   = in[0]+w;						   
460
  ubyte *ui    = in[1];							   
461
  ubyte *vi    = in[2];							   
462
									   
463
  vector unsigned char *oute						   
464
    = (vector unsigned char *)						   
465
        (oplanes[0]+srcSliceY*outstrides[0]);				   
466
  vector unsigned char *outo						   
467
    = (vector unsigned char *)						   
468
        (oplanes[0]+srcSliceY*outstrides[0]+outstrides[0]);		   
469
									   
470
									   
471
  instrides_scl[0] = instrides[0];					   
472
  instrides_scl[1] = instrides[1]-w/2;  /* the loop moves ui by w/2 */	   
473
  instrides_scl[2] = instrides[2]-w/2;  /* the loop moves vi by w/2 */	   
474
									   
475
									   
476
  for (i=0;i<h/2;i++) {							   
477
    vec_dstst (outo, (0x02000002|(((w*3+32)/32)<<16)), 0);                 
478
    vec_dstst (oute, (0x02000002|(((w*3+32)/32)<<16)), 1);                 
479
									   
480
    for (j=0;j<w/16;j++) {						   
481
									   
482
      y0 = vec_ldl (0,y1i);						   
483
      y1 = vec_ldl (0,y2i);						   
484
      uivP = (vector unsigned char *)ui;				   
485
      vivP = (vector unsigned char *)vi;				   
486
									   
487
      align_perm = vec_lvsl (0, ui);					   
488
      u = (vector signed char)vec_perm (uivP[0], uivP[1], align_perm);	   
489
									   
490
      align_perm = vec_lvsl (0, vi);					   
491
      v = (vector signed char)vec_perm (vivP[0], vivP[1], align_perm);
492
      u  = (vector signed char)
493
     		vec_sub (u,(vector signed char)
494
				vec_splat((vector signed char)AVV(128),0));
495
      
496
      v  = (vector signed char)
497
      		vec_sub (v, (vector signed char)
498
				vec_splat((vector signed char)AVV(128),0));
499
      
500
      U  = vec_unpackh (u);						   
501
      V  = vec_unpackh (v);						   
502
									   
503
									   
504
	Y0 = vec_unh (y0);						   
505
	Y1 = vec_unl (y0);						   
506
	Y2 = vec_unh (y1);						   
507
	Y3 = vec_unl (y1);						   
508
									   
509
        Y0 = vec_mradds (Y0, lCY, lOY);					   
510
        Y1 = vec_mradds (Y1, lCY, lOY);					   
511
        Y2 = vec_mradds (Y2, lCY, lOY);					   
512
        Y3 = vec_mradds (Y3, lCY, lOY);					   
513
									   
514
	/*   ux  = (CBU*(u<<CSHIFT)+0x4000)>>15 */			   
515
	ux = vec_sl (U, lCSHIFT);					   
516
	ux = vec_mradds (ux, lCBU, (vector signed short)AVV(0));
517
	ux0  = vec_mergeh (ux,ux);					   
518
	ux1  = vec_mergel (ux,ux);					   
519
									   
520
	/* vx  = (CRV*(v<<CSHIFT)+0x4000)>>15;	*/			   
521
	vx = vec_sl (V, lCSHIFT);					   
522
	vx = vec_mradds (vx, lCRV, (vector signed short)AVV(0));
523
	vx0  = vec_mergeh (vx,vx);
524
	vx1  = vec_mergel (vx,vx);
525
	/* uvx = ((CGU*u) + (CGV*v))>>15 */
526
	uvx = vec_mradds (U, lCGU, (vector signed short)AVV(0));
527
	uvx = vec_mradds (V, lCGV, uvx);
528
	uvx0 = vec_mergeh (uvx,uvx);
529
	uvx1 = vec_mergel (uvx,uvx);
530
	R0 = vec_add (Y0,vx0);
531
	G0 = vec_add (Y0,uvx0);
532
	B0 = vec_add (Y0,ux0);
533
	R1 = vec_add (Y1,vx1);
534
	G1 = vec_add (Y1,uvx1);
535
	B1 = vec_add (Y1,ux1);
536
	R  = vec_packclp (R0,R1);
537
	G  = vec_packclp (G0,G1);
538
	B  = vec_packclp (B0,B1);
539
	
540
	out_argb(R,G,B,oute);
541
	R0 = vec_add (Y2,vx0);
542
	G0 = vec_add (Y2,uvx0);
543
	B0 = vec_add (Y2,ux0);
544
	R1 = vec_add (Y3,vx1);
545
	G1 = vec_add (Y3,uvx1);
546
	B1 = vec_add (Y3,ux1);
547
	R  = vec_packclp (R0,R1);
548
	G  = vec_packclp (G0,G1);
549
	B  = vec_packclp (B0,B1);
550
	
551
	out_argb(R,G,B,outo);
552
	y1i  += 16;							   
553
	y2i  += 16;							   
554
	ui   += 8;
555
	vi   += 8;							   
556
									   
557
    }									   
558
									   
559
    outo += (outstrides[0])>>4;					           
560
    oute += (outstrides[0])>>4;					           
561
									   
562
    ui    += instrides_scl[1];						   
563
    vi    += instrides_scl[2];						   
564
    y1i   += instrides_scl[0];						   
565
    y2i   += instrides_scl[0];						   
566
  }									   
567
  return srcSliceH;							   
568
}
569

  
570
#endif
571

  
572

  
415 573
DEFCSP420_CVT (yuv2_rgba32, out_rgba)
416 574
DEFCSP420_CVT (yuv2_argb32, out_argb)
417 575
DEFCSP420_CVT (yuv2_rgb24,  out_rgb24)
......
422 580
// 0123 4567 89ab cdef
423 581
static
424 582
const vector unsigned char
425
  demux_u = (vector unsigned char)(0x10,0x00,0x10,0x00,
583
  demux_u = (const vector unsigned char)AVV(0x10,0x00,0x10,0x00,
426 584
				   0x10,0x04,0x10,0x04,
427 585
				   0x10,0x08,0x10,0x08,
428 586
				   0x10,0x0c,0x10,0x0c),
429
  demux_v = (vector unsigned char)(0x10,0x02,0x10,0x02,
587
  demux_v = (const vector unsigned char)AVV(0x10,0x02,0x10,0x02,
430 588
				   0x10,0x06,0x10,0x06,
431 589
				   0x10,0x0A,0x10,0x0A,
432 590
				   0x10,0x0E,0x10,0x0E),
433
  demux_y = (vector unsigned char)(0x10,0x01,0x10,0x03,
591
  demux_y = (const vector unsigned char)AVV(0x10,0x01,0x10,0x03,
434 592
				   0x10,0x05,0x10,0x07,
435 593
				   0x10,0x09,0x10,0x0B,
436 594
				   0x10,0x0D,0x10,0x0F);
......
461 619
    for (j=0;j<w/16;j++) {
462 620
      uyvy = vec_ld (0, img);
463 621
      U = (vector signed short)
464
	vec_perm (uyvy, (vector unsigned char)(0), demux_u);
622
	vec_perm (uyvy, (vector unsigned char)AVV(0), demux_u);
465 623

  
466 624
      V = (vector signed short)
467
	vec_perm (uyvy, (vector unsigned char)(0), demux_v);
625
	vec_perm (uyvy, (vector unsigned char)AVV(0), demux_v);
468 626

  
469 627
      Y = (vector signed short)
470
	vec_perm (uyvy, (vector unsigned char)(0), demux_y);
628
	vec_perm (uyvy, (vector unsigned char)AVV(0), demux_y);
471 629

  
472 630
      cvtyuvtoRGB (c, Y,U,V,&R0,&G0,&B0);
473 631

  
474 632
      uyvy = vec_ld (16, img);
475 633
      U = (vector signed short)
476
	vec_perm (uyvy, (vector unsigned char)(0), demux_u);
634
	vec_perm (uyvy, (vector unsigned char)AVV(0), demux_u);
477 635

  
478 636
      V = (vector signed short)
479
	vec_perm (uyvy, (vector unsigned char)(0), demux_v);
637
	vec_perm (uyvy, (vector unsigned char)AVV(0), demux_v);
480 638

  
481 639
      Y = (vector signed short)
482
	vec_perm (uyvy, (vector unsigned char)(0), demux_y);
640
	vec_perm (uyvy, (vector unsigned char)AVV(0), demux_y);
483 641

  
484 642
      cvtyuvtoRGB (c, Y,U,V,&R1,&G1,&B1);
485 643

  
......
564 722
  return NULL;
565 723
}
566 724

  
567
void yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4])
568
{
569
  vector signed short CY, CRV, CBU, CGU, CGV, OY, Y0;
570
  int64_t crv __attribute__ ((aligned(16))) = inv_table[0];
571
  int64_t cbu __attribute__ ((aligned(16))) = inv_table[1];
572
  int64_t cgu __attribute__ ((aligned(16))) = inv_table[2];
573
  int64_t cgv __attribute__ ((aligned(16))) = inv_table[3];
574
  int64_t cy = (1<<16)-1;
575
  int64_t oy = 0;
576
  short tmp __attribute__ ((aligned(16)));
577

  
578
  if ((c->flags & SWS_CPU_CAPS_ALTIVEC) == 0)
579
    return;
580

  
581
  cy = (cy *c->contrast             )>>17;
582
  crv= (crv*c->contrast * c->saturation)>>32;
583
  cbu= (cbu*c->contrast * c->saturation)>>32;
584
  cgu= (cgu*c->contrast * c->saturation)>>32;
585
  cgv= (cgv*c->contrast * c->saturation)>>32;
586

  
587
  oy -= 256*c->brightness;
588

  
589
  tmp = cy;
590
  CY = vec_lde (0, &tmp);
591
  CY  = vec_splat (CY, 0);
592

  
593
  tmp = oy;
594
  OY = vec_lde (0, &tmp);
595
  OY  = vec_splat (OY, 0);
596

  
597
  tmp = crv>>3;
598
  CRV = vec_lde (0, &tmp);
599
  CRV  = vec_splat (CRV, 0);
600
  tmp = cbu>>3;
601
  CBU = vec_lde (0, &tmp);
602
  CBU  = vec_splat (CBU, 0);
603

  
604
  tmp = -(cgu>>1);
605
  CGU = vec_lde (0, &tmp);
606
  CGU  = vec_splat (CGU, 0);
607
  tmp = -(cgv>>1);
608
  CGV = vec_lde (0, &tmp);
609
  CGV  = vec_splat (CGV, 0);
610

  
611
  c->CSHIFT = (vector unsigned short)(2);
612
  c->CY = CY;
613
  c->OY = OY;
614
  c->CRV = CRV;
615
  c->CBU = CBU;
616
  c->CGU = CGU;
617
  c->CGV = CGV;
725
static uint16_t roundToInt16(int64_t f){
726
	int r= (f + (1<<15))>>16;
727
	     if(r<-0x7FFF) return 0x8000;
728
	else if(r> 0x7FFF) return 0x7FFF;
729
	else               return r;
730
}
618 731

  
732
void yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4],int brightness,int contrast, int saturation)
733
{
734
  union {
735
  	signed short tmp[8] __attribute__ ((aligned(16)));
736
	vector signed short vec;
737
	} buf;
738

  
739
  buf.tmp[0] =  ( (0xffffLL) * contrast>>8 )>>9;			//cy
740
  buf.tmp[1] =  -256*brightness;					//oy
741
  buf.tmp[2] =  (inv_table[0]>>3) *(contrast>>16)*(saturation>>16);	//crv
742
  buf.tmp[3] =  (inv_table[1]>>3) *(contrast>>16)*(saturation>>16);	//cbu
743
  buf.tmp[4] = -((inv_table[2]>>1)*(contrast>>16)*(saturation>>16));	//cgu
744
  buf.tmp[5] = -((inv_table[3]>>1)*(contrast>>16)*(saturation>>16));	//cgv
745

  
746

  
747
  c->CSHIFT = (vector unsigned short)vec_splat((vector unsigned short)AVV(2),0);
748
  c->CY  = vec_splat ((vector signed short)buf.vec, 0);
749
  c->OY  = vec_splat ((vector signed short)buf.vec, 1);
750
  c->CRV  = vec_splat ((vector signed short)buf.vec, 2);
751
  c->CBU  = vec_splat ((vector signed short)buf.vec, 3);
752
  c->CGU  = vec_splat ((vector signed short)buf.vec, 4);
753
  c->CGV  = vec_splat ((vector signed short)buf.vec, 5);
619 754
#if 0
620
  printf ("cy:  %hvx\n", CY);
621
  printf ("oy:  %hvx\n", OY);
622
  printf ("crv: %hvx\n", CRV);
623
  printf ("cbu: %hvx\n", CBU);
624
  printf ("cgv: %hvx\n", CGV);
625
  printf ("cgu: %hvx\n", CGU);
755
{
756
int i;
757
char *v[6]={"cy","oy","crv","cbu","cgu","cgv"};
758
for (i=0; i<6;i++)
759
  printf("%s %d ", v[i],buf.tmp[i] );
760
  printf("\n");
761
}
626 762
#endif
627

  
628 763
 return;
629 764
}
630 765

  
......
637 772
{
638 773
  int i,j;
639 774
  short tmp __attribute__((aligned (16)));
640
  short *p;
775
  int16_t *p;
641 776
  short *f;
642 777
  vector signed short X,X0,X1,Y0,U0,V0,Y1,U1,V1,U,V;
643 778
  vector signed short R0,G0,B0,R1,G1,B1;
644 779

  
645 780
  vector unsigned char R,G,B,pels[3];
646 781
  vector unsigned char *out,*nout;
647
  vector signed short   RND = (vector signed short)(1<<3);
648
  vector unsigned short SCL = (vector unsigned short)(4);
782

  
783
  vector signed short   RND = vec_splat((vector signed short)AVV(1<<3),0);
784
  vector unsigned short SCL = vec_splat((vector unsigned short)AVV(4),0);
649 785
  unsigned long scratch[16] __attribute__ ((aligned (16)));
650 786

  
651 787
  vector signed short *vYCoeffsBank, *vCCoeffsBank;

Also available in: Unified diff