chromium/third_party/opus/src/src/opus_demo.c

/* Copyright (c) 2007-2008 CSIRO
   Copyright (c) 2007-2009 Xiph.Org Foundation
   Written by Jean-Marc Valin */
/*
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:

   - Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.

   - Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.

   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
   OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "opus.h"
#include "debug.h"
#include "opus_types.h"
#include "opus_private.h"
#include "opus_multistream.h"

#define MAX_PACKET

void print_usage( char* argv[] )
{}

static void int_to_char(opus_uint32 i, unsigned char ch[4])
{}

static opus_uint32 char_to_int(unsigned char ch[4])
{}

#define check_encoder_option(decode_only, opt)

static const int silk8_test[][4] =;

static const int silk12_test[][4] =;

static const int silk16_test[][4] =;

static const int hybrid24_test[][4] =;

static const int hybrid48_test[][4] =;

static const int celt_test[][4] =;

static const int celt_hq_test[][4] =;

#if 0 /* This is a hack that replaces the normal encoder/decoder with the multistream version */
#define OpusEncoder
#define OpusDecoder
#define opus_encode
#define opus_decode
#define opus_encoder_ctl
#define opus_decoder_ctl
#define opus_encoder_create
#define opus_decoder_create
#define opus_encoder_destroy
#define opus_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[])
{}