fixed RTjpeg and removed one memcpy

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3811 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
alex 2001-12-27 23:05:01 +00:00
parent 287a2e4e5e
commit b2b11bb2df
1 changed files with 9 additions and 6 deletions

View File

@ -13,6 +13,8 @@
#include "config.h" #include "config.h"
#include "mp_msg.h" #include "mp_msg.h"
#include "fastmemcpy.h"
#include "libmpdemux/nuppelvideo.h" #include "libmpdemux/nuppelvideo.h"
#include "RTjpegN.h" #include "RTjpegN.h"
#include "minilzo.h" #include "minilzo.h"
@ -29,8 +31,8 @@ void decode_nuv( unsigned char *encoded, int encoded_size,
static unsigned char *previous_buffer = 0; static unsigned char *previous_buffer = 0;
static is_lzo_inited = 0; static is_lzo_inited = 0;
// printf("NUV packet: frametype: %c comptype: %c\n", // printf("frametype: %c, comtype: %c, encoded_size: %d, width: %d, height: %d\n",
// encodedh->frametype, encodedh->comptype); // encodedh->frametype, encodedh->comptype, encoded_size, width, height);
switch(encodedh->frametype) switch(encodedh->frametype)
{ {
@ -39,8 +41,9 @@ void decode_nuv( unsigned char *encoded, int encoded_size,
/* tables are in encoded */ /* tables are in encoded */
if (encodedh->comptype == 'R') if (encodedh->comptype == 'R')
{ {
RTjpeg_init_decompress ( encoded, width, height ); RTjpeg_init_decompress ( encoded+12, width, height );
printf("Found RTjpeg tables\n"); printf("Found RTjpeg tables (size: %d, width: %d, height: %d)\n",
encoded_size-12, width, height);
} }
break; break;
} }
@ -96,12 +99,12 @@ void decode_nuv( unsigned char *encoded, int encoded_size,
RTjpeg_decompressYUV420 ( ( __s8 * ) buffer, decoded ); RTjpeg_decompressYUV420 ( ( __s8 * ) buffer, decoded );
break; break;
case '3': /* raw YUV420 with LZO */ case '3': /* raw YUV420 with LZO */
r = lzo1x_decompress ( encoded + 12, encodedh->packetlength, buffer, &out_len, NULL ); r = lzo1x_decompress ( encoded + 12, encodedh->packetlength, decoded, &out_len, NULL );
if ( r != LZO_E_OK ) if ( r != LZO_E_OK )
{ {
printf ( "Error decompressing\n" ); printf ( "Error decompressing\n" );
} }
memcpy(decoded, buffer, width*height*3/2); // memcpy(decoded, buffer, width*height*3/2);
break; break;
case 'N': /* black frame */ case 'N': /* black frame */
memset ( decoded, 0, width * height ); memset ( decoded, 0, width * height );