SSBM Decomp
Loading...
Searching...
No Matches
THPDec.c File Reference
#include <dolphin.h>
#include <dolphin/thp/thp.h>

Data Structures

struct  THPAlignedHuffmanTabPtr
struct  THPAlignedSamplePtr
struct  THPAlignedWidth
struct  THPQuantizationPtr
struct  THPLCWork
struct  THPVideoDecodeHeader
struct  THPLCSizeEntry
struct  THPInitWork
 THPInit initializes the adjacent LC work objects as one layout. More...

Macros

#define THP_SDATA
#define THPROUNDUP(a, b)
#define OS_GQR_F32   0x0000
#define OS_GQR_U8   0x0004
#define OS_GQR_U16   0x0005
#define OS_GQR_S8   0x0006
#define OS_GQR_S16   0x0007
#define OS_FASTCAST_U8   2
#define OS_FASTCAST_U16   3
#define OS_FASTCAST_S8   4
#define OS_FASTCAST_S16   5

Functions

static THP_SDATA struct THPAlignedHuffmanTabPtr Ydchuff ATTRIBUTE_ALIGN (32)
void __THPPrepBitStream (THPFileInfo *info)
s32 THPDec_8032F8D4 (u8 *data, THPDec_8032FD40_Data *out)
s32 THPDec_8032FD40 (THPDec_8032FD40_Data *data, u16 num)
THPFileInfo * THPVideoDecode (void *hdr, void *status_out, THPFileInfo *work, void *data, THPDec_8032FD40_Data *desc)
 Reads the headers of one compressed THP video frame into work.
void THPDec_803300E0 (THPFileInfo *info)
 Carves the sixteen THPFileInfo::mcuBuffer blocks, 128 bytes each, out of the work area's scratch space, starting at the next 32-byte boundary.
u8 THPDec_80330158 (THPFileInfo *info)
s32 THPDec_803302EC (u8 **data)
u8 THPDec_803310CC (THPFileInfo *info)
static u8 __THPReadFrameHeader (THPFileInfo *info)
static u8 __THPReadQuantizationTable (THPFileInfo *info)
static u8 __THPReadHuffmanTableSpecification (THPFileInfo *info)
static u8 __THPReadScaneHeader (THPFileInfo *info)
static u8 __THPHuffGenerateSizeTable (THPFileInfo *info, u8 tab_index, int huffmanBits)
static u8 __THPHuffGenerateCodeTable (THPFileInfo *info, u8 tab_index)
static int __THPHuffGenerateDecoderTables (THPFileInfo *info, u8 tabIndex)
static u8 __THPRestartDefinition (THPFileInfo *info)
void THPDec_80331340 (THPFileInfo *info, void *tileY, void *tileU, void *tileV)
void THPDec_803313D0 (THPFileInfo *info, void *tileY, void *tileU, void *tileV, u32 x)
void __THPInverseDCTNoYPos (register THPCoeff *in, register u32 xPos)
void __THPInverseDCTY8 (register THPCoeff *in, register u32 xPos)
s32 __THPHuffDecodeTab (register THPFileInfo *info, register THPHuffmanTab *h)
static void __THPDecompressiMCURow640x480 (THPFileInfo *info)
static void __THPDecompressiMCURowNxN (THPFileInfo *info, u32 x)
static void __THPHuffDecodeDCTCompY (register THPFileInfo *info, THPCoeff *block)
static void __THPHuffDecodeDCTCompU (register THPFileInfo *info, THPCoeff *block)
static void __THPHuffDecodeDCTCompV (register THPFileInfo *info, THPCoeff *block)
static void OSInitFastCast (void)
void THPInit (void)

Variables

static char __THP420Error [] = "ERROR: THP only supports 4:2:0!!!\n"
static const u8 __THPJpegNaturalOrder [80]
static const f64 __THPAANScaleFactor [8]
static struct THPLCWork __THPLC
u8 * __THPLCWork672 [3]
static struct THPLCSizeEntry __THPLCSizeTableA [5]
static struct THPLCSizeEntry __THPLCSizeTableB [9]

Macro Definition Documentation

◆ THP_SDATA

#define THP_SDATA

◆ THPROUNDUP

#define THPROUNDUP ( a,
b )
Value:
((((s32) (a)) + ((s32) (b) - 1L)) / ((s32) (b)))
signed int s32
Definition types.h:12

◆ OS_GQR_F32

#define OS_GQR_F32   0x0000

◆ OS_GQR_U8

#define OS_GQR_U8   0x0004

◆ OS_GQR_U16

#define OS_GQR_U16   0x0005

◆ OS_GQR_S8

#define OS_GQR_S8   0x0006

◆ OS_GQR_S16

#define OS_GQR_S16   0x0007

◆ OS_FASTCAST_U8

#define OS_FASTCAST_U8   2

◆ OS_FASTCAST_U16

#define OS_FASTCAST_U16   3

◆ OS_FASTCAST_S8

#define OS_FASTCAST_S8   4

◆ OS_FASTCAST_S16

#define OS_FASTCAST_S16   5

Function Documentation

◆ ATTRIBUTE_ALIGN()

THP_SDATA struct THPAlignedHuffmanTabPtr Ydchuff ATTRIBUTE_ALIGN ( 32 )
static

◆ __THPPrepBitStream()

void __THPPrepBitStream ( THPFileInfo * info)

◆ THPDec_8032F8D4()

