SSBM Decomp
Loading...
Searching...
No Matches
thp.h
Go to the documentation of this file.
1#ifndef THP_H
2#define THP_H
3
4#include <dolphin/os.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10typedef u8 THPSample;
11typedef s16 THPCoeff;
12typedef f32 THPQuantTab[64];
13
14typedef struct _THPHuffmanTab {
15 /* 0x00 */ u8 quick[32];
16 /* 0x20 */ u8 increment[32];
17 /* 0x40 */ u8* Vij;
18 /* 0x44 */ s32 maxCode[18];
19 /* 0x8C */ s32 valPtr[18];
20 /* 0xD4 */ u8 Vij1;
21 /* 0xD5 */ u8 padD5[0xD8 - 0xD5];
22 /* 0xD8 */ u8* bits;
23 /* 0xDC */ s8* sizeTab;
24 /* 0xE0 */ u32* codeTab;
25 /* 0xE4 */ u32 numCodes;
26 /* 0xE8 */ u16 numVij;
27 /* 0xEA */ u16 padEA;
28} THPHuffmanTab; // size = 0xEC
29
30typedef struct _THPComponent {
31 /* 0x00 */ u8 componentID;
32 /* 0x01 */ u8 samplingH;
33 /* 0x02 */ u8 samplingV;
35 /* 0x04 */ u8 DCTableSelector;
36 /* 0x05 */ u8 ACTableSelector;
37 /* 0x06 */ THPCoeff predDC;
38 /* 0x08 */ u32 x08;
39 /* 0x0C */ u32 x0C;
40 /* 0x10 */ u32 x10;
41 /* 0x14 */ s32 x14;
42 /* 0x18 */ s32 x18;
43 /* 0x1C */ s32 x1C;
44 /* 0x20 */ s32 x20;
45 /* 0x24 */ s32 x24;
46 /* 0x28 */ s32 x28;
47} THPComponent; // size = 0x2C
48
54typedef struct _THPFileInfo {
55 /* 0x000 */ u8* file;
56 /* 0x004 */ u32 currByte;
57 /* 0x008 */ u32 cnt;
58 /* 0x00C */ u8* dataStart;
59 /* 0x010 */ THPCoeff* mcuBuffer[16];
60 /* 0x050 */ u16 xSize;
61 /* 0x052 */ u16 ySize;
62 /* 0x054 */ u8 pad54[0x6C - 0x54];
63 /* 0x06C */ u8* scanStart;
64 /* 0x070 */ u16 xPixelSize;
65 /* 0x072 */ u16 yPixelSize;
66 /* 0x074 */ u16 x74;
67 /* 0x076 */ u16 decompressedY;
68 /* 0x078 */ u8 validHuffmanTabs;
69 /* 0x079 */ u8 validQuantTabs;
70 /* 0x07A */ u8 samplingHMax;
71 /* 0x07B */ u8 samplingVMax;
72 /* 0x07C */ u8 nComponents;
73 /* 0x07D */ u8 x7D;
74 /* 0x07E */ u8 pad7E[0x88 - 0x7E];
75 /* 0x088 */ THPHuffmanTab huffmanTabs[4];
76 /* 0x438 */ THPQuantTab quantTabs[3];
77 /* 0x738 */ u8 pad738[0x838 - 0x738];
78 /* 0x838 */ THPComponent components[3];
79 /* 0x8BC */ u8 x8BC[0x8CC - 0x8BC];
80 /* 0x8CC */ u16 MCUsPerRow;
81 /* 0x8CE */ u16 x8CE;
82 /* 0x8D0 */ u16 x8D0;
83 /* 0x8D2 */ u16 x8D2;
84 /* 0x8D4 */ u16 x8D4;
85 /* 0x8D6 */ u8 pad8D6[0x8E8 - 0x8D6];
86 /* 0x8E8 */ u16 x8E8;
87 /* 0x8EA */ u16 x8EA;
88 /* 0x8EC */ u16 x8EC;
89 /* 0x8EE */ u16 x8EE;
90 /* 0x8F0 */ u8* tileY;
91 /* 0x8F4 */ u8* tileU;
92 /* 0x8F8 */ u8* tileV;
93 /* 0x8FC */ u16 nMCU;
94 /* 0x8FE */ u16 currMCU;
95 /* 0x900 */ u8 RST;
96 /* 0x901 */ u8 pad901[0x904 - 0x901];
97 /* 0x904 */ u8* scratch;
98} THPFileInfo; // size = 0x908
99
106
116static void __THPPrepBitStream(THPFileInfo*);
123
124THPFileInfo* THPVideoDecode(void* header, void* status_out, THPFileInfo* work,
125 void* data, THPDec_8032FD40_Data* desc);
126s32 THPDec_803302EC(u8** data);
130void THPDec_80331340(THPFileInfo*, void*, void*, void*);
131void THPDec_803313D0(THPFileInfo*, void*, void*, void*, u32);
132void THPDec_803300E0(THPFileInfo* info);
133void THPInit(void);
134
135#ifdef __cplusplus
136}
137#endif
138
139#endif // THP_H
signed int s32
Definition types.h:12
unsigned int u32
Definition types.h:13
signed char s8
Definition types.h:4
signed short int s16
Definition types.h:6
float f32
Definition types.h:18
unsigned short int u16
Definition types.h:7
unsigned char u8
Definition types.h:5
Definition thp.h:30
u8 ACTableSelector
Definition thp.h:36
s32 x14
Definition thp.h:41
u32 x10
Definition thp.h:40
u8 DCTableSelector
Definition thp.h:35
s32 x20
Definition thp.h:44
u32 x0C
Definition thp.h:39
s32 x18
Definition thp.h:42
u8 componentID
Definition thp.h:31
s32 x1C
Definition thp.h:43
u32 x08
Definition thp.h:38
s32 x24
Definition thp.h:45
u8 samplingH
Definition thp.h:32
u8 samplingV
Definition thp.h:33
THPCoeff predDC
Definition thp.h:37
u8 quantizationTableSelector
Definition thp.h:34
s32 x28
Definition thp.h:46
Definition thp.h:100
u16 val1
Definition thp.h:102
u8 val2
Definition thp.h:104
s32 val0
Definition thp.h:101
u16 _pad
Definition thp.h:103
The decode work area, sized by THPDec_8032FD40 and filled in by THPVideoDecode: the bit stream being ...
Definition thp.h:54
u8 * dataStart
Definition thp.h:58
u8 samplingVMax
Definition thp.h:71
u16 x8D2
Definition thp.h:83
u16 nMCU
Definition thp.h:93
u16 xSize
Definition thp.h:60
u16 x8E8
Definition thp.h:86
u8 validHuffmanTabs
Definition thp.h:68
u8 * scanStart
Definition thp.h:63
u16 x74
Definition thp.h:66
u16 x8D0
Definition thp.h:82
THPHuffmanTab huffmanTabs[4]
Definition thp.h:75
u8 * tileY
Definition thp.h:90
THPQuantTab quantTabs[3]
Definition thp.h:76
u8 validQuantTabs
Definition thp.h:69
u16 ySize
Definition thp.h:61
u16 currMCU
Definition thp.h:94
u16 x8EC
Definition thp.h:88
u8 * scratch
Definition thp.h:97
u8 pad901[0x904 - 0x901]
Definition thp.h:96
u16 x8EA
Definition thp.h:87
u8 pad8D6[0x8E8 - 0x8D6]
Definition thp.h:85
u8 RST
Definition thp.h:95
THPCoeff * mcuBuffer[16]
Definition thp.h:59
u8 x7D
Definition thp.h:73
u16 xPixelSize
Definition thp.h:64
u8 * tileU
Definition thp.h:91
u16 yPixelSize
Definition thp.h:65
u16 x8CE
Definition thp.h:81
u8 nComponents
Definition thp.h:72
u8 * file
Definition thp.h:55
u32 currByte
Definition thp.h:56
u16 decompressedY
Definition thp.h:67
THPComponent components[3]
Definition thp.h:78
u32 cnt
Definition thp.h:57
u8 x8BC[0x8CC - 0x8BC]
Definition thp.h:79
u8 pad7E[0x88 - 0x7E]
Definition thp.h:74
u16 x8D4
Definition thp.h:84
u8 * tileV
Definition thp.h:92
u16 MCUsPerRow
Definition thp.h:80
u16 x8EE
Definition thp.h:89
u8 pad738[0x838 - 0x738]
Definition thp.h:77
u8 pad54[0x6C - 0x54]
Definition thp.h:62
u8 samplingHMax
Definition thp.h:70
Definition thp.h:14
u8 quick[32]
Definition thp.h:15
s32 valPtr[18]
Definition thp.h:19
u8 increment[32]
Definition thp.h:16
s8 * sizeTab
Definition thp.h:23
u16 numVij
Definition thp.h:26
u8 * bits
Definition thp.h:22
u16 padEA
Definition thp.h:27
u32 numCodes
Definition thp.h:25
s32 maxCode[18]
Definition thp.h:18
u8 * Vij
Definition thp.h:17
u8 padD5[0xD8 - 0xD5]
Definition thp.h:21
u32 * codeTab
Definition thp.h:24
u8 Vij1
Definition thp.h:20
static void __THPHuffDecodeDCTCompY(THPFileInfo *, THPCoeff *)
static u8 __THPHuffGenerateCodeTable(THPFileInfo *, u8 tab_index)
static void __THPDecompressiMCURow640x480(THPFileInfo *)
static void __THPDecompressiMCURowNxN(THPFileInfo *, u32)
s32 THPDec_8032FD40(THPDec_8032FD40_Data *arg0, u16 arg1)
Definition THPDec.c:229
void THPInit(void)
Definition THPDec.c:2528
static u8 __THPReadScaneHeader(THPFileInfo *)
f32 THPQuantTab[64]
Definition thp.h:12
u8 THPDec_80330158(THPFileInfo *info)
Definition THPDec.c:387
static u8 __THPReadQuantizationTable(THPFileInfo *)
s16 THPCoeff
Definition thp.h:11
static void __THPPrepBitStream(THPFileInfo *)
Definition THPDec.c:66
static u8 __THPRestartDefinition(THPFileInfo *)
u8 THPSample
Definition thp.h:10
THPFileInfo * THPVideoDecode(void *header, void *status_out, THPFileInfo *work, void *data, THPDec_8032FD40_Data *desc)
Reads the headers of one compressed THP video frame into work.
Definition THPDec.c:259
s32 THPDec_803302EC(u8 **data)
Definition THPDec.c:430
static int __THPHuffGenerateDecoderTables(THPFileInfo *, u8 tab_index)
static u8 __THPHuffGenerateSizeTable(THPFileInfo *, u8, int)
void THPDec_803313D0(THPFileInfo *, void *, void *, void *, u32)
Definition THPDec.c:813
static u8 __THPReadHuffmanTableSpecification(THPFileInfo *)
static void __THPHuffDecodeDCTCompU(THPFileInfo *, THPCoeff *)
void THPDec_803300E0(THPFileInfo *info)
Carves the sixteen THPFileInfo::mcuBuffer blocks, 128 bytes each, out of the work area's scratch spac...
Definition THPDec.c:374
s32 THPDec_8032F8D4(u8 *data, THPDec_8032FD40_Data *out)
Definition THPDec.c:124
static void __THPInverseDCTNoYPos(THPCoeff *, u32)
static u8 __THPReadFrameHeader(THPFileInfo *)
static void __THPHuffDecodeDCTCompV(THPFileInfo *, THPCoeff *)
void THPDec_80331340(THPFileInfo *, void *, void *, void *)
Definition THPDec.c:789