Andy,

SPHENC/SPHDEC are not actual codecs. They are abstract decription of
the model of codec API that you have to implement.
You will have to create actual wrapper for your encoder and decoder, let's call 
them
SPEEXENC and SPEEXDEC.
This as xDAIS/xDM wrappers above your actual library.

Anyhow I would implement SPEEXENC into speexenc.l64 (without merging
speex-base), SPEEXDEC into speexdec.l64. You would use them into the XDC
definition of your server. Then add speex-base.l64 into your LINK.CMD file
for your server. But that more a matter of preference than an actual defined
rule. May be Chris can comment on that.

>  and couldn't figure
> out which file to edit so that it will link the Speex library with the codec 
> during the build
because this is would be done (in my choice) at server level in LINK.CMD
You don't have a way in a (codec) library to declare a dependency to another
library and expect the tools to find it automatically. So development 
environement
such as C# (or old Turbo Pascal) lets you declare libs (units) you are depending
on so that they are automatically searched by the linker. In C you have to 
provide
at least all the lib into which the linker search for symbols.

> the makefile is automatically 
Mostly all codec and server build mecanism is driver by XDC files which
then generates makefiles and usefull files.


So in conclusion a short path looks like:
- copy all /dvevm_1_10/codec_engine_1_02/examples/codecs/sphdec_copy 
  into /dvevm_1_10/codec_engine_1_02/examples/codecs/speexdec
- rename modules, files, symbols in soure code, xdc files, ... in order to build
  a new codec library named speexdec.l64 which includes a definition of
  the SPEEXDEC algorithm.
- If you want to try, build it, build the depending server (add the declaration
  of speexdec into its configuration files), modify sample code to instantiate
  "speexdec" instead of "speechdec_copy" and tryout the sample
   => once this is done you made probably the more complex stuff
- now modify C source code of SPEEXDEC class to make call to your
  speexdec-base.l64 API
- add "-l speex-base.l64" to your LINK.CMD
- rebuild and you should be able to truly decode speex data now.


Hope this helps.

Regards,

Jean-Michel.

  ----- Original Message ----- 
  From: Andy Ngo 
  To: Jean-Michel Mercier ; [email protected] 
  Sent: Tuesday, January 09, 2007 6:03 PM
  Subject: Re: Merging enc and dec codecs


  Jean-Michel,

  Thanks for the response.  I kinda understand what you are saying.  So let's 
say I have the source 
  code for the Speex library, which has both the API for decode and encode; so 
let's say I want
  to use SPHENC and SPHDEC as wrappers to access the API in the Speex library.  
How do I
  add/compile/link the library to both SPHENC and SPHDEC?  Do I add the Speex 
source code
  to the SPHENC codec "AND" to the SPHDEC codec?  Would that be redundant and 
create
  "symbol already defined" errors since the Speex library code is linked twiced?

  On a related note, let's say I have a precompiled Speex library that I 
compiled under CCS 3.2
  already; how do I link it to the SPHENC or SPHDEC?  For example, I look at 
the different
  files in /dvevm_1_10/codec_engine_1_02/examples/codecs/sphdec_copy and 
couldn't figure
  out which file to edit so that it will link the Speex library with the codec 
during the build; the
  makefile is automatically generated so I can't touch that; the only file that 
seems to make sense
  is the package.bld, which shows how to add c modules to be built to into the 
package libary.

  Please advise.  Thanks.

  Regards,
  Andy Ngo


  ----- Original Message ----
  From: Jean-Michel Mercier <[EMAIL PROTECTED]>
  To: Andy Ngo <[EMAIL PROTECTED]>; 
[email protected]
  Sent: Tuesday, January 9, 2007 5:20:35 AM
  Subject: Re: Merging enc and dec codecs


  Andy,

  You don't specifically need to link your codec to the existing servers
  unless you want to simultaneously use the other codecs with your
  speex codec.
  As far as you are goind to make change to servers (Welcome to
  the World of DV SDK and XDC!), it is now up to you to make your
  own combination of codecs into servers with regard to your application
  needs.

  What is clear is that each codec must have its own API in the appropriate 
class.
  So if your base Speex codec have a single library for both encode
  and decode, you will any how have to wrap the encoder into a SPHENC
  class and the decoder into a SPHDEC.
  I don't remind seeing anything that prevent you implementing the
  2 classes into a single library. What is important is that instanciation
  and control should remain separate to respect the xDM specifications.

  Then you can build the server(s) that you need. As an application can talk
  simultaneously to a single server, you must make either separates
  (half-duplex) encode and decode servers or a (full-duplex) encode+decode
  server.

  Hope this helps.

  Regards,

  jean-michel.

    ----- Original Message ----- 
    From: Andy Ngo 
    To: [email protected] 
    Sent: Thursday, January 04, 2007 9:50 PM
    Subject: Merging enc and dec codecs


    I'm trying to implement the open-source Speex codec (www.speex.org) into a 
Code Engine Server.  The Speex library has both
    the encoding and decoding support functions.  Does that mean I have to link 
the library to the CE enc codec and also to the CE dec
    codec?  I want to save memory resources and possibly share global state 
data in the library between the enc and dec codecs; is
    there a way to combine both the enc and dec codecs into one?

    By the way, I'm new to the CE API so I have a huge learning curve;  I've 
read through the documents and looked at the codec
    examples and it's still a little foreign to me.  I have built the Speex 
library for a TMS320 5510 DSP before, can I just link the library
    with a CE codec or do I have to massage the Speex source into the CE API 
method and rebuild it?

    Thanks,
    Andy




    _______________________________________________
    Davinci-linux-open-source mailing list
    [email protected]
    http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to