FFmpeg
Data Structures | Macros | Functions | Variables
mimic.c File Reference
#include <stdint.h>
#include "libavutil/mem_internal.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "blockdsp.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "bytestream.h"
#include "bswapdsp.h"
#include "hpeldsp.h"
#include "idctdsp.h"
#include "thread.h"
#include "threadframe.h"

Go to the source code of this file.

Data Structures

struct  MimicContext
 

Macros

#define MIMIC_HEADER_SIZE   20
 
#define MIMIC_VLC_BITS   11
 

Functions

static av_cold int mimic_decode_end (AVCodecContext *avctx)
 
static av_cold void mimic_init_static (void)
 
static av_cold int mimic_decode_init (AVCodecContext *avctx)
 
static int vlc_decode_block (MimicContext *ctx, int num_coeffs, int qscale)
 
static int decode (MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
 
static void flip_swap_frame (AVFrame *f)
 Flip the buffer upside-down and put it in the YVU order to revert the way Mimic encodes frames. More...
 
static int mimic_decode_frame (AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
 

Variables

static VLCElem block_vlc [4368]
 
static const uint8_t huffsyms []
 
static const uint8_t huffbits []
 
static const uint8_t col_zag [64]
 
static const int8_t vlcdec_lookup [9][64]
 
const FFCodec ff_mimic_decoder
 

Macro Definition Documentation

◆ MIMIC_HEADER_SIZE

#define MIMIC_HEADER_SIZE   20

Definition at line 39 of file mimic.c.

◆ MIMIC_VLC_BITS

#define MIMIC_VLC_BITS   11

Definition at line 40 of file mimic.c.

Function Documentation

◆ mimic_decode_end()

static av_cold int mimic_decode_end ( AVCodecContext avctx)
static

Definition at line 104 of file mimic.c.

◆ mimic_init_static()

static av_cold void mimic_init_static ( void  )
static

Definition at line 121 of file mimic.c.

Referenced by mimic_decode_init().

◆ mimic_decode_init()

static av_cold int mimic_decode_init ( AVCodecContext avctx)
static

Definition at line 128 of file mimic.c.

◆ vlc_decode_block()

static int vlc_decode_block ( MimicContext ctx,
int  num_coeffs,
int  qscale 
)
static

Definition at line 216 of file mimic.c.

Referenced by decode().

◆ decode()

static int decode ( MimicContext ctx,
int  quality,
int  num_coeffs,
int  is_iframe 
)
static

Definition at line 260 of file mimic.c.

Referenced by mimic_decode_frame().

◆ flip_swap_frame()

static void flip_swap_frame ( AVFrame f)
static

Flip the buffer upside-down and put it in the YVU order to revert the way Mimic encodes frames.

Definition at line 331 of file mimic.c.

Referenced by mimic_decode_frame().

◆ mimic_decode_frame()

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

Definition at line 342 of file mimic.c.

Variable Documentation

◆ block_vlc

VLCElem block_vlc[4368]
static

Definition at line 70 of file mimic.c.

Referenced by mimic_init_static(), and vlc_decode_block().

◆ huffsyms

const uint8_t huffsyms[]
static
Initial value:
= {
0x10, 0x20, 0x30, 0x00, 0x11, 0x40, 0x50, 0x12, 0x13, 0x21, 0x31, 0x60,
0x14, 0x15, 0x16, 0x22, 0x41, 0x17, 0x18, 0x23, 0x24, 0x25, 0x32, 0x42,
0x51, 0x61, 0x70, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x26, 0x27,
0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x52, 0x53, 0x54, 0x55, 0x56,
0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x62, 0x63, 0x64, 0x65,
0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x71, 0x72, 0x73,
0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E,
}

Definition at line 72 of file mimic.c.

Referenced by mimic_init_static().

◆ huffbits

const uint8_t huffbits[]
static
Initial value:
= {
2, 2, 3, 4, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8,
8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12,
13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17,
17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21,
22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26,
26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30,
}

Definition at line 84 of file mimic.c.

Referenced by mimic_init_static().

◆ col_zag

const uint8_t col_zag[64]
static
Initial value:
= {
0, 8, 1, 2, 9, 16, 24, 17,
10, 3, 4, 11, 18, 25, 32, 40,
33, 26, 19, 12, 5, 6, 13, 20,
27, 34, 41, 48, 56, 49, 42, 35,
28, 21, 14, 7, 15, 22, 29, 36,
43, 50, 57, 58, 51, 44, 37, 30,
23, 31, 38, 45, 52, 59, 39, 46,
53, 60, 61, 54, 47, 55, 62, 63,
}

Definition at line 93 of file mimic.c.

Referenced by mimic_decode_init().

◆ vlcdec_lookup

const int8_t vlcdec_lookup[9][64]
static

Definition at line 179 of file mimic.c.

Referenced by vlc_decode_block().

◆ ff_mimic_decoder

const FFCodec ff_mimic_decoder
Initial value:
= {
.p.name = "mimic",
CODEC_LONG_NAME("Mimic"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(MimicContext),
.close = mimic_decode_end,
UPDATE_THREAD_CONTEXT(mimic_decode_update_thread_context),
.caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS |
}

Definition at line 440 of file mimic.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
AV_CODEC_ID_MIMIC
@ AV_CODEC_ID_MIMIC
Definition: codec_id.h:165
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:110
UPDATE_THREAD_CONTEXT
#define UPDATE_THREAD_CONTEXT(func)
Definition: codec_internal.h:281
mimic_decode_end
static av_cold int mimic_decode_end(AVCodecContext *avctx)
Definition: mimic.c:104
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
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
FF_CODEC_CAP_ALLOCATE_PROGRESS
#define FF_CODEC_CAP_ALLOCATE_PROGRESS
Definition: codec_internal.h:69
mimic_decode_init
static av_cold int mimic_decode_init(AVCodecContext *avctx)
Definition: mimic.c:128
mimic_decode_frame
static int mimic_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
Definition: mimic.c:342
MimicContext
Definition: mimic.c:42
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201