I tried to compress 160 samples of random garbage (range 0-500.f) at 4kbps and got a crash in nb_encode -> forced_pitch_quant because start was -858993460 (== ol_pitch). -- Daniel, Epic Games Inc. --- >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 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
> Can someone else reproduce this or am I on crack and should look for a bugelsewhere? Sorry, my fault, I was on crack - I was accidentaly sending in bogus data to compress. The library would be more foolproof if there were a way to pass in data as shorts instead of floats to avoid possible issues with sending in NaNs or INF or really big/small numbers :) -- Daniel, Epic Games Inc. --- >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 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Le mer 12/03/2003 à 22:39, Daniel Vogel a écrit :> I tried to compress 160 samples of random garbage (range 0-500.f) at 4kbps > and got a crash in nb_encode -> forced_pitch_quant because start > was -858993460 (== ol_pitch).I haven't been able to reproduce the problem. Can you send either an audio file that reproduces the problem with speexenc or a simplified bit of source code that I can use? So far, I have one potential (but unlikely) explanation: in the file ltp.c, line 83, you have: for (i=0;i<N;i++) { best_score[i]=-1; gain[i]=0; } can you change that to: for (i=0;i<N;i++) { best_score[i]=-1e10; gain[i]=0; pitch[i]=0; } and see if it works? Jean-Marc -- Jean-Marc Valin, M.Sc.A. LABORIUS (http://www.gel.usherb.ca/laborius) Université de Sherbrooke, Québec, Canada <p> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 242 bytes Desc: signature.asc Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20030312/6625650b/signature-0001.pgp
Narrowed it down a bit. For me the code crashes encoding the second frame if
the first encoded frame was all zeros. Can someone else reproduce this or am
I on crack and should look for a bug elsewhere?
// Initialize speex encoder.
SpeexEncoderBits = new SpeexBits;
SpeexEncoderState = speex_encoder_init(&speex_nb_mode);
INT FrameSize,
SamplingRate = 8000, // 8000 Hz
BitRate = 4000; // 4kbps == 10 bytes per 20 ms
peex_encoder_ctl( SpeexEncoderState, SPEEX_SET_BITRATE , &BitRate );
speex_encoder_ctl( SpeexEncoderState, SPEEX_SET_SAMPLING_RATE ,
&SamplingRate );
speex_encoder_ctl( SpeexEncoderState, SPEEX_GET_FRAME_SIZE , &FrameSize );
FLOAT Src[VOICE_FRAME_SIZE];
appMemzero( Src, sizeof(Src) );
char Dest[VOICE_FRAME_SIZE];
peex_bits_init( SpeexEncoderBits );
speex_bits_reset( SpeexEncoderBits );
speex_encode( SpeexEncoderState, Src, SpeexEncoderBits );
INT PacketSize = speex_bits_write( SpeexEncoderBits, Dest,
VOICE_FRAME_SIZE );
check( FrameSize == VOICE_FRAME_SIZE );
check( PacketSize == FVoicePacket::Size );
peex_bits_reset( SpeexEncoderBits );
speex_encode( SpeexEncoderState, Src, SpeexEncoderBits ); //<-- boom!!!
Thanks,
-- Daniel, Epic Games Inc.
> -----Original Message-----
> From: owner-speex-dev@xiph.org [mailto:owner-speex-dev@xiph.org]On
> Behalf Of Daniel Vogel
> Sent: Wednesday, March 12, 2003 10:40 PM
> To: speex-dev@xiph.org
> Subject: [speex-dev] libspeex crash with RC3
>
>
> I tried to compress 160 samples of random garbage (range 0-500.f) at 4kbps
> and got a crash in nb_encode -> forced_pitch_quant because start
> was -858993460 (== ol_pitch).
>
> -- Daniel, Epic Games Inc.
>
> --- >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
> 'speex-dev-request@xiph.org'
> containing only the word 'unsubscribe' in the body. No subject is
needed.
> Unsubscribe messages sent to the list will be ignored/filtered.
>
--- >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
'speex-dev-request@xiph.org'
containing only the word 'unsubscribe' in the body. No subject is
needed.
Unsubscribe messages sent to the list will be ignored/filtered.