Commit 61f040dd authored by Loïc Le Loarer's avatar Loïc Le Loarer Committed by Michael Niedermayer

compile with TRACE define patch by (Loic <lll+ffmpeg m4x org>)

Originally committed as revision 3848 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent b6663a55
...@@ -773,25 +773,25 @@ static always_inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2], ...@@ -773,25 +773,25 @@ static always_inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2],
//#define TRACE //#define TRACE
#ifdef TRACE #ifdef TRACE
#include "avcodec.h"
static inline void print_bin(int bits, int n){ static inline void print_bin(int bits, int n){
int i; int i;
for(i=n-1; i>=0; i--){ for(i=n-1; i>=0; i--){
printf("%d", (bits>>i)&1); av_log(NULL, AV_LOG_DEBUG, "%d", (bits>>i)&1);
} }
for(i=n; i<24; i++) for(i=n; i<24; i++)
printf(" "); av_log(NULL, AV_LOG_DEBUG, " ");
} }
static inline int get_bits_trace(GetBitContext *s, int n, char *file, char *func, int line){ static inline int get_bits_trace(GetBitContext *s, int n, char *file, const char *func, int line){
int r= get_bits(s, n); int r= get_bits(s, n);
print_bin(r, n); print_bin(r, n);
printf("%5d %2d %3d bit @%5d in %s %s:%d\n", r, n, r, get_bits_count(s)-n, file, func, line); av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d bit @%5d in %s %s:%d\n", r, n, r, get_bits_count(s)-n, file, func, line);
return r; return r;
} }
static inline int get_vlc_trace(GetBitContext *s, VLC_TYPE (*table)[2], int bits, int max_depth, char *file, char *func, int line){ static inline int get_vlc_trace(GetBitContext *s, VLC_TYPE (*table)[2], int bits, int max_depth, char *file, const char *func, int line){
int show= show_bits(s, 24); int show= show_bits(s, 24);
int pos= get_bits_count(s); int pos= get_bits_count(s);
int r= get_vlc2(s, table, bits, max_depth); int r= get_vlc2(s, table, bits, max_depth);
...@@ -800,15 +800,15 @@ static inline int get_vlc_trace(GetBitContext *s, VLC_TYPE (*table)[2], int bits ...@@ -800,15 +800,15 @@ static inline int get_vlc_trace(GetBitContext *s, VLC_TYPE (*table)[2], int bits
print_bin(bits2, len); print_bin(bits2, len);
printf("%5d %2d %3d vlc @%5d in %s %s:%d\n", bits2, len, r, pos, file, func, line); av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d vlc @%5d in %s %s:%d\n", bits2, len, r, pos, file, func, line);
return r; return r;
} }
static inline int get_xbits_trace(GetBitContext *s, int n, char *file, char *func, int line){ static inline int get_xbits_trace(GetBitContext *s, int n, char *file, const char *func, int line){
int show= show_bits(s, n); int show= show_bits(s, n);
int r= get_xbits(s, n); int r= get_xbits(s, n);
print_bin(show, n); print_bin(show, n);
printf("%5d %2d %3d xbt @%5d in %s %s:%d\n", show, n, r, get_bits_count(s)-n, file, func, line); av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d xbt @%5d in %s %s:%d\n", show, n, r, get_bits_count(s)-n, file, func, line);
return r; return r;
} }
......
...@@ -283,7 +283,7 @@ static inline int get_sr_golomb_flac(GetBitContext *gb, int k, int limit, int es ...@@ -283,7 +283,7 @@ static inline int get_sr_golomb_flac(GetBitContext *gb, int k, int limit, int es
#ifdef TRACE #ifdef TRACE
static inline int get_ue(GetBitContext *s, char *file, char *func, int line){ static inline int get_ue(GetBitContext *s, char *file, const char *func, int line){
int show= show_bits(s, 24); int show= show_bits(s, 24);
int pos= get_bits_count(s); int pos= get_bits_count(s);
int i= get_ue_golomb(s); int i= get_ue_golomb(s);
...@@ -297,7 +297,7 @@ static inline int get_ue(GetBitContext *s, char *file, char *func, int line){ ...@@ -297,7 +297,7 @@ static inline int get_ue(GetBitContext *s, char *file, char *func, int line){
return i; return i;
} }
static inline int get_se(GetBitContext *s, char *file, char *func, int line){ static inline int get_se(GetBitContext *s, char *file, const char *func, int line){
int show= show_bits(s, 24); int show= show_bits(s, 24);
int pos= get_bits_count(s); int pos= get_bits_count(s);
int i= get_se_golomb(s); int i= get_se_golomb(s);
...@@ -311,7 +311,7 @@ static inline int get_se(GetBitContext *s, char *file, char *func, int line){ ...@@ -311,7 +311,7 @@ static inline int get_se(GetBitContext *s, char *file, char *func, int line){
return i; return i;
} }
static inline int get_te(GetBitContext *s, int r, char *file, char *func, int line){ static inline int get_te(GetBitContext *s, int r, char *file, const char *func, int line){
int show= show_bits(s, 24); int show= show_bits(s, 24);
int pos= get_bits_count(s); int pos= get_bits_count(s);
int i= get_te0_golomb(s, r); int i= get_te0_golomb(s, r);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment