Skip to content

Instantly share code, notes, and snippets.

@lu-zero
Forked from sasshka/gist:9fb9891ade4628145d3b
Last active March 4, 2016 21:53
Show Gist options
  • Save lu-zero/345107b2167368bd2d3a to your computer and use it in GitHub Desktop.
Save lu-zero/345107b2167368bd2d3a to your computer and use it in GitHub Desktop.
bitstream.h debugging
#define bistream_read_count(bb) ({\
int _ret = bitstream_read_count(bb); \
printf("%s:%d %s, read_count %d\n", __FILE__, __LINE__, __func__, _ret); \
_ret; \
})
#define bistream_read_bit(bb) ({\
int _ret = bitstream_read_bit(bb); \
printf("%s:%d %s, read_bit %d\n", __FILE__, __LINE__, __func__, _ret); \
_ret; \
})
#define bistream_read_32(bb, n) ({\
int _ret = bitstream_read_32(bb, n); \
printf("%s:%d %s, read_32 %d\n", __FILE__, __LINE__, __func__, _ret); \
_ret; \
})
#define bistream_show_32(bb, n) ({\
int _ret = bitstream_show_32(bb, n); \
printf("%s:%d %s, show_32 %d\n", __FILE__, __LINE__, __func__, _ret); \
_ret; \
})
#define bistream_read_xbits(bb, n) ({\
int _ret = bitstream_read_xbits(bb, n); \
printf("%s:%d %s, read_xbits %d\n", __FILE__, __LINE__, __func__, _ret); \
_ret; \
})
#define bistream_read_s32(bb, n) ({\
int _ret = bitstream_read_s32(bb, n); \
printf("%s:%d %s, read_s32 %d\n", __FILE__, __LINE__, __func__, _ret); \
_ret; \
})
#define bistream_read_s(bb, n) ({\
int _ret = bitstream_read_s(bb, n); \
printf("%s:%d %s, read_s %d\n", __FILE__, __LINE__, __func__, _ret); \
_ret; \
})
#define bitstream_show_left(bb) ({\
int _ret = bitstream_show_left(bb); \
printf("%s:%d %s, show_left %d\n", __FILE__, __LINE__, __func__, _ret); \
_ret; \
})
#define bitstream_read_vlc(bb, table, bits, max) ({\
int _ret = bitstream_read_vlc(bb, table, bits, max); \
printf("%s:%d %s, show_left %d\n", __FILE__, __LINE__, __func__, _ret); \
_ret; \
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment