JM8.6代码文件结构

JM8.6代码文件结构

总结一下, JM8.6中比较重要的源代码文件

[block.c]用于处理一个块

void

intrapred_luma (int img_x, int img_y, int *left_available, int *up_available, int *all_available)

void

intrapred_luma_16x16 ()

int

dct_luma_16x16 (int new_intra_mode)

int

dct_luma (int block_x, int block_y, int *coeff_cost, int old_intra_mode)

int

dct_chroma (int uv, int cr_cbp)

[decoder.c] "decoders in the encoder

void

decode_one_b8block (int decoder, int mbmode, int b8block, int b8mode, int b8ref)

void

decode_one_mb (int decoder, Macroblock *currMB)

void

Get_Reference_Block (byte **imY, int block_y, int block_x, int mvhor, int mvver, byte **out)

byte

Get_Reference_Pixel (byte **imY, int y_pos, int x_pos)

void

UpdateDecoders ()

void

DecOneForthPix (byte **dY, byte ***dref)

void

compute_residue_b8block (int b8block, int i16mode)

void

compute_residue_mb (int i16mode)

void

Build_Status_Map (byte **s_map)

void

Error_Concealment (byte **inY, byte **s_map, byte ***refY)

void

Conceal_Error (byte **inY, int mb_y, int mb_x, byte ***refY, byte **s_map)

[image.c] Code one image/slice

void

code_a_picture (Picture *pic)

void

frame_picture (Picture *frame)

static int

writeout_picture (Picture *pic)

static int

picture_structure_decision (Picture *frame, Picture *top, Picture *bot)

static void

distortion_fld (float *dis_fld_y, float *dis_fld_u, float *dis_fld_v)

static void

find_snr ()

static void

find_distortion ()

static void

frame_mode_buffer (int bit_frame, float snr_frame_y, float snr_frame_u, float snr_frame_v)

static void

init_frame ()

static void

put_buffer_frame ()

static void

copy_motion_vectors_MB ()

static void

CopyFrameToOldImgOrgVariables (Sourceframe *sf)

static Sourceframe *

AllocSourceframe (int xs, int ys)

static void

FreeSourceframe (Sourceframe *sf)

static void

ReadOneFrame (int FrameNoInFile, int HeaderSize, int xs, int ys, Sourceframe *sf)

static void

writeUnit (Bitstream *currStream, int partition)

static int

CalculateFrameNumber ()

int

encode_one_frame ()

static void

init_dec_ref_pic_marking_buffer ()

static void

GenerateFullPelRepresentation (pel_t **Fourthpel, pel_t *Fullpel, int xsize, int ysize)

void

UnifiedOneForthPix (StorablePicture *s)

Boolean

dummy_slice_too_big (int bits_slice)

void

copy_rdopt_data (int bot_block)

static void

GenerateFieldComponent (char *src, char *top, char *bot, int xs, int ys)

[lencod.c]主函数所在文件

void

Init_Motion_Search_Module ()

void

Clear_Motion_Search_Module ()

int

main (int argc, char **argv)

void

report_stats_on_error ()

void

init_poc ()

void

CAVLC_init ()

void

init_img ()

void

free_img ()

Picture *

malloc_picture ()

void

free_picture (Picture *pic)

int

init_global_buffers ()

void

free_global_buffers ()

int

get_mem_mv (int *******mv)

int

get_mem_ACcoeff (int *****cofAC)

void

combine_field ()

void

process_2nd_IGOP ()

void

SetImgType ()

[macroblock.c] Process one macroblock

void

set_MB_parameters (int mb_addr)

void

proceed2nextMacroblock ()

void

start_macroblock (int mb_addr, int mb_field)

void

terminate_macroblock (Boolean *end_of_slice, Boolean *recode_macroblock)

int

slice_too_big (int rlc_bits)

void

OneComponentLumaPrediction4x4 (int *mpred, int pic_pix_x, int pic_pix_y, int *mv, int ref, StorablePicture **list)

void

copyblock4x4 (int *mpred, int block[BLOCK_SIZE][BLOCK_SIZE])

void

LumaPrediction4x4 (int block_x, int block_y, int p_dir, int fw_mode, int bw_mode, int fw_ref_idx, int bw_ref_idx)

