On Tue, Apr 09, 2013 at 11:13:32PM +0200, Nicolas Bertrand wrote:
> ---
>  Changelog                |    1 +
>  doc/general.texi         |    4 +-
>  libavcodec/Makefile      |    2 +
>  libavcodec/allcodecs.c   |    1 +
>  libavcodec/avcodec.h     |    6 +
>  libavcodec/jpeg2000.c    |  459 +++++++++++++++++
>  libavcodec/jpeg2000.h    |  267 ++++++++++
>  libavcodec/jpeg2000dec.c | 1269 
> ++++++++++++++++++++++++++++++++++++++++++++++
>  libavcodec/jpeg2000dwt.c |  263 ++++++++++
>  libavcodec/jpeg2000dwt.h |   62 +++
>  libavcodec/mqc.c         |  112 ++++
>  libavcodec/mqc.h         |   74 +++
>  libavcodec/mqcdec.c      |   93 ++++
>  13 files changed, 2611 insertions(+), 2 deletions(-)
>  create mode 100644 libavcodec/jpeg2000.c
>  create mode 100644 libavcodec/jpeg2000.h
>  create mode 100644 libavcodec/jpeg2000dec.c
>  create mode 100644 libavcodec/jpeg2000dwt.c
>  create mode 100644 libavcodec/jpeg2000dwt.h
>  create mode 100644 libavcodec/mqc.c
>  create mode 100644 libavcodec/mqc.h
>  create mode 100644 libavcodec/mqcdec.c

A version bump is missing (fixed locally).

> --- /dev/null
> +++ b/libavcodec/jpeg2000.h
> @@ -0,0 +1,267 @@
> +static inline int ff_jpeg2000_getrefctxno(int flag)
> +{
> +    static const uint8_t refctxno_lut[2][2] = { { 14, 15 }, { 16, 16 } };
> +    return refctxno_lut[(flag >> 14) & 1][(flag & 255) != 0];
> +}

A static table within a header is not good; it will get duplicated at
every place this header is #included.  Can we move this one out?

> --- /dev/null
> +++ b/libavcodec/jpeg2000dec.c
> @@ -0,0 +1,1269 @@
> +static uint8_t get_tlm(Jpeg2000DecoderContext *s, int n)
> +{
> +    uint8_t Stlm, Ztlm, ST, SP,tile_tlm, i;
> +    uint16_t Ttlm_i=0;
> +    uint32_t Ptlm_i=0;
> +    Ztlm = bytestream_get_byte(&s->buf);        /* Ztlm */
> +    Stlm = bytestream_get_byte(&s->buf);        /* Stlm */
> +
> +    // too complex ? ST = ((Stlm >> 4) & 0x01) + ((Stlm >> 4) & 0x02);
> +    ST = (Stlm >> 4) & 0x03;
> +    // TODO : Manage case of ST = 0b11 --> raise error
> +    SP = (Stlm >> 6) & 0x01;
> +    tile_tlm = (n - 4) / ((SP + 1) * 2 + ST);
> +    for (i = 0; i < tile_tlm; i++) {
> +        switch (ST) {
> +        case 0:
> +            Ttlm_i = 0;
> +            break;
> +        case 1:
> +            Ttlm_i = bytestream_get_byte(&s->buf);
> +            break;
> +        case 2:
> +            Ttlm_i = bytestream_get_be16(&s->buf);
> +            break;
> +        case 3:
> +            Ttlm_i = bytestream_get_be32(&s->buf);
> +            break;
> +        }
> +        if (SP == 0) {
> +            Ptlm_i = bytestream_get_be16(&s->buf);
> +        } else {
> +            Ptlm_i = bytestream_get_be32(&s->buf);
> +        }
> +    }
> +    return 0;
> +}

What does this function do apart from generating these warnings?

libavcodec/jpeg2000dec.c: In function ‘get_tlm’:
libavcodec/jpeg2000dec.c:460:14: warning: variable ‘Ptlm_i’ set but not used 
[-Wunused-but-set-variable]
libavcodec/jpeg2000dec.c:459:14: warning: variable ‘Ttlm_i’ set but not used 
[-Wunused-but-set-variable]
libavcodec/jpeg2000dec.c:458:19: warning: variable ‘Ztlm’ set but not used 
[-Wunused-but-set-variable]

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

Reply via email to