exip  Alpha 0.5.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
ioUtil.h File Reference

Common utilities for StreamIO module. More...

#include "procTypes.h"
#include "errorHandle.h"

Go to the source code of this file.

Functions

void moveBitPointer (EXIStream *strm, unsigned int bitPositions)
 Moves the BitPointer with certain positions. More...
 
unsigned char getBitsNumber (uint64_t val)
 Determine the number of bits needed to encode an unsigned integer value ⌈ log 2 m ⌉ from the spec is equal to getBitsNumber(m - 1) More...
 
unsigned int log2INT (uint64_t val)
 Log2 function. More...
 
errorCode readEXIChunkForParsing (EXIStream *strm, unsigned int numBytesToBeRead)
 Reads an EXI stream chunk using buffer.ioStrm.readWriteToStream if available. More...
 
errorCode writeEncodedEXIChunk (EXIStream *strm)
 Flushes the EXI buffer using buffer.ioStrm.readWriteToStream if available. More...
 

Detailed Description

Date
Oct 26, 2010
Author
Rumen Kyusakov
Version
0.5
[Revision] $Id: ioUtil.h 344 2014-11-17 16:08:37Z kjussakov $

Definition in file ioUtil.h.

Function Documentation

unsigned char getBitsNumber ( uint64_t  val)
Parameters
[in]valunsigned integer value
Returns
The number of bits needed

Definition at line 37 of file ioUtil.c.

unsigned int log2INT ( uint64_t  val)

Used to determine the number of bits needed to encode a unsigned integer value The code taken from: http://www-graphics.stanford.edu/~seander/bithacks.html#IntegerLog

Parameters
[in]valuint32_t value
Returns
The number of bits needed

Definition at line 83 of file ioUtil.c.

void moveBitPointer ( EXIStream strm,
unsigned int  bitPositions 
)

Takes care of byteIndex increasing when the movement cross a byte boundary

Parameters
[in]strmEXI stream of bits
[in]bitPositionsthe number of bit positions to move the pointer

Definition at line 20 of file ioUtil.c.

errorCode readEXIChunkForParsing ( EXIStream strm,
unsigned int  numBytesToBeRead 
)
Parameters
[in]strmEXI stream of bits
[in]numBytesToBeReadthe number of bytes that are requested for parsing
Returns
The number of bits needed

Definition at line 101 of file ioUtil.c.

errorCode writeEncodedEXIChunk ( EXIStream strm)
Parameters
[in]strmEXI stream of bits
Returns
The number of bits needed

Definition at line 130 of file ioUtil.c.