x264_macroblock_analyse模块分析-3
来源:互联网 发布:js div加载html页面 编辑:程序博客网 时间:2024/06/06 03:17
5、void x264_me_refine_qpel( x264_t *h, x264_me_t *m )
该函数一开始得到半象素、1/4象素搜索的次数(菱形小模板),分别为hpel、q hpel,然后调用refine_subpel(),去看看!
if( hpel_iters ) { int mx = x264_clip3( m->mvp[0], h->mb.mv_min_spel[0], h->mb.mv_max_spel[0] ); int my = x264_clip3( m->mvp[1], h->mb.mv_min_spel[1], h->mb.mv_max_spel[1] ); if( mx != bmx || my != bmy ) COST_MV_SAD( mx, my, -1 ); }//检测MVp的小数精度。for( i = hpel_iters; i > 0; i-- ) { odir = bdir; omx = bmx; omy = bmy; COST_MV_SAD( omx, omy - 2, 0 ); COST_MV_SAD( omx, omy + 2, 1 ); COST_MV_SAD( omx - 2, omy, 2 ); COST_MV_SAD( omx + 2, omy, 3 ); if( bmx == omx && bmy == omy ) break; }//对半象素精度进行hpel_iters次小菱形搜索。后面有1/4象素精度的qpel_iters次小模板搜索,略。
6、static uint8_t *get_ref( uint8_t *src[4], int i_src_stride, uint8_t *dst,
该函数得到亚象素搜索时参考块的指针。
src1、src2分别指向半象素精度块。1/4搜索时需要临时插值,就是pixel_avg()函数的只能功能。
值得注意的是变量correction的作用,当作是1/4插值时的偏移量吧。N个人问过我,其实结合1/4象素插值,仔细推导一下就出来了。
7、static void x264_mb_analyse_intra( x264_t *h, x264_mb_analysis_t *a, int i_cost_inter )
依次检测Intra_16x16、Intra4x4、Intra8x8的最佳模式。
值得注意,if(subme<=1)
h->pixf.mbcmp是求sad值
else
h->pixf.mbcmp是求satd值
另外,对与Intra4x4、Intra8x8,此时就要进行真正的变换量化、反变换反量化、重建,因为要为后续的块做参考。而且,就算其系数值很小,也不能改变cbp,切记切记。
具体分析略。
8、static inline void x264_mb_analyse_transform( x264_t *h )
就是对残差进行4x4、8x8的satd变换,比较绝对和值,值较小对应的尺寸用于变换的尺寸。
- x264_macroblock_analyse模块分析-3
- x264_macroblock_analyse模块分析
- [转贴]x264_macroblock_analyse模块分析
- x264_macroblock_analyse模块分析
- x264_macroblock_analyse模块分析-2
- X264中x264_macroblock_analyse模块分析
- x264代码追踪之x264_macroblock_analyse模块分析
- x264_macroblock_analyse(x264_t *h ) 分析
- x264_macroblock_analyse(x264_t *h ) 分析
- x264_macroblock_analyse(x264_t *h ) 分析
- x264代码剖析(十一):核心算法之宏块分析函数x264_macroblock_analyse()
- 网络模块分析3
- gloox代码分析3 - 注册模块
- 差异分析定位Ring 3保护模块
- Appium源码分析(3)-路由器模块
- 差异分析定位Ring 3保护模块
- cocos2dx 音频模块分析(3): 背景音乐部分
- Floodlight模块分析:forwarding模块
- 博客搬家啦
- Task #4 - Deploy and test
- db2数据库跟踪方法
- 用gen_tcp创建本地服务器需要注意的一个问题
- python面向对象编程(2)—— 实例属性,类属性,类方法,静态方法
- x264_macroblock_analyse模块分析-3
- [LeetCode] Interleaving String
- android SQLite操作
- 办公室白领的IT必备
- Linux Shell编程入门
- 润乾报表简单通用查询报表设计
- 看懂SqlServer查询计划
- C# 将界面打印成图片,以PDF形式打开
- iOS 音乐播