Lines 172-177
static inline spx_word32_t compute_pitch
Link Here
|
172 |
#ifndef OVERRIDE_OPEN_LOOP_NBEST_PITCH |
172 |
#ifndef OVERRIDE_OPEN_LOOP_NBEST_PITCH |
173 |
void open_loop_nbest_pitch(spx_word16_t *sw, int start, int end, int len, int *pitch, spx_word16_t *gain, int N, char *stack) |
173 |
void open_loop_nbest_pitch(spx_word16_t *sw, int start, int end, int len, int *pitch, spx_word16_t *gain, int N, char *stack) |
174 |
{ |
174 |
{ |
|
|
175 |
int loop_done; |
175 |
int i,j,k; |
176 |
int i,j,k; |
176 |
VARDECL(spx_word32_t *best_score); |
177 |
VARDECL(spx_word32_t *best_score); |
177 |
VARDECL(spx_word32_t *best_ener); |
178 |
VARDECL(spx_word32_t *best_ener); |
Lines 268-275
void open_loop_nbest_pitch(spx_word16_t
Link Here
|
268 |
best_score[N-1]=tmp; |
269 |
best_score[N-1]=tmp; |
269 |
best_ener[N-1]=ener16[i-start]+1; |
270 |
best_ener[N-1]=ener16[i-start]+1; |
270 |
pitch[N-1]=i; |
271 |
pitch[N-1]=i; |
|
|
272 |
|
273 |
loop_done = 0; |
274 |
|
271 |
/* Check if it comes in front of others */ |
275 |
/* Check if it comes in front of others */ |
272 |
for (j=0;j<N-1;j++) |
276 |
for (j=0;j<N-1 && !loop_done;j++) |
273 |
{ |
277 |
{ |
274 |
if (MULT16_16(tmp,best_ener[j])>MULT16_16(best_score[j],ADD16(1,ener16[i-start]))) |
278 |
if (MULT16_16(tmp,best_ener[j])>MULT16_16(best_score[j],ADD16(1,ener16[i-start]))) |
275 |
{ |
279 |
{ |
Lines 282-288
void open_loop_nbest_pitch(spx_word16_t
Link Here
|
282 |
best_score[j]=tmp; |
286 |
best_score[j]=tmp; |
283 |
best_ener[j]=ener16[i-start]+1; |
287 |
best_ener[j]=ener16[i-start]+1; |
284 |
pitch[j]=i; |
288 |
pitch[j]=i; |
285 |
break; |
289 |
loop_done=1; |
286 |
} |
290 |
} |
287 |
} |
291 |
} |
288 |
} |
292 |
} |