1 /****************************************************************************** 2 * * 3 * Copyright (C) 2018 The Android Open Source Project 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at: 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 ***************************************************************************** 18 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore 19 */ 20 #include "ixheaacd_cnst.h" 21 22 #include "ixheaacd_constants.h" 23 #include <ixheaacd_type_def.h> 24 #include <ixheaacd_basic_ops32.h> 25 #include <ixheaacd_basic_ops40.h> 26 27 #include "ixheaacd_windows.h" 28 ixheaacd_calc_window(WORD32 ** win,WORD32 win_sz,WORD32 win_sel)29WORD32 ixheaacd_calc_window(WORD32 **win, WORD32 win_sz, WORD32 win_sel) { 30 switch (win_sel) { 31 case WIN_SEL_0: 32 switch (win_sz) { 33 case WIN_LEN_128: 34 *win = (WORD32 *)ixheaacd_sine_win_128; 35 break; 36 case WIN_LEN_1024: 37 *win = (WORD32 *)ixheaacd_sine_win_1024; 38 break; 39 case WIN_LEN_64: 40 *win = (WORD32 *)ixheaacd_sine_win_64; 41 break; 42 case WIN_LEN_768: 43 *win = (WORD32 *)ixheaacd_sine_win_768; 44 break; 45 case WIN_LEN_192: 46 *win = (WORD32 *)ixheaacd_sine_win_192; 47 break; 48 case WIN_LEN_96: 49 *win = (WORD32 *)ixheaacd_sine_win_96; 50 break; 51 case WIN_LEN_256: 52 *win = (WORD32 *)ixheaacd_sine_win_256; 53 break; 54 default:; 55 } 56 break; 57 58 case WIN_SEL_1: 59 switch (win_sz) { 60 case WIN_LEN_120: 61 *win = (WORD32 *)ixheaacd_kbd_win120; 62 break; 63 case WIN_LEN_128: 64 *win = (WORD32 *)ixheaacd_kbd_win128; 65 break; 66 case WIN_LEN_960: 67 *win = (WORD32 *)ixheaacd_kbd_win960; 68 break; 69 case WIN_LEN_1024: 70 *win = (WORD32 *)ixheaacd_kbd_win1024; 71 break; 72 case WIN_LEN_4: 73 *win = (WORD32 *)ixheaacd_kbd_win4; 74 break; 75 case WIN_LEN_16: 76 *win = (WORD32 *)ixheaacd_kbd_win16; 77 break; 78 case WIN_LEN_64: 79 *win = (WORD32 *)ixheaacd_kbd_win_64; 80 break; 81 case WIN_LEN_768: 82 *win = (WORD32 *)ixheaacd_kbd_win768; 83 break; 84 case WIN_LEN_192: 85 *win = (WORD32 *)ixheaacd_kbd_win192; 86 break; 87 case WIN_LEN_96: 88 *win = (WORD32 *)ixheaacd_kbd_win96; 89 break; 90 case WIN_LEN_48: 91 *win = (WORD32 *)ixheaacd_kbd_win48; 92 break; 93 default: 94 return -1; 95 break; 96 } 97 break; 98 99 default: 100 return -1; 101 break; 102 } 103 return 0; 104 } 105