ldecod.c File Reference

H.264/AVC reference decoder project main(). More...

#include "contributors.h"
#include <sys/stat.h>
#include "global.h"
#include "image.h"
#include "memalloc.h"
#include "mc_prediction.h"
#include "mbuffer.h"
#include "leaky_bucket.h"
#include "fmo.h"
#include "output.h"
#include "cabac.h"
#include "parset.h"
#include "sei.h"
#include "erc_api.h"
#include "quant.h"
#include "block.h"
#include "nalu.h"

Include dependency graph for ldecod.c:

Go to the source code of this file.

Defines

#define JM   "15 (FRExt)"
#define VERSION   "15.1"
#define EXT_VERSION   "(FRExt)"
#define LOGFILE   "log.dec"
#define DATADECFILE   "dataDec.txt"
#define TRACEFILE   "trace_dec.txt"
#define OUTSTRING_SIZE   255

Functions

void JMDecHelpExit (void)
void Configure (int ac, char *av[])
static void alloc_img (ImageParameters **img)
static void free_img (ImageParameters *img)
int main (int argc, char **argv)
void init (ImageParameters *img)
void init_frext (ImageParameters *img)
static void conf_read_check (int val, int expected)
void init_conf (struct inp_par *inp, char *config_filename)
void report (struct inp_par *inp, ImageParameters *img, struct snr_par *snr)
DataPartition * AllocPartition (int n)
void FreePartition (DataPartition *dp, int n)
void malloc_slice (struct inp_par *inp, ImageParameters *img)
void free_slice (ImageParameters *img)
int init_global_buffers (void)
void free_global_buffers (void)

Variables

objectBuffer_t * erc_object_list
ercVariables_t * erc_errorVar
ColocatedParams * Co_located
ColocatedParams * Co_located_JV [MAX_PLANE]
StorablePicture * dec_picture
struct inp_par * params
struct snr_par * snr
ImageParameters * img
int global_init_done = 0


Detailed Description

H.264/AVC reference decoder project main().

ldecod.c

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

Definition in file ldecod.c.


Function Documentation

static void alloc_img ( ImageParameters **  img  )  [static]

Allocate the Image structure.

Output:
Image Parameters ImageParameters *img

Definition at line 291 of file ldecod.c.

References get_mem3Dint(), get_mem3Dpel(), and no_mem_exit().

Referenced by main().

Here is the call graph for this function:

DataPartition* AllocPartition ( int  n  ) 

Allocates a stand-alone partition structure. Structure should be freed by FreePartition(); data structures.

Input:
n: number of partitions in the array
return
pointer to DataPartition Structure, zero-initialized

Definition at line 818 of file ldecod.c.

References datapartition::bitstream, error(), errortext, ET_SIZE, MAX_CODED_FRAME_SIZE, and Bitstream::streamBuffer.

Referenced by malloc_slice().

Here is the call graph for this function:

static void conf_read_check ( int  val,
int  expected 
) [inline, static]

exit with error message if reading from config file failed

Definition at line 513 of file ldecod.c.

References error().

Referenced by init_conf().

Here is the call graph for this function:

void Configure ( int  ac,
char *  av[] 
)

set default bitstream name

set default output file name

set default reference file name

Input file

Output File

Reference File

Poc Scale

indicate UV writing for 4:0:0

Definition at line 128 of file ldecod.c.

References error(), errortext, ET_SIZE, init_conf(), JMDecHelpExit(), p_out, p_ref, PAR_OF_ANNEXB, and params.

Referenced by main().

Here is the call graph for this function:

void free_global_buffers ( void   ) 

Free allocated memory of frame size related global buffers buffers are defined in global.h, allocated memory is allocated in int init_global_buffers().

Input:
Input Parameters struct inp_par *inp, Image Parameters ImageParameters *img
Output:
none

Definition at line 1039 of file ldecod.c.

References free_mem2D(), free_mem2Dint(), free_mem2Dpel(), free_mem3Dint(), free_mem3Dpel(), free_mem4D(), free_mem4Dint(), img, and imgY_ref.

Referenced by init_global_buffers(), and main().

Here is the call graph for this function:

static void free_img ( ImageParameters *  img  )  [static]

Free the Image structure.

