[FFmpeg-devel] [PATCH] port DVCProHD encoding code from FFmbc-0.7-rc5

Maksym Veremeyenko verem at m1stereo.tv
Wed Jan 18 15:46:56 CET 2012


18.01.12 15:52, Tomas Härdin написав(ла):
> On Wed, 2012-01-18 at 13:01 +0200, Maksym Veremeyenko wrote:
>> Hi,
>>
>> attached patch port a code for encoding DVCProHD
>
> Considering FFmbc is GPL, isn't this code too? If so then it requires
> some configuration fiddlery as well.
> The code may be based on a set of old patches from this mailing list,
> meaning it might count as LGPL. IANAL and I don't know if this code is
> based on that.
i am not Lawyer too, maybe somebody could clarify this?

*dvenc.c* file from ffmbc has a header:
[...]
  * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public
  * License as published by the Free Software Foundation;
  * version 2 of the License.
[...]


>
>> -static av_always_inline int dv_init_enc_block(EncBlockInfo* bi, uint8_t *data, int linesize, DVVideoContext *s, int bias)
>> +static av_always_inline void dv_set_class_number_sd(DCTELEM *blk, EncBlockInfo *bi,
>> +                                          const uint8_t *zigzag_scan,
>> +                                          const int *weight, int bias)
>
> Strange indentation
>
fixed

>> -       bi->prev[area]     = prev;
>> -       bi->bit_size[area] = 1; // 4 areas 4 bits for EOB :)
>> -       for (i = mb_area_start[area]; i<  mb_area_start[area+1]; i++)
>> {
>> -          int level = blk[zigzag_scan[i]];
>> -
>> -          if (level + 15>  30U) {
>> -              bi->sign[i] = (level>>  31)&  1;
>> -              /* weight it and and shift down into range, adding for
>> rounding */
>> -              /* the extra division by a factor of 2^4 reverses the
>> 8x expansion of the DCT
>> -                 AND the 2x doubling of the weights */
>> -              level = (FFABS(level) * weight[i] + (1<<
>> (dv_weight_bits+3)))>>  (dv_weight_bits+4);
>> -              bi->mb[i] = level;
>> -              if (level>  max)
>> -                  max = level;
>> -              bi->bit_size[area] += dv_rl2vlc_size(i - prev  - 1,
>> level);
>> -              bi->next[prev]= i;
>> -              prev = i;
>> -          }
>> -       }
>> +        bi->prev[area]     = prev;
>> +        bi->bit_size[area] = 1; // 4 areas 4 bits for EOB :)
>> +        for (i = mb_area_start[area]; i<  mb_area_start[area+1]; i++)
>> {
>> +            int level = blk[zigzag_scan[i]];
>> +
>> +            if (level + 15>  30U) {
>> +                bi->sign[i] = (level>>  31)&  1;
>> +                /* weight it and and shift down into range, adding
>> for rounding */
>> +                /* the extra division by a factor of 2^4 reverses the
>> 8x expansion of the DCT
>> +                   AND the 2x doubling of the weights */
>> +                level = (FFABS(level) * weight[i] + (1<<
>> (dv_weight_bits+3)))>>  (dv_weight_bits+4);
>> +                bi->mb[i] = level;
>> +                if (level>  max)
>> +                    max = level;
>> +                bi->bit_size[area] += dv_rl2vlc_size(i - prev  - 1,
>> level);
>> +                bi->next[prev] = i;
>> +                prev = i;
>> +            }
>> +        }
>>       }
>>       bi->next[prev]= i;
>>       for (bi->cno = 0; max>  classes[bi->cno]; bi->cno++);
>> @@ -844,20 +831,336 @@ static av_always_inline int
>> dv_init_enc_block(EncBlockInfo* bi, uint8_t *data, i
>>               bi->bit_size[area] = 1; // 4 areas 4 bits for EOB :)
>>               for (; i<  mb_area_start[area+1]; i = bi->next[i]) {
>>                   bi->mb[i]>>= 1;
>> -
>>                   if (bi->mb[i]) {
>>                       bi->bit_size[area] += dv_rl2vlc_size(i - prev -
>> 1, bi->mb[i]);
>> -                    bi->next[prev]= i;
>> +                    bi->next[prev] = i;
>>                       prev = i;
>>                   }
>>               }
>>           }
>> -        bi->next[prev]= i;
>> +        bi->next[prev] = i;
>
> These look like indentation/cosmetic hunks only - consider moving them
> to a separate patch.
that is actually moving/factorizing SD related code from 
dv_init_enc_block into the dv_init_enc_block


-- 
________________________________________
Maksym Veremeyenko
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-port-DVCProHD-encoding-code-from-FFmbc-0.7-rc5.patch
Type: text/x-patch
Size: 30391 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120118/431e8cd5/attachment.bin>


More information about the ffmpeg-devel mailing list