FFmpeg
|
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libavutil/avassert.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "audio.h"
Go to the source code of this file.
Data Structures | |
struct | hdcd_state |
struct | hdcd_detection_data |
struct | HDCDContext |
Macros | |
#define | PEAK_EXT_LEVEL 0x5981 /* + sizeof(peaktab)-1 = 0x8000 */ |
#define | HDCD_PROCESS_STEREO_DEFAULT 1 |
#define | HDCD_MAX_CHANNELS 2 |
#define | GAINTOFLOAT(g) (g) ? -(float)(g>>1) - ((g & 1) ? 0.5 : 0.0) : 0.0 |
convert to float from 4-bit (3.1) fixed-point the always-negative value is stored positive, so make it negative More... | |
#define | APPLY_GAIN(s, g) do{int64_t s64 = s; s64 *= gaintab[g]; s = (int32_t)(s64 >> 23); }while(0); |
apply gain, 11-bit (3.8) fixed point, always negative but stored positive. More... | |
#define | TONEGEN16(sn, f, sr, a) (int16_t)(sin((6.28318530718 * (sn) * (f)) /(sr)) * (a) * 0x7fff) |
tone generator: sample_number, frequency, sample_rate, amplitude More... | |
#define | HDCD_ANA_OFF_DESC "disabled" |
analyze mode descriptions: macro for AVOption definitions, array of const char for mapping mode to string More... | |
#define | HDCD_ANA_LLE_DESC "gain adjustment level at each sample" |
#define | HDCD_ANA_PE_DESC "samples where peak extend occurs" |
#define | HDCD_ANA_CDT_DESC "samples where the code detect timer is active" |
#define | HDCD_ANA_TGM_DESC "samples where the target gain does not match between channels" |
#define | OFFSET(x) offsetof(HDCDContext, x) |
#define | A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM |
Enumerations | |
enum | hdcd_pe { HDCD_PE_NEVER = 0, HDCD_PE_INTERMITTENT = 1, HDCD_PE_PERMANENT = 2 } |
enum | hdcd_dv { HDCD_NONE = 0, HDCD_NO_EFFECT = 1, HDCD_EFFECTUAL = 2 } |
enum | hdcd_pf { HDCD_PVER_NONE = 0, HDCD_PVER_A = 1, HDCD_PVER_B = 2, HDCD_PVER_MIX = 3 } |
enum | hdcd_ana_mode { HDCD_ANA_OFF = 0, HDCD_ANA_LLE = 1, HDCD_ANA_PE = 2, HDCD_ANA_CDT = 3, HDCD_ANA_TGM = 4, HDCD_ANA_TOP = 5 } |
enum | hdcd_control_result { HDCD_OK =0, HDCD_TG_MISMATCH } |
Functions | |
AVFILTER_DEFINE_CLASS (hdcd) | |
static void | hdcd_reset (hdcd_state *state, unsigned rate, unsigned cdt_ms) |
static int | hdcd_integrate (HDCDContext *ctx, hdcd_state *states, int channels, int *flag, const int32_t *samples, int count, int stride) |
static int | hdcd_scan (HDCDContext *ctx, hdcd_state *states, int channels, const int32_t *samples, int max, int stride) |
static void | hdcd_analyze_prepare (hdcd_state *state, int32_t *samples, int count, int stride) |
replace audio with solid tone, but save LSBs More... | |
static int32_t | hdcd_analyze_gen (int32_t sample, unsigned int v, unsigned int maxv) |
encode a value in the given sample by adjusting the amplitude More... | |
static int | hdcd_analyze (int32_t *samples, int count, int stride, int gain, int target_gain, int extend, int mode, int cdt_active, int tg_mismatch) |
behaves like hdcd_envelope(), but encodes processing information in a way that is audible (and visible in an audio editor) to aid analysis. More... | |
static int | hdcd_envelope (int32_t *samples, int count, int stride, int vbits, int gain, int target_gain, int extend) |
apply HDCD decoding parameters to a series of samples More... | |
static void | hdcd_control (HDCDContext *ctx, hdcd_state *state, int *peak_extend, int *target_gain) |
extract fields from control code More... | |
static hdcd_control_result | hdcd_control_stereo (HDCDContext *ctx, int *peak_extend0, int *peak_extend1) |
static void | hdcd_process (HDCDContext *ctx, hdcd_state *state, int32_t *samples, int count, int stride) |
static void | hdcd_process_stereo (HDCDContext *ctx, int32_t *samples, int count) |
static void | hdcd_detect_reset (hdcd_detection_data *detect) |
static void | hdcd_detect_start (hdcd_detection_data *detect) |
static void | hdcd_detect_onech (hdcd_state *state, hdcd_detection_data *detect) |
static void | hdcd_detect_end (hdcd_detection_data *detect, int channels) |
static int | filter_frame (AVFilterLink *inlink, AVFrame *in) |
static int | query_formats (AVFilterContext *ctx) |
static av_cold void | uninit (AVFilterContext *ctx) |
static av_cold int | init (AVFilterContext *ctx) |
static int | config_input (AVFilterLink *inlink) |
Variables | |
static const uint32_t | peaktab [0x2680] |
static const uint8_t | readaheadtab [] |
static const int32_t | gaintab [] |
static const char *const | pe_str [] |
static const char *const | pf_str [] |
static const char *const | ana_mode_str [] |
static const AVOption | hdcd_options [] |
static const AVFilterPad | avfilter_af_hdcd_inputs [] |
const AVFilter | ff_af_hdcd |
HDCD decoding filter
Definition in file af_hdcd.c.
#define PEAK_EXT_LEVEL 0x5981 /* + sizeof(peaktab)-1 = 0x8000 */ |
#define HDCD_ANA_OFF_DESC "disabled" |
#define HDCD_ANA_PE_DESC "samples where peak extend occurs" |
#define OFFSET | ( | x | ) | offsetof(HDCDContext, x) |
enum hdcd_pe |
enum hdcd_dv |
enum hdcd_pf |
enum hdcd_ana_mode |
enum hdcd_control_result |
AVFILTER_DEFINE_CLASS | ( | hdcd | ) |
|
static |
Definition at line 1014 of file af_hdcd.c.
Referenced by config_input().
|
static |
Definition at line 1043 of file af_hdcd.c.
Referenced by hdcd_scan().
|
static |
Definition at line 1128 of file af_hdcd.c.
Referenced by hdcd_process(), and hdcd_process_stereo().
|
static |
replace audio with solid tone, but save LSBs
Definition at line 1180 of file af_hdcd.c.
Referenced by hdcd_process(), and hdcd_process_stereo().
encode a value in the given sample by adjusting the amplitude
Definition at line 1198 of file af_hdcd.c.
Referenced by hdcd_analyze().
|
static |
behaves like hdcd_envelope(), but encodes processing information in a way that is audible (and visible in an audio editor) to aid analysis.
Definition at line 1208 of file af_hdcd.c.
Referenced by hdcd_process(), and hdcd_process_stereo().
|
static |
apply HDCD decoding parameters to a series of samples
Definition at line 1268 of file af_hdcd.c.
Referenced by hdcd_process(), and hdcd_process_stereo().
|
static |
extract fields from control code
Definition at line 1337 of file af_hdcd.c.
Referenced by hdcd_control_stereo(), and hdcd_process().
|
static |
Definition at line 1348 of file af_hdcd.c.
Referenced by hdcd_process_stereo().
|
static |
Definition at line 1367 of file af_hdcd.c.
Referenced by filter_frame().
|
static |
Definition at line 1408 of file af_hdcd.c.
Referenced by filter_frame().
|
static |
Definition at line 1473 of file af_hdcd.c.
Referenced by config_input().
|
static |
Definition at line 1485 of file af_hdcd.c.
Referenced by filter_frame().
|
static |
Definition at line 1492 of file af_hdcd.c.
Referenced by filter_frame().
|
static |
Definition at line 1518 of file af_hdcd.c.
Referenced by filter_frame().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 55 of file af_hdcd.c.
Referenced by hdcd_envelope().
|
static |
Definition at line 674 of file af_hdcd.c.
Referenced by hdcd_integrate().
|
static |
|
static |
|
static |
Definition at line 937 of file af_hdcd.c.
Referenced by config_input().
|
static |
|
static |
const AVFilter ff_af_hdcd |