xine-lib: xine-lib-1.2.13/src/post/audio/upmix.c File Reference

xine-lib 1.2.13-20230125hg15249

Data Structures | Macros | Typedefs | Functions | Variables
upmix.c File Reference
`#include <stdio.h>`
`#include <pthread.h>`
`#include <xine/xine_internal.h>`
`#include <xine/xineutils.h>`
`#include <xine/post.h>`
`#include "dsp.h"`
`#include "audio_filters.h"`

## Data Structures
struct | biquad_t
struct | af_sub_s
struct | upmix_parameters_s

## Macros
#define | Q 1.0
#define | IIR(in, w, q, out)

## Typedefs
typedef struct post_plugin_upmix_s | post_plugin_upmix_t
typedef struct af_sub_s | af_sub_t
typedef struct upmix_parameters_s | upmix_parameters_t

## Functions
| PARAM_ITEM (POST_PARAM_TYPE_INT, cut_off_freq, NULL, 0, 500, 0, "cut_off_freq")
static int | set_parameters (xine_post_t *this_gen, const void *param_gen)
static int | get_parameters (xine_post_t *this_gen, void *param_gen)
static xine_post_api_descr_t * | get_param_descr (void)
static char * | get_help (void)
static int | upmix_port_open (xine_audio_port_t *port_gen, xine_stream_t *stream, uint32_t bits, uint32_t rate, int mode)
static int | upmix_frames_2to51_any_to_float (uint8_t *dst8, uint8_t *src8, int num_frames, int step_channel_in, af_sub_t *sub)
static void | upmix_port_put_buffer (xine_audio_port_t *port_gen, audio_buffer_t *buf, xine_stream_t *stream)
static void | upmix_dispose (post_plugin_t *this_gen)
static post_plugin_t * | upmix_open_plugin (post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target)
void * | upmix_init_plugin (xine_t *xine, const void *data)

## Variables
static const biquad_t | s_param [2]

## Macro Definition Documentation

## ◆ IIR

#define IIR | ( |  | in,
|  |  | w,
|  |  | q,
|  |  | out )

Value:
{ \
float h0 = (q)[0]; \
float h1 = (q)[1]; \
float hn = (in) - h0 * (w)[0] - h1 * (w)[1]; \
out = hn + h0 * (w)[2] + h1 * (w)[3]; \
(q)[1] = h0; \
(q)[0] = hn; \
}

Referenced by upmix_frames_2to51_any_to_float().

## ◆ Q

#define Q 1.0

Referenced by szxform(), upmix_port_open(), and upmix_port_put_buffer().

## Typedef Documentation

## ◆ af_sub_t

typedef struct af_sub_s af_sub_t

## ◆ post_plugin_upmix_t

typedef struct post_plugin_upmix_s post_plugin_upmix_t

## ◆ upmix_parameters_t

typedef struct upmix_parameters_s upmix_parameters_t

## Function Documentation

## ◆ get_help()

static char * get_help | ( | void |  | ) |
| static

References _.

Referenced by upmix_open_plugin().

## ◆ get_param_descr()

static xine_post_api_descr_t * get_param_descr | ( | void |  | ) |
| static

Referenced by upmix_open_plugin().

## ◆ get_parameters()

static int get_parameters | ( | xine_post_t * | this_gen,
|  | void * | param_gen )
| static

Referenced by upmix_open_plugin().

## ◆ PARAM_ITEM()

PARAM_ITEM | ( | POST_PARAM_TYPE_INT | ,
|  | cut_off_freq | ,
|  | NULL | ,
|  | 0 | ,
|  | 500 | ,
|  | 0 | ,
|  | "cut_off_freq" | )

## ◆ set_parameters()

static int set_parameters | ( | xine_post_t * | this_gen,
|  | const void * | param_gen )
| static

Referenced by upmix_open_plugin().

## ◆ upmix_dispose()

static void upmix_dispose | ( | post_plugin_t * | this_gen | ) |
| static

References _x_freep(), and _x_post_dispose().

Referenced by upmix_open_plugin().

## ◆ upmix_frames_2to51_any_to_float()

static int upmix_frames_2to51_any_to_float | ( | uint8_t * | dst8,
|  | uint8_t * | src8,
|  | int | num_frames,
|  | int | step_channel_in,
|  | af_sub_t * | sub )
| static

References IIR, INT32_MAX, af_sub_s::k, af_sub_s::q, and af_sub_s::w.

Referenced by upmix_port_put_buffer().

## ◆ upmix_init_plugin()

void * upmix_init_plugin | ( | xine_t * | xine,
|  | const void * | data )

References post_plugin_s::dispose, N_, NULL, post_class_s::open_plugin, and upmix_open_plugin().

## ◆ upmix_open_plugin()

static post_plugin_t * upmix_open_plugin | ( | post_class_t * | class_gen,
|  | int | inputs,
|  | xine_audio_port_t ** | audio_target,
|  | xine_video_port_t ** | video_target )
| static

References _x_post_init(), _x_post_intercept_audio_port(), xine_audio_port_s::close, get_help(), get_param_descr(), get_parameters(), input(), xine_post_in_s::name, post_audio_port_s::new_port, NULL, xine_audio_port_s::open, xine_audio_port_s::put_buffer, set_parameters(), xine_post_api_t::set_parameters, upmix_dispose(), upmix_port_open(), upmix_port_put_buffer(), xine_list_push_back(), and XINE_POST_DATA_PARAMETERS.

Referenced by upmix_init_plugin().

## ◆ upmix_port_open()

static int upmix_port_open | ( | xine_audio_port_t * | port_gen,
|  | xine_stream_t * | stream,
|  | uint32_t | bits,
|  | uint32_t | rate,
|  | int | mode )
| static

References _x_ao_mode2channels(), _x_freep(), _x_post_inc_usage, _x_post_rewire(), AO_CAP_FLOAT32, AO_CAP_MODE_5_1CHANNEL, bits, post_audio_port_s::bits, xine_audio_port_s::get_capabilities, mode(), post_audio_port_s::mode, xine_audio_port_s::open, post_audio_port_s::original_port, post_audio_port_s::post, Q, post_audio_port_s::rate, s_param, post_audio_port_s::stream, and szxform().

Referenced by upmix_open_plugin().

## ◆ upmix_port_put_buffer()

static void upmix_port_put_buffer | ( | xine_audio_port_t * | port_gen,
|  | audio_buffer_t * | buf,
|  | xine_stream_t * | stream )
| static

References _x_extra_info_merge(), AO_CAP_MODE_5_1CHANNEL, ao_format_s::bits, post_audio_port_s::bits, audio_buffer_s::extra_info, audio_buffer_s::first_access_unit, audio_buffer_s::format, audio_buffer_s::frame_header_count, xine_audio_port_s::get_buffer, audio_buffer_s::mem, audio_buffer_s::mem_size, ao_format_s::mode, audio_buffer_s::num_frames, post_audio_port_s::original_port, post_audio_port_s::post, xine_audio_port_s::put_buffer, Q, ao_format_s::rate, post_audio_port_s::rate, s_param, szxform(), upmix_frames_2to51_any_to_float(), and audio_buffer_s::vpts.

Referenced by upmix_open_plugin().

## Variable Documentation

## ◆ s_param

const biquad_t s_param[2]
| static

Initial value:
= {{{1.0,0.0,0.0},{1.0,0.765367,1.0}},
{{1.0,0.0,0.0},{1.0,1.847759,1.0}}}

Referenced by upmix_port_open(), and upmix_port_put_buffer().