📄 umc_dv_decoder_tables.cpp
字号:
0x00000180 + 46, 46, 0, 0x00000180 + 47, 47, 0, 0x00000180 + 48, 48, 0, 0x00000180 + 49, 49, 0,//11 0x00000180 + 50, 50, 0, 0x00000180 + 51, 51, 0, 0x00000180 + 52, 52, 0, 0x00000180 + 53, 53, 0,//12 0x00000180 + 54, 54, 0, 0x00000180 + 55, 55, 0, 0x00000180 + 56, 56, 0, 0x00000180 + 57, 57, 0,//13 0x00000180 + 58, 58, 0, 0x00000180 + 59, 59, 0, 0x00000180 + 60, 60, 0, 0x00000180 + 61, 61, 0,//14 (x4)=56 0x00000180 + 62, 0, 0, 0x00000180 + 63, 0, 0, -1 /* end of table */};int DVVideoDecoder::DVCreateADequantizeTable(){ vm_var16 lpBuffer[14 *64], *lpBuffer1; int i,j; /* this pretty table was designed to avoid coincidencies with any GPL code */ vm_var32 tabl1[] = { 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63 }; vm_var32 tabl2[] = { 0, 32, 1, 33, 8, 40, 2, 34, 9, 41, 16, 48, 24, 56, 17, 49, 10, 42, 3, 35, 4, 36, 11, 43, 18, 50, 25, 57, 26, 58, 19, 51, 12, 44, 5, 37, 6, 38, 13, 45, 20, 52, 27, 59, 28, 60, 21, 53, 14, 46, 7, 39, 15, 47, 22, 54, 29, 61, 30, 62, 23, 55, 31, 63 }; vm_var32 *lineTable, lineTable1[ ]= { //0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 4, 4, 3, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, // 0, 0, 0, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, // V 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 0, 0, 0, 0, //0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 0, //0, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 // 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 0, 0 13, 12, 12, 8, 8, 11, 11, 6, 6, 5, 5, 4, 4, 10, 9, 9 }; static double TablW0[] = { (0.5/*2500076*/),(_W0*_W1/2),(_W0*_W2/2),(_W0*_W3/2),(_W0*_W4/2),(_W0*_W5/2),(_W0*_W6/2),(_W0*_W7/2), (_W1*_W0/2),(_W1*_W1/2),(_W1*_W2/2),(_W1*_W3/2),(_W1*_W4/2),(_W1*_W5/2),(_W1*_W6/2),(_W1*_W7/2), (_W2*_W0/2),(_W2*_W1/2),(_W2*_W2/2),(_W2*_W3/2),(_W2*_W4/2),(_W2*_W5/2),(_W2*_W6/2),(_W2*_W7/2), (_W3*_W0/2),(_W3*_W1/2),(_W3*_W2/2),(_W3*_W3/2),(_W3*_W4/2),(_W3*_W5/2),(_W3*_W6/2),(_W3*_W7/2), (_W4*_W0/2),(_W4*_W1/2),(_W4*_W2/2),(_W4*_W3/2),(_W4*_W4/2),(_W4*_W5/2),(_W4*_W6/2),(_W4*_W7/2), (_W5*_W0/2),(_W5*_W1/2),(_W5*_W2/2),(_W5*_W3/2),(_W5*_W4/2),(_W5*_W5/2),(_W5*_W6/2),(_W5*_W7/2), (_W6*_W0/2),(_W6*_W1/2),(_W6*_W2/2),(_W6*_W3/2),(_W6*_W4/2),(_W6*_W5/2),(_W6*_W6/2),(_W6*_W7/2), (_W7*_W0/2),(_W7*_W1/2),(_W7*_W2/2),(_W7*_W3/2),(_W7*_W4/2),(_W7*_W5/2),(_W7*_W6/2),(_W7*_W7/2) }; static double TablW1[] = { (0.5/*2500076*/),(_W0*_W1/2),(_W0*_W2/2),(_W0*_W3/2),(_W0*_W4/2),(_W0*_W5/2),(_W0*_W6/2),(_W0*_W7/2), (_W2*_W0/2),(_W2*_W1/2),(_W2*_W2/2),(_W2*_W3/2),(_W2*_W4/2),(_W2*_W5/2),(_W2*_W6/2),(_W2*_W7/2), (_W4*_W0/2),(_W4*_W1/2),(_W4*_W2/2),(_W4*_W3/2),(_W4*_W4/2),(_W4*_W5/2),(_W4*_W6/2),(_W4*_W7/2), (_W6*_W0/2),(_W6*_W1/2),(_W6*_W2/2),(_W6*_W3/2),(_W6*_W4/2),(_W6*_W5/2),(_W6*_W6/2),(_W6*_W7/2), (_W0*_W0/2),(_W0*_W1/2),(_W0*_W2/2),(_W0*_W3/2),(_W0*_W4/2),(_W0*_W5/2),(_W0*_W6/2),(_W0*_W7/2), (_W2*_W0/2),(_W2*_W1/2),(_W2*_W2/2),(_W2*_W3/2),(_W2*_W4/2),(_W2*_W5/2),(_W2*_W6/2),(_W2*_W7/2), (_W4*_W0/2),(_W4*_W1/2),(_W4*_W2/2),(_W4*_W3/2),(_W4*_W4/2),(_W4*_W5/2),(_W4*_W6/2),(_W4*_W7/2), (_W6*_W0/2),(_W6*_W1/2),(_W6*_W2/2),(_W6*_W3/2),(_W6*_W4/2),(_W6*_W5/2),(_W6*_W6/2),(_W6*_W7/2), }; // clear returned pointer (may be error occurs) m_lpADequantizeLineTable = NULL; m_lpADequantizeTable = NULL; // alloc aligned memory m_lpBuffer2 = ( vm_var16 *) malloc(SIZE_TABLE_A_DEQUANTIZE * 2 + 0x10); lpBuffer1 = align_pointer<vm_var16 *> (m_lpBuffer2, ALING_VALUE); lineTable = (vm_var32 *) malloc( 1024); for (i=0;i<64;i+=2) lineTable[i] = lineTable1[i]; for (i=1;i<64;i+=2) lineTable[i] = lineTable1[i]; if (NULL == lpBuffer1) return -1; // fill adaptive dequantization values (see blue book) INIT_A_D_E( 0, 1, 1, 1, 1) INIT_A_D_E( 1, 1, 1, 1, 2) INIT_A_D_E( 2, 1, 1, 2, 2) INIT_A_D_E( 3, 1, 2, 2, 4) INIT_A_D_E( 4, 2, 2, 4, 4) INIT_A_D_E( 5, 2, 4, 4, 8) INIT_A_D_E( 6, 4, 4, 8, 8) INIT_A_D_E( 7, 4, 8, 8, 16) INIT_A_D_E( 8, 8, 8, 16, 16) INIT_A_D_E( 9, 2, 2, 2, 2)//0 INIT_A_D_E( 10, 2, 2, 2, 4)//1 //2- 4 //3- 5 //4- 6 INIT_A_D_E( 11, 4, 8, 8, 16)//5 //6- 8 INIT_A_D_E( 12, 8, 16, 16, 32)//7 INIT_A_D_E( 13, 16, 16, 32, 32)//8 for(j=0;j<14;j++) for(i=0;i<64;i++) lpBuffer1[j * 64 + tabl1[i]] = (vm_var16) (lpBuffer[j* 64 + i] * (int)(((double) (1 << 8)) / TablW0[tabl1[i]])); for( j=0;j<14;j++) for(i=0;i<64;i++) lpBuffer1[64 * 14 + j * 64 + tabl2[i]] = (vm_var16) (lpBuffer[j* 64 + i]*(int)(((double) (1 << 8 )) / TablW1[tabl2[i]])); m_lpADequantizeLineTable = lineTable; m_lpADequantizeTable = lpBuffer1; return 0;} //int DVCreateADequantizeTable(unsigned int **m_lpADequantizeTable)/* this pretty table was designed to avoid coincidences with any GPL code */vm_var32 DVVideoDecoder::_INTERNAL_DEZIGZAG_TABLE_0[] ={ 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63, 0, 32, 1, 33, 8, 40, 2, 34, 9, 41, 16, 48, 24, 56, 17, 49, 10, 42, 3, 35, 4, 36, 11, 43, 18, 50, 25, 57, 26, 58, 19, 51, 12, 44, 5, 37, 6, 38, 13, 45, 20, 52, 27, 59, 28, 60, 21, 53, 14, 46, 7, 39, 15, 47, 22, 54, 29, 61, 30, 62, 23, 55, 31, 63};#undef INIT_A_D_E#undef SIZE_TABLE_A_DEQUANTIZE#undef _INTERNAL_CS1#undef _INTERNAL_CS2#undef _INTERNAL_CS3#undef _INTERNAL_CS4#undef _INTERNAL_CS5#undef _INTERNAL_CS6#undef _INTERNAL_CS7#undef _W0#undef _W1#undef _W2#undef _W3#undef _W4#undef _W5#undef _W6#undef _W7} // end namespace UMC
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -