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

void malloc_annex_b (ImageParameters *p_Img)
void init_annex_b (ANNEXB_t *annex_b)
void free_annex_b (ImageParameters *p_Img)
static int getChunk (ANNEXB_t *annex_b)
static byte getfbyte (ANNEXB_t *annex_b)
static int FindStartCode (unsigned char *Buf, int zeros_in_startcode)
int GetAnnexbNALU (ImageParameters *p_Img, NALU_t *nalu)
void OpenAnnexBFile (ImageParameters *p_Img, char *fn)
void CloseAnnexBFile (ImageParameters *p_Img)

Variables

static const unsigned int IOBUFFERSIZE = 65536


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 ( ImageParameters *  p_Img  ) 

Closes the bit stream file.

Definition at line 338 of file annexb.c.

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 102 of file annexb.c.

Referenced by GetAnnexbNALU().

int GetAnnexbNALU ( ImageParameters *  p_Img,
NALU_t nalu 
)

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 139 of file annexb.c.

References nalu_t::buf, FindStartCode(), nalu_t::forbidden_bit, getfbyte(), nalu_t::len, nalu_t::lost_packets, nalu_t::max_size, nalu_t::nal_reference_idc, nalu_t::nal_unit_type, no_mem_exit(), and nalu_t::startcodeprefix_len.

Referenced by initBitsFile().

Here is the call graph for this function:

static int getChunk ( ANNEXB_t *  annex_b  )  [inline, static]

fill IO buffer

Definition at line 53 of file annexb.c.

Referenced by getfbyte(), and OpenAnnexBFile().

static byte getfbyte ( ANNEXB_t *  annex_b  )  [inline, static]

returns a byte from IO buffer

Definition at line 74 of file annexb.c.

References getChunk().

Referenced by GetAnnexbNALU().

Here is the call graph for this function:

void OpenAnnexBFile ( ImageParameters *  p_Img,
char *  fn 
)

Opens the bit stream file named fn.

Returns:
none

Definition at line 310 of file annexb.c.

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

Referenced by initBitsFile().

Here is the call graph for this function:


Documentation generated with DoxyGen