[FFmpeg-devel] [RFC][PATCH 1/3] lavu: Add av_crc2() and av_crc2_init()

Michael Niedermayer michaelni at gmx.at
Tue Jan 29 01:04:21 CET 2013


On Mon, Jan 28, 2013 at 07:29:36PM -0300, James Almer wrote:
> On 28/01/13 11:38 AM, Michael Niedermayer wrote:
> > On Mon, Jan 28, 2013 at 04:31:53AM -0300, James Almer wrote:
> >> Functionally the same as av_crc() and av_crc_init(), but
> >> supporting CRCs of up to 64 bits.
> >>
> >> Signed-off-by: James Almer <jamrial at gmail.com>
> >> ---
> >>  libavutil/crc.c          | 75 ++++++++++++------------------------------
> >>  libavutil/crc.h          |  7 ++++
> >>  libavutil/crc_template.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++
> >>  3 files changed, 112 insertions(+), 55 deletions(-)
> >>  create mode 100644 libavutil/crc_template.c
> > 
> > thats a huge mess for calculating a crc once for a few bytes of a
> > tta password.
> > 
> > something like:
> > for all bytes
> >     c ^= (uint64_t)*byte++ << 56;
> >     for(i=0; i<8; i++)
> >         c = (c << 1) ^ (poly & (((int64_t) c) >> 63));
> > 
> > in tta will do the samem, saving all the hundreads of lines of code
> > added to crc.*
> 
> I started that way, adding the calculation in tta, but then figured i might as 
> well just add support for CRCs of more than 32 bits to libavutil in case something
> else needs them in the future.
> 
> I'll send a patch later today to get the calculation done within tta.

i wouldnt mind it in libavutil if there was need for it (some speed
relevant code using it) but ATM its quite a lot macro/template mess
to avoid significantly fewer lines in tta*

so yes i think ATM its better in tta

thanks


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

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130129/25e15924/attachment.asc>


More information about the ffmpeg-devel mailing list