📄 bugfix.notes
字号:
Date: Wed, 24 Mar 93 12:30:44 -0500From: kabal@aldebaran.ee.mcgill.ca (Peter Kabal)Message-Id: <9303241730.AA07509@aldebaran.EE.McGill.CA>To: jpcampb@afterlife.ncsc.mil (Joe Campbell)Subject: celp distributionContent-Length: 17181X-Lines: 539Status: ROJoe, I grabbed the latest version from furmint.nectar.cs.cmu.edu. VinceCale has now put everything in a tar.Z file. I had grabbed the stuff earlierwhen it was just loose in some directories. Some of the stuff has been badlymangled. I ran a diff with the latest version, and there is an apologyin the comments to the effect that he has messed up the ifdefs. Indeed hehas, that is why the C-version does not run.I suggest you send him (and me), the correct celp.c and makefile. Thatshould put the distribution back in order. There are other bits andpieces lying around which probably were not in the original distribution.Back to the Fortran version. The version I have now runs on both Sun andDEC without further modification. The DEC version complains about speechdifferences, but after processing the DEC and Sun output files measureup to within 80 dB. The DEC output file is slightly longer than the Sun,but that is presumably due to differences in how they handle partialrecords at the end.Fortran routines for 1016 CELPThe following renames were required:bitperm.h -> bitpermute.hbitprot.h -> bitprotect.hcbgain.tlb -> cbgain.tablecbsearch.f -> cbsearch.Fcsub.f -> csub.Fdcodham.f -> decodeham.fdisto.f -> distortion.fencodham.f -> encodeham.fgaindcod.f -> gaindecode.fgainncd2.f -> gainencode2.fgainncod.f -> gainencode.fldelaynr.f -> ldelay_nr.flsp34.tbl -> lsp34.tablelspd34.f -> lspdecode34.fmexcite.f -> mexcite.Fmtrxgen.f -> matrixgen.fpgain.tbl -> pagain.tableptdcode.f -> pitchdecode.fptncod.f -> pitchencode.fpostfilt.f -> postfilt2.fread_err.f -> read_error.freadme.mke -> readme.makesavesg.f -> save_sg.fsmcbgn.f -> smoothcbgain.fsmpgn.f -> smoothpgain.fsmt.f -> smoothtau.fwrterr.f -> write_error.fIn addition, the following routines were more extensively modified andrenamed:celp.f -> celp.F changes + ultrix changescli.f -> cli.F changes + ultrix changesiodisk.f -> iodisk.F changes + ultrix changesmakefile.mke -> Makefilepsearch.f -> psearch.F changes + ultrix changesSun refers to Fortran under SunOS 4.1.3.DEC refers to DEC Fortran 3.2 running under Ultrix 4.2.Changes:(1) "implicit undefined" is a Sun'ism. The equivalent for DEC is "implicit none". However, the best strategy is not to have such a statement at all. Both Sun & DEC Fortran accept the -u option which turns on this option without having to modify the source. This is the preferred way for portable code. This affects ALL fortran routines.(2) DEC Fortran (and the F77 standard) do not allow null character strings. Since strings are padded with blanks anyway, the portable solution is to use ' ' instead of ''. (cli.F)(3) Both Sun and DEC use the extension .F to signify that the file contains conditionals which need the C-preprocessor.(4) Consider a file which is read only. For Sun an OPEN succeeds on this file, and only if one attempts to write will an error be signalled. For DEC, an open fails unless the "readonly" option is specified in the open. The readonly option is ignored by Sun, but with a warning. I have put conditionals (ifdef ultrix) around such changes.(5) The interpretation of the record size for unformatted reads is according to the F77 standard in terms of "processor defined units". Sun uses bytes and DEC uses longwords (4 bytes). I have put conditionals around such changes. (iodisk.F)(6) The routine celp.f (renamed to celp.F) had a number of unexplained errors. First the header had been mangled so that comment characters were not in place on some statements. Second, the reference to bitprotect treated it as a character, when in fact it is an integer. Third the only routine available is postfilt2, yet the code calls out postfilt.(7) There are some incompatibilities for an unformatted read of a character string in routine cli.F. The F77 standard indicates that on the external record, the string should be in quotes. I changed this to a formatted read.(8) The code in psearch.F had some consistency checks on parameter values. With DEC Fortran, these were optimized right out of the code. This made part of the code unreachable, causing a compilation error.Here are my diffs (not including the "implicit undefined" stuff which appliespractically to all files).*** celp32/celp.f Mon Oct 26 17:19:36 1992--- ../celp-1016/celp32/celp.F Wed Mar 10 17:32:26 1993****************** 7,13 **** * resulting from this code. Further reproduction or distribution * * of this code without prior written permission of the U.S. * * Government is prohibited. See NCS Technical Information Bulletin *! * on FS 1016 CELP Speech Coding. * * * *************************************************************************** C C ROUTINE--- 7,14 ---- * resulting from this code. Further reproduction or distribution * * of this code without prior written permission of the U.S. * * Government is prohibited. See NCS Technical Information Bulletin *! * on FS 1016 CELP Speech Coding. *! * * *************************************************************************** C C ROUTINE****************** 146,152 **** C************************************************************************** C*- program celp! implicit undefined (a-z) include 'ccsub.com' convex #include "ccsub.com" real sold(maxll), snew(maxll), ssub(maxll)--- 147,153 ---- C************************************************************************** C*- program celp! include 'ccsub.com' convex #include "ccsub.com" real sold(maxll), snew(maxll), ssub(maxll)****************** 285,292 ****--- 286,295 ---- c This issue can be reviewed by reading the UNIX man pages c on ieee floating point (man -k ieee). c+ #ifdef sun call abrupt_underflow() #include <f77/f77_floatingpoint.h>+ #endif cSUN? call ieee_handler("set", "underflow", SIGFPE_DEFAULT) c c *** parse the command line****************** 377,385 **** c c *bit stream channel file if (analy) then! open(unit=25, file=ofile(1:oflen)//'.chan') else open(unit=25, file=ifile(1:iflen)//'.chan', status='old') end if c c *quantizer design (data collection) files--- 380,393 ---- c c *bit stream channel file if (analy) then! open(unit=25, file=ofile(1:oflen)//'.chan', status='new') else+ #ifdef ultrix+ open(unit=25, file=ifile(1:iflen)//'.chan', status='old',+ - readonly)+ #else open(unit=25, file=ifile(1:iflen)//'.chan', status='old')+ #endif end if c c *quantizer design (data collection) files****************** 387,393 ****--- 395,406 ---- copt open(unit=21, file='pgain.data') c c *read stochastic code book vector file (by 20)+ #ifdef ultrix+ open(unit=11, file='./codebook.h', status='old', err=112,+ - readonly)+ #else open(unit=11, file='./codebook.h', status='old', err=112)+ #endif i = 1 do 110 j = 1, (2*(maxncsize-1)+l)/20 read(11, *, err=112) (x(k), k=i,i-1+20)****************** 400,406 ****--- 413,424 ---- 115 continue c c *read adaptive code book index (pitch delay) file+ #ifdef ultrix+ open(unit=12, file='./pdelay.h', status='old', err=122,+ - readonly)+ #else open(unit=12, file='./pdelay.h', status='old', err=122)+ #endif do 120 i = 0, maxpd-1 read(12, *, err=122) pdelay(i) 120 continue****************** 412,419 ****--- 430,444 ---- c *read pitch delay coding tables for bit assignment c *pdencode.h for encoding, pddecode.h for decoding c *generate pdtabi for delta delay coding+ #ifdef ultrix+ open(unit=13, file='./pdencode.h', status='old', err=132,+ - readonly)+ open(unit=14, file='./pddecode.h', status='old', err=142,+ - readonly)+ #else open(unit=13, file='./pdencode.h', status='old', err=132) open(unit=14, file='./pddecode.h', status='old', err=142)+ #endif do 130 i = 0, maxpd-1 read(13, '(z)', err=132) pdencode(i) read(14, *, err=142) pddecode(i)****************** 427,441 **** 145 continue c c *read bit protection file open(unit=15, file='./bitprotect.h', status='old', err=152)! read(15, *, err=152) bitprotect(1:codelength2) close(15) go to 155 152 stop ' celp: Problem with file "bitprotect.h"' 155 continue c c *read bit permutation file (by 12) open(unit=16, file='./bitpermute.h', status='old', err=162) i = 1 do 160 j = 1, streambits/12 read(16, *, err=162) (bitpermute(k), k=i,i+11)--- 452,476 ---- 145 continue c c *read bit protection file+ #ifdef ultrix+ open(unit=15, file='./bitprotect.h', status='old', err=152,+ - readonly)+ #else open(unit=15, file='./bitprotect.h', status='old', err=152)! #endif! read(15, *, err=152) (bitprotect(i),i=1,codelength2) close(15) go to 155 152 stop ' celp: Problem with file "bitprotect.h"' 155 continue c c *read bit permutation file (by 12)+ #ifdef ultrix+ open(unit=16, file='./bitpermute.h', status='old', err=162,+ - readonly)+ #else open(unit=16, file='./bitpermute.h', status='old', err=162)+ #endif i = 1 do 160 j = 1, streambits/12 read(16, *, err=162) (bitpermute(k), k=i,i+11)****************** 916,922 **** c c *** post filtering
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -