# HG changeset patch # User michael # Date 1212177619 0 # Node ID 97798862a4140cb531cd2de4f40e895c5bae4d1e # Parent 24e01f7cc819ca425704970fd863906bda31c89f Little helper macro to make the use of INIT_VLC_USE_NEW_STATIC easier. diff -r 24e01f7cc819 -r 97798862a414 bitstream.h --- a/bitstream.h Fri May 30 19:48:02 2008 +0000 +++ b/bitstream.h Fri May 30 20:00:19 2008 +0000 @@ -805,6 +805,15 @@ #define INIT_VLC_USE_NEW_STATIC 4 void free_vlc(VLC *vlc); +#define INIT_VLC_STATIC(vlc, bits, a,b,c,d,e,f,g, static_size)\ +{\ + static VLC_TYPE table[static_size][2];\ + (vlc)->table= table;\ + (vlc)->table_allocated= static_size;\ + init_vlc(vlc, bits, a,b,c,d,e,f,g, INIT_VLC_USE_NEW_STATIC);\ +} + + /** * * if the vlc code is invalid and max_depth=1 than no bits will be removed