comparison libswscale/swscale_altivec_template.c @ 27158:65b8334df960

spelling/grammar/wording overhaul
author diego
date Fri, 04 Jul 2008 13:49:45 +0000
parents 4ffa92294ee7
children 3bc8263972a3
comparison
equal deleted inserted replaced
27157:e2797c291ba9 27158:65b8334df960
243 (vector signed short)(vec_mergeh((vector unsigned char)vzero, src_vF)); 243 (vector signed short)(vec_mergeh((vector unsigned char)vzero, src_vF));
244 // now put our elements in the even slots 244 // now put our elements in the even slots
245 src_v = vec_mergeh(src_v, (vector signed short)vzero); 245 src_v = vec_mergeh(src_v, (vector signed short)vzero);
246 246
247 filter_v = vec_ld(i << 3, filter); 247 filter_v = vec_ld(i << 3, filter);
248 // the 3 above is 2 (filterSize == 4) + 1 (sizeof(short) == 2) 248 // The 3 above is 2 (filterSize == 4) + 1 (sizeof(short) == 2).
249 249
250 // the neat trick : we only care for half the elements, 250 // The neat trick: We only care for half the elements,
251 // high or low depending on (i<<3)%16 (it's 0 or 8 here), 251 // high or low depending on (i<<3)%16 (it's 0 or 8 here),
252 // and we're going to use vec_mule, so we chose 252 // and we're going to use vec_mule, so we choose
253 // carefully how to "unpack" the elements into the even slots 253 // carefully how to "unpack" the elements into the even slots.
254 if ((i << 3) % 16) 254 if ((i << 3) % 16)
255 filter_v = vec_mergel(filter_v, (vector signed short)vzero); 255 filter_v = vec_mergel(filter_v, (vector signed short)vzero);
256 else 256 else
257 filter_v = vec_mergeh(filter_v, (vector signed short)vzero); 257 filter_v = vec_mergeh(filter_v, (vector signed short)vzero);
258 258
403 if (width&15) { 403 if (width&15) {
404 yv12toyuy2(ysrc, usrc, vsrc, dst, c->srcW, srcSliceH, lumStride, chromStride, dstStride); 404 yv12toyuy2(ysrc, usrc, vsrc, dst, c->srcW, srcSliceH, lumStride, chromStride, dstStride);
405 return srcSliceH; 405 return srcSliceH;
406 } 406 }
407 407
408 /* this code assume: 408 /* This code assumes:
409 409
410 1) dst is 16 bytes-aligned 410 1) dst is 16 bytes-aligned
411 2) dstStride is a multiple of 16 411 2) dstStride is a multiple of 16
412 3) width is a multiple of 16 412 3) width is a multiple of 16
413 4) lum&chrom stride are multiple of 8 413 4) lum & chrom stride are multiples of 8
414 */ 414 */
415 415
416 for (y=0; y<height; y++) { 416 for (y=0; y<height; y++) {
417 int i; 417 int i;
418 for (i = 0; i < width - 31; i+= 32) { 418 for (i = 0; i < width - 31; i+= 32) {
480 if (width&15) { 480 if (width&15) {
481 yv12touyvy(ysrc, usrc, vsrc, dst, c->srcW, srcSliceH, lumStride, chromStride, dstStride); 481 yv12touyvy(ysrc, usrc, vsrc, dst, c->srcW, srcSliceH, lumStride, chromStride, dstStride);
482 return srcSliceH; 482 return srcSliceH;
483 } 483 }
484 484
485 /* this code assume: 485 /* This code assumes:
486 486
487 1) dst is 16 bytes-aligned 487 1) dst is 16 bytes-aligned
488 2) dstStride is a multiple of 16 488 2) dstStride is a multiple of 16
489 3) width is a multiple of 16 489 3) width is a multiple of 16
490 4) lum&chrom stride are multiple of 8 490 4) lum & chrom stride are multiples of 8
491 */ 491 */
492 492
493 for (y=0; y<height; y++) { 493 for (y=0; y<height; y++) {
494 int i; 494 int i;
495 for (i = 0; i < width - 31; i+= 32) { 495 for (i = 0; i < width - 31; i+= 32) {