On Mon, Jan 21, 2013 at 08:20:57PM +0100, Jordi Ortiz wrote:
> --- /dev/null
> +++ b/libavcodec/dirac_dwt.c
> @@ -0,0 +1,608 @@
> +static void spatial_compose_daub97i_dy(DiracDWTContext *d, int level,
> +                                       unsigned width, unsigned height,
> +                                       int stride)
> +{
> +    DiracDWTCompose *cs = d->cs + level;
> +    int i, y            = cs->y;
> +    IDWTELEM *b[6];
> +
> +    for (i = 0; i < 4; i++)
> +        b[i] = cs->b[i];
> +    b[4] = d->buffer + mirror(y + 3, height - 1) * stride;
> +    b[5] = d->buffer + mirror(y + 4, height - 1) * stride;
> +
> +    if (y + 3 < (unsigned)height)
> +        d->vertical_compose_l1(b[3], b[4], b[5], width);
> +    if (y + 2 < (unsigned)height)
> +        d->vertical_compose_h1(b[2], b[3], b[4], width);
> +    if (y + 1 < (unsigned)height)
> +        d->vertical_compose_l0_3tap(b[1], b[2], b[3], width);
> +    if (y + 0 < (unsigned)height)
> +        d->vertical_compose_h0_3tap(b[0], b[1], b[2], width);
> +
> +    if (y - 1 < (unsigned)height)
> +        d->horizontal_compose(b[0], d->temp, width);
> +    if (y + 0 < (unsigned)height)
> +        d->horizontal_compose(b[1], d->temp, width);

You cast the unsigned height variable to ... unsigned ...

> --- /dev/null
> +++ b/libavcodec/dirac_dwt.h
> @@ -0,0 +1,132 @@
> +
> +#ifndef AVCODEC_DIRAC_DWT_H
> +#define AVCODEC_DIRAC_DWT_H
> +
> +#include <stdint.h>
> +
> +typedef int   DWTELEM;
> +typedef short IDWTELEM;

If this needs a fixed size, then the POSIX int types would be safer.

> --- /dev/null
> +++ b/libavcodec/diracdsp.c
> @@ -0,0 +1,313 @@
> +
> +void ff_diracdsp_init(DiracDSPContext *c, AVCodecContext *avctx)
> +{
> +    ff_dsputil_init(&c->dsp, avctx);

What do you need this for, we're trying to drop dsputil dependencies.

> +    // checkme: bitdepth set to 8 but could bitdepth be variable?
> +    ff_videodsp_init(&c->videodsp, 8);

Is avctx->bits_per_raw_sample set?  Then you could use that value.

> +    c->dirac_hpel_filter       = dirac_hpel_filter;
> +    c->add_rect_clamped        = add_rect_clamped_c;
> +    c->put_signed_rect_clamped = put_signed_rect_clamped_c;
> +
> +    c->add_dirac_obmc[0] = add_obmc8_c;
> +    c->add_dirac_obmc[1] = add_obmc16_c;
> +    c->add_dirac_obmc[2] = add_obmc32_c;
> +
> +    c->weight_dirac_pixels_tab[0] = weight_dirac_pixels8_c;
> +    c->weight_dirac_pixels_tab[1] = weight_dirac_pixels16_c;
> +    c->weight_dirac_pixels_tab[2] = weight_dirac_pixels32_c;
> +
> +    c->biweight_dirac_pixels_tab[0] = biweight_dirac_pixels8_c;
> +    c->biweight_dirac_pixels_tab[1] = biweight_dirac_pixels16_c;
> +    c->biweight_dirac_pixels_tab[2] = biweight_dirac_pixels32_c;

nit: Align all of this.

> --- /dev/null
> +++ b/libavcodec/diracdsp.h
> @@ -0,0 +1,98 @@
> +
> +#ifndef AVCODEC_DIRACDSP_H
> +#define AVCODEC_DIRACDSP_H
> +
> +#include <stdint.h>
> +
> +#include "dsputil.h"
> +#include "videodsp.h"
> +
> +typedef struct DiracDSPContext {
> +
> +    dirac_weight_func weight_dirac_pixels_tab[3];
> +    dirac_biweight_func biweight_dirac_pixels_tab[3];
> +    DSPContext dsp;
> +    VideoDSPContext videodsp;
> +} DiracDSPContext;

What do you need the DSPContext for?  Can it be dropped?

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

Reply via email to