summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-31 23:20:03 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-31 23:20:03 +0000
commit17cb5504b14805bf5821556206a7a810206850e9 (patch)
treed4b561dc6f46a0330635391e4df647b3aab73528 /libmpcodecs
parent77efea9cf2859f8609ec3a9b63b1ae841d19893f (diff)
downloadmpv-17cb5504b14805bf5821556206a7a810206850e9.tar.bz2
mpv-17cb5504b14805bf5821556206a7a810206850e9.tar.xz
Use ffmpeg lzo instead of (also quite outdated) minlzo in nuppelvideo.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22098 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/native/nuppelvideo.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/libmpcodecs/native/nuppelvideo.c b/libmpcodecs/native/nuppelvideo.c
index 207d835593..c7d88eca66 100644
--- a/libmpcodecs/native/nuppelvideo.c
+++ b/libmpcodecs/native/nuppelvideo.c
@@ -20,7 +20,11 @@
#include "libmpdemux/nuppelvideo.h"
#include "RTjpegN.h"
-#include "minilzo.h"
+#ifdef USE_LIBAVUTIL_SO
+#include <ffmpeg/lzo.h>
+#else
+#include "libavutil/lzo.h"
+#endif
#define KEEP_BUFFER
@@ -34,7 +38,6 @@ void decode_nuv( unsigned char *encoded, int encoded_size,
#ifdef KEEP_BUFFER
static unsigned char *previous_buffer = 0; /* to support Last-frame-copy */
#endif
- static int is_lzo_inited = 0;
// printf("frametype: %c, comtype: %c, encoded_size: %d, width: %d, height: %d\n",
// encodedh->frametype, encodedh->comptype, encoded_size, width, height);
@@ -55,23 +58,12 @@ void decode_nuv( unsigned char *encoded, int encoded_size,
}
case 'V':
{
+ int in_len = encodedh->packetlength;
#ifdef KEEP_BUFFER
if (!previous_buffer)
- previous_buffer = ( unsigned char * ) malloc ( out_len );
+ previous_buffer = ( unsigned char * ) malloc ( out_len + LZO_OUTPUT_PADDING );
#endif
- if (((encodedh->comptype == '2') ||
- (encodedh->comptype == '3')) && !is_lzo_inited)
- {
- /* frame using lzo, init lzo first if not inited */
- if ( lzo_init() != LZO_E_OK )
- {
- mp_msg(MSGT_DECVIDEO, MSGL_ERR, "LZO init failed\n");
- return;
- }
- is_lzo_inited = 1;
- }
-
switch(encodedh->comptype)
{
case '0': /* raw YUV420 */
@@ -82,14 +74,14 @@ void decode_nuv( unsigned char *encoded, int encoded_size,
break;
case '2': /* RTJpeg with LZO */
if (!buffer)
- buffer = ( unsigned char * ) malloc ( out_len );
+ buffer = ( unsigned char * ) malloc ( out_len + LZO_OUTPUT_PADDING );
if (!buffer)
{
mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Nuppelvideo: error decompressing\n");
break;
}
- r = lzo1x_decompress_safe ( encoded + 12, encodedh->packetlength, buffer, &out_len, NULL );
- if ( r != LZO_E_OK )
+ r = lzo1x_decode ( buffer, &out_len, encoded + 12, &in_len );
+ if ( r )
{
mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Nuppelvideo: error decompressing\n");
break;
@@ -97,8 +89,8 @@ void decode_nuv( unsigned char *encoded, int encoded_size,
RTjpeg_decompressYUV420 ( ( __s8 * ) buffer, decoded );
break;
case '3': /* raw YUV420 with LZO */
- r = lzo1x_decompress_safe ( encoded + 12, encodedh->packetlength, decoded, &out_len, NULL );
- if ( r != LZO_E_OK )
+ r = lzo1x_decode ( decoded, &out_len, encoded + 12, &in_len );
+ if ( r )
{
mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Nuppelvideo: error decompressing\n");
break;