|
SASC
DVBSoftCAM
|
00001 /* FFdecsa -- fast decsa algorithm 00002 * 00003 * Copyright (C) 2007 Dark Avenger 00004 * 2003-2004 fatih89r 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 */ 00020 00021 #ifndef FFTABLE_H 00022 #define FFTABLE_H 00023 00024 void static inline FFTABLEIN(unsigned char *tab, int g, unsigned char *data) 00025 { 00026 #if 0 00027 *(((int *)tab)+2*g)=*((int *)data); 00028 *(((int *)tab)+2*g+1)=*(((int *)data)+1); 00029 #else 00030 *(((long long *)tab)+g)=*((long long *)data); 00031 #endif 00032 } 00033 00034 void static inline FFTABLEOUT(unsigned char *data, unsigned char *tab, int g) 00035 { 00036 #if 1 00037 *((int *)data)=*(((int *)tab)+2*g); 00038 *(((int *)data)+1)=*(((int *)tab)+2*g+1); 00039 #else 00040 *((long long *)data)=*(((long long *)tab)+g); 00041 #endif 00042 } 00043 00044 void static inline FFTABLEOUTXORNBY(int n, unsigned char *data, unsigned char *tab, int g) 00045 { 00046 for(int j=0;j<n;j++) *(data+j)^=*(tab+8*g+j); 00047 } 00048 00049 #undef XOREQ_BEST_BY 00050 static inline void XOREQ_BEST_BY(unsigned char *d, unsigned char *s) 00051 { 00052 XOR_BEST_BY(d, d, s); 00053 } 00054 00055 #endif //FFTABLE_H