Mercurial > libavcodec.hg
comparison i386/h264dsp_mmx.c @ 6334:bf8c9e82c7ad libavcodec
fix aliasing warnings. simpler too.
author | lorenm |
---|---|
date | Wed, 06 Feb 2008 04:14:07 +0000 |
parents | c57670e07668 |
children | 950811a14eb3 |
comparison
equal
deleted
inserted
replaced
6333:beb52d4a5efe | 6334:bf8c9e82c7ad |
---|---|
1679 static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ | 1679 static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
1680 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, src+1, stride, stride);\ | 1680 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, src+1, stride, stride);\ |
1681 }\ | 1681 }\ |
1682 \ | 1682 \ |
1683 static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ | 1683 static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
1684 DECLARE_ALIGNED(ALIGN, uint64_t, temp[SIZE*SIZE/8]);\ | 1684 DECLARE_ALIGNED(ALIGN, uint8_t, temp[SIZE*SIZE]);\ |
1685 uint8_t * const half= (uint8_t*)temp;\ | 1685 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\ |
1686 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(half, src, SIZE, stride);\ | 1686 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, temp, stride, stride, SIZE);\ |
1687 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, half, stride, stride, SIZE);\ | |
1688 }\ | 1687 }\ |
1689 \ | 1688 \ |
1690 static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ | 1689 static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
1691 OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## MMX(dst, src, stride, stride);\ | 1690 OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## MMX(dst, src, stride, stride);\ |
1692 }\ | 1691 }\ |
1693 \ | 1692 \ |
1694 static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ | 1693 static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
1695 DECLARE_ALIGNED(ALIGN, uint64_t, temp[SIZE*SIZE/8]);\ | 1694 DECLARE_ALIGNED(ALIGN, uint8_t, temp[SIZE*SIZE]);\ |
1696 uint8_t * const half= (uint8_t*)temp;\ | 1695 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\ |
1697 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(half, src, SIZE, stride);\ | 1696 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+stride, temp, stride, stride, SIZE);\ |
1698 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+stride, half, stride, stride, SIZE);\ | |
1699 }\ | 1697 }\ |
1700 \ | 1698 \ |
1701 static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ | 1699 static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
1702 DECLARE_ALIGNED(ALIGN, uint64_t, temp[SIZE*SIZE/8]);\ | 1700 DECLARE_ALIGNED(ALIGN, uint8_t, temp[SIZE*SIZE]);\ |
1703 uint8_t * const halfV= (uint8_t*)temp;\ | 1701 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\ |
1704 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src, SIZE, stride);\ | 1702 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, temp, stride, SIZE);\ |
1705 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, halfV, stride, SIZE);\ | |
1706 }\ | 1703 }\ |
1707 \ | 1704 \ |
1708 static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ | 1705 static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
1709 DECLARE_ALIGNED(ALIGN, uint64_t, temp[SIZE*SIZE/8]);\ | 1706 DECLARE_ALIGNED(ALIGN, uint8_t, temp[SIZE*SIZE]);\ |
1710 uint8_t * const halfV= (uint8_t*)temp;\ | 1707 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, SIZE, stride);\ |
1711 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src+1, SIZE, stride);\ | 1708 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, temp, stride, SIZE);\ |
1712 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, halfV, stride, SIZE);\ | |
1713 }\ | 1709 }\ |
1714 \ | 1710 \ |
1715 static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ | 1711 static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
1716 DECLARE_ALIGNED(ALIGN, uint64_t, temp[SIZE*SIZE/8]);\ | 1712 DECLARE_ALIGNED(ALIGN, uint8_t, temp[SIZE*SIZE]);\ |
1717 uint8_t * const halfV= (uint8_t*)temp;\ | 1713 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\ |
1718 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src, SIZE, stride);\ | 1714 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, temp, stride, SIZE);\ |
1719 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, halfV, stride, SIZE);\ | |
1720 }\ | 1715 }\ |
1721 \ | 1716 \ |
1722 static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ | 1717 static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
1723 DECLARE_ALIGNED(ALIGN, uint64_t, temp[SIZE*SIZE/8]);\ | 1718 DECLARE_ALIGNED(ALIGN, uint8_t, temp[SIZE*SIZE]);\ |
1724 uint8_t * const halfV= (uint8_t*)temp;\ | 1719 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, SIZE, stride);\ |
1725 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src+1, SIZE, stride);\ | 1720 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, temp, stride, SIZE);\ |
1726 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, halfV, stride, SIZE);\ | |
1727 }\ | 1721 }\ |
1728 \ | 1722 \ |
1729 static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ | 1723 static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
1730 DECLARE_ALIGNED(ALIGN, uint64_t, temp[SIZE*(SIZE<8?12:24)/4]);\ | 1724 DECLARE_ALIGNED(ALIGN, uint16_t, temp[SIZE*(SIZE<8?12:24)]);\ |
1731 int16_t * const tmp= (int16_t*)temp;\ | 1725 OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(dst, temp, src, stride, SIZE, stride);\ |
1732 OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(dst, tmp, src, stride, SIZE, stride);\ | |
1733 }\ | 1726 }\ |
1734 \ | 1727 \ |
1735 static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ | 1728 static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
1736 DECLARE_ALIGNED(ALIGN, uint64_t, temp[SIZE*(SIZE<8?12:24)/4 + SIZE*SIZE/8]);\ | 1729 DECLARE_ALIGNED(ALIGN, uint8_t, temp[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE]);\ |
1737 uint8_t * const halfHV= (uint8_t*)temp;\ | 1730 uint8_t * const halfHV= temp;\ |
1738 int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE/2;\ | 1731 int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\ |
1739 assert(((int)temp & 7) == 0);\ | 1732 assert(((int)temp & 7) == 0);\ |
1740 put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, tmp, src, SIZE, SIZE, stride);\ | 1733 put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\ |
1741 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, halfHV, stride, SIZE);\ | 1734 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, halfHV, stride, SIZE);\ |
1742 }\ | 1735 }\ |
1743 \ | 1736 \ |
1744 static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ | 1737 static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
1745 DECLARE_ALIGNED(ALIGN, uint64_t, temp[SIZE*(SIZE<8?12:24)/4 + SIZE*SIZE/8]);\ | 1738 DECLARE_ALIGNED(ALIGN, uint8_t, temp[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE]);\ |
1746 uint8_t * const halfHV= (uint8_t*)temp;\ | 1739 uint8_t * const halfHV= temp;\ |
1747 int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE/2;\ | 1740 int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\ |
1748 assert(((int)temp & 7) == 0);\ | 1741 assert(((int)temp & 7) == 0);\ |
1749 put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, tmp, src, SIZE, SIZE, stride);\ | 1742 put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\ |
1750 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, halfHV, stride, SIZE);\ | 1743 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, halfHV, stride, SIZE);\ |
1751 }\ | 1744 }\ |
1752 \ | 1745 \ |
1753 static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ | 1746 static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
1754 DECLARE_ALIGNED(ALIGN, uint64_t, temp[SIZE*(SIZE<8?12:24)/4 + SIZE*SIZE/8]);\ | 1747 DECLARE_ALIGNED(ALIGN, uint8_t, temp[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE]);\ |
1755 int16_t * const halfV= ((int16_t*)temp) + SIZE*SIZE/2;\ | 1748 uint8_t * const halfHV= temp;\ |
1756 uint8_t * const halfHV= ((uint8_t*)temp);\ | 1749 int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\ |
1757 assert(((int)temp & 7) == 0);\ | 1750 assert(((int)temp & 7) == 0);\ |
1758 put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\ | 1751 put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\ |
1759 OPNAME ## pixels ## SIZE ## _l2_shift5_ ## MMX(dst, halfV+2, halfHV, stride, SIZE, SIZE);\ | 1752 OPNAME ## pixels ## SIZE ## _l2_shift5_ ## MMX(dst, halfV+2, halfHV, stride, SIZE, SIZE);\ |
1760 }\ | 1753 }\ |
1761 \ | 1754 \ |
1762 static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ | 1755 static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
1763 DECLARE_ALIGNED(ALIGN, uint64_t, temp[SIZE*(SIZE<8?12:24)/4 + SIZE*SIZE/8]);\ | 1756 DECLARE_ALIGNED(ALIGN, uint8_t, temp[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE]);\ |
1764 int16_t * const halfV= ((int16_t*)temp) + SIZE*SIZE/2;\ | 1757 uint8_t * const halfHV= temp;\ |
1765 uint8_t * const halfHV= ((uint8_t*)temp);\ | 1758 int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\ |
1766 assert(((int)temp & 7) == 0);\ | 1759 assert(((int)temp & 7) == 0);\ |
1767 put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\ | 1760 put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\ |
1768 OPNAME ## pixels ## SIZE ## _l2_shift5_ ## MMX(dst, halfV+3, halfHV, stride, SIZE, SIZE);\ | 1761 OPNAME ## pixels ## SIZE ## _l2_shift5_ ## MMX(dst, halfV+3, halfHV, stride, SIZE, SIZE);\ |
1769 }\ | 1762 }\ |
1770 | 1763 |