Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2018-07-26 19:06:35 +0300
committerJean-Marc Valin <jmvalin@jmvalin.ca>2018-07-27 02:49:35 +0300
commit722a66b84becd0907f0bb4f6f80d17dbc04eb5e6 (patch)
tree69bb2a713f5f823204f5a144df56c5a3d1810f69 /src
parentac044500cc3ad39f9b0795cec08106124d705564 (diff)
Remove ambisonics experimental flag
Diffstat (limited to 'src')
-rw-r--r--src/mapping_matrix.c3
-rw-r--r--src/mapping_matrix.h4
-rw-r--r--src/opus_multistream_encoder.c16
-rw-r--r--src/opus_private.h5
-rw-r--r--src/opus_projection_decoder.c104
-rw-r--r--src/opus_projection_encoder.c92
6 files changed, 1 insertions, 223 deletions
diff --git a/src/mapping_matrix.c b/src/mapping_matrix.c
index f9821f7e..31298af0 100644
--- a/src/mapping_matrix.c
+++ b/src/mapping_matrix.c
@@ -35,8 +35,6 @@
#include "opus_defines.h"
#include "mapping_matrix.h"
-#ifdef ENABLE_EXPERIMENTAL_AMBISONICS
-
#define MATRIX_INDEX(nb_rows, row, col) (nb_rows * col + row)
opus_int32 mapping_matrix_get_size(int rows, int cols)
@@ -378,4 +376,3 @@ const opus_int16 mapping_matrix_toa_demixing_data[324] = {
0, 0, 0, 32767
};
-#endif /* ENABLE_EXPERIMENTAL_AMBISONICS */
diff --git a/src/mapping_matrix.h b/src/mapping_matrix.h
index 86451688..9c20483e 100644
--- a/src/mapping_matrix.h
+++ b/src/mapping_matrix.h
@@ -33,8 +33,6 @@
#ifndef MAPPING_MATRIX_H
#define MAPPING_MATRIX_H
-#ifdef ENABLE_EXPERIMENTAL_AMBISONICS
-
#include "opus_types.h"
#include "opus_projection.h"
@@ -132,6 +130,4 @@ extern const opus_int16 mapping_matrix_toa_demixing_data[324];
}
#endif
-#endif /* ENABLE_EXPERIMENTAL_AMBISONICS */
-
#endif /* MAPPING_MATRIX_H */
diff --git a/src/opus_multistream_encoder.c b/src/opus_multistream_encoder.c
index 09a84b2e..52fd27e2 100644
--- a/src/opus_multistream_encoder.c
+++ b/src/opus_multistream_encoder.c
@@ -101,7 +101,6 @@ static opus_val32 *ms_get_window_mem(OpusMSEncoder *st)
return (opus_val32*)(void*)ptr;
}
-#ifdef ENABLE_EXPERIMENTAL_AMBISONICS
static int validate_ambisonics(int nb_channels, int *nb_streams, int *nb_coupled_streams)
{
int order_plus_one;
@@ -124,7 +123,6 @@ static int validate_ambisonics(int nb_channels, int *nb_streams, int *nb_coupled
*nb_coupled_streams = nondiegetic_channels != 0;
return 1;
}
-#endif
static int validate_encoder_layout(const ChannelLayout *layout)
{
@@ -414,12 +412,10 @@ opus_int32 opus_multistream_surround_encoder_get_size(int channels, int mapping_
{
nb_streams=channels;
nb_coupled_streams=0;
-#ifdef ENABLE_EXPERIMENTAL_AMBISONICS
} else if (mapping_family==2)
{
if (!validate_ambisonics(channels, &nb_streams, &nb_coupled_streams))
return 0;
-#endif
} else
return 0;
size = opus_multistream_encoder_get_size(nb_streams, nb_coupled_streams);
@@ -466,11 +462,9 @@ static int opus_multistream_encoder_init_impl(
if (mapping_type == MAPPING_TYPE_SURROUND &&
!validate_encoder_layout(&st->layout))
return OPUS_BAD_ARG;
-#ifdef ENABLE_EXPERIMENTAL_AMBISONICS
if (mapping_type == MAPPING_TYPE_AMBISONICS &&
!validate_ambisonics(st->layout.nb_channels, NULL, NULL))
return OPUS_BAD_ARG;
-#endif
ptr = (char*)st + align(sizeof(OpusMSEncoder));
coupled_size = opus_encoder_get_size(2);
mono_size = opus_encoder_get_size(1);
@@ -562,7 +556,6 @@ int opus_multistream_surround_encoder_init(
*coupled_streams=0;
for(i=0;i<channels;i++)
mapping[i] = i;
-#ifdef ENABLE_EXPERIMENTAL_AMBISONICS
} else if (mapping_family==2)
{
int i;
@@ -572,17 +565,14 @@ int opus_multistream_surround_encoder_init(
mapping[i] = i + (*coupled_streams * 2);
for(i = 0; i < *coupled_streams * 2; i++)
mapping[i + (*streams - *coupled_streams)] = i;
-#endif
} else
return OPUS_UNIMPLEMENTED;
if (channels>2 && mapping_family==1) {
mapping_type = MAPPING_TYPE_SURROUND;
-#ifdef ENABLE_EXPERIMENTAL_AMBISONICS
} else if (mapping_family==2)
{
mapping_type = MAPPING_TYPE_AMBISONICS;
-#endif
} else
{
mapping_type = MAPPING_TYPE_NONE;
@@ -743,7 +733,6 @@ static void surround_rate_allocation(
}
}
-#ifdef ENABLE_EXPERIMENTAL_AMBISONICS
static void ambisonics_rate_allocation(
OpusMSEncoder *st,
opus_int32 *rate,
@@ -820,7 +809,6 @@ static void ambisonics_rate_allocation(
}
}
}
-#endif /* ENABLE_EXPERIMENTAL_AMBISONICS */
static opus_int32 rate_allocation(
OpusMSEncoder *st,
@@ -836,11 +824,9 @@ static opus_int32 rate_allocation(
ptr = (char*)st + align(sizeof(OpusMSEncoder));
opus_encoder_ctl((OpusEncoder*)ptr, OPUS_GET_SAMPLE_RATE(&Fs));
-#ifdef ENABLE_EXPERIMENTAL_AMBISONICS
if (st->mapping_type == MAPPING_TYPE_AMBISONICS) {
ambisonics_rate_allocation(st, rate, frame_size, Fs);
} else
-#endif
{
surround_rate_allocation(st, rate, frame_size, Fs);
}
@@ -973,11 +959,9 @@ int opus_multistream_encode_native
opus_encoder_ctl(enc, OPUS_SET_FORCE_CHANNELS(2));
}
}
-#ifdef ENABLE_EXPERIMENTAL_AMBISONICS
else if (st->mapping_type == MAPPING_TYPE_AMBISONICS) {
opus_encoder_ctl(enc, OPUS_SET_FORCE_MODE(MODE_CELT_ONLY));
}
-#endif
}
ptr = (char*)st + align(sizeof(OpusMSEncoder));
diff --git a/src/opus_private.h b/src/opus_private.h
index 193ff938..09783cee 100644
--- a/src/opus_private.h
+++ b/src/opus_private.h
@@ -53,11 +53,8 @@ typedef struct ChannelLayout {
typedef enum {
MAPPING_TYPE_NONE,
- MAPPING_TYPE_SURROUND
-#ifdef ENABLE_EXPERIMENTAL_AMBISONICS
- , /* Do not include comma at end of enumerator list */
+ MAPPING_TYPE_SURROUND,
MAPPING_TYPE_AMBISONICS
-#endif /* ENABLE_EXPERIMENTAL_AMBISONICS */
} MappingType;
struct OpusMSEncoder {
diff --git a/src/opus_projection_decoder.c b/src/opus_projection_decoder.c
index 1ccd8b72..3538b78f 100644
--- a/src/opus_projection_decoder.c
+++ b/src/opus_projection_decoder.c
@@ -38,8 +38,6 @@
#include "mapping_matrix.h"
#include "stack_alloc.h"
-#ifdef ENABLE_EXPERIMENTAL_AMBISONICS
-
struct OpusProjectionDecoder
{
opus_int32 demixing_matrix_size_in_bytes;
@@ -258,105 +256,3 @@ void opus_projection_decoder_destroy(OpusProjectionDecoder *st)
opus_free(st);
}
-#else /* ENABLE_EXPERIMENTAL_AMBISONICS */
-
-opus_int32 opus_projection_decoder_get_size(
- int channels,
- int streams,
- int coupled_streams)
-{
- (void)channels;
- (void)streams;
- (void)coupled_streams;
- return OPUS_UNIMPLEMENTED;
-}
-
-OpusProjectionDecoder *opus_projection_decoder_create(
- opus_int32 Fs,
- int channels,
- int streams,
- int coupled_streams,
- unsigned char *demixing_matrix,
- opus_int32 demixing_matrix_size,
- int *error)
-{
- (void)Fs;
- (void)channels;
- (void)streams;
- (void)coupled_streams;
- (void)demixing_matrix;
- (void)demixing_matrix_size;
- if (error) *error = OPUS_UNIMPLEMENTED;
- return NULL;
-}
-
-int opus_projection_decoder_init(
- OpusProjectionDecoder *st,
- opus_int32 Fs,
- int channels,
- int streams,
- int coupled_streams,
- unsigned char *demixing_matrix,
- opus_int32 demixing_matrix_size)
-{
- (void)st;
- (void)Fs;
- (void)channels;
- (void)streams;
- (void)coupled_streams;
- (void)demixing_matrix;
- (void)demixing_matrix_size;
- return OPUS_UNIMPLEMENTED;
-}
-
-int opus_projection_decode(
- OpusProjectionDecoder *st,
- const unsigned char *data,
- opus_int32 len,
- opus_int16 *pcm,
- int frame_size,
- int decode_fec)
-{
- (void)st;
- (void)data;
- (void)len;
- (void)pcm;
- (void)frame_size;
- (void)decode_fec;
- return OPUS_UNIMPLEMENTED;
-}
-
-int opus_projection_decode_float(
- OpusProjectionDecoder *st,
- const unsigned char *data,
- opus_int32 len,
- float *pcm,
- int frame_size,
- int decode_fec)
-{
- (void)st;
- (void)data;
- (void)len;
- (void)pcm;
- (void)frame_size;
- (void)decode_fec;
- return OPUS_UNIMPLEMENTED;
-}
-
-int opus_projection_decoder_ctl(
- OpusProjectionDecoder *st,
- int request,
- ...)
-{
- (void)st;
- (void)request;
- return OPUS_UNIMPLEMENTED;
-}
-
-void opus_projection_decoder_destroy(
- OpusProjectionDecoder *st)
-{
- (void)st;
-}
-
-#endif /* ENABLE_EXPERIMENTAL_AMBISONICS */
diff --git a/src/opus_projection_encoder.c b/src/opus_projection_encoder.c
index 5dfb4cfd..1c2d0024 100644
--- a/src/opus_projection_encoder.c
+++ b/src/opus_projection_encoder.c
@@ -38,8 +38,6 @@
#include "stack_alloc.h"
#include "mapping_matrix.h"
-#ifdef ENABLE_EXPERIMENTAL_AMBISONICS
-
struct OpusProjectionEncoder
{
opus_int32 mixing_matrix_size_in_bytes;
@@ -468,93 +466,3 @@ bad_arg:
return OPUS_BAD_ARG;
}
-#else /* ENABLE_EXPERIMENTAL_AMBISONICS */
-
-opus_int32 opus_projection_ambisonics_encoder_get_size(
- int channels, int mapping_family)
-{
- (void)channels;
- (void)mapping_family;
- return OPUS_UNIMPLEMENTED;
-}
-
-OpusProjectionEncoder *opus_projection_ambisonics_encoder_create(
- opus_int32 Fs, int channels, int mapping_family, int *streams,
- int *coupled_streams, int application, int *error)
-{
- (void)Fs;
- (void)channels;
- (void)mapping_family;
- (void)streams;
- (void)coupled_streams;
- (void)application;
- if (error) *error = OPUS_UNIMPLEMENTED;
- return NULL;
-}
-
-int opus_projection_ambisonics_encoder_init(
- OpusProjectionEncoder *st,
- opus_int32 Fs,
- int channels,
- int mapping_family,
- int *streams,
- int *coupled_streams,
- int application)
-{
- (void)st;
- (void)Fs;
- (void)channels;
- (void)mapping_family;
- (void)streams;
- (void)coupled_streams;
- (void)application;
- return OPUS_UNIMPLEMENTED;
-}
-
-int opus_projection_encode(
- OpusProjectionEncoder *st,
- const opus_int16 *pcm,
- int frame_size,
- unsigned char *data,
- opus_int32 max_data_bytes)
-{
- (void)st;
- (void)pcm;
- (void)frame_size;
- (void)data;
- (void)max_data_bytes;
- return OPUS_UNIMPLEMENTED;
-}
-
-int opus_projection_encode_float(
- OpusProjectionEncoder *st,
- const float *pcm,
- int frame_size,
- unsigned char *data,
- opus_int32 max_data_bytes)
-{
- (void)st;
- (void)pcm;
- (void)frame_size;
- (void)data;
- (void)max_data_bytes;
- return OPUS_UNIMPLEMENTED;
-}
-
-void opus_projection_encoder_destroy(
- OpusProjectionEncoder *st)
-{
- (void)st;
-}
-
-int opus_projection_encoder_ctl(
- OpusProjectionEncoder *st,
- int request,
- ...)
-{
- (void)st;
- (void)request;
- return OPUS_UNIMPLEMENTED;
-}
-
-#endif /* ENABLE_EXPERIMENTAL_AMBISONICS */