[gbx]
[oscam.git] / ffdecsa / fftable.h
blob7553c8e7ae3bb09c4dc6e5257e465832c12ee127
1 /* FFdecsa -- fast decsa algorithm
3 * Copyright (C) 2007 Dark Avenger
4 * 2003-2004 fatih89r
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef FFTABLE_H
22 #define FFTABLE_H
24 inline static void FFTABLEIN(unsigned char *tab, int g, unsigned char *data)
26 #if 0
27 *(((int *)tab)+2*g)=*((int *)data);
28 *(((int *)tab)+2*g+1)=*(((int *)data)+1);
29 #else
30 *(((long long *)tab)+g)=*((long long *)data);
31 #endif
34 inline static void FFTABLEOUT(unsigned char *data, unsigned char *tab, int g)
36 #if 1
37 *((int *)data)=*(((int *)tab)+2*g);
38 *(((int *)data)+1)=*(((int *)tab)+2*g+1);
39 #else
40 *((long long *)data)=*(((long long *)tab)+g);
41 #endif
44 inline static void FFTABLEOUTXORNBY(int n, unsigned char *data, unsigned char *tab, int g)
46 int j;
47 for(j=0;j<n;j++) *(data+j)^=*(tab+8*g+j);
50 #undef XOREQ_BEST_BY
51 inline static void XOREQ_BEST_BY(unsigned char *d, unsigned char *s)
53 XOR_BEST_BY(d, d, s);
56 #endif //FFTABLE_H