Mercurial > libavcodec.hg
comparison dsputil.c @ 884:2cef5c4c0ca6 libavcodec
* altivec and pix_norm patch by Brian Foley
author | kabi |
---|---|
date | Fri, 22 Nov 2002 07:53:06 +0000 |
parents | 34943cb0c2fb |
children | 8ae1e4c24e91 |
comparison
equal
deleted
inserted
replaced
883:b0d29bf1cecd | 884:2cef5c4c0ca6 |
---|---|
141 pix += line_size - 16; | 141 pix += line_size - 16; |
142 } | 142 } |
143 return s; | 143 return s; |
144 } | 144 } |
145 | 145 |
146 | |
147 static int pix_norm_c(UINT8 * pix1, UINT8 * pix2, int line_size) | |
148 { | |
149 int s, i, j; | |
150 UINT32 *sq = squareTbl + 256; | |
151 | |
152 s = 0; | |
153 for (i = 0; i < 16; i++) { | |
154 for (j = 0; j < 16; j += 8) { | |
155 s += sq[pix1[0] - pix2[0]]; | |
156 s += sq[pix1[1] - pix2[1]]; | |
157 s += sq[pix1[2] - pix2[2]]; | |
158 s += sq[pix1[3] - pix2[3]]; | |
159 s += sq[pix1[4] - pix2[4]]; | |
160 s += sq[pix1[5] - pix2[5]]; | |
161 s += sq[pix1[6] - pix2[6]]; | |
162 s += sq[pix1[7] - pix2[7]]; | |
163 pix1 += 8; | |
164 pix2 += 8; | |
165 } | |
166 pix1 += line_size - 16; | |
167 pix2 += line_size - 16; | |
168 } | |
169 return s; | |
170 } | |
146 | 171 |
147 static void get_pixels_c(DCTELEM *restrict block, const UINT8 *pixels, int line_size) | 172 static void get_pixels_c(DCTELEM *restrict block, const UINT8 *pixels, int line_size) |
148 { | 173 { |
149 int i; | 174 int i; |
150 | 175 |
1402 c->gmc1 = gmc1_c; | 1427 c->gmc1 = gmc1_c; |
1403 c->gmc = gmc_c; | 1428 c->gmc = gmc_c; |
1404 c->clear_blocks = clear_blocks_c; | 1429 c->clear_blocks = clear_blocks_c; |
1405 c->pix_sum = pix_sum_c; | 1430 c->pix_sum = pix_sum_c; |
1406 c->pix_norm1 = pix_norm1_c; | 1431 c->pix_norm1 = pix_norm1_c; |
1432 c->pix_norm = pix_norm_c; | |
1407 | 1433 |
1408 /* TODO [0] 16 [1] 8 */ | 1434 /* TODO [0] 16 [1] 8 */ |
1409 c->pix_abs16x16 = pix_abs16x16_c; | 1435 c->pix_abs16x16 = pix_abs16x16_c; |
1410 c->pix_abs16x16_x2 = pix_abs16x16_x2_c; | 1436 c->pix_abs16x16_x2 = pix_abs16x16_x2_c; |
1411 c->pix_abs16x16_y2 = pix_abs16x16_y2_c; | 1437 c->pix_abs16x16_y2 = pix_abs16x16_y2_c; |