libavutil/lzo.c File Reference

#include "avutil.h"
#include "common.h"
#include <string.h>
#include "lzo.h"

Go to the source code of this file.

Data Structures

struct  LZOContext

Defines

#define OUTBUF_PADDED   1
 Avoid e.g. MPlayers fast_memcpy, it slows things down here.
#define INBUF_PADDED   1
 Define if we may read up to 8 bytes beyond the input buffer.
#define GETB(c)   (*(c).in++)
#define BUILTIN_MEMCPY
#define COPY2(d, s)   memcpy(d, s, 2);
#define COPY4(d, s)   memcpy(d, s, 4);

Functions

static int get_byte (LZOContext *c)
 Reads one byte from the input buffer, avoiding an overrun.
static int get_len (LZOContext *c, int x, int mask)
 Decodes a length value in the coding used by lzo.
static void copy (LZOContext *c, int cnt)
 Copies bytes from input to output buffer with checking.
static void memcpy_backptr (uint8_t *dst, int back, int cnt)
static void copy_backptr (LZOContext *c, int back, int cnt)
 Copies previously decoded bytes to current position.
void av_memcpy_backptr (uint8_t *dst, int back, int cnt)
 deliberately overlapping memcpy implementation
int av_lzo1x_decode (void *out, int *outlen, const void *in, int *inlen)
 Decodes LZO 1x compressed data.
int lzo1x_decode (void *out, int *outlen, const void *in, int *inlen)


Define Documentation

#define BUILTIN_MEMCPY

Definition at line 72 of file lzo.c.

#define COPY2 ( d,
 )     memcpy(d, s, 2);

Definition at line 77 of file lzo.c.

Referenced by memcpy_backptr().

#define COPY4 ( d,
 )     memcpy(d, s, 4);

Definition at line 78 of file lzo.c.

Referenced by copy().

#define GETB (  )     (*(c).in++)

Definition at line 51 of file lzo.c.

Referenced by av_lzo1x_decode().

#define INBUF_PADDED   1

Define if we may read up to 8 bytes beyond the input buffer.

Definition at line 32 of file lzo.c.

#define OUTBUF_PADDED   1

Avoid e.g. MPlayers fast_memcpy, it slows things down here.

Define if we may write up to 12 bytes beyond the output buffer.

Definition at line 30 of file lzo.c.


Function Documentation

int av_lzo1x_decode ( void *  out,
int *  outlen,
const void *  in,
int *  inlen 
)

Decodes LZO 1x compressed data.

Parameters:
out output buffer
outlen size of output buffer, number of bytes left are returned here
in input buffer
inlen size of input buffer, number of bytes left are returned here
Returns:
0 on success, otherwise a combination of the error flags above
Make sure all buffers are appropriately padded, in must provide AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes.

Definition at line 174 of file lzo.c.

Referenced by decode_frame(), lzo1x_decode(), and matroska_decode_buffer().

void av_memcpy_backptr ( uint8_t *  dst,
int  back,
int  cnt 
)

deliberately overlapping memcpy implementation

Parameters:
dst destination buffer; must be padded with 12 additional bytes
back how many bytes back we start (the initial size of the overlapping window)
cnt number of bytes to copy, must be >= 0
cnt > back is valid, this will copy the bytes we just copied, thus creating a repeating pattern with a period length of back.

Definition at line 170 of file lzo.c.

Referenced by unpack().

static void copy ( LZOContext c,
int  cnt 
) [inline, static]

Copies bytes from input to output buffer with checking.

Parameters:
cnt number of bytes to copy, must be >= 0

Definition at line 88 of file lzo.c.

Referenced by av_lzo1x_decode(), qpeg_decode_intra(), and roq_decode_frame().

static void copy_backptr ( LZOContext c,
int  back,
int  cnt 
) [inline, static]

Copies previously decoded bytes to current position.

Parameters:
back how many bytes back we start
cnt number of bytes to copy, must be >= 0
cnt > back is valid, this will copy the bytes we just copied, thus creating a repeating pattern with a period length of back.

Definition at line 121 of file lzo.c.

Referenced by av_lzo1x_decode().

static int get_byte ( LZOContext c  )  [inline, static]

Reads one byte from the input buffer, avoiding an overrun.

Returns:
byte read

Definition at line 43 of file lzo.c.

static int get_len ( LZOContext c,
int  x,
int  mask 
) [inline, static]

Decodes a length value in the coding used by lzo.

Parameters:
x previous byte value
mask bits used from x
Returns:
decoded length value

Definition at line 62 of file lzo.c.

Referenced by av_lzo1x_decode().

int lzo1x_decode ( void *  out,
int *  outlen,
const void *  in,
int *  inlen 
)

Definition at line 238 of file lzo.c.

static void memcpy_backptr ( uint8_t *  dst,
int  back,
int  cnt 
) [inline, static]

Definition at line 136 of file lzo.c.

Referenced by av_memcpy_backptr(), and copy_backptr().


Generated on Fri Oct 26 02:35:46 2012 for FFmpeg by  doxygen 1.5.8