int

LumaResidualCoding8x8 (int *cbp, int *cbp_blk, int block8x8, int p_dir, int fw_mode, int bw_mode, int fw_refframe, int bw_refframe)

void

SetModesAndRefframe (int b8, int *p_dir, int *fw_mode, int *bw_mode, int *fw_ref, int *bw_ref)

void

LumaResidualCoding ()

void

OneComponentChromaPrediction4x4 (int *mpred, int block_c_x, int block_c_y, int ******mv, int list_idx, int ref, int blocktype, int uv)

void

IntraChromaPrediction4x4 (int uv, int block_x, int block_y)

void

ChromaPrediction4x4 (int uv, int block_x, int block_y, int p_dir, int fw_mode, int bw_mode, int fw_ref_idx, int bw_ref_idx)

void

ChromaResidualCoding (int *cr_cbp)

void

IntraChromaPrediction8x8 (int *mb_up, int *mb_left, int *mb_up_left)

int

ZeroRef (Macroblock *currMB)

int

MBType2Value (Macroblock *currMB)

int

writeIntra4x4Modes (int only_this_block)

int

B8Mode2Value (int b8mode, int b8pdir)

int

writeMBHeader (int rdopt)

void

write_terminating_bit (short bit)

int

writeChromaIntraPredMode ()

void

set_last_dquant ()

void

write_one_macroblock (int eos_bit)

int

BType2CtxRef (int btype)

int

writeReferenceFrame (int mode, int i, int j, int fwd_flag, int ref)

int

writeMotionVector8x8 (int i0, int j0, int i1, int j1, int refframe, int list_idx, int mv_mode)

int

writeMotionInfo2NAL ()

int

writeChromaCoeff ()

int

writeLumaCoeff4x4_CABAC (int b8, int b4, int intra4x4mode)

int

writeLumaCoeff8x8 (int block8x8, int intra4x4mode)

int

writeCBPandLumaCoeff ()

int

predict_nnz (int i, int j)

int

predict_nnz_chroma (int i, int j)

int

writeCoeff4x4_CAVLC (int block_type, int b8, int b4, int param)

int

find_sad_16x16 (int *intra_mode)

[mb_access.c]

int

mb_is_available (int mbAddr, int currMbAddr)

void

CheckAvailabilityOfNeighbors ()

void

get_mb_block_pos (int mb_addr, int *x, int *y)

void

get_mb_pos (int mb_addr, int *x, int *y)

void

getNonAffNeighbour (unsigned int curr_mb_nr, int xN, int yN, int luma, PixelPos *pix)

void

getAffNeighbour (unsigned int curr_mb_nr, int xN, int yN, int luma, PixelPos *pix)

void

getNeighbour (int curr_mb_nr, int xN, int yN, int luma, PixelPos *pix)

void

getLuma4x4Neighbour (int curr_mb_nr, int block_x, int block_y, int rel_x, int rel_y, PixelPos *pix)

void

getChroma4x4Neighbour (int curr_mb_nr, int block_x, int block_y, int rel_x, int rel_y, PixelPos *pix)

[mv-search.c]

void

SetMotionVectorPredictor (int pmv[2], int ***refPic, int ****tmp_mv, int ref_frame, int list, int block_x, int block_y, int blockshape_x, int blockshape_y)

void

InitializeFastFullIntegerSearch ()

void

ClearFastFullIntegerSearch ()

void

ResetFastFullIntegerSearch ()

void

SetupLargerBlocks (int list, int refindex, int max_pos)

void

SetupFastFullPelSearch (int ref, int list)

void

Init_Motion_Search_Module ()

void

Clear_Motion_Search_Module ()

int

FullPelBlockMotionSearch (pel_t **orig_pic, int ref, int list, int pic_pix_x, int pic_pix_y, int blocktype, int pred_mv_x, int pred_mv_y, int *mv_x, int *mv_y, int search_range, int min_mcost, double lambda)

int

FastFullPelBlockMotionSearch (pel_t **orig_pic, int ref, int list, int pic_pix_x, int pic_pix_y, int blocktype, int pred_mv_x, int pred_mv_y, int *mv_x, int *mv_y, int search_range, int min_mcost, double lambda)

