[Speexdev] Noisy sound quality with Blackfin in WBmode
Bernhard Gerlach
bernhard.gerlach at stud.tuilmenau.de
Wed Nov 9 05:02:29 PST 2005
Hello JeanMarc,
I disabled the Blackfin optimization functions one by one and found
the error in libspeex/lpc_bfin.h in the autocorrelation computation.
Compared to the fixedpointvariant of that function (from lpc.c),
the blackfincode produces correct values except for the zero offset
value. Additionally, the loop after the ASMcode assigned values
(ac32) wrong to the functions output structure (ac). I added a loop
to compute ac0value correctly and another loop, that moves ac32
values to ac. I checked my code with debug printf's comparing
BlackfinASMcomputed values against fixedpointvariant values and
found the values to be generally the equal. Some BlackfinASMvalues
differ slightly from fixedpointvalues what may be the result of
rounding errors. I can hear no difference any more between fixed
pointonly and fixedpoint+blackfinencoded files. I tested for some
quality and complexity values in wideband and ultrawideband mode.
Find attached the diff against current svn with my changes.
Best regards,
Bernhard
Index: lpc_bfin.h
===================================================================
 lpc_bfin.h
+++ lpc_bfin.h
@@ 109,23 +110,19 @@
: : "m" (xs), "m" (x), "m" (ac32top), "m" (N_lag), "m" (lag_1),
"m" (nshift)
: "A0", "A1", "P0", "P1", "P2", "P3", "P4", "R0", "R1", "R2",
"R3", "R4", "I0", "I1", "L0", "L1", "B0", "B1", "memory"
);
+
+
+ for ( i=1; i<lag; i++ )
+ {
+ ac[i]=SHR32(ac32[i+(10(lag1))], ac_shift);
+ }
+
+
d=0;
for (j=0;j<n;j++)
{
d = ADD32(d,SHR32(MULT16_16(x[j],x[j]), shift));
}
 ac32[0] = d;

 for (i=0;i<lag;i++)
 {
 d=0;
 for (j=i;j<lag_1;j++)
 {
 d = ADD32(d,SHR32(MULT16_16(x[j],x[ji]), shift));
 }
 if (i)
 ac32[i] += d;
 ac[i] = SHR32(ac32[i], ac_shift);
 }
+ ac[0] = SHR32(d, ac_shift);
}
More information about the Speexdev
mailing list