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
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2013-06-13 23:06:42 +0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2013-06-13 23:06:42 +0400
commit204e70d9fa9cce8d890224690230d58f46ed2348 (patch)
tree1c5881c01cf1c6f07d94dc9cedeb3b131908314c
parent28733d1281b9fde5561a2f5747179c841ef24944 (diff)
Adds a quick hack to replace the normal calls with the multistream version.
-rw-r--r--src/opus_demo.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/opus_demo.c b/src/opus_demo.c
index 4c644022..3709c3af 100644
--- a/src/opus_demo.c
+++ b/src/opus_demo.c
@@ -38,6 +38,7 @@
#include "debug.h"
#include "opus_types.h"
#include "opus_private.h"
+#include "opus_multistream.h"
#define MAX_PACKET 1500
@@ -193,6 +194,35 @@ static const int celt_hq_test[][4] = {
{MODE_CELT_ONLY, OPUS_BANDWIDTH_FULLBAND, 120, 2},
};
+#if 0 /* This is a hack that replaces the normal encoder/decoder with the multistream version */
+#define OpusEncoder OpusMSEncoder
+#define OpusDecoder OpusMSDecoder
+#define opus_encode opus_multistream_encode
+#define opus_decode opus_multistream_decode
+#define opus_encoder_ctl opus_multistream_encoder_ctl
+#define opus_decoder_ctl opus_multistream_decoder_ctl
+#define opus_encoder_create ms_opus_encoder_create
+#define opus_decoder_create ms_opus_decoder_create
+#define opus_encoder_destroy opus_multistream_encoder_destroy
+#define opus_decoder_destroy opus_multistream_decoder_destroy
+
+static OpusEncoder *ms_opus_encoder_create(opus_int32 Fs, int channels, int application, int *error)
+{
+ int streams, coupled_streams;
+ unsigned char mapping[256];
+ return (OpusEncoder *)opus_multistream_surround_encoder_create(Fs, channels, 1, &streams, &coupled_streams, mapping, application, error);
+}
+static OpusDecoder *ms_opus_decoder_create(opus_int32 Fs, int channels, int *error)
+{
+ int streams;
+ int coupled_streams;
+ unsigned char mapping[256]={0,1};
+ streams = 1;
+ coupled_streams = channels==2;
+ return (OpusDecoder *)opus_multistream_decoder_create(Fs, channels, streams, coupled_streams, mapping, error);
+}
+#endif
+
int main(int argc, char *argv[])
{
int err;