ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
libmpeg_internal.h
Go to the documentation of this file.
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright (c) 2006 Eugene Plotnikov <e-plotnikov@operamail.com>
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
9 */
10 
16 #ifndef __libmpeg_internal_H
17 # define __libmpeg_internal_H
18 
19 # include <libmpeg.h>
20 
21 # define _MPEG_PT_I 1
22 # define _MPEG_PT_P 2
23 # define _MPEG_PT_B 3
24 # define _MPEG_PT_D 4
25 
26 # define _MPEG_PS_TOP_FIELD 1
27 # define _MPEG_PS_BOTTOM_FIELD 2
28 # define _MPEG_PS_FRAME 3
29 
30 # define _MPEG_MBT_INTRA 1
31 # define _MPEG_MBT_PATTERN 2
32 # define _MPEG_MBT_MOTION_BACKWARD 4
33 # define _MPEG_MBT_MOTION_FORWARD 8
34 # define _MPEG_MBT_QUANT 16
35 
36 # define _MPEG_MC_FIELD 1
37 # define _MPEG_MC_FRAME 2
38 # define _MPEG_MC_16X8 2
39 # define _MPEG_MC_DMV 3
40 
41 # define _MPEG_MV_FIELD 0
42 # define _MPEG_MV_FRAME 1
43 
44 # define _MPEG_CODE_PIC_START 0x00000100
45 # define _MPEG_CODE_SLICE_MIN 0x00000101
46 # define _MPEG_CODE_SLICE_MAX 0x000001AF
47 # define _MPEG_CODE_USER_DATA 0x000001B2
48 # define _MPEG_CODE_SEQ_HDR 0x000001B3
49 # define _MPEG_CODE_EXTENSION 0x000001B5
50 # define _MPEG_CODE_SEQ_END 0x000001B7
51 # define _MPEG_CODE_GRP_START 0x000001B8
52 
53 # define _MPEG_XID_0 0
54 # define _MPEG_XID_SEQUENCE 1
55 # define _MPEG_XID_DISPLAY 2
56 # define _MPEG_XID_QMATRIX 3
57 # define _MPEG_XID_COPYRIGHT 4
58 # define _MPEG_XID_SCALABLE 5
59 # define _MPEG_XID_6 6
60 # define _MPEG_XID_PIC_DSP 7
61 # define _MPEG_XID_PIC_COD 8
62 # define _MPEG_XID_PIC_SSC 9
63 # define _MPEG_XID_PIC_TSC 10
64 
65 typedef struct _MPEGMBXY {
66 
67  unsigned char m_X;
68  unsigned char m_Y;
69 
70 } _MPEGMBXY;
71 
72 typedef struct _MPEGMacroBlock8 {
73 
74  unsigned char m_Y [ 16 ][ 16 ];
75  unsigned char m_Cb[ 8 ][ 8 ];
76  unsigned char m_Cr[ 8 ][ 8 ];
77 
79 
80 typedef struct _MPEGMotion {
81 
82  unsigned char* m_pSrc;
83  short* m_pDstY;
84  short* m_pDstCbCr;
85  int m_X;
86  int m_Y;
87  int m_H;
88  int m_fInt;
89  int m_Field;
90 
91  void ( *MC_Luma ) ( struct _MPEGMotion* );
92  void ( *MC_Chroma ) ( void );
93 
94 } _MPEGMotion;
95 
96 typedef struct _MPEGMotions {
97 
98  unsigned char* m_pMBDstY;
99  unsigned char* m_pMBDstCbCr;
100  unsigned char* m_pSrc;
101  unsigned char* m_pSPRBlk;
102  unsigned char* m_pSPRRes;
103  unsigned char* m_pSPRMC;
104  int m_Stride;
106  void ( *BlockOp ) ( struct _MPEGMotions* );
108 
109 } _MPEGMotions;
110 
111 typedef struct _MPEGContext {
112 
124  unsigned char* m_pCurFrameY;
125  unsigned char* m_pCurFrameCbCr;
126  int m_FRCode;
130  int m_fMPEG2;
131  int m_fRepFF;
132  int m_fTopFF;
136  int m_fError;
137  int m_fDCRst;
138  int m_QScale;
145  int m_FCode[ 2 ][ 2 ];
146  int m_CurMC;
149 
150 } _MPEGContext;
151 
152 void _MPEG_Initialize ( _MPEGContext*, int ( * ) ( void* ), void*, int* );
153 void _MPEG_Destroy ( void );
154 int _MPEG_CSCImage ( void*, void*, int );
155 void _MPEG_SetDefQM ( int );
156 void _MPEG_SetQM ( int );
157 int _MPEG_GetMBAI ( void );
158 int _MPEG_GetMBType ( void );
159 int _MPEG_GetMotionCode ( void );
160 int _MPEG_GetDMVector ( void );
161 unsigned int _MPEG_NextStartCode ( void );
162 void _MPEG_AlignBits ( void );
163 unsigned int _MPEG_GetBits ( unsigned int );
164 unsigned int _MPEG_ShowBits ( unsigned int );
165 void _MPEG_SetIDCP ( void );
166 void _MPEG_SetQSTIVFAS ( void );
167 void _MPEG_SetPCT ( unsigned int );
168 void _MPEG_BDEC ( int, int, int, int, void* );
169 int _MPEG_WaitBDEC ( void );
176 void _MPEG_put_chroma ( void );
177 void _MPEG_put_chroma_X ( void );
178 void _MPEG_put_chroma_Y ( void );
179 void _MPEG_put_chroma_XY ( void );
184 void _MPEG_avg_chroma ( void );
185 void _MPEG_avg_chroma_X ( void );
186 void _MPEG_avg_chroma_Y ( void );
187 void _MPEG_avg_chroma_XY ( void );
194 void _MPEG_Suspend ( void );
195 void _MPEG_Resume ( void );
196 #endif /* __libmpeg_internal_H */
void _MPEG_avg_luma_Y(_MPEGMotion *)
void _MPEG_dma_ref_image(_MPEGMacroBlock8 *, _MPEGMotion *, int, int)
void _MPEG_Destroy(void)
void _MPEG_avg_chroma_Y(void)
void _MPEG_put_luma_Y(_MPEGMotion *)
void _MPEG_Resume(void)
void _MPEG_put_block_il(_MPEGMotions *)
int _MPEG_GetMotionCode(void)
void _MPEG_avg_luma(_MPEGMotion *)
int _MPEG_WaitBDEC(void)
unsigned int _MPEG_ShowBits(unsigned int)
void _MPEG_put_block_fr(_MPEGMotions *)
void _MPEG_SetQSTIVFAS(void)
void _MPEG_put_chroma_Y(void)
void _MPEG_SetDefQM(int)
int _MPEG_GetDMVector(void)
void _MPEG_put_block_fl(_MPEGMotions *)
void _MPEG_put_luma(_MPEGMotion *)
void _MPEG_put_luma_X(_MPEGMotion *)
void _MPEG_SetIDCP(void)
void _MPEG_put_luma_XY(_MPEGMotion *)
unsigned int _MPEG_NextStartCode(void)
void _MPEG_avg_chroma_X(void)
void _MPEG_avg_luma_X(_MPEGMotion *)
int _MPEG_CSCImage(void *, void *, int)
void _MPEG_avg_chroma_XY(void)
void _MPEG_Initialize(_MPEGContext *, int(*)(void *), void *, int *)
int _MPEG_GetMBAI(void)
void _MPEG_put_chroma_XY(void)
int _MPEG_GetMBType(void)
void _MPEG_add_block_frfr(_MPEGMotions *)
void _MPEG_SetPCT(unsigned int)
void _MPEG_add_block_ilfl(_MPEGMotions *)
void _MPEG_SetQM(int)
void _MPEG_put_chroma_X(void)
void _MPEG_AlignBits(void)
void _MPEG_BDEC(int, int, int, int, void *)
void _MPEG_avg_chroma(void)
void _MPEG_add_block_frfl(_MPEGMotions *)
unsigned int _MPEG_GetBits(unsigned int)
void _MPEG_avg_luma_XY(_MPEGMotion *)
void _MPEG_do_mc(_MPEGMotion *)
void _MPEG_Suspend(void)
void _MPEG_put_chroma(void)
_MPEGMacroBlock8 * m_pAuxFrame
_MPEGMacroBlock8 * m_pCurFrame
_MPEGMBXY * m_pMBXY
int m_FCode[2][2]
_MPEGMotions * m_pCurMotions
MPEGSequenceInfo m_SI
_MPEGMacroBlock8 * m_pBckFrame
_MPEGMacroBlock8 * m_pFwdFrame
_MPEGMotions m_MC[2]
unsigned char * m_pCurFrameY
unsigned char * m_pCurFrameCbCr
unsigned char m_Y
unsigned char m_X
unsigned char m_Y[16][16]
unsigned char m_Cb[8][8]
unsigned char m_Cr[8][8]
unsigned char * m_pSrc
short * m_pDstCbCr
void(* MC_Chroma)(void)
void(* MC_Luma)(struct _MPEGMotion *)
unsigned char * m_pSPRBlk
unsigned char * m_pSPRRes
unsigned char * m_pMBDstY
unsigned char * m_pSrc
unsigned char * m_pMBDstCbCr
_MPEGMotion m_Motion[7]
unsigned char * m_pSPRMC
void(* BlockOp)(struct _MPEGMotions *)
signed long s64
Definition: tamtypes.h:62