From: Tzafrir Cohen <[email protected]>
Handle some of the build warnings. Sometimes using brute force.
---
src/ampexp.c | 10 ++--
src/c2sim.c | 3 +-
src/fdmdv_put_test_bits.c | 2 +-
src/insert_errors.c | 3 +-
src/nlp.c | 6 +++
src/phaseexp.c | 121 +--------------------------------------------
6 files changed, 15 insertions(+), 130 deletions(-)
diff --git a/src/ampexp.c b/src/ampexp.c
index 0119160..94e2184 100644
--- a/src/ampexp.c
+++ b/src/ampexp.c
@@ -370,7 +370,7 @@ static float frame_energy(MODEL *model, float *enormdB) {
static void print_sparse_amp_error(struct AEXP *aexp, MODEL *model, float
edB_thresh)
{
int m, index;
- float edB, enormdB, error, dWo, Am;
+ float edB, enormdB, error, dWo;
float sparse_pe[MAX_AMP];
edB = frame_energy(model, &enormdB);
@@ -536,12 +536,12 @@ static void split_error(struct AEXP *aexp, struct
codebook *vq, float sparse_pe_
static void sparse_vq_amp(struct AEXP *aexp, MODEL *model)
{
int m, index;
- float error, amp_dB, edB, enormdB;
+ float error, amp_dB, enormdB;
float sparse_pe_in[MAX_AMP];
float sparse_pe_out[MAX_AMP];
float weights[MAX_AMP];
- edB = frame_energy(model, &enormdB);
+ frame_energy(model, &enormdB);
aexp->mag[2] = enormdB;
@@ -864,9 +864,9 @@ void smooth_samples(struct AEXP *aexp, MODEL *model, int
mode)
float sparse_pe_out[MAX_AMP];
float smoothed[MAX_AMP], smoothed_out[MAX_AMP];
float weights[MAX_AMP];
- float edB, enormdB;
+ float enormdB;
- edB = frame_energy(model, &enormdB);
+ frame_energy(model, &enormdB);
for(m=0; m<MAX_AMP; m++) {
sparse_pe_in[m] = 0.0;
diff --git a/src/c2sim.c b/src/c2sim.c
index 92f1387..255bd1a 100644
--- a/src/c2sim.c
+++ b/src/c2sim.c
@@ -426,7 +426,6 @@ int main(int argc, char *argv[])
if (phase0) {
float Wn[M]; /* windowed speech samples */
float Rk[LPC_MAX+1]; /* autocorrelation coeffs */
- int ret;
#ifdef DUMP
dump_phase(&model.phi[0], model.L);
@@ -467,7 +466,7 @@ int main(int argc, char *argv[])
model.phi[i] = 0;
if (hand_voicing) {
- ret = fscanf(fvoicing,"%d\n",&model.voiced);
+ fscanf(fvoicing,"%d\n",&model.voiced);
}
}
diff --git a/src/fdmdv_put_test_bits.c b/src/fdmdv_put_test_bits.c
index 3b8bf7b..c1e62f1 100644
--- a/src/fdmdv_put_test_bits.c
+++ b/src/fdmdv_put_test_bits.c
@@ -92,7 +92,7 @@ int main(int argc, char *argv[])
rx_bits = (int*)malloc(sizeof(int)*bits_per_codec_frame);
assert(rx_bits != NULL);
- error_pattern = (int*)malloc(fdmdv_error_pattern_size(fdmdv)*sizeof(int));
+ error_pattern =
(short*)malloc(fdmdv_error_pattern_size(fdmdv)*sizeof(int));
assert(error_pattern != NULL);
total_bit_errors = 0;
diff --git a/src/insert_errors.c b/src/insert_errors.c
index 2a1877b..e3f3810 100644
--- a/src/insert_errors.c
+++ b/src/insert_errors.c
@@ -45,7 +45,7 @@ int main(int argc, char *argv[])
unsigned char byte;
short error;
int errors, bits;
- int bits_per_frame, bytes_per_frame;
+ int bits_per_frame;
if (argc < 4) {
printf("%s InputBitFile OutputBitFile ErrorFile bitsPerFrame [startBit
endBit]\n", argv[0]);
@@ -75,7 +75,6 @@ int main(int argc, char *argv[])
bits_per_frame = atoi(argv[4]);
assert((bits_per_frame % 8) == 0);
- bytes_per_frame = bits_per_frame/8;
start_bit = 0; end_bit = bits_per_frame;
if (argc == 7) {
diff --git a/src/nlp.c b/src/nlp.c
index 5fb8358..ea88e45 100644
--- a/src/nlp.c
+++ b/src/nlp.c
@@ -440,7 +440,9 @@ float post_process_mbe(COMP Fw[], int pmin, int pmax, float
gmax, COMP Sw[], COM
#ifdef DUMP
float e_hz[F0_MAX];
#endif
+ #if !defined(NDEBUG) || defined(DUMP)
int bin;
+ #endif
float f0_min, f0_max;
float f0_start, f0_end;
@@ -473,7 +475,9 @@ float post_process_mbe(COMP Fw[], int pmin, int pmax, float
gmax, COMP Sw[], COM
for(f0=f0_start; f0<=f0_end; f0+= 2.5) {
e = test_candidate_mbe(Sw, W, f0);
+ #if !defined(NDEBUG) || defined(DUMP)
bin = floor(f0); assert((bin > 0) && (bin < F0_MAX));
+ #endif
#ifdef DUMP
e_hz[bin] = e;
#endif
@@ -498,7 +502,9 @@ float post_process_mbe(COMP Fw[], int pmin, int pmax, float
gmax, COMP Sw[], COM
for(f0=f0_start; f0<=f0_end; f0+= 2.5) {
e = test_candidate_mbe(Sw, W, f0);
+ #if !defined(NDEBUG) || defined(DUMP)
bin = floor(f0); assert((bin > 0) && (bin < F0_MAX));
+ #endif
#ifdef DUMP
e_hz[bin] = e;
#endif
diff --git a/src/phaseexp.c b/src/phaseexp.c
index 57db0f0..be2ad9b 100644
--- a/src/phaseexp.c
+++ b/src/phaseexp.c
@@ -343,14 +343,6 @@ static void predict_phases2(struct PEXP *pexp, MODEL
*model, int start, int end)
}
-static void skip_phases(struct PEXP *pexp, MODEL *model, int start, int end) {
- int i;
-
- for(i=start; i<=end; i+=2)
- model->phi[i] = model->phi[i-1] - model->phi[i-2];
-
-}
-
static void rand_phases(MODEL *model, int start, int end) {
int i;
@@ -859,117 +851,6 @@ static void sparse_vq_pred_error(struct PEXP *pexp,
}
-/*
- est delta (in Wo)
- see if this gives us a better (smaller variance) prediction error
-*/
-
-static void print_pred_error_sparse_wo_correction(struct PEXP *pexp,
- MODEL *model,
- int start, int end,
- float mag_thresh)
-{
- int i, index;
- float mag, pred, error[MAX_AMP], diff, c, s, delta, err;
- float sparse_pe[MAX_AMP];
-
- mag = 0.0;
- for(i=start; i<=end; i++)
- mag += model->A[i]*model->A[i];
- mag = 10*log10(mag/(end-start));
-
- if (mag > mag_thresh) {
- for(i=0; i<MAX_AMP; i++) {
- sparse_pe[i] = 0.0;
- }
-
- /* predict phase and sum differences between harmonics */
-
- for(i=start; i<=end; i++) {
- //model->phi[i] = pexp->phi_prev[i] + N*i*(model->Wo +
pexp->Wo_prev)/2.0 + 0.01*N*i;
- pred = pexp->phi_prev[i] + N*i*(model->Wo + pexp->Wo_prev)/2.0;
- error[i] = pred - model->phi[i];
- }
-
- /* estimate delta Wo */
-
- c = s = 0.0;
- for(i=start+1; i<=end; i++) {
- diff = error[i] - error[i-1];
- c += log(model->A[i])*cos(diff);
- s += log(model->A[i])*sin(diff);
- }
- delta = atan2(s,c)/N;
- //printf("delta %f\n",delta);
- delta = 0;
- /* now predict phases using corrected Wo */
-
- for(i=start; i<=end; i++) {
- pred = pexp->phi_prev[i] + N*i*(model->Wo + pexp->Wo_prev)/2.0 -
N*i*delta;
- err = pred - model->phi[i];
- err = atan2(sin(err),cos(err));
-
- index = MAX_AMP*i*model->Wo/PI;
- assert(index < MAX_AMP);
- sparse_pe[index] = err;
- }
-
- /* dump spare phase vector in polar format */
-
- for(i=0; i<MAX_AMP; i++)
- printf("%f ", sparse_pe[i]);
- printf("\n");
-
- }
-
-}
-
-
-static void print_pred_error_sparse_wo_correction1(struct PEXP *pexp,
- MODEL *model,
- int start, int end,
- float mag_thresh)
-{
- int i, index;
- float mag, pred, best_Wo, err;
- float sparse_pe[MAX_AMP];
-
- mag = 0.0;
- for(i=start; i<=end; i++)
- mag += model->A[i]*model->A[i];
- mag = 10*log10(mag/(end-start));
-
- if (mag > mag_thresh) {
-
- best_Wo = refine_Wo(pexp, model, start, end);
-
- /* now predict phases using corrected Wo */
-
- for(i=0; i<MAX_AMP; i++) {
- sparse_pe[i] = 0.0;
- }
-
- for(i=start; i<=end; i++) {
- pred = pexp->phi_prev[i] + N*i*best_Wo;
- err = pred - model->phi[i];
- err = atan2(sin(err),cos(err));
-
- index = MAX_AMP*i*model->Wo/PI;
- assert(index < MAX_AMP);
- sparse_pe[index] = err;
- }
-
- /* dump spare phase vector in polar format */
-
- for(i=0; i<MAX_AMP; i++)
- printf("%f ", sparse_pe[i]);
- printf("\n");
-
- }
-
-}
-
-
static void predict_phases1(struct PEXP *pexp, MODEL *model, int start, int
end) {
int i;
float best_Wo;
@@ -1356,7 +1237,7 @@ static void repeat_phases(struct PEXP *pexp, MODEL
*model) {
void phase_experiment(struct PEXP *pexp, MODEL *model, char *arg) {
int m;
- float before[MAX_AMP], best_Wo;
+ float before[MAX_AMP];
assert(pexp != NULL);
memcpy(before, &model->phi[0], sizeof(float)*MAX_AMP);
--
1.7.10.4
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Freetel-codec2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freetel-codec2