From 5ddab7e162f7477089d495eb9a76ff13f4b2b0a4 Mon Sep 17 00:00:00 2001 From: pixel Date: Sun, 12 Dec 2004 02:14:37 +0000 Subject: Fixing STR decoding/encoding (yeah!) --- psxdev/bs.c | 5 +++-- psxdev/vlc.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'psxdev') diff --git a/psxdev/bs.c b/psxdev/bs.c index a79a877..41c2a8c 100644 --- a/psxdev/bs.c +++ b/psxdev/bs.c @@ -152,6 +152,7 @@ static void encode_init (bs_context_t *ctxt, void *outbuf, int type, int q_scale static void encode_finish (bs_context_t *ctxt) { + putbits(ctxt, 32704, 16); putbits_flush(ctxt); ctxt->bsbuf[0] = (((ctxt->rlsize+1)/2)+31)&~31; } @@ -277,7 +278,7 @@ void bs_init (void) } int bs_encode (bs_header_t *outbuf,bs_input_image_t *img,int type,int q_scale, - const unsigned char *myiqtab) + const unsigned char *myiqtab) { unsigned char image[16][16][3]; BLOCK blk[6][DCTSIZE2]; @@ -340,7 +341,7 @@ int bs_encode (bs_header_t *outbuf,bs_input_image_t *img,int type,int q_scale, } } - encode_finish(ctxt); + encode_finish(ctxt); rl = (ctxt->bs_size * 2); free (ctxt); diff --git a/psxdev/vlc.c b/psxdev/vlc.c index 4ff3d06..34288c2 100644 --- a/psxdev/vlc.c +++ b/psxdev/vlc.c @@ -428,7 +428,7 @@ static void yuv2rgb15(BLOCK *blk,Uint16 *image) } } -enum {R, G, B}; +enum {B, G, R}; static void yuv2rgb24(BLOCK *blk,Uint8 image[][3]) { -- cgit v1.2.3