Input:
Image Parameters ImageParameters *img

Definition at line 314 of file ldecod.c.

References free_mem3Dint(), and free_mem3Dpel().

Referenced by main().

Here is the call graph for this function:

void free_slice ( ImageParameters *  img  ) 

Memory frees of the Slice structure and of its dependent data structures.

Input:
Input Parameters struct inp_par *inp, ImageParameters *img

Definition at line 930 of file ldecod.c.

References delete_contexts_MotionInfo(), delete_contexts_TextureInfo(), FreePartition(), Slice::mot_ctx, Slice::partArr, and Slice::tex_ctx.

Referenced by main().

Here is the call graph for this function:

void FreePartition ( DataPartition *  dp,
int  n 
)

Frees a partition structure (array).

Input:
Partition to be freed, size of partition Array (Number of Partitions)
return
None
Note:
n must be the same as for the corresponding call of AllocPartition

Definition at line 869 of file ldecod.c.

References datapartition::bitstream, and Bitstream::streamBuffer.

Referenced by free_slice().

void init ( ImageParameters *  img  ) 

Initilize some arrays.

Parameters:
img  image parameters

Definition at line 429 of file ldecod.c.

References imgY_ref, and params.

Referenced by main().

void init_conf ( struct inp_par *  inp,
char *  config_filename 
)

Read parameters from configuration file.

Input:
Name of configuration filename
Output
none

Definition at line 533 of file ldecod.c.

References conf_read_check(), error(), errortext, ET_SIZE, img, PAR_OF_ANNEXB, and PAR_OF_RTP.

Referenced by Configure().

Here is the call graph for this function:

void init_frext ( ImageParameters *  img  ) 

Initialize FREXT variables.

Parameters:
img  image parameters

Definition at line 459 of file ldecod.c.

References init_qp_process(), YUV400, YUV420, YUV422, and YUV444.

Here is the call graph for this function:

int init_global_buffers ( void   ) 

Dynamic memory allocation of frame size related global buffers buffers are defined in global.h, allocated memory must be freed in void free_global_buffers().

Input:
Input Parameters struct inp_par *inp, Image Parameters ImageParameters *img
Output:
Number of allocated bytes

Helper array to access macroblock positions. We add 1 to also consider last MB.

Definition at line 961 of file ldecod.c.

References free_global_buffers(), get_mem2D(), get_mem2Dint(), get_mem2Dpel(), get_mem3Dint(), get_mem3Dpel(), get_mem4D(), get_mem4Dint(), img, imgY_ref, MAX_REFERENCE_PICTURES, no_mem_exit(), and YUV400.

Here is the call graph for this function:

void JMDecHelpExit ( void   ) 

print help message and exit

Definition at line 99 of file ldecod.c.

Referenced by Configure().

int main ( int  argc,
char **  argv 
)

void malloc_slice ( struct inp_par *  inp,
ImageParameters *  img 
)

Allocates the slice structure along with its dependent data structures.

Input:
Input Parameters struct inp_par *inp, ImageParameters *img

you don't know whether we do CABAC hre, hence initialize CABAC anyway

assume data partitioning (worst case) for the following mallocs()

Definition at line 895 of file ldecod.c.

References AllocPartition(), create_contexts_MotionInfo(), create_contexts_TextureInfo(), error(), errortext, ET_SIZE, Slice::max_part_nr, Slice::mot_ctx, Slice::partArr, and Slice::tex_ctx.

Referenced by main().

Here is the call graph for this function:

void report ( struct inp_par *  inp,
ImageParameters *  img,
struct snr_par *  snr 
)

Reports the gathered information to appropriate outputs.

Input:
struct inp_par *inp, ImageParameters *img, struct snr_par *stat
Output:
None

Definition at line 653 of file ldecod.c.

References error(), errortext, ET_SIZE, p_log, and params.

Referenced by main().

Here is the call graph for this function:


Variable Documentation

Co_located to be used during 4:4:4 independent mode decoding.

Definition at line 50 of file mbuffer.c.

ImageParameters* img

struct inp_par* params

struct snr_par* snr

statistics

Definition at line 88 of file ldecod.c.

Referenced by direct_output(), exit_picture(), insert_picture_in_dpb(), and main().


Documentation generated with DoxyGen