Note: We no longer publish the latest version of our code here. We primarily use a kumc-bmi github organization. The heron ETL repository, in particular, is not public. Peers in the informatics community should see MultiSiteDev for details on requesting access.

source: webrtc/webrtc/modules/audio_coding/neteq/mcu_dsp_common.h @ 0:4bda6873e34c

pub_scrub_3792 tip
Last change on this file since 0:4bda6873e34c was 0:4bda6873e34c, checked in by Michael Prittie <mprittie@…>, 6 years ago

Scrubbed password for publication.

File size: 2.2 KB
Line 
1/*
2 *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 *
4 *  Use of this source code is governed by a BSD-style license
5 *  that can be found in the LICENSE file in the root of the source
6 *  tree. An additional intellectual property rights grant can be found
7 *  in the file PATENTS.  All contributing project authors may
8 *  be found in the AUTHORS file in the root of the source tree.
9 */
10
11/*
12 * The main NetEQ instance, which is where the DSP and MCU sides join.
13 */
14
15#ifndef MCU_DSP_COMMON_H
16#define MCU_DSP_COMMON_H
17
18#include "typedefs.h"
19
20#include "dsp.h"
21#include "mcu.h"
22
23/* Define size of shared memory area. */
24#if defined(NETEQ_48KHZ_WIDEBAND)
25    #define SHARED_MEM_SIZE (6*640)
26#elif defined(NETEQ_32KHZ_WIDEBAND)
27    #define SHARED_MEM_SIZE (4*640)
28#elif defined(NETEQ_WIDEBAND)
29    #define SHARED_MEM_SIZE (2*640)
30#else
31    #define SHARED_MEM_SIZE 640
32#endif
33
34#define  SYNC_PAYLOAD_LEN_BYTES  7
35static const uint8_t kSyncPayload[SYNC_PAYLOAD_LEN_BYTES] = {
36    'a', 'v', 's', 'y', 'n', 'c', '\0' };
37
38/* Struct to hold the NetEQ instance */
39typedef struct
40{
41    DSPInst_t DSPinst; /* DSP part of the NetEQ instance */
42    MCUInst_t MCUinst; /* MCU part of the NetEQ instance */
43    int16_t ErrorCode; /* Store last error code */
44#ifdef NETEQ_STEREO
45    int16_t masterSlave; /* 0 = not set, 1 = master, 2 = slave */
46#endif /* NETEQ_STEREO */
47} MainInst_t;
48
49/* Struct used for communication between DSP and MCU sides of NetEQ */
50typedef struct
51{
52    uint32_t playedOutTS; /* Timestamp position at end of DSP data */
53    uint16_t samplesLeft; /* Number of samples stored */
54    int16_t MD; /* Multiple description codec information */
55    int16_t lastMode; /* Latest mode of NetEQ playout */
56    int16_t frameLen; /* Frame length of previously decoded packet */
57} DSP2MCU_info_t;
58
59/* Initialize instances with read and write address */
60int WebRtcNetEQ_DSPinit(MainInst_t *inst);
61
62/* The DSP side will call this function to interrupt the MCU side */
63int WebRtcNetEQ_DSP2MCUinterrupt(MainInst_t *inst, int16_t *pw16_shared_mem);
64
65/* Returns 1 if the given payload matches |kSyncPayload| payload, otherwise
66 * 0 is returned. */
67int WebRtcNetEQ_IsSyncPayload(const void* payload, int payload_len_bytes);
68
69#endif
Note: See TracBrowser for help on using the repository browser.