annotate src/opus-1.3/silk/API.h @ 84:08ae793730bd

Add null config files
author Chris Cannam
date Mon, 02 Mar 2020 14:03:47 +0000
parents 7aeed7906520
children
rev   line source
Chris@69 1 /***********************************************************************
Chris@69 2 Copyright (c) 2006-2011, Skype Limited. All rights reserved.
Chris@69 3 Redistribution and use in source and binary forms, with or without
Chris@69 4 modification, are permitted provided that the following conditions
Chris@69 5 are met:
Chris@69 6 - Redistributions of source code must retain the above copyright notice,
Chris@69 7 this list of conditions and the following disclaimer.
Chris@69 8 - Redistributions in binary form must reproduce the above copyright
Chris@69 9 notice, this list of conditions and the following disclaimer in the
Chris@69 10 documentation and/or other materials provided with the distribution.
Chris@69 11 - Neither the name of Internet Society, IETF or IETF Trust, nor the
Chris@69 12 names of specific contributors, may be used to endorse or promote
Chris@69 13 products derived from this software without specific prior written
Chris@69 14 permission.
Chris@69 15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Chris@69 16 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Chris@69 17 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Chris@69 18 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
Chris@69 19 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
Chris@69 20 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
Chris@69 21 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Chris@69 22 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
Chris@69 23 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
Chris@69 24 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
Chris@69 25 POSSIBILITY OF SUCH DAMAGE.
Chris@69 26 ***********************************************************************/
Chris@69 27
Chris@69 28 #ifndef SILK_API_H
Chris@69 29 #define SILK_API_H
Chris@69 30
Chris@69 31 #include "control.h"
Chris@69 32 #include "typedef.h"
Chris@69 33 #include "errors.h"
Chris@69 34 #include "entenc.h"
Chris@69 35 #include "entdec.h"
Chris@69 36
Chris@69 37 #ifdef __cplusplus
Chris@69 38 extern "C"
Chris@69 39 {
Chris@69 40 #endif
Chris@69 41
Chris@69 42 #define SILK_MAX_FRAMES_PER_PACKET 3
Chris@69 43
Chris@69 44 /* Struct for TOC (Table of Contents) */
Chris@69 45 typedef struct {
Chris@69 46 opus_int VADFlag; /* Voice activity for packet */
Chris@69 47 opus_int VADFlags[ SILK_MAX_FRAMES_PER_PACKET ]; /* Voice activity for each frame in packet */
Chris@69 48 opus_int inbandFECFlag; /* Flag indicating if packet contains in-band FEC */
Chris@69 49 } silk_TOC_struct;
Chris@69 50
Chris@69 51 /****************************************/
Chris@69 52 /* Encoder functions */
Chris@69 53 /****************************************/
Chris@69 54
Chris@69 55 /***********************************************/
Chris@69 56 /* Get size in bytes of the Silk encoder state */
Chris@69 57 /***********************************************/
Chris@69 58 opus_int silk_Get_Encoder_Size( /* O Returns error code */
Chris@69 59 opus_int *encSizeBytes /* O Number of bytes in SILK encoder state */
Chris@69 60 );
Chris@69 61
Chris@69 62 /*************************/
Chris@69 63 /* Init or reset encoder */
Chris@69 64 /*************************/
Chris@69 65 opus_int silk_InitEncoder( /* O Returns error code */
Chris@69 66 void *encState, /* I/O State */
Chris@69 67 int arch, /* I Run-time architecture */
Chris@69 68 silk_EncControlStruct *encStatus /* O Encoder Status */
Chris@69 69 );
Chris@69 70
Chris@69 71 /**************************/
Chris@69 72 /* Encode frame with Silk */
Chris@69 73 /**************************/
Chris@69 74 /* Note: if prefillFlag is set, the input must contain 10 ms of audio, irrespective of what */
Chris@69 75 /* encControl->payloadSize_ms is set to */
Chris@69 76 opus_int silk_Encode( /* O Returns error code */
Chris@69 77 void *encState, /* I/O State */
Chris@69 78 silk_EncControlStruct *encControl, /* I Control status */
Chris@69 79 const opus_int16 *samplesIn, /* I Speech sample input vector */
Chris@69 80 opus_int nSamplesIn, /* I Number of samples in input vector */
Chris@69 81 ec_enc *psRangeEnc, /* I/O Compressor data structure */
Chris@69 82 opus_int32 *nBytesOut, /* I/O Number of bytes in payload (input: Max bytes) */
Chris@69 83 const opus_int prefillFlag, /* I Flag to indicate prefilling buffers no coding */
Chris@69 84 int activity /* I Decision of Opus voice activity detector */
Chris@69 85 );
Chris@69 86
Chris@69 87 /****************************************/
Chris@69 88 /* Decoder functions */
Chris@69 89 /****************************************/
Chris@69 90
Chris@69 91 /***********************************************/
Chris@69 92 /* Get size in bytes of the Silk decoder state */
Chris@69 93 /***********************************************/
Chris@69 94 opus_int silk_Get_Decoder_Size( /* O Returns error code */
Chris@69 95 opus_int *decSizeBytes /* O Number of bytes in SILK decoder state */
Chris@69 96 );
Chris@69 97
Chris@69 98 /*************************/
Chris@69 99 /* Init or Reset decoder */
Chris@69 100 /*************************/
Chris@69 101 opus_int silk_InitDecoder( /* O Returns error code */
Chris@69 102 void *decState /* I/O State */
Chris@69 103 );
Chris@69 104
Chris@69 105 /******************/
Chris@69 106 /* Decode a frame */
Chris@69 107 /******************/
Chris@69 108 opus_int silk_Decode( /* O Returns error code */
Chris@69 109 void* decState, /* I/O State */
Chris@69 110 silk_DecControlStruct* decControl, /* I/O Control Structure */
Chris@69 111 opus_int lostFlag, /* I 0: no loss, 1 loss, 2 decode fec */
Chris@69 112 opus_int newPacketFlag, /* I Indicates first decoder call for this packet */
Chris@69 113 ec_dec *psRangeDec, /* I/O Compressor data structure */
Chris@69 114 opus_int16 *samplesOut, /* O Decoded output speech vector */
Chris@69 115 opus_int32 *nSamplesOut, /* O Number of samples decoded */
Chris@69 116 int arch /* I Run-time architecture */
Chris@69 117 );
Chris@69 118
Chris@69 119 #if 0
Chris@69 120 /**************************************/
Chris@69 121 /* Get table of contents for a packet */
Chris@69 122 /**************************************/
Chris@69 123 opus_int silk_get_TOC(
Chris@69 124 const opus_uint8 *payload, /* I Payload data */
Chris@69 125 const opus_int nBytesIn, /* I Number of input bytes */
Chris@69 126 const opus_int nFramesPerPayload, /* I Number of SILK frames per payload */
Chris@69 127 silk_TOC_struct *Silk_TOC /* O Type of content */
Chris@69 128 );
Chris@69 129 #endif
Chris@69 130
Chris@69 131 #ifdef __cplusplus
Chris@69 132 }
Chris@69 133 #endif
Chris@69 134
Chris@69 135 #endif