X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=fec.c;h=2301cc8d2d4653b8bc82a8bcc46b5867b5d7af14;hp=233a87803ebcf06fe38d172473cfa15e23b17c96;hb=d4b040af5e31260dbf71f4547484179f32be4746;hpb=290d89f17769d1ad8fe9abb5e432939268f74f1a;ds=sidebyside diff --git a/fec.c b/fec.c index 233a8780..2301cc8d 100644 --- a/fec.c +++ b/fec.c @@ -74,7 +74,7 @@ static unsigned char gf_mul_table[GF_SIZE + 1][GF_SIZE + 1]; #define gf_mul(x,y) gf_mul_table[x][y] /* Compute x % GF_SIZE without a slow divide. */ -static inline unsigned char modnn(int x) +__a_const static inline unsigned char modnn(int x) { while (x >= GF_SIZE) { x -= GF_SIZE; @@ -182,11 +182,15 @@ static void generate_gf(void) static void addmul(unsigned char *dst1, const unsigned char *src1, unsigned char c, int sz) { + unsigned char *dst, *lim, *col; + const unsigned char *src = src1; + if (c == 0) return; - unsigned char *dst = dst1, *lim = &dst[sz - UNROLL + 1], - *col = gf_mul_table[c]; - const unsigned char *src = src1; + + dst = dst1; + lim = &dst[sz - UNROLL + 1]; + col = gf_mul_table[c]; for (; dst < lim; dst += UNROLL, src += UNROLL) { dst[0] ^= col[src[0]];