X264 中的x264_macroblock_cache_load 的问题

来源:互联网 发布:软件项目管理问题 编辑:程序博客网 时间:2024/05/22 07:44
分类: 技术 2008-12-04 10:36

关于拷贝模块,很复杂。
首先有x264_t结构体中的指针函数
   void (*copy[7])( uint8_t *dst, int, uint8_t *src, int, int i_height );
来自结构体x264_t中的, x264_mc_functions_t;
而这些指针函数的初始化来自
void x264_mc_init( int cpu, x264_mc_functions_t *pf )
{
    pf->copy[PIXEL_16x16] = mc_copy_w16;
    pf->copy[PIXEL_8x8]   = mc_copy_w8;
    pf->copy[PIXEL_4x4]   = mc_copy_w4;

}
mc_copy_w16定义于一个宏
#define MC_COPY(W) /
static void mc_copy_w##W( uint8_t *dst, int i_dst, uint8_t *src, int i_src, int i_height ) /
{ /
    mc_copy( src, i_src, dst, i_dst, W, i_height ); /
}
MC_COPY( 16 )
MC_COPY( 8 )
MC_COPY( 4 )

其中的W为暗含参数
这样追本溯源就可以得到
       
h->mc.copy[i?PIXEL_8x8:PIXEL_16x16]( h->mb.pic.p_fenc[i], FENC_STRIDE,
            &h->fenc->plane[i][ w * (i_mb_x + i_mb_y * i_stride) ], i_stride, w );

原创粉丝点击