X264源程序分析(x264_slice_write)——学习笔记(2)
来源:互联网 发布:广电网络集团前景 编辑:程序博客网 时间:2024/04/29 07:50
// http://auraleo.blog.sohu.com/10119199.html
TIMER_START( i_mtime_analyse ); x264_macroblock_analyse( h );//通过一系列的SAD算出最优方案。 TIMER_STOP( i_mtime_analyse ); ————————————————————————————————————————— void x264_macroblock_analyse( x264_t *h ) { /*--------------------------- Do the analysis ---------------------------*/ if( h->sh。i_type == SLICE_TYPE_I ) { /*帧内预测分析(亮度)。Try all mode and calculate their score。 Include: 16x16 prediction selection & 4x4 prediction selection */ x264_mb_analyse_intra( h, &analysis, COST_MAX ); —————————————————————————— static void x264_mb_analyse_intra( x264_t *h, x264_mb_analysis_t *res, int i_cost_inter ) { …… predict_16x16_mode_available( h->mb。i_neighbour, predict_mode, &i_max ); //根据是否存在top或left值,确定使用什么预测模式(16*16亮度预测模式) predict_4x4_mode_available( h->mb。i_neighbour, idx, predict_mode, &i_max ); //根据是否存在top或left值,确定使用什么预测模式(4*4亮度预测模式) } —————————————————————————— if( analysis。i_sad_i4x4 < analysis。i_sad_i16x16 )h->mb。i_type = I_4x4; else h->mb。i_type = I_16x16; } else if( h->sh。i_type == SLICE_TYPE_P ) { …… /* Fast P_SKIP detection *///判断是不是SKIP块 if( ( (i_neighbour&MB_LEFT) && h->mb。type[h->mb。i_mb_xy - 1] == P_SKIP ) || ( (i_neighbour&MB_TOP) && h->mb。type[h->mb。i_mb_xy - h->mb。i_mb_stride] == P_SKIP ) || ( ((i_neighbour&(MB_TOP|MB_LEFT)) == (MB_TOP|MB_LEFT) ) && h->mb。type[h->mb。i_mb_xy - h- >mb。i_mb_stride-1 ] == P_SKIP ) || ( (i_neighbour&MB_TOPRIGHT) && h->mb。type[h->mb。i_mb_xy - h->mb。i_mb_stride+1 ] == P_SKIP ) ) {b_skip = x264_macroblock_probe_pskip( h ); } if( b_skip ) { h->mb。i_type = P_SKIP; h->mb。i_partition = D_16x16; } else//Direct块 { …… x264_mb_analyse_load_costs( h, &analysis ); //帧间预测 /* Select best inter mode */ /*16*16、16*8、8*16、8*8、8*4、4*8、4*4*/…… /* refine qpel *//*帧间模式选择后,对该模式进行亚象素精细搜索。以进一步减少误差。注意,在前面每个模式的检测时,也要进行亚象素搜索(包括半象素和1/4象素)。我怎么觉得好像只有16*16的帧间模式检测中用到了亚像素的搜索呢(主要是这两个函数:x264_mb_predict_mv_ref16x16( h, 0, i_ref, mvc, &i_mvc ); x264_me_search_ref( h, &m, mvc, i_mvc, p_fullpel_thresh );)?*/ //帧内预测(亮度) x264_mb_analyse_intra( h, &analysis, i_cost ); if( h->mb。b_chroma_me && ( analysis。i_sad_i16x16 < i_cost|| ( analysis。i_sad_i4x4 < i_cost ))) { //满足条件后进行色度的帧内预测 x264_mb_analyse_intra_chroma( h, &analysis ); analysis。i_sad_i16x16 += analysis。i_sad_i8x8; analysis。i_sad_i4x4 += analysis。i_sad_i8x8; }/*亮度代价分别存在analysis。i_sad_i16x16/i8x8/i4x4中,色度代价存在analysis。i_sad_i8x8chroma中。*/ else if( h->sh。i_type == SLICE_TYPE_B ) …… /*-------------------- Update MB from the analysis ----------------------*/ /*根据上述所判断的结果,进行详细的帧内或帧间预测*/ } ————————————————————————————————————————— /* encode this macrobock -> be carefull it can change the mb type to P_SKIP if needed */ TIMER_START( i_mtime_encode ); x264_macroblock_encode( h ); TIMER_STOP( i_mtime_encode );
- X264源程序分析(x264_slice_write)——学习笔记(2)
- X264源程序分析(x264_slice_write)——学习笔记(1)
- X264源程序分析(x264_slice_write)——学习笔记(3)
- X264源程序分析(x264_slice_write)——学习笔记(4)
- x264源代码简单分析:x264_slice_write()
- x264源代码简单分析:x264_slice_write()
- x264学习(2)——x264命令行参数解释
- x264源码分析三:x264_slices_write和x264_slice_write函数分析
- X264学习笔记(1)
- x264学习笔记(一)
- vc++学习——源程序组成结构(No.2)
- x264源代码简单分析:x264命令行工具(x264.exe)
- x264源代码简单分析:x264命令行工具(x264.exe)
- x264学习(1)——简述x264几种码率控制方式的实现
- x264 学习(一)
- C++学习笔记之一(C++源程序构成)
- x264源代码分析(转载)
- 学习笔记(一)(x264编码流程)
- spring 自带filter解决form提交中文乱码
- android电池(四):电池 电量计(MAX17040)驱动分析篇
- 如何将USBKey中的证书注册到Windows系统中、分享一个 证书 C++安装
- PHP5新特性
- MVAPI第一个版本架构图
- X264源程序分析(x264_slice_write)——学习笔记(2)
- android电池(五):电池 充电IC(PM2301)驱动分析篇
- DB2安全角色及权限明细
- Android开源库集锦 + Android场景桌面(一) 转自way
- PreTranslateMessage
- alsa移植到arm linux嵌入式系统中
- 情绪ABC理论
- Objective-C与JavaScript的交互,很一般
- 国内外推荐系统应用总结