File: mix.h

package info (click to toggle)
gavl 2.0.0~svn6298-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,808 kB
  • sloc: ansic: 465,657; makefile: 325; sh: 109
file content (74 lines) | stat: -rw-r--r-- 2,466 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*****************************************************************
 * gavl - a general purpose audio/video processing library
 *
 * Copyright (c) 2001 - 2012 Members of the Gmerlin project
 * gmerlin-general@lists.sourceforge.net
 * http://gmerlin.sourceforge.net
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * *****************************************************************/

typedef struct gavl_mix_output_channel_s gavl_mix_output_channel_t;

typedef void (*gavl_mix_func_t)(gavl_mix_output_channel_t * channel,
                                const gavl_audio_frame_t * input_frame,
                                gavl_audio_frame_t * output_frame);
                                
typedef struct
  {
  gavl_mix_func_t copy_func;
  gavl_mix_func_t mix_1_to_1;
  gavl_mix_func_t mix_2_to_1;
  gavl_mix_func_t mix_3_to_1;
  gavl_mix_func_t mix_4_to_1;
  gavl_mix_func_t mix_5_to_1;
  gavl_mix_func_t mix_6_to_1;
  gavl_mix_func_t mix_all_to_1;
  } gavl_mixer_table_t;

typedef struct gavl_mix_input_channel_s
  {
  int index; /* Which input channel */
  union      /* Weighing factor     */
    {
    double  f_float;
    int     f_int;
    } factor;
  } gavl_mix_input_channel_t;

struct gavl_mix_output_channel_s
  {
  int num_inputs;
  int index;
  gavl_mix_input_channel_t inputs[GAVL_MAX_CHANNELS];
  gavl_mix_func_t func;
  };

struct gavl_mix_matrix_s
  {
  gavl_mix_output_channel_t output_channels[GAVL_MAX_CHANNELS];
  gavl_mixer_table_t mixer_table;
  };

gavl_mix_matrix_t *
gavl_create_mix_matrix(gavl_audio_options_t * opt,
                       gavl_audio_format_t * in,
                       gavl_audio_format_t * out);

void gavl_destroy_mix_matrix(gavl_mix_matrix_t *);

void gavl_mix_audio(gavl_audio_convert_context_t * ctx);

void gavl_setup_mix_funcs_c(gavl_mixer_table_t * c,
                            gavl_audio_format_t * f);