s32 THPDec_8032F8D4 ( u8 * data,
THPDec_8032FD40_Data * out )

◆ THPDec_8032FD40()

s32 THPDec_8032FD40 ( THPDec_8032FD40_Data * data,
u16 num )

◆ THPVideoDecode()

THPFileInfo * THPVideoDecode ( void * hdr,
void * status_out,
THPFileInfo * work,
void * data,
THPDec_8032FD40_Data * desc )

Reads the headers of one compressed THP video frame into work.

Parameters
headerFrame dimensions.
status_outReceives the status code: 0 on success, an error code otherwise.
workThe decode work area, sized by THPDec_8032FD40.
dataThe compressed frame data.
descThe image descriptor built by THPDec_8032F8D4.
Returns
work, ready for THPDec_80331340 / THPDec_803313D0, or NULL if the frame could not be read.

◆ THPDec_803300E0()

void THPDec_803300E0 ( THPFileInfo * info)

Carves the sixteen THPFileInfo::mcuBuffer blocks, 128 bytes each, out of the work area's scratch space, starting at the next 32-byte boundary.

◆ THPDec_80330158()

u8 THPDec_80330158 ( THPFileInfo * info)

◆ THPDec_803302EC()

s32 THPDec_803302EC ( u8 ** data)

◆ THPDec_803310CC()

u8 THPDec_803310CC ( THPFileInfo * info)

◆ __THPReadFrameHeader()

u8 __THPReadFrameHeader ( THPFileInfo * info)
static

◆ __THPReadQuantizationTable()

u8 __THPReadQuantizationTable ( THPFileInfo * info)
static

◆ __THPReadHuffmanTableSpecification()

u8 __THPReadHuffmanTableSpecification ( THPFileInfo * info)
static

◆ __THPReadScaneHeader()

u8 __THPReadScaneHeader ( THPFileInfo * info)
static

◆ __THPHuffGenerateSizeTable()

u8 __THPHuffGenerateSizeTable ( THPFileInfo * info,
u8 tab_index,
int huffmanBits )
static

◆ __THPHuffGenerateCodeTable()

u8 __THPHuffGenerateCodeTable ( THPFileInfo * info,
u8 tab_index )
static

◆ __THPHuffGenerateDecoderTables()

int __THPHuffGenerateDecoderTables ( THPFileInfo * info,
u8 tabIndex )
static

◆ __THPRestartDefinition()

u8 __THPRestartDefinition ( THPFileInfo * info)
static

◆ THPDec_80331340()

void THPDec_80331340 ( THPFileInfo * info,
void * tileY,
void * tileU,
void * tileV )

◆ THPDec_803313D0()

void THPDec_803313D0 ( THPFileInfo * info,
void * tileY,
void * tileU,
void * tileV,
u32 x )

◆ __THPInverseDCTNoYPos()

void __THPInverseDCTNoYPos ( register THPCoeff * in,
register u32 xPos )
inline

◆ __THPInverseDCTY8()

void __THPInverseDCTY8 ( register THPCoeff * in,
register u32 xPos )
inline

◆ __THPHuffDecodeTab()

s32 __THPHuffDecodeTab ( register THPFileInfo * info,
register THPHuffmanTab * h )
inline

◆ __THPDecompressiMCURow640x480()

void __THPDecompressiMCURow640x480 ( THPFileInfo * info)
static

◆ __THPDecompressiMCURowNxN()

void __THPDecompressiMCURowNxN ( THPFileInfo * info,
u32 x )
static

◆ __THPHuffDecodeDCTCompY()

void __THPHuffDecodeDCTCompY ( register THPFileInfo * info,
THPCoeff * block )
static

◆ __THPHuffDecodeDCTCompU()

void __THPHuffDecodeDCTCompU ( register THPFileInfo * info,
THPCoeff * block )
static

◆ __THPHuffDecodeDCTCompV()

void __THPHuffDecodeDCTCompV ( register THPFileInfo * info,
THPCoeff * block )
static

◆ OSInitFastCast()

void OSInitFastCast ( void )
inlinestatic

◆ THPInit()

void THPInit ( void )

Variable Documentation

◆ __THP420Error

char __THP420Error[] = "ERROR: THP only supports 4:2:0!!!\n"
static

◆ __THPJpegNaturalOrder

const u8 __THPJpegNaturalOrder[80]
static
Initial value:
= {
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,
63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63
}

◆ __THPAANScaleFactor

const f64 __THPAANScaleFactor[8]
static
Initial value:
= {
1.0f, 1.387039845f, 1.306562965f, 1.175875602f,
1.0f, 0.785694958f, 0.541196100f, 0.275899379f,
}

◆ __THPLC

struct THPLCWork __THPLC
static

◆ __THPLCWork672

u8 * __THPLCWork672

◆ __THPLCSizeTableA

struct THPLCSizeEntry __THPLCSizeTableA[5]
static
Initial value:
= {
{ 0, 0x1000 }, { 1, 0x400 }, { 2, 0x400 }, { 3, 0x400 }, { 4, 0x400 },
}

◆ __THPLCSizeTableB

struct THPLCSizeEntry __THPLCSizeTableB[9]
static
Initial value:
= {
{ 0, 0x1000 }, { 1, 0x200 }, { 2, 0x200 }, { 3, 0x200 }, { 4, 0x200 },
{ 5, 0x200 }, { 6, 0x200 }, { 7, 0x200 }, { 8, 0x200 },
}