[vorbis-dev] Encoding in Delphi - Help
Crock Real
integracrock at yahoo.com
Sat Nov 8 04:50:35 PST 2003
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, at readbuffer[0],bytes div 4);
uninterleave(buffer, at 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 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