int

SATD (int *diff, int use_hadamard)

int

SubPelBlockMotionSearch (pel_t **orig_pic, int ref, int list, int pic_pix_x, int pic_pix_y, int blocktype, int pred_mv_x, int pred_mv_y, int *mv_x, int *mv_y, int search_pos2, int search_pos4, int min_mcost, double lambda)

int

BlockMotionSearch (int ref, int list, int mb_x, int mb_y, int blocktype, int search_range, double lambda)

int

BIDPartitionCost (int blocktype, int block8x8, int fw_ref, int bw_ref, int lambda_factor)

int

GetSkipCostMB (double lambda)

void

FindSkipModeMotionVector ()

int

Get_Direct_Cost8x8 (int block, double lambda)

int

Get_Direct_CostMB (double lambda)

void

PartitionMotionSearch (int blocktype, int block8x8, double lambda)

void

Get_Direct_Motion_Vectors ()

[rdopt.c]

void

clear_rdopt ()

void

init_rdopt ()

void

UpdatePixelMap ()

int

CheckReliabilityOfRef (int block, int list_idx, int ref, int mode)

double

RDCost_for_4x4IntraBlocks (int *nonzero, int b8, int b4, int ipmode, double lambda, double min_rdcost, int mostProbableMode)

int

Mode_Decision_for_4x4IntraBlocks (int b8, int b4, double lambda, int *min_cost)

int

Mode_Decision_for_8x8IntraBlocks (int b8, double lambda, int *cost)

int

Mode_Decision_for_Intra4x4Macroblock (double lambda, int *cost)

double

RDCost_for_8x8blocks (int *cnt_nonz, int *cbp_blk, double lambda, int block, int mode, int pdir, int ref, int bwd_ref)

int

I16Offset (int cbp, int i16mode)

void

SetModesAndRefframeForBlocks (int mode)

void

Intra16x16_Mode_Decision (Macroblock *currMB, int *i16mode)

void

SetCoeffAndReconstruction8x8 (Macroblock *currMB)

void

SetMotionVectorsMB (Macroblock *currMB, int bframe)

int

RDCost_for_macroblocks (double lambda, int mode, double *min_rdcost)

void

store_macroblock_parameters (int mode)

void

set_stored_macroblock_parameters ()

void

SetRefAndMotionVectors (int block, int mode, int pdir, int fwref, int bwref)

int

field_flag_inference ()

void

encode_one_macroblock ()

[rdopt_coding_state.c]

[vlc.c]

int

ue_v (char *tracestring, int value, DataPartition *part)

int

se_v (char *tracestring, int value, DataPartition *part)

int

u_1 (char *tracestring, int value, DataPartition *part)

int

u_v (int n, char *tracestring, int value, DataPartition *part)

void

ue_linfo (int ue, int dummy, int *len, int *info)

void

se_linfo (int se, int dummy, int *len, int *info)

void

cbp_linfo_intra (int cbp, int dummy, int *len, int *info)

void

cbp_linfo_inter (int cbp, int dummy, int *len, int *info)

void

levrun_linfo_c2x2 (int level, int run, int *len, int *info)

void

levrun_linfo_inter (int level, int run, int *len, int *info)

void

levrun_linfo_intra (int level, int run, int *len, int *info)

int

symbol2uvlc (SyntaxElement *sym)

int

writeSyntaxElement_UVLC (SyntaxElement *se, DataPartition *this_dataPart)

int

writeSyntaxElement_fixed (SyntaxElement *se, DataPartition *this_dataPart)

int

writeSyntaxElement_Intra4x4PredictionMode (SyntaxElement *se, DataPartition *this_dataPart)

int

writeSyntaxElement2Buf_UVLC (SyntaxElement *se, Bitstream *this_streamBuffer)

void

writeUVLC2buffer (SyntaxElement *se, Bitstream *currStream)

int

writeSyntaxElement2Buf_Fixed (SyntaxElement *se, Bitstream *this_streamBuffer)

int

symbol2vlc (SyntaxElement *sym)

int

writeSyntaxElement_VLC (SyntaxElement *se, DataPartition *this_dataPart)

