image.c File Reference

Decode a Slice. More...

#include "contributors.h"
#include <math.h>
#include <limits.h>
#include "global.h"
#include "image.h"
#include "fmo.h"
#include "annexb.h"
#include "nalu.h"
#include "parset.h"
#include "header.h"
#include "sei.h"
#include "output.h"
#include "mb_access.h"
#include "memalloc.h"
#include "macroblock.h"
#include "loopfilter.h"
#include "biaridecod.h"
#include "context_ini.h"
#include "cabac.h"
#include "vlc.h"
#include "quant.h"
#include "errorconcealment.h"
#include "erc_api.h"

Include dependency graph for image.c:

Go to the source code of this file.

Functions

static void init_picture (ImageParameters *img, Slice *currSlice, struct inp_par *inp)
void MbAffPostProc (void)
static void fill_wp_params (ImageParameters *img)
static void decode_slice (ImageParameters *img, Slice *currSlice, struct inp_par *inp, int current_header)
static void Error_tracking (void)
int decode_one_frame (ImageParameters *img, struct inp_par *inp, struct snr_par *snr)
void buf2img (imgpel **imgX, unsigned char *buf, int size_x, int size_y, int symbol_size_in_bytes)
void calculate_frame_no (StorablePicture *p)
void find_snr (struct snr_par *snr, StorablePicture *p, int *p_ref)
void reorder_lists (int currSliceType, Slice *currSlice)
void set_ref_pic_num (void)
int read_new_slice (Slice *currSlice)
void exit_picture (StorablePicture **dec_picture)
void ercWriteMBMODEandMV (Macroblock *currMB, ImageParameters *img, struct inp_par *inp)
void init_old_slice (OldSliceParams *p_old_slice)
void exit_slice (Slice *currSlice, OldSliceParams *p_old_slice)
int is_new_picture (StorablePicture *dec_picture, Slice *currSlice, OldSliceParams *p_old_slice)
void frame_postprocessing (ImageParameters *img)
void field_postprocessing (ImageParameters *img)
void copy_dec_picture_JV (StorablePicture *dst, StorablePicture *src)
void decode_one_slice (ImageParameters *img, Slice *currSlice, struct inp_par *inp)

Variables

objectBuffer_t * erc_object_list
ercVariables_t * erc_errorVar
frame erc_recfr
int erc_mvperMB
ImageParameters * erc_img
StorablePicture ** listX [6]
ColocatedParams * Co_located
StorablePicture * no_reference_picture
int non_conforming_stream
StorablePicture * dec_picture
StorablePicture * dec_picture_JV [MAX_PLANE]
OldSliceParams old_slice


Detailed Description

Decode a Slice.

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

Definition in file image.c.


Function Documentation

void buf2img ( imgpel **  imgX,
unsigned char *  buf,
int  size_x,
int  size_y,
int  symbol_size_in_bytes 
)

Convert file read buffer to source picture structure.

Parameters:
imgX Pointer to image plane
buf Buffer for file output
size_x horizontal image size in pixel
size_y vertical image size in pixel
symbol_size_in_bytes number of bytes used per pel

Definition at line 623 of file image.c.

References error(), and testEndian().

Referenced by find_snr().

Here is the call graph for this function:

void calculate_frame_no ( StorablePicture *  p  ) 

Calculate the value of frame_no.

Definition at line 725 of file image.c.

References params, and storable_picture::poc.

Referenced by direct_output(), and insert_picture_in_dpb().

void copy_dec_picture_JV ( StorablePicture *  dst,
StorablePicture *  src 
)

int decode_one_frame ( ImageParameters *  img,
struct inp_par *  inp,
struct snr_par *  snr 
)

decodes one I- or P-frame

Definition at line 551 of file image.c.

References EOS, Error_tracking(), exit_picture(), Is_primary_correct, Is_redundant_correct, Slice::next_header, previous_frame_num, read_new_slice(), ref_flag, and SOP.

Referenced by main().

Here is the call graph for this function:

void decode_one_slice ( ImageParameters *  img,
Slice *  currSlice,
struct inp_par *  inp 
)

void ercWriteMBMODEandMV ( Macroblock *  currMB,
ImageParameters *  img,
struct inp_par *  inp 
)

write the encoding mode and motion vectors of current MB to the buffer of the error concealment module.

Definition at line 1482 of file image.c.

References macroblock::b8mode, macroblock::mb_type, storable_picture::motion, pic_motion_params::mv, objectBuffer_t::mv, pic_motion_params::ref_idx, objectBuffer_t::regionMode, REGMODE_INTER_COPY, REGMODE_INTER_PRED, REGMODE_INTRA, and storable_picture::size_x.

Referenced by decode_one_slice().

static void Error_tracking ( void   )  [static]

