FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
loco.c File Reference
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "golomb.h"
#include "mathops.h"

Go to the source code of this file.

Data Structures

struct  LOCOContext
 
struct  RICEContext
 

Macros

#define ADVANCE_BY_DECODED
 

Enumerations

enum  LOCO_MODE {
  LOCO_UNKN = 0, LOCO_CYUY2 = -1, LOCO_CRGB = -2, LOCO_CRGBA = -3,
  LOCO_CYV12 = -4, LOCO_YUY2 = 1, LOCO_UYVY = 2, LOCO_RGB = 3,
  LOCO_RGBA = 4, LOCO_YV12 = 5
}
 

Functions

static int loco_get_rice_param (RICEContext *r)
 
static void loco_update_rice_param (RICEContext *r, int val)
 
static int loco_get_rice (RICEContext *r)
 
static int loco_predict (uint8_t *data, int stride)
 
static int loco_decode_plane (LOCOContext *l, uint8_t *data, int width, int height, int stride, const uint8_t *buf, int buf_size)
 
static void rotate_faulty_loco (uint8_t *data, int width, int height, int stride)
 
static int decode_frame (AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
 
static av_cold int decode_init (AVCodecContext *avctx)
 

Variables

const FFCodec ff_loco_decoder
 

Detailed Description

LOCO codec.

Definition in file loco.c.

Macro Definition Documentation

◆ ADVANCE_BY_DECODED

#define ADVANCE_BY_DECODED
Value:
do { \
if (decoded < 0 || decoded >= buf_size) goto buf_too_small; \
buf += decoded; buf_size -= decoded; \
} while(0)

Enumeration Type Documentation

◆ LOCO_MODE

enum LOCO_MODE
Enumerator
LOCO_UNKN 
LOCO_CYUY2 
LOCO_CRGB 
LOCO_CRGBA 
LOCO_CYV12 
LOCO_YUY2 
LOCO_UYVY 
LOCO_RGB 
LOCO_RGBA 
LOCO_YV12 

Definition at line 34 of file loco.c.

Function Documentation

◆ loco_get_rice_param()

static int loco_get_rice_param ( RICEContext r)
static

Definition at line 60 of file loco.c.

Referenced by loco_get_rice().

◆ loco_update_rice_param()

static void loco_update_rice_param ( RICEContext r,
int  val 
)
inlinestatic

Definition at line 73 of file loco.c.

Referenced by loco_get_rice().

◆ loco_get_rice()

static int loco_get_rice ( RICEContext r)
inlinestatic

Definition at line 84 of file loco.c.

Referenced by loco_decode_plane().

◆ loco_predict()

static int loco_predict ( uint8_t *  data,
int  stride 
)
inlinestatic

Definition at line 120 of file loco.c.

Referenced by loco_decode_plane().

◆ loco_decode_plane()

static int loco_decode_plane ( LOCOContext l,
uint8_t *  data,
int  width,
int  height,
int  stride,
const uint8_t *  buf,
int  buf_size 
)
static

Definition at line 131 of file loco.c.

Referenced by decode_frame().

◆ rotate_faulty_loco()

static void rotate_faulty_loco ( uint8_t *  data,
int  width,
int  height,
int  stride 
)
static

Definition at line 183 of file loco.c.

Referenced by decode_frame().

◆ decode_frame()

static int decode_frame ( AVCodecContext avctx,
AVFrame p,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 199 of file loco.c.

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 281 of file loco.c.

Variable Documentation

◆ ff_loco_decoder

const FFCodec ff_loco_decoder
Initial value:
= {
.p.name = "loco",
CODEC_LONG_NAME("LOCO"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(LOCOContext),
.p.capabilities = AV_CODEC_CAP_DR1,
}

Definition at line 339 of file loco.c.

LOCOContext
Definition: loco.c:47
AV_CODEC_ID_LOCO
@ AV_CODEC_ID_LOCO
Definition: codec_id.h:124
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:306
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
decode_frame
static int decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
Definition: loco.c:199
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
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: loco.c:281