FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
on2avc.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/float_dsp.h"
#include "avcodec.h"
#include "bytestream.h"
#include "fft.h"
#include "get_bits.h"
#include "golomb.h"
#include "internal.h"
#include "unary.h"
#include "on2avcdata.h"

Go to the source code of this file.

Data Structures

struct  On2AVCContext
 

Macros

#define ON2AVC_SUBFRAME_SIZE   1024
 
#define CMUL1_R(s, t, is, it)   s[is + 0] * t[it + 0] - s[is + 1] * t[it + 1]
 
#define CMUL1_I(s, t, is, it)   s[is + 0] * t[it + 1] + s[is + 1] * t[it + 0]
 
#define CMUL2_R(s, t, is, it)   s[is + 0] * t[it + 0] + s[is + 1] * t[it + 1]
 
#define CMUL2_I(s, t, is, it)   s[is + 0] * t[it + 1] - s[is + 1] * t[it + 0]
 
#define CMUL0(dst, id, s0, s1, s2, s3, t0, t1, t2, t3, is, it)
 
#define CMUL1(dst, s0, s1, s2, s3, t0, t1, t2, t3, is, it)
 
#define CMUL2(dst, s0, s1, s2, s3, t0, t1, t2, t3, is, it)
 

Enumerations

enum  WindowTypes {
  WINDOW_TYPE_LONG = 0, WINDOW_TYPE_LONG_STOP, WINDOW_TYPE_LONG_START, WINDOW_TYPE_8SHORT = 3,
  WINDOW_TYPE_EXT4, WINDOW_TYPE_EXT5, WINDOW_TYPE_EXT6, WINDOW_TYPE_EXT7
}
 

Functions

static void on2avc_read_ms_info (On2AVCContext *c, GetBitContext *gb)
 
static int on2avc_decode_band_types (On2AVCContext *c, GetBitContext *gb)
 
static int on2avc_decode_band_scales (On2AVCContext *c, GetBitContext *gb)
 
static float on2avc_scale (int v, float scale)
 
static int on2avc_decode_quads (On2AVCContext *c, GetBitContext *gb, float *dst, int dst_size, int type, float band_scale)
 
static int get_egolomb (GetBitContext *gb)
 
static int on2avc_decode_pairs (On2AVCContext *c, GetBitContext *gb, float *dst, int dst_size, int type, float band_scale)
 
static int on2avc_read_channel_data (On2AVCContext *c, GetBitContext *gb, int ch)
 
static int on2avc_apply_ms (On2AVCContext *c)
 
static void zero_head_and_tail (float *src, int len, int order0, int order1)
 
static void pretwiddle (float *src, float *dst, int dst_len, int tab_step, int step, int order0, int order1, const double *const *tabs)
 
static void twiddle (float *src1, float *src2, int src2_len, const double *tab, int tab_len, int step, int order0, int order1, const double *const *tabs)
 
static void combine_fft (float *s0, float *s1, float *s2, float *s3, float *dst, const float *t0, const float *t1, const float *t2, const float *t3, int len, int step)
 
static void wtf_end_512 (On2AVCContext *c, float *out, float *src, float *tmp0, float *tmp1)
 
static void wtf_end_1024 (On2AVCContext *c, float *out, float *src, float *tmp0, float *tmp1)
 
static void wtf_40 (On2AVCContext *c, float *out, float *src, int size)
 
static void wtf_44 (On2AVCContext *c, float *out, float *src, int size)
 
static int on2avc_reconstruct_stereo (On2AVCContext *c, AVFrame *dst, int offset)
 
static int on2avc_reconstruct_channel (On2AVCContext *c, int channel, AVFrame *dst, int offset)
 
static int on2avc_decode_subframe (On2AVCContext *c, const uint8_t *buf, int buf_size, AVFrame *dst, int offset)
 
static int on2avc_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
 
static av_cold void on2avc_free_vlcs (On2AVCContext *c)
 
static av_cold int on2avc_decode_init (AVCodecContext *avctx)
 
static av_cold int on2avc_decode_close (AVCodecContext *avctx)
 

Variables

AVCodec ff_on2avc_decoder
 

Macro Definition Documentation

#define ON2AVC_SUBFRAME_SIZE   1024
#define CMUL1_R (   s,
  t,
  is,
  it 
)    s[is + 0] * t[it + 0] - s[is + 1] * t[it + 1]

Definition at line 372 of file on2avc.c.

#define CMUL1_I (   s,
  t,
  is,
  it 
)    s[is + 0] * t[it + 1] + s[is + 1] * t[it + 0]

Definition at line 374 of file on2avc.c.

#define CMUL2_R (   s,
  t,
  is,
  it 
)    s[is + 0] * t[it + 0] + s[is + 1] * t[it + 1]

Definition at line 376 of file on2avc.c.

#define CMUL2_I (   s,
  t,
  is,
  it 
)    s[is + 0] * t[it + 1] - s[is + 1] * t[it + 0]

