FFmpeg
Data Structures | Macros | Functions | Variables
imm4.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libavutil/mem_internal.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "bswapdsp.h"
#include "codec_internal.h"
#include "copy_block.h"
#include "get_bits.h"
#include "idctdsp.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  IMM4Context
 

Macros

#define CBPLO_VLC_BITS   6
 
#define CBPHI_VLC_BITS   6
 
#define BLKTYPE_VLC_BITS   9
 
#define BLOCK_VLC_BITS   12
 

Functions

static int get_cbphi (GetBitContext *gb, int x)
 
static int decode_block (AVCodecContext *avctx, GetBitContext *gb, int block, int factor, int flag, int offset, int flag2)
 
static int decode_blocks (AVCodecContext *avctx, GetBitContext *gb, unsigned cbp, int flag, int offset, unsigned flag2)
 
static int decode_intra (AVCodecContext *avctx, GetBitContext *gb, AVFrame *frame)
 
static int decode_inter (AVCodecContext *avctx, GetBitContext *gb, AVFrame *frame, AVFrame *prev)
 
static int decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
 
static av_cold void imm4_init_static_data (void)
 
static av_cold int decode_init (AVCodecContext *avctx)
 
static void decode_flush (AVCodecContext *avctx)
 
static av_cold int decode_close (AVCodecContext *avctx)
 

Variables

static const uint8_t intra_cb []
 
static const uint8_t inter_cb []
 
static const uint8_t cbplo [][2]
 
static const uint8_t cbphi_bits []
 
static const uint8_t cbphi_codes []
 
static const uint8_t blktype [][2]
 
static const uint16_t block_symbols []
 
static const uint8_t block_bits []
 
static VLC cbplo_tab
 
static VLC cbphi_tab
 
static VLC blktype_tab
 
static VLC block_tab
 
const FFCodec ff_imm4_decoder
 

Macro Definition Documentation

◆ CBPLO_VLC_BITS

#define CBPLO_VLC_BITS   6

Definition at line 38 of file imm4.c.

◆ CBPHI_VLC_BITS

#define CBPHI_VLC_BITS   6

Definition at line 39 of file imm4.c.

◆ BLKTYPE_VLC_BITS

#define BLKTYPE_VLC_BITS   9

Definition at line 40 of file imm4.c.

◆ BLOCK_VLC_BITS

#define BLOCK_VLC_BITS   12

Definition at line 41 of file imm4.c.

Function Documentation

◆ get_cbphi()

static int get_cbphi ( GetBitContext gb,
int  x 
)
static

Definition at line 118 of file imm4.c.

Referenced by decode_inter(), and decode_intra().

◆ decode_block()

static int decode_block ( AVCodecContext avctx,
GetBitContext gb,
int  block,
int  factor,
int  flag,
int  offset,
int  flag2 
)
static

Definition at line 129 of file imm4.c.

Referenced by decode_blocks().

◆ decode_blocks()

static int decode_blocks ( AVCodecContext avctx,
GetBitContext gb,
unsigned  cbp,
int  flag,
int  offset,
unsigned  flag2 
)
static

Definition at line 172 of file imm4.c.

Referenced by decode_inter(), and decode_intra().

◆ decode_intra()

static int decode_intra ( AVCodecContext avctx,
GetBitContext gb,
AVFrame frame 
)
static

Definition at line 202 of file imm4.c.

Referenced by decode_frame().

◆ decode_inter()

static int decode_inter ( AVCodecContext avctx,
GetBitContext gb,
AVFrame frame,
AVFrame prev 
)
static

Definition at line 253 of file imm4.c.

Referenced by decode_frame().

◆ decode_frame()

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

Definition at line 356 of file imm4.c.

◆ imm4_init_static_data()

static av_cold void imm4_init_static_data ( void  )
static

Definition at line 477 of file imm4.c.

Referenced by decode_init().

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 495 of file imm4.c.

◆ decode_flush()

static void decode_flush ( AVCodecContext avctx)
static

Definition at line 517 of file imm4.c.

◆ decode_close()

static av_cold int decode_close ( AVCodecContext avctx)
static

Definition at line 524 of file imm4.c.

Variable Documentation

◆ intra_cb

const uint8_t intra_cb[]
static
Initial value:
= {
24, 18, 12
}

Definition at line 60 of file imm4.c.

Referenced by decode_intra().

◆ inter_cb

const uint8_t inter_cb[]
static
Initial value:
= {
30, 20, 15
}

Definition at line 64 of file imm4.c.

Referenced by decode_inter().

◆ cbplo

const uint8_t cbplo[][2]
static
Initial value:
= {
{ 0,-6 }, { 0x01, 6 }, { 0x02, 6 }, { 0x03, 6 }, { 0x00, 4 },
{ 0x01, 3 }, { 0x02, 3 }, { 0x03, 3 }, { 0x00, 1 },
}

Definition at line 68 of file imm4.c.

Referenced by decode_inter(), decode_intra(), and imm4_init_static_data().

