libavcodec/ffwavesynth.c File Reference

#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "avcodec.h"

Go to the source code of this file.

Data Structures

struct  ws_interval
struct  wavesynth_context

Defines

#define SIN_BITS   14
#define WS_MAX_CHANNELS   32
#define INF_TS   0x7FFFFFFFFFFFFFFF
#define PINK_UNIT   128
#define LCG_A   1284865837
#define LCG_C   4150755663
#define LCG_AI   849225893

Enumerations

enum  ws_interval_type { WS_SINE = MKTAG('S','I','N','E'), WS_NOISE = MKTAG('N','O','I','S'), WS_SINE = MKTAG('S','I','N','E'), WS_NOISE = MKTAG('N','O','I','S') }

Functions

static uint32_t lcg_next (uint32_t *s)
static void lcg_seek (uint32_t *s, int64_t dt)
static void pink_fill (struct wavesynth_context *ws)
static uint64_t frac64 (uint64_t a, uint64_t b)
static uint64_t phi_at (struct ws_interval *in, int64_t ts)
static void wavesynth_seek (struct wavesynth_context *ws, int64_t ts)
static int wavesynth_parse_extradata (AVCodecContext *avc)
static av_cold int wavesynth_init (AVCodecContext *avc)
static void wavesynth_synth_sample (struct wavesynth_context *ws, int64_t ts, int32_t *channels)
static void wavesynth_enter_intervals (struct wavesynth_context *ws, int64_t ts)
static int wavesynth_decode (AVCodecContext *avc, void *rframe, int *rgot_frame, AVPacket *packet)
static av_cold int wavesynth_close (AVCodecContext *avc)

Variables

AVCodec ff_ffwavesynth_decoder


Define Documentation

#define INF_TS   0x7FFFFFFFFFFFFFFF

Definition at line 28 of file ffwavesynth.c.

Referenced by wavesynth_enter_intervals(), and wavesynth_seek().

#define LCG_A   1284865837

Definition at line 105 of file ffwavesynth.c.

Referenced by lcg_next(), and lcg_seek().

#define LCG_AI   849225893

Definition at line 107 of file ffwavesynth.c.

Referenced by lcg_seek().

#define LCG_C   4150755663

Definition at line 106 of file ffwavesynth.c.

Referenced by lcg_next(), and lcg_seek().

#define PINK_UNIT   128

Definition at line 30 of file ffwavesynth.c.

Referenced by pink_fill(), wavesynth_init(), wavesynth_seek(), and wavesynth_synth_sample().

#define SIN_BITS   14

Definition at line 26 of file ffwavesynth.c.

Referenced by wavesynth_init(), and wavesynth_synth_sample().

#define WS_MAX_CHANNELS   32

Definition at line 27 of file ffwavesynth.c.

Referenced by wavesynth_decode(), and wavesynth_init().


Enumeration Type Documentation

Enumerator:
WS_SINE 
WS_NOISE 
WS_SINE 
WS_NOISE 

Definition at line 75 of file ffwavesynth.c.


Function Documentation

static uint64_t frac64 ( uint64_t  a,
uint64_t  b 
) [static]

Returns:
(1<<64) * a / b, without overflow, if a < b

Definition at line 166 of file ffwavesynth.c.

Referenced by wavesynth_parse_extradata().

static uint32_t lcg_next ( uint32_t *  s  )  [static]

Definition at line 109 of file ffwavesynth.c.

Referenced by pink_fill(), and wavesynth_synth_sample().

static void lcg_seek ( uint32_t *  s,
int64_t  dt 
) [static]

Definition at line 115 of file ffwavesynth.c.

Referenced by wavesynth_seek().

static uint64_t phi_at ( struct ws_interval in,
int64_t  ts 
) [static]

Definition at line 194 of file ffwavesynth.c.

Referenced by wavesynth_parse_extradata(), and wavesynth_seek().

static void pink_fill ( struct wavesynth_context ws  )  [static]

Definition at line 142 of file ffwavesynth.c.

Referenced by wavesynth_seek(), and wavesynth_synth_sample().

static av_cold int wavesynth_close ( AVCodecContext avc  )  [static]

Definition at line 463 of file ffwavesynth.c.

static int wavesynth_decode ( AVCodecContext avc,
void *  rframe,
int *  rgot_frame,
AVPacket packet 
) [static]

Definition at line 425 of file ffwavesynth.c.

static void wavesynth_enter_intervals ( struct wavesynth_context ws,
int64_t  ts 
) [static]

Definition at line 400 of file ffwavesynth.c.

Referenced by wavesynth_decode().

static av_cold int wavesynth_init ( AVCodecContext avc  )  [static]

Definition at line 314 of file ffwavesynth.c.

static int wavesynth_parse_extradata ( AVCodecContext avc  )  [static]

Definition at line 239 of file ffwavesynth.c.

Referenced by wavesynth_init().

static void wavesynth_seek ( struct wavesynth_context ws,
int64_t  ts 
) [static]

Definition at line 202 of file ffwavesynth.c.

Referenced by wavesynth_decode(), and wavesynth_init().

static void wavesynth_synth_sample ( struct wavesynth_context ws,
int64_t  ts,
int32_t *  channels 
) [static]

Definition at line 354 of file ffwavesynth.c.

Referenced by wavesynth_decode().


Variable Documentation

Initial value:

 {
    .name           = "wavesynth",
    .type           = AVMEDIA_TYPE_AUDIO,
    .id             = CODEC_ID_FFWAVESYNTH,
    .priv_data_size = sizeof(struct wavesynth_context),
    .init           = wavesynth_init,
    .close          = wavesynth_close,
    .decode         = wavesynth_decode,
    .capabilities   = CODEC_CAP_DR1,
    .long_name      = NULL_IF_CONFIG_SMALL("Wave synthesis pseudo-codec"),
}

Definition at line 472 of file ffwavesynth.c.


Generated on Fri Oct 26 02:46:08 2012 for FFmpeg by  doxygen 1.5.8