FFmpeg
Data Structures | Macros | Functions | Variables
hcadec.c File Reference
#include "libavutil/crc.h"
#include "libavutil/float_dsp.h"
#include "libavutil/mem.h"
#include "libavutil/mem_internal.h"
#include "libavutil/tx.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "hca_data.h"

Go to the source code of this file.

Data Structures

struct  ChannelContext
 
struct  HCAContext
 

Macros

#define HCA_MASK   0x7f7f7f7f
 
#define MAX_CHANNELS   16
 

Functions

static void cipher_init56_create_table (uint8_t *r, uint8_t key)
 
static void cipher_init56 (uint8_t *cipher, uint64_t keycode)
 
static void cipher_init (uint8_t *cipher, int type, uint64_t keycode, uint16_t subkey)
 
static void ath_init1 (uint8_t *ath, int sample_rate)
 
static int ath_init (uint8_t *ath, int type, int sample_rate)
 
static unsigned ceil2 (unsigned a, unsigned b)
 
static av_cold void init_flush (AVCodecContext *avctx)
 
static int init_hca (AVCodecContext *avctx, const uint8_t *extradata, const int extradata_size)
 
static av_cold int decode_init (AVCodecContext *avctx)
 
static void run_imdct (HCAContext *c, ChannelContext *ch, int index, float *out)
 
static void apply_intensity_stereo (HCAContext *s, ChannelContext *ch1, ChannelContext *ch2, int index, unsigned band_count, unsigned base_band_count, unsigned stereo_band_count)
 
static void reconstruct_hfr (HCAContext *s, ChannelContext *ch, unsigned hfr_group_count, unsigned bands_per_hfr_group, unsigned start_band, unsigned total_band_count)
 
static void dequantize_coefficients (HCAContext *c, ChannelContext *ch, GetBitContext *gb)
 
static void unpack (HCAContext *c, ChannelContext *ch, GetBitContext *gb, unsigned hfr_group_count, int packed_noise_level, const uint8_t *ath)
 
static int decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 
static av_cold int decode_close (AVCodecContext *avctx)
 
static av_cold void decode_flush (AVCodecContext *avctx)
 

Variables

const FFCodec ff_hca_decoder
 

Macro Definition Documentation

◆ HCA_MASK

#define HCA_MASK   0x7f7f7f7f

Definition at line 32 of file hcadec.c.

◆ MAX_CHANNELS

#define MAX_CHANNELS   16

Definition at line 33 of file hcadec.c.

Function Documentation

◆ cipher_init56_create_table()

static void cipher_init56_create_table ( uint8_t *  r,
uint8_t  key 
)
static

Definition at line 75 of file hcadec.c.

Referenced by cipher_init56().

◆ cipher_init56()

static void cipher_init56 ( uint8_t *  cipher,
uint64_t  keycode 
)
static

Definition at line 87 of file hcadec.c.

Referenced by cipher_init().

◆ cipher_init()

static void cipher_init ( uint8_t *  cipher,
int  type,
uint64_t  keycode,
uint16_t  subkey 
)
static

Definition at line 145 of file hcadec.c.

Referenced by init_hca().

◆ ath_init1()

static void ath_init1 ( uint8_t *  ath,
int  sample_rate 
)
static

Definition at line 162 of file hcadec.c.

Referenced by ath_init().

◆ ath_init()

static int ath_init ( uint8_t *  ath,
int  type,
int  sample_rate 
)
static

Definition at line 180 of file hcadec.c.

Referenced by init_hca().

◆ ceil2()

static unsigned ceil2 ( unsigned  a,
unsigned  b 
)
inlinestatic

Definition at line 196 of file hcadec.c.

Referenced by init_hca().

◆ init_flush()

static av_cold void init_flush ( AVCodecContext avctx)
static

Definition at line 201 of file hcadec.c.

Referenced by init_hca().

◆ init_hca()

static int init_hca ( AVCodecContext avctx,
const uint8_t *  extradata,
const int  extradata_size 
)
static

Definition at line 208 of file hcadec.c.

Referenced by decode_frame(), and decode_init().

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 362 of file hcadec.c.

◆ run_imdct()

static void run_imdct ( HCAContext c,
ChannelContext ch,
int  index,
float out 
)
static

Definition at line 390 of file hcadec.c.

Referenced by decode_frame().

◆ apply_intensity_stereo()

static void apply_intensity_stereo ( HCAContext s,
ChannelContext ch1,
ChannelContext ch2,
int  index,
unsigned  band_count,
unsigned  base_band_count,
unsigned  stereo_band_count 
)
static

Definition at line 400 of file hcadec.c.

Referenced by decode_frame().

◆ reconstruct_hfr()

static void reconstruct_hfr ( HCAContext s,
ChannelContext ch,
unsigned  hfr_group_count,
unsigned  bands_per_hfr_group,
unsigned  start_band,
unsigned  total_band_count 
)
static

Definition at line 418 of file hcadec.c.

Referenced by decode_frame().

◆ dequantize_coefficients()

static void dequantize_coefficients ( HCAContext c,
ChannelContext ch,
GetBitContext gb 
)
static

Definition at line 436 of file hcadec.c.

Referenced by decode_frame().

◆ unpack()

static void unpack ( HCAContext c,
ChannelContext ch,
GetBitContext gb,
unsigned  hfr_group_count,
int  packed_noise_level,
const uint8_t *  ath 
)
static

Definition at line 466 of file hcadec.c.

Referenced by decode_frame().

◆ decode_frame()

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

Definition at line 526 of file hcadec.c.

◆ decode_close()

static av_cold int decode_close ( AVCodecContext avctx)
static

Definition at line 607 of file hcadec.c.

◆ decode_flush()

static av_cold void decode_flush ( AVCodecContext avctx)
static

Definition at line 617 of file hcadec.c.

Variable Documentation

◆ ff_hca_decoder

const FFCodec ff_hca_decoder
Initial value:
= {
.p.name = "hca",
CODEC_LONG_NAME("CRI HCA"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_HCA,
.priv_data_size = sizeof(HCAContext),
.flush = decode_flush,
.close = decode_close,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
}

Definition at line 625 of file hcadec.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
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
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
decode_frame
static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: hcadec.c:526
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: hcadec.c:362
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:366
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
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
decode_close
static av_cold int decode_close(AVCodecContext *avctx)
Definition: hcadec.c:607
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
HCAContext
Definition: hcadec.c:49
decode_flush
static av_cold void decode_flush(AVCodecContext *avctx)
Definition: hcadec.c:617
AV_CODEC_ID_HCA
@ AV_CODEC_ID_HCA
Definition: codec_id.h:533