Merge pull request #9 from DizzyEggg/compresss
Remove DMA from decompression code
This commit is contained in:
commit
58058a0d1d
1 changed files with 22 additions and 14 deletions
|
@ -321,16 +321,7 @@ void BuildDecompressionTable(const u32 *packedFreqs, struct DecodeYK *table, u32
|
|||
{
|
||||
if (freqs[i] != 0)
|
||||
{
|
||||
DmaCopy16(3, &sYkTemplate[freqs[i]], &table[currCol], freqs[i]*sizeof(struct DecodeYK));
|
||||
for (u32 j = 0; j < freqs[i]; j++)
|
||||
symbolTable[currCol + j] = i;
|
||||
currCol += freqs[i];
|
||||
}
|
||||
// Fully unrolling this loop worsens the performance, however this partial unroll makes it better by about 3k cycles.
|
||||
i++;
|
||||
if (freqs[i] != 0)
|
||||
{
|
||||
DmaCopy16(3, &sYkTemplate[freqs[i]], &table[currCol], freqs[i]*sizeof(struct DecodeYK));
|
||||
CpuCopy32(&sYkTemplate[freqs[i]], &table[currCol], freqs[i]*sizeof(struct DecodeYK));
|
||||
for (u32 j = 0; j < freqs[i]; j++)
|
||||
symbolTable[currCol + j] = i;
|
||||
currCol += freqs[i];
|
||||
|
@ -547,6 +538,23 @@ void DecodeSymDeltatANS(const u32 *data, const u32 *pFreqs, u16 *resultVec, u32
|
|||
SwitchToArmCallSymDeltaANS(data, &stuff, maskTable, (void *) funcBuffer);
|
||||
}
|
||||
|
||||
static inline void Copy16(void *_src, void *_dst, u32 size)
|
||||
{
|
||||
u16 *src = _src;
|
||||
u16 *dst = _dst;
|
||||
for (u32 i = 0; i < size; i++) {
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
static inline void Fill16(u16 value, void *_dst, u32 size)
|
||||
{
|
||||
u16 *dst = _dst;
|
||||
for (u32 i = 0; i < size; i++) {
|
||||
dst[i] = value;
|
||||
}
|
||||
}
|
||||
|
||||
__attribute__((target("arm"))) __attribute__((noinline)) void DecodeInstructions(u32 headerLoSize, u8 *loVec, u16 *symVec, void *dest)
|
||||
{
|
||||
u32 loIndex = 0;
|
||||
|
@ -579,20 +587,20 @@ __attribute__((target("arm"))) __attribute__((noinline)) void DecodeInstructions
|
|||
dest = (void *)(dest + 2);
|
||||
if (currOffset == 1)
|
||||
{
|
||||
DmaFill16(3, symVec[symIndex], dest, 2*currLength);
|
||||
Fill16(symVec[symIndex], dest, currLength);
|
||||
dest = (void *)(dest + currLength*2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
DmaCopy16(3, (void *)(dest - currOffset*2), dest, currLength*2);
|
||||
Copy16((void *)(dest - currOffset*2), dest, currLength);
|
||||
//DmaCopy16(3, (void *)(dest - currOffset*2), dest, currLength*2);
|
||||
dest = (void *)(dest + currLength*2);
|
||||
}
|
||||
symIndex++;
|
||||
}
|
||||
else
|
||||
{
|
||||
DmaCopy16(3, &symVec[symIndex], dest, currOffset*2);
|
||||
Copy16(&symVec[symIndex], dest, currOffset);
|
||||
dest = (void *)(dest + currOffset*2);
|
||||
symIndex += currOffset;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue