input.c File Reference

Input related functions. More...

#include "contributors.h"
#include <math.h>
#include <time.h>
#include <sys/timeb.h>
#include "global.h"
#include "input.h"
#include "report.h"
#include "img_io.h"

Include dependency graph for input.c:

Go to the source code of this file.

Functions

void buf2img_basic (imgpel **imgX,unsigned char *buf,int size_x,int size_y,int o_size_x,int o_size_y,int symbol_size_in_bytes,int dummy)
void buf2img_endian (imgpel **imgX,unsigned char *buf,int size_x,int size_y,int o_size_x,int o_size_y,int symbol_size_in_bytes,int dummy)
void buf2img_bitshift (imgpel **imgX,unsigned char *buf,int size_x,int size_y,int o_size_x,int o_size_y,int symbol_size_in_bytes,int bitshift)
void fillPlane (imgpel **imgX,int nVal,int size_x,int size_y)
void initInput (FrameFormat *source, FrameFormat *output)
int testEndian (void)
static void deinterleave (unsigned char **input, unsigned char **output, FrameFormat *source, int symbol_size_in_bytes)
void AllocateFrameMemory (ImageParameters *img, InputParameters *params, int size)
void DeleteFrameMemory (void)
void ReadOneFrame (VideoDataFile *input_file, int FrameNoInFile, int HeaderSize, FrameFormat *source, FrameFormat *output, imgpel **pImage[3])

Variables

unsigned char * buf = NULL
unsigned char * ibuf = NULL
void(* buf2img )(imgpel **imgX, unsigned char *buf, int size_x, int size_y, int o_size_x, int o_size_y, int symbol_size_in_bytes, int bitshift)


Detailed Description

Input related functions.

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

Definition in file input.c.


Function Documentation

void AllocateFrameMemory ( ImageParameters *  img,
InputParameters *  params,
int  size 
)

Create Frame Memory buffer.

Definition at line 550 of file input.c.

References InputParameters::input_file1, no_mem_exit(), and ImageParameters::pic_unit_size_on_disk.

Referenced by init_img().

Here is the call graph for this function:

void buf2img_basic ( imgpel **  imgX,
unsigned char *  buf,
int  size_x,
int  size_y,
int  o_size_x,
int  o_size_y,
int  symbol_size_in_bytes,
int  dummy 
)

Convert file read buffer to source picture structure.

Parameters:
imgX  Pointer to image plane
buf  Buffer for file output
size_x  horizontal size of picture
size_y  vertical size of picture
o_size_x  horizontal size of picture
o_size_y  vertical size of picture
symbol_size_in_bytes  number of bytes in file used for one pixel
dummy  dummy variable used for allowing function pointer use

Definition at line 358 of file input.c.

References error().

Referenced by initInput().

Here is the call graph for this function:

void buf2img_bitshift ( imgpel **  imgX,
unsigned char *  buf,
int  size_x,
int  size_y,
int  o_size_x,
int  o_size_y,
int  symbol_size_in_bytes,
int  bitshift 
)

Convert file read buffer to source picture structure.

Parameters:
imgX  Pointer to image plane
buf  Buffer for file output
size_x  horizontal size of picture
size_y  vertical size of picture
o_size_x  horizontal size of picture
o_size_y  vertical size of picture
symbol_size_in_bytes  number of bytes in file used for one pixel
bitshift  variable for bitdepth expansion

Definition at line 231 of file input.c.

References error(), and testEndian().

Referenced by initInput().

Here is the call graph for this function:

void buf2img_endian ( imgpel **  imgX,
unsigned char *  buf,
int  size_x,
int  size_y,
int  o_size_x,
int  o_size_y,
int  symbol_size_in_bytes,
int  dummy 
)

Convert file read buffer to source picture structure.

Parameters:
imgX  Pointer to image plane
buf  Buffer for file output
size_x  horizontal size of picture
size_y  vertical size of picture
o_size_x  horizontal size of picture
o_size_y  vertical size of picture
symbol_size_in_bytes  number of bytes in file used for one pixel
dummy  dummy variable used for allowing function pointer use

Definition at line 470 of file input.c.

References error().

Referenced by initInput().

Here is the call graph for this function:

static void deinterleave ( unsigned char **  input,
unsigned char **  output,
FrameFormat *  source,
int  symbol_size_in_bytes 
) [static]

Deinterleave file read buffer to source picture structure.

Parameters:
input  input buffer
output  output buffer
source  format of source buffer
symbol_size_in_bytes  number of bytes per symbol

Definition at line 138 of file input.c.

References YUV420, YUV422, and YUV444.

Referenced by ReadOneFrame().

void DeleteFrameMemory ( void   ) 

Delete Frame Memory buffer.

Definition at line 568 of file input.c.

Referenced by free_img().

void fillPlane ( imgpel **  imgX,
int  nVal,
int  size_x,
int  size_y 
)

Fill plane with constant value.

Parameters:
imgX  Pointer to image plane
nVal  Fill value (currently 0 <= nVal < 256)
size_x  horizontal size of picture
size_y  vertical size of picture

Definition at line 108 of file input.c.

void initInput ( FrameFormat *  source,
FrameFormat *  output 
)

checks if the System is big- or little-endian

Returns:
0, little-endian (e.g. Intel architectures) 1, big-endian (e.g. SPARC, MIPS, PowerPC)

Definition at line 46 of file input.c.

References buf2img_basic(), buf2img_bitshift(), buf2img_endian(), and testEndian().

Referenced by init_img().

Here is the call graph for this function:

void ReadOneFrame ( VideoDataFile *  input_file,
int  FrameNoInFile,
int  HeaderSize,
FrameFormat *  source,
FrameFormat *  output,
imgpel **  pImage[3] 
)

Reads one new frame from file.

Parameters:
input_file structure containing information (filename, format) about the source file
FrameNoInFile Frame number in the source file
HeaderSize Number of bytes in the source file to be skipped
source source file (on disk) information
output output file (for encoding) information
pImage Image planes

Definition at line 595 of file input.c.

References deinterleave(), InputParameters::grayscale, ImageParameters::pic_unit_size_on_disk, ReadFrameConcatenated(), ReadFrameSeparate(), ReadTIFFImage(), InputParameters::rgb_input_flag, InputParameters::source, YUV400, YUV444, and ImageParameters::yuv_format.

Referenced by encode_one_frame().

Here is the call graph for this function:

int testEndian ( void   ) 

checks if the System is big- or little-endian

Returns:
0, little-endian (e.g. Intel architectures) 1, big-endian (e.g. SPARC, MIPS, PowerPC)

Definition at line 69 of file input.c.

Referenced by buf2img_bitshift(), img2buf(), and initInput().


Documentation generated with DoxyGen