comparison rangecoder.h @ 2967:ef2149182f1c libavcodec

COSMETICS: Remove all trailing whitespace.
author diego
date Sat, 17 Dec 2005 18:14:38 +0000
parents e25782262d7d
children 0b546eab515d
comparison
equal deleted inserted replaced
2966:564788471dd4 2967:ef2149182f1c
15 * You should have received a copy of the GNU Lesser General Public 15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software 16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * 18 *
19 */ 19 */
20 20
21 /** 21 /**
22 * @file rangecoder.h 22 * @file rangecoder.h
23 * Range coder. 23 * Range coder.
24 */ 24 */
25 25
56 *c->bytestream++ = 0x00; 56 *c->bytestream++ = 0x00;
57 c->outstanding_byte= (c->low>>8) & 0xFF; 57 c->outstanding_byte= (c->low>>8) & 0xFF;
58 }else{ 58 }else{
59 c->outstanding_count++; 59 c->outstanding_count++;
60 } 60 }
61 61
62 c->low = (c->low & 0xFF)<<8; 62 c->low = (c->low & 0xFF)<<8;
63 c->range <<= 8; 63 c->range <<= 8;
64 } 64 }
65 } 65 }
66 66
76 }else{ 76 }else{
77 c->low += c->range - range1; 77 c->low += c->range - range1;
78 c->range = range1; 78 c->range = range1;
79 *state= c->one_state[*state]; 79 *state= c->one_state[*state];
80 } 80 }
81 81
82 renorm_encoder(c); 82 renorm_encoder(c);
83 } 83 }
84 84
85 static inline void refill(RangeCoder *c){ 85 static inline void refill(RangeCoder *c){
86 if(c->range < 0x100){ 86 if(c->range < 0x100){
93 } 93 }
94 94
95 static inline int get_rac(RangeCoder *c, uint8_t * const state){ 95 static inline int get_rac(RangeCoder *c, uint8_t * const state){
96 int range1= (c->range * (*state)) >> 8; 96 int range1= (c->range * (*state)) >> 8;
97 int attribute_unused one_mask; 97 int attribute_unused one_mask;
98 98
99 c->range -= range1; 99 c->range -= range1;
100 #if 1 100 #if 1
101 if(c->low < c->range){ 101 if(c->low < c->range){
102 *state= c->zero_state[*state]; 102 *state= c->zero_state[*state];
103 refill(c); 103 refill(c);
109 refill(c); 109 refill(c);
110 return 1; 110 return 1;
111 } 111 }
112 #else 112 #else
113 one_mask= (c->range - c->low-1)>>31; 113 one_mask= (c->range - c->low-1)>>31;
114 114
115 c->low -= c->range & one_mask; 115 c->low -= c->range & one_mask;
116 c->range += (range1 - c->range) & one_mask; 116 c->range += (range1 - c->range) & one_mask;
117 117
118 *state= c->zero_state[(*state) + (256&one_mask)]; 118 *state= c->zero_state[(*state) + (256&one_mask)];
119 119
120 refill(c); 120 refill(c);
121 121
122 return one_mask&1; 122 return one_mask&1;
123 #endif 123 #endif
124 } 124 }