| 113 | } |
| 114 | |
| 115 | STATIC |
| 116 | UINT32 |
| 117 | GetBits ( |
| 118 | IN SCRATCH_DATA *Sd, |
| 119 | IN UINT16 NumOfBits |
| 120 | ) |
| 121 | /*++ |
| 122 | |
| 123 | Routine Description: |
| 124 | |
| 125 | Get NumOfBits of bits out from mBitBuf. Fill mBitBuf with subsequent |
| 126 | NumOfBits of bits from source. Returns NumOfBits of bits that are |
| 127 | popped out. |
| 128 | |
| 129 | Arguments: |
| 130 | |
| 131 | Sd - The global scratch data. |
| 132 | NumOfBits - The number of bits to pop and read. |
| 133 | |
| 134 | Returns: |
| 135 | |
| 136 | The bits that are popped out. |
| 137 | |
| 138 | --*/ |
| 139 | { |
| 140 | UINT32 OutBits; |
| 141 | |
| 142 | OutBits = (UINT32) (Sd->mBitBuf >> (BITBUFSIZ - NumOfBits)); |
| 143 | |
| 144 | FillBuf (Sd, NumOfBits); |
| 145 | |
| 146 | return OutBits; |
| 147 | } |
| 148 | |
| 149 | STATIC |
| 150 | UINT16 |