Ticket #2312: patch.diff
File patch.diff, 2.6 KB (added by , 14 years ago) 


yuv2rgb.cpp
682 682 } 683 683 } 684 684 685 static void non_vec_yuv420_2vuy (uint8_t * image, uint8_t * py, 686 uint8_t * pu, uint8_t * pv, 687 int h_size, int v_size, 688 int vuy_stride, int y_stride, int uv_stride) 689 { 690 uint8_t *pi1, *pi2 = image; 691 uint8_t *py1, *py2 = py; 692 693 int x, y; 694 695 for (y = v_size / 2; y; ) 696 { 697 pi1 = pi2; 698 pi2 += h_size * 2; 699 py1 = py2; 700 py2 += h_size; 701 702 for (x = h_size / 2; x; ) 703 { 704 *(pi1)++ = *(pi2)++ = *(pu)++; 705 *(pi1)++ = *(py1)++; *(pi2)++ = *(py2)++; 706 *(pi1)++ = *(pi2)++ = *(pv)++; 707 *(pi1)++ = *(py1)++; *(pi2)++ = *(py2)++; 708 } 709 710 py1 += y_stride; 711 py2 += y_stride; 712 pu += uv_stride; 713 pv += uv_stride; 714 pi1 += vuy_stride; 715 pi2 += vuy_stride; 716 } 717 } 718 685 719 /* YUV420 to VUY2 colorspace conversion routines. 686 720 * 687 721 * In the early days of the OS X port of MythTV, Paul Jara noticed that … … 711 745 712 746 int x,y; 713 747 748 if (!((h_size % 16)  (v_size % 2))) 749 { 714 750 for(y = v_size/2; y; ) 715 751 { 716 752 ibuf1 = ibuf2; … … 781 817 } 782 818 } 783 819 784 #endif // MMX 820 else 821 { 822 // Fall back to C version 823 non_vec_yuv420_2vuy(image, py, pu, pv, h_size, v_size, 824 vuy_stride, y_stride, uv_stride); 825 } 785 826 827 } 786 828 787 static void non_vec_yuv420_2vuy (uint8_t * image, uint8_t * py, 788 uint8_t * pu, uint8_t * pv, 789 int h_size, int v_size, 790 int vuy_stride, int y_stride, int uv_stride) 791 { 792 uint8_t *pi1, *pi2 = image; 793 uint8_t *py1, *py2 = py; 829 #endif // MMX 794 830 795 int x, y;796 831 797 for (y = v_size / 2; y; )798 {799 pi1 = pi2;800 pi2 += h_size * 2;801 py1 = py2;802 py2 += h_size;803 832 804 for (x = h_size / 2; x; )805 {806 *(pi1)++ = *(pi2)++ = *(pu)++;807 *(pi1)++ = *(py1)++; *(pi2)++ = *(py2)++;808 *(pi1)++ = *(pi2)++ = *(pv)++;809 *(pi1)++ = *(py1)++; *(pi2)++ = *(py2)++;810 }811 833 812 py1 += y_stride;813 py2 += y_stride;814 pu += uv_stride;815 pv += uv_stride;816 pi1 += vuy_stride;817 pi2 += vuy_stride;818 }819 }820 821 822 834 #ifdef HAVE_ALTIVEC 823 835 824 836 // Altivec code adapted from VLC's i420_yuv2.c (thanks to Titer and Paul Jara)