FFmpeg
Data Structures | Macros | Functions | Variables
kmvc.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "avcodec.h"
#include "bytestream.h"
#include "decode.h"
#include "internal.h"
#include "libavutil/common.h"

Go to the source code of this file.

Data Structures

struct  KmvcContext
 
struct  BitBuf
 

Macros

#define KMVC_KEYFRAME   0x80
 
#define KMVC_PALETTE   0x40
 
#define KMVC_METHOD   0x0F
 
#define MAX_PALSIZE   256
 
#define BLK(data, x, y)   data[av_clip((x) + (y) * 320, 0, 320 * 200 -1)]
 
#define kmvc_init_getbits(bb, g)   bb.bits = 7; bb.bitbuf = bytestream2_get_byte(g);
 
#define kmvc_getbit(bb, g, res)
 

Functions

static int kmvc_decode_intra_8x8 (KmvcContext *ctx, int w, int h)
 
static int kmvc_decode_inter_8x8 (KmvcContext *ctx, int w, int h)
 
static int decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int decode_init (AVCodecContext *avctx)
 

Variables

const AVCodec ff_kmvc_decoder
 

Detailed Description

Karl Morton's Video Codec decoder

Definition in file kmvc.c.

Macro Definition Documentation

◆ KMVC_KEYFRAME

#define KMVC_KEYFRAME   0x80

Definition at line 36 of file kmvc.c.

◆ KMVC_PALETTE

#define KMVC_PALETTE   0x40

Definition at line 37 of file kmvc.c.

◆ KMVC_METHOD

#define KMVC_METHOD   0x0F

Definition at line 38 of file kmvc.c.

◆ MAX_PALSIZE

#define MAX_PALSIZE   256

Definition at line 39 of file kmvc.c.

◆ BLK

#define BLK (   data,
  x,
 
)    data[av_clip((x) + (y) * 320, 0, 320 * 200 -1)]

Definition at line 60 of file kmvc.c.

◆ kmvc_init_getbits

#define kmvc_init_getbits (   bb,
  g 
)    bb.bits = 7; bb.bitbuf = bytestream2_get_byte(g);

Definition at line 62 of file kmvc.c.

◆ kmvc_getbit

#define kmvc_getbit (   bb,
  g,
  res 
)
Value:
{\
res = 0; \
if (bb.bitbuf & (1 << bb.bits)) res = 1; \
bb.bits--; \
if(bb.bits == -1) { \
bb.bitbuf = bytestream2_get_byte(g); \
bb.bits = 7; \
} \
}

Definition at line 64 of file kmvc.c.

Function Documentation

◆ kmvc_decode_intra_8x8()

static int kmvc_decode_intra_8x8 ( KmvcContext ctx,
int  w,
int  h 
)
static

Definition at line 74 of file kmvc.c.

Referenced by decode_frame().

◆ kmvc_decode_inter_8x8()

static int kmvc_decode_inter_8x8 ( KmvcContext ctx,
int  w,
int  h 
)
static

Definition at line 163 of file kmvc.c.

Referenced by decode_frame().

◆ decode_frame()

static int decode_frame ( AVCodecContext avctx,
void *  data,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 263 of file kmvc.c.

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 361 of file kmvc.c.

Variable Documentation

◆ ff_kmvc_decoder

const AVCodec ff_kmvc_decoder
Initial value:
= {
.name = "kmvc",
.long_name = NULL_IF_CONFIG_SMALL("Karl Morton's video codec"),
.priv_data_size = sizeof(KmvcContext),
.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
}

Definition at line 407 of file kmvc.c.

FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:41
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
KmvcContext
Definition: kmvc.c:44
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
AV_CODEC_ID_KMVC
@ AV_CODEC_ID_KMVC
Definition: codec_id.h:134
g
const char * g
Definition: vf_curves.c:117
bits
uint8_t bits
Definition: vp3data.h:141
if
if(ret)
Definition: filter_design.txt:179
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
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
decode_frame
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: kmvc.c:263
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: kmvc.c:361