From: Andre Noll Date: Mon, 5 Jun 2017 15:08:58 +0000 (+0200) Subject: wma: Remove pointless VLC_TYPE define. X-Git-Tag: v0.6.1~44^2~8 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=c8829b0bbe3c634ef64accfd88686c5895013e86;ds=sidebyside wma: Remove pointless VLC_TYPE define. It was defined to int16_t which only obfuscates the code. --- diff --git a/bitstream.c b/bitstream.c index 9cd1273c..a2a0537a 100644 --- a/bitstream.c +++ b/bitstream.c @@ -47,7 +47,7 @@ static void alloc_table(struct vlc *vlc, int size) if (vlc->table_size > vlc->table_allocated) { vlc->table_allocated += (1 << vlc->bits); vlc->table = para_realloc(vlc->table, - sizeof(VLC_TYPE) * 2 * vlc->table_allocated); + sizeof(int16_t) * 2 * vlc->table_allocated); } } @@ -57,7 +57,7 @@ static int build_table(struct vlc *vlc, int table_nb_bits, int nb_codes, { int i, j, k, n, table_size, table_index, nb, n1, idx; uint32_t code; - VLC_TYPE(*table)[2]; + int16_t (*table)[2]; table_size = 1 << table_nb_bits; table_index = vlc->table_size; @@ -173,7 +173,7 @@ void free_vlc(struct vlc *vlc) * * \return The vlc code. */ -int get_vlc(struct getbit_context *gbc, VLC_TYPE(*table)[2], int bits) +int get_vlc(struct getbit_context *gbc, int16_t (*table)[2], int bits) { int n, idx, nb_bits, code; diff --git a/bitstream.h b/bitstream.h index 3bcd2759..bed370ff 100644 --- a/bitstream.h +++ b/bitstream.h @@ -19,14 +19,12 @@ struct getbit_context { int index; }; -#define VLC_TYPE int16_t - /** A variable length code table. */ struct vlc { /** Number of bits of the table. */ int bits; /** The code and the bits table. */ - VLC_TYPE(*table)[2]; + int16_t (*table)[2]; /** The size of the table. */ int table_size; /** Amount of memory allocated so far. */ @@ -98,4 +96,4 @@ static inline void init_get_bits(struct getbit_context *gbc, void init_vlc(struct vlc *vlc, int nb_bits, int nb_codes, const void *bits, const void *codes, int codes_size); void free_vlc(struct vlc *vlc); -int get_vlc(struct getbit_context *gbc, VLC_TYPE(*table)[2], int bits); +int get_vlc(struct getbit_context *gbc, int16_t (*table)[2], int bits);