<trclass="memitem:ad72778b38786be93fa55aa983501010d"><tdclass="memTemplParams"colspan="2">template<typename T ></td></tr>
<trclass="memitem:ad72778b38786be93fa55aa983501010d"><tdclass="memTemplItemLeft"align="right"valign="top">bool </td><tdclass="memTemplItemRight"valign="bottom"><aclass="el"href="../../d6/da9/classshaka_1_1media_1_1BitReader.html#ad72778b38786be93fa55aa983501010d">ReadBits</a> (int num_bits, T *out)</td></tr>
<trclass="memitem:a83d80cc51b96ca864a44fa169ce9c67a"><tdclass="memItemLeft"align="right"valign="top">bool </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="../../d6/da9/classshaka_1_1media_1_1BitReader.html#a83d80cc51b96ca864a44fa169ce9c67a">SkipBitsConditional</a> (bool condition, int num_bits)</td></tr>
<divclass="textblock"><p>A class to read bit streams. </p>
<p>Definition at line <aclass="el"href="../../d4/dd3/bit__reader_8h_source.html#l00017">17</a> of file <aclass="el"href="../../d4/dd3/bit__reader_8h_source.html">bit_reader.h</a>.</p>
</div><h2class="groupheader">Constructor & Destructor Documentation</h2>
<p>Initialize the <aclass="el"href="../../d6/da9/classshaka_1_1media_1_1BitReader.html"title="A class to read bit streams. ">BitReader</a> object to read a data buffer. </p>
<tr><tdclass="paramname">data</td><td>points to the beginning of the buffer. </td></tr>
<tr><tdclass="paramname">size</td><td>is the buffer size in bytes. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="../../d5/de0/bit__reader_8cc_source.html#l00012">12</a> of file <aclass="el"href="../../d5/de0/bit__reader_8cc_source.html">bit_reader.cc</a>.</p>
</div>
</div>
<h2class="groupheader">Member Function Documentation</h2>
<dlclass="section return"><dt>Returns</dt><dd>The current bit position. </dd></dl>
<p>Definition at line <aclass="el"href="../../d4/dd3/bit__reader_8h_source.html#l00081">81</a> of file <aclass="el"href="../../d4/dd3/bit__reader_8h_source.html">bit_reader.h</a>.</p>
<p>Definition at line <aclass="el"href="../../d4/dd3/bit__reader_8h_source.html#l00076">76</a> of file <aclass="el"href="../../d4/dd3/bit__reader_8h_source.html">bit_reader.h</a>.</p>
<tr><tdclass="paramdir"></td><tdclass="paramname">num_bits</td><td>specifies the number of bits to read. It cannot be larger than the number of bits the type can hold. </td></tr>
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">out</td><td>stores the output. The type <b>T</b> has to be a primitive integer type. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>false if the given number of bits cannot be read (not enough bits in the stream), true otherwise. When false is returned, the stream will enter a state where further ReadBits/SkipBits operations will always return false unless <em>num_bits</em> is 0. </dd></dl>
<p>Definition at line <aclass="el"href="../../d4/dd3/bit__reader_8h_source.html#l00035">35</a> of file <aclass="el"href="../../d4/dd3/bit__reader_8h_source.html">bit_reader.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>false if the given number of bits cannot be skipped (not enough bits in the stream), true otherwise. When false is returned, the stream will enter a state where further ReadXXX/SkipXXX operations will always return false unless |num_bits/bytes| is 0. </dd></dl>
<p>Definition at line <aclass="el"href="../../d5/de0/bit__reader_8cc_source.html#l00024">24</a> of file <aclass="el"href="../../d5/de0/bit__reader_8cc_source.html">bit_reader.cc</a>.</p>
<p>Read one bit then skip the number of bits specified if that bit matches <em>condition</em>. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">condition</td><td>indicates when the number of bits should be skipped. </td></tr>
<tr><tdclass="paramname">num_bits</td><td>specifies the number of bits to be skipped. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>false if the one bit cannot be read (not enough bits in the stream) or if the bit is set but the given number of bits cannot be skipped (not enough bits in the stream), true otherwise. When false is returned, the stream will enter a state where further ReadXXX/SkipXXX operations will always return false. </dd></dl>
<p>Definition at line <aclass="el"href="../../d4/dd3/bit__reader_8h_source.html#l00060">60</a> of file <aclass="el"href="../../d4/dd3/bit__reader_8h_source.html">bit_reader.h</a>.</p>
<p>Skip a number of bytes from stream. The current posision should be byte aligned, otherwise a false is returned and bytes are not skipped. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">num_bytes</td><td>specifies the number of bytes to be skipped. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>false if the current position is not byte aligned or if the given number of bytes cannot be skipped (not enough bytes in the stream), true otherwise. </dd></dl>
<p>Definition at line <aclass="el"href="../../d5/de0/bit__reader_8cc_source.html#l00056">56</a> of file <aclass="el"href="../../d5/de0/bit__reader_8cc_source.html">bit_reader.cc</a>.</p>