PDA

View Full Version : Question about writing a codec


Chu
25th July 2002, 10:42
Hello all. I have a quick question about actuially writing a codec. I have a lot of expirence with c++ in un*x environments, but absolutly 0 expirence with developing windows apps. Anyways, I wanted to try writing a codec. I know what algorithm I want to use (progressive huffman encoding /w some "tricks"), and while I doubt I can do any better then huffyuv, who knows. Anyways, I was looking through the source of huffyuv, and, well, I'm having trouble figuring out exactly how windows handles these things :\

So far, the only thing I've really figured out on my own is exactly how avi wrappers work, and how to call codecs with fourcc codes using vfw.h, but am completly lost as to how to actuially write an interface between the codec and windows.

I guess I need a big primer on how windows handles events in general, and how exactly windows deals with these codecs. Anyways, can someone point me to the right place to start reading up on this stuff?

-Chu

Richard Berg
26th July 2002, 03:59
Unfortunately there's really no good resources; everything on MSDN deals with DirectShow. If you don't need VfW compatibility then that's fine (have fun writing the billion little methods it requires...), but if you do the only suggestion I have is to email someone who knows the ins & outs of VfW (e.g. Avery Lee) and ask for a reference.

avih
26th July 2002, 08:46
you can use xvid, which is open source. the code should be quite clean, and you can ask specific questions on the xvid.org forum. it uses the vfw framework, but it's already there.. so u'll just have to modify the encodeing/decoding algorithms.

cheers and good luck
avi

Chu
26th July 2002, 18:40
Allright, thanks for the info!

BTW, for the purposes of video, most of the encoding I do myself is anime. I've been wondering, do you think the entropy between frames is 'polar' enough (i.e. bunch of pixels ~0, and the rest all over the map) to justify arithematic coding instead of huffman? The obvious tradeoff being speed, unless there is a progressive arithematic algorithm I am not aware of.

-Chu

P.S., the last time I was graded in spelling I got an F.

Richard Berg
26th July 2002, 19:09
Here's a paper (http://www.doc.ic.ac.uk/~ajf/Teaching/Projects/Distinguished00/MaxSmith.ps) you may want to look at.

spyder
30th July 2002, 18:10
Ah, finally some work on an Anime codec perhaps. There has to be a good method for this yet to be discovered.