FFmpeg
Data Structures | Macros | Functions | Variables
imc.c File Reference
#include "config_components.h"
#include <math.h>
#include <stddef.h>
#include "libavutil/channel_layout.h"
#include "libavutil/ffmath.h"
#include "libavutil/float_dsp.h"
#include "libavutil/internal.h"
#include "libavutil/mem_internal.h"
#include "libavutil/thread.h"
#include "libavutil/tx.h"
#include "avcodec.h"
#include "bswapdsp.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "sinewin.h"
#include "imcdata.h"

Go to the source code of this file.

Data Structures

struct  IMCChannel
 
struct  IMCContext
 

Macros

#define IMC_BLOCK_SIZE   64
 
#define IMC_FRAME_ID   0x21
 
#define BANDS   32
 
#define COEFFS   256
 
#define IMC_VLC_BITS   9
 
#define VLC_TABLES_SIZE   9512
 

Functions

static double freq2bark (double freq)
 
static av_cold void iac_generate_tabs (IMCContext *q, int sampling_rate)
 
static av_cold void imc_init_static (void)
 
static av_cold int imc_decode_init (AVCodecContext *avctx)
 
static void imc_calculate_coeffs (IMCContext *q, float *flcoeffs1, float *flcoeffs2, int *bandWidthT, float *flcoeffs3, float *flcoeffs5)
 
static void imc_read_level_coeffs (IMCContext *q, int stream_format_code, int *levlCoeffs)
 
static void imc_read_level_coeffs_raw (IMCContext *q, int stream_format_code, int *levlCoeffs)
 
static void imc_decode_level_coefficients (IMCContext *q, int *levlCoeffBuf, float *flcoeffs1, float *flcoeffs2)
 
static void imc_decode_level_coefficients2 (IMCContext *q, int *levlCoeffBuf, float *old_floor, float *flcoeffs1, float *flcoeffs2)
 
static void imc_decode_level_coefficients_raw (IMCContext *q, int *levlCoeffBuf, float *flcoeffs1, float *flcoeffs2)
 
static int bit_allocation (IMCContext *q, IMCChannel *chctx, int stream_format_code, int freebits, int flag)
 Perform bit allocation depending on bits available. More...
 
static void imc_get_skip_coeff (IMCContext *q, IMCChannel *chctx)
 
static void imc_adjust_bit_allocation (IMCContext *q, IMCChannel *chctx, int summer)
 Increase highest' band coefficient sizes as some bits won't be used. More...
 
static int inverse_quant_coeff (IMCContext *q, IMCChannel *chctx, int stream_format_code)
 
static void imc_get_coeffs (AVCodecContext *avctx, IMCContext *q, IMCChannel *chctx)
 
static void imc_refine_bit_allocation (IMCContext *q, IMCChannel *chctx)
 
static int imc_decode_block (AVCodecContext *avctx, IMCContext *q, int ch)
 
static int imc_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 
static av_cold int imc_decode_close (AVCodecContext *avctx)
 
static av_cold void flush (AVCodecContext *avctx)
 

Variables

static VLC huffman_vlc [4][4]
 
static VLCElem vlc_tables [VLC_TABLES_SIZE]
 

Detailed Description

IMC - Intel Music Coder A mdct based codec using a 256 points large transform divided into 32 bands with some mix of scale factors. Only mono is supported.

Definition in file imc.c.

Macro Definition Documentation

◆ IMC_BLOCK_SIZE

#define IMC_BLOCK_SIZE   64

Definition at line 54 of file imc.c.

◆ IMC_FRAME_ID

#define IMC_FRAME_ID   0x21

Definition at line 55 of file imc.c.

◆ BANDS

#define BANDS   32

Definition at line 56 of file imc.c.

◆ COEFFS

#define COEFFS   256

Definition at line 57 of file imc.c.

◆ IMC_VLC_BITS

#define IMC_VLC_BITS   9

Definition at line 111 of file imc.c.

◆ VLC_TABLES_SIZE

#define VLC_TABLES_SIZE   9512

Definition at line 112 of file imc.c.

Function Documentation

◆ freq2bark()

static double freq2bark ( double  freq)
inlinestatic

Definition at line 116 of file imc.c.

Referenced by iac_generate_tabs().

◆ iac_generate_tabs()

static av_cold void iac_generate_tabs ( IMCContext q,
int  sampling_rate 
)
static

Definition at line 121 of file imc.c.

Referenced by imc_decode_init().

