X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fdct32.c;h=272e0dbf955bd9e0bca40f07ad1b35eebd8b4bf0;hb=295f13953dc57be8c2ad7e41f6254d0a036582a8;hp=4e843ee832b3f71aadb67461b4aa6f742749fffc;hpb=809b7a99b27548fdb12709b69dc7cacff0a20f01;p=ffmpeg diff --git a/libavcodec/dct32.c b/libavcodec/dct32.c index 4e843ee832b..272e0dbf955 100644 --- a/libavcodec/dct32.c +++ b/libavcodec/dct32.c @@ -2,27 +2,36 @@ * Template for the Discrete Cosine Transform for 32 samples * Copyright (c) 2001, 2002 Fabrice Bellard * - * This file is part of FFmpeg. + * This file is part of Libav. * - * FFmpeg is free software; you can redistribute it and/or + * Libav 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. * - * FFmpeg is distributed in the hope that it will be useful, + * Libav 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 FFmpeg; if not, write to the Free Software + * License along with Libav; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifdef DCT32_FLOAT +#include "dct32.h" +#include "mathops.h" + +#if DCT32_FLOAT +# define dct32 ff_dct32_float # define FIXHR(x) ((float)(x)) # define MULH3(x, y, s) ((s)*(y)*(x)) # define INTFLOAT float +#else +# define dct32 ff_dct32_fixed +# define FIXHR(a) ((int)((a) * (1LL<<32) + 0.5)) +# define MULH3(x, y, s) MULH((s)*(x), y) +# define INTFLOAT int #endif @@ -103,7 +112,7 @@ #define ADD(a, b) val##a += val##b /* DCT32 without 1/sqrt(2) coef zero scaling. */ -static void dct32(INTFLOAT *out, const INTFLOAT *tab) +void dct32(INTFLOAT *out, const INTFLOAT *tab) { INTFLOAT tmp0, tmp1;