FFmpeg
Enumerations | Functions
snappy.c File Reference
#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

anonymous enum
Enumerator
SNAPPY_LITERAL 
SNAPPY_COPY_1 
SNAPPY_COPY_2 
SNAPPY_COPY_4 

Definition at line 25 of file snappy.c.

Function Documentation

◆ bytestream2_get_levarint()

static int64_t bytestream2_get_levarint ( GetByteContext gb)
static

Definition at line 32 of file snappy.c.

Referenced by decode_len().

◆ snappy_literal()

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

Definition at line 49 of file snappy.c.

Referenced by ff_snappy_uncompress().

◆ snappy_copy()

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

Definition at line 78 of file snappy.c.

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

◆ snappy_copy1()

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

Definition at line 94 of file snappy.c.

Referenced by ff_snappy_uncompress().

◆ snappy_copy2()

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

Definition at line 103 of file snappy.c.

Referenced by ff_snappy_uncompress().

◆ snappy_copy4()

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

Definition at line 112 of file snappy.c.

Referenced by ff_snappy_uncompress().

◆ decode_len()

static int64_t decode_len ( GetByteContext gb)
static

Definition at line 121 of file snappy.c.

Referenced by ff_snappy_peek_uncompressed_length(), and ff_snappy_uncompress().

◆ ff_snappy_peek_uncompressed_length()

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 131 of file snappy.c.

Referenced by hap_parse_frame_header().

◆ ff_snappy_uncompress()

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 141 of file snappy.c.

Referenced by decompress_chunks_thread().