annexb.c File Reference

Annex B Byte Stream format. More...

#include "global.h"
#include "annexb.h"
#include "memalloc.h"

Include dependency graph for annexb.c:

Go to the source code of this file.

Functions

static int getChunk ()
static byte getfbyte ()
static int FindStartCode (unsigned char *Buf, int zeros_in_startcode)
int GetAnnexbNALU (NALU_t *nalu)
void OpenAnnexBFile (char *fn)
void CloseAnnexBFile ()

Variables

static int BitStreamFile = -1
static const unsigned int IOBUFFERSIZE = 65536
static byte * iobuffer
static byte * iobufferread
static unsigned int bytesinbuffer
static int is_eof
static int IsFirstByteStreamNALU = 1
static int nextstartcodebytes = 0


Detailed Description

Annex B Byte Stream format.

Author:
Main contributors (see contributors.h for copyright, address and affiliation details)

Definition in file annexb.c.


Function Documentation

void CloseAnnexBFile ( void   ) 

Closes the bit stream file.

Definition at line 320 of file annexb.c.

References BitStreamFile.

Referenced by initBitsFile().

static int FindStartCode ( unsigned char *  Buf,
int  zeros_in_startcode 
) [inline, static]

returns if new start code is found at byte aligned position buf. new-startcode is of form N 0x00 bytes, followed by a 0x01 byte.

Returns:
1 if start-code is found or
0, indicating that there is no start code
Parameters:
Buf pointer to byte-stream
zeros_in_startcode indicates number of 0x00 bytes in start-code.

Definition at line 84 of file annexb.c.

static int getChunk (  )  [inline, static]

fill IO buffer

Definition at line 35 of file annexb.c.

References BitStreamFile.

Referenced by getfbyte(), and OpenAnnexBFile().

static byte getfbyte (  )  [inline, static]

returns a byte from IO buffer

Definition at line 56 of file annexb.c.

References getChunk().

Here is the call graph for this function:

void OpenAnnexBFile ( char *  fn  ) 

Opens the bit stream file named fn.

Returns:
none

Definition at line 293 of file annexb.c.

References BitStreamFile, error(), errortext, ET_SIZE, and getChunk().

Referenced by initBitsFile().

Here is the call graph for this function:


Variable Documentation

int BitStreamFile = -1 [static]

the bit stream file

Definition at line 19 of file annexb.c.

Referenced by CloseAnnexBFile(), CloseRTPFile(), getChunk(), GetRTPNALU(), OpenAnnexBFile(), and OpenRTPFile().

int nextstartcodebytes = 0 [static]

Returns the size of the NALU (bits between start codes in case of Annex B. nalu->buf and nalu->len are filled. Other field in nalu-> remain uninitialized (will be taken care of by NALUtoRBSP.

Returns:
0 if there is nothing any more to read (EOF) -1 in case of any error
Note:
Side-effect: Returns length of start-code in bytes.

GetAnnexbNALU expects start codes at byte aligned positions in the file

Definition at line 122 of file annexb.c.


Documentation generated with DoxyGen