FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
mimic.c File Reference
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include "avcodec.h"
#include "blockdsp.h"
#include "internal.h"
#include "get_bits.h"
#include "bytestream.h"
#include "bswapdsp.h"
#include "hpeldsp.h"
#include "idctdsp.h"
#include "thread.h"

Go to the source code of this file.

Data Structures

struct  MimicContext
 

Macros

#define MIMIC_HEADER_SIZE   20
 

Functions

static av_cold int mimic_decode_end (AVCodecContext *avctx)
 
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, void *data, int *got_frame, AVPacket *avpkt)
 

Variables

static const uint32_t huffcodes []
 
static const uint8_t huffbits []
 
static const uint8_t col_zag [64]
 
static const int8_t vlcdec_lookup [9][64]
 
AVCodec ff_mimic_decoder
 

Macro Definition Documentation

#define MIMIC_HEADER_SIZE   20

Definition at line 36 of file mimic.c.

Referenced by mimic_decode_frame().

Function Documentation

static av_cold int mimic_decode_end ( AVCodecContext avctx)
static

Definition at line 117 of file mimic.c.

Referenced by mimic_decode_init().

static av_cold int mimic_decode_init ( AVCodecContext avctx)
static

Definition at line 137 of file mimic.c.

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

Definition at line 231 of file mimic.c.

Referenced by decode().

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

Definition at line 275 of file mimic.c.

Referenced by mimic_decode_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 345 of file mimic.c.

Referenced by mimic_decode_frame().

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

Definition at line 356 of file mimic.c.

Variable Documentation

const uint32_t huffcodes[]
static
Initial value:
= {
0x0000000a, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000b,
0x0000001b, 0x00000038, 0x00000078, 0x00000079, 0x0000007a, 0x000000f9,
0x000000fa, 0x000003fb, 0x000007f8, 0x000007f9, 0x000007fa, 0x000007fb,
0x00000ff8, 0x00000ff9, 0x00000001, 0x00000039, 0x0000007b, 0x000000fb,
0x000001f8, 0x000001f9, 0x00000ffa, 0x00000ffb, 0x00001ff8, 0x00001ff9,
0x00001ffa, 0x00001ffb, 0x00003ff8, 0x00003ff9, 0x00003ffa, 0x00000000,
0x00000004, 0x0000003a, 0x000001fa, 0x00003ffb, 0x00007ff8, 0x00007ff9,
0x00007ffa, 0x00007ffb, 0x0000fff8, 0x0000fff9, 0x0000fffa, 0x0000fffb,
0x0001fff8, 0x0001fff9, 0x0001fffa, 0x00000000, 0x0000000c, 0x000000f8,
0x000001fb, 0x0001fffb, 0x0003fff8, 0x0003fff9, 0x0003fffa, 0x0003fffb,
0x0007fff8, 0x0007fff9, 0x0007fffa, 0x0007fffb, 0x000ffff8, 0x000ffff9,
0x000ffffa, 0x00000000, 0x0000001a, 0x000003f8, 0x000ffffb, 0x001ffff8,
0x001ffff9, 0x001ffffa, 0x001ffffb, 0x003ffff8, 0x003ffff9, 0x003ffffa,
0x003ffffb, 0x007ffff8, 0x007ffff9, 0x007ffffa, 0x007ffffb, 0x00000000,
0x0000003b, 0x000003f9, 0x00fffff8, 0x00fffff9, 0x00fffffa, 0x00fffffb,
0x01fffff8, 0x01fffff9, 0x01fffffa, 0x01fffffb, 0x03fffff8, 0x03fffff9,
0x03fffffa, 0x03fffffb, 0x07fffff8, 0x00000000, 0x000003fa, 0x07fffff9,
0x07fffffa, 0x07fffffb, 0x0ffffff8, 0x0ffffff9, 0x0ffffffa, 0x0ffffffb,
0x1ffffff8, 0x1ffffff9, 0x1ffffffa, 0x1ffffffb, 0x3ffffff8, 0x3ffffff9,
0x3ffffffa,
}

Definition at line 67 of file mimic.c.

Referenced by mimic_decode_init().

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

Definition at line 92 of file mimic.c.

Referenced by mimic_decode_init().

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 106 of file mimic.c.

Referenced by mimic_decode_init().

const int8_t vlcdec_lookup[9][64]
static

Definition at line 194 of file mimic.c.

AVCodec ff_mimic_decoder
Initial value:
= {
.name = "mimic",
.long_name = NULL_IF_CONFIG_SMALL("Mimic"),
.priv_data_size = sizeof(MimicContext),
.close = mimic_decode_end,
.update_thread_context = ONLY_IF_THREADS_ENABLED(mimic_decode_update_thread_context),
.init_thread_copy = ONLY_IF_THREADS_ENABLED(mimic_init_thread_copy),
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
Definition: mimic.c:275
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: avcodec.h:1022
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
Definition: internal.h:215
static av_cold int mimic_decode_end(AVCodecContext *avctx)
Definition: mimic.c:117
static av_cold int mimic_decode_init(AVCodecContext *avctx)
Definition: mimic.c:137
static int mimic_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: mimic.c:356
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:959

Definition at line 473 of file mimic.c.