Mercurial > libavcodec.hg
comparison dsputil.c @ 6437:5154ab444372 libavcodec
move draw_edges() into dsputil
author | aurel |
---|---|
date | Tue, 04 Mar 2008 00:07:41 +0000 |
parents | 7f9e2b5893fc |
children | e1dd408a7864 |
comparison
equal
deleted
inserted
replaced
6436:6491d3284f89 | 6437:5154ab444372 |
---|---|
401 | 401 |
402 int w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){ | 402 int w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){ |
403 return w_c(v, pix1, pix2, line_size, 32, h, 0); | 403 return w_c(v, pix1, pix2, line_size, 32, h, 0); |
404 } | 404 } |
405 #endif | 405 #endif |
406 | |
407 /* draw the edges of width 'w' of an image of size width, height */ | |
408 //FIXME check that this is ok for mpeg4 interlaced | |
409 static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w) | |
410 { | |
411 uint8_t *ptr, *last_line; | |
412 int i; | |
413 | |
414 last_line = buf + (height - 1) * wrap; | |
415 for(i=0;i<w;i++) { | |
416 /* top and bottom */ | |
417 memcpy(buf - (i + 1) * wrap, buf, width); | |
418 memcpy(last_line + (i + 1) * wrap, last_line, width); | |
419 } | |
420 /* left and right */ | |
421 ptr = buf; | |
422 for(i=0;i<height;i++) { | |
423 memset(ptr - w, ptr[0], w); | |
424 memset(ptr + width, ptr[width-1], w); | |
425 ptr += wrap; | |
426 } | |
427 /* corners */ | |
428 for(i=0;i<w;i++) { | |
429 memset(buf - (i + 1) * wrap - w, buf[0], w); /* top left */ | |
430 memset(buf - (i + 1) * wrap + width, buf[width-1], w); /* top right */ | |
431 memset(last_line + (i + 1) * wrap - w, last_line[0], w); /* top left */ | |
432 memset(last_line + (i + 1) * wrap + width, last_line[width-1], w); /* top right */ | |
433 } | |
434 } | |
406 | 435 |
407 static void get_pixels_c(DCTELEM *restrict block, const uint8_t *pixels, int line_size) | 436 static void get_pixels_c(DCTELEM *restrict block, const uint8_t *pixels, int line_size) |
408 { | 437 { |
409 int i; | 438 int i; |
410 | 439 |
4201 c->biweight_h264_pixels_tab[6]= biweight_h264_pixels4x4_c; | 4230 c->biweight_h264_pixels_tab[6]= biweight_h264_pixels4x4_c; |
4202 c->biweight_h264_pixels_tab[7]= biweight_h264_pixels4x2_c; | 4231 c->biweight_h264_pixels_tab[7]= biweight_h264_pixels4x2_c; |
4203 c->biweight_h264_pixels_tab[8]= biweight_h264_pixels2x4_c; | 4232 c->biweight_h264_pixels_tab[8]= biweight_h264_pixels2x4_c; |
4204 c->biweight_h264_pixels_tab[9]= biweight_h264_pixels2x2_c; | 4233 c->biweight_h264_pixels_tab[9]= biweight_h264_pixels2x2_c; |
4205 | 4234 |
4235 c->draw_edges = draw_edges_c; | |
4236 | |
4206 #ifdef CONFIG_CAVS_DECODER | 4237 #ifdef CONFIG_CAVS_DECODER |
4207 ff_cavsdsp_init(c,avctx); | 4238 ff_cavsdsp_init(c,avctx); |
4208 #endif | 4239 #endif |
4209 #if defined(CONFIG_VC1_DECODER) || defined(CONFIG_WMV3_DECODER) | 4240 #if defined(CONFIG_VC1_DECODER) || defined(CONFIG_WMV3_DECODER) |
4210 ff_vc1dsp_init(c,avctx); | 4241 ff_vc1dsp_init(c,avctx); |