-#ifdef DEBUG_TRACE
-#include <stdarg.h>
-int frame_count;
-
-static FILE *flog;
-
-void trace(const char *fmt, ...)
-{
- va_list ap;
-
-
- if (!flog) {
- flog = fopen("/tmp/out.log", "w");
- setlinebuf(flog);
- }
-
- va_start(ap, fmt);
- vfprintf(flog, fmt, ap);
- va_end(ap);
-}
-
-#define get_bits(s, n) get_bits_trace(s, n)
-#define get_vlc(s, vlc) get_vlc_trace(s, vlc)
-
-unsigned int get_bits_trace(GetBitContext *s, int n)
-{
- unsigned int val;
- val = (get_bits)(s, n);
- trace("get_bits(%d) : 0x%x\n", n, val);
- return val;
-}
-
-static int get_vlc_trace(GetBitContext *s, VLC *vlc)
-{
- int code;
- code = (get_vlc)(s, vlc);
- trace("get_vlc() : %d\n", code);
- return code;
-}
-