comparison vc1dsp.c @ 3665:9d942506b1f2 libavcodec

Drop put_vc1_qpel_pixels_tab as they won't be needed anymore.
author kostya
date Sat, 02 Sep 2006 04:58:51 +0000
parents 1cc5bdadd487
children c8c591fe26f8
comparison
equal deleted inserted replaced
3664:de842f000384 3665:9d942506b1f2
422 422
423 static void ff_put_vc1_mspel_mc33_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { 423 static void ff_put_vc1_mspel_mc33_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
424 vc1_mspel_mc(dst, src, stride, 0xF, rnd); 424 vc1_mspel_mc(dst, src, stride, 0xF, rnd);
425 } 425 }
426 426
427 /** Filter used to interpolate fractional pel values
428 * except for half-pel cases for _mcXY:
429 * A = (4-X)*(4-Y)
430 * B = X *(4-Y)
431 * C = (4-X)* Y
432 * D = X * Y
433 */
434 #define VC1_QPEL_FILTER(src, i, stride, rnd, A, B, C, D) \
435 clip_uint8((A*src[i] + B*src[i+1] + C*src[i+stride] + D*src[i+stride+1] + 8 - rnd) >> 4)
436
437 /* this one is defined in dsputil.c */
438 void ff_put_vc1_qpel_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int rnd);
439
440 static void ff_put_vc1_qpel_mc10_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
441 int i, j;
442 for(j = 0; j < 8; j++) {
443 for(i = 0; i < 8; i++)
444 dst[i] = VC1_QPEL_FILTER(src, i, stride, rnd, 12, 4, 0, 0);
445 dst += stride;
446 src += stride;
447 }
448 }
449
450 static void ff_put_vc1_qpel_mc20_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
451 int i, j;
452 for(j = 0; j < 8; j++) {
453 for(i = 0; i < 8; i++)
454 dst[i] = clip_uint8((src[i] + src[i + 1] + 1 - rnd) >> 1);
455 dst += stride;
456 src += stride;
457 }
458 }
459
460 static void ff_put_vc1_qpel_mc30_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
461 int i, j;
462 for(j = 0; j < 8; j++) {
463 for(i = 0; i < 8; i++)
464 dst[i] = VC1_QPEL_FILTER(src, i, stride, rnd, 4, 12, 0, 0);
465 dst += stride;
466 src += stride;
467 }
468 }
469
470 static void ff_put_vc1_qpel_mc01_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
471 int i, j;
472 for(j = 0; j < 8; j++) {
473 for(i = 0; i < 8; i++)
474 dst[i] = VC1_QPEL_FILTER(src, i, stride, rnd, 12, 0, 4, 0);
475 dst += stride;
476 src += stride;
477 }
478 }
479
480 static void ff_put_vc1_qpel_mc11_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
481 int i, j;
482 for(j = 0; j < 8; j++) {
483 for(i = 0; i < 8; i++)
484 dst[i] = VC1_QPEL_FILTER(src, i, stride, rnd, 9, 3, 3, 1);
485 dst += stride;
486 src += stride;
487 }
488 }
489
490 static void ff_put_vc1_qpel_mc21_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
491 int i, j;
492 for(j = 0; j < 8; j++) {
493 for(i = 0; i < 8; i++)
494 dst[i] = VC1_QPEL_FILTER(src, i, stride, rnd, 6, 6, 2, 2);
495 dst += stride;
496 src += stride;
497 }
498 }
499
500 static void ff_put_vc1_qpel_mc31_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
501 int i, j;
502 for(j = 0; j < 8; j++) {
503 for(i = 0; i < 8; i++)
504 dst[i] = VC1_QPEL_FILTER(src, i, stride, rnd, 3, 9, 1, 3);
505 dst += stride;
506 src += stride;
507 }
508 }
509
510 static void ff_put_vc1_qpel_mc02_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
511 int i, j;
512 for(j = 0; j < 8; j++) {
513 for(i = 0; i < 8; i++)
514 dst[i] = clip_uint8((src[i] + src[i + stride] + 1 - rnd) >> 1);
515 dst += stride;
516 src += stride;
517 }
518 }
519
520 static void ff_put_vc1_qpel_mc12_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
521 int i, j;
522 for(j = 0; j < 8; j++) {
523 for(i = 0; i < 8; i++)
524 dst[i] = VC1_QPEL_FILTER(src, i, stride, rnd, 6, 2, 6, 2);
525 dst += stride;
526 src += stride;
527 }
528 }
529
530 static void ff_put_vc1_qpel_mc22_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
531 int i, j;
532 for(j = 0; j < 8; j++) {
533 for(i = 0; i < 8; i++)
534 dst[i] = clip_uint8((src[i] + src[i + 1] + src[i + stride] + src[i + stride + 1] + 2 - rnd) >> 2);
535 dst += stride;
536 src += stride;
537 }
538 }
539
540 static void ff_put_vc1_qpel_mc32_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
541 int i, j;
542 for(j = 0; j < 8; j++) {
543 for(i = 0; i < 8; i++)
544 dst[i] = VC1_QPEL_FILTER(src, i, stride, rnd, 2, 6, 2, 6);
545 dst += stride;
546 src += stride;
547 }
548 }
549
550 static void ff_put_vc1_qpel_mc03_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
551 int i, j;
552 for(j = 0; j < 8; j++) {
553 for(i = 0; i < 8; i++)
554 dst[i] = VC1_QPEL_FILTER(src, i, stride, rnd, 4, 0, 12, 0);
555 dst += stride;
556 src += stride;
557 }
558 }
559
560 static void ff_put_vc1_qpel_mc13_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
561 int i, j;
562 for(j = 0; j < 8; j++) {
563 for(i = 0; i < 8; i++)
564 dst[i] = VC1_QPEL_FILTER(src, i, stride, rnd, 3, 1, 9, 3);
565 dst += stride;
566 src += stride;
567 }
568 }
569
570 static void ff_put_vc1_qpel_mc23_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
571 int i, j;
572 for(j = 0; j < 8; j++) {
573 for(i = 0; i < 8; i++)
574 dst[i] = VC1_QPEL_FILTER(src, i, stride, rnd, 2, 2, 6, 6);
575 dst += stride;
576 src += stride;
577 }
578 }
579
580 static void ff_put_vc1_qpel_mc33_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
581 int i, j;
582 for(j = 0; j < 8; j++) {
583 for(i = 0; i < 8; i++)
584 dst[i] = VC1_QPEL_FILTER(src, i, stride, rnd, 1, 3, 3, 9);
585 dst += stride;
586 src += stride;
587 }
588 }
589
590 void ff_vc1dsp_init(DSPContext* dsp, AVCodecContext *avctx) { 427 void ff_vc1dsp_init(DSPContext* dsp, AVCodecContext *avctx) {
591 dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_c; 428 dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_c;
592 dsp->vc1_inv_trans_4x8 = vc1_inv_trans_4x8_c; 429 dsp->vc1_inv_trans_4x8 = vc1_inv_trans_4x8_c;
593 dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_c; 430 dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_c;
594 dsp->vc1_inv_trans_4x4 = vc1_inv_trans_4x4_c; 431 dsp->vc1_inv_trans_4x4 = vc1_inv_trans_4x4_c;
609 dsp->put_vc1_mspel_pixels_tab[11] = ff_put_vc1_mspel_mc32_c; 446 dsp->put_vc1_mspel_pixels_tab[11] = ff_put_vc1_mspel_mc32_c;
610 dsp->put_vc1_mspel_pixels_tab[12] = ff_put_vc1_mspel_mc03_c; 447 dsp->put_vc1_mspel_pixels_tab[12] = ff_put_vc1_mspel_mc03_c;
611 dsp->put_vc1_mspel_pixels_tab[13] = ff_put_vc1_mspel_mc13_c; 448 dsp->put_vc1_mspel_pixels_tab[13] = ff_put_vc1_mspel_mc13_c;
612 dsp->put_vc1_mspel_pixels_tab[14] = ff_put_vc1_mspel_mc23_c; 449 dsp->put_vc1_mspel_pixels_tab[14] = ff_put_vc1_mspel_mc23_c;
613 dsp->put_vc1_mspel_pixels_tab[15] = ff_put_vc1_mspel_mc33_c; 450 dsp->put_vc1_mspel_pixels_tab[15] = ff_put_vc1_mspel_mc33_c;
614 451 }
615 dsp->put_vc1_qpel_pixels_tab[ 0] = ff_put_vc1_qpel_mc00_c;
616 dsp->put_vc1_qpel_pixels_tab[ 1] = ff_put_vc1_qpel_mc10_c;
617 dsp->put_vc1_qpel_pixels_tab[ 2] = ff_put_vc1_qpel_mc20_c;
618 dsp->put_vc1_qpel_pixels_tab[ 3] = ff_put_vc1_qpel_mc30_c;
619 dsp->put_vc1_qpel_pixels_tab[ 4] = ff_put_vc1_qpel_mc01_c;
620 dsp->put_vc1_qpel_pixels_tab[ 5] = ff_put_vc1_qpel_mc11_c;
621 dsp->put_vc1_qpel_pixels_tab[ 6] = ff_put_vc1_qpel_mc21_c;
622 dsp->put_vc1_qpel_pixels_tab[ 7] = ff_put_vc1_qpel_mc31_c;
623 dsp->put_vc1_qpel_pixels_tab[ 8] = ff_put_vc1_qpel_mc02_c;
624 dsp->put_vc1_qpel_pixels_tab[ 9] = ff_put_vc1_qpel_mc12_c;
625 dsp->put_vc1_qpel_pixels_tab[10] = ff_put_vc1_qpel_mc22_c;
626 dsp->put_vc1_qpel_pixels_tab[11] = ff_put_vc1_qpel_mc32_c;
627 dsp->put_vc1_qpel_pixels_tab[12] = ff_put_vc1_qpel_mc03_c;
628 dsp->put_vc1_qpel_pixels_tab[13] = ff_put_vc1_qpel_mc13_c;
629 dsp->put_vc1_qpel_pixels_tab[14] = ff_put_vc1_qpel_mc23_c;
630 dsp->put_vc1_qpel_pixels_tab[15] = ff_put_vc1_qpel_mc33_c;
631 }