int

writeSyntaxElement_NumCoeffTrailingOnes (SyntaxElement *se, DataPartition *this_dataPart)

int

writeSyntaxElement_NumCoeffTrailingOnesChromaDC (SyntaxElement *se, DataPartition *this_dataPart)

int

writeSyntaxElement_TotalZeros (SyntaxElement *se, DataPartition *this_dataPart)

int

writeSyntaxElement_TotalZerosChromaDC (SyntaxElement *se, DataPartition *this_dataPart)

int

writeSyntaxElement_Run (SyntaxElement *se, DataPartition *this_dataPart)

int

writeSyntaxElement_Level_VLC1 (SyntaxElement *se, DataPartition *this_dataPart)

int

writeSyntaxElement_Level_VLCN (SyntaxElement *se, int vlc, DataPartition *this_dataPart)

void

writeVlcByteAlign (Bitstream *currStream)

[cabac.c]

void

unary_bin_encode (EncodingEnvironmentPtr eep_dp, unsigned int symbol, BiContextTypePtr ctx, int ctx_offset)

void

unary_bin_max_encode (EncodingEnvironmentPtr eep_dp, unsigned int symbol, BiContextTypePtr ctx, int ctx_offset, unsigned int max_symbol)

void

unary_exp_golomb_level_encode (EncodingEnvironmentPtr eep_dp, unsigned int symbol, BiContextTypePtr ctx)

void

unary_exp_golomb_mv_encode (EncodingEnvironmentPtr eep_dp, unsigned int symbol, BiContextTypePtr ctx, unsigned int max_bin)

void

cabac_new_slice ()

void

CheckAvailabilityOfNeighborsCABAC ()

MotionInfoContexts *

create_contexts_MotionInfo (void)

TextureInfoContexts *

create_contexts_TextureInfo (void)

void

delete_contexts_MotionInfo (MotionInfoContexts *enco_ctx)

void

delete_contexts_TextureInfo (TextureInfoContexts *enco_ctx)

int

writeSyntaxElement_CABAC (SyntaxElement *se, DataPartition *this_dataPart)

void

writeFieldModeInfo_CABAC (SyntaxElement *se, EncodingEnvironmentPtr eep_dp)

void

writeMB_skip_flagInfo_CABAC (SyntaxElement *se, EncodingEnvironmentPtr eep_dp)

void

writeMB_typeInfo_CABAC (SyntaxElement *se, EncodingEnvironmentPtr eep_dp)

void

writeB8_typeInfo_CABAC (SyntaxElement *se, EncodingEnvironmentPtr eep_dp)

void

writeIntraPredMode_CABAC (SyntaxElement *se, EncodingEnvironmentPtr eep_dp)

void

writeRefFrame_CABAC (SyntaxElement *se, EncodingEnvironmentPtr eep_dp)

void

writeDquant_CABAC (SyntaxElement *se, EncodingEnvironmentPtr eep_dp)

void

writeMVD_CABAC (SyntaxElement *se, EncodingEnvironmentPtr eep_dp)

void

writeCIPredMode_CABAC (SyntaxElement *se, EncodingEnvironmentPtr eep_dp)

void

writeCBP_BIT_CABAC (int b8, int bit, int cbp, Macroblock *currMB, int inter, EncodingEnvironmentPtr eep_dp)

void

writeCBP_CABAC (SyntaxElement *se, EncodingEnvironmentPtr eep_dp)

void

write_and_store_CBP_block_bit (Macroblock *currMB, EncodingEnvironmentPtr eep_dp, int type, int cbp_bit)

void

write_significance_map (Macroblock *currMB, EncodingEnvironmentPtr eep_dp, int type, int coeff[], int coeff_ctr)

void

write_significant_coefficients (Macroblock *currMB, EncodingEnvironmentPtr eep_dp, int type, int coeff[])

void

writeRunLevel_CABAC (SyntaxElement *se, EncodingEnvironmentPtr eep_dp)

void

exp_golomb_encode_eq_prob (EncodingEnvironmentPtr eep_dp, unsigned int symbol, int k)

 

posted @ 2012-07-27 16:57  Mr.Rico  阅读(...)  评论(...编辑  收藏