Ticket #5324: mythtv-vid-17.diff
File mythtv-vid-17.diff, 22.8 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/openglcontext.cpp
diff -ur -X excl mythtv-vid-16/libs/libmythtv/openglcontext.cpp mythtv-vid-17/libs/libmythtv/openglcontext.cpp
old new 785 785 pboMemory = gMythGLMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 786 786 GL_WRITE_ONLY); 787 787 788 pack_yv12alpha(frame, (unsigned char *)pboMemory, alpha); 788 if (frame->interlaced_frame) 789 { 790 pack_yv12interlaced(frame->buf, (unsigned char *)pboMemory, 791 frame->offsets, frame->pitches, 792 QSize(frame->width, frame->height)); 793 } 794 else 795 { 796 pack_yv12alpha(frame->buf, (unsigned char *)pboMemory, 797 frame->offsets, frame->pitches, 798 QSize(frame->width, frame->height), alpha); 799 } 789 800 790 801 gMythGLUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB); 791 802 -
libs/libmythtv/openglvideo.cpp
diff -ur -X excl mythtv-vid-16/libs/libmythtv/openglvideo.cpp mythtv-vid-17/libs/libmythtv/openglvideo.cpp
old new 667 667 FMT_YV12 == format && alpha) 668 668 { 669 669 VideoFrame frame; 670 frame.interlaced_frame = false; 670 671 frame.codec = FMT_YV12; 671 672 frame.buf = (unsigned char *)buf; 672 673 frame.width = size.width(); -
libs/libmythtv/util-opengl.cpp
diff -ur -X excl mythtv-vid-16/libs/libmythtv/util-opengl.cpp mythtv-vid-17/libs/libmythtv/util-opengl.cpp
old new 440 440 } 441 441 442 442 #ifdef MMX 443 static inline void mmx_pack_alpha_high(uint8_t *a1, uint8_t *a2) 443 static inline void mmx_pack_alpha_high(uint8_t *a1, uint8_t *a2, 444 uint8_t *y1, uint8_t *y2) 444 445 { 445 446 movq_m2r (*a1, mm4); 446 punpckhbw_ r2r (mm0, mm4);447 punpckhbw_m2r (*y1, mm4); 447 448 movq_m2r (*a2, mm7); 448 punpckhbw_ r2r (mm1, mm7);449 punpckhbw_m2r (*y2, mm7); 449 450 } 450 451 451 static inline void mmx_pack_alpha_low(uint8_t *a1, uint8_t *a2) 452 static inline void mmx_pack_alpha_low(uint8_t *a1, uint8_t *a2, 453 uint8_t *y1, uint8_t *y2) 452 454 { 453 455 movq_m2r (*a1, mm4); 454 punpcklbw_ r2r (mm0, mm4);456 punpcklbw_m2r (*y1, mm4); 455 457 movq_m2r (*a2, mm7); 456 punpcklbw_ r2r (mm1, mm7);458 punpcklbw_m2r (*y2, mm7); 457 459 } 458 460 459 461 static mmx_t mmx_1s = {0xffffffffffffffffLL}; 460 462 461 static inline void mmx_pack_alpha1s_high( void)463 static inline void mmx_pack_alpha1s_high(uint8_t *y1, uint8_t *y2) 462 464 { 463 465 movq_m2r (mmx_1s, mm4); 464 punpckhbw_ r2r (mm0, mm4);466 punpckhbw_m2r (*y1, mm4); 465 467 movq_m2r (mmx_1s, mm7); 466 punpckhbw_ r2r (mm1, mm7);468 punpckhbw_m2r (*y2, mm7); 467 469 } 468 470 469 static inline void mmx_pack_alpha1s_low( void)471 static inline void mmx_pack_alpha1s_low(uint8_t *y1, uint8_t *y2) 470 472 { 471 473 movq_m2r (mmx_1s, mm4); 472 punpcklbw_ r2r (mm0, mm4);474 punpcklbw_m2r (*y1, mm4); 473 475 movq_m2r (mmx_1s, mm7); 474 punpcklbw_r2r (mm1, mm7); 475 } 476 477 static inline void mmx_pack_start(uint8_t *y1, uint8_t *y2, 478 uint8_t *u, uint8_t *v, 479 uint8_t *dest1, uint8_t *dest2) 480 { 481 movq_m2r (*y1, mm0); 482 movq_m2r (*y2, mm1); 483 movd_m2r (*u, mm2); 484 movd_m2r (*v, mm3); 485 486 punpcklbw_r2r (mm2, mm2); 487 punpcklbw_r2r (mm3, mm3); 476 punpcklbw_m2r (*y2, mm7); 488 477 } 489 478 490 479 static inline void mmx_pack_middle(uint8_t *dest1, uint8_t *dest2) … … 511 500 512 501 static inline void mmx_pack_end(uint8_t *dest1, uint8_t *dest2) 513 502 { 514 movq_r2r (mm3, mm5); 515 punpckhbw_r2r (mm2, mm5); 503 punpckhbw_r2r (mm2, mm3); 516 504 517 movq_r2r (mm 5, mm6);505 movq_r2r (mm3, mm6); 518 506 punpcklbw_r2r (mm4, mm6); 519 507 movq_r2m (mm6, *(dest1 + 16)); 520 508 521 movq_r2r (mm 5, mm6);509 movq_r2r (mm3, mm6); 522 510 punpckhbw_r2r (mm4, mm6); 523 511 movq_r2m (mm6, *(dest1 + 24)); 524 512 525 movq_r2r (mm 5, mm6);513 movq_r2r (mm3, mm6); 526 514 punpcklbw_r2r (mm7, mm6); 527 515 movq_r2m (mm6, *(dest2 + 16)); 528 516 517 punpckhbw_r2r (mm7, mm3); 518 movq_r2m (mm3, *(dest2 + 24)); 519 } 520 521 static inline void mmx_pack_easy(uint8_t *dest, uint8_t *y) 522 { 523 movq_m2r (mmx_1s, mm4); 524 punpcklbw_m2r (*y, mm4); 525 526 movq_r2r (mm3, mm5); 527 punpcklbw_r2r (mm2, mm5); 528 529 529 movq_r2r (mm5, mm6); 530 punpckhbw_r2r (mm7, mm6); 531 movq_r2m (mm6, *(dest2 + 24)); 530 punpcklbw_r2r (mm4, mm6); 531 movq_r2m (mm6, *(dest)); 532 533 movq_r2r (mm5, mm6); 534 punpckhbw_r2r (mm4, mm6); 535 movq_r2m (mm6, *(dest + 8)); 536 537 movq_m2r (mmx_1s, mm4); 538 punpckhbw_m2r (*y, mm4); 539 540 punpckhbw_r2r (mm2, mm3); 541 542 movq_r2r (mm3, mm6); 543 punpcklbw_r2r (mm4, mm6); 544 movq_r2m (mm6, *(dest + 16)); 545 546 punpckhbw_r2r (mm4, mm3); 547 movq_r2m (mm3, *(dest + 24)); 548 } 549 550 static mmx_t mmx_0s = {0x0000000000000000LL}; 551 static mmx_t round = {0x0002000200020002LL}; 552 553 static inline void mmx_interp_start(uint8_t *left, uint8_t *right) 554 { 555 movd_m2r (*left, mm5); 556 punpcklbw_m2r (mmx_0s, mm5); 557 558 movq_r2r (mm5, mm4); 559 paddw_r2r (mm4, mm4); 560 paddw_r2r (mm5, mm4); 561 paddw_m2r (round, mm4); 562 563 movd_m2r (*right, mm5); 564 punpcklbw_m2r (mmx_0s, mm5); 565 paddw_r2r (mm5, mm4); 566 567 psrlw_i2r (2, mm4); 568 } 569 570 static inline void mmx_interp_endu(void) 571 { 572 movq_r2r (mm4, mm2); 573 psllw_i2r (8, mm2); 574 paddb_r2r (mm4, mm2); 575 } 576 577 static inline void mmx_interp_endv(void) 578 { 579 movq_r2r (mm4, mm3); 580 psllw_i2r (8, mm3); 581 paddb_r2r (mm4, mm3); 582 } 583 584 static inline void mmx_pack_chroma(uint8_t *u, uint8_t *v) 585 { 586 movd_m2r (*u, mm2); 587 movd_m2r (*v, mm3); 588 punpcklbw_r2r (mm2, mm2); 589 punpcklbw_r2r (mm3, mm3); 532 590 } 533 591 #endif // MMX 534 592 535 void pack_yv12alpha(const VideoFrame *frame, 536 const unsigned char *buf, 593 static inline void c_interp(uint8_t *dest, uint8_t *a, uint8_t *b, 594 uint8_t *c, uint8_t *d) 595 { 596 unsigned int tmp = (unsigned int) *a; 597 tmp *= 3; 598 tmp += 2; 599 tmp += (unsigned int) *c; 600 dest[0] = (uint8_t) (tmp >> 2); 601 602 tmp = (unsigned int) *b; 603 tmp *= 3; 604 tmp += 2; 605 tmp += (unsigned int) *d; 606 dest[1] = (uint8_t) (tmp >> 2); 607 608 tmp = (unsigned int) *c; 609 tmp *= 3; 610 tmp += 2; 611 tmp += (unsigned int) *a; 612 dest[2] = (uint8_t) (tmp >> 2); 613 614 tmp = (unsigned int) *d; 615 tmp *= 3; 616 tmp += 2; 617 tmp += (unsigned int) *b; 618 dest[3] = (uint8_t) (tmp >> 2); 619 } 620 621 void pack_yv12alpha(const unsigned char *source, 622 const unsigned char *dest, 623 const int *offsets, 624 const int *pitches, 625 const QSize size, 537 626 const unsigned char *alpha) 538 627 { 539 if (frame->codec != FMT_YV12 || (frame->height % 2)) 628 const int width = size.width(); 629 const int height = size.height(); 630 631 if (height % 2) 540 632 return; 541 633 542 uint bgra_width = frame->width << 2; 543 uint chroma_width = frame->width >> 1; 544 uint u_extra = frame->pitches[1] - chroma_width; 545 uint v_extra = frame->pitches[2] - chroma_width; 546 547 uint8_t *ypt_1 = (uint8_t *)frame->buf + frame->offsets[0]; 548 uint8_t *ypt_2 = ypt_1 + frame->width; 549 uint8_t *upt = (uint8_t *)frame->buf + frame->offsets[1]; 550 uint8_t *vpt = (uint8_t *)frame->buf + frame->offsets[2]; 551 uint8_t *dst_1 = (uint8_t *) buf; 634 uint bgra_width = width << 2; 635 uint chroma_width = width >> 1; 636 uint y_extra = (pitches[0] << 1) - width; 637 uint u_extra = pitches[1] - chroma_width; 638 uint v_extra = pitches[2] - chroma_width; 639 640 uint8_t *ypt_1 = (uint8_t *)source + offsets[0]; 641 uint8_t *ypt_2 = ypt_1 + pitches[0]; 642 uint8_t *upt = (uint8_t *)source + offsets[1]; 643 uint8_t *vpt = (uint8_t *)source + offsets[2]; 644 uint8_t *dst_1 = (uint8_t *) dest; 552 645 uint8_t *dst_2 = dst_1 + bgra_width; 553 646 554 647 if (alpha) 555 648 { 556 649 uint8_t *alpha_1 = (uint8_t *) alpha; 557 uint8_t *alpha_2 = alpha_1 + frame->width;650 uint8_t *alpha_2 = alpha_1 + width; 558 651 559 652 #ifdef MMX 560 if (!( frame->width % 8))653 if (!(width % 8)) 561 654 { 562 for (int row = 0; row < frame->height; row += 2)655 for (int row = 0; row < height; row += 2) 563 656 { 564 for (int col = 0; col < frame->width; col += 8)657 for (int col = 0; col < width; col += 8) 565 658 { 566 mmx_pack_ start(ypt_1, ypt_2, upt, vpt, dst_1, dst_2);567 mmx_pack_alpha_low(alpha_1, alpha_2 );659 mmx_pack_chroma(upt, vpt); 660 mmx_pack_alpha_low(alpha_1, alpha_2, ypt_1, ypt_2); 568 661 mmx_pack_middle(dst_1, dst_2); 569 mmx_pack_alpha_high(alpha_1, alpha_2 );662 mmx_pack_alpha_high(alpha_1, alpha_2, ypt_1, ypt_2); 570 663 mmx_pack_end(dst_1, dst_2); 571 dst_1 += 32; 572 dst_2 += 32; 573 alpha_1 += 8; 574 alpha_2 += 8; 575 ypt_1 += 8; 576 ypt_2 += 8; 577 upt += 4; 578 vpt += 4; 664 665 dst_1 += 32; dst_2 += 32; 666 alpha_1 += 8; alpha_2 += 8; 667 ypt_1 += 8; ypt_2 += 8; 668 upt += 4; vpt += 4; 579 669 } 580 ypt_1 += (frame->pitches[0]); 581 ypt_2 += (frame->pitches[0]); 582 upt += u_extra; 583 vpt += v_extra; 584 dst_1 += bgra_width; 585 dst_2 += bgra_width; 586 alpha_1 += frame->width; 587 alpha_2 += frame->width; 670 671 ypt_1 += y_extra; ypt_2 += y_extra; 672 upt += u_extra; vpt += v_extra; 673 dst_1 += bgra_width; dst_2 += bgra_width; 674 alpha_1 += width; alpha_2 += width; 588 675 } 589 676 590 677 emms(); … … 593 680 } 594 681 #endif //MMX 595 682 596 for (int row = 0; row < frame->height; row += 2)683 for (int row = 0; row < height; row += 2) 597 684 { 598 for (int col = 0; col < frame->width; col += 2)685 for (int col = 0; col < width; col += 2) 599 686 { 600 *(dst_1++) = *vpt; 601 *(dst_2++) = *vpt; 687 *(dst_1++) = *vpt; *(dst_2++) = *vpt; 602 688 *(dst_1++) = *(alpha_1++); 603 689 *(dst_2++) = *(alpha_2++); 604 *(dst_1++) = *upt; 605 *(dst_2++) = *upt; 690 *(dst_1++) = *upt; *(dst_2++) = *upt; 606 691 *(dst_1++) = *(ypt_1++); 607 692 *(dst_2++) = *(ypt_2++); 608 693 609 *(dst_1++) = *vpt; 610 *(dst_2++) = *(vpt++); 694 *(dst_1++) = *vpt; *(dst_2++) = *(vpt++); 611 695 *(dst_1++) = *(alpha_1++); 612 696 *(dst_2++) = *(alpha_2++); 613 *(dst_1++) = *upt; 614 *(dst_2++) = *(upt++); 697 *(dst_1++) = *upt; *(dst_2++) = *(upt++); 615 698 *(dst_1++) = *(ypt_1++); 616 699 *(dst_2++) = *(ypt_2++); 617 700 } 618 ypt_1 += (frame->pitches[0]); 619 ypt_2 += (frame->pitches[0]); 620 upt += u_extra; 621 vpt += v_extra; 622 alpha_1 += frame->width; 623 alpha_2 += frame->width; 624 dst_1 += bgra_width; 625 dst_2 += bgra_width; 701 702 ypt_1 += y_extra; ypt_2 += y_extra; 703 upt += u_extra; vpt += v_extra; 704 alpha_1 += width; alpha_2 += width; 705 dst_1 += bgra_width; dst_2 += bgra_width; 626 706 } 627 707 } 628 708 else 629 709 { 630 710 631 711 #ifdef MMX 632 if (!( frame->width % 8))712 if (!(width % 8)) 633 713 { 634 for (int row = 0; row < frame->height; row += 2)714 for (int row = 0; row < height; row += 2) 635 715 { 636 for (int col = 0; col < frame->width; col += 8)716 for (int col = 0; col < width; col += 8) 637 717 { 638 mmx_pack_ start(ypt_1, ypt_2, upt, vpt, dst_1, dst_2);639 mmx_pack_alpha1s_low( );718 mmx_pack_chroma(upt, vpt); 719 mmx_pack_alpha1s_low(ypt_1, ypt_2); 640 720 mmx_pack_middle(dst_1, dst_2); 641 mmx_pack_alpha1s_high( );721 mmx_pack_alpha1s_high(ypt_1, ypt_2); 642 722 mmx_pack_end(dst_1, dst_2); 643 dst_1 += 32; 644 dst_2 += 32; 645 ypt_1 += 8; 646 ypt_2 += 8; 647 upt += 4; 648 vpt += 4; 723 724 dst_1 += 32; dst_2 += 32; 725 ypt_1 += 8; ypt_2 += 8; 726 upt += 4; vpt += 4; 727 649 728 } 650 ypt_1 += (frame->pitches[0]); 651 ypt_2 += (frame->pitches[0]); 652 upt += u_extra; 653 vpt += v_extra; 654 dst_1 += bgra_width; 655 dst_2 += bgra_width; 729 ypt_1 += y_extra; ypt_2 += y_extra; 730 upt += u_extra; vpt += v_extra; 731 dst_1 += bgra_width; dst_2 += bgra_width; 656 732 } 657 733 658 734 emms(); … … 661 737 } 662 738 #endif //MMX 663 739 664 for (int row = 0; row < frame->height; row += 2)740 for (int row = 0; row < height; row += 2) 665 741 { 666 for (int col = 0; col < frame->width; col += 2)742 for (int col = 0; col < width; col += 2) 667 743 { 668 *(dst_1++) = *vpt; 669 *(dst_2++) = *vpt; 670 *(dst_1++) = 255; 671 *(dst_2++) = 255; 672 *(dst_1++) = *upt; 673 *(dst_2++) = *upt; 744 *(dst_1++) = *vpt; *(dst_2++) = *vpt; 745 *(dst_1++) = 255; *(dst_2++) = 255; 746 *(dst_1++) = *upt; *(dst_2++) = *upt; 674 747 *(dst_1++) = *(ypt_1++); 675 748 *(dst_2++) = *(ypt_2++); 676 749 677 *(dst_1++) = *vpt; 678 *(dst_2++) = *(vpt++); 679 *(dst_1++) = 255; 680 *(dst_2++) = 255; 681 *(dst_1++) = *upt; 682 *(dst_2++) = *(upt++); 750 *(dst_1++) = *vpt; *(dst_2++) = *(vpt++); 751 *(dst_1++) = 255; *(dst_2++) = 255; 752 *(dst_1++) = *upt; *(dst_2++) = *(upt++); 683 753 *(dst_1++) = *(ypt_1++); 684 754 *(dst_2++) = *(ypt_2++); 685 755 } 686 ypt_1 += (frame->pitches[0]); 687 ypt_2 += (frame->pitches[0]); 688 upt += u_extra; 689 vpt += v_extra; 690 dst_1 += bgra_width; 691 dst_2 += bgra_width; 756 ypt_1 += y_extra; ypt_2 += y_extra; 757 upt += u_extra; vpt += v_extra; 758 dst_1 += bgra_width; dst_2 += bgra_width; 692 759 } 693 760 } 694 761 } 695 762 763 void pack_yv12interlaced(const unsigned char *source, 764 const unsigned char *dest, 765 const int *offsets, 766 const int *pitches, 767 const QSize size) 768 { 769 int width = size.width(); 770 int height = size.height(); 771 772 if (height % 4 || width % 2) 773 return; 774 775 uint bgra_width = width << 2; 776 uint dwrap = (bgra_width << 2) - bgra_width; 777 uint chroma_width = width >> 1; 778 uint ywrap = (pitches[0] << 1) - width; 779 uint uwrap = (pitches[1] << 1) - chroma_width; 780 uint vwrap = (pitches[2] << 1) - chroma_width; 781 782 uint8_t *ypt_1 = (uint8_t *)source + offsets[0]; 783 uint8_t *ypt_2 = ypt_1 + pitches[0]; 784 uint8_t *ypt_3 = ypt_1 + (pitches[0] * (height - 2)); 785 uint8_t *ypt_4 = ypt_3 + pitches[0]; 786 787 uint8_t *u1 = (uint8_t *)source + offsets[1]; 788 uint8_t *v1 = (uint8_t *)source + offsets[2]; 789 uint8_t *u2 = u1 + pitches[1]; uint8_t *v2 = v1 + pitches[2]; 790 uint8_t *u3 = u1 + (pitches[1] * ((height - 4) >> 1)); 791 uint8_t *v3 = v1 + (pitches[2] * ((height - 4) >> 1)); 792 uint8_t *u4 = u3 + pitches[1]; uint8_t *v4 = v3 + pitches[2]; 793 794 uint8_t *dst_1 = (uint8_t *) dest; 795 uint8_t *dst_2 = dst_1 + bgra_width; 796 uint8_t *dst_3 = dst_1 + (bgra_width * (height - 2)); 797 uint8_t *dst_4 = dst_3 + bgra_width; 798 799 #ifdef MMX 800 801 if (!(width % 8)) 802 { 803 // pack first 2 and last 2 rows 804 for (int col = 0; col < width; col += 8) 805 { 806 mmx_pack_chroma(u1, v1); 807 mmx_pack_easy(dst_1, ypt_1); 808 mmx_pack_chroma(u2, v2); 809 mmx_pack_easy(dst_2, ypt_2); 810 mmx_pack_chroma(u3, v3); 811 mmx_pack_easy(dst_3, ypt_3); 812 mmx_pack_chroma(u4, v4); 813 mmx_pack_easy(dst_4, ypt_4); 814 815 dst_1 += 32; dst_2 += 32; dst_3 += 32; dst_4 += 32; 816 ypt_1 += 8; ypt_2 += 8; ypt_3 += 8; ypt_4 += 8; 817 u1 += 4; v1 += 4; u2 += 4; v2 += 4; 818 u3 += 4; v3 += 4; u4 += 4; v4 += 4; 819 } 820 821 ypt_1 += ywrap; ypt_2 += ywrap; 822 dst_1 += bgra_width; dst_2 += bgra_width; 823 824 ypt_3 = ypt_2 + pitches[0]; 825 ypt_4 = ypt_3 + pitches[0]; 826 dst_3 = dst_2 + bgra_width; 827 dst_4 = dst_3 + bgra_width; 828 829 ywrap = (pitches[0] << 2) - width; 830 831 u1 = (uint8_t *)source + offsets[1]; 832 v1 = (uint8_t *)source + offsets[2]; 833 u2 = u1 + pitches[1]; v2 = v1 + pitches[2]; 834 u3 = u2 + pitches[1]; v3 = v2 + pitches[2]; 835 u4 = u3 + pitches[1]; v4 = v3 + pitches[2]; 836 837 height -= 4; 838 839 // pack main body 840 for (int row = 0 ; row < height; row += 4) 841 { 842 for (int col = 0; col < width; col += 8) 843 { 844 mmx_interp_start(u1, u3); mmx_interp_endu(); 845 mmx_interp_start(v1, v3); mmx_interp_endv(); 846 mmx_pack_easy(dst_1, ypt_1); 847 848 mmx_interp_start(u2, u4); mmx_interp_endu(); 849 mmx_interp_start(v2, v4); mmx_interp_endv(); 850 mmx_pack_easy(dst_2, ypt_2); 851 852 mmx_interp_start(u3, u1); mmx_interp_endu(); 853 mmx_interp_start(v3, v1); mmx_interp_endv(); 854 mmx_pack_easy(dst_3, ypt_3); 855 856 mmx_interp_start(u4, u2); mmx_interp_endu(); 857 mmx_interp_start(v4, v2); mmx_interp_endv(); 858 mmx_pack_easy(dst_4, ypt_4); 859 860 dst_1 += 32; dst_2 += 32; dst_3 += 32; dst_4 += 32; 861 ypt_1 += 8; ypt_2 += 8; ypt_3 += 8; ypt_4 += 8; 862 u1 += 4; u2 += 4; u3 += 4; u4 += 4; 863 v1 += 4; v2 += 4; v3 += 4; v4 += 4; 864 } 865 866 ypt_1 += ywrap; ypt_2 += ywrap; ypt_3 += ywrap; ypt_4 += ywrap; 867 dst_1 += dwrap; dst_2 += dwrap; dst_3 += dwrap; dst_4 += dwrap; 868 u1 += uwrap; v1 += vwrap; u2 += uwrap; v2 += vwrap; 869 u3 += uwrap; v3 += vwrap; u4 += uwrap;v4 += vwrap; 870 } 871 872 emms(); 873 874 return; 875 } 876 #endif //MMX 877 878 // pack first 2 and last 2 rows 879 for (int col = 0; col < width; col += 2) 880 { 881 *(dst_1++) = *v1; *(dst_2++) = *v2; *(dst_3++) = *v3; *(dst_4++) = *v4; 882 *(dst_1++) = 255; *(dst_2++) = 255; *(dst_3++) = 255; *(dst_4++) = 255; 883 *(dst_1++) = *u1; *(dst_2++) = *u2; *(dst_3++) = *u3; *(dst_4++) = *u4; 884 *(dst_1++) = *(ypt_1++); *(dst_2++) = *(ypt_2++); 885 *(dst_3++) = *(ypt_3++); *(dst_4++) = *(ypt_4++); 886 887 *(dst_1++) = *(v1++); *(dst_2++) = *(v2++); 888 *(dst_3++) = *(v3++); *(dst_4++) = *(v4++); 889 *(dst_1++) = 255; *(dst_2++) = 255; *(dst_3++) = 255; *(dst_4++) = 255; 890 *(dst_1++) = *(u1++); *(dst_2++) = *(u2++); 891 *(dst_3++) = *(u3++); *(dst_4++) = *(u4++); 892 *(dst_1++) = *(ypt_1++); *(dst_2++) = *(ypt_2++); 893 *(dst_3++) = *(ypt_3++); *(dst_4++) = *(ypt_4++); 894 } 895 896 ypt_1 += ywrap; ypt_2 += ywrap; 897 dst_1 += bgra_width; dst_2 += bgra_width; 898 899 ypt_3 = ypt_2 + pitches[0]; 900 ypt_4 = ypt_3 + pitches[0]; 901 dst_3 = dst_2 + bgra_width; 902 dst_4 = dst_3 + bgra_width; 903 904 ywrap = (pitches[0] << 2) - width; 905 906 u1 = (uint8_t *)source + offsets[1]; 907 v1 = (uint8_t *)source + offsets[2]; 908 u2 = u1 + pitches[1]; v2 = v1 + pitches[2]; 909 u3 = u2 + pitches[1]; v3 = v2 + pitches[2]; 910 u4 = u3 + pitches[1]; v4 = v3 + pitches[2]; 911 912 height -= 4; 913 914 uint8_t v[4], u[4]; 915 916 // pack main body 917 for (int row = 0; row < height; row += 4) 918 { 919 for (int col = 0; col < width; col += 2) 920 { 921 c_interp(v, v1, v2, v3, v4); 922 c_interp(u, u1, u2, u3, u4); 923 924 *(dst_1++) = v[0]; *(dst_2++) = v[1]; 925 *(dst_3++) = v[2]; *(dst_4++) = v[3]; 926 *(dst_1++) = 255; *(dst_2++) = 255; *(dst_3++) = 255; *(dst_4++) = 255; 927 *(dst_1++) = u[0]; *(dst_2++) = u[1]; 928 *(dst_3++) = u[2]; *(dst_4++) = u[3]; 929 *(dst_1++) = *(ypt_1++); *(dst_2++) = *(ypt_2++); 930 *(dst_3++) = *(ypt_3++); *(dst_4++) = *(ypt_4++); 931 932 *(dst_1++) = v[0]; *(dst_2++) = v[1]; 933 *(dst_3++) = v[2]; *(dst_4++) = v[3]; 934 *(dst_1++) = 255; *(dst_2++) = 255; *(dst_3++) = 255; *(dst_4++) = 255; 935 *(dst_1++) = u[0]; *(dst_2++) = u[1]; 936 *(dst_3++) = u[2]; *(dst_4++) = u[3]; 937 *(dst_1++) = *(ypt_1++); *(dst_2++) = *(ypt_2++); 938 *(dst_3++) = *(ypt_3++); *(dst_4++) = *(ypt_4++); 939 940 v1++; v2++; v3++; v4++; 941 u1++; u2++; u3++; u4++; 942 } 943 ypt_1 += ywrap; ypt_2 += ywrap; ypt_3 += ywrap; ypt_4 += ywrap; 944 u1 += uwrap; u2 += uwrap; u3 += uwrap; u4 += uwrap; 945 v1 += vwrap; v2 += vwrap; v3 += vwrap; v4 += vwrap; 946 dst_1 += dwrap; dst_2 += dwrap; dst_3 += dwrap; dst_4 += dwrap; 947 } 948 } -
libs/libmythtv/util-opengl.h
diff -ur -X excl mythtv-vid-16/libs/libmythtv/util-opengl.h mythtv-vid-17/libs/libmythtv/util-opengl.h
old new 121 121 int texture, 122 122 int texture_type); 123 123 124 void pack_yv12alpha(const VideoFrame *frame, 125 const unsigned char *buf, 126 const unsigned char *alpha = NULL); 124 void pack_yv12alpha(const unsigned char *source, 125 const unsigned char *dest, 126 const int *offsets, 127 const int *pitches, 128 const QSize size, 129 const unsigned char *alpha = NULL); 130 131 void pack_yv12interlaced(const unsigned char *source, 132 const unsigned char *dest, 133 const int *offsets, 134 const int *pitches, 135 const QSize size); 127 136 128 137 __GLXextFuncPtr get_gl_proc_address(const QString &procName); 129 138