#ifndef DEFINES_H #define DEFINES_H // Fixed Point typedef int fix; #define DB 16 #define FIX(x) ((x)<>DB) // fixed to int fix fmul(fix x, fix y) { int64_t p = (int64_t)x * (int64_t)y; return (int32_t)(p >> DB); } fix ffrac(fix f) { return f & ((1 << DB) - 1); } float fixtof(fix f) { return ((float)f)/(1<