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

Dylan Yudaken dyudaken
Wed Mar 25 16:43:05 CET 2009


Kostya wrote:
> On Tue, Mar 24, 2009 at 10:51:41PM +0200, Dylan Yudaken wrote:
>   
>> I apologise for being ridiculous and attaching the old file
>>
>> Dylan Yudaken wrote:
>>     
>>> Hi,
>>>
>>> I have attached a new LGPL'd libavcodec/fdctref.c file as per my 
>>> summer of code small task.
>>>       
>>     
>
> [...]
>   
>> void init_fdct(void){
>>   unsigned int i, j;
>>   double c0;
>>   
>>   c0 = sqrt(0.125);
>>   for (i = 0; i < 8; ++i){
>>       for (j = 0; j < 8; ++j){
>>           A[i*8 + j] = c0 * cos(i*PI_BY_8*(j + 0.5) );
>>       }
>>       /* c0 = sqrt(0.125) only for i =0 else c0 = 0.5*/
>>       c0 = 0.5;
>>   }
>> }
>>     
>
> please use consistent K&R indentation everywhere (4 spaces, spaces before right brace)
> i.e.
> void foo()
> {
>     int bar;
>     for (bar = 0; bar < 8; bar++) {
>         baz();
>     }
> }
>
> (on Linux "indent -i4 -kr fdctref.c" will format it for you) 
>   
I have attached it trying to fix all comments. Also included a patch 
file to adjust the callings in other methods as well as the licence file 
etc...
I changed fdctref.c to dctref.c as per comments.

> Otherwise it looks more like you've done some cosmetic changes instead of rewrite.
>   
They look similar, but it there arent a lot of ways of writing this 
code. It is just 2 matrix multiplications per method.
>  
>   
>> /**
>>  * Transform 8x8 block of data with a double precision forward DCT <br>
>>  * This is a reference implementation.
>>  *
>>  * @param block Pointer to 8x8 block of data to transform
>>  */
>> void fdct(short *block){
>>     unsigned int i, j,k;
>>     double tmp;
>>     double out[8 * 8];
>>     
>>     /* out = AX */
>>     for(i=0; i<8; ++i){
>>         for(j = 0; j < 8; ++j){
>>     
>
> like the spaces here
>
> [...]
> _______________________________________________
> 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: dctref.c
Type: text/x-csrc
Size: 3539 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090325/9cbe115c/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gsoc-smalltask.patch
Type: application/mbox
Size: 6873 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090325/9cbe115c/attachment.bin>



More information about the ffmpeg-devel mailing list