◆ cbphi_bits

const uint8_t cbphi_bits[]
static
Initial value:
= {
4, 5, 5, 4, 5, 4, 6, 4, 5, 6, 4, 4, 4, 4, 4, 2
}

Definition at line 73 of file imm4.c.

Referenced by imm4_init_static_data().

◆ cbphi_codes

const uint8_t cbphi_codes[]
static
Initial value:
= {
3, 5, 4, 9, 3, 7, 2, 11, 2, 3, 5, 10, 4, 8, 6, 3
}

Definition at line 77 of file imm4.c.

Referenced by imm4_init_static_data().

◆ blktype

const uint8_t blktype[][2]
static
Initial value:
= {
{ 0,-8 }, { 0x34, 9 }, { 0,-9 }, { 0x14, 9 }, { 0,-9 },
{ 0x23, 8 }, { 0x13, 8 }, { 0x32, 8 }, { 0x33, 7 }, { 0x22, 7 },
{ 0x12, 7 }, { 0x21, 7 }, { 0x11, 7 }, { 0x04, 6 }, { 0x30, 6 },
{ 0x03, 5 }, { 0x20, 4 }, { 0x10, 4 }, { 0x02, 3 }, { 0x01, 3 },
{ 0x00, 1 },
}

Definition at line 81 of file imm4.c.

Referenced by imm4_init_static_data().

◆ block_symbols

const uint16_t block_symbols[]
static
Initial value:
= {
0, 0x4082, 0x4003, 0x000B, 0x000A, 0x4E01, 0x4D81, 0x4D01, 0x4C81,
0x0482, 0x0402, 0x0382, 0x0302, 0x0282, 0x0183, 0x0103, 0x0084, 0x000C,
0x0085, 0x0B81, 0x0C01, 0x4E81, 0x4F01, 0x4F81, 0x5001, 0x0086, 0x0104,
0x0203, 0x0283, 0x0303, 0x0502, 0x0C81, 0x0D01, 0x5081, 0x5101, 0x5181,
0x5201, 0x5281, 0x5301, 0x5381, 0x5401, 0x0000, 0x0009, 0x0008, 0x4C01,
0x4B81, 0x4B01, 0x4A81, 0x4A01, 0x4981, 0x4901, 0x4881, 0x4002, 0x0B01,
0x0A81, 0x0A01, 0x0981, 0x0901, 0x0881, 0x0801, 0x0781, 0x0202, 0x0182,
0x0007, 0x0006, 0x4801, 0x4781, 0x4701, 0x4681, 0x4601, 0x4581, 0x4501,
0x4481, 0x0701, 0x0681, 0x0102, 0x0083, 0x0005, 0x4401, 0x4381, 0x4301,
0x4281, 0x0601, 0x0581, 0x0501, 0x0004, 0x4201, 0x4181, 0x4101, 0x4081,
0x0481, 0x0401, 0x0381, 0x0301, 0x0082, 0x0003, 0x0281, 0x0201, 0x0181,
0x4001, 0x0001, 0x0081, 0x0101, 0x0002,
}

Definition at line 89 of file imm4.c.

Referenced by imm4_init_static_data().

◆ block_bits

const uint8_t block_bits[]
static
Initial value:
= {
-9, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11,
11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 7, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 5, 5, 5, 4, 2, 3, 4, 4,
}

Definition at line 104 of file imm4.c.

Referenced by decode_entropy_image(), imm4_init_static_data(), parse_transform_color(), and parse_transform_predictor().

◆ cbplo_tab

VLC cbplo_tab
static

Definition at line 113 of file imm4.c.

Referenced by decode_intra(), and imm4_init_static_data().

◆ cbphi_tab

VLC cbphi_tab
static

Definition at line 114 of file imm4.c.

Referenced by get_cbphi(), and imm4_init_static_data().

◆ blktype_tab

VLC blktype_tab
static

Definition at line 115 of file imm4.c.

Referenced by decode_inter(), and imm4_init_static_data().

◆ block_tab

VLC block_tab
static

Definition at line 116 of file imm4.c.

Referenced by decode_block(), and imm4_init_static_data().

◆ ff_imm4_decoder

const FFCodec ff_imm4_decoder
Initial value:
= {
.p.name = "imm4",
.p.long_name = NULL_IF_CONFIG_SMALL("Infinity IMM4"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(IMM4Context),
.close = decode_close,
.flush = decode_flush,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
}

Definition at line 535 of file imm4.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:39
decode_frame
static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: imm4.c:356
decode_close
static av_cold int decode_close(AVCodecContext *avctx)
Definition: imm4.c:524
init
static int init
Definition: av_tx.c:47
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:254
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: imm4.c:495
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
AV_CODEC_ID_IMM4
@ AV_CODEC_ID_IMM4
Definition: codec_id.h:286
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: codec_internal.h:31
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
IMM4Context
Definition: imm4.c:43
decode_flush
static void decode_flush(AVCodecContext *avctx)
Definition: imm4.c:517