[FFmpeg-devel] [Fwd: Summer of code small task patch]

Dylan Yudaken dyudaken
Mon Mar 30 22:52:32 CEST 2009


Michael Niedermayer wrote:
>
>> Also - in the earlier versions of my code the IDCT was wrong. I have fixed 
>> it now but it doesnt get the exact values of the previous versions. My 
>> version has a lower error^2 but a higher systematic error. I dont have much 
>> experience to tell if this trade off is acceptable.
>>     
>
> it would be nice if your code would produce the same values as the current
> ref in svn
>
>   
does so now. it meant I had to take out that whole optimizing thing. 
most of the other comments were related to this so they are fixed.
>   
>> From 423dd9ac2c620c10bf42c362bb8872b47256fa00 Mon Sep 17 00:00:00 2001
>> From: Dylan Yudaken <dyudaken at gmail.com>
>> Date: Mon, 30 Mar 2009 20:07:26 +0200
>> Subject: [PATCH] Create new reference DCT file
>>
>> ---
>>  libavcodec/dctref.c |  138 +++++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 files changed, 138 insertions(+), 0 deletions(-)
>>  create mode 100644 libavcodec/dctref.c
>>
>> diff --git a/libavcodec/dctref.c b/libavcodec/dctref.c
>> new file mode 100644
>> index 0000000..4d30ac3
>> --- /dev/null
>> +++ b/libavcodec/dctref.c
>> @@ -0,0 +1,138 @@
>> +/*
>> + * Reference discrete cosine transform (double-precision)
>> + * Copyright (C) 2009 Dylan Yudaken
>> + *
>> + * This file is part of FFmpeg.
>> + *
>> + * FFmpeg is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU Lesser General Public
>> + * License as published by the Free Software Foundation; either
>> + * version 2.1 of the License, or (at your option) any later version.
>> + *
>> + * FFmpeg is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>> + * Lesser General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU Lesser General Public
>> + * License along with FFmpeg; if not, write to the Free Software
>> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>> + */
>> +
>>     
>
>   
>> +/**
>> + * @file libavcodec/dctref.c
>> + * Reference discrete cosine transform (double-precision)
>> + * @author Dylan Yudaken (dyudaken at gmail)
>> + */
>> +
>>     
>
>   
>> +/*
>> +  This file could be optimised a lot, but is for
>> +  reference and so readability is better
>> + */
>>     
>
> this could be a @note in the file doxy
>
>
>   
>> +
>> +#include "libavutil/mathematics.h"
>> +static double coefficientsData[8 * 7];
>> +
>>     
>
>   
>> +/* Initialise here, prevent segfaults if you dont call init */
>> +static double *coefficients = &coefficientsData[0] - 8;
>>     
>
> this variable is redundant
>
>
>   
>> +
>> +/**
>> + * Initialize the Double Precision Discrete Cosine Transform
>> + * functions fdct & idct.
>> + */
>> +av_cold void ff_ref_dct_init(void)
>> +{
>> +    unsigned int i, j;
>> +
>> +    for (i = 8; i < 64; i+=8) {
>> +        for (j = 0; j < 8; ++j) {
>> +            coefficients[i + j] = sqrt(2.0) * cos(i * (j+0.5) * (M_PI / 64.0));
>> +        }
>> +    }
>>     
>
> i meant
> for (j = 0; j < 8; ++j) {
>     coefficients[j] = 1;
>     for (i = 8; i < 64; i+=8) {
>         coefficients[i + j] = sqrt(2.0) * cos(i * (j+0.5) * (M_PI / 64.0));
>
>
> [...]
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Change-over-to-new-reference-DCT-using-LGPL.patch
Type: application/mbox
Size: 12146 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090330/73d51b01/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Create-new-reference-DCT-file.patch
Type: application/mbox
Size: 4145 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090330/73d51b01/attachment-0001.bin>



More information about the ffmpeg-devel mailing list