综合门户网站建设,汕头seo建站,哪个网站可以做免费请帖,网络营销推广的案例encode_one_macroblock()函数中的运动估计分为两大块#xff0c;对于宏块级的三种模式#xff0c;分块后直接对patition依次调用PartitionMotionSearch()函数#xff1b;而对于亚宏块级的#xff08;含8x8, 8x4,4x8,4x4#xff09;模式#xff0c;首先将宏块拆分为4个88子… encode_one_macroblock()函数中的运动估计分为两大块对于宏块级的三种模式分块后直接对patition依次调用PartitionMotionSearch()函数而对于亚宏块级的含8x8, 8x4,4x8,4x4模式首先将宏块拆分为4个8×8子宏块针对每个8×8子宏块调用PartitionMotionSearch()函数。void PartitionMotionSearch (int blocktype, //块模式 int block8x8, //当前partition在宏块的序号 double lambda) // λ { static int bx0[5][4] {{0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,2,0,0}, {0,2,0,2}}; static int by0[5][4] {{0,0,0,0}, {0,0,0,0}, {0,2,0,0}, {0,0,0,0}, {0,0,2,2}}; //参见注释[1] int **ref_array, ***mv_array; //参考帧列表和运动向量列表 int parttype (blocktype4?blocktype:4); int step_h0 (input-blc_size[ parttype][0]2); int step_v0 (input-blc_size[ parttype][1]2); //partition的尺寸用于决定block的边界对非P8×8模式无意义。 int step_h (input-blc_size[blocktype][0]2); //子块的尺寸 int step_v (input-blc_size[blocktype][1]2); int v, h; // BlockMotionSearch()函数要处理的子块在当前宏块中的相对块坐标 //以上尺寸全部以4×4block为单位numlistsbslice?2:1; for (list0; list { for (ref0; ref listXsize[listlist_offset]; ref) { ref_array enc_picture-ref_idx[list]; mv_array enc_picture-mv[list]; //遍历partition中的每一个 for (vby0[parttype][block8x8]; v { pic_block_y img-block_y v;// 当前子块在图像中的块坐标当前宏块的块坐标当前子块在宏块中的相对块坐标 for (hbx0[parttype][block8x8]; h { pic_block_x img-block_x h; // 当前子块在图像中的块坐标当前宏块的块坐标当前子块在宏块中的相对块坐标 mcost BlockMotionSearch (ref, list, h2, v2, blocktype, search_range, lambda); //对当前子块作运动向量搜索 motion_cost[blocktype][list][ref][block8x8] mcost; //保存代价值 for (j0; j for (i0; i { mv_array [pic_block_xi][pic_block_yj][0] img-all_mv[h][v][list][ref][blocktype][0]; mv_array [pic_block_xi][pic_block_yj][1] img-all_mv[h][v][list][ref][blocktype][1]; //以4×4block为单位保存运动向量 ref_array [pic_block_xi][pic_block_yj] ref; //保存参考帧序号 } } } } } } [1] static int bx0[5][4] {{0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,2,0,0}, {0,2,0,2}}; static int by0[5][4] {{0,0,0,0}, {0,0,0,0}, {0,2,0,0}, {0,0,0,0}, {0,0,2,2}}; 这里的bx0, by0两个数组分别对应了SKIP模式16×1616×88×16P8×8这四种模式的横坐标和纵坐标。举两个例子 如图所示的16×16宏块首先划分为4个8×8子块因为PartitionMotionSearch()函数处理的最小块的尺寸为8×8以4×4block为单位设定坐标图上已标出4个8×8子块左上角的块坐标。SKIP模式实际上并不牵涉到这个函数因此坐标全部置零16×16模式只有第一个坐标起作用后三个置零16×8只有前两个有意义标出两个partition的左上角坐标如图标出了(0,0),(0,2)对照bx0, by0可以看到相应坐标值最多子块情况为4个8×8即最后一组坐标。