[x264-devel] Re: Extracting the CABAC coder from x264 sources?

Loren Merritt lorenm at u.washington.edu
Fri Aug 25 09:00:07 CEST 2006


On Thu, 17 Aug 2006, Tomas Carnecky wrote:

> Tondeur Steven wrote:
>> As far as I know, you don't have to perform a flush after encoding a terminal bit 0, only after a 1.
>>
>
> nah, a flush is always needed. I've created a little demo:
>
> http://dbservice.com/ftpdir/tom/acdemo.c
> http://dbservice.com/ftpdir/tom/cabac.c

I can't see it (http 404).

> copy both files into one directory and compile with:
> $ gcc -std=c99 -o acdemo acdemo.c
> and run with:
> $ ./acdemo /path/to/file
> It will encode and decode the file and put the result into a new file
> called 'out'. 'out' and '/path/to/file' should be identical (md5sum).
> You can play with encode_terminal/encode_flush and see what the assert()
> does..

If you look in x264 you'll find that encode_terminal(1) is always followed 
by encode_flush, and encode_terminal(0) never is.
Flush is what you do when you terminate encoding. It would defeat the 
purpose of encode_terminal if you had to terminate encoding even when you 
said you were not doing so.

> But cabac is too slow, I need something that is ~20x faster :) Too bad
> that the cavlc code in x264 doesn't have a decoder...

ffmpeg's rangecoder is somewhat faster than cabac, but not nearly 20x.
If it needs to be that fast, you probably can't afford the
context-adaptive part of cavlc either, just the vlc :)

--Loren Merritt

-- 
This is the x264-devel mailing-list
To unsubscribe, go to: http://developers.videolan.org/lists.html



More information about the x264-devel mailing list