Definition at line 378 of file on2avc.c.

#define CMUL0 (   dst,
  id,
  s0,
  s1,
  s2,
  s3,
  t0,
  t1,
  t2,
  t3,
  is,
  it 
)
Value:
dst[id] = s0[is] * t0[it] + s1[is] * t1[it] \
+ s2[is] * t2[it] + s3[is] * t3[it]; \
dst[id + 1] = s0[is] * t0[it + 1] + s1[is] * t1[it + 1] \
+ s2[is] * t2[it + 1] + s3[is] * t3[it + 1];
enum AVCodecID id
Definition: mxfenc.c:99
#define t0
Definition: regdef.h:28
#define s2
Definition: regdef.h:39
#define s0
Definition: regdef.h:37
#define t1
Definition: regdef.h:29
#define t3
Definition: regdef.h:31
#define s3
Definition: regdef.h:40
#define s1
Definition: regdef.h:38
#define t2
Definition: regdef.h:30

Definition at line 381 of file on2avc.c.

Referenced by combine_fft().

#define CMUL1 (   dst,
  s0,
  s1,
  s2,
  s3,
  t0,
  t1,
  t2,
  t3,
  is,
  it 
)
Value:
*dst++ = CMUL1_R(s0, t0, is, it) \
+ CMUL1_R(s1, t1, is, it) \
+ CMUL1_R(s2, t2, is, it) \
+ CMUL1_R(s3, t3, is, it); \
*dst++ = CMUL1_I(s0, t0, is, it) \
+ CMUL1_I(s1, t1, is, it) \
+ CMUL1_I(s2, t2, is, it) \
+ CMUL1_I(s3, t3, is, it);
#define CMUL1_R(s, t, is, it)
Definition: on2avc.c:372
#define t0
Definition: regdef.h:28
#define s2
Definition: regdef.h:39
#define s0
Definition: regdef.h:37
#define t1
Definition: regdef.h:29
#define t3
Definition: regdef.h:31
#define CMUL1_I(s, t, is, it)
Definition: on2avc.c:374
#define s3
Definition: regdef.h:40
#define s1
Definition: regdef.h:38
#define t2
Definition: regdef.h:30

Definition at line 387 of file on2avc.c.

Referenced by combine_fft().

#define CMUL2 (   dst,
  s0,
  s1,
  s2,
  s3,
  t0,
  t1,
  t2,
  t3,
  is,
  it 
)
Value:
*dst++ = CMUL2_R(s0, t0, is, it) \
+ CMUL2_R(s1, t1, is, it) \
+ CMUL2_R(s2, t2, is, it) \
+ CMUL2_R(s3, t3, is, it); \
*dst++ = CMUL2_I(s0, t0, is, it) \
+ CMUL2_I(s1, t1, is, it) \
+ CMUL2_I(s2, t2, is, it) \
+ CMUL2_I(s3, t3, is, it);
#define t0
Definition: regdef.h:28
#define s2
Definition: regdef.h:39
#define s0
Definition: regdef.h:37
#define t1
Definition: regdef.h:29
#define t3
Definition: regdef.h:31
#define CMUL2_I(s, t, is, it)
Definition: on2avc.c:378
#define s3
Definition: regdef.h:40
#define s1
Definition: regdef.h:38
#define CMUL2_R(s, t, is, it)
Definition: on2avc.c:376
#define t2
Definition: regdef.h:30

Definition at line 397 of file on2avc.c.

Referenced by combine_fft().

Enumeration Type Documentation

Enumerator
WINDOW_TYPE_LONG 
WINDOW_TYPE_LONG_STOP 
WINDOW_TYPE_LONG_START 
WINDOW_TYPE_8SHORT 
WINDOW_TYPE_EXT4 
WINDOW_TYPE_EXT5 
WINDOW_TYPE_EXT6 
WINDOW_TYPE_EXT7 

Definition at line 37 of file on2avc.c.

Function Documentation

static void on2avc_read_ms_info ( On2AVCContext c,
GetBitContext gb 
)
static

Definition at line 89 of file on2avc.c.

Referenced by on2avc_decode_subframe().

static int on2avc_decode_band_types ( On2AVCContext c,
GetBitContext gb 
)
static

Definition at line 110 of file on2avc.c.

Referenced by on2avc_read_channel_data().

static int on2avc_decode_band_scales ( On2AVCContext c,
GetBitContext gb 
)
static

Definition at line 140 of file on2avc.c.

Referenced by on2avc_read_channel_data().

static float on2avc_scale ( int  v,
float  scale 
)
inlinestatic

Definition at line 187 of file on2avc.c.

Referenced by on2avc_decode_pairs(), and on2avc_decode_quads().

static int on2avc_decode_quads ( On2AVCContext c,
GetBitContext gb,
float *  dst,
int  dst_size,
int  type,
float  band_scale 
)
static

