summaryrefslogtreecommitdiff
path: root/psxdev/vlc.c
diff options
context:
space:
mode:
Diffstat (limited to 'psxdev/vlc.c')
-rw-r--r--psxdev/vlc.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/psxdev/vlc.c b/psxdev/vlc.c
index 780dcf1..196fa96 100644
--- a/psxdev/vlc.c
+++ b/psxdev/vlc.c
@@ -1,7 +1,7 @@
-#include "bs.h"
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
+#include "bs.h"
#define SOFT
@@ -39,7 +39,7 @@
/* Table B-14, DCT coefficients table zero,
* codes 0100 ... 1xxx (used for all other coefficients)
*/
-static const u_long VLCtabnext[12*2] = {
+static const Uint32 VLCtabnext[12*2] = {
CODE(0,2,4), CODE(2,1,4), CODE2(1,1,3), CODE2(1,-1,3),
CODE0(63,512,2), CODE0(63,512,2), CODE0(63,512,2), CODE0(63,512,2), /*EOB*/
CODE2(0,1,2), CODE2(0,1,2), CODE2(0,-1,2), CODE2(0,-1,2)
@@ -48,7 +48,7 @@ static const u_long VLCtabnext[12*2] = {
/* Table B-14, DCT coefficients table zero,
* codes 000001xx ... 00111xxx
*/
-static const u_long VLCtab0[60*2] = {
+static const Uint32 VLCtab0[60*2] = {
CODE0(63,0,6), CODE0(63,0,6),CODE0(63,0,6), CODE0(63,0,6), /* ESCAPE */
CODE2(2,2,7), CODE2(2,-2,7), CODE2(9,1,7), CODE2(9,-1,7),
CODE2(0,4,7), CODE2(0,-4,7), CODE2(8,1,7), CODE2(8,-1,7),
@@ -69,7 +69,7 @@ static const u_long VLCtab0[60*2] = {
/* Table B-14, DCT coefficients table zero,
* codes 0000001000 ... 0000001111
*/
-static const u_long VLCtab1[8*2] = {
+static const Uint32 VLCtab1[8*2] = {
CODE(16,1,10), CODE(5,2,10), CODE(0,7,10), CODE(2,3,10),
CODE(1,4,10), CODE(15,1,10), CODE(14,1,10), CODE(4,2,10)
};
@@ -77,7 +77,7 @@ static const u_long VLCtab1[8*2] = {
/* Table B-14/15, DCT coefficients table zero / one,
* codes 000000010000 ... 000000011111
*/
-static const u_long VLCtab2[16*2] = {
+static const Uint32 VLCtab2[16*2] = {
CODE(0,11,12), CODE(8,2,12), CODE(4,3,12), CODE(0,10,12),
CODE(2,4,12), CODE(7,2,12), CODE(21,1,12), CODE(20,1,12),
CODE(0,9,12), CODE(19,1,12), CODE(18,1,12), CODE(1,5,12),
@@ -87,7 +87,7 @@ static const u_long VLCtab2[16*2] = {
/* Table B-14/15, DCT coefficients table zero / one,
* codes 0000000010000 ... 0000000011111
*/
-static const u_long VLCtab3[16*2] = {
+static const Uint32 VLCtab3[16*2] = {
CODE(10,2,13), CODE(9,2,13), CODE(5,3,13), CODE(3,4,13),
CODE(2,5,13), CODE(1,7,13), CODE(1,6,13), CODE(0,15,13),
CODE(0,14,13), CODE(0,13,13), CODE(0,12,13), CODE(26,1,13),
@@ -97,7 +97,7 @@ static const u_long VLCtab3[16*2] = {
/* Table B-14/15, DCT coefficients table zero / one,
* codes 00000000010000 ... 00000000011111
*/
-static const u_long VLCtab4[16*2] = {
+static const Uint32 VLCtab4[16*2] = {
CODE(0,31,14), CODE(0,30,14), CODE(0,29,14), CODE(0,28,14),
CODE(0,27,14), CODE(0,26,14), CODE(0,25,14), CODE(0,24,14),
CODE(0,23,14), CODE(0,22,14), CODE(0,21,14), CODE(0,20,14),
@@ -107,7 +107,7 @@ static const u_long VLCtab4[16*2] = {
/* Table B-14/15, DCT coefficients table zero / one,
* codes 000000000010000 ... 000000000011111
*/
-static const u_long VLCtab5[16*2] = {
+static const Uint32 VLCtab5[16*2] = {
CODE(0,40,15), CODE(0,39,15), CODE(0,38,15), CODE(0,37,15),
CODE(0,36,15), CODE(0,35,15), CODE(0,34,15), CODE(0,33,15),
CODE(0,32,15), CODE(1,14,15), CODE(1,13,15), CODE(1,12,15),
@@ -117,7 +117,7 @@ static const u_long VLCtab5[16*2] = {
/* Table B-14/15, DCT coefficients table zero / one,
* codes 0000000000010000 ... 0000000000011111
*/
-static const u_long VLCtab6[16*2] = {
+static const Uint32 VLCtab6[16*2] = {
CODE(1,18,16), CODE(1,17,16), CODE(1,16,16), CODE(1,15,16),
CODE(6,3,16), CODE(16,2,16), CODE(15,2,16), CODE(14,2,16),
CODE(13,2,16), CODE(12,2,16), CODE(11,2,16), CODE(31,1,16),
@@ -138,7 +138,7 @@ static const u_long VLCtab6[16*2] = {
8 1111110xxxxxxxx 11111110xxxxxxxx -255..-128,128..255
*/
-static const u_long DC_Ytab0[48] = {
+static const Uint32 DC_Ytab0[48] = {
CODE1(0,-1,3),CODE1(0,-1,3),CODE1(0,-1,3),CODE1(0,-1,3),
CODE1(0,-1,3),CODE1(0,-1,3),CODE1(0,-1,3),CODE1(0,-1,3),
CODE1(0,1,3),CODE1(0,1,3),CODE1(0,1,3),CODE1(0,1,3),
@@ -156,7 +156,7 @@ static const u_long DC_Ytab0[48] = {
};
-static const u_long DC_UVtab0[56] = {
+static const Uint32 DC_UVtab0[56] = {
CODE1(0,0,2),CODE1(0,0,2),CODE1(0,0,2),CODE1(0,0,2),
CODE1(0,0,2),CODE1(0,0,2),CODE1(0,0,2),CODE1(0,0,2),
CODE1(0,0,2),CODE1(0,0,2),CODE1(0,0,2),CODE1(0,0,2),
@@ -191,17 +191,17 @@ static const u_long DC_UVtab0[56] = {
#define Printf printf
-int DecDCTvlc(u_short *mdec_bs,u_short *mdec_rl)
+int DecDCTvlc(Uint16 *mdec_bs,Uint16 *mdec_rl)
{
-/* u_short *mdec_bs = mdecbs,*mdec_rl = mdecrl */
- u_short *rl_end;
- u_long bitbuf;
+/* Uint16 *mdec_bs = mdecbs,*mdec_rl = mdecrl */
+ Uint16 *rl_end;
+ Uint32 bitbuf;
int incnt; /* 16-Lbit x86=char risc = long */
int q_code;
int type,n;
int last_dc[3];
-/* BS_HDR u_short rlsize,magic,ver,q_scale */
+/* BS_HDR Uint16 rlsize,magic,ver,q_scale */
/* printf("%04x,%04x,",mdec_bs[0],mdec_bs[1]); */
*(long*)mdec_rl=*(long*)mdec_bs;
@@ -216,7 +216,7 @@ int DecDCTvlc(u_short *mdec_bs,u_short *mdec_rl)
n = 0;
last_dc[0]=last_dc[1]=last_dc[2] = 0;
while(mdec_rl<rl_end) {
- u_long code2;
+ Uint32 code2;
/* DC */
if (type==2) {
code2 = Show_Bits(10)|(10<<16); /* DC code */
@@ -265,7 +265,7 @@ int DecDCTvlc(u_short *mdec_bs,u_short *mdec_rl)
/* AC */
for(;;){
-/* u_long code; */
+/* Uint32 code; */
#define code code2
#define SBIT 17
*mdec_rl++=code2;
@@ -322,7 +322,7 @@ extern unsigned char zscan[DCTSIZE2];
typedef struct {
int iqtab[DCTSIZE2];
const unsigned char *iq_y;
- u_short *mdec_rl,*rl_end;
+ Uint16 *mdec_rl,*rl_end;
int mdec_mode;
} bs_context_t;
@@ -340,7 +340,7 @@ void iqtab_init(bs_context_t *ctxt)
extern void IDCT(BLOCK *blk,int k);
-u_short* rl2blk(bs_context_t *ctxt, BLOCK *blk,u_short *mdec_rl)
+Uint16* rl2blk(bs_context_t *ctxt, BLOCK *blk,Uint16 *mdec_rl)
{
int i,k,q_scale,rl;
memset(blk,0,6*DCTSIZE2*sizeof(BLOCK));
@@ -392,9 +392,9 @@ int ROUND(int r)
}
*/
-extern u_char bs_roundtbl[256*3];
+extern Uint8 bs_roundtbl[256*3];
-static void yuv2rgb15(BLOCK *blk,u_short *image)
+static void yuv2rgb15(BLOCK *blk,Uint16 *image)
{
int x,yy;
BLOCK *yblk = blk+DCTSIZE2*2;
@@ -430,7 +430,7 @@ static void yuv2rgb15(BLOCK *blk,u_short *image)
enum {B,G,R};
-static void yuv2rgb24(BLOCK *blk,u_char image[][3])
+static void yuv2rgb24(BLOCK *blk,Uint8 image[][3])
{
int x,yy;
BLOCK *yblk = blk+DCTSIZE2*2;
@@ -486,7 +486,7 @@ static void DecDCTReset(bs_context_t *ctxt, int mode)
iqtab_init(ctxt);
}
-static void DecDCTin(bs_context_t *ctxt, u_short *mdecrl,int mode)
+static void DecDCTin(bs_context_t *ctxt, Uint16 *mdecrl,int mode)
{
mdecrl+=2;
ctxt->mdec_rl = mdecrl;
@@ -494,7 +494,7 @@ static void DecDCTin(bs_context_t *ctxt, u_short *mdecrl,int mode)
ctxt->mdec_mode = mode;
}
-static void DecDCTout(bs_context_t *ctxt, u_short *image,int size)
+static void DecDCTout(bs_context_t *ctxt, Uint16 *image,int size)
{
BLOCK blk[DCTSIZE2*6];
int blocksize=16*16;
@@ -540,7 +540,7 @@ void bs_decode_rgb24 (
for(x=0;x<width;x+=w)
{
- u_short *dst,*src;
+ Uint16 *dst,*src;
DecDCTout(&ctxt,image,slice);
src = image;
dst = buf2+x+(0)*width;
@@ -589,7 +589,7 @@ void bs_decode_rgb15 (
for(x=0;x<width;x+=w)
{
- u_short *dst,*src;
+ Uint16 *dst,*src;
DecDCTout(&ctxt,image,slice);
src = image;
dst = buf2+x+(height-1)*width;