diff --git a/libcelt/entcode.c b/libcelt/entcode.c index 205f1be2..bbb77fa7 100644 --- a/libcelt/entcode.c +++ b/libcelt/entcode.c @@ -6,17 +6,7 @@ -void ec_byte_reset(ec_byte_buffer *_b){ - _b->ptr=_b->buf; -} -long ec_byte_bytes(ec_byte_buffer *_b){ - return _b->ptr-_b->buf; -} - -unsigned char *ec_byte_get_buffer(ec_byte_buffer *_b){ - return _b->buf; -} diff --git a/libcelt/entcode.h b/libcelt/entcode.h index 86b7f2bd..4a907084 100644 --- a/libcelt/entcode.h +++ b/libcelt/entcode.h @@ -44,9 +44,17 @@ void ec_byte_adv4(ec_byte_buffer *_b); int ec_byte_read1(ec_byte_buffer *_b); int ec_byte_read4(ec_byte_buffer *_b,ec_uint32 *_val); /*Shared functions.*/ -void ec_byte_reset(ec_byte_buffer *_b); -long ec_byte_bytes(ec_byte_buffer *_b); -unsigned char *ec_byte_get_buffer(ec_byte_buffer *_b); +static inline void ec_byte_reset(ec_byte_buffer *_b){ + _b->ptr=_b->buf; +} + +static inline long ec_byte_bytes(ec_byte_buffer *_b){ + return _b->ptr-_b->buf; +} + +static inline unsigned char *ec_byte_get_buffer(ec_byte_buffer *_b){ + return _b->buf; +} int ec_ilog(ec_uint32 _v); int ec_ilog64(ec_uint64 _v); diff --git a/libcelt/rangedec.c b/libcelt/rangedec.c index 685ee251..067f7dc1 100644 --- a/libcelt/rangedec.c +++ b/libcelt/rangedec.c @@ -132,7 +132,7 @@ static int ec_dec_in(ec_dec *_this){ /*Normalizes the contents of dif and rng so that rng lies entirely in the high-order symbol.*/ -static void ec_dec_normalize(ec_dec *_this){ +static inline void ec_dec_normalize(ec_dec *_this){ /*If the range is too small, rescale it and input some bits.*/ while(_this->rng<=EC_CODE_BOT){ int sym; diff --git a/libcelt/rangeenc.c b/libcelt/rangeenc.c index 177fcb25..13bddd63 100644 --- a/libcelt/rangeenc.c +++ b/libcelt/rangeenc.c @@ -63,7 +63,7 @@ static void ec_enc_carry_out(ec_enc *_this,int _c){ else _this->ext++; } -static void ec_enc_normalize(ec_enc *_this){ +static inline void ec_enc_normalize(ec_enc *_this){ /*If the range is too small, output some bits and rescale it.*/ while(_this->rng<=EC_CODE_BOT){ ec_enc_carry_out(_this,(int)(_this->low>>EC_CODE_SHIFT));