Bug Summary

File:libs/broadvoice/src/floating/bv32/bv32ptquan.c
Location:line 99, column 5
Description:Value stored to 's2' is never read

Annotated Source Code

1/*
2 * broadvoice - a library for the BroadVoice 16 and 32 codecs
3 *
4 * ptquan.c -
5 *
6 * Adapted by Steve Underwood <steveu@coppice.org> from code which is
7 * Copyright 2000-2009 Broadcom Corporation
8 *
9 * All rights reserved.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 2.1,
13 * as published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 * $Id: bv32ptquan.c,v 1.1.1.1 2009/11/19 12:10:48 steveu Exp $
25 */
26
27/*! \file */
28
29#if defined(HAVE_CONFIG_H1)
30#include "config.h"
31#endif
32
33#include "typedef.h"
34#include "bv32cnst.h"
35#include "bvcommon.h"
36#include "bv32externs.h"
37
38int bv32_pitchtapquan(Float *x,
39 int pp,
40 Float *b)
41{
42 Float p[9];
43 Float t;
44 Float s0;
45 Float s1;
46 Float s2;
47 Float cormax;
48 Float cor;
49 Float t0;
50 Float t1;
51 Float t2;
52 Float *xt;
53 const Float *fp0;
54 Float *fp1;
55 const Float *fp2;
56 int ppm2;
57 int qidx = 0;
58 int i;
59 int j;
60
61 ppm2 = pp - 2;
62 xt = x + XOFF(265 +1);
63
64 for (i = 0; i < 3; i++)
65 {
66 fp0 = xt;
67 fp1 = x + XOFF(265 +1) - ppm2 - i - 1;
68 t = 0;
69 for (j = 0; j < FRSZ80; j++)
70 t += (*fp0++) * (*fp1++);
71 p[i] = t;
72 }
73
74 fp0 = x + XOFF(265 +1) - ppm2 - 3;
75 s0 = *fp0++;
76 s1 = *fp0++;
77 s2 = *fp0--;
78 t0 = p[8] = s0*s0;
79 t1 = p[4] = s0*s1;
80 p[5] = s0*s2;
81 s0 = *fp0++;
82 s1 = *fp0++;
83 s2 = *fp0--;
84 t2 = s0*s0;
85 p[8] += t2;
86 p[4] += s0*s1;
87 p[5] += s0*s2;
88 for (i = 0; i < (FRSZ80 - 2); i++)
89 {
90 s0 = *fp0++;
91 s1 = *fp0++;
92 s2 = *fp0--;
93 p[8] += s0*s0;
94 p[4] += s0*s1;
95 p[5] += s0*s2;
96 }
97 s0 = *fp0++;
98 s1 = *fp0++;
99 s2 = *fp0--;
Value stored to 's2' is never read
100 p[7] = p[8] + (s0*s0) - t0;
101 p[3] = p[4] + (s0*s1) - t1;
102 p[6] = p[7] + (s1*s1) - t2;
103
104 cormax = -1.0e30;
105 fp0 = bv32_pp9cb;
106 for (i = 0; i < PPCBSZ32; i++)
107 {
108 cor = 0.0;
109 fp1 = p;
110 for (j = 0; j < 9; j++)
111 cor += (*fp0++)*(*fp1++);
112 if (cor > cormax)
113 {
114 cormax = cor;
115 qidx = i;
116 }
117 }
118
119 fp2 = bv32_pp9cb + qidx*9;
120 for (i = 0; i < 3; i++)
121 b[i] = fp2[i]*0.5;
122
123 return qidx;
124}