#include "contributors.h"
#include <sys/stat.h>
#include "global.h"
#include "annexb.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 "img_io.h"
Go to the source code of this file.
Defines | |
#define | LOGFILE "log.dec" |
#define | DATADECFILE "dataDec.txt" |
#define | TRACEFILE "trace_dec.txt" |
#define | OUTSTRING_SIZE 255 |
Functions | |
static void | init_conf (ImageParameters *p_Img, InputParameters *p_Inp, char *config_filename) |
static void | Report (ImageParameters *p_Img) |
static void | init (ImageParameters *p_Img) |
static void | malloc_slice (InputParameters *p_Inp, ImageParameters *p_Img) |
static void | free_slice (Slice *currSlice) |
void | error (char *text, int code) |
void | JMDecHelpExit (void) |
void | Configure (ImageParameters *p_Img, InputParameters *p_Inp, int ac, char *av[]) |
static void | alloc_img (ImageParameters **p_Img) |
static void | alloc_params (InputParameters **p_Inp) |
static void | alloc_decoder (DecoderParams **p_Dec) |
static void | free_img (ImageParameters *p_Img) |
int | main (int argc, char **argv) |
void | init_frext (ImageParameters *p_Img) |
static void | conf_read_check (int val, int expected) |
DataPartition * | AllocPartition (int n) |
void | FreePartition (DataPartition *dp, int n) |
int | init_global_buffers (ImageParameters *p_Img) |
void | free_global_buffers (ImageParameters *p_Img) |
void | report_stats_on_error (void) |
Variables | |
DecoderParams * | p_Dec |
Definition in file ldecod.c.
static void alloc_decoder | ( | DecoderParams ** | p_Dec | ) | [static] |
Allocate the Decoder Structure.
Definition at line 350 of file ldecod.c.
References alloc_img(), alloc_params(), and no_mem_exit().
Referenced by main().
static void alloc_img | ( | ImageParameters ** | p_Img | ) | [static] |
Allocate the Image structure.
Definition at line 302 of file ldecod.c.
References no_mem_exit().
Referenced by alloc_decoder().
static void alloc_params | ( | InputParameters ** | p_Inp | ) | [static] |
Allocate the Input structure.
Definition at line 336 of file ldecod.c.
References no_mem_exit().
Referenced by alloc_decoder().
DataPartition* AllocPartition | ( | int | n | ) |
Allocates a stand-alone partition structure. Structure should be freed by FreePartition(); data structures.
Definition at line 900 of file ldecod.c.
References error(), errortext, ET_SIZE, MAX_CODED_FRAME_SIZE, and Bitstream::streamBuffer.
Referenced by malloc_slice().
static void conf_read_check | ( | int | val, | |
int | expected | |||
) | [inline, static] |
exit with error message if reading from config file failed
Definition at line 592 of file ldecod.c.
References error().
Referenced by init_conf().
void Configure | ( | ImageParameters * | p_Img, | |
InputParameters * | p_Inp, | |||
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 136 of file ldecod.c.
References error(), errortext, ET_SIZE, init_conf(), JMDecHelpExit(), and PAR_OF_ANNEXB.
Referenced by main().
void error | ( | char * | text, | |
int | code | |||
) |
Error handling procedure. Print error message to stderr and exit with supplied code.
text | Error message | |
code | Exit code |
Definition at line 93 of file ldecod.c.
References flush_dpb().
Referenced by adaptive_memory_management(), AllocPartition(), arideco_delete_decoding_environment(), buf2img_basic(), buf2img_bitshift(), buf2img_endian(), buffer2img(), check_num_ref(), conf_read_check(), Configure(), decode_one_component_b_slice(), decode_poc(), FmoGenerateMapUnitToSliceGroupMap(), free_mem1Dpel(), free_mem2D(), free_mem2Ddist(), free_mem2Ddouble(), free_mem2Dint(), free_mem2Dint64(), free_mem2Dlm(), free_mem2Dmp(), free_mem2Dmv(), free_mem2Dodouble(), free_mem2Doint(), free_mem2Dolm(), free_mem2Dpel(), free_mem2Dquant(), free_mem2Dshort(), free_mem2Duint16(), free_mem3D(), free_mem3Ddouble(), free_mem3Dint(), free_mem3Dint64(), free_mem3Dmp(), free_mem3Dmv(), free_mem3Dodouble(), free_mem3Doint(), free_mem3Dpel(), free_mem3Dquant(), free_mem3Dshort(), free_mem3Duint16(), free_mem4D(), free_mem4Dint(), free_mem4Dmv(), free_mem4Dpel(), free_mem4Dquant(), free_mem4Dshort(), free_mem4Duint16(), free_mem5Dint(), free_mem5Dmv(), free_mem5Dpel(), free_mem5Dquant(), free_mem5Dshort(), free_mem6Dshort(), free_mem7Dshort(), free_offset_mem2Dshort(), get_smallest_poc(), getDpbSize(), img2buf_endian(), init_conf(), init_dpb(), init_picture(), initBitsFile(), interpret_picture_timing_info(), intra16x16_hor_pred(), intra16x16_plane_pred(), intra16x16_vert_pred(), intrapred_chroma(), malloc_slice(), mm_assign_long_term_frame_idx(), no_mem_exit(), OpenAnnexBFile(), OpenFiles(), OpenRTPFile(), output_one_frame_from_dpb(), predict_nnz(), read_ipred_modes(), read_motion_info_from_NAL_b_slice(), read_new_slice(), read_next_nalu(), readCoeff4x4_CAVLC(), ReadFrameConcatenated(), ReadFrameSeparate(), ReadTIFFIFDEntry(), remove_frame_from_dpb(), reorder_ref_pic_list(), Report(), RestOfSliceHeader(), start_macroblock(), store_picture_in_dpb(), and write_out_picture().
void free_global_buffers | ( | ImageParameters * | p_Img | ) |
Free allocated memory of frame size related global buffers buffers are defined in global.h, allocated memory is allocated in int init_global_buffers().
Definition at line 1142 of file ldecod.c.
References free_mem2D(), free_mem2Dint(), free_mem2Dpel(), free_mem3Dpel(), and free_mem4D().
Referenced by init_global_buffers(), and main().
static void free_img | ( | ImageParameters * | p_Img | ) | [static] |
static void free_slice | ( | Slice * | currSlice | ) | [static] |
Memory frees of the Slice structure and of its dependent data structures.
Definition at line 1025 of file ldecod.c.
References delete_contexts_MotionInfo(), delete_contexts_TextureInfo(), free_mem3Dint(), free_mem3Dpel(), free_mem4Dint(), FreePartition(), slice::mot_ctx, slice::partArr, and slice::tex_ctx.
Referenced by main().
void FreePartition | ( | DataPartition * | dp, | |
int | n | |||
) |
Frees a partition structure (array).
Definition at line 951 of file ldecod.c.
References Bitstream::streamBuffer.
Referenced by free_slice().
static void init | ( | ImageParameters * | p_Img | ) | [static] |
static void init_conf | ( | ImageParameters * | p_Img, | |
InputParameters * | p_Inp, | |||
char * | config_filename | |||
) | [static] |
Read parameters from configuration file.
Definition at line 612 of file ldecod.c.
References conf_read_check(), error(), errortext, ET_SIZE, PAR_OF_ANNEXB, and PAR_OF_RTP.
Referenced by Configure().
void init_frext | ( | ImageParameters * | p_Img | ) |
int init_global_buffers | ( | ImageParameters * | p_Img | ) |
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().
Helper array to access macroblock positions. We add 1 to also consider last MB.
Definition at line 1066 of file ldecod.c.
References free_global_buffers(), get_mem2D(), get_mem2Dint(), get_mem2Dpel(), get_mem3Dpel(), get_mem4D(), init_qp_process(), no_mem_exit(), and YUV400.
Referenced by activate_sps().
void JMDecHelpExit | ( | void | ) |
int main | ( | int | argc, | |
char ** | argv | |||
) |
main function for TML decoder
Definition at line 416 of file ldecod.c.
References alloc_decoder(), Configure(), decode_one_frame(), EOS, ercClose(), flush_dpb(), FmoFinit(), free_dpb(), free_global_buffers(), free_img(), free_slice(), init(), init_old_slice(), init_out_buffer(), initBitsFile(), malloc_slice(), Report(), and uninit_out_buffer().
static void malloc_slice | ( | InputParameters * | p_Inp, | |
ImageParameters * | p_Img | |||
) | [static] |
Allocates the slice structure along with its dependent data structures.
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 977 of file ldecod.c.
References AllocPartition(), create_contexts_MotionInfo(), create_contexts_TextureInfo(), error(), errortext, ET_SIZE, get_mem3Dint(), get_mem3Dpel(), get_mem4Dint(), MAX_REFERENCE_PICTURES, slice::mot_ctx, slice::partArr, and slice::tex_ctx.
Referenced by main().
static void Report | ( | ImageParameters * | p_Img | ) | [static] |