A problem in function PartitionMotionSearch()
2011-10-16 11:34
204 查看
void PartitionMotionSearch (int blocktype,
int block8x8,
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}};
……
for (v=by0[parttype][block8x8]; v<by0[parttype][block8x8]+step_v0; v+=step_v) //===== LOOP OVER SUB MACRO BLOCK partitions
for (h=bx0[parttype][block8x8]; h<bx0[parttype][block8x8]+step_h0; h+=step_h)
………………
}
那两个数组跟运动估计时的分割方式有关系吗?有关系那是什么关系呢,如没有关系那两个数组是干嘛用的呢?
自我分析:在后面引用的时候by0[parttype][block8x8]; 分别用的是parttype和block8x8控制行和列
而前面有定义int parttype = (blocktype<4?blocktype:4);所以parttype 指宏块类型,分别为0.1.2.3.4.五个值
而block8x8也有相关语句:int block8x8, // <-- block number of 8x8 block指8*8宏块数目。
后面步长为step_v0,赋值为
int step_h0 = (input->blc_size[ parttype][0]>>2);
int step_v0 = (input->blc_size[ parttype][1]>>2);
int step_h = (input->blc_size[blocktype][0]>>2);
int step_v = (input->blc_size[blocktype][1]>>2);
又找了input->blc_size[,于是又有相关定义,
int blc_size[8][2]; //!< array for different block sizes
input->blc_size[0][0]=16;
input->blc_size[0][1]=16;
input->blc_size[1][0]=16;
input->blc_size[1][1]=16;
input->blc_size[2][0]=16;
input->blc_size[2][1]= 8;
input->blc_size[3][0]= 8;
input->blc_size[3][1]=16;
input->blc_size[4][0]= 8;
input->blc_size[4][1]= 8;
input->blc_size[5][0]= 8;
input->blc_size[5][1]= 4;
input->blc_size[6][0]= 4;
input->blc_size[6][1]= 8;
input->blc_size[7][0]= 4;
input->blc_size[7][1]= 4;
…………接下去我还是不懂
明白了…………
贴张图:
(bx0,by0)是一个宏块中的某个子宏块的相对坐标,以mode 4 8*8为例
一个宏块被分为4个8*8子块,每个子块相对于宏块坐标分别如上图所示:
即数组bx0,by0的第五个一维数组{0,2,0,2},{0,0,2,2}。
后面继续跟踪:
首先处理mode 1.2.3模式,对于p8*8模式,则是把16*16分成8*8后再调用PartitionMotionSearch()
…………
int block8x8,
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}};
……
for (v=by0[parttype][block8x8]; v<by0[parttype][block8x8]+step_v0; v+=step_v) //===== LOOP OVER SUB MACRO BLOCK partitions
for (h=bx0[parttype][block8x8]; h<bx0[parttype][block8x8]+step_h0; h+=step_h)
………………
}
那两个数组跟运动估计时的分割方式有关系吗?有关系那是什么关系呢,如没有关系那两个数组是干嘛用的呢?
自我分析:在后面引用的时候by0[parttype][block8x8]; 分别用的是parttype和block8x8控制行和列
而前面有定义int parttype = (blocktype<4?blocktype:4);所以parttype 指宏块类型,分别为0.1.2.3.4.五个值
而block8x8也有相关语句:int block8x8, // <-- block number of 8x8 block指8*8宏块数目。
后面步长为step_v0,赋值为
int step_h0 = (input->blc_size[ parttype][0]>>2);
int step_v0 = (input->blc_size[ parttype][1]>>2);
int step_h = (input->blc_size[blocktype][0]>>2);
int step_v = (input->blc_size[blocktype][1]>>2);
又找了input->blc_size[,于是又有相关定义,
int blc_size[8][2]; //!< array for different block sizes
input->blc_size[0][0]=16;
input->blc_size[0][1]=16;
input->blc_size[1][0]=16;
input->blc_size[1][1]=16;
input->blc_size[2][0]=16;
input->blc_size[2][1]= 8;
input->blc_size[3][0]= 8;
input->blc_size[3][1]=16;
input->blc_size[4][0]= 8;
input->blc_size[4][1]= 8;
input->blc_size[5][0]= 8;
input->blc_size[5][1]= 4;
input->blc_size[6][0]= 4;
input->blc_size[6][1]= 8;
input->blc_size[7][0]= 4;
input->blc_size[7][1]= 4;
…………接下去我还是不懂
明白了…………
贴张图:
(bx0,by0)是一个宏块中的某个子宏块的相对坐标,以mode 4 8*8为例
一个宏块被分为4个8*8子块,每个子块相对于宏块坐标分别如上图所示:
即数组bx0,by0的第五个一维数组{0,2,0,2},{0,0,2,2}。
后面继续跟踪:
首先处理mode 1.2.3模式,对于p8*8模式,则是把16*16分成8*8后再调用PartitionMotionSearch()
…………
相关文章推荐
- Know How To Use ID_NULL Function To Search An Object In Oracle Forms
- Support in the Wild: My Biggest Elasticsearch Problem at Scale
- 宏块的分块模式及函数PartitionMotionSearch
- PartitionMotionSearch()
- PartitionMotionSearch()函数
- PartitionMotionSearch()函数解析
- Duplicate range boundary values are not allowed in partition function boundary value list.
- BinarySearch function in C++ (urjnasw xkfjjkn@CSDN)
- Are there dictionary comprehensions in Python? (Problem with function returning dict)
- leetcode problem 33 -- Search in Rotated Sorted Array
- PartitionMotionSearch()函数解析
- dede5.6进入后台提示PHP Deprecated: Function ereg_replace() is deprecated in dede\\config.php on line 2
- leetcode 33|81. Search in Rotated Sorted Array 1|2
- 【leetcode】81. Search in Rotated Sorted Array II【java】
- Project Euler:Problem 11 Largest product in a grid
- 解决 js报错:Uncaught TypeError- Cannot use 'in' operator to search for 'length' in [{"id":"636","...
- leetcode — search-in-rotated-sorted-array
- python built-in function summary
- Google documents show hopes for big gains in non-search revenue 谷歌2013年超过35%的收益将来自非搜索业务
- 81. Search in Rotated Sorted Array II