On Thu, Jan 21, 2016 at 3:17 AM, Diego Biurrun <[email protected]> wrote:
> On Wed, Jan 20, 2016 at 10:48:12AM -0500, Vittorio Giovara wrote:
>> On Wed, Jan 20, 2016 at 5:10 AM, Diego Biurrun <[email protected]> wrote:
>> > On Tue, Jan 19, 2016 at 07:45:25PM -0500, Vittorio Giovara wrote:
>> >> --- a/libavcodec/eatqi.c
>> >> +++ b/libavcodec/eatqi.c
>> >> @@ -35,69 +35,177 @@
>> >>
>> >> +/* Based off mpeg1_decode_block_intra from mpeg12dec.c */
>> >
>> > s/Based off/Duplicated from/
>>
>> it's not strictly duplicated as it has some simplifications, but ok
>
> Well, one "simplification" I noticed was mixing declarations and statements,
> so ...
>
>> > I don't see this as an improvement.
>>
>> why?
>
> Because it's code duplication, pure and simple.

you can't be seriously comparing the mpegvideo detangling and a
complete decoder deduplication (mpeg1) to the addition of a single
relatively small function

>> >> +static inline int decode_intra_block(AVCodecContext *avctx, int16_t 
>> >> *block,
>> >> +                                     int index)
>> >>  {
>> >> +    TqiContext *t = avctx->priv_data;
>> >> +    int dc, diff, component;
>> >> +    int i, j, ret = 0;
>> >> +    const uint16_t *quant_matrix = t->intra_matrix;
>> >> +
>> >> +    /* DC coefficient */
>> >> +    component = index <= 3 ? 0 : index - 4 + 1;
>> >> +
>> >> +    diff = decode_dc(&t->gb, component);
>> >> +    if (diff >= 0xffff)
>> >> +        return AVERROR_INVALIDDATA;
>> >> +
>> >> +    dc  = t->last_dc[component];
>> >> +    dc += diff;
>> >> +    t->last_dc[component] = dc;
>> >> +
>> >> +    block[0] = dc * quant_matrix[0];
>> >> +    ff_dlog(avctx, "dc=%d diff=%d\n", dc, diff);
>> >> +    i = 0;
>> >> +
>> >> +    /* now quantify & encode AC coefficients */
>> >> +    OPEN_READER(re, &t->gb);
>> >
>> > What happened to -Werror=declaration-after-statement?  Does clang not
>> > even warn?
>>
>> no it does not, but I spotted it with gcc and fixed locally
>
> Local testing seems to indicate that the warning is broken with clang.
>
> Diego
> _______________________________________________
> libav-devel mailing list
> [email protected]
> https://lists.libav.org/mailman/listinfo/libav-devel



-- 
Vittorio
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to