FFmpeg
Data Structures | Macros | Typedefs | Functions | Variables
interplayacm.c File Reference
#include "libavutil/intreadwrite.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "get_bits.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  InterplayACMContext
 

Macros

#define BITSTREAM_READER_LE
 
#define set_pos(s, r, c, idx)
 

Typedefs

typedef int(* filler) (InterplayACMContext *s, unsigned ind, unsigned col)
 

Functions

static av_cold void decode_init_static (void)
 
static av_cold int decode_init (AVCodecContext *avctx)
 
static int zero (InterplayACMContext *s, unsigned ind, unsigned col)
 
static int bad (InterplayACMContext *s, unsigned ind, unsigned col)
 
static int linear (InterplayACMContext *s, unsigned ind, unsigned col)
 
static int k13 (InterplayACMContext *s, unsigned ind, unsigned col)
 
static int k12 (InterplayACMContext *s, unsigned ind, unsigned col)
 
static int k24 (InterplayACMContext *s, unsigned ind, unsigned col)
 
static int k23 (InterplayACMContext *s, unsigned ind, unsigned col)
 
static int k35 (InterplayACMContext *s, unsigned ind, unsigned col)
 
static int k34 (InterplayACMContext *s, unsigned ind, unsigned col)
 
static int k45 (InterplayACMContext *s, unsigned ind, unsigned col)
 
static int k44 (InterplayACMContext *s, unsigned ind, unsigned col)
 
static int t15 (InterplayACMContext *s, unsigned ind, unsigned col)
 
static int t27 (InterplayACMContext *s, unsigned ind, unsigned col)
 
static int t37 (InterplayACMContext *s, unsigned ind, unsigned col)
 
static int fill_block (InterplayACMContext *s)
 
static void juggle (int *wrap_p, int *block_p, unsigned sub_len, unsigned sub_count)
 
static void juggle_block (InterplayACMContext *s)
 
static int decode_block (InterplayACMContext *s)
 
static int decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt)
 
static av_cold int decode_close (AVCodecContext *avctx)
 

Variables

static const int8_t map_1bit [] = { -1, +1 }
 
static const int8_t map_2bit_near [] = { -2, -1, +1, +2 }
 
static const int8_t map_2bit_far [] = { -3, -2, +2, +3 }
 
static const int8_t map_3bit [] = { -4, -3, -2, -1, +1, +2, +3, +4 }
 
static int mul_3x3 [3 *3 *3]
 
static int mul_3x5 [5 *5 *5]
 
static int mul_2x11 [11 *11]
 
static const filler filler_list []
 
const FFCodec ff_interplay_acm_decoder
 

Macro Definition Documentation

◆ BITSTREAM_READER_LE

#define BITSTREAM_READER_LE

Definition at line 24 of file interplayacm.c.

◆ set_pos

#define set_pos (   s,
  r,
  c,
  idx 
)
Value:
do { \
unsigned pos = ((r) << s->level) + (c); \
s->block[pos] = s->midbuf[(idx)]; \
} while (0)

Definition at line 113 of file interplayacm.c.

Typedef Documentation

◆ filler

typedef int(* filler) (InterplayACMContext *s, unsigned ind, unsigned col)

Definition at line 418 of file interplayacm.c.

Function Documentation

◆ decode_init_static()

static av_cold void decode_init_static ( void  )
static

Definition at line 60 of file interplayacm.c.

Referenced by decode_init().

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 75 of file interplayacm.c.

◆ zero()

static int zero ( InterplayACMContext s,
unsigned  ind,
unsigned  col 
)
static

Definition at line 118 of file interplayacm.c.

◆ bad()

static int bad ( InterplayACMContext s,
unsigned  ind,
unsigned  col 
)
static

Definition at line 127 of file interplayacm.c.

Referenced by amv_init().

◆ linear()

static int linear ( InterplayACMContext s,
unsigned  ind,
unsigned  col 
)
static

Definition at line 132 of file interplayacm.c.

Referenced by pixfmt_is_supported(), and resample_init().

◆ k13()

static int k13 ( InterplayACMContext s,
unsigned  ind,
unsigned  col 
)
static

Definition at line 145 of file interplayacm.c.

◆ k12()

static int k12 ( InterplayACMContext s,
unsigned  ind,
unsigned  col 
)
static

Definition at line 170 of file interplayacm.c.

◆ k24()

static int k24 ( InterplayACMContext s,
unsigned  ind,
unsigned  col 
)
static

Definition at line 188 of file interplayacm.c.

◆ k23()

static int k23 ( InterplayACMContext s,
unsigned  ind,
unsigned  col 
)
static

Definition at line 214 of file interplayacm.c.

◆ k35()

static int k35 ( InterplayACMContext s,
unsigned  ind,
unsigned  col 
)
static

Definition at line 232 of file interplayacm.c.

◆ k34()

