Skip to main content.
May 11th, 2005

Sick and compressing

Friday I left the office and it was raining. I didn’t buy an umbrella because it wasn’t so bad.
Saturday I went out, Sunday night I went to sleep and felt as I was getting sick. By the end of Monday I was sick indeed !
Today, Tuesday, I decided to call in sick and face the cold and sore throat before it would get worse. It wasn’t that bad, but when it’s bad it’s already too late.
The theory goes that with cold wind, one gets his/her throat dry, making the job easier for the bacteria. That may be so, but it’s definitely not the whole story ! One get’s wet in a cold environment, he/she sneezes and there starts the cold effect. It’s that simple, but I don’t know of any proper scientific explanation for this.. at least it’s not common knowledge.

In any case, I spent a few hours on Sunday and Monday on video compression, and the not-so-sick part of today too. I’ve finally came up with some working, decent, implementation. It’s all black & white, but it’s also 640×480.
Trying to video chat at 640×480 is quite a challenge. Capturing with DirectShow from a USB 2 web-camera alone takes a big slice of CPU ! To that must be added the necessary noise reduction, then compressing one frame while decompressing another. I’ve thought about using graphics hardware acceleration to help the CPU, but the good accelerators, those with pixel shaders, are of course on already powerful computers. This is again the big trouble with PCs.. while I see that Apple has been pushing the use of hardware acceleration to do video processing. Having a relatively fixed spec hardware definitely helps push things forward. Apple also uses the AltiVec instruction set, since that’s standard on the recent Macs.
In any case, I’m hoping for a test dev release. Something for others to test (help me to test 8). First I need to add color, because B&W really sucks ! After that, I will try optimize further the compression.

One good starting point for improving compression is to assume that the camera doesn’t move and that the subject(s) are in front of a camera with a relatively static background.
At first, the moving subject will cover one part of the background, then uncover it while covering another part. My goal, would be to progressively memorize the whole background, so that at one point the subject can move anywhere and (ideally) none of the background data will need to be re-transmitted.
Something like this is already implemented in MPEG-1 compression. Hardly anything is new nowadays, it’s mostly matter of efficiently implement some specific ideas in a simple way so that code doesn’t get too complex and encoding doesn’t take too much time. Assuming that the camera is fixed helps avoiding to deal with motion compensation, a very powerful technique that is also very time consuming !

Time to zzzzzzz
poof

Posted by Davide Pasca in Uncategorized

This entry was posted on Wednesday, May 11th, 2005 at 2:13 am and is filed under Uncategorized. You can follow any responses to this entry through the comments RSS 2.0 feed. You can leave a response, or trackback from your own site.

3 Responses to “Sick and compressing”

  1. Rince says:

    Thats what we like to see.

    No Dottertheory updates.

    Here we have discovered and hopefully fixed a rather sad bug that was in our engine since 2001!!

    Basically the world rendering microcode ( not originally written by me ) was using a world space to clipspace transformation to make use of the clipw instruction to classify vertices for clipping and then the clipping code was transforming them from clip space to screen space, which due to precision was not always the same as transforming a vertex directly from world to screen space and sometimes cracks could be seen between clipped and unclipped triangles!!!

    Very sad indeed.

    So we modified the clipping microcode to remember the vu1 memory address of the original untransformed vertex in world space. And then when we render we check to see if the vertex we are rendering got generated by the clipper or if it is one of the original vertices in which case we load up its original value and transform it from world to screen space directly. This got rid of the seams.

    However this introduces a branch in the vertex loop which is not good for performance, however the way clipping works here is in 2 passes. In 1st pass it traverses the strip and sets all vertices that need clipping to no-kick and draws the whole strip. In the 2nd pass it searches for triangles that need to be clipped and clips and draws them individually. So in the end the amount of vertices that go through the clip rendering loop is rather small.

    Hmmmm we will see…..

  2. Davide Pasca says:

    I thought that at one point you were converting vertices from screen space (plus Z) backward into clip space in order to clip them. That’s definitely worrysome.
    As for the actual current issue. I’m doing the same thing but I never noticed any gaps, possibly because my PS2 engine has hardly ever been used 8)

  3. ragin' lion says:

    Wow. Sounds like PS2 programming here! 8P Good thing I don’t have to worry about such minute details … but having said that … bugs in shader code can induce misery!

    I agree w/ Mr. Rince; about time we saw some serious progress being done on the video stuff. Maybe you should be sick often! (^-^)

    If you need a tester, just let me know. I’ve also got my oldsk00l P3-450MHz machine available for “performance” testing. ;-)

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>