[FFmpeg-devel] [PATCH] Rename ffadler to ffhash and expand it using the generic hash API

James Almer jamrial at gmail.com
Wed May 15 21:11:27 CEST 2013


On 15/05/13 10:38 AM, Michael Niedermayer wrote:
> On Wed, May 15, 2013 at 04:35:40AM -0300, James Almer wrote:
>> Signed-off-by: James Almer <jamrial at gmail.com>
>> ---
>>  libavutil/Makefile            |  2 +-
>>  tools/{ffadler.c => ffhash.c} | 79 +++++++++++++++++++++++++++++++++++++------
>>  2 files changed, 70 insertions(+), 11 deletions(-)
>>  rename tools/{ffadler.c => ffhash.c} (49%)
> 
> [...]
> 
>> +static void finish(void)
>> +{
>> +    int i, len = av_hash_get_size(hash);
>> +
>> +    printf("%s=0x", av_hash_get_name(hash));
>> +    av_hash_final(hash, res);
>> +    for (i = 0; i < len; i++)
>> +        printf("%02"PRIx8, res[i]);
> 
> %02x

Ok.

> also, the values returned change
> 
> echo this | tools/ffhash adler32
> adler32=0xc2010f06
> 
> echo this | tools/ffadler
> A32=0x061401c3

I mentioned in an earlier email that hash.c is initializing adler32 with 0 instead of 1,
so it needs to be changed.
Also, it needs to store the value using AV_WB32() instead of AV_WL32() in av_hash_final()
or it will be printed in reverse.

Regards.


More information about the ffmpeg-devel mailing list