Stéphane Lesage
2007-Oct-16 10:02 UTC
[Speex-dev] Blackfin port on Visual DSP, Michael Shatz ?
Hi, I'm using the Speex codec on my Blackfin-based board, and plain-C performance is pretty poor. Decoder is OK (something 25 MIPS for wide-band). But Encoder is not (wide-band quality 8, complexity 1): - 162 MIPS with Analog-Devices lib - 128 MIPS with 1.2beta2 (faster but not working) I don't worry that much, as it's not the optimized version, and everything is running in SDRAM. Can you give me some advice on what I should try to put into internal SRAM ? Critical code ? Input samples ? Code-books ? Can we pre-allocate internal buffers heavily used by the encoder ? I'm also trying to compile Speex with asm optimizations. But it's targetted for GCC... I went through the archives, and found some entry-points to port asm-constraints to the VDSP compiler. But I'm facing the problem of 'dynamic' labels for loops. I don't know if Michael Shatz has completed the port... If you're reading this. Would you share your files ? Jean-Marc, I don't want to come back on the debate, but I think you should include the VDSP architecture. (there is also a problem with variables named "bank" which is a compiler keyword...) Best regards. -- St?phane Lesage ATEIS International
Jean-Marc Valin
2007-Oct-16 16:58 UTC
[Speex-dev] Blackfin port on Visual DSP, Michael Shatz ?
Some things to check. Do you compile with VAR_ARRAYS? If not, you can probably reduce the size of the managed stack. In terms of data RAM, everything should fit into SRAM easily. I've done some massive wideband RAM reduction in 1.2beta2. If it's not working on Blackfin, then we'd need to investigate that first. Depending on whether you're using all the bit-rates, you might want to put only some of the codebooks in SRAM (if you tell me what bit-rate, I can tell you which codebooks you need). About code, it could be a bit more tricky and I don't know whether everything can fit into SRAM.> Jean-Marc, I don't want to come back on the debate, > but I think you should include the VDSP architecture.What do you mean by "the VDSP architecture"?> (there is also a problem with variables named "bank" > which is a compiler keyword...)You don't even need that part of the code actually. Try getting the git/svn version where I actually did a split into libspeex and libspeexdsp. The one you need is libspeex only. Cheers, Jean-Marc St?phane Lesage wrote:> Hi, > > I'm using the Speex codec on my Blackfin-based board, > and plain-C performance is pretty poor. > > Decoder is OK (something 25 MIPS for wide-band). > But Encoder is not (wide-band quality 8, complexity 1): > - 162 MIPS with Analog-Devices lib > - 128 MIPS with 1.2beta2 (faster but not working) > > I don't worry that much, as it's not the optimized version, and everything > is running in SDRAM. > > Can you give me some advice on what I should try to put into internal SRAM ? > Critical code ? Input samples ? Code-books ? > Can we pre-allocate internal buffers heavily used by the encoder ? > > > I'm also trying to compile Speex with asm optimizations. > But it's targetted for GCC... > > I went through the archives, and found some entry-points to port > asm-constraints to the VDSP compiler. > But I'm facing the problem of 'dynamic' labels for loops. > > I don't know if Michael Shatz has completed the port... > If you're reading this. Would you share your files ? > > > > Best regards. >
Stéphane Lesage
2007-Nov-21 15:56 UTC
[Speex-dev] Blackfin port on Visual DSP, Michael Shatz ?
> -----Original Message----- > From: Jean-Marc Valin [mailto:jean-marc.valin@usherbrooke.ca] > Sent: Wednesday, October 17, 2007 1:56 AM > To: St?phane Lesage > Cc: speex-dev@xiph.org > Subject: Re: [Speex-dev] Blackfin port on Visual DSP, Michael Shatz ?Salut Jean-Marc, After 1 month busy on other projects, I can finally answer you:> Some things to check. Do you compile with VAR_ARRAYS? If not, > you can probably reduce the size of the managed stack. In > terms of data RAM, everything should fit into SRAM easily.No I didn't know this macro. According to the sources, I understand it's destined to compilers supporting run-time size for local arrays on the stack. But this is not documented (API or user manual), and does not appear in any header file. It should appear at least in arch.h, commented and defaulting to #undef... BTW, do you have figures on the stack-usage of the different Speex modules ?> I've done some massive wideband RAM reduction in 1.2beta2. If > it's not working on Blackfin, then we'd need to investigate > that first.I compiled 1.2beta1, beta2, and the SVN from yesterday. Beta1 works fine, but starting from beta2, the sound is scrambled... Of course, project options are identical. Did you change something in the API ? Do I need to initialize extra things ? See myspeex.c code. It's pretty simple. I noticed a very interesting thing: the echo-cancellation totally removes this problem !!! How can I help you debug this thing ? My platform is Blackfin fixed-point on visual DSP. I can't use the debug-out on VDSP (too slow), but my custom-board has IP and RS232 interfaces which could help.> Depending on whether you're using all the > bit-rates, you might want to put only some of the codebooks > in SRAM (if you tell me what bit-rate, I can tell you which > codebooks you need). > About code, it could be a bit more tricky and I don't know > whether everything can fit into SRAM.Actually performance is not my priority for the moment, as long as Encoder + Echo cancellation + UDP + Decoder runs in real-time on a 400 MHz BF-537. (I'll see later if I can use a slower processor)> > Jean-Marc, I don't want to come back on the debate, but I think you > > should include the VDSP architecture. > > What do you mean by "the VDSP architecture"?The Visual DSP++ assembler/compiler/linker tools.> > (there is also a problem with variables named "bank" > > which is a compiler keyword...) > > You don't even need that part of the code actually. Try > getting the git/svn version where I actually did a split into > libspeex and libspeexdsp. The one you need is libspeex only.I also need the echo-cancellation. and actually I don't know in which files it's implemented ! So I just renamed the variables/members to "bnk". Can you include these modifications ? BTW, everything is in the /libspeex directory... It does not look like we have 2 projects. Moreover you also have examples in this directory. Most users using IDEs are not familiar with make-files and don't know what files to include in their projects. (already seen this on the mailing-list) Maybe you should split it into: /libspeex /libspeexdsp /tests -- St?phane Lesage ATEIS International -------------- next part -------------- A non-text attachment was scrubbed... Name: myspeex.c Type: application/octet-stream Size: 1453 bytes Desc: not available Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20071121/3a00cf4e/myspeex.obj