[flac-dev] about word size in bitreader/bitwriter

Miroslav Lichvar mlichvar at redhat.com
Mon Jan 4 06:21:00 PST 2016


On Sun, Dec 20, 2015 at 01:30:57PM +0300, lvqcl wrote:
> Erik de Castro Lopo wrote:
> 
> > The think in and ideal world we would a:
> >
> > * Make it work correctly FLAC__BYTES_PER_WORD == 8 and compare the performance
> >   with FLAC__BYTES_PER_WORD == 4.
> > * If there is an statistically measurable performance, keep it, otherwise
> >   remove the FLAC__BYTES_PER_WORD == 8 code all together.
> 
> I'll try to do it, but I don't have a deep understanding of bit(read|write)
> routines such as FLAC__bitreader_read_rice_signed_block() and other.
> Maybe Miroslav Lichvar can say something?

Using larger registers in the bitreader/bitwriter should reduce the
number of instructions needed when reading/writing the encoded stream
as fewer words need to be read/written and encoded values are less
likely to be split across two words.

In the measurements comparing 32-bit and 64-bit words you posted
later, I'm wondering why there is a slow down in decoding of 24-bit
files. Does profiling show it comes from the read_rice_signed_block()
function or something else? Could it be slower SWAP_BE_WORD_TO_HOST or
COUNT_ZERO_MSBS2?

-- 
Miroslav Lichvar


More information about the flac-dev mailing list