Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: third_party/opus/src/silk/API.h

Issue 2195313002: Remove Opus from DEPS and import a local copy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Local copy of opus, opus/src/.gitignore, opus/DEPS, update README.chromium Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/opus/src/silk/A2NLSF.c ('k') | third_party/opus/src/silk/CNG.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /***********************************************************************
2 Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 Redistribution and use in source and binary forms, with or without
4 modification, are permitted provided that the following conditions
5 are met:
6 - Redistributions of source code must retain the above copyright notice,
7 this list of conditions and the following disclaimer.
8 - Redistributions in binary form must reproduce the above copyright
9 notice, this list of conditions and the following disclaimer in the
10 documentation and/or other materials provided with the distribution.
11 - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 names of specific contributors, may be used to endorse or promote
13 products derived from this software without specific prior written
14 permission.
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 POSSIBILITY OF SUCH DAMAGE.
26 ***********************************************************************/
27
28 #ifndef SILK_API_H
29 #define SILK_API_H
30
31 #include "control.h"
32 #include "typedef.h"
33 #include "errors.h"
34 #include "entenc.h"
35 #include "entdec.h"
36
37 #ifdef __cplusplus
38 extern "C"
39 {
40 #endif
41
42 #define SILK_MAX_FRAMES_PER_PACKET 3
43
44 /* Struct for TOC (Table of Contents) */
45 typedef struct {
46 opus_int VADFlag; /* Voice activity for pa cket */
47 opus_int VADFlags[ SILK_MAX_FRAMES_PER_PACKET ]; /* Voice activity for ea ch frame in packet */
48 opus_int inbandFECFlag; /* Flag indicating if pa cket contains in-band FEC */
49 } silk_TOC_struct;
50
51 /****************************************/
52 /* Encoder functions */
53 /****************************************/
54
55 /***********************************************/
56 /* Get size in bytes of the Silk encoder state */
57 /***********************************************/
58 opus_int silk_Get_Encoder_Size( /* O Returns error co de */
59 opus_int *encSizeBytes /* O Number of bytes in SILK encoder state */
60 );
61
62 /*************************/
63 /* Init or reset encoder */
64 /*************************/
65 opus_int silk_InitEncoder( /* O Returns error co de */
66 void *encState, /* I/O State */
67 int arch, /* I Run-time archite cture */
68 silk_EncControlStruct *encStatus /* O Encoder Status */
69 );
70
71 /**************************/
72 /* Encode frame with Silk */
73 /**************************/
74 /* Note: if prefillFlag is set, the input must contain 10 ms of audio, irrespect ive of what */
75 /* encControl->payloadSize_ms is set to */
76 opus_int silk_Encode( /* O Returns error co de */
77 void *encState, /* I/O State */
78 silk_EncControlStruct *encControl, /* I Control status */
79 const opus_int16 *samplesIn, /* I Speech sample in put vector */
80 opus_int nSamplesIn, /* I Number of sample s in input vector */
81 ec_enc *psRangeEnc, /* I/O Compressor data structure */
82 opus_int32 *nBytesOut, /* I/O Number of bytes in payload (input: Max bytes) */
83 const opus_int prefillFlag /* I Flag to indicate prefilling buffers no coding */
84 );
85
86 /****************************************/
87 /* Decoder functions */
88 /****************************************/
89
90 /***********************************************/
91 /* Get size in bytes of the Silk decoder state */
92 /***********************************************/
93 opus_int silk_Get_Decoder_Size( /* O Returns error co de */
94 opus_int *decSizeBytes /* O Number of bytes in SILK decoder state */
95 );
96
97 /*************************/
98 /* Init or Reset decoder */
99 /*************************/
100 opus_int silk_InitDecoder( /* O Returns error co de */
101 void *decState /* I/O State */
102 );
103
104 /******************/
105 /* Decode a frame */
106 /******************/
107 opus_int silk_Decode( /* O Returns error co de */
108 void* decState, /* I/O State */
109 silk_DecControlStruct* decControl, /* I/O Control Structur e */
110 opus_int lostFlag, /* I 0: no loss, 1 lo ss, 2 decode fec */
111 opus_int newPacketFlag, /* I Indicates first decoder call for this packet */
112 ec_dec *psRangeDec, /* I/O Compressor data structure */
113 opus_int16 *samplesOut, /* O Decoded output s peech vector */
114 opus_int32 *nSamplesOut, /* O Number of sample s decoded */
115 int arch /* I Run-time archite cture */
116 );
117
118 #if 0
119 /**************************************/
120 /* Get table of contents for a packet */
121 /**************************************/
122 opus_int silk_get_TOC(
123 const opus_uint8 *payload, /* I Payload data */
124 const opus_int nBytesIn, /* I Number of input bytes */
125 const opus_int nFramesPerPayload, /* I Number of SILK f rames per payload */
126 silk_TOC_struct *Silk_TOC /* O Type of content */
127 );
128 #endif
129
130 #ifdef __cplusplus
131 }
132 #endif
133
134 #endif
OLDNEW
« no previous file with comments | « third_party/opus/src/silk/A2NLSF.c ('k') | third_party/opus/src/silk/CNG.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698