xref: /aosp_15_r20/external/libopus/dnn/dred_config.h (revision a58d3d2adb790c104798cd88c8a3aff4fa8b82cc)
1 /* Copyright (c) 2022 Amazon
2    Written by Jan Buethe */
3 /*
4    Redistribution and use in source and binary forms, with or without
5    modification, are permitted provided that the following conditions
6    are met:
7 
8    - Redistributions of source code must retain the above copyright
9    notice, this list of conditions and the following disclaimer.
10 
11    - Redistributions in binary form must reproduce the above copyright
12    notice, this list of conditions and the following disclaimer in the
13    documentation and/or other materials provided with the distribution.
14 
15    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19    OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef DRED_CONFIG_H
29 #define DRED_CONFIG_H
30 
31 /* Change this once DRED gets an extension number assigned. */
32 #define DRED_EXTENSION_ID 126
33 
34 /* Remove these two completely once DRED gets an extension number assigned. */
35 #define DRED_EXPERIMENTAL_VERSION 10
36 #define DRED_EXPERIMENTAL_BYTES 2
37 
38 
39 #define DRED_MIN_BYTES 8
40 
41 /* these are inpart duplicates to the values defined in dred_rdovae_constants.h */
42 #define DRED_SILK_ENCODER_DELAY (79+12-80)
43 #define DRED_FRAME_SIZE 160
44 #define DRED_DFRAME_SIZE (2 * (DRED_FRAME_SIZE))
45 #define DRED_MAX_DATA_SIZE 1000
46 #define DRED_ENC_Q0 6
47 #define DRED_ENC_Q1 15
48 
49 /* Covers 1.04 second so we can cover one second, after the lookahead. */
50 #define DRED_MAX_LATENTS 26
51 #define DRED_NUM_REDUNDANCY_FRAMES (2*DRED_MAX_LATENTS)
52 #define DRED_MAX_FRAMES (4*DRED_MAX_LATENTS)
53 
54 #endif
55