#define BITS_PER_GROUP GROUP_PARALLELISM
#define BIPG BITS_PER_GROUP
+// platform specific
+
+#ifdef __arm__
+#if !defined(MEMALIGN_VAL) || MEMALIGN_VAL<4
+#undef MEMALIGN_VAL
+#define MEMALIGN_VAL 4
+#endif
+#define COPY_UNALIGNED_PKT
+#endif
+
+//
+
#ifndef MALLOC
#define MALLOC(X) malloc(X)
#endif
#ifndef FREE
#define FREE(X) free(X)
#endif
-#ifndef MEMALIGN
+#ifdef MEMALIGN_VAL
+#define MEMALIGN __attribute__((aligned(MEMALIGN_VAL)))
+#else
#define MEMALIGN
#endif
MEMALIGN unsigned char stream_out[GROUP_PARALLELISM*8];
MEMALIGN unsigned char ib[GROUP_PARALLELISM*8];
MEMALIGN unsigned char block_out[GROUP_PARALLELISM*8];
+#ifdef COPY_UNALIGNED_PKT
+ unsigned char *unaligned[GROUP_PARALLELISM];
+ MEMALIGN unsigned char alignedBuff[GROUP_PARALLELISM][188];
+#endif
struct stream_regs regs;
//icc craziness i=(int)&pad1;//////////align!!! FIXME
encp[g]=g_pkt[g];
DBG(fprintf(stderr,"header[%i]=%p (%02x)\n",g,encp[g],*(encp[g])));
encp[g]+=g_offset[g]; // skip header
+#ifdef COPY_UNALIGNED_PKT
+ if(((int)encp[g])&0x03) {
+ memcpy(alignedBuff[g],encp[g],g_len[g]);
+ unaligned[g]=encp[g];
+ encp[g]=alignedBuff[g];
+ }
+ else unaligned[g]=0;
+#endif
FFTABLEIN(stream_in,g,encp[g]);
}
//dump_mem("stream_in",stream_in,GROUP_PARALLELISM*8,BYPG);
DBG(fprintf(stderr,"returning advanced=%i\n",advanced));
+#ifdef COPY_UNALIGNED_PKT
+ for(g=0;g<grouped;g++)
+ if(unaligned[g]) memcpy(unaligned[g],alignedBuff[g],g_len[g]);
+#endif
+
M_EMPTY(); // restore CPU multimedia state
return advanced;