Definition at line 193 of file on2avc.c.

Referenced by on2avc_read_channel_data().

static int get_egolomb ( GetBitContext gb)
inlinestatic

Definition at line 210 of file on2avc.c.

Referenced by on2avc_decode_pairs().

static int on2avc_decode_pairs ( On2AVCContext c,
GetBitContext gb,
float *  dst,
int  dst_size,
int  type,
float  band_scale 
)
static

Definition at line 219 of file on2avc.c.

Referenced by on2avc_read_channel_data().

static int on2avc_read_channel_data ( On2AVCContext c,
GetBitContext gb,
int  ch 
)
static

Definition at line 247 of file on2avc.c.

Referenced by on2avc_decode_subframe().

static int on2avc_apply_ms ( On2AVCContext c)
static

Definition at line 284 of file on2avc.c.

Referenced by on2avc_decode_subframe().

static void zero_head_and_tail ( float *  src,
int  len,
int  order0,
int  order1 
)
static

Definition at line 309 of file on2avc.c.

Referenced by wtf_end_1024(), and wtf_end_512().

static void pretwiddle ( float *  src,
float *  dst,
int  dst_len,
int  tab_step,
int  step,
int  order0,
int  order1,
const double *const *  tabs 
)
static

Definition at line 315 of file on2avc.c.

Referenced by twiddle(), wtf_end_1024(), and wtf_end_512().

static void twiddle ( float *  src1,
float *  src2,
int  src2_len,
const double *  tab,
int  tab_len,
int  step,
int  order0,
int  order1,
const double *const *  tabs 
)
static

Definition at line 342 of file on2avc.c.

Referenced by wtf_40(), and wtf_44().

static void combine_fft ( float *  s0,
float *  s1,
float *  s2,
float *  s3,
float *  dst,
const float *  t0,
const float *  t1,
const float *  t2,
const float *  t3,
int  len,
int  step 
)
static

Definition at line 407 of file on2avc.c.

Referenced by wtf_end_1024(), and wtf_end_512().

static void wtf_end_512 ( On2AVCContext c,
float *  out,
float *  src,
float *  tmp0,
float *  tmp1 
)
static

Definition at line 456 of file on2avc.c.

Referenced by wtf_40(), and wtf_44().

static void wtf_end_1024 ( On2AVCContext c,
float *  out,
float *  src,
float *  tmp0,
float *  tmp1 
)
static

Definition at line 489 of file on2avc.c.

Referenced by wtf_40(), and wtf_44().

static void wtf_40 ( On2AVCContext c,
float *  out,
float *  src,
int  size 
)
static

Definition at line 522 of file on2avc.c.

Referenced by on2avc_decode_init().

static void wtf_44 ( On2AVCContext c,
float *  out,
float *  src,
int  size 
)
static

Definition at line 608 of file on2avc.c.

Referenced by on2avc_decode_init().

static int on2avc_reconstruct_stereo ( On2AVCContext c,
AVFrame dst,
int  offset 
)
static

Definition at line 682 of file on2avc.c.

Referenced by on2avc_decode_subframe().

static int on2avc_reconstruct_channel ( On2AVCContext c,
int  channel,
AVFrame dst,
int  offset 
)
static

Definition at line 727 of file on2avc.c.

Referenced by on2avc_decode_subframe().

static int on2avc_decode_subframe ( On2AVCContext c,
const uint8_t buf,
int  buf_size,
AVFrame dst,
int  offset 
)
static

Definition at line 792 of file on2avc.c.

Referenced by on2avc_decode_frame().

static int on2avc_decode_frame ( AVCodecContext avctx,
void data,
int *  got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 837 of file on2avc.c.

static av_cold void on2avc_free_vlcs ( On2AVCContext c)
static

Definition at line 895 of file on2avc.c.

Referenced by on2avc_decode_close(), and on2avc_decode_init().

static av_cold int on2avc_decode_init ( AVCodecContext avctx)
static

Definition at line 904 of file on2avc.c.

static av_cold int on2avc_decode_close ( AVCodecContext avctx)
static

Definition at line 990 of file on2avc.c.

Variable Documentation

AVCodec ff_on2avc_decoder
Initial value:
= {
.name = "on2avc",
.long_name = NULL_IF_CONFIG_SMALL("On2 Audio for Video Codec"),
.priv_data_size = sizeof(On2AVCContext),
.capabilities = CODEC_CAP_DR1,
}
float, planar
Definition: samplefmt.h:70
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static int on2avc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: on2avc.c:837
static av_cold int on2avc_decode_init(AVCodecContext *avctx)
Definition: on2avc.c:904
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:789
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:175
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:59
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
Definition: ccaption_dec.c:522
static av_cold int on2avc_decode_close(AVCodecContext *avctx)
Definition: on2avc.c:990
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:701

Definition at line 1010 of file on2avc.c.