[vorbis-dev] encoding from 22050Hz source

Daniel Holth dholth at fastmail.fm
Tue Apr 20 19:29:44 PDT 2004



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Smith wrote:

| On Tuesday 20 April 2004 23:12, Crock Real wrote:
|
|> Hi!
|>
|> I use libraries from the win32sdk-1.0.1. Is it ok?
|>
|> My program halts at line:
|>
|> while(vorbis_analysis_blockout(vd,vb)=1) do Begin ->
|> vorbis_analysis(vb,op);  //"Invalid floating point operation"
|> //but not at once, only in the third loop... And just then, when
|> the source is 22050Hz...

I have this frustrating problem with gentoo + python's numarray + my
oggpy wrapper: vorbis encoding and decoding generates floating point
exceptions. Only on gentoo, and maybe only on my compile of gentoo.
Others have had the same problem with completely different libraries.
Possibly some compiler flag was set, somewhere, in one of the
libraries used, that results in this snafPu. Recompiling everything
has been known to help. Unfortunately I haven't solved my problems
with this yet.

I assume you don't want your program to die when it divides by zero,
rather just live with the NaN and -inf and +inf. Solutions may include
handling SIGFPE or disabling the exception.

~From the GNU libc info pages:

~       "When exceptions occur (when exceptions are "raised", in the
~    language
~    of the standard), one of two things can happen.  By default the
~    exception is simply noted in the floating-point "status word",
and the
~    program continues as if nothing had happened.  The operation
~    produces a
~    default value, which depends on the exception (see the table below).
~    Your program can check the status word to find out which exceptions
~    happened.

~       "Alternatively, you can enable "traps" for exceptions.  In that
~    case,
~    when an exception is raised, your program will receive the `SIGFPE'
~    signal.  The default action for this signal is to terminate the
~    program.  *Note Signal Handling::, for how you can change the
~    effect of
~    the signal."

There are some new C99 functions that help the programmer control and
examine FPU exceptions. This glibc documentation page might be a good
starting place:
http://www.gnu.org/software/libc/manual/html_node/Floating-Point-Errors.html#Floating%20Point%20Errors

If you figure this out, please share!

- - Daniel Holth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAhdyXVh4W2pVfoMsRAucGAJ9+VVUxZOK5hK8EWRC3xiSK5G9qOACgp4tq
hdw3z/u340w9XztBiUo65f4=
=l1Lg
-----END PGP SIGNATURE-----

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list