#include #include #include "ac.h" /* Use random() and srandom() if you have them (Unix-like systems do). */ /* #define RANDOM random #define SRANDOM srandom */ /* Otherwise, use rand() and srand() from the standard C library. */ /* rand() is not very random, but will do for the demonstration here. */ #define RANDOM rand #define SRANDOM srand /* Do not change these to rand and srand, they are declared in stdlib.h. */ /* If the system declares these in a header, these two lines can be removed. */ long random (); void srandom (unsigned); #define NUMLOOPS 10000 #define ADAPT 1 #define FILE1 "foo" #define FILE2 "bar" #define MASK1 ((0x1<<3) - 1) #define MASK2 ((0x1<<5) - 1) #define NSYM1 (MASK1 + 1) #define NSYM2 (MASK2 + 1) int main () { ac_encoder ace1; ac_encoder ace2; ac_decoder acd1; ac_decoder acd2; ac_model acm1; ac_model acm2; int sym, i; ac_encoder_init (&ace1, FILE1); ac_encoder_init (&ace2, FILE2); ac_model_init (&acm1, NSYM1, NULL, ADAPT); ac_model_init (&acm2, NSYM2, NULL, ADAPT); SRANDOM (0); for (i=0; i