X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fdsputil_template.c;h=58533d2ce959555b42bc819dd4bd53a5f6c603a7;hb=c137fdd778e1bb82c2f0d7fa4a88adc97058d6d4;hp=b85931856a190546aa96efdd4644184cad90c4f2;hpb=c90b94424cd4953a095d6d6648ba8d499e306b35;p=ffmpeg diff --git a/libavcodec/dsputil_template.c b/libavcodec/dsputil_template.c index b85931856a1..58533d2ce95 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 * - * 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 */ @@ -79,10 +79,10 @@ static inline void FUNC(copy_block16)(uint8_t *dst, const uint8_t *src, int dstS /* 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; @@ -192,12 +192,12 @@ void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src, int linesize, i } } -static void FUNCC(add_pixels8)(uint8_t *restrict _pixels, DCTELEM *_block, int line_size) +static void FUNCC(add_pixels8)(uint8_t *restrict p_pixels, DCTELEM *p_block, int line_size) { int i; - pixel *restrict pixels = (pixel *restrict)_pixels; - dctcoef *block = (dctcoef*)_block; - line_size /= sizeof(pixel); + pixel *restrict pixels = (pixel *restrict)p_pixels; + dctcoef *block = (dctcoef*)p_block; + line_size >>= sizeof(pixel)-1; for(i=0;i<8;i++) { pixels[0] += block[0]; @@ -213,12 +213,12 @@ static void FUNCC(add_pixels8)(uint8_t *restrict _pixels, DCTELEM *_block, int l } } -static void FUNCC(add_pixels4)(uint8_t *restrict _pixels, DCTELEM *_block, int line_size) +static void FUNCC(add_pixels4)(uint8_t *restrict p_pixels, DCTELEM *p_block, int line_size) { int i; - pixel *restrict pixels = (pixel *restrict)_pixels; - dctcoef *block = (dctcoef*)_block; - line_size /= sizeof(pixel); + pixel *restrict pixels = (pixel *restrict)p_pixels; + dctcoef *block = (dctcoef*)p_block; + line_size >>= sizeof(pixel)-1; for(i=0;i<4;i++) { pixels[0] += block[0]; @@ -582,12 +582,12 @@ static inline void FUNC(OPNAME ## _no_rnd_pixels16_l4)(uint8_t *dst, const uint8 FUNC(OPNAME ## _no_rnd_pixels8_l4)(dst+8*sizeof(pixel), src1+8*sizeof(pixel), src2+8*sizeof(pixel), src3+8*sizeof(pixel), src4+8*sizeof(pixel), dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\ }\ \ -static inline void FUNCC(OPNAME ## _pixels2_xy2)(uint8_t *_block, const uint8_t *_pixels, int line_size, int h)\ +static inline void FUNCC(OPNAME ## _pixels2_xy2)(uint8_t *p_block, const uint8_t *p_pixels, int line_size, int h)\ {\ int i, a0, b0, a1, b1;\ - pixel *block = (pixel*)_block;\ - const pixel *pixels = (const pixel*)_pixels;\ - line_size /= sizeof(pixel);\ + pixel *block = (pixel*)p_block;\ + const pixel *pixels = (const pixel*)p_pixels;\ + line_size >>= sizeof(pixel)-1;\ a0= pixels[0];\ b0= pixels[1] + 2;\ a0 += b0;\ @@ -769,15 +769,15 @@ static void FUNCC(put_no_rnd_pixels8_l2)(uint8_t *dst, const uint8_t *a, const u } #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);\ \ @@ -800,15 +800,15 @@ 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);\ \ @@ -835,15 +835,15 @@ 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);\ \ @@ -887,14 +887,14 @@ H264_CHROMA_MC(avg_ , op_avg) #undef op_put #define H264_LOWPASS(OPNAME, OP, OP2) \ -static av_unused void FUNC(OPNAME ## h264_qpel2_h_lowpass)(uint8_t *_dst, uint8_t *_src, int dstStride, int srcStride){\ +static av_unused void FUNC(OPNAME ## h264_qpel2_h_lowpass)(uint8_t *p_dst, uint8_t *p_src, int dstStride, int srcStride){\ const int h=2;\ INIT_CLIP\ int i;\ - pixel *dst = (pixel*)_dst;\ - pixel *src = (pixel*)_src;\ - dstStride /= sizeof(pixel);\ - srcStride /= sizeof(pixel);\ + pixel *dst = (pixel*)p_dst;\ + pixel *src = (pixel*)p_src;\ + dstStride >>= sizeof(pixel)-1;\ + srcStride >>= sizeof(pixel)-1;\ for(i=0; i>= sizeof(pixel)-1;\ + srcStride >>= sizeof(pixel)-1;\ for(i=0; i 9) ? (-10 * ((1<>= sizeof(pixel)-1;\ + srcStride >>= sizeof(pixel)-1;\ src -= 2*srcStride;\ for(i=0; i>= sizeof(pixel)-1;\ + srcStride >>= sizeof(pixel)-1;\ for(i=0; i>= sizeof(pixel)-1;\ + srcStride >>= sizeof(pixel)-1;\ for(i=0; i 9) ? (-10 * ((1<>= sizeof(pixel)-1;\ + srcStride >>= sizeof(pixel)-1;\ src -= 2*srcStride;\ for(i=0; i>= sizeof(pixel)-1;\ + srcStride >>= sizeof(pixel)-1;\ for(i=0; i>= sizeof(pixel)-1;\ + srcStride >>= sizeof(pixel)-1;\ for(i=0; i 9) ? (-10 * ((1<>= sizeof(pixel)-1;\ + srcStride >>= sizeof(pixel)-1;\ src -= 2*srcStride;\ for(i=0; i