Error tracking: if current frame is lost or any reference frame of current frame is lost, current frame is incorrect.

Definition at line 515 of file image.c.

References Is_primary_correct, Is_redundant_correct, redundant_slice_ref_idx, and ref_flag.

Referenced by decode_one_frame().

void exit_picture ( StorablePicture **  dec_picture  ) 

finish decoding of a picture, conceal errors and store it into the DPB

this is always true at the beginning of a picture

mark the start of the first segment

generate the segments according to the macroblock map

stop current segment

mark current segment as lost or OK

next segment

start new segment

save start MB for this segment

mark end of the last segment

call the right error concealment function depending on the frame type.

Definition at line 1281 of file image.c.

References change_plane_JV(), DeblockPicture(), ercConcealInterFrame(), ercConcealIntraFrame(), ercMarkCurrSegmentLost(), ercMarkCurrSegmentOK(), ercStartSegment(), ercStopSegment(), field_postprocessing(), frame_postprocessing(), make_frame_picture_JV(), p_ref, params, snr, store_picture_in_dpb(), frame::uptr, frame::vptr, frame::yptr, and YUV400.

Referenced by decode_one_frame(), and init_picture().

Here is the call graph for this function:

void exit_slice ( Slice *  currSlice,
OldSliceParams *  p_old_slice 
)

save slice parameters that are needed for checking of "first VCL NAL unit of a picture"

Definition at line 1604 of file image.c.

References Slice::pic_parameter_set_id.

Referenced by decode_one_slice().

void field_postprocessing ( ImageParameters *  img  ) 

Prepare field and frame buffer after field decoding.

Definition at line 1704 of file image.c.

Referenced by exit_picture().

void find_snr ( struct snr_par *  snr,
StorablePicture *  p,
int *  p_ref 
)

void frame_postprocessing ( ImageParameters *  img  ) 

Prepare field and frame buffer after frame decoding.

Definition at line 1694 of file image.c.

Referenced by exit_picture().

void init_old_slice ( OldSliceParams *  p_old_slice  ) 

set defaults for old_slice NAL unit of a picture"

Definition at line 1578 of file image.c.

Referenced by main().

static void init_picture ( ImageParameters *  img,
Slice *  currSlice,
struct inp_par *  inp 
) [static]

Initializes the parameters for a new picture.

Definition at line 82 of file image.c.

References storable_picture::adaptive_ref_pic_buffering_flag, alloc_storable_picture(), storable_picture::bottom_poc, storable_picture::chroma_format_idc, storable_picture::chroma_qp_offset, storable_picture::coded_frame, conceal_lost_frames(), copy_dec_picture_JV(), storable_picture::dec_ref_pic_marking_buffer, decode_poc(), ercReset(), error(), exit_picture(), fill_frame_num_gap(), storable_picture::frame_cropping_flag, storable_picture::frame_cropping_rect_bottom_offset, storable_picture::frame_cropping_rect_left_offset, storable_picture::frame_cropping_rect_right_offset, storable_picture::frame_cropping_rect_top_offset, storable_picture::frame_mbs_only_flag, storable_picture::frame_num, storable_picture::frame_poc, get_mb_block_pos_mbaff(), get_mb_block_pos_normal(), getAffNeighbour(), getNonAffNeighbour(), storable_picture::idr_flag, storable_picture::long_term_reference_flag, storable_picture::MbaffFrameFlag, no_mem_exit(), storable_picture::no_output_of_prior_pics_flag, storable_picture::pic_num, storable_picture::PicWidthInMbs, storable_picture::poc, storable_picture::qp, storable_picture::recovery_frame, storable_picture::seiHasTone_mapping, set_ec_flag(), storable_picture::size_x, Slice::slice_qp_delta, storable_picture::slice_qp_delta, storable_picture::slice_type, storable_picture::tone_mapping_lut, storable_picture::tone_mapping_model_id, storable_picture::tonemapped_bit_depth, storable_picture::top_poc, and storable_picture::used_for_reference.

Referenced by read_new_slice().

Here is the call graph for this function:

int is_new_picture ( StorablePicture *  dec_picture,
Slice *  currSlice,
OldSliceParams *  p_old_slice 
)

detect if current slice is "first VCL NAL unit of a picture"

Definition at line 1645 of file image.c.

References Slice::pic_parameter_set_id.

Referenced by read_new_slice().

int read_new_slice ( Slice *  currSlice  ) 

void set_ref_pic_num ( void   ) 


Variable Documentation

dec_picture to be used during 4:4:4 independent mode decoding

Definition at line 72 of file image.c.

Referenced by change_plane_JV(), and make_frame_picture_JV().

dummy storable picture for recovery point

Definition at line 47 of file mbuffer.c.


Documentation generated with DoxyGen