Lines Matching refs:table

579 static void HuffCountData( HuffData* table, const u8 *srcp, u32 size, u8 bitSize );
580 static u16 HuffConstructTree( HuffData* table, u32 dataNum );
581 static u32 HuffConvertData( const HuffData *table, const u8* srcp, u8* dstp, u32 srcSize, u32 maxS…
583 static void HuffAddParentDepthToTable( HuffData *table, u16 leftNo, u16 rightNo );
584 static void HuffAddCodeToTable ( HuffData *table, u16 nodeNo, u32 paHuffCode );
585 static u8 HuffAddCountHWordToTable ( HuffData *table, u16 nodeNo );
707 HuffData* table = info->huffTable; in HuffInitTable() local
712 table[ i ] = HUFF_TABLE_INIT_DATA; in HuffInitTable()
713 table[ i ].No = (u16)i; in HuffInitTable()
742 static void HuffCountData( HuffData* table, const u8 *srcp, u32 size, u8 bitSize ) in HuffCountData() argument
751 table[ srcp[ i ] ].Freq++; // 8-bit encoding in HuffCountData()
759 table[ tmp ].Freq++; // Store from upper 4 bits first // Either is OK in HuffCountData()
761 table[ tmp ].Freq++; // The problem is the encoding in HuffCountData()
774 static u16 HuffConstructTree( HuffData *table, u32 dataNum ) in HuffConstructTree() argument
790 if ( ( table[i].Freq == 0 ) || in HuffConstructTree()
791 ( table[i].PaNo != 0 ) ) in HuffConstructTree()
800 else if ( table[i].Freq < table[ leftNo ].Freq ) in HuffConstructTree()
809 if ( ( table[i].Freq == 0 ) || in HuffConstructTree()
810 ( table[i].PaNo != 0 ) || in HuffConstructTree()
820 else if ( table[i].Freq < table[rightNo].Freq ) in HuffConstructTree()
832 table[ tableTop ].Freq = table[ leftNo ].Freq; in HuffConstructTree()
833 table[ tableTop ].ChNo[0] = (s16)leftNo; in HuffConstructTree()
834 table[ tableTop ].ChNo[1] = (s16)leftNo; in HuffConstructTree()
835 table[ tableTop ].LeafDepth = 1; in HuffConstructTree()
836 table[ leftNo ].PaNo = (s16)tableTop; in HuffConstructTree()
837 table[ leftNo ].Bit = 0; in HuffConstructTree()
838 table[ leftNo ].PaDepth = 1; in HuffConstructTree()
850 table[ tableTop ].Freq = table[ leftNo ].Freq + table[ rightNo ].Freq; in HuffConstructTree()
851 table[ tableTop ].ChNo[0] = (s16)leftNo; in HuffConstructTree()
852 table[ tableTop ].ChNo[1] = (s16)rightNo; in HuffConstructTree()
853 if ( table[ leftNo ].LeafDepth > table[ rightNo ].LeafDepth ) in HuffConstructTree()
855 table[ tableTop ].LeafDepth = (u16)( table[ leftNo ].LeafDepth + 1 ); in HuffConstructTree()
859 table[ tableTop ].LeafDepth = (u16)( table[ rightNo ].LeafDepth + 1 ); in HuffConstructTree()
862 table[ leftNo ].PaNo = table[ rightNo ].PaNo = (s16)(tableTop); in HuffConstructTree()
863 table[ leftNo ].Bit = 0; in HuffConstructTree()
864 table[ rightNo ].Bit = 1; in HuffConstructTree()
866 HuffAddParentDepthToTable( table, (u16)leftNo, (u16)rightNo ); in HuffConstructTree()
873 …HuffAddCodeToTable( table, rootNo, 0x00 ); // The Huffman code is the code with HuffCode's … in HuffConstructTree()
876 HuffAddCountHWordToTable( table, rootNo ); in HuffConstructTree()
884 static void HuffAddParentDepthToTable( HuffData *table, u16 leftNo, u16 rightNo ) in HuffAddParentDepthToTable() argument
886 table[ leftNo ].PaDepth++; in HuffAddParentDepthToTable()
887 table[ rightNo ].PaDepth++; in HuffAddParentDepthToTable()
889 if ( table[ leftNo ].LeafDepth != 0 ) in HuffAddParentDepthToTable()
891 … HuffAddParentDepthToTable( table, (u16)table[ leftNo ].ChNo[0], (u16)table[ leftNo ].ChNo[1] ); in HuffAddParentDepthToTable()
893 if ( table[ rightNo ].LeafDepth != 0 ) in HuffAddParentDepthToTable()
895 … HuffAddParentDepthToTable( table, (u16)table[ rightNo ].ChNo[0], (u16)table[ rightNo ].ChNo[1] ); in HuffAddParentDepthToTable()
902 static void HuffAddCodeToTable( HuffData* table, u16 nodeNo, u32 paHuffCode ) in HuffAddCodeToTable() argument
904 table[ nodeNo ].HuffCode = (paHuffCode << 1) | table[ nodeNo ].Bit; in HuffAddCodeToTable()
906 if ( table[ nodeNo ].LeafDepth != 0 ) in HuffAddCodeToTable()
908 HuffAddCodeToTable( table, (u16)table[ nodeNo ].ChNo[0], table[ nodeNo ].HuffCode ); in HuffAddCodeToTable()
909 HuffAddCodeToTable( table, (u16)table[ nodeNo ].ChNo[1], table[ nodeNo ].HuffCode ); in HuffAddCodeToTable()
917 static u8 HuffAddCountHWordToTable( HuffData *table, u16 nodeNo) in HuffAddCountHWordToTable() argument
921 switch ( table[ nodeNo ].LeafDepth ) in HuffAddCountHWordToTable()
929 leftHWord = HuffAddCountHWordToTable( table, (u16)table[nodeNo].ChNo[0] ); in HuffAddCountHWordToTable()
930 rightHWord = HuffAddCountHWordToTable( table, (u16)table[nodeNo].ChNo[1] ); in HuffAddCountHWordToTable()
934 table[ nodeNo ].HWord = (u16)( leftHWord + rightHWord + 1 ); in HuffAddCountHWordToTable()
1219 static u32 HuffConvertData( const HuffData *table, const u8* srcp, u8* dstp, u32 srcSize, u32 maxSi… in HuffConvertData() argument
1233 bitStream = (bitStream << table[ val ].PaDepth) | table[ val ].HuffCode; in HuffConvertData()
1234 streamLength += table[ val ].PaDepth; in HuffConvertData()
1260 bitStream = (bitStream << table[ srcTmp ].PaDepth) | table[ srcTmp ].HuffCode; in HuffConvertData()
1261 streamLength += table[ srcTmp ].PaDepth; in HuffConvertData()