[FFmpeg-devel] [PATCH] G.729 Fixed-codebook vector decoding

Michael Niedermayer michaelni
Sun Jun 28 03:22:52 CEST 2009

On Sat, Jun 27, 2009 at 09:27:23AM +0700, Vladimir Voroshilov wrote:
> 2009/6/27 Michael Niedermayer <michaelni at gmx.at>:
> > On Sat, Jun 27, 2009 at 02:05:27AM +0700, Vladimir Voroshilov wrote:
> >> Memset is required, since vector should contain only several non-zero pulses
> >
> > if the thing is sparse, memset could maybe be replaced by just setting
> > the non zero values to zero, in that sense many operationson on sparse
> > vectors can be done more efficiently than working on an array of zeros
> > with one non zero value, which if it applies here means you have to
> > rewrite the related code to be more efficient
> Hmm..
> Does you mean "invert" vector (replace zero with non-zero and vice versa) ?
> What values whould contain non-zero parts in your suggestion?
> Here is how i uderstand fixed-codebook vector generation.
> Fixed-codebook vector defines where four (or three, depends on mode)
> pulses of sound are placed in
> current frame (which is zero at this stage). Afaik, fixed-codebook
> vector defines signal which in "new"
> in current frame and is not continuation oprevious frame's sound.
> Routine sets 1 at this positions, setting all other to 0.
> "1" related to pulse of sound, "0" means silence.
> Later this vector will be weightly summed with excitation signal.
> Thus, either your suggestion is deep math or heavy optimization which
> i can't understand.

adding a sparse vector with 4 non zero pulses to another vector is a O(1)
operation, your code needs O(n) that is not acceptable. (that is based on
your description above)

Its simply that you add n-4 values with n-4 zeros and 4 values with
4 non zero values, thats not deep math

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090628/6de38630/attachment.pgp>

More information about the ffmpeg-devel mailing list