yading@10: /* yading@10: * Floating point AAN IDCT yading@10: * Copyright (c) 2008 Michael Niedermayer yading@10: * yading@10: * This file is part of FFmpeg. yading@10: * yading@10: * FFmpeg is free software; you can redistribute it and/or yading@10: * modify it under the terms of the GNU Lesser General Public yading@10: * License as published by the Free Software Foundation; either yading@10: * version 2.1 of the License, or (at your option) any later version. yading@10: * yading@10: * FFmpeg is distributed in the hope that it will be useful, yading@10: * but WITHOUT ANY WARRANTY; without even the implied warranty of yading@10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU yading@10: * Lesser General Public License for more details. yading@10: * yading@10: * You should have received a copy of the GNU Lesser General Public yading@10: * License along with FFmpeg; if not, write to the Free Software yading@10: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA yading@10: */ yading@10: #include "faanidct.h" yading@10: #include "libavutil/common.h" yading@10: yading@10: /* To allow switching to double. */ yading@10: #define FLOAT float yading@10: yading@10: #define B0 1.0000000000000000000000 yading@10: #define B1 1.3870398453221474618216 // cos(pi*1/16)sqrt(2) yading@10: #define B2 1.3065629648763765278566 // cos(pi*2/16)sqrt(2) yading@10: #define B3 1.1758756024193587169745 // cos(pi*3/16)sqrt(2) yading@10: #define B4 1.0000000000000000000000 // cos(pi*4/16)sqrt(2) yading@10: #define B5 0.7856949583871021812779 // cos(pi*5/16)sqrt(2) yading@10: #define B6 0.5411961001461969843997 // cos(pi*6/16)sqrt(2) yading@10: #define B7 0.2758993792829430123360 // cos(pi*7/16)sqrt(2) yading@10: yading@10: #define A4 0.70710678118654752438 // cos(pi*4/16) yading@10: #define A2 0.92387953251128675613 // cos(pi*2/16) yading@10: yading@10: static const FLOAT prescale[64]={ yading@10: B0*B0/8, B0*B1/8, B0*B2/8, B0*B3/8, B0*B4/8, B0*B5/8, B0*B6/8, B0*B7/8, yading@10: B1*B0/8, B1*B1/8, B1*B2/8, B1*B3/8, B1*B4/8, B1*B5/8, B1*B6/8, B1*B7/8, yading@10: B2*B0/8, B2*B1/8, B2*B2/8, B2*B3/8, B2*B4/8, B2*B5/8, B2*B6/8, B2*B7/8, yading@10: B3*B0/8, B3*B1/8, B3*B2/8, B3*B3/8, B3*B4/8, B3*B5/8, B3*B6/8, B3*B7/8, yading@10: B4*B0/8, B4*B1/8, B4*B2/8, B4*B3/8, B4*B4/8, B4*B5/8, B4*B6/8, B4*B7/8, yading@10: B5*B0/8, B5*B1/8, B5*B2/8, B5*B3/8, B5*B4/8, B5*B5/8, B5*B6/8, B5*B7/8, yading@10: B6*B0/8, B6*B1/8, B6*B2/8, B6*B3/8, B6*B4/8, B6*B5/8, B6*B6/8, B6*B7/8, yading@10: B7*B0/8, B7*B1/8, B7*B2/8, B7*B3/8, B7*B4/8, B7*B5/8, B7*B6/8, B7*B7/8, yading@10: }; yading@10: yading@10: static inline void p8idct(int16_t data[64], FLOAT temp[64], uint8_t *dest, int stride, int x, int y, int type){ yading@10: int i; yading@10: FLOAT av_unused tmp0; yading@10: FLOAT s04, d04, s17, d17, s26, d26, s53, d53; yading@10: FLOAT os07, os16, os25, os34; yading@10: FLOAT od07, od16, od25, od34; yading@10: yading@10: for(i=0; i