Bug Summary

File:libs/broadvoice/src/floating/bv16/bv16ptquan.c
Location:line 89, 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 - Pitch quantizer
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: bv16ptquan.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 "bv16cnst.h"
35#include "bv16externs.h"
36
37int pitchtapquan(
38 Float *x,
39 int pp,
40 Float *b,
41 Float *re)
42{
43 Float p[9], t, s0, s1, s2, cormax, cor;
44 Float t0, t1, t2;
45 Float *xt;
46 Float *fp0;
47 Float *fp1;
48 const Float *fp2;
49 int ppm2, qidx=0, i, j;
50
51 ppm2 = pp - 2;
52 xt = x + XOFF(137 +1);
53
54 for (i = 0; i < 3; i++)
55 {
56 fp0 = xt;
57 fp1 = x + XOFF(137 +1) - ppm2 - i - 1;
58 t = 0;
59 for (j = 0; j < FRSZ40; j++)
60 t += (*fp0++) * (*fp1++);
61 p[i] = t;
62 }
63
64 fp0 = x+XOFF(137 +1)-ppm2-3;
65 s0 = *fp0++;
66 s1 = *fp0++;
67 s2 = *fp0--;
68 t0 = p[8] = s0*s0;
69 t1 = p[4] = s0*s1;
70 p[5] = s0*s2;
71 s0 = *fp0++;
72 s1 = *fp0++;
73 s2 = *fp0--;
74 t2 = s0*s0;
75 p[8] += t2;
76 p[4] += s0*s1;
77 p[5] += s0*s2;
78 for (i = 0; i < (FRSZ40 - 2); i++)
79 {
80 s0 = *fp0++;
81 s1 = *fp0++;
82 s2 = *fp0--;
83 p[8] += s0*s0;
84 p[4] += s0*s1;
85 p[5] += s0*s2;
86 }
87 s0 = *fp0++;
88 s1 = *fp0++;
89 s2 = *fp0--;
Value stored to 's2' is never read
90 p[7] = p[8] + (s0*s0) - t0;
91 p[3] = p[4] + (s0*s1) - t1;
92 p[6] = p[7] + (s1*s1) - t2;
93
94 cormax = -1.0e30;
95 fp2 = bv16_pp9cb;
96 for (i = 0; i < PPCBSZ32; i++)
97 {
98 cor = 0.0;
99 fp1 = p;
100 for (j = 0; j < 9; j++)
101 cor += (*fp2++)*(*fp1++);
102 if (cor > cormax)
103 {
104 cormax = cor;
105 qidx = i;
106 }
107 }
108
109 fp2 = bv16_pp9cb + qidx*9;
110 for (i = 0; i < 3; i++)
111 b[i] = fp2[i]*0.5;
112
113 fp0 = x + XOFF(137 +1);
114 fp1 = x + XOFF(137 +1) - ppm2 - 1;
115 t = 0;
116 for (i = 0; i < FRSZ40; i++)
117 {
118 t0 = *fp0++ - b[0]*fp1[0] - b[1]*fp1[-1] - b[2]*fp1[-2];
119 fp1++;
120 t += t0*t0;
121 }
122 *re = t;
123 return qidx;
124}
125