FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vqcdec.c File Reference
#include "avcodec.h"
#include "get_bits.h"
#include "codec_internal.h"
#include "decode.h"
#include "libavutil/thread.h"

Go to the source code of this file.

Data Structures

struct  VqcContext
 

Macros

#define VECTOR_VLC_BITS   6
 

Enumerations

enum  {
  SKIP_3 = 0x10, SKIP_4, SKIP_5, SKIP_6,
  STOP_RUN, SIGNED_8BIT, SIGNED_6BIT
}
 

Functions

static av_cold void vqc_init_static_data (void)
 
static av_cold int vqc_decode_init (AVCodecContext *avctx)
 
static int seed_pow1 (int x)
 
static int seed_pow2 (int x)
 
static int bias (int x, int c)
 
static void seed_codebooks (VqcContext *s, const int *seed)
 
static int decode_vectors (VqcContext *s, const uint8_t *buf, int size, int width, int height)
 
static void load_coeffs (VqcContext *s, const uint8_t *v, int width, int coeff_width)
 
static void transform1 (const int16_t *a, const int16_t *b, int16_t *dst, int width)
 
static uint8_t clip (int x)
 
static void transform2 (const int16_t *a, const int16_t *b, uint8_t *dst, int width)
 
static void decode_strip (VqcContext *s, uint8_t *dst, int stride, int width)
 
static void decode_frame (VqcContext *s, int width, int height)
 
static int vqc_decode_frame (AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
 
static av_cold int vqc_decode_end (AVCodecContext *avctx)
 

Variables

static const uint8_t vector_nbits []
 
static const int8_t vector_symbols []
 
static VLC vector_vlc
 
const FFCodec ff_vqc_decoder
 

Macro Definition Documentation

◆ VECTOR_VLC_BITS

#define VECTOR_VLC_BITS   6

Definition at line 28 of file vqcdec.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SKIP_3 
SKIP_4 
SKIP_5 
SKIP_6 
STOP_RUN 
SIGNED_8BIT 
SIGNED_6BIT 

Definition at line 35 of file vqcdec.c.

Function Documentation

◆ vqc_init_static_data()

static av_cold void vqc_init_static_data ( void  )
static

Definition at line 54 of file vqcdec.c.

Referenced by vqc_decode_init().

◆ vqc_decode_init()

static av_cold int vqc_decode_init ( AVCodecContext avctx)
static

Definition at line 69 of file vqcdec.c.

◆ seed_pow1()

static int seed_pow1 ( int  x)
static

Definition at line 103 of file vqcdec.c.

Referenced by vqc_decode_frame().

◆ seed_pow2()

static int seed_pow2 ( int  x)
static

Definition at line 108 of file vqcdec.c.

Referenced by vqc_decode_frame().

◆ bias()

static int bias ( int  x,
int  c 
)
static

◆ seed_codebooks()

static void seed_codebooks ( VqcContext s,
const int seed 
)
static

Definition at line 123 of file vqcdec.c.

Referenced by vqc_decode_frame().

◆ decode_vectors()

static int decode_vectors ( VqcContext s,
const uint8_t *  buf,
int  size,
int  width,
int  height 
)
static

Definition at line 143 of file vqcdec.c.

Referenced by vqc_decode_frame().

◆ load_coeffs()

static void load_coeffs ( VqcContext s,
const uint8_t *  v,
int  width,
int  coeff_width 
)
static

Definition at line 194 of file vqcdec.c.

Referenced by decode_frame().

◆ transform1()

static void transform1 ( const int16_t *  a,
const int16_t *  b,
int16_t *  dst,
int  width 
)
static

Definition at line 276 of file vqcdec.c.

Referenced by decode_strip().

◆ clip()

static uint8_t clip ( int  x)
static

Definition at line 290 of file vqcdec.c.

Referenced by transform2().

◆ transform2()

static void transform2 ( const int16_t *  a,
const int16_t *  b,
uint8_t *  dst,
int  width 
)
static

Definition at line 295 of file vqcdec.c.

Referenced by decode_strip().

◆ decode_strip()

static void decode_strip ( VqcContext s,
uint8_t *  dst,
int  stride,
int  width 
)
static

Definition at line 311 of file vqcdec.c.

Referenced by decode_frame().

◆ decode_frame()

static void decode_frame ( VqcContext s,
int  width,
int  height 
)
static

Definition at line 336 of file vqcdec.c.

Referenced by vqc_decode_frame().

◆ vqc_decode_frame()

static int vqc_decode_frame ( AVCodecContext avctx,
AVFrame rframe,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 366 of file vqcdec.c.

◆ vqc_decode_end()

static av_cold int vqc_decode_end ( AVCodecContext avctx)
static

Definition at line 415 of file vqcdec.c.

Variable Documentation

◆ vector_nbits

const uint8_t vector_nbits[]
static
Initial value:
= {
2, 4, 4, 4, 4, 2, 4, 4,
6, 6, 6, 6, 6, 6, 6, 6
}

Definition at line 30 of file vqcdec.c.

Referenced by vqc_init_static_data().

◆ vector_symbols

const int8_t vector_symbols[]
static
Initial value:
= {
2, 3, 4, SIGNED_8BIT, -2, -3, -4, SIGNED_6BIT
}

Definition at line 47 of file vqcdec.c.

Referenced by vqc_init_static_data().

◆ vector_vlc

VLC vector_vlc
static

Definition at line 52 of file vqcdec.c.

Referenced by decode_vectors(), and vqc_init_static_data().

◆ ff_vqc_decoder

const FFCodec ff_vqc_decoder
Initial value:
= {
.p.name = "vqc",
CODEC_LONG_NAME("ViewQuest VQC"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_VQC,
.priv_data_size = sizeof(VqcContext),
.close = vqc_decode_end,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 428 of file vqcdec.c.

FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:42
SKIP_4
@ SKIP_4
Definition: vqcdec.c:37
AV_CODEC_ID_VQC
@ AV_CODEC_ID_VQC
Definition: codec_id.h:322
vqc_decode_end
static av_cold int vqc_decode_end(AVCodecContext *avctx)
Definition: vqcdec.c:415
VqcContext
Definition: vqcdec.c:62
SKIP_3
@ SKIP_3
Definition: vqcdec.c:36
STOP_RUN
@ STOP_RUN
Definition: vqcdec.c:40
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:298
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:264
SIGNED_8BIT
@ SIGNED_8BIT
Definition: vqcdec.c:41
vqc_decode_init
static av_cold int vqc_decode_init(AVCodecContext *avctx)
Definition: vqcdec.c:69
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
SKIP_5
@ SKIP_5
Definition: vqcdec.c:38
SIGNED_6BIT
@ SIGNED_6BIT
Definition: vqcdec.c:42
vqc_decode_frame
static int vqc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
Definition: vqcdec.c:366
SKIP_6
@ SKIP_6
Definition: vqcdec.c:39
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201