◆ imc_init_static()

static av_cold void imc_init_static ( void  )
static

Definition at line 172 of file imc.c.

Referenced by imc_decode_init().

◆ imc_decode_init()

static av_cold int imc_decode_init ( AVCodecContext avctx)
static

Definition at line 188 of file imc.c.

◆ imc_calculate_coeffs()

static void imc_calculate_coeffs ( IMCContext q,
float flcoeffs1,
float flcoeffs2,
int bandWidthT,
float flcoeffs3,
float flcoeffs5 
)
static

Definition at line 255 of file imc.c.

Referenced by imc_decode_block().

◆ imc_read_level_coeffs()

static void imc_read_level_coeffs ( IMCContext q,
int  stream_format_code,
int levlCoeffs 
)
static

Definition at line 310 of file imc.c.

Referenced by imc_decode_block().

◆ imc_read_level_coeffs_raw()

static void imc_read_level_coeffs_raw ( IMCContext q,
int  stream_format_code,
int levlCoeffs 
)
static

Definition at line 338 of file imc.c.

Referenced by imc_decode_block().

◆ imc_decode_level_coefficients()

static void imc_decode_level_coefficients ( IMCContext q,
int levlCoeffBuf,
float flcoeffs1,
float flcoeffs2 
)
static

Definition at line 349 of file imc.c.

Referenced by imc_decode_block().

◆ imc_decode_level_coefficients2()

static void imc_decode_level_coefficients2 ( IMCContext q,
int levlCoeffBuf,
float old_floor,
float flcoeffs1,
float flcoeffs2 
)
static

Definition at line 383 of file imc.c.

Referenced by imc_decode_block().

◆ imc_decode_level_coefficients_raw()

static void imc_decode_level_coefficients_raw ( IMCContext q,
int levlCoeffBuf,
float flcoeffs1,
float flcoeffs2 
)
static

Definition at line 403 of file imc.c.

Referenced by imc_decode_block().

◆ bit_allocation()

static int bit_allocation ( IMCContext q,
IMCChannel chctx,
int  stream_format_code,
int  freebits,
int  flag 
)
static

Perform bit allocation depending on bits available.

Definition at line 428 of file imc.c.

Referenced by imc_decode_block().

◆ imc_get_skip_coeff()

static void imc_get_skip_coeff ( IMCContext q,
IMCChannel chctx 
)
static

Definition at line 604 of file imc.c.

Referenced by imc_refine_bit_allocation().

◆ imc_adjust_bit_allocation()

static void imc_adjust_bit_allocation ( IMCContext q,
IMCChannel chctx,
int  summer 
)
static

Increase highest' band coefficient sizes as some bits won't be used.

Definition at line 660 of file imc.c.

Referenced by imc_refine_bit_allocation().

◆ inverse_quant_coeff()

static int inverse_quant_coeff ( IMCContext q,
IMCChannel chctx,
int  stream_format_code 
)
static

Definition at line 702 of file imc.c.

Referenced by imc_decode_block().

◆ imc_get_coeffs()

static void imc_get_coeffs ( AVCodecContext avctx,
IMCContext q,
IMCChannel chctx 
)
static

Definition at line 742 of file imc.c.

Referenced by imc_decode_block().

◆ imc_refine_bit_allocation()

static void imc_refine_bit_allocation ( IMCContext q,
IMCChannel chctx 
)
static

Definition at line 770 of file imc.c.

Referenced by imc_decode_block().

◆ imc_decode_block()

static int imc_decode_block ( AVCodecContext avctx,
IMCContext q,
int  ch 
)
static

Definition at line 813 of file imc.c.

Referenced by imc_decode_frame().

◆ imc_decode_frame()

static int imc_decode_frame ( AVCodecContext avctx,
AVFrame frame,
int got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 963 of file imc.c.

◆ imc_decode_close()

static av_cold int imc_decode_close ( AVCodecContext avctx)
static

Definition at line 1009 of file imc.c.

◆ flush()

static av_cold void flush ( AVCodecContext avctx)
static

Definition at line 1019 of file imc.c.

Variable Documentation

◆ huffman_vlc

VLC huffman_vlc[4][4]
static

Definition at line 109 of file imc.c.

Referenced by imc_init_static(), and imc_read_level_coeffs().

◆ vlc_tables

VLCElem vlc_tables[VLC_TABLES_SIZE]
static

Definition at line 114 of file imc.c.

Referenced by imc_init_static().