- x264_param_default设置默认参数
- Parse参数解析
- signalCtrl+C句柄关联设置
-
Encode编码
- p_get_frame_total
-
x264_encoder_open编码前的初始化与设置
- x264_validate_parameters验证参数有效性并设置
- x264_cqm_parse_file解析量化矩阵
- x264_sps_init序列参数集初始化
- x264_pps_init图像参数集初始化
- x264_validate_levels检查级别的有效性
- x264_cqm_init量化矩阵初始化
- x264_rdo_init CABAC表的初始化
- x264_predict_16x16_init帧内16*16 预测
- x264_predict_8x8c_init帧内色度预测
- x264_predict_8x8_init帧内8*8 预测
- x264_predict_4x4_init帧内4*4 预测
- x264_init_vlc_tablesVLC表
- x264_pixel_initSAD/satd等设置
- x264_dct_initDCT 变换
- x264_zigzag_initzigzag 扫描
- x264_mc_init运动补偿
- x264_quant_init量化
- x264_deblock_init去块滤波
- x264_dct_init_weightsdct变换的权重设置
- mbcmp_initmb宏块比较初始化
- x264_ratecontrol_new 创建码率控制结构体并初始化
- p_set_outfile_param
- x264_picture_alloc
-
for( ;; )
- p_read_frame
- parse_qpfile
-
Encode_frame
-
x264_encoder_encode编码器编码
- 线程上下文同步
- x264_reference_update
- x264_frame_push_unused
- x264_frame_pop_unused
- x264_frame_push
- x264_frame_push_unused
- x264_frame_pop_unused
- x264_frame_pop_unused
- x264_frame_copy_picture
- x264_frame_expand_border_mod16
- x264_frame_push
- x264_frame_init_lowres
- x264_adaptive_quant_frame
- x264_encoder_frame_end
- x264_stack_align
- x264_frame_push
- x264_frame_shift
- 编码实体do_encode<标签非函数>↓
- x264_reference_reset
- 设置nal类型、参考等级、片头类型
- x264_reference_build_list
- build ref list 0/1
- Order ref0 from higher to lower poc
- Order ref1 from lower to higher poc (bubble sort) for B-frame
- In the standard, a P-frame's ref list is sorted by frame_num.
- x264_ratecontrol_start
- get_zone
- x264_encoder_reconfig
- 统计在本帧是P帧的情况下,其前面连续的B帧的数目
- 由各种不同的slice类型及vbv等参数获取的q值
- accum_p_qp_update
- x264_ratecontrol_qp
- x264_macroblock_bipred_init
- x264_slice_init
- x264_slice_header_init
- x264_macroblock_slice_init
- bs_init初始化比特流上下文
- x264_nal_start
- bs_write
- bs_rbsp_trailing
- x264_nal_end
- Write SPS and PPS
- x264_nal_start
- x264_sei_version_write
- x264_sps_write
- x264_pps_write
- x264_nal_end
- x264_pthread_create
- x264_slices_write
- x264_stack_align
- x264_slice_write
- x264_nal_start
- x264_slice_header_write
- bs_write_ue
- bs_write
- bs_write1
- bs_write_se
- bs_align_1
- x264_cabac_context_init
- x264_cabac_encode_init
- 循环对整个图像的每个宏块进行编码
- bs_pos
- x264_cabac_pos
- x264_fdec_filter_row
- x264_frame_deblock_row
- x264_frame_expand_border
- x264_frame_filter
- integral_init4h
- integral_init4v
- integral_init8h
- integral_init8v
- x264_frame_expand_border_filtered
- plane_expand_border
- x264_frame_cond_broadcast
- x264_macroblock_cache_load
- 首先初始化和当前宏块毗邻的已解码块
- 如果有有效的TOP-MB
- 同MB_TOP, 装入LEFT-MB相关参数
- 同MB_TOP,装入MB_TOPRIGHT相邻MB的相关参数
- 同MB_TOP,装入MB_TOPLEFT相邻MB的相关参数
- 装入编码图像块和参考图像数据
- 搬移重建数据到参考数据位置, 行方向的参考数据未搬移
- 运动向量、参考图像装入. 分成TOP, TOPLEFT, TOPRIGHT, LEFT
- x264_macroblock_cache_skip
- x264_mb_predict_mv_pskip
- x264_macroblock_analyse
- x264_ratecontrol_qp
- x264_adaptive_quant
- x264_mb_analyse_init
- 对不同类型的块采用不同的处理步骤
- 对于I帧采用帧内编码,其没有采用运动估计
- x264_mb_cache_fenc_satd
- x264_mb_analyse_intra
- x264_intra_rd
- 比较得到最佳的帧内预测模式
- x264_intra_rd_refine
- P模式(P模式内包括I模式,而B模式仅是P模式的简单延伸)
- prefetch_ref
- x264_macroblock_probe_pskip
- x264_mb_analyse_load_costs
- x264_mb_analyse_inter_p16x16
- x264_mb_analyse_inter_p8x8_mixed_ref
- x264_mb_analyse_inter_p8x8
- 如果8×8代价值小于16×16, 则进行子宏块分割的判断
- x264_mb_analyse_inter_p4x4
- x264_mb_analyse_inter_p8x4
- x264_mb_analyse_inter_p4x8
- x264_mb_cache_mv_p8x8
- 检测16×8和8×16模式
- x264_mb_analyse_inter_p16x8
- x264_mb_analyse_inter_p8x16
- 帧间模式选择后, 对该模式进行亚象素精细搜索, 以进一步减少误差
- x264_me_refine_qpel
- 分析宏块的帧内编码,包括亮度和色度
- x264_mb_analyse_intra_chroma
- x264_mb_analyse_intra
- x264_mb_analyse_p_rd
- x264_mb_analyse_transform_rd
- x264_intra_rd
- 比较得到最佳的帧内预测模式
- x264_intra_rd_refine
- x264_macroblock_cache_ref
- x264_me_refine_qpel_rd
- B模式(其仅是P模式的简单延伸).
- x264_mb_predict_mv_direct16x16
- x264_mb_mc
- x264_macroblock_probe_bskip
- x264_mb_predict_mv_direct16x16
- x264_macroblock_probe_bskip
- x264_mb_analyse_load_costs
- x264_mb_analyse_inter_direct
- x264_mb_analyse_inter_b16x16
- x264_mb_analyse_b_rd
- x264_analyse_update_cache
- x264_mb_analyse_inter_b8x8
- x264_mb_analyse_inter_b16x8
- x264_mb_analyse_inter_b8x16
- x264_me_refine_qpel
- x264_mb_analyse_b_rd
- x264_mb_analyse_intra
- x264_mb_analyse_transform_rd
- x264_intra_rd
- x264_intra_rd_refine
- x264_refine_bidir
- x264_analyse_update_cache
- x264_me_refine_qpel_rd
- x264_analyse_update_cache
- x264_mb_analyse_transform
- x264_psy_trellis_init
- x264_macroblock_encode
- P_SKIP
- x264_macroblock_encode_pskip
- B_SKIP
- x264_mb_mc
- x264_macroblock_encode_skip
- I_16x16
- x264_predict_lossless_16x16
- 用函数指针h->predict_16x16[i_mode]进行帧内预测
- x264_mb_encode_i16x16
- I_8x8
- x264_predict_8x8_filter
- x264_predict_lossless_8x8
- 用函数指针完成4个宏块的帧内预测
- x264_mb_encode_i8x8
- I_4x4
- x264_predict_lossless_4x4
- 用函数指针完成4个宏块的帧内预测
- x264_mb_encode_i4x4
- Inter MB
- x264_mb_mc
- 然后分多种情形
- 无损压缩情况
- sub_8x8
- sub_4x4
- 指定采用8x8DCT情况
- sub16x16_dct8
- 对4个8x8的DCT系数块进行处理:包括可能的去噪x264_denoise_dct,量化(标量/矢量)
- denoise_dct
- x264_quant_8x8
- scan_8x8
- dequant_8x8
- add8x8_idct8
- 对一般情况的处理
- sub16x16_dct
- denoise_dct
- x264_quant_4x4
- scan_4x4
- dequant_4x4
- decimate_score16
- add8x8_idct
- 对色度块编码
- 处理色差分量,如果是Intra的则进行预测
- x264_predict_lossless_8x8_chroma色度块8*8无损预测
- 如果是Intra的则进行预测
- x264_mb_encode_8x8_chroma
- 存储宏块编码模式,以待下次使用或参考
- x264_bitstream_check_buffer
- 处理码流输出,分CABAC和CAVLC两种情况
- x264_cabac_encode_terminal
- x264_cabac_mb_skip
- x264_macroblock_write_cabac
- x264_cabac_mb_type
- IS_SKIP
- x264_cabac_encode_decision_noup
- SLICE_TYPE_I
- x264_cabac_mb_type_intra
- SLICE_TYPE_P
- P_L0
- x264_cabac_encode_decision_noup
- D_16x16
- D_16x8
- D_8x16
- P_8x8
- x264_cabac_encode_decision_noup
- intra
- x264_cabac_encode_decision_noup
- x264_cabac_mb_type_intra
- SLICE_TYPE_B
- B_DIRECT
- x264_cabac_encode_decision_noup
- B_8x8
- x264_cabac_encode_decision_noup
- x264_cabac_encode_decision
- IS_INTRA
- x264_cabac_encode_decision_noup
- x264_cabac_encode_decision
- x264_cabac_mb_type_intra
- else{}
- x264_cabac_encode_decision_noup
- x264_cabac_encode_decision
- IS_INTRA
- x264_cabac_mb_transform_size
- x264_mb_predict_intra4x4_mode
- x264_mb_pred_mode4x4_fix
- x264_cabac_mb_intra4x4_pred_mode
- x264_cabac_mb_intra_chroma_pred_mode
- P_L0
- D_16x16
- x264_cabac_mb_ref
- x264_cabac_mb_mvd
- D_16x8
- x264_cabac_mb_ref
- x264_cabac_mb_mvd
- D_8x16
- x264_cabac_mb_ref
- x264_cabac_mb_mvd
- P_8x8
- x264_cabac_mb_sub_p_partition
- x264_cabac_mb_ref
- x264_cabac_mb8x8_mvd
- B_8x8
- x264_cabac_mb_sub_b_partition
- x264_cabac_mb_ref
- x264_cabac_mb8x8_mvd
- B_DIRECT
- D_16x16
- x264_cabac_mb_ref
- x264_cabac_mb_mvd
- D_16x8
- x264_cabac_mb_ref
- x264_cabac_mb_mvd
- D_8x16
- x264_cabac_mb_ref
- x264_cabac_mb_mvd
- x264_cabac_mb_cbp_luma
- x264_cabac_mb_cbp_chroma
- x264_mb_transform_8x8_allowed
- x264_cabac_mb_transform_size
- x264_cabac_mb_qp_delta
- block_residual_write_cabac
- block_residual_write_cabac_8x8
- bs_write_ue
- x264_macroblock_write_cavlc
- Write:
- type
- prediction
- mv
- IS_SKIP
- bs_write1
- I_4x4 I_8x8
- bs_write_ue
- bs_write1
- x264_mb_predict_intra4x4_mode
- x264_mb_pred_mode4x4_fix
- I_16x16
- bs_write_ue
- P_L0
- D_16x16
- bs_write_ue
- bs_write_te
- x264_mb_predict_mv
- bs_write_se
- D_16x8
- bs_write_ue
- bs_write_te
- x264_mb_predict_mv
- bs_write_se
- D_8x16
- bs_write_ue
- bs_write_te
- x264_mb_predict_mv
- bs_write_se
- P_8x8
- bs_write_ue
- bs_write
- bs_write_te
- cavlc_mb8x8_mvd
- B_8x8
- bs_write_ue
- bs_write_te
- cavlc_mb8x8_mvd
- !B_DIRECT
- bs_write_ue
- bs_write_te
- B_DIRECT
- bs_write_ue
- Coded block patern
- bs_write_ue
- transform size 8x8 flag
- x264_mb_transform_8x8_allowed
- bs_write1
- write residual
- cavlc_qp_delta
- block_residual_write_cavlc
- x264_macroblock_luma_write_cavlc
- x264_macroblock_cache_save
- x264_macroblock_store_pic
- x264_prefetch_fenc
- prefetch_fenc
- save intra4x4
- save I_PCM
- save non zero count
- 更新宏块统计
- x264_ratecontrol_mb
- row_bits_so_far
- x264_ratecontrol_set_estimated_size
- update_predictor
- predict_row_size_sum
- row_bits_so_far
- x264_cabac_encode_flush
- x264_cabac_putbyte
- bs_write_ue
- bs_rbsp_trailing
- x264_nal_end
- x264_fdec_filter_row
- x264_frame_deblock_row
- x264_frame_expand_border
- x264_frame_filter
- integral_init4h
- integral_init4v
- integral_init8h
- integral_init8v
- x264_frame_expand_border_filtered
- plane_expand_border
- x264_frame_cond_broadcast
- bs_pos
- x264_frame_sort_pts
- x264_frame_sort
- x264_frame_unshift
- x264_frame_push
- x264_encoder_frame_end
- x264_frame_push_unused
- 终止比特流,设置输出
- 设置输出图像的属性
- 更新编码器的状态
- 更新码率控制部分
- x264_ratecontrol_end
- 统计i p b类型的Mb的个数,并计算平均QP
- 恢复CPU状态(即使用Float运算前).
- x264_emms
- 去噪更新
- x264_noise_reduction_update
- Compute/Print statistics
- x264_thread_sync_stat
- x264_frame_dump
-
NALU封装
- 处理NALU溢出
- x264_free
- x264_malloc
- x264_nal_encode NAL层编码
- 进行字节流格式的码流编码
- 长的开始前缀码
- NAL头部
- 脱壳操作,防止竞争
- 计算处理的数据长度,返回
- p_write_nalu写NALU到比特流文件中
- p_set_eop
-
Encode_frameB帧编码-Flush delayed B-frames
- Encode_frame
-
x264_picture_clean
- x264_free
-
x264_encoder_close
- 做一些清理工作,主要是释放空间
- x264_pthread_join
- x264_frame_delete
- x264_log
- x264_print_intra
- x264_ratecontrol_summary
- x264_ratecontrol_delete
- x264_frame_delete
- x264_macroblock_cache_end
- x264_free
- x264_free
- p_close_infile
- p_close_outfile
- 计算fps并打印