diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2012-12-15 21:46:02 +0400 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2012-12-20 16:40:45 +0400 |
commit | 8c53d39e7f0604127bfc96fa1182c8abe3847ac6 (patch) | |
tree | 18495cabf7f0e6d365871d3407f2534f2b80b653 /libavcodec/dsputil_template.c | |
parent | a925f723a915bc0255e2673f8817af5212131763 (diff) |
lavc: introduce VideoDSPContext
Move some functions from dsputil. The idea is that videodsp contains
functions that are useful for a large and varied set of video decoders.
Currently, it contains emulated_edge_mc() and prefetch().
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/dsputil_template.c')
-rw-r--r-- | libavcodec/dsputil_template.c | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/libavcodec/dsputil_template.c b/libavcodec/dsputil_template.c index 72ed6bfd2a..13f7628b2e 100644 --- a/libavcodec/dsputil_template.c +++ b/libavcodec/dsputil_template.c @@ -113,85 +113,6 @@ static void FUNCC(draw_edges)(uint8_t *_buf, int _wrap, int width, int height, i memcpy(last_line + (i + 1) * wrap, last_line, (width + w + w) * sizeof(pixel)); // bottom } -/** - * Copy a rectangular area of samples to a temporary buffer and replicate the border samples. - * @param buf destination buffer - * @param src source buffer - * @param linesize number of bytes between 2 vertically adjacent samples in both the source and destination buffers - * @param block_w width of block - * @param block_h height of block - * @param src_x x coordinate of the top left sample of the block in the source buffer - * @param src_y y coordinate of the top left sample of the block in the source buffer - * @param w width of the source buffer - * @param h height of the source buffer - */ -void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src, int linesize, int block_w, int block_h, - int src_x, int src_y, int w, int h){ - int x, y; - int start_y, start_x, end_y, end_x; - - if(src_y>= h){ - src+= (h-1-src_y)*linesize; - src_y=h-1; - }else if(src_y<=-block_h){ - src+= (1-block_h-src_y)*linesize; - src_y=1-block_h; - } - if(src_x>= w){ - src+= (w-1-src_x)*sizeof(pixel); - src_x=w-1; - }else if(src_x<=-block_w){ - src+= (1-block_w-src_x)*sizeof(pixel); - src_x=1-block_w; - } - - start_y= FFMAX(0, -src_y); - start_x= FFMAX(0, -src_x); - end_y= FFMIN(block_h, h-src_y); - end_x= FFMIN(block_w, w-src_x); - assert(start_y < end_y && block_h); - assert(start_x < end_x && block_w); - - w = end_x - start_x; - src += start_y*linesize + start_x*sizeof(pixel); - buf += start_x*sizeof(pixel); - - //top - for(y=0; y<start_y; y++){ - memcpy(buf, src, w*sizeof(pixel)); - buf += linesize; - } - - // copy existing part - for(; y<end_y; y++){ - memcpy(buf, src, w*sizeof(pixel)); - src += linesize; - buf += linesize; - } - - //bottom - src -= linesize; - for(; y<block_h; y++){ - memcpy(buf, src, w*sizeof(pixel)); - buf += linesize; - } - - buf -= block_h * linesize + start_x*sizeof(pixel); - while (block_h--){ - pixel *bufp = (pixel*)buf; - //left - for(x=0; x<start_x; x++){ - bufp[x] = bufp[start_x]; - } - - //right - for(x=end_x; x<block_w; x++){ - bufp[x] = bufp[end_x - 1]; - } - buf += linesize; - } -} - #define DCTELEM_FUNCS(dctcoef, suffix) \ static void FUNCC(get_pixels ## suffix)(DCTELEM *restrict _block, \ const uint8_t *_pixels, \ |