static int k34 ( InterplayACMContext s,
unsigned  ind,
unsigned  col 
)
static

Definition at line 266 of file interplayacm.c.

◆ k45()

static int k45 ( InterplayACMContext s,
unsigned  ind,
unsigned  col 
)
static

Definition at line 291 of file interplayacm.c.

◆ k44()

static int k44 ( InterplayACMContext s,
unsigned  ind,
unsigned  col 
)
static

Definition at line 318 of file interplayacm.c.

◆ t15()

static int t15 ( InterplayACMContext s,
unsigned  ind,
unsigned  col 
)
static

◆ t27()

static int t27 ( InterplayACMContext s,
unsigned  ind,
unsigned  col 
)
static

Definition at line 365 of file interplayacm.c.

Referenced by itxfm_wrap().

◆ t37()

static int t37 ( InterplayACMContext s,
unsigned  ind,
unsigned  col 
)
static

Definition at line 394 of file interplayacm.c.

◆ fill_block()

static int fill_block ( InterplayACMContext s)
static

Definition at line 431 of file interplayacm.c.

Referenced by decode_block().

◆ juggle()

static void juggle ( int wrap_p,
int block_p,
unsigned  sub_len,
unsigned  sub_count 
)
static

Definition at line 446 of file interplayacm.c.

Referenced by juggle_block().

◆ juggle_block()

static void juggle_block ( InterplayACMContext s)
static

Definition at line 473 of file interplayacm.c.

Referenced by decode_block().

◆ decode_block()

static int decode_block ( InterplayACMContext s)
static

Definition at line 526 of file interplayacm.c.

Referenced by decode_frame().

◆ decode_frame()

static int decode_frame ( AVCodecContext avctx,
AVFrame frame,
int got_frame_ptr,
AVPacket pkt 
)
static

Definition at line 555 of file interplayacm.c.

◆ decode_close()

static av_cold int decode_close ( AVCodecContext avctx)
static

Definition at line 622 of file interplayacm.c.

Variable Documentation

◆ map_1bit

const int8_t map_1bit[] = { -1, +1 }
static

Definition at line 30 of file interplayacm.c.

Referenced by k12(), k13(), k34(), and k35().

◆ map_2bit_near

const int8_t map_2bit_near[] = { -2, -1, +1, +2 }
static

Definition at line 31 of file interplayacm.c.

Referenced by k23(), and k24().

◆ map_2bit_far

const int8_t map_2bit_far[] = { -3, -2, +2, +3 }
static

Definition at line 32 of file interplayacm.c.

Referenced by k34(), and k35().

◆ map_3bit

const int8_t map_3bit[] = { -4, -3, -2, -1, +1, +2, +3, +4 }
static

Definition at line 33 of file interplayacm.c.

Referenced by k44(), and k45().

◆ mul_3x3

int mul_3x3[3 *3 *3]
static

Definition at line 35 of file interplayacm.c.

Referenced by decode_init_static(), and t15().

◆ mul_3x5

int mul_3x5[5 *5 *5]
static

Definition at line 36 of file interplayacm.c.

Referenced by decode_init_static(), and t27().

◆ mul_2x11

int mul_2x11[11 * 11]
static

Definition at line 37 of file interplayacm.c.

Referenced by decode_init_static(), and t37().

◆ filler_list

const filler filler_list[]
static
Initial value:

Definition at line 420 of file interplayacm.c.

Referenced by fill_block().

◆ ff_interplay_acm_decoder

const FFCodec ff_interplay_acm_decoder
Initial value:
= {
.p.name = "interplayacm",
.p.long_name = NULL_IF_CONFIG_SMALL("Interplay ACM"),
.p.type = AVMEDIA_TYPE_AUDIO,
.init = decode_init,
.close = decode_close,
.p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.priv_data_size = sizeof(InterplayACMContext),
}

Definition at line 635 of file interplayacm.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:41
r
const char * r
Definition: vf_curves.c:116
k45
static int k45(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:291
AV_CODEC_ID_INTERPLAY_ACM
@ AV_CODEC_ID_INTERPLAY_ACM
Definition: codec_id.h:507
decode_frame
static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt)
Definition: interplayacm.c:555
linear
static int linear(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:132
k44
static int k44(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:318
t15
static int t15(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:336
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:260
s
#define s(width, name)
Definition: cbs_vp9.c:256
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
k35
static int k35(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:232
k34
static int k34(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:266
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: interplayacm.c:75
k12
static int k12(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:170
decode_close
static av_cold int decode_close(AVCodecContext *avctx)
Definition: interplayacm.c:622
InterplayACMContext
Definition: interplayacm.c:39
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
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
t27
static int t27(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:365
zero
static int zero(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:118
k23
static int k23(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:214
pos
unsigned int pos
Definition: spdifenc.c:412
t37
static int t37(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:394
k13
static int k13(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:145
AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: codec.h:82
bad
static int bad(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:127
k24
static int k24(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:188