Hi,
I'm very new to C programming and need to get a program compiled and running. The code was given to me but I keep having issues compiling it. It says:
warning #2027: Missing prototype for 'print_p56_long_summary'.
warning #2027: Missing prototype for 'print_p56_short_summary'.
The code is pretty long so Ill just put the parts it references:
/*
============================================================================
void print_p56_long_summary(char *file, SVP56_state state, double al_dB,
~~~~~~~~~~~~~~~~~~~~~~~~~~~ double NdB, double gain, double ratio,
long N, long N1, long N2, long bitno);
Print full summary of P.56 statistics
Parameter:
~~~~~~~~~~
file ..... File name
state .... P.56 state variable
al_dB .... active level in dB
NdB ...... desired dB level for output
gain ..... gain to equalize file to desired level
ratio .... ratio of maximum number representable in the system (based on
the number of bits, or resolution, of the input speech file)
to the range of the input signal. E.g., for a 16 bit system
with a +-1 signal range, ratio = 32760 / 1.0.
N ........ number of samples per block
N1 ....... number of first block processed in the file
N2 ....... total number of blocks processed from the file
bitno .... number of bits per sample (input signal resolution)
Returns
~~~~~~~
None
Original author
~~~~~~~~~~~~~~~
simao@ctd.comsat.com
Log of changes
~~~~~~~~~~~~~~
01.Nov.96 v1.0 Creation.
============================================================================
*/
void print_p56_long_summary(out, file, state, al_dB, NdB, ratio, gain,
N, N1, N2, bitno)
FILE *out;
SVP56_state state;
char *file;
double ratio, gain, al_dB, NdB;
long N, N1, N2, bitno;
{
static char unity[5] = "dBov";
double abs_max_dB, max_gain, new_max;
/* Calculate peak in dB */
abs_max_dB = 20 * log10(SVP56_get_abs_max(state) + MIN_LOG_OFFSET)
- state.refdB;
/* Computes the maximum gain that will not cause saturation */
max_gain = al_dB - 20 * log10(SVP56_get_abs_max(state));
/* Print the relevant messages */
fprintf(out, "%s%s", " ---------------------------",
"----------------------------");
fprintf(out, "\n Input file: ................... %s, ", file);
fprintf(out, "%2ld bits, fs=%5.0f Hz", bitno, state.f);
fprintf(out, "\n Block Length: ................. %7ld [samples]", N);
fprintf(out, "\n Starting Block: ............... %7ld []", N1 + 1);
fprintf(out, "\n Number of Blocks: ............. %7ld []", N2);
fprintf(out, "\n %s desired for output: ...... %7.3f [%s]",
unity, NdB, unity);
/* Skip if filesize is zero */
if (state.n==0)
{
fprintf(out, "%s%s", "\n -***-----------------------",
"----------------------------\n");
return;
}
/* If the activity factor is 0, don't report many things */
if (SVP56_get_activity(state) == 0)
{
fprintf(out, "\n Activity factor is ZERO -- the file is silence");
fprintf(out, " or idle noise");
fprintf(out, "%s%s", "\n ---------------------------",
"----------------------------");
fprintf(out, "\n DC level: ..................... %7.0f [PCM]",
ratio * SVP56_get_DC_level(state));
fprintf(out, "\n Maximum positive value: ....... %7.0f [PCM]",
ratio * SVP56_get_pos_max(state));
fprintf(out, "\n Maximum negative value: ....... %7.0f [PCM]",
ratio * SVP56_get_neg_max(state));
fprintf(out, "%s%s", "\n ---------------------------",
"----------------------------");
fprintf(out, "\n Noise/silence energy (rms): ... %7.3f [dB]",
SVP56_get_rms_dB(state));
}
else
{
fprintf(out, "\n Norm factor desired is: ....... %7.3f [times]", gain);
fprintf(out, "\n Max norm WITHOUT saturation: .. %7.3f [%s]",
max_gain, unity);
fprintf(out, "%s%s", "\n ---------------------------",
"----------------------------");
fprintf(out, "\n DC level: ..................... %7.0f [PCM]",
ratio * SVP56_get_DC_level(state));
fprintf(out, "\n Maximum positive value: ....... %7.0f [PCM]",
ratio * SVP56_get_pos_max(state));
fprintf(out, "\n Maximum negative value: ....... %7.0f [PCM]",
ratio * SVP56_get_neg_max(state));
fprintf(out, "%s%s", "\n ---------------------------",
"----------------------------");
fprintf(out, "\n Long term energy (rms): ....... %7.3f [%s]",
SVP56_get_rms_dB(state), unity);
fprintf(out, "\n Active speech level: .......... %7.3f [%s]",
al_dB, unity);
fprintf(out, "\n RMS peak-factor found: ........ %7.3f [dB]",
abs_max_dB - SVP56_get_rms_dB(state));
fprintf(out, "\n Active peak factor found: ..... %7.3f [dB]",
abs_max_dB - al_dB);
fprintf(out, "\n Activity factor: .............. %7.3f [%%]",
SVP56_get_activity(state));
}
fprintf(out, "%s%s", "\n ---------------------------",
"----------------------------");
/* Tests if the equalization will cause saturation */
new_max = SVP56_get_abs_max(state) * gain;
if (new_max > 1.0)
{
/* Print message */
fprintf(out, "\n%%SV-W-SAT, the dB level chosen causes SATURATION: ");
fprintf(out, "old max=%5.0f; new max=%6.0f",
ratio * SVP56_get_abs_max(state),
ratio * new_max);
fprintf(out, "\n%%SV-I-MAXLEVDB, the maximum norm factor ");
fprintf(out, "to PREVENT clipping is %7.3fdB; ", max_gain);
fprintf(out, "\n -------------------------------------------------------");
}
}
/* .................... End of print_p56_long_summary() ................... */
/*
============================================================================
void print_p56_short_summary (char *file, SVP56_state state,
~~~~~~~~~~~~~~~~~~~~~~~~ double al_dB, double ratio);
Print one-line summary of P.56 statistics
Parameter:
~~~~~~~~~~
file ..... File name
state .... P.56 state variable
al_dB .... active level in dB
ratio .... ratio of maximum number representable in the system (based on
the number of bits, or resolution, of the input speech file)
to the range of the input signal. E.g., for a 16 bit system
with a +-1 signal range, ratio = 32760 / 1.0.
Returns
~~~~~~~
None
Original author
~~~~~~~~~~~~~~~
simao@ctd.comsat.com
Log of changes
~~~~~~~~~~~~~~
01.Nov.96 v1.0 Creation.
============================================================================
*/
void print_p56_short_summary(out, file, state, al_dB, ratio, gain)
FILE *out;
SVP56_state state;
char *file;
double ratio, al_dB, gain;
{
/* Report number of samples */
fprintf(out, "Samples: %5ld ", state.n);
/* Skip if filesize is zero */
if (state.n==0)
{
fprintf(out, "%s%s%s", "Min: ------ Max: ----- DC: ------- ",
"RMSLev[dB]: ------- ActLev[dB]: ------- %Active: ------ ",
"Gain: ------ ");
}
else
{
fprintf(out, "Min: %-5.0f ", ratio * state.maxN);
fprintf(out, "Max: %-5.0f ", ratio * state.maxP);
fprintf(out, "DC: %-7.2f ", ratio * state.DClevel);
fprintf(out, "RMSLev[dB]: %7.3f ", state.rmsdB);
fprintf(out, "ActLev[dB]: %7.3f ", al_dB);
fprintf(out, "%%Active: %7.3f", state.ActivityFactor * 100);
fprintf(out, "Gain[]: %7.3f", gain);
}
fprintf(out, "\t%s\n", file);
}
/* ................... End of print_p56_short_summary() .................... */
I appreciate any help you can give me.
Thanks