对x264的函数macroblockcacheload_neighbours中的每行代码注释
- User
对x264的函数macroblock_cache_load_neighbours中的每行代码注释
- Assistant
/* Load the neighbouring macroblocks into cache */
void macroblock_cache_load_neighbours (macroblock_t *mb, x264_t *h) { int x,y; int mb_xy = mb->mb_xy; x264_picture_t *pic = &h->sh.working_picture;
/* Load the previously encoded bottom macroblock */ if( mb_xy >= h->mb_stride ) { mb->bottom_mb = h->mb_cache[mb_xy-h->mb_stride]; } /* Load the left macroblock */ mb->left_mb = h->mb_cache[mb_xy-1]; /* Load the top macroblocks */ for( x = 0; x < mb->mb_width; x++ ) { y = -1; mb->top_mb[x] = mb_xy - h->mb_stride; if( mb->top_available ) { mb->top_mb[x] = h->mb_cache[mb_xy-h->mb_stride+x]; } }}
/* 该函数用于将周围图像块加载到缓存中 */
void macroblock_cache_load_neighbours (macroblock_t *mb, x264_t *h) { int x,y; // 定义变量x和y int mb_xy = mb->mb_xy; // 记录该宏块在图像中的位置 x264_picture_t *pic = &h->sh.working_picture; // 指向工作图像
- User
- Assistant