Lines Matching refs:table

577 static void HuffCountData( HuffData* table, const u8 *srcp, u32 size, u8 bitSize );
578 static u16 HuffConstructTree( HuffData* table, u32 dataNum );
579 static u32 HuffConvertData( const HuffData *table, const u8* srcp, u8* dstp, u32 srcSize, u32 maxS…
581 static void HuffAddParentDepthToTable( HuffData *table, u16 leftNo, u16 rightNo );
582 static void HuffAddCodeToTable ( HuffData *table, u16 nodeNo, u32 paHuffCode );
583 static u8 HuffAddCountHWordToTable ( HuffData *table, u16 nodeNo );
705 HuffData* table = info->huffTable; in HuffInitTable() local
710 table[ i ] = HUFF_TABLE_INIT_DATA; in HuffInitTable()
711 table[ i ].No = (u16)i; in HuffInitTable()
740 static void HuffCountData( HuffData* table, const u8 *srcp, u32 size, u8 bitSize ) in HuffCountData() argument
749 table[ srcp[ i ] ].Freq++; // 8-bit encoding in HuffCountData()
757 table[ tmp ].Freq++; // Store from upper 4 bits first // Either is OK in HuffCountData()
759 table[ tmp ].Freq++; // The problem is the encoding in HuffCountData()
772 static u16 HuffConstructTree( HuffData *table, u32 dataNum ) in HuffConstructTree() argument
788 if ( ( table[i].Freq == 0 ) || in HuffConstructTree()
789 ( table[i].PaNo != 0 ) ) in HuffConstructTree()
798 else if ( table[i].Freq < table[ leftNo ].Freq ) in HuffConstructTree()
807 if ( ( table[i].Freq == 0 ) || in HuffConstructTree()
808 ( table[i].PaNo != 0 ) || in HuffConstructTree()
818 else if ( table[i].Freq < table[rightNo].Freq ) in HuffConstructTree()
830 table[ tableTop ].Freq = table[ leftNo ].Freq; in HuffConstructTree()
831 table[ tableTop ].ChNo[0] = (s16)leftNo; in HuffConstructTree()
832 table[ tableTop ].ChNo[1] = (s16)leftNo; in HuffConstructTree()
833 table[ tableTop ].LeafDepth = 1; in HuffConstructTree()
834 table[ leftNo ].PaNo = (s16)tableTop; in HuffConstructTree()
835 table[ leftNo ].Bit = 0; in HuffConstructTree()
836 table[ leftNo ].PaDepth = 1; in HuffConstructTree()
848 table[ tableTop ].Freq = table[ leftNo ].Freq + table[ rightNo ].Freq; in HuffConstructTree()
849 table[ tableTop ].ChNo[0] = (s16)leftNo; in HuffConstructTree()
850 table[ tableTop ].ChNo[1] = (s16)rightNo; in HuffConstructTree()
851 if ( table[ leftNo ].LeafDepth > table[ rightNo ].LeafDepth ) in HuffConstructTree()
853 table[ tableTop ].LeafDepth = (u16)( table[ leftNo ].LeafDepth + 1 ); in HuffConstructTree()
857 table[ tableTop ].LeafDepth = (u16)( table[ rightNo ].LeafDepth + 1 ); in HuffConstructTree()
860 table[ leftNo ].PaNo = table[ rightNo ].PaNo = (s16)(tableTop); in HuffConstructTree()
861 table[ leftNo ].Bit = 0; in HuffConstructTree()
862 table[ rightNo ].Bit = 1; in HuffConstructTree()
864 HuffAddParentDepthToTable( table, (u16)leftNo, (u16)rightNo ); in HuffConstructTree()
871 …HuffAddCodeToTable( table, rootNo, 0x00 ); // The Huffman code is the code with HuffCode's … in HuffConstructTree()
874 HuffAddCountHWordToTable( table, rootNo ); in HuffConstructTree()
882 static void HuffAddParentDepthToTable( HuffData *table, u16 leftNo, u16 rightNo ) in HuffAddParentDepthToTable() argument
884 table[ leftNo ].PaDepth++; in HuffAddParentDepthToTable()
885 table[ rightNo ].PaDepth++; in HuffAddParentDepthToTable()
887 if ( table[ leftNo ].LeafDepth != 0 ) in HuffAddParentDepthToTable()
889 … HuffAddParentDepthToTable( table, (u16)table[ leftNo ].ChNo[0], (u16)table[ leftNo ].ChNo[1] ); in HuffAddParentDepthToTable()
891 if ( table[ rightNo ].LeafDepth != 0 ) in HuffAddParentDepthToTable()
893 … HuffAddParentDepthToTable( table, (u16)table[ rightNo ].ChNo[0], (u16)table[ rightNo ].ChNo[1] ); in HuffAddParentDepthToTable()
900 static void HuffAddCodeToTable( HuffData* table, u16 nodeNo, u32 paHuffCode ) in HuffAddCodeToTable() argument
902 table[ nodeNo ].HuffCode = (paHuffCode << 1) | table[ nodeNo ].Bit; in HuffAddCodeToTable()
904 if ( table[ nodeNo ].LeafDepth != 0 ) in HuffAddCodeToTable()
906 HuffAddCodeToTable( table, (u16)table[ nodeNo ].ChNo[0], table[ nodeNo ].HuffCode ); in HuffAddCodeToTable()
907 HuffAddCodeToTable( table, (u16)table[ nodeNo ].ChNo[1], table[ nodeNo ].HuffCode ); in HuffAddCodeToTable()
915 static u8 HuffAddCountHWordToTable( HuffData *table, u16 nodeNo) in HuffAddCountHWordToTable() argument
919 switch ( table[ nodeNo ].LeafDepth ) in HuffAddCountHWordToTable()
927 leftHWord = HuffAddCountHWordToTable( table, (u16)table[nodeNo].ChNo[0] ); in HuffAddCountHWordToTable()
928 rightHWord = HuffAddCountHWordToTable( table, (u16)table[nodeNo].ChNo[1] ); in HuffAddCountHWordToTable()
932 table[ nodeNo ].HWord = (u16)( leftHWord + rightHWord + 1 ); in HuffAddCountHWordToTable()
1217 static u32 HuffConvertData( const HuffData *table, const u8* srcp, u8* dstp, u32 srcSize, u32 maxSi… in HuffConvertData() argument
1231 bitStream = (bitStream << table[ val ].PaDepth) | table[ val ].HuffCode; in HuffConvertData()
1232 streamLength += table[ val ].PaDepth; in HuffConvertData()
1258 bitStream = (bitStream << table[ srcTmp ].PaDepth) | table[ srcTmp ].HuffCode; in HuffConvertData()
1259 streamLength += table[ srcTmp ].PaDepth; in HuffConvertData()