FFmpeg
Enumerations | Functions
snappy.c File Reference
#include "libavutil/mem.h"
#include "bytestream.h"
#include "snappy.h"

Go to the source code of this file.

Enumerations

enum  { SNAPPY_LITERAL, SNAPPY_COPY_1, SNAPPY_COPY_2, SNAPPY_COPY_4 }
 

Functions

static int64_t bytestream2_get_levarint (GetByteContext *gb)
 
static int snappy_literal (GetByteContext *gb, uint8_t *p, int size, int val)
 
static int snappy_copy (uint8_t *start, uint8_t *p, int size, unsigned int off, int len)
 
static int snappy_copy1 (GetByteContext *gb, uint8_t *start, uint8_t *p, int size, int val)
 
static int snappy_copy2 (GetByteContext *gb, uint8_t *start, uint8_t *p, int size, int val)
 
static int snappy_copy4 (GetByteContext *gb, uint8_t *start, uint8_t *p, int size, int val)
 
static int64_t decode_len (GetByteContext *gb)
 
int64_t ff_snappy_peek_uncompressed_length (GetByteContext *gb)
 Get the uncompressed length of an input buffer compressed using the Snappy algorithm. More...
 
int ff_snappy_uncompress (GetByteContext *gb, uint8_t *buf, int64_t *size)
 Decompress an input buffer using Snappy algorithm. More...
 

Enumeration Type Documentation

anonymous enum
Enumerator
SNAPPY_LITERAL 
SNAPPY_COPY_1 
SNAPPY_COPY_2 
SNAPPY_COPY_4 

Definition at line 27 of file snappy.c.

Function Documentation

static int64_t bytestream2_get_levarint ( GetByteContext gb)
static

Definition at line 34 of file snappy.c.

Referenced by decode_len().

static int snappy_literal ( GetByteContext gb,
uint8_t p,
int  size,
int  val 
)
static

Definition at line 51 of file snappy.c.

Referenced by ff_snappy_uncompress().

static int snappy_copy ( uint8_t start,
uint8_t p,
int  size,
unsigned int  off,
int  len 
)
static

Definition at line 80 of file snappy.c.

Referenced by snappy_copy1(), snappy_copy2(), and snappy_copy4().

static int snappy_copy1 ( GetByteContext gb,
uint8_t start,
uint8_t p,
int  size,
int  val 
)
static

Definition at line 96 of file snappy.c.

Referenced by ff_snappy_uncompress().

static int snappy_copy2 ( GetByteContext gb,
uint8_t start,
uint8_t p,
int  size,
int  val 
)
static

Definition at line 105 of file snappy.c.

Referenced by ff_snappy_uncompress().

static int snappy_copy4 ( GetByteContext gb,
uint8_t start,
uint8_t p,
int  size,
int  val 
)
static

Definition at line 114 of file snappy.c.

Referenced by ff_snappy_uncompress().

static int64_t decode_len ( GetByteContext gb)
static

Definition at line 123 of file snappy.c.

Referenced by ff_snappy_peek_uncompressed_length(), and ff_snappy_uncompress().

int64_t ff_snappy_peek_uncompressed_length ( GetByteContext gb)

Get the uncompressed length of an input buffer compressed using the Snappy algorithm.

The GetByteContext is not advanced.

Parameters
gbinput GetByteContext.
Returns
A positive length on success, AVERROR otherwise.

Definition at line 133 of file snappy.c.

Referenced by hap_parse_frame_header().

int ff_snappy_uncompress ( GetByteContext gb,
uint8_t buf,
int64_t *  size 
)

Decompress an input buffer using Snappy algorithm.

Parameters
gbinput GetByteContext.
bufinput buffer pointer.
sizeinput/output on input, the size of buffer, on output, the size of the uncompressed data.
Returns
0 if success, AVERROR otherwise.

Definition at line 143 of file snappy.c.

Referenced by decompress_chunks_thread().