Mercurial > libavcodec.hg
comparison dsputil.c @ 1984:ef919e9ef73e libavcodec
separate out put_signed_pixels_clamped() into its own function and
implement an optimized MMX version of the function
author | melanson |
---|---|
date | Tue, 27 Apr 2004 03:58:06 +0000 |
parents | 89422281f6f6 |
children | b6f2add2511e |
comparison
equal
deleted
inserted
replaced
1983:1205bf58c420 | 1984:ef919e9ef73e |
---|---|
327 pixels[6] = cm[block[6]]; | 327 pixels[6] = cm[block[6]]; |
328 pixels[7] = cm[block[7]]; | 328 pixels[7] = cm[block[7]]; |
329 | 329 |
330 pixels += line_size; | 330 pixels += line_size; |
331 block += 8; | 331 block += 8; |
332 } | |
333 } | |
334 | |
335 static void put_signed_pixels_clamped_c(const DCTELEM *block, | |
336 uint8_t *restrict pixels, | |
337 int line_size) | |
338 { | |
339 int i, j; | |
340 | |
341 for (i = 0; i < 8; i++) { | |
342 for (j = 0; j < 8; j++) { | |
343 if (*block < -128) | |
344 *pixels = 0; | |
345 else if (*block > 127) | |
346 *pixels = 255; | |
347 else | |
348 *pixels = (uint8_t)(*block + 128); | |
349 block++; | |
350 pixels++; | |
351 } | |
352 pixels += (line_size - 8); | |
332 } | 353 } |
333 } | 354 } |
334 | 355 |
335 static void add_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels, | 356 static void add_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels, |
336 int line_size) | 357 int line_size) |
3129 c->vp3_idct = vp3_idct_c; | 3150 c->vp3_idct = vp3_idct_c; |
3130 | 3151 |
3131 c->get_pixels = get_pixels_c; | 3152 c->get_pixels = get_pixels_c; |
3132 c->diff_pixels = diff_pixels_c; | 3153 c->diff_pixels = diff_pixels_c; |
3133 c->put_pixels_clamped = put_pixels_clamped_c; | 3154 c->put_pixels_clamped = put_pixels_clamped_c; |
3155 c->put_signed_pixels_clamped = put_signed_pixels_clamped_c; | |
3134 c->add_pixels_clamped = add_pixels_clamped_c; | 3156 c->add_pixels_clamped = add_pixels_clamped_c; |
3135 c->gmc1 = gmc1_c; | 3157 c->gmc1 = gmc1_c; |
3136 c->gmc = gmc_c; | 3158 c->gmc = gmc_c; |
3137 c->clear_blocks = clear_blocks_c; | 3159 c->clear_blocks = clear_blocks_c; |
3138 c->pix_sum = pix_sum_c; | 3160 c->pix_sum = pix_sum_c; |