[FFmpeg-devel] [PATCH] Arithmetic decoding in ALS

Michael Niedermayer michaelni
Mon Jan 25 12:16:16 CET 2010


On Tue, Jan 19, 2010 at 11:54:50PM +0100, Thilo Borgmann wrote:
> Am 19.01.10 19:37, schrieb Michael Niedermayer:
> > On Thu, Jan 14, 2010 at 03:20:04PM +0100, Thilo Borgmann wrote:
> > [...]
> >> The size of the luts might be further reduced if the shifted symbol
> >> would be stored and use a smaller type than uint for the luts. Then, the
> >> stored symbol would have to be shifted back before usage, but this again
> >> costs many << operations (one for each sample in the file). Useful?
> > 
> > I think this is a good idea, the luts look a little large to me
> 
> 
> 3509969 dezicycles in bgmc NO shift & unsigned int, 512 runs, 0 skips
> ->
> 3738521 dezicycles in bgmc DO shift & uint8_t, 512 runs, 0 skips

that seems like a quite big speedloss :/
have you checked that the code work? (same number of iterations in
the loop?)


> 
> 

> Also I made the luts non-static what should make them thread safe,
> doesn't it?

no, if you write from 2 threads different data into a common place you
need thread synchronization.
What works is writing the same data or writing from just one thread.
In practice that means each byte in each lut can only be in one of 2
states, uninitialized and a single constant value. Another way to see
it is that all static and global tables must be constant or you need
thread sync / only a single thread writing




[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100125/052da84b/attachment.pgp>



More information about the ffmpeg-devel mailing list