FFmpeg
Loading...
Searching...
No Matches
fic.c File Reference
#include "libavutil/common.h"
#include "libavutil/mem.h"
#include "libavutil/mem_internal.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "golomb.h"

Go to the source code of this file.

Data Structures

struct  FICThreadContext
 
struct  FICContext
 

Macros

#define FIC_HEADER_SIZE   27
 
#define CURSOR_OFFSET   59
 
#define CURSOR_SIZE   4096
 

Functions

static av_always_inline void fic_idct (int16_t *blk, int step, int shift, int rnd)
 
static void fic_idct_put (uint8_t *dst, int stride, int16_t *block)
 
static int fic_decode_block (FICContext *ctx, GetBitContext *gb, uint8_t *dst, int stride, int16_t *block, int *is_p)
 
static int fic_decode_slice (AVCodecContext *avctx, void *tdata)
 
static av_always_inline void fic_alpha_blend (uint8_t *dst, uint8_t *src, int size, uint8_t *alpha)
 
static void fic_draw_cursor (AVCodecContext *avctx, const uint8_t cursor_buf[CURSOR_SIZE], int cur_x, int cur_y)
 
static int fic_decode_frame (AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
 
static av_cold int fic_decode_close (AVCodecContext *avctx)
 
static av_cold int fic_decode_init (AVCodecContext *avctx)
 

Variables

static const uint8_t fic_qmat_hq [64]
 
static const uint8_t fic_qmat_lq [64]
 
static const uint8_t fic_header [7] = { 0, 0, 1, 'F', 'I', 'C', 'V' }
 
static const AVOption options []
 
static const AVClass fic_decoder_class
 
const FFCodec ff_fic_decoder
 

Macro Definition Documentation

◆ FIC_HEADER_SIZE

#define FIC_HEADER_SIZE   27

Definition at line 86 of file fic.c.

Referenced by fic_decode_frame().

◆ CURSOR_OFFSET

#define CURSOR_OFFSET   59

Definition at line 87 of file fic.c.

Referenced by fic_decode_frame().

◆ CURSOR_SIZE

#define CURSOR_SIZE   4096

Definition at line 88 of file fic.c.

Referenced by fic_decode_frame(), and fic_draw_cursor().

Function Documentation

◆ fic_idct()

static av_always_inline void fic_idct ( int16_t * blk,
int step,
int shift,
int rnd )
static

Definition at line 90 of file fic.c.

Referenced by fic_idct_put().

◆ fic_idct_put()

static void fic_idct_put ( uint8_t * dst,
int stride,
int16_t * block )
static

Definition at line 114 of file fic.c.

Referenced by fic_decode_block().

◆ fic_decode_block()

static int fic_decode_block ( FICContext * ctx,
GetBitContext * gb,
uint8_t * dst,
int stride,
int16_t * block,
int * is_p )
static

Definition at line 140 of file fic.c.

Referenced by fic_decode_slice().

◆ fic_decode_slice()

static int fic_decode_slice ( AVCodecContext * avctx,
void * tdata )
static

Definition at line 173 of file fic.c.

Referenced by fic_decode_frame().

◆ fic_alpha_blend()

static av_always_inline void fic_alpha_blend ( uint8_t * dst,
uint8_t * src,
int size,
uint8_t * alpha )
static

Definition at line 208 of file fic.c.

Referenced by fic_draw_cursor().

◆ fic_draw_cursor()

static void fic_draw_cursor ( AVCodecContext * avctx,
const uint8_t cursor_buf[CURSOR_SIZE],
int cur_x,
int cur_y )
static

Definition at line 217 of file fic.c.

Referenced by fic_decode_frame().

◆ fic_decode_frame()

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

Definition at line 272 of file fic.c.

◆ fic_decode_close()

static av_cold int fic_decode_close ( AVCodecContext * avctx)
static

Definition at line 445 of file fic.c.

◆ fic_decode_init()

static av_cold int fic_decode_init ( AVCodecContext * avctx)
static

Definition at line 456 of file fic.c.

Variable Documentation

◆ fic_qmat_hq

const uint8_t fic_qmat_hq[64]
static
Initial value:
= {
1, 2, 2, 2, 3, 3, 3, 4,
2, 2, 2, 3, 3, 3, 4, 4,
2, 2, 3, 3, 3, 4, 4, 4,
2, 2, 3, 3, 3, 4, 4, 5,
2, 3, 3, 3, 4, 4, 5, 6,
3, 3, 3, 4, 4, 5, 6, 7,
3, 3, 3, 4, 4, 5, 7, 7,
3, 3, 4, 4, 5, 7, 7, 7,
}

Definition at line 62 of file fic.c.

Referenced by fic_decode_frame().

◆ fic_qmat_lq

const uint8_t fic_qmat_lq[64]
static
Initial value:
= {
1, 5, 6, 7, 8, 9, 9, 11,
5, 5, 7, 8, 9, 9, 11, 12,
6, 7, 8, 9, 9, 11, 11, 12,
7, 7, 8, 9, 9, 11, 12, 13,
7, 8, 9, 9, 10, 11, 13, 16,
8, 9, 9, 10, 11, 13, 16, 19,
8, 9, 9, 11, 12, 15, 18, 23,
9, 9, 11, 12, 15, 18, 23, 27
}

Definition at line 73 of file fic.c.

Referenced by fic_decode_frame().

◆ fic_header

const uint8_t fic_header[7] = { 0, 0, 1, 'F', 'I', 'C', 'V' }
static

Definition at line 84 of file fic.c.

Referenced by fic_decode_frame().

◆ options

const AVOption options[]
static
Initial value:
= {
{ "skip_cursor", "skip the cursor", 0x42 , AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM },
{ NULL },
}
#define NULL
Definition coverity.c:32
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
Definition opt.h:355
#define AV_OPT_FLAG_VIDEO_PARAM
Definition opt.h:357
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326

Definition at line 478 of file fic.c.

◆ fic_decoder_class

const AVClass fic_decoder_class
static
Initial value:
= {
.class_name = "FIC decoder",
.item_name = av_default_item_name,
.option = options,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85

Definition at line 483 of file fic.c.

◆ ff_fic_decoder

const FFCodec ff_fic_decoder
Initial value:
= {
.p.name = "fic",
CODEC_LONG_NAME("Mirillis FIC"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_FIC,
.priv_data_size = sizeof(FICContext),
.close = fic_decode_close,
.p.priv_class = &fic_decoder_class,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}
#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
static const AVClass fic_decoder_class
Definition fic.c:483
static int fic_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
Definition fic.c:272
static av_cold int fic_decode_close(AVCodecContext *avctx)
Definition fic.c:445
static av_cold int fic_decode_init(AVCodecContext *avctx)
Definition fic.c:456
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
Definition codec.h:102
@ AV_CODEC_ID_FIC
Definition codec_id.h:225
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200

Definition at line 490 of file fic.c.