FFmpeg
Loading...
Searching...
No Matches
vqcdec.c File Reference
#include "avcodec.h"
#include "get_bits.h"
#include "codec_internal.h"
#include "decode.h"
#include "libavutil/mem.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 VLCElem vector_vlc [1<< VECTOR_VLC_BITS]
 
const FFCodec ff_vqc_decoder
 

Macro Definition Documentation

◆ VECTOR_VLC_BITS

#define VECTOR_VLC_BITS   6

Definition at line 29 of file vqcdec.c.

Referenced by decode_vectors(), and vqc_init_static_data().

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 36 of file vqcdec.c.

Function Documentation

◆ vqc_init_static_data()

static av_cold void vqc_init_static_data ( void )
static

Definition at line 55 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 71 of file vqcdec.c.

◆ seed_pow1()

static int seed_pow1 ( int x)
static

Definition at line 105 of file vqcdec.c.

Referenced by vqc_decode_frame().

◆ seed_pow2()

static int seed_pow2 ( int x)
static

Definition at line 110 of file vqcdec.c.

Referenced by vqc_decode_frame().

◆ bias()

◆ seed_codebooks()

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

Definition at line 125 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 145 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 199 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 281 of file vqcdec.c.

Referenced by decode_strip().

◆ clip()

static uint8_t clip ( int x)
static

Definition at line 295 of file vqcdec.c.

◆ transform2()

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

Definition at line 300 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 316 of file vqcdec.c.

Referenced by decode_frame().

◆ decode_frame()

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

Definition at line 341 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 371 of file vqcdec.c.

◆ vqc_decode_end()

static av_cold int vqc_decode_end ( AVCodecContext * avctx)
static

Definition at line 420 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 31 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
}
@ SKIP_3
Definition vqcdec.c:37
@ SIGNED_8BIT
Definition vqcdec.c:42
@ SKIP_4
Definition vqcdec.c:38
@ STOP_RUN
Definition vqcdec.c:41
@ SKIP_5
Definition vqcdec.c:39
@ SKIP_6
Definition vqcdec.c:40
@ SIGNED_6BIT
Definition vqcdec.c:43

Definition at line 48 of file vqcdec.c.

Referenced by vqc_init_static_data().

◆ vector_vlc

VLCElem vector_vlc[1<< VECTOR_VLC_BITS]
static

Definition at line 53 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),
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
@ AV_CODEC_ID_VQC
Definition codec_id.h:314
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static int vqc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
Definition vqcdec.c:371
static av_cold int vqc_decode_init(AVCodecContext *avctx)
Definition vqcdec.c:71
static av_cold int vqc_decode_end(AVCodecContext *avctx)
Definition vqcdec.c:420

Definition at line 433 of file vqcdec.c.