comparison dsputil.c @ 1064:b32afefe7d33 libavcodec

* UINTX -> uintx_t INTX -> intx_t
author kabi
date Tue, 11 Feb 2003 16:35:48 +0000
parents 5840ee827cc9
children f59c3f66363b
comparison
equal deleted inserted replaced
1063:fdeac9642346 1064:b32afefe7d33
22 #include "dsputil.h" 22 #include "dsputil.h"
23 #include "mpegvideo.h" 23 #include "mpegvideo.h"
24 24
25 int ff_bit_exact=0; 25 int ff_bit_exact=0;
26 26
27 UINT8 cropTbl[256 + 2 * MAX_NEG_CROP]; 27 uint8_t cropTbl[256 + 2 * MAX_NEG_CROP];
28 UINT32 squareTbl[512]; 28 uint32_t squareTbl[512];
29 29
30 const UINT8 ff_zigzag_direct[64] = { 30 const uint8_t ff_zigzag_direct[64] = {
31 0, 1, 8, 16, 9, 2, 3, 10, 31 0, 1, 8, 16, 9, 2, 3, 10,
32 17, 24, 32, 25, 18, 11, 4, 5, 32 17, 24, 32, 25, 18, 11, 4, 5,
33 12, 19, 26, 33, 40, 48, 41, 34, 33 12, 19, 26, 33, 40, 48, 41, 34,
34 27, 20, 13, 6, 7, 14, 21, 28, 34 27, 20, 13, 6, 7, 14, 21, 28,
35 35, 42, 49, 56, 57, 50, 43, 36, 35 35, 42, 49, 56, 57, 50, 43, 36,
37 58, 59, 52, 45, 38, 31, 39, 46, 37 58, 59, 52, 45, 38, 31, 39, 46,
38 53, 60, 61, 54, 47, 55, 62, 63 38 53, 60, 61, 54, 47, 55, 62, 63
39 }; 39 };
40 40
41 /* not permutated inverse zigzag_direct + 1 for MMX quantizer */ 41 /* not permutated inverse zigzag_direct + 1 for MMX quantizer */
42 UINT16 __align8 inv_zigzag_direct16[64]; 42 uint16_t __align8 inv_zigzag_direct16[64];
43 43
44 const UINT8 ff_alternate_horizontal_scan[64] = { 44 const uint8_t ff_alternate_horizontal_scan[64] = {
45 0, 1, 2, 3, 8, 9, 16, 17, 45 0, 1, 2, 3, 8, 9, 16, 17,
46 10, 11, 4, 5, 6, 7, 15, 14, 46 10, 11, 4, 5, 6, 7, 15, 14,
47 13, 12, 19, 18, 24, 25, 32, 33, 47 13, 12, 19, 18, 24, 25, 32, 33,
48 26, 27, 20, 21, 22, 23, 28, 29, 48 26, 27, 20, 21, 22, 23, 28, 29,
49 30, 31, 34, 35, 40, 41, 48, 49, 49 30, 31, 34, 35, 40, 41, 48, 49,
50 42, 43, 36, 37, 38, 39, 44, 45, 50 42, 43, 36, 37, 38, 39, 44, 45,
51 46, 47, 50, 51, 56, 57, 58, 59, 51 46, 47, 50, 51, 56, 57, 58, 59,
52 52, 53, 54, 55, 60, 61, 62, 63, 52 52, 53, 54, 55, 60, 61, 62, 63,
53 }; 53 };
54 54
55 const UINT8 ff_alternate_vertical_scan[64] = { 55 const uint8_t ff_alternate_vertical_scan[64] = {
56 0, 8, 16, 24, 1, 9, 2, 10, 56 0, 8, 16, 24, 1, 9, 2, 10,
57 17, 25, 32, 40, 48, 56, 57, 49, 57 17, 25, 32, 40, 48, 56, 57, 49,
58 41, 33, 26, 18, 3, 11, 4, 12, 58 41, 33, 26, 18, 3, 11, 4, 12,
59 19, 27, 34, 42, 50, 58, 35, 43, 59 19, 27, 34, 42, 50, 58, 35, 43,
60 51, 59, 20, 28, 5, 13, 6, 14, 60 51, 59, 20, 28, 5, 13, 6, 14,
62 53, 61, 22, 30, 7, 15, 23, 31, 62 53, 61, 22, 30, 7, 15, 23, 31,
63 38, 46, 54, 62, 39, 47, 55, 63, 63 38, 46, 54, 62, 39, 47, 55, 63,
64 }; 64 };
65 65
66 /* a*inverse[b]>>32 == a/b for all 0<=a<=65536 && 2<=b<=255 */ 66 /* a*inverse[b]>>32 == a/b for all 0<=a<=65536 && 2<=b<=255 */
67 const UINT32 inverse[256]={ 67 const uint32_t inverse[256]={
68 0, 4294967295U,2147483648U,1431655766, 1073741824, 858993460, 715827883, 613566757, 68 0, 4294967295U,2147483648U,1431655766, 1073741824, 858993460, 715827883, 613566757,
69 536870912, 477218589, 429496730, 390451573, 357913942, 330382100, 306783379, 286331154, 69 536870912, 477218589, 429496730, 390451573, 357913942, 330382100, 306783379, 286331154,
70 268435456, 252645136, 238609295, 226050911, 214748365, 204522253, 195225787, 186737709, 70 268435456, 252645136, 238609295, 226050911, 214748365, 204522253, 195225787, 186737709,
71 178956971, 171798692, 165191050, 159072863, 153391690, 148102321, 143165577, 138547333, 71 178956971, 171798692, 165191050, 159072863, 153391690, 148102321, 143165577, 138547333,
72 134217728, 130150525, 126322568, 122713352, 119304648, 116080198, 113025456, 110127367, 72 134217728, 130150525, 126322568, 122713352, 119304648, 116080198, 113025456, 110127367,
97 18512791, 18433337, 18354562, 18276457, 18199014, 18122225, 18046082, 17970575, 97 18512791, 18433337, 18354562, 18276457, 18199014, 18122225, 18046082, 17970575,
98 17895698, 17821442, 17747799, 17674763, 17602325, 17530479, 17459217, 17388532, 98 17895698, 17821442, 17747799, 17674763, 17602325, 17530479, 17459217, 17388532,
99 17318417, 17248865, 17179870, 17111424, 17043522, 16976156, 16909321, 16843010, 99 17318417, 17248865, 17179870, 17111424, 17043522, 16976156, 16909321, 16843010,
100 }; 100 };
101 101
102 static int pix_sum_c(UINT8 * pix, int line_size) 102 static int pix_sum_c(uint8_t * pix, int line_size)
103 { 103 {
104 int s, i, j; 104 int s, i, j;
105 105
106 s = 0; 106 s = 0;
107 for (i = 0; i < 16; i++) { 107 for (i = 0; i < 16; i++) {
119 pix += line_size - 16; 119 pix += line_size - 16;
120 } 120 }
121 return s; 121 return s;
122 } 122 }
123 123
124 static int pix_norm1_c(UINT8 * pix, int line_size) 124 static int pix_norm1_c(uint8_t * pix, int line_size)
125 { 125 {
126 int s, i, j; 126 int s, i, j;
127 UINT32 *sq = squareTbl + 256; 127 uint32_t *sq = squareTbl + 256;
128 128
129 s = 0; 129 s = 0;
130 for (i = 0; i < 16; i++) { 130 for (i = 0; i < 16; i++) {
131 for (j = 0; j < 16; j += 8) { 131 for (j = 0; j < 16; j += 8) {
132 #if 0 132 #if 0
168 } 168 }
169 return s; 169 return s;
170 } 170 }
171 171
172 172
173 static int sse8_c(void *v, UINT8 * pix1, UINT8 * pix2, int line_size) 173 static int sse8_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size)
174 { 174 {
175 int s, i; 175 int s, i;
176 UINT32 *sq = squareTbl + 256; 176 uint32_t *sq = squareTbl + 256;
177 177
178 s = 0; 178 s = 0;
179 for (i = 0; i < 8; i++) { 179 for (i = 0; i < 8; i++) {
180 s += sq[pix1[0] - pix2[0]]; 180 s += sq[pix1[0] - pix2[0]];
181 s += sq[pix1[1] - pix2[1]]; 181 s += sq[pix1[1] - pix2[1]];
219 pix2 += line_size; 219 pix2 += line_size;
220 } 220 }
221 return s; 221 return s;
222 } 222 }
223 223
224 static void get_pixels_c(DCTELEM *restrict block, const UINT8 *pixels, int line_size) 224 static void get_pixels_c(DCTELEM *restrict block, const uint8_t *pixels, int line_size)
225 { 225 {
226 int i; 226 int i;
227 227
228 /* read the pixels */ 228 /* read the pixels */
229 for(i=0;i<8;i++) { 229 for(i=0;i<8;i++) {
238 pixels += line_size; 238 pixels += line_size;
239 block += 8; 239 block += 8;
240 } 240 }
241 } 241 }
242 242
243 static void diff_pixels_c(DCTELEM *restrict block, const UINT8 *s1, 243 static void diff_pixels_c(DCTELEM *restrict block, const uint8_t *s1,
244 const UINT8 *s2, int stride){ 244 const uint8_t *s2, int stride){
245 int i; 245 int i;
246 246
247 /* read the pixels */ 247 /* read the pixels */
248 for(i=0;i<8;i++) { 248 for(i=0;i<8;i++) {
249 block[0] = s1[0] - s2[0]; 249 block[0] = s1[0] - s2[0];
259 block += 8; 259 block += 8;
260 } 260 }
261 } 261 }
262 262
263 263
264 static void put_pixels_clamped_c(const DCTELEM *block, UINT8 *restrict pixels, 264 static void put_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels,
265 int line_size) 265 int line_size)
266 { 266 {
267 int i; 267 int i;
268 UINT8 *cm = cropTbl + MAX_NEG_CROP; 268 uint8_t *cm = cropTbl + MAX_NEG_CROP;
269 269
270 /* read the pixels */ 270 /* read the pixels */
271 for(i=0;i<8;i++) { 271 for(i=0;i<8;i++) {
272 pixels[0] = cm[block[0]]; 272 pixels[0] = cm[block[0]];
273 pixels[1] = cm[block[1]]; 273 pixels[1] = cm[block[1]];
281 pixels += line_size; 281 pixels += line_size;
282 block += 8; 282 block += 8;
283 } 283 }
284 } 284 }
285 285
286 static void add_pixels_clamped_c(const DCTELEM *block, UINT8 *restrict pixels, 286 static void add_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels,
287 int line_size) 287 int line_size)
288 { 288 {
289 int i; 289 int i;
290 UINT8 *cm = cropTbl + MAX_NEG_CROP; 290 uint8_t *cm = cropTbl + MAX_NEG_CROP;
291 291
292 /* read the pixels */ 292 /* read the pixels */
293 for(i=0;i<8;i++) { 293 for(i=0;i<8;i++) {
294 pixels[0] = cm[pixels[0] + block[0]]; 294 pixels[0] = cm[pixels[0] + block[0]];
295 pixels[1] = cm[pixels[1] + block[1]]; 295 pixels[1] = cm[pixels[1] + block[1]];
700 700
701 #define avg2(a,b) ((a+b+1)>>1) 701 #define avg2(a,b) ((a+b+1)>>1)
702 #define avg4(a,b,c,d) ((a+b+c+d+2)>>2) 702 #define avg4(a,b,c,d) ((a+b+c+d+2)>>2)
703 703
704 704
705 static void gmc1_c(UINT8 *dst, UINT8 *src, int stride, int h, int x16, int y16, int rounder) 705 static void gmc1_c(uint8_t *dst, uint8_t *src, int stride, int h, int x16, int y16, int rounder)
706 { 706 {
707 const int A=(16-x16)*(16-y16); 707 const int A=(16-x16)*(16-y16);
708 const int B=( x16)*(16-y16); 708 const int B=( x16)*(16-y16);
709 const int C=(16-x16)*( y16); 709 const int C=(16-x16)*( y16);
710 const int D=( x16)*( y16); 710 const int D=( x16)*( y16);
723 dst+= stride; 723 dst+= stride;
724 src+= stride; 724 src+= stride;
725 } 725 }
726 } 726 }
727 727
728 static void gmc_c(UINT8 *dst, UINT8 *src, int stride, int h, int ox, int oy, 728 static void gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
729 int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height) 729 int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height)
730 { 730 {
731 int y, vx, vy; 731 int y, vx, vy;
732 const int s= 1<<shift; 732 const int s= 1<<shift;
733 733
781 ox += dxy; 781 ox += dxy;
782 oy += dyy; 782 oy += dyy;
783 } 783 }
784 } 784 }
785 785
786 static inline void copy_block17(UINT8 *dst, UINT8 *src, int dstStride, int srcStride, int h) 786 static inline void copy_block17(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
787 { 787 {
788 int i; 788 int i;
789 for(i=0; i<h; i++) 789 for(i=0; i<h; i++)
790 { 790 {
791 ST32(dst , LD32(src )); 791 ST32(dst , LD32(src ));
796 dst+=dstStride; 796 dst+=dstStride;
797 src+=srcStride; 797 src+=srcStride;
798 } 798 }
799 } 799 }
800 800
801 static inline void copy_block9(UINT8 *dst, UINT8 *src, int dstStride, int srcStride, int h) 801 static inline void copy_block9(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
802 { 802 {
803 int i; 803 int i;
804 for(i=0; i<h; i++) 804 for(i=0; i<h; i++)
805 { 805 {
806 ST32(dst , LD32(src )); 806 ST32(dst , LD32(src ));
811 } 811 }
812 } 812 }
813 813
814 814
815 #define QPEL_MC(r, OPNAME, RND, OP) \ 815 #define QPEL_MC(r, OPNAME, RND, OP) \
816 static void OPNAME ## mpeg4_qpel8_h_lowpass(UINT8 *dst, UINT8 *src, int dstStride, int srcStride, int h){\ 816 static void OPNAME ## mpeg4_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
817 UINT8 *cm = cropTbl + MAX_NEG_CROP;\ 817 uint8_t *cm = cropTbl + MAX_NEG_CROP;\
818 int i;\ 818 int i;\
819 for(i=0; i<h; i++)\ 819 for(i=0; i<h; i++)\
820 {\ 820 {\
821 OP(dst[0], (src[0]+src[1])*20 - (src[0]+src[2])*6 + (src[1]+src[3])*3 - (src[2]+src[4]));\ 821 OP(dst[0], (src[0]+src[1])*20 - (src[0]+src[2])*6 + (src[1]+src[3])*3 - (src[2]+src[4]));\
822 OP(dst[1], (src[1]+src[2])*20 - (src[0]+src[3])*6 + (src[0]+src[4])*3 - (src[1]+src[5]));\ 822 OP(dst[1], (src[1]+src[2])*20 - (src[0]+src[3])*6 + (src[0]+src[4])*3 - (src[1]+src[5]));\
829 dst+=dstStride;\ 829 dst+=dstStride;\
830 src+=srcStride;\ 830 src+=srcStride;\
831 }\ 831 }\
832 }\ 832 }\
833 \ 833 \
834 static void OPNAME ## mpeg4_qpel8_v_lowpass(UINT8 *dst, UINT8 *src, int dstStride, int srcStride){\ 834 static void OPNAME ## mpeg4_qpel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
835 const int w=8;\ 835 const int w=8;\
836 UINT8 *cm = cropTbl + MAX_NEG_CROP;\ 836 uint8_t *cm = cropTbl + MAX_NEG_CROP;\
837 int i;\ 837 int i;\
838 for(i=0; i<w; i++)\ 838 for(i=0; i<w; i++)\
839 {\ 839 {\
840 const int src0= src[0*srcStride];\ 840 const int src0= src[0*srcStride];\
841 const int src1= src[1*srcStride];\ 841 const int src1= src[1*srcStride];\
857 dst++;\ 857 dst++;\
858 src++;\ 858 src++;\
859 }\ 859 }\
860 }\ 860 }\
861 \ 861 \
862 static void OPNAME ## mpeg4_qpel16_h_lowpass(UINT8 *dst, UINT8 *src, int dstStride, int srcStride, int h){\ 862 static void OPNAME ## mpeg4_qpel16_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
863 UINT8 *cm = cropTbl + MAX_NEG_CROP;\ 863 uint8_t *cm = cropTbl + MAX_NEG_CROP;\
864 int i;\ 864 int i;\
865 \ 865 \
866 for(i=0; i<h; i++)\ 866 for(i=0; i<h; i++)\
867 {\ 867 {\
868 OP(dst[ 0], (src[ 0]+src[ 1])*20 - (src[ 0]+src[ 2])*6 + (src[ 1]+src[ 3])*3 - (src[ 2]+src[ 4]));\ 868 OP(dst[ 0], (src[ 0]+src[ 1])*20 - (src[ 0]+src[ 2])*6 + (src[ 1]+src[ 3])*3 - (src[ 2]+src[ 4]));\
884 dst+=dstStride;\ 884 dst+=dstStride;\
885 src+=srcStride;\ 885 src+=srcStride;\
886 }\ 886 }\
887 }\ 887 }\
888 \ 888 \
889 static void OPNAME ## mpeg4_qpel16_v_lowpass(UINT8 *dst, UINT8 *src, int dstStride, int srcStride){\ 889 static void OPNAME ## mpeg4_qpel16_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
890 UINT8 *cm = cropTbl + MAX_NEG_CROP;\ 890 uint8_t *cm = cropTbl + MAX_NEG_CROP;\
891 int i;\ 891 int i;\
892 const int w=16;\ 892 const int w=16;\
893 for(i=0; i<w; i++)\ 893 for(i=0; i<w; i++)\
894 {\ 894 {\
895 const int src0= src[0*srcStride];\ 895 const int src0= src[0*srcStride];\
928 dst++;\ 928 dst++;\
929 src++;\ 929 src++;\
930 }\ 930 }\
931 }\ 931 }\
932 \ 932 \
933 static void OPNAME ## qpel8_mc00_c (UINT8 *dst, UINT8 *src, int stride){\ 933 static void OPNAME ## qpel8_mc00_c (uint8_t *dst, uint8_t *src, int stride){\
934 OPNAME ## pixels8_c(dst, src, stride, 8);\ 934 OPNAME ## pixels8_c(dst, src, stride, 8);\
935 }\ 935 }\
936 \ 936 \
937 static void OPNAME ## qpel8_mc10_c(UINT8 *dst, UINT8 *src, int stride){\ 937 static void OPNAME ## qpel8_mc10_c(uint8_t *dst, uint8_t *src, int stride){\
938 UINT8 half[64];\ 938 uint8_t half[64];\
939 put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8);\ 939 put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8);\
940 OPNAME ## pixels8_l2(dst, src, half, stride, stride, 8, 8);\ 940 OPNAME ## pixels8_l2(dst, src, half, stride, stride, 8, 8);\
941 }\ 941 }\
942 \ 942 \
943 static void OPNAME ## qpel8_mc20_c(UINT8 *dst, UINT8 *src, int stride){\ 943 static void OPNAME ## qpel8_mc20_c(uint8_t *dst, uint8_t *src, int stride){\
944 OPNAME ## mpeg4_qpel8_h_lowpass(dst, src, stride, stride, 8);\ 944 OPNAME ## mpeg4_qpel8_h_lowpass(dst, src, stride, stride, 8);\
945 }\ 945 }\
946 \ 946 \
947 static void OPNAME ## qpel8_mc30_c(UINT8 *dst, UINT8 *src, int stride){\ 947 static void OPNAME ## qpel8_mc30_c(uint8_t *dst, uint8_t *src, int stride){\
948 UINT8 half[64];\ 948 uint8_t half[64];\
949 put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8);\ 949 put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8);\
950 OPNAME ## pixels8_l2(dst, src+1, half, stride, stride, 8, 8);\ 950 OPNAME ## pixels8_l2(dst, src+1, half, stride, stride, 8, 8);\
951 }\ 951 }\
952 \ 952 \
953 static void OPNAME ## qpel8_mc01_c(UINT8 *dst, UINT8 *src, int stride){\ 953 static void OPNAME ## qpel8_mc01_c(uint8_t *dst, uint8_t *src, int stride){\
954 UINT8 full[16*9];\ 954 uint8_t full[16*9];\
955 UINT8 half[64];\ 955 uint8_t half[64];\
956 copy_block9(full, src, 16, stride, 9);\ 956 copy_block9(full, src, 16, stride, 9);\
957 put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16);\ 957 put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16);\
958 OPNAME ## pixels8_l2(dst, full, half, stride, 16, 8, 8);\ 958 OPNAME ## pixels8_l2(dst, full, half, stride, 16, 8, 8);\
959 }\ 959 }\
960 \ 960 \
961 static void OPNAME ## qpel8_mc02_c(UINT8 *dst, UINT8 *src, int stride){\ 961 static void OPNAME ## qpel8_mc02_c(uint8_t *dst, uint8_t *src, int stride){\
962 UINT8 full[16*9];\ 962 uint8_t full[16*9];\
963 copy_block9(full, src, 16, stride, 9);\ 963 copy_block9(full, src, 16, stride, 9);\
964 OPNAME ## mpeg4_qpel8_v_lowpass(dst, full, stride, 16);\ 964 OPNAME ## mpeg4_qpel8_v_lowpass(dst, full, stride, 16);\
965 }\ 965 }\
966 \ 966 \
967 static void OPNAME ## qpel8_mc03_c(UINT8 *dst, UINT8 *src, int stride){\ 967 static void OPNAME ## qpel8_mc03_c(uint8_t *dst, uint8_t *src, int stride){\
968 UINT8 full[16*9];\ 968 uint8_t full[16*9];\
969 UINT8 half[64];\ 969 uint8_t half[64];\
970 copy_block9(full, src, 16, stride, 9);\ 970 copy_block9(full, src, 16, stride, 9);\
971 put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16);\ 971 put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16);\
972 OPNAME ## pixels8_l2(dst, full+16, half, stride, 16, 8, 8);\ 972 OPNAME ## pixels8_l2(dst, full+16, half, stride, 16, 8, 8);\
973 }\ 973 }\
974 void ff_ ## OPNAME ## qpel8_mc11_old_c(UINT8 *dst, UINT8 *src, int stride){\ 974 void ff_ ## OPNAME ## qpel8_mc11_old_c(uint8_t *dst, uint8_t *src, int stride){\
975 UINT8 full[16*9];\ 975 uint8_t full[16*9];\
976 UINT8 halfH[72];\ 976 uint8_t halfH[72];\
977 UINT8 halfV[64];\ 977 uint8_t halfV[64];\
978 UINT8 halfHV[64];\ 978 uint8_t halfHV[64];\
979 copy_block9(full, src, 16, stride, 9);\ 979 copy_block9(full, src, 16, stride, 9);\
980 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\ 980 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
981 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\ 981 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
982 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\ 982 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
983 OPNAME ## pixels8_l4(dst, full, halfH, halfV, halfHV, stride, 16, 8, 8, 8, 8);\ 983 OPNAME ## pixels8_l4(dst, full, halfH, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
984 }\ 984 }\
985 static void OPNAME ## qpel8_mc11_c(UINT8 *dst, UINT8 *src, int stride){\ 985 static void OPNAME ## qpel8_mc11_c(uint8_t *dst, uint8_t *src, int stride){\
986 UINT8 full[16*9];\ 986 uint8_t full[16*9];\
987 UINT8 halfH[72];\ 987 uint8_t halfH[72];\
988 UINT8 halfHV[64];\ 988 uint8_t halfHV[64];\
989 copy_block9(full, src, 16, stride, 9);\ 989 copy_block9(full, src, 16, stride, 9);\
990 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\ 990 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
991 put ## RND ## pixels8_l2(halfH, halfH, full, 8, 8, 16, 9);\ 991 put ## RND ## pixels8_l2(halfH, halfH, full, 8, 8, 16, 9);\
992 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\ 992 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
993 OPNAME ## pixels8_l2(dst, halfH, halfHV, stride, 8, 8, 8);\ 993 OPNAME ## pixels8_l2(dst, halfH, halfHV, stride, 8, 8, 8);\
994 }\ 994 }\
995 void ff_ ## OPNAME ## qpel8_mc31_old_c(UINT8 *dst, UINT8 *src, int stride){\ 995 void ff_ ## OPNAME ## qpel8_mc31_old_c(uint8_t *dst, uint8_t *src, int stride){\
996 UINT8 full[16*9];\ 996 uint8_t full[16*9];\
997 UINT8 halfH[72];\ 997 uint8_t halfH[72];\
998 UINT8 halfV[64];\ 998 uint8_t halfV[64];\
999 UINT8 halfHV[64];\ 999 uint8_t halfHV[64];\
1000 copy_block9(full, src, 16, stride, 9);\ 1000 copy_block9(full, src, 16, stride, 9);\
1001 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\ 1001 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1002 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\ 1002 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
1003 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\ 1003 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1004 OPNAME ## pixels8_l4(dst, full+1, halfH, halfV, halfHV, stride, 16, 8, 8, 8, 8);\ 1004 OPNAME ## pixels8_l4(dst, full+1, halfH, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
1005 }\ 1005 }\
1006 static void OPNAME ## qpel8_mc31_c(UINT8 *dst, UINT8 *src, int stride){\ 1006 static void OPNAME ## qpel8_mc31_c(uint8_t *dst, uint8_t *src, int stride){\
1007 UINT8 full[16*9];\ 1007 uint8_t full[16*9];\
1008 UINT8 halfH[72];\ 1008 uint8_t halfH[72];\
1009 UINT8 halfHV[64];\ 1009 uint8_t halfHV[64];\
1010 copy_block9(full, src, 16, stride, 9);\ 1010 copy_block9(full, src, 16, stride, 9);\
1011 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\ 1011 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1012 put ## RND ## pixels8_l2(halfH, halfH, full+1, 8, 8, 16, 9);\ 1012 put ## RND ## pixels8_l2(halfH, halfH, full+1, 8, 8, 16, 9);\
1013 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\ 1013 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1014 OPNAME ## pixels8_l2(dst, halfH, halfHV, stride, 8, 8, 8);\ 1014 OPNAME ## pixels8_l2(dst, halfH, halfHV, stride, 8, 8, 8);\
1015 }\ 1015 }\
1016 void ff_ ## OPNAME ## qpel8_mc13_old_c(UINT8 *dst, UINT8 *src, int stride){\ 1016 void ff_ ## OPNAME ## qpel8_mc13_old_c(uint8_t *dst, uint8_t *src, int stride){\
1017 UINT8 full[16*9];\ 1017 uint8_t full[16*9];\
1018 UINT8 halfH[72];\ 1018 uint8_t halfH[72];\
1019 UINT8 halfV[64];\ 1019 uint8_t halfV[64];\
1020 UINT8 halfHV[64];\ 1020 uint8_t halfHV[64];\
1021 copy_block9(full, src, 16, stride, 9);\ 1021 copy_block9(full, src, 16, stride, 9);\
1022 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\ 1022 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1023 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\ 1023 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
1024 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\ 1024 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1025 OPNAME ## pixels8_l4(dst, full+16, halfH+8, halfV, halfHV, stride, 16, 8, 8, 8, 8);\ 1025 OPNAME ## pixels8_l4(dst, full+16, halfH+8, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
1026 }\ 1026 }\
1027 static void OPNAME ## qpel8_mc13_c(UINT8 *dst, UINT8 *src, int stride){\ 1027 static void OPNAME ## qpel8_mc13_c(uint8_t *dst, uint8_t *src, int stride){\
1028 UINT8 full[16*9];\ 1028 uint8_t full[16*9];\
1029 UINT8 halfH[72];\ 1029 uint8_t halfH[72];\
1030 UINT8 halfHV[64];\ 1030 uint8_t halfHV[64];\
1031 copy_block9(full, src, 16, stride, 9);\ 1031 copy_block9(full, src, 16, stride, 9);\
1032 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\ 1032 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1033 put ## RND ## pixels8_l2(halfH, halfH, full, 8, 8, 16, 9);\ 1033 put ## RND ## pixels8_l2(halfH, halfH, full, 8, 8, 16, 9);\
1034 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\ 1034 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1035 OPNAME ## pixels8_l2(dst, halfH+8, halfHV, stride, 8, 8, 8);\ 1035 OPNAME ## pixels8_l2(dst, halfH+8, halfHV, stride, 8, 8, 8);\
1036 }\ 1036 }\
1037 void ff_ ## OPNAME ## qpel8_mc33_old_c(UINT8 *dst, UINT8 *src, int stride){\ 1037 void ff_ ## OPNAME ## qpel8_mc33_old_c(uint8_t *dst, uint8_t *src, int stride){\
1038 UINT8 full[16*9];\ 1038 uint8_t full[16*9];\
1039 UINT8 halfH[72];\ 1039 uint8_t halfH[72];\
1040 UINT8 halfV[64];\ 1040 uint8_t halfV[64];\
1041 UINT8 halfHV[64];\ 1041 uint8_t halfHV[64];\
1042 copy_block9(full, src, 16, stride, 9);\ 1042 copy_block9(full, src, 16, stride, 9);\
1043 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full , 8, 16, 9);\ 1043 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full , 8, 16, 9);\
1044 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\ 1044 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
1045 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\ 1045 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1046 OPNAME ## pixels8_l4(dst, full+17, halfH+8, halfV, halfHV, stride, 16, 8, 8, 8, 8);\ 1046 OPNAME ## pixels8_l4(dst, full+17, halfH+8, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
1047 }\ 1047 }\
1048 static void OPNAME ## qpel8_mc33_c(UINT8 *dst, UINT8 *src, int stride){\ 1048 static void OPNAME ## qpel8_mc33_c(uint8_t *dst, uint8_t *src, int stride){\
1049 UINT8 full[16*9];\ 1049 uint8_t full[16*9];\
1050 UINT8 halfH[72];\ 1050 uint8_t halfH[72];\
1051 UINT8 halfHV[64];\ 1051 uint8_t halfHV[64];\
1052 copy_block9(full, src, 16, stride, 9);\ 1052 copy_block9(full, src, 16, stride, 9);\
1053 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\ 1053 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1054 put ## RND ## pixels8_l2(halfH, halfH, full+1, 8, 8, 16, 9);\ 1054 put ## RND ## pixels8_l2(halfH, halfH, full+1, 8, 8, 16, 9);\
1055 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\ 1055 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1056 OPNAME ## pixels8_l2(dst, halfH+8, halfHV, stride, 8, 8, 8);\ 1056 OPNAME ## pixels8_l2(dst, halfH+8, halfHV, stride, 8, 8, 8);\
1057 }\ 1057 }\
1058 static void OPNAME ## qpel8_mc21_c(UINT8 *dst, UINT8 *src, int stride){\ 1058 static void OPNAME ## qpel8_mc21_c(uint8_t *dst, uint8_t *src, int stride){\
1059 UINT8 halfH[72];\ 1059 uint8_t halfH[72];\
1060 UINT8 halfHV[64];\ 1060 uint8_t halfHV[64];\
1061 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\ 1061 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
1062 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\ 1062 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1063 OPNAME ## pixels8_l2(dst, halfH, halfHV, stride, 8, 8, 8);\ 1063 OPNAME ## pixels8_l2(dst, halfH, halfHV, stride, 8, 8, 8);\
1064 }\ 1064 }\
1065 static void OPNAME ## qpel8_mc23_c(UINT8 *dst, UINT8 *src, int stride){\ 1065 static void OPNAME ## qpel8_mc23_c(uint8_t *dst, uint8_t *src, int stride){\
1066 UINT8 halfH[72];\ 1066 uint8_t halfH[72];\
1067 UINT8 halfHV[64];\ 1067 uint8_t halfHV[64];\
1068 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\ 1068 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
1069 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\ 1069 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1070 OPNAME ## pixels8_l2(dst, halfH+8, halfHV, stride, 8, 8, 8);\ 1070 OPNAME ## pixels8_l2(dst, halfH+8, halfHV, stride, 8, 8, 8);\
1071 }\ 1071 }\
1072 void ff_ ## OPNAME ## qpel8_mc12_old_c(UINT8 *dst, UINT8 *src, int stride){\ 1072 void ff_ ## OPNAME ## qpel8_mc12_old_c(uint8_t *dst, uint8_t *src, int stride){\
1073 UINT8 full[16*9];\ 1073 uint8_t full[16*9];\
1074 UINT8 halfH[72];\ 1074 uint8_t halfH[72];\
1075 UINT8 halfV[64];\ 1075 uint8_t halfV[64];\
1076 UINT8 halfHV[64];\ 1076 uint8_t halfHV[64];\
1077 copy_block9(full, src, 16, stride, 9);\ 1077 copy_block9(full, src, 16, stride, 9);\
1078 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\ 1078 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1079 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\ 1079 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
1080 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\ 1080 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1081 OPNAME ## pixels8_l2(dst, halfV, halfHV, stride, 8, 8, 8);\ 1081 OPNAME ## pixels8_l2(dst, halfV, halfHV, stride, 8, 8, 8);\
1082 }\ 1082 }\
1083 static void OPNAME ## qpel8_mc12_c(UINT8 *dst, UINT8 *src, int stride){\ 1083 static void OPNAME ## qpel8_mc12_c(uint8_t *dst, uint8_t *src, int stride){\
1084 UINT8 full[16*9];\ 1084 uint8_t full[16*9];\
1085 UINT8 halfH[72];\ 1085 uint8_t halfH[72];\
1086 copy_block9(full, src, 16, stride, 9);\ 1086 copy_block9(full, src, 16, stride, 9);\
1087 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\ 1087 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1088 put ## RND ## pixels8_l2(halfH, halfH, full, 8, 8, 16, 9);\ 1088 put ## RND ## pixels8_l2(halfH, halfH, full, 8, 8, 16, 9);\
1089 OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\ 1089 OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
1090 }\ 1090 }\
1091 void ff_ ## OPNAME ## qpel8_mc32_old_c(UINT8 *dst, UINT8 *src, int stride){\ 1091 void ff_ ## OPNAME ## qpel8_mc32_old_c(uint8_t *dst, uint8_t *src, int stride){\
1092 UINT8 full[16*9];\ 1092 uint8_t full[16*9];\
1093 UINT8 halfH[72];\ 1093 uint8_t halfH[72];\
1094 UINT8 halfV[64];\ 1094 uint8_t halfV[64];\
1095 UINT8 halfHV[64];\ 1095 uint8_t halfHV[64];\
1096 copy_block9(full, src, 16, stride, 9);\ 1096 copy_block9(full, src, 16, stride, 9);\
1097 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\ 1097 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1098 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\ 1098 put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
1099 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\ 1099 put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1100 OPNAME ## pixels8_l2(dst, halfV, halfHV, stride, 8, 8, 8);\ 1100 OPNAME ## pixels8_l2(dst, halfV, halfHV, stride, 8, 8, 8);\
1101 }\ 1101 }\
1102 static void OPNAME ## qpel8_mc32_c(UINT8 *dst, UINT8 *src, int stride){\ 1102 static void OPNAME ## qpel8_mc32_c(uint8_t *dst, uint8_t *src, int stride){\
1103 UINT8 full[16*9];\ 1103 uint8_t full[16*9];\
1104 UINT8 halfH[72];\ 1104 uint8_t halfH[72];\
1105 copy_block9(full, src, 16, stride, 9);\ 1105 copy_block9(full, src, 16, stride, 9);\
1106 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\ 1106 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1107 put ## RND ## pixels8_l2(halfH, halfH, full+1, 8, 8, 16, 9);\ 1107 put ## RND ## pixels8_l2(halfH, halfH, full+1, 8, 8, 16, 9);\
1108 OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\ 1108 OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
1109 }\ 1109 }\
1110 static void OPNAME ## qpel8_mc22_c(UINT8 *dst, UINT8 *src, int stride){\ 1110 static void OPNAME ## qpel8_mc22_c(uint8_t *dst, uint8_t *src, int stride){\
1111 UINT8 halfH[72];\ 1111 uint8_t halfH[72];\
1112 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\ 1112 put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
1113 OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\ 1113 OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
1114 }\ 1114 }\
1115 static void OPNAME ## qpel16_mc00_c (UINT8 *dst, UINT8 *src, int stride){\ 1115 static void OPNAME ## qpel16_mc00_c (uint8_t *dst, uint8_t *src, int stride){\
1116 OPNAME ## pixels16_c(dst, src, stride, 16);\ 1116 OPNAME ## pixels16_c(dst, src, stride, 16);\
1117 }\ 1117 }\
1118 \ 1118 \
1119 static void OPNAME ## qpel16_mc10_c(UINT8 *dst, UINT8 *src, int stride){\ 1119 static void OPNAME ## qpel16_mc10_c(uint8_t *dst, uint8_t *src, int stride){\
1120 UINT8 half[256];\ 1120 uint8_t half[256];\
1121 put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16);\ 1121 put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16);\
1122 OPNAME ## pixels16_l2(dst, src, half, stride, stride, 16, 16);\ 1122 OPNAME ## pixels16_l2(dst, src, half, stride, stride, 16, 16);\
1123 }\ 1123 }\
1124 \ 1124 \
1125 static void OPNAME ## qpel16_mc20_c(UINT8 *dst, UINT8 *src, int stride){\ 1125 static void OPNAME ## qpel16_mc20_c(uint8_t *dst, uint8_t *src, int stride){\
1126 OPNAME ## mpeg4_qpel16_h_lowpass(dst, src, stride, stride, 16);\ 1126 OPNAME ## mpeg4_qpel16_h_lowpass(dst, src, stride, stride, 16);\
1127 }\ 1127 }\
1128 \ 1128 \
1129 static void OPNAME ## qpel16_mc30_c(UINT8 *dst, UINT8 *src, int stride){\ 1129 static void OPNAME ## qpel16_mc30_c(uint8_t *dst, uint8_t *src, int stride){\
1130 UINT8 half[256];\ 1130 uint8_t half[256];\
1131 put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16);\ 1131 put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16);\
1132 OPNAME ## pixels16_l2(dst, src+1, half, stride, stride, 16, 16);\ 1132 OPNAME ## pixels16_l2(dst, src+1, half, stride, stride, 16, 16);\
1133 }\ 1133 }\
1134 \ 1134 \
1135 static void OPNAME ## qpel16_mc01_c(UINT8 *dst, UINT8 *src, int stride){\ 1135 static void OPNAME ## qpel16_mc01_c(uint8_t *dst, uint8_t *src, int stride){\
1136 UINT8 full[24*17];\ 1136 uint8_t full[24*17];\
1137 UINT8 half[256];\ 1137 uint8_t half[256];\
1138 copy_block17(full, src, 24, stride, 17);\ 1138 copy_block17(full, src, 24, stride, 17);\
1139 put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24);\ 1139 put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24);\
1140 OPNAME ## pixels16_l2(dst, full, half, stride, 24, 16, 16);\ 1140 OPNAME ## pixels16_l2(dst, full, half, stride, 24, 16, 16);\
1141 }\ 1141 }\
1142 \ 1142 \
1143 static void OPNAME ## qpel16_mc02_c(UINT8 *dst, UINT8 *src, int stride){\ 1143 static void OPNAME ## qpel16_mc02_c(uint8_t *dst, uint8_t *src, int stride){\
1144 UINT8 full[24*17];\ 1144 uint8_t full[24*17];\
1145 copy_block17(full, src, 24, stride, 17);\ 1145 copy_block17(full, src, 24, stride, 17);\
1146 OPNAME ## mpeg4_qpel16_v_lowpass(dst, full, stride, 24);\ 1146 OPNAME ## mpeg4_qpel16_v_lowpass(dst, full, stride, 24);\
1147 }\ 1147 }\
1148 \ 1148 \
1149 static void OPNAME ## qpel16_mc03_c(UINT8 *dst, UINT8 *src, int stride){\ 1149 static void OPNAME ## qpel16_mc03_c(uint8_t *dst, uint8_t *src, int stride){\
1150 UINT8 full[24*17];\ 1150 uint8_t full[24*17];\
1151 UINT8 half[256];\ 1151 uint8_t half[256];\
1152 copy_block17(full, src, 24, stride, 17);\ 1152 copy_block17(full, src, 24, stride, 17);\
1153 put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24);\ 1153 put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24);\
1154 OPNAME ## pixels16_l2(dst, full+24, half, stride, 24, 16, 16);\ 1154 OPNAME ## pixels16_l2(dst, full+24, half, stride, 24, 16, 16);\
1155 }\ 1155 }\
1156 void ff_ ## OPNAME ## qpel16_mc11_old_c(UINT8 *dst, UINT8 *src, int stride){\ 1156 void ff_ ## OPNAME ## qpel16_mc11_old_c(uint8_t *dst, uint8_t *src, int stride){\
1157 UINT8 full[24*17];\ 1157 uint8_t full[24*17];\
1158 UINT8 halfH[272];\ 1158 uint8_t halfH[272];\
1159 UINT8 halfV[256];\ 1159 uint8_t halfV[256];\
1160 UINT8 halfHV[256];\ 1160 uint8_t halfHV[256];\
1161 copy_block17(full, src, 24, stride, 17);\ 1161 copy_block17(full, src, 24, stride, 17);\
1162 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\ 1162 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1163 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\ 1163 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
1164 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\ 1164 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1165 OPNAME ## pixels16_l4(dst, full, halfH, halfV, halfHV, stride, 24, 16, 16, 16, 16);\ 1165 OPNAME ## pixels16_l4(dst, full, halfH, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
1166 }\ 1166 }\
1167 static void OPNAME ## qpel16_mc11_c(UINT8 *dst, UINT8 *src, int stride){\ 1167 static void OPNAME ## qpel16_mc11_c(uint8_t *dst, uint8_t *src, int stride){\
1168 UINT8 full[24*17];\ 1168 uint8_t full[24*17];\
1169 UINT8 halfH[272];\ 1169 uint8_t halfH[272];\
1170 UINT8 halfHV[256];\ 1170 uint8_t halfHV[256];\
1171 copy_block17(full, src, 24, stride, 17);\ 1171 copy_block17(full, src, 24, stride, 17);\
1172 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\ 1172 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1173 put ## RND ## pixels16_l2(halfH, halfH, full, 16, 16, 24, 17);\ 1173 put ## RND ## pixels16_l2(halfH, halfH, full, 16, 16, 24, 17);\
1174 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\ 1174 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1175 OPNAME ## pixels16_l2(dst, halfH, halfHV, stride, 16, 16, 16);\ 1175 OPNAME ## pixels16_l2(dst, halfH, halfHV, stride, 16, 16, 16);\
1176 }\ 1176 }\
1177 void ff_ ## OPNAME ## qpel16_mc31_old_c(UINT8 *dst, UINT8 *src, int stride){\ 1177 void ff_ ## OPNAME ## qpel16_mc31_old_c(uint8_t *dst, uint8_t *src, int stride){\
1178 UINT8 full[24*17];\ 1178 uint8_t full[24*17];\
1179 UINT8 halfH[272];\ 1179 uint8_t halfH[272];\
1180 UINT8 halfV[256];\ 1180 uint8_t halfV[256];\
1181 UINT8 halfHV[256];\ 1181 uint8_t halfHV[256];\
1182 copy_block17(full, src, 24, stride, 17);\ 1182 copy_block17(full, src, 24, stride, 17);\
1183 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\ 1183 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1184 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\ 1184 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
1185 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\ 1185 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1186 OPNAME ## pixels16_l4(dst, full+1, halfH, halfV, halfHV, stride, 24, 16, 16, 16, 16);\ 1186 OPNAME ## pixels16_l4(dst, full+1, halfH, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
1187 }\ 1187 }\
1188 static void OPNAME ## qpel16_mc31_c(UINT8 *dst, UINT8 *src, int stride){\ 1188 static void OPNAME ## qpel16_mc31_c(uint8_t *dst, uint8_t *src, int stride){\
1189 UINT8 full[24*17];\ 1189 uint8_t full[24*17];\
1190 UINT8 halfH[272];\ 1190 uint8_t halfH[272];\
1191 UINT8 halfHV[256];\ 1191 uint8_t halfHV[256];\
1192 copy_block17(full, src, 24, stride, 17);\ 1192 copy_block17(full, src, 24, stride, 17);\
1193 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\ 1193 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1194 put ## RND ## pixels16_l2(halfH, halfH, full+1, 16, 16, 24, 17);\ 1194 put ## RND ## pixels16_l2(halfH, halfH, full+1, 16, 16, 24, 17);\
1195 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\ 1195 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1196 OPNAME ## pixels16_l2(dst, halfH, halfHV, stride, 16, 16, 16);\ 1196 OPNAME ## pixels16_l2(dst, halfH, halfHV, stride, 16, 16, 16);\
1197 }\ 1197 }\
1198 void ff_ ## OPNAME ## qpel16_mc13_old_c(UINT8 *dst, UINT8 *src, int stride){\ 1198 void ff_ ## OPNAME ## qpel16_mc13_old_c(uint8_t *dst, uint8_t *src, int stride){\
1199 UINT8 full[24*17];\ 1199 uint8_t full[24*17];\
1200 UINT8 halfH[272];\ 1200 uint8_t halfH[272];\
1201 UINT8 halfV[256];\ 1201 uint8_t halfV[256];\
1202 UINT8 halfHV[256];\ 1202 uint8_t halfHV[256];\
1203 copy_block17(full, src, 24, stride, 17);\ 1203 copy_block17(full, src, 24, stride, 17);\
1204 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\ 1204 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1205 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\ 1205 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
1206 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\ 1206 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1207 OPNAME ## pixels16_l4(dst, full+24, halfH+16, halfV, halfHV, stride, 24, 16, 16, 16, 16);\ 1207 OPNAME ## pixels16_l4(dst, full+24, halfH+16, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
1208 }\ 1208 }\
1209 static void OPNAME ## qpel16_mc13_c(UINT8 *dst, UINT8 *src, int stride){\ 1209 static void OPNAME ## qpel16_mc13_c(uint8_t *dst, uint8_t *src, int stride){\
1210 UINT8 full[24*17];\ 1210 uint8_t full[24*17];\
1211 UINT8 halfH[272];\ 1211 uint8_t halfH[272];\
1212 UINT8 halfHV[256];\ 1212 uint8_t halfHV[256];\
1213 copy_block17(full, src, 24, stride, 17);\ 1213 copy_block17(full, src, 24, stride, 17);\
1214 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\ 1214 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1215 put ## RND ## pixels16_l2(halfH, halfH, full, 16, 16, 24, 17);\ 1215 put ## RND ## pixels16_l2(halfH, halfH, full, 16, 16, 24, 17);\
1216 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\ 1216 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1217 OPNAME ## pixels16_l2(dst, halfH+16, halfHV, stride, 16, 16, 16);\ 1217 OPNAME ## pixels16_l2(dst, halfH+16, halfHV, stride, 16, 16, 16);\
1218 }\ 1218 }\
1219 void ff_ ## OPNAME ## qpel16_mc33_old_c(UINT8 *dst, UINT8 *src, int stride){\ 1219 void ff_ ## OPNAME ## qpel16_mc33_old_c(uint8_t *dst, uint8_t *src, int stride){\
1220 UINT8 full[24*17];\ 1220 uint8_t full[24*17];\
1221 UINT8 halfH[272];\ 1221 uint8_t halfH[272];\
1222 UINT8 halfV[256];\ 1222 uint8_t halfV[256];\
1223 UINT8 halfHV[256];\ 1223 uint8_t halfHV[256];\
1224 copy_block17(full, src, 24, stride, 17);\ 1224 copy_block17(full, src, 24, stride, 17);\
1225 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full , 16, 24, 17);\ 1225 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full , 16, 24, 17);\
1226 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\ 1226 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
1227 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\ 1227 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1228 OPNAME ## pixels16_l4(dst, full+25, halfH+16, halfV, halfHV, stride, 24, 16, 16, 16, 16);\ 1228 OPNAME ## pixels16_l4(dst, full+25, halfH+16, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
1229 }\ 1229 }\
1230 static void OPNAME ## qpel16_mc33_c(UINT8 *dst, UINT8 *src, int stride){\ 1230 static void OPNAME ## qpel16_mc33_c(uint8_t *dst, uint8_t *src, int stride){\
1231 UINT8 full[24*17];\ 1231 uint8_t full[24*17];\
1232 UINT8 halfH[272];\ 1232 uint8_t halfH[272];\
1233 UINT8 halfHV[256];\ 1233 uint8_t halfHV[256];\
1234 copy_block17(full, src, 24, stride, 17);\ 1234 copy_block17(full, src, 24, stride, 17);\
1235 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\ 1235 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1236 put ## RND ## pixels16_l2(halfH, halfH, full+1, 16, 16, 24, 17);\ 1236 put ## RND ## pixels16_l2(halfH, halfH, full+1, 16, 16, 24, 17);\
1237 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\ 1237 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1238 OPNAME ## pixels16_l2(dst, halfH+16, halfHV, stride, 16, 16, 16);\ 1238 OPNAME ## pixels16_l2(dst, halfH+16, halfHV, stride, 16, 16, 16);\
1239 }\ 1239 }\
1240 static void OPNAME ## qpel16_mc21_c(UINT8 *dst, UINT8 *src, int stride){\ 1240 static void OPNAME ## qpel16_mc21_c(uint8_t *dst, uint8_t *src, int stride){\
1241 UINT8 halfH[272];\ 1241 uint8_t halfH[272];\
1242 UINT8 halfHV[256];\ 1242 uint8_t halfHV[256];\
1243 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\ 1243 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
1244 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\ 1244 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1245 OPNAME ## pixels16_l2(dst, halfH, halfHV, stride, 16, 16, 16);\ 1245 OPNAME ## pixels16_l2(dst, halfH, halfHV, stride, 16, 16, 16);\
1246 }\ 1246 }\
1247 static void OPNAME ## qpel16_mc23_c(UINT8 *dst, UINT8 *src, int stride){\ 1247 static void OPNAME ## qpel16_mc23_c(uint8_t *dst, uint8_t *src, int stride){\
1248 UINT8 halfH[272];\ 1248 uint8_t halfH[272];\
1249 UINT8 halfHV[256];\ 1249 uint8_t halfHV[256];\
1250 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\ 1250 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
1251 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\ 1251 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1252 OPNAME ## pixels16_l2(dst, halfH+16, halfHV, stride, 16, 16, 16);\ 1252 OPNAME ## pixels16_l2(dst, halfH+16, halfHV, stride, 16, 16, 16);\
1253 }\ 1253 }\
1254 void ff_ ## OPNAME ## qpel16_mc12_old_c(UINT8 *dst, UINT8 *src, int stride){\ 1254 void ff_ ## OPNAME ## qpel16_mc12_old_c(uint8_t *dst, uint8_t *src, int stride){\
1255 UINT8 full[24*17];\ 1255 uint8_t full[24*17];\
1256 UINT8 halfH[272];\ 1256 uint8_t halfH[272];\
1257 UINT8 halfV[256];\ 1257 uint8_t halfV[256];\
1258 UINT8 halfHV[256];\ 1258 uint8_t halfHV[256];\
1259 copy_block17(full, src, 24, stride, 17);\ 1259 copy_block17(full, src, 24, stride, 17);\
1260 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\ 1260 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1261 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\ 1261 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
1262 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\ 1262 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1263 OPNAME ## pixels16_l2(dst, halfV, halfHV, stride, 16, 16, 16);\ 1263 OPNAME ## pixels16_l2(dst, halfV, halfHV, stride, 16, 16, 16);\
1264 }\ 1264 }\
1265 static void OPNAME ## qpel16_mc12_c(UINT8 *dst, UINT8 *src, int stride){\ 1265 static void OPNAME ## qpel16_mc12_c(uint8_t *dst, uint8_t *src, int stride){\
1266 UINT8 full[24*17];\ 1266 uint8_t full[24*17];\
1267 UINT8 halfH[272];\ 1267 uint8_t halfH[272];\
1268 copy_block17(full, src, 24, stride, 17);\ 1268 copy_block17(full, src, 24, stride, 17);\
1269 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\ 1269 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1270 put ## RND ## pixels16_l2(halfH, halfH, full, 16, 16, 24, 17);\ 1270 put ## RND ## pixels16_l2(halfH, halfH, full, 16, 16, 24, 17);\
1271 OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\ 1271 OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
1272 }\ 1272 }\
1273 void ff_ ## OPNAME ## qpel16_mc32_old_c(UINT8 *dst, UINT8 *src, int stride){\ 1273 void ff_ ## OPNAME ## qpel16_mc32_old_c(uint8_t *dst, uint8_t *src, int stride){\
1274 UINT8 full[24*17];\ 1274 uint8_t full[24*17];\
1275 UINT8 halfH[272];\ 1275 uint8_t halfH[272];\
1276 UINT8 halfV[256];\ 1276 uint8_t halfV[256];\
1277 UINT8 halfHV[256];\ 1277 uint8_t halfHV[256];\
1278 copy_block17(full, src, 24, stride, 17);\ 1278 copy_block17(full, src, 24, stride, 17);\
1279 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\ 1279 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1280 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\ 1280 put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
1281 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\ 1281 put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1282 OPNAME ## pixels16_l2(dst, halfV, halfHV, stride, 16, 16, 16);\ 1282 OPNAME ## pixels16_l2(dst, halfV, halfHV, stride, 16, 16, 16);\
1283 }\ 1283 }\
1284 static void OPNAME ## qpel16_mc32_c(UINT8 *dst, UINT8 *src, int stride){\ 1284 static void OPNAME ## qpel16_mc32_c(uint8_t *dst, uint8_t *src, int stride){\
1285 UINT8 full[24*17];\ 1285 uint8_t full[24*17];\
1286 UINT8 halfH[272];\ 1286 uint8_t halfH[272];\
1287 copy_block17(full, src, 24, stride, 17);\ 1287 copy_block17(full, src, 24, stride, 17);\
1288 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\ 1288 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1289 put ## RND ## pixels16_l2(halfH, halfH, full+1, 16, 16, 24, 17);\ 1289 put ## RND ## pixels16_l2(halfH, halfH, full+1, 16, 16, 24, 17);\
1290 OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\ 1290 OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
1291 }\ 1291 }\
1292 static void OPNAME ## qpel16_mc22_c(UINT8 *dst, UINT8 *src, int stride){\ 1292 static void OPNAME ## qpel16_mc22_c(uint8_t *dst, uint8_t *src, int stride){\
1293 UINT8 halfH[272];\ 1293 uint8_t halfH[272];\
1294 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\ 1294 put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
1295 OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\ 1295 OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
1296 } 1296 }
1297 1297
1298 #define op_avg(a, b) a = (((a)+cm[((b) + 16)>>5]+1)>>1) 1298 #define op_avg(a, b) a = (((a)+cm[((b) + 16)>>5]+1)>>1)
1403 wmv2_mspel8_h_lowpass(halfH, src-stride, 8, stride, 11); 1403 wmv2_mspel8_h_lowpass(halfH, src-stride, 8, stride, 11);
1404 wmv2_mspel8_v_lowpass(dst, halfH+8, stride, 8, 8); 1404 wmv2_mspel8_v_lowpass(dst, halfH+8, stride, 8, 8);
1405 } 1405 }
1406 1406
1407 1407
1408 static inline int pix_abs16x16_c(UINT8 *pix1, UINT8 *pix2, int line_size) 1408 static inline int pix_abs16x16_c(uint8_t *pix1, uint8_t *pix2, int line_size)
1409 { 1409 {
1410 int s, i; 1410 int s, i;
1411 1411
1412 s = 0; 1412 s = 0;
1413 for(i=0;i<16;i++) { 1413 for(i=0;i<16;i++) {
1431 pix2 += line_size; 1431 pix2 += line_size;
1432 } 1432 }
1433 return s; 1433 return s;
1434 } 1434 }
1435 1435
1436 static int pix_abs16x16_x2_c(UINT8 *pix1, UINT8 *pix2, int line_size) 1436 static int pix_abs16x16_x2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
1437 { 1437 {
1438 int s, i; 1438 int s, i;
1439 1439
1440 s = 0; 1440 s = 0;
1441 for(i=0;i<16;i++) { 1441 for(i=0;i<16;i++) {
1459 pix2 += line_size; 1459 pix2 += line_size;
1460 } 1460 }
1461 return s; 1461 return s;
1462 } 1462 }
1463 1463
1464 static int pix_abs16x16_y2_c(UINT8 *pix1, UINT8 *pix2, int line_size) 1464 static int pix_abs16x16_y2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
1465 { 1465 {
1466 int s, i; 1466 int s, i;
1467 UINT8 *pix3 = pix2 + line_size; 1467 uint8_t *pix3 = pix2 + line_size;
1468 1468
1469 s = 0; 1469 s = 0;
1470 for(i=0;i<16;i++) { 1470 for(i=0;i<16;i++) {
1471 s += abs(pix1[0] - avg2(pix2[0], pix3[0])); 1471 s += abs(pix1[0] - avg2(pix2[0], pix3[0]));
1472 s += abs(pix1[1] - avg2(pix2[1], pix3[1])); 1472 s += abs(pix1[1] - avg2(pix2[1], pix3[1]));
1489 pix3 += line_size; 1489 pix3 += line_size;
1490 } 1490 }
1491 return s; 1491 return s;
1492 } 1492 }
1493 1493
1494 static int pix_abs16x16_xy2_c(UINT8 *pix1, UINT8 *pix2, int line_size) 1494 static int pix_abs16x16_xy2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
1495 { 1495 {
1496 int s, i; 1496 int s, i;
1497 UINT8 *pix3 = pix2 + line_size; 1497 uint8_t *pix3 = pix2 + line_size;
1498 1498
1499 s = 0; 1499 s = 0;
1500 for(i=0;i<16;i++) { 1500 for(i=0;i<16;i++) {
1501 s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1])); 1501 s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1]));
1502 s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2])); 1502 s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2]));
1519 pix3 += line_size; 1519 pix3 += line_size;
1520 } 1520 }
1521 return s; 1521 return s;
1522 } 1522 }
1523 1523
1524 static inline int pix_abs8x8_c(UINT8 *pix1, UINT8 *pix2, int line_size) 1524 static inline int pix_abs8x8_c(uint8_t *pix1, uint8_t *pix2, int line_size)
1525 { 1525 {
1526 int s, i; 1526 int s, i;
1527 1527
1528 s = 0; 1528 s = 0;
1529 for(i=0;i<8;i++) { 1529 for(i=0;i<8;i++) {
1539 pix2 += line_size; 1539 pix2 += line_size;
1540 } 1540 }
1541 return s; 1541 return s;
1542 } 1542 }
1543 1543
1544 static int pix_abs8x8_x2_c(UINT8 *pix1, UINT8 *pix2, int line_size) 1544 static int pix_abs8x8_x2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
1545 { 1545 {
1546 int s, i; 1546 int s, i;
1547 1547
1548 s = 0; 1548 s = 0;
1549 for(i=0;i<8;i++) { 1549 for(i=0;i<8;i++) {
1559 pix2 += line_size; 1559 pix2 += line_size;
1560 } 1560 }
1561 return s; 1561 return s;
1562 } 1562 }
1563 1563
1564 static int pix_abs8x8_y2_c(UINT8 *pix1, UINT8 *pix2, int line_size) 1564 static int pix_abs8x8_y2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
1565 { 1565 {
1566 int s, i; 1566 int s, i;
1567 UINT8 *pix3 = pix2 + line_size; 1567 uint8_t *pix3 = pix2 + line_size;
1568 1568
1569 s = 0; 1569 s = 0;
1570 for(i=0;i<8;i++) { 1570 for(i=0;i<8;i++) {
1571 s += abs(pix1[0] - avg2(pix2[0], pix3[0])); 1571 s += abs(pix1[0] - avg2(pix2[0], pix3[0]));
1572 s += abs(pix1[1] - avg2(pix2[1], pix3[1])); 1572 s += abs(pix1[1] - avg2(pix2[1], pix3[1]));
1581 pix3 += line_size; 1581 pix3 += line_size;
1582 } 1582 }
1583 return s; 1583 return s;
1584 } 1584 }
1585 1585
1586 static int pix_abs8x8_xy2_c(UINT8 *pix1, UINT8 *pix2, int line_size) 1586 static int pix_abs8x8_xy2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
1587 { 1587 {
1588 int s, i; 1588 int s, i;
1589 UINT8 *pix3 = pix2 + line_size; 1589 uint8_t *pix3 = pix2 + line_size;
1590 1590
1591 s = 0; 1591 s = 0;
1592 for(i=0;i<8;i++) { 1592 for(i=0;i<8;i++) {
1593 s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1])); 1593 s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1]));
1594 s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2])); 1594 s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2]));
1611 1611
1612 static int sad8x8_c(void *s, uint8_t *a, uint8_t *b, int stride){ 1612 static int sad8x8_c(void *s, uint8_t *a, uint8_t *b, int stride){
1613 return pix_abs8x8_c(a,b,stride); 1613 return pix_abs8x8_c(a,b,stride);
1614 } 1614 }
1615 1615
1616 void ff_block_permute(DCTELEM *block, UINT8 *permutation, const UINT8 *scantable, int last) 1616 void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last)
1617 { 1617 {
1618 int i; 1618 int i;
1619 DCTELEM temp[64]; 1619 DCTELEM temp[64];
1620 1620
1621 if(last<=0) return; 1621 if(last<=0) return;
1820 return sum; 1820 return sum;
1821 } 1821 }
1822 1822
1823 static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride){ 1823 static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride){
1824 MpegEncContext * const s= (MpegEncContext *)c; 1824 MpegEncContext * const s= (MpegEncContext *)c;
1825 const UINT8 *scantable= s->intra_scantable.permutated; 1825 const uint8_t *scantable= s->intra_scantable.permutated;
1826 uint64_t __align8 aligned_temp[sizeof(DCTELEM)*64/8]; 1826 uint64_t __align8 aligned_temp[sizeof(DCTELEM)*64/8];
1827 uint64_t __align8 aligned_bak[stride]; 1827 uint64_t __align8 aligned_bak[stride];
1828 DCTELEM * const temp= (DCTELEM*)aligned_temp; 1828 DCTELEM * const temp= (DCTELEM*)aligned_temp;
1829 uint8_t * const bak= (uint8_t*)aligned_bak; 1829 uint8_t * const bak= (uint8_t*)aligned_bak;
1830 int i, last, run, bits, level, distoration, start_i; 1830 int i, last, run, bits, level, distoration, start_i;
1894 return distoration + ((bits*s->qscale*s->qscale*109 + 64)>>7); 1894 return distoration + ((bits*s->qscale*s->qscale*109 + 64)>>7);
1895 } 1895 }
1896 1896
1897 static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride){ 1897 static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride){
1898 MpegEncContext * const s= (MpegEncContext *)c; 1898 MpegEncContext * const s= (MpegEncContext *)c;
1899 const UINT8 *scantable= s->intra_scantable.permutated; 1899 const uint8_t *scantable= s->intra_scantable.permutated;
1900 uint64_t __align8 aligned_temp[sizeof(DCTELEM)*64/8]; 1900 uint64_t __align8 aligned_temp[sizeof(DCTELEM)*64/8];
1901 DCTELEM * const temp= (DCTELEM*)aligned_temp; 1901 DCTELEM * const temp= (DCTELEM*)aligned_temp;
1902 int i, last, run, bits, level, start_i; 1902 int i, last, run, bits, level, start_i;
1903 const int esc_length= s->ac_esc_length; 1903 const int esc_length= s->ac_esc_length;
1904 uint8_t * length; 1904 uint8_t * length;