<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Tony Garnock Jones has some bit comprehension libraries on planet I believe.&nbsp;</div><br><div><div>On Jun 14, 2012, at 8:12 PM, Anurag Mendhekar wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div style="color:#000; background-color:#fff; font-family:tahoma, new york, times, serif;font-size:12pt"><div><span><br></span></div><div>Thanks for all the helpful suggestions.&nbsp;</div><div><br></div><div>1. Full agreement on using macros to make things efficient. Ramakrishnan Muthukrishnan pointed me to an excellent paper on Bit-Comprehensions (think set/list comprehensions for bits) in Erlang and we are trying to use similar metaphors for h264 (the bit comprehensions don't directly translate due to context sensitivity of the h264 bit stream), but we will definitely be exploiting the power of macros for efficiency.&nbsp;</div><div><br></div><div>2. Typed racket is also something we will explore. Are there any benchmarks out there for typed v. untyped racket? Also, I'm assuming we can restrict ourselves to typed racket only where it really matters so that we can move back-and-forth between typed and untyped
 racket.&nbsp;</div><div><br></div><div>Best,</div><div><br></div><div>A.&nbsp;</div>  <div style="font-size: 12pt; font-family: tahoma, 'new york', times, serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Eli Barzilay &lt;<a href="mailto:eli@barzilay.org">eli@barzilay.org</a>&gt;<br> <b><span style="font-weight: bold;">To:</span></b> Anurag Mendhekar &lt;<a href="mailto:mendhekar@yahoo.com">mendhekar@yahoo.com</a>&gt; <br><b><span style="font-weight: bold;">Cc:</span></b> "<a href="mailto:users@racket-lang.org">users@racket-lang.org</a>" &lt;<a href="mailto:users@racket-lang.org">users@racket-lang.org</a>&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, June 14, 2012 7:26 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [racket] H264 Codec in Racket<br> </font> </div> <br>
More than a week ago, Anurag Mendhekar wrote:<br>&gt; I'm considering writing an H.264 encoder/decoder in Racket. Has<br>&gt; anyone tried such a thing before?<br>&gt; <br>&gt; Codecs require a lot of bit-whacking and the h264 standard is<br>&gt; particularly convoluted. Efficiencies are obtained in C in many<br>&gt; different and usually complex ways. Codec experts usually recommend<br>&gt; starting at C/++ and go to assembly to extract further performance.<br>&gt; <br>&gt; Does any one have thoughts on this? Would someone be interested in<br>&gt; working with me on an open-source project for this? I expect an<br>&gt; exercise like this will also push the Racket implementation to<br>&gt; deliver higher performance, or will establish a proof point about<br>&gt; how good the implementations is.<br><br>You've got a bunch of suggestions -- and many of them focus on<br>traditional aspects of these problems (like using TR to make the code<br>run faster, the
 problem of dealing with 32-bit numbers etc).&nbsp; But one<br>thing that wasn't mentioned is that Racket has the advantage of<br>macros, which can often be used in such bit-whacking (nice term)<br>situations.&nbsp; It can be used to easily pre-generate some code that<br>would otherwise be too complicated to write.&nbsp; When you say<br><br>&nbsp; &nbsp; Efficiencies are obtained in C in many different and usually<br>&nbsp; &nbsp; complex ways.<br><br>then my guess is that that's a perfect case for doing these kind of<br>things.<br><br>-- <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ((lambda (x) (x x)) (lambda (x) (x x)))&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Eli Barzilay:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://barzilay.org/">http://barzilay.org/</a>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  Maze is Life!<br><br><br> </div> </div>  </div></div>____________________<br> &nbsp;Racket Users list:<br> &nbsp;<a href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a><br></blockquote></div><br></body></html>