| 1 | /* Copyright (c) 2017 Google Inc. |
| 2 | Written by Andrew Allen */ |
| 3 | /* |
| 4 | Redistribution and use in source and binary forms, with or without |
| 5 | modification, are permitted provided that the following conditions |
| 6 | are met: |
| 7 | |
| 8 | - Redistributions of source code must retain the above copyright |
| 9 | notice, this list of conditions and the following disclaimer. |
| 10 | |
| 11 | - Redistributions in binary form must reproduce the above copyright |
| 12 | notice, this list of conditions and the following disclaimer in the |
| 13 | documentation and/or other materials provided with the distribution. |
| 14 | |
| 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 16 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER |
| 19 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | */ |
| 27 | |
| 28 | /** |
| 29 | * @file mapping_matrix.h |
| 30 | * @brief Opus reference implementation mapping matrix API |
| 31 | */ |
| 32 | |
| 33 | #ifndef MAPPING_MATRIX_H |
| 34 | #define MAPPING_MATRIX_Hcxx . . $ `external/opusfile/opus/mapping_matrix.h:34:9`! |
| 35 | |
| 36 | #include "opus_types.h"cxx . . $ `<file>/external/opusfile/opus/opus_types.h`/ |
| 37 | #include "opus_projection.h"cxx . . $ `<file>/external/opusfile/opus/opus_projection.h`/ |
| 38 | |
| 39 | #ifdef __cplusplus |
| 40 | extern "C" { |
| 41 | #endif |
| 42 | |
| 43 | typedef struct MappingMatrixcxx . . $ MappingMatrix# |
| 44 | { |
| 45 | int rowscxx . . $ MappingMatrix#rows.; /* number of channels outputted from matrix. */ |
| 46 | int colscxx . . $ MappingMatrix#cols.; /* number of channels inputted to matrix. */ |
| 47 | int gaincxx . . $ MappingMatrix#gain.; /* in dB. S7.8-format. */ |
| 48 | /* Matrix cell data goes here using col-wise ordering. */ |
| 49 | } MappingMatrixcxx . . $ MappingMatrix#; |
| 50 | |
| 51 | opus_int32cxx . . $ opus_int32# mapping_matrix_get_sizecxx . . $ mapping_matrix_get_size(9b79fb6aee4c0440).(int rows, int cols); |
| 52 | |
| 53 | opus_int16cxx . . $ opus_int16# *mapping_matrix_get_datacxx . . $ mapping_matrix_get_data(68e41946706b2694).(const MappingMatrixcxx . . $ MappingMatrix# *matrix); |
| 54 | |
| 55 | void mapping_matrix_initcxx . . $ mapping_matrix_init(b26ad01c8c953b40).( |
| 56 | MappingMatrixcxx . . $ MappingMatrix# * const matrix, |
| 57 | int rows, |
| 58 | int cols, |
| 59 | int gain, |
| 60 | const opus_int16cxx . . $ opus_int16# *data, |
| 61 | opus_int32cxx . . $ opus_int32# data_size |
| 62 | ); |
| 63 | |
| 64 | #ifndef DISABLE_FLOAT_API |
| 65 | void mapping_matrix_multiply_channel_in_floatcxx . . $ mapping_matrix_multiply_channel_in_float(c3f65f9e24d0978).( |
| 66 | const MappingMatrixcxx . . $ MappingMatrix# *matrix, |
| 67 | const float *input, |
| 68 | int input_rows, |
| 69 | opus_val16cxx . . $ opus_val16# *output, |
| 70 | int output_row, |
| 71 | int output_rows, |
| 72 | int frame_size |
| 73 | ); |
| 74 | |
| 75 | void mapping_matrix_multiply_channel_out_floatcxx . . $ mapping_matrix_multiply_channel_out_float(eabe7c3f24c9ff99).( |
| 76 | const MappingMatrixcxx . . $ MappingMatrix# *matrix, |
| 77 | const opus_val16cxx . . $ opus_val16# *input, |
| 78 | int input_row, |
| 79 | int input_rows, |
| 80 | float *output, |
| 81 | int output_rows, |
| 82 | int frame_size |
| 83 | ); |
| 84 | #endif /* DISABLE_FLOAT_API */ |
| 85 | |
| 86 | void mapping_matrix_multiply_channel_in_shortcxx . . $ mapping_matrix_multiply_channel_in_short(4d4cc9786fd6e815).( |
| 87 | const MappingMatrixcxx . . $ MappingMatrix# *matrix, |
| 88 | const opus_int16cxx . . $ opus_int16# *input, |
| 89 | int input_rows, |
| 90 | opus_val16cxx . . $ opus_val16# *output, |
| 91 | int output_row, |
| 92 | int output_rows, |
| 93 | int frame_size |
| 94 | ); |
| 95 | |
| 96 | void mapping_matrix_multiply_channel_out_shortcxx . . $ mapping_matrix_multiply_channel_out_short(6cc3c4edd9529397).( |
| 97 | const MappingMatrixcxx . . $ MappingMatrix# *matrix, |
| 98 | const opus_val16cxx . . $ opus_val16# *input, |
| 99 | int input_row, |
| 100 | int input_rows, |
| 101 | opus_int16cxx . . $ opus_int16# *output, |
| 102 | int output_rows, |
| 103 | int frame_size |
| 104 | ); |
| 105 | |
| 106 | /* Pre-computed mixing and demixing matrices for 1st to 3rd-order ambisonics. |
| 107 | * foa: first-order ambisonics |
| 108 | * soa: second-order ambisonics |
| 109 | * toa: third-order ambisonics |
| 110 | */ |
| 111 | extern const MappingMatrixcxx . . $ MappingMatrix# mapping_matrix_foa_mixingcxx . . $ mapping_matrix_foa_mixing.; |
| 112 | extern const opus_int16cxx . . $ opus_int16# mapping_matrix_foa_mixing_datacxx . . $ mapping_matrix_foa_mixing_data.[36]; |
| 113 | |
| 114 | extern const MappingMatrixcxx . . $ MappingMatrix# mapping_matrix_soa_mixingcxx . . $ mapping_matrix_soa_mixing.; |
| 115 | extern const opus_int16cxx . . $ opus_int16# mapping_matrix_soa_mixing_datacxx . . $ mapping_matrix_soa_mixing_data.[121]; |
| 116 | |
| 117 | extern const MappingMatrixcxx . . $ MappingMatrix# mapping_matrix_toa_mixingcxx . . $ mapping_matrix_toa_mixing.; |
| 118 | extern const opus_int16cxx . . $ opus_int16# mapping_matrix_toa_mixing_datacxx . . $ mapping_matrix_toa_mixing_data.[324]; |
| 119 | |
| 120 | extern const MappingMatrixcxx . . $ MappingMatrix# mapping_matrix_foa_demixingcxx . . $ mapping_matrix_foa_demixing.; |
| 121 | extern const opus_int16cxx . . $ opus_int16# mapping_matrix_foa_demixing_datacxx . . $ mapping_matrix_foa_demixing_data.[36]; |
| 122 | |
| 123 | extern const MappingMatrixcxx . . $ MappingMatrix# mapping_matrix_soa_demixingcxx . . $ mapping_matrix_soa_demixing.; |
| 124 | extern const opus_int16cxx . . $ opus_int16# mapping_matrix_soa_demixing_datacxx . . $ mapping_matrix_soa_demixing_data.[121]; |
| 125 | |
| 126 | extern const MappingMatrixcxx . . $ MappingMatrix# mapping_matrix_toa_demixingcxx . . $ mapping_matrix_toa_demixing.; |
| 127 | extern const opus_int16cxx . . $ opus_int16# mapping_matrix_toa_demixing_datacxx . . $ mapping_matrix_toa_demixing_data.[324]; |
| 128 | |
| 129 | #ifdef __cplusplus |
| 130 | } |
| 131 | #endif |
| 132 | |
| 133 | #endif /* MAPPING_MATRIX_H */ |