<br><br><div><span class="gmail_quote">2007/9/9, Josh Coalson <<a href="mailto:xflac@yahoo.com">xflac@yahoo.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
--- Harry Sack <<a href="mailto:tranzedude@gmail.com">tranzedude@gmail.com</a>> wrote:<br>> 2007/9/8, Josh Coalson <<a href="mailto:xflac@yahoo.com">xflac@yahoo.com</a>>:<br>> ><br>> > it actually is complicated. the libFLAC api is not suited to a
<br>> > multithreaded design because the i/o is stream-based, not file-<br>> > based. flac(.exe) is the file-based wrapper around libFLAC that<br>> > allows it to work on files. the way libFLAC buffers data is also
<br>> > impossible to parallelize without significantly changing the api.<br>><br>> why was this approach used?<br><br>because the tradeoffs I described required for arbitrarily parallel<br>encoding significantly complicate the api and implementation.
<br>libFLAC was not design for multicode file encoding on PCs, it is a<br>reference design that is also being used in embedded devices running<br><100MHz, low memory, all kinds of different OSes, etc.</blockquote><div>
<br><br>euh :) Just make a flag or something in the api that enables the code for low cpu power devices and/or streaming and disable this when encoding on fast pc (so no streaming)? So it uses file based code then for encoding of files on pc's with multiple cpu's and stream based code for all other devices and streaming :)
<br>Then you have both in the API! <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> The API design seems to me not very smart
<br>> because it's not flexible and you're stuck in the future (like now<br>> for multiple core support)<br>><br>> I don't see any reason why you wouldn't make it all based on files<br>> and not on streams :s It's just a major disavantage in my opinion
<br><br>an api cannot be all things to everyone. </blockquote><div><br><br>sure it can: you just have to make some different cases (low cpu power device/streaming or multi-core cpu) and call the apprioprate functions <br>
</div><br><div><br><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">you keep making this<br>assertion but if you actually tried to implement it (and I hope
<br>you will) the problems we are all bringing up will quickly become<br>obvious.<br><br>your own lame-mt example is not an incremental improvement but a<br>significant rewrite of lame (and also does not have nearly the<br>
performance advantage of process-level parallelism, see<br><a href="http://www.hydrogenaudio.org/forums/index.php?showtopic=50862">http://www.hydrogenaudio.org/forums/index.php?showtopic=50862</a>)</blockquote><div><br>It's multi-threaded and that's what I mean: people here say an audio codec can't be written multi-threaded and it will give no performance boost:
<br>1) that's false: se LAME MT<br>2) performance boost up to 30%: see LAME MT again<br><br>For very large files you must wait not so long before it's encoded vs. the original LAME. <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> > it would take a specialty file-based encoder using an independent<br>> > frame encoder to do and even that is not trivial.<br>><br>> so we can assume that those API changes will never come and the flac
<br>> encoder will never have multiple core support?<br><br>you can assume libFLAC will probably not have it. if you can modify<br>libFLAC to make a multithreaded encoder like flac-mt that would be<br>neat and probably useful to some people. until that time there is
<br>not much point repeating the same assertions which are just going to<br>aggravate people.<br><br>Josh<br><br><br><br><br>____________________________________________________________________________________<br>Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
<br><a href="http://smallbusiness.yahoo.com/webhosting">http://smallbusiness.yahoo.com/webhosting</a><br></blockquote></div><br>