Hi! I've made a vorbis encoder in delphi, but it's very verey slow! It takes 5 minutes to encode a pcm file. And i don't know why. Could anyone help me??? ---------------------------------------------------------------------------------- result := ogg_stream_flush(os, og); while result <> 0 do begin OutFile.Write(Pointer(og.header)^, og.header_len); OutFile.Write(Pointer(og.body)^, og.body_len); result := ogg_stream_flush(os, og); end; eos := false; while not eos do begin bytes := InFile.Read(readbuffer, SAMPLES*4); if bytes = 0 then begin fix; vorbis_analysis_wrote(vd,0); end else begin fix; buffer := vorbis_analysis_buffer(vd, SAMPLES); // uninterleave_little_endian(buffer,@readbuffer[0],bytes div 4); uninterleave(buffer,@readbuffer[0],bytes div 4); vorbis_analysis_wrote(vd, bytes div 4); end; fix; while(vorbis_analysis_blockout(vd,vb)=1) do begin fix; vorbis_analysis(vb,op); fix; vorbis_bitrate_addblock(vb); fix; while(vorbis_bitrate_flushpacket(vd,op)<>0) do begin fix; ogg_stream_packetin(os,op); while (not eos) do begin fix; result:=ogg_stream_pageout(os,og); if(result=0) Then break; OutFile.Write(Pointer(og.header)^, og.header_len); OutFile.Write(Pointer(og.body)^, og.body_len); fix; if(ogg_page_eos(og) <>0) then eos:= true; end; end; end; end; ----------------------------------------------------------------------------------------------- I'm not an expert, so I don't know what I should use: beg endian, or little endian. Matthijs Laan uses: SAMPLES = 4096; and readbuffer: array[0..SAMPLES*4-1] of Byte; but in the encoder_example.c : SAMPLES = 1024; and char readbuffer[SAMPLES*4+44]; Why??? Please help me! Thank you in advance! IntegraCrock <p>--------------------------------- Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
On Sat 8 November 2003 13:50, Crock Real wrote:> Hi! > > I've made a vorbis encoder in delphi, but it's very verey slow! > It takes 5 minutes to encode a pcm file.How big is the file, and on what kind of computer? What quality are you using? How fast can oggenc compress it at the same settings?> And i don't know why. Could anyone help me???<snip Delphi code> What is this fix; procedure call I see everywhere (I programmed in Pascal many moons ago, but I've never done Delphi, and I couldn't find it on the web). Does it by any chance sync disks?> ----------------------------------------------------------------- >------------------------------ I'm not an expert, so I don't know > what I should use: beg endian, or little endian. Matthijs LaanThat depends on your input file. If it's little endian, use little endian, else if it's big endian use big endian. Doing this the wrong way around might (haven't tried actually) increase compression time, since then you're trying to compress noise essentially.> uses: SAMPLES = 4096; and readbuffer: array[0..SAMPLES*4-1] of > Byte; but in the encoder_example.c : SAMPLES = 1024; and char > readbuffer[SAMPLES*4+44]; Why???A larger buffer shouldn't hurt, and might improve read performance because less reads are done in total. Lourens -- GPG public key: http://home.student.utwente.nl/l.e.veen/lourens.key --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
> I've made a vorbis encoder in delphi, but it's very verey slow!you can try to compare it with our Delphi conversion: http://lakeofsoft.com/vc/vorbis_examples_delphi.zip <p>With best wishes, Aleksandr Shamray <p>--- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.