Lines Matching refs:_this

91 static int ec_read_byte(ec_dec *_this){
92 return _this->offs<_this->storage?_this->buf[_this->offs++]:0;
95 static int ec_read_byte_from_end(ec_dec *_this){
96 return _this->end_offs<_this->storage?
97 _this->buf[_this->storage-++(_this->end_offs)]:0;
102 static void ec_dec_normalize(ec_dec *_this){
104 while(_this->rng<=EC_CODE_BOT){
106 _this->nbits_total+=EC_SYM_BITS;
107 _this->rng<<=EC_SYM_BITS;
109 sym=_this->rem;
111 _this->rem=ec_read_byte(_this);
113 sym=(sym<<EC_SYM_BITS|_this->rem)>>(EC_SYM_BITS-EC_CODE_EXTRA);
115 _this->val=((_this->val<<EC_SYM_BITS)+(EC_SYM_MAX&~sym))&(EC_CODE_TOP-1);
119 void ec_dec_init(ec_dec *_this,unsigned char *_buf,opus_uint32 _storage){
120 _this->buf=_buf;
121 _this->storage=_storage;
122 _this->end_offs=0;
123 _this->end_window=0;
124 _this->nend_bits=0;
128 _this->nbits_total=EC_CODE_BITS+1
130 _this->offs=0;
131 _this->rng=1U<<EC_CODE_EXTRA;
132 _this->rem=ec_read_byte(_this);
133 _this->val=_this->rng-1-(_this->rem>>(EC_SYM_BITS-EC_CODE_EXTRA));
134 _this->error=0;
136 ec_dec_normalize(_this);
139 unsigned ec_decode(ec_dec *_this,unsigned _ft){
141 _this->ext=_this->rng/_ft;
142 s=(unsigned)(_this->val/_this->ext);
146 unsigned ec_decode_bin(ec_dec *_this,unsigned _bits){
148 _this->ext=_this->rng>>_bits;
149 s=(unsigned)(_this->val/_this->ext);
153 void ec_dec_update(ec_dec *_this,unsigned _fl,unsigned _fh,unsigned _ft){
155 s=IMUL32(_this->ext,_ft-_fh);
156 _this->val-=s;
157 _this->rng=_fl>0?IMUL32(_this->ext,_fh-_fl):_this->rng-s;
158 ec_dec_normalize(_this);
162 int ec_dec_bit_logp(ec_dec *_this,unsigned _logp){
167 r=_this->rng;
168 d=_this->val;
171 if(!ret)_this->val=d-s;
172 _this->rng=ret?s:r-s;
173 ec_dec_normalize(_this);
177 int ec_dec_icdf(ec_dec *_this,const unsigned char *_icdf,unsigned _ftb){
183 s=_this->rng;
184 d=_this->val;
192 _this->val=d-s;
193 _this->rng=t-s;
194 ec_dec_normalize(_this);
198 opus_uint32 ec_dec_uint(ec_dec *_this,opus_uint32 _ft){
210 s=ec_decode(_this,ft);
211 ec_dec_update(_this,s,s+1,ft);
212 t=(opus_uint32)s<<ftb|ec_dec_bits(_this,ftb);
214 _this->error=1;
219 s=ec_decode(_this,(unsigned)_ft);
220 ec_dec_update(_this,s,s+1,(unsigned)_ft);
225 opus_uint32 ec_dec_bits(ec_dec *_this,unsigned _bits){
229 window=_this->end_window;
230 available=_this->nend_bits;
233 window|=(ec_window)ec_read_byte_from_end(_this)<<available;
241 _this->end_window=window;
242 _this->nend_bits=available;
243 _this->nbits_total+=_bits;