diff options
Diffstat (limited to 'libavcodec/dsputil_template.c')
-rw-r--r-- | libavcodec/dsputil_template.c | 61 |
1 files changed, 31 insertions, 30 deletions
diff --git a/libavcodec/dsputil_template.c b/libavcodec/dsputil_template.c index 1dbeb71..201aa55 100644 --- a/libavcodec/dsputil_template.c +++ b/libavcodec/dsputil_template.c @@ -5,20 +5,20 @@ * * gmc & q-pel & 32/64 bit based MC by Michael Niedermayer <michaelni@gmx.at> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -31,10 +31,10 @@ /* draw the edges of width 'w' of an image of size width, height */ //FIXME check that this is ok for mpeg4 interlaced -static void FUNCC(draw_edges)(uint8_t *_buf, int _wrap, int width, int height, int w, int h, int sides) +static void FUNCC(draw_edges)(uint8_t *p_buf, int p_wrap, int width, int height, int w, int h, int sides) { - pixel *buf = (pixel*)_buf; - int wrap = _wrap / sizeof(pixel); + pixel *buf = (pixel*)p_buf; + int wrap = p_wrap / sizeof(pixel); pixel *ptr, *last_line; int i; @@ -66,12 +66,12 @@ static void FUNCC(draw_edges)(uint8_t *_buf, int _wrap, int width, int height, i } #define DCTELEM_FUNCS(dctcoef, suffix) \ -static void FUNCC(get_pixels ## suffix)(int16_t *restrict _block, \ +static void FUNCC(get_pixels ## suffix)(int16_t *av_restrict _block, \ const uint8_t *_pixels, \ int line_size) \ { \ const pixel *pixels = (const pixel *) _pixels; \ - dctcoef *restrict block = (dctcoef *) _block; \ + dctcoef *av_restrict block = (dctcoef *) _block; \ int i; \ \ /* read the pixels */ \ @@ -89,12 +89,12 @@ static void FUNCC(get_pixels ## suffix)(int16_t *restrict _block, \ } \ } \ \ -static void FUNCC(add_pixels8 ## suffix)(uint8_t *restrict _pixels, \ +static void FUNCC(add_pixels8 ## suffix)(uint8_t *av_restrict _pixels, \ int16_t *_block, \ int line_size) \ { \ int i; \ - pixel *restrict pixels = (pixel *restrict)_pixels; \ + pixel *av_restrict pixels = (pixel *av_restrict)_pixels; \ dctcoef *block = (dctcoef*)_block; \ line_size /= sizeof(pixel); \ \ @@ -112,12 +112,12 @@ static void FUNCC(add_pixels8 ## suffix)(uint8_t *restrict _pixels, \ } \ } \ \ -static void FUNCC(add_pixels4 ## suffix)(uint8_t *restrict _pixels, \ +static void FUNCC(add_pixels4 ## suffix)(uint8_t *av_restrict _pixels, \ int16_t *_block, \ int line_size) \ { \ int i; \ - pixel *restrict pixels = (pixel *restrict)_pixels; \ + pixel *av_restrict pixels = (pixel *av_restrict)_pixels; \ dctcoef *block = (dctcoef*)_block; \ line_size /= sizeof(pixel); \ \ @@ -293,7 +293,7 @@ static inline void FUNCC(OPNAME ## _pixels2_xy2)(uint8_t *_block, const uint8_t int i, a0, b0, a1, b1;\ pixel *block = (pixel*)_block;\ const pixel *pixels = (const pixel*)_pixels;\ - line_size /= sizeof(pixel);\ + line_size >>= sizeof(pixel)-1;\ a0= pixels[0];\ b0= pixels[1] + 2;\ a0 += b0;\ @@ -361,7 +361,7 @@ static inline void FUNCC(OPNAME ## _pixels4_xy2)(uint8_t *block, const uint8_t * }\ }\ \ -static inline void FUNCC(OPNAME ## _pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)\ +static inline void FUNCC(OPNAME ## _pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)\ {\ /* FIXME HIGH BIT DEPTH */\ int j;\ @@ -464,17 +464,17 @@ PIXOP2(put, op_put) #undef op_put #define H264_CHROMA_MC(OPNAME, OP)\ -static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\ - pixel *dst = (pixel*)_dst;\ - pixel *src = (pixel*)_src;\ +static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *p_dst/*align 8*/, uint8_t *p_src/*align 1*/, int stride, int h, int x, int y){\ + pixel *dst = (pixel*)p_dst;\ + pixel *src = (pixel*)p_src;\ const int A=(8-x)*(8-y);\ const int B=( x)*(8-y);\ const int C=(8-x)*( y);\ const int D=( x)*( y);\ int i;\ - stride /= sizeof(pixel);\ + stride >>= sizeof(pixel)-1;\ \ - assert(x<8 && y<8 && x>=0 && y>=0);\ + av_assert2(x<8 && y<8 && x>=0 && y>=0);\ \ if(D){\ for(i=0; i<h; i++){\ @@ -495,17 +495,17 @@ static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst/*align 8*/, uint8_t * }\ }\ \ -static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\ - pixel *dst = (pixel*)_dst;\ - pixel *src = (pixel*)_src;\ +static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *p_dst/*align 8*/, uint8_t *p_src/*align 1*/, int stride, int h, int x, int y){\ + pixel *dst = (pixel*)p_dst;\ + pixel *src = (pixel*)p_src;\ const int A=(8-x)*(8-y);\ const int B=( x)*(8-y);\ const int C=(8-x)*( y);\ const int D=( x)*( y);\ int i;\ - stride /= sizeof(pixel);\ + stride >>= sizeof(pixel)-1;\ \ - assert(x<8 && y<8 && x>=0 && y>=0);\ + av_assert2(x<8 && y<8 && x>=0 && y>=0);\ \ if(D){\ for(i=0; i<h; i++){\ @@ -530,17 +530,17 @@ static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst/*align 8*/, uint8_t * }\ }\ \ -static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\ - pixel *dst = (pixel*)_dst;\ - pixel *src = (pixel*)_src;\ +static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *p_dst/*align 8*/, uint8_t *p_src/*align 1*/, int stride, int h, int x, int y){\ + pixel *dst = (pixel*)p_dst;\ + pixel *src = (pixel*)p_src;\ const int A=(8-x)*(8-y);\ const int B=( x)*(8-y);\ const int C=(8-x)*( y);\ const int D=( x)*( y);\ int i;\ - stride /= sizeof(pixel);\ + stride >>= sizeof(pixel)-1;\ \ - assert(x<8 && y<8 && x>=0 && y>=0);\ + av_assert2(x<8 && y<8 && x>=0 && y>=0);\ \ if(D){\ for(i=0; i<h; i++){\ @@ -593,3 +593,4 @@ void FUNCC(ff_put_pixels16x16)(uint8_t *dst, uint8_t *src, int stride) { void FUNCC(ff_avg_pixels16x16)(uint8_t *dst, uint8_t *src, int stride) { FUNCC(avg_pixels16)(dst, src, stride, 16); } + |