Thanks for the changes - only a few things remaining:

<snip>

> --- a/libavcodec/codec_desc.c
> +++ b/libavcodec/codec_desc.c
> @@ -1148,6 +1148,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
>          .long_name = NULL_IF_CONFIG_SMALL("Canopus HQ/HQA"),
>          .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
>      },
> +    {
> +        .id        = AV_CODEC_ID_HAP,
> +        .type      = AVMEDIA_TYPE_VIDEO,
> +        .name      = "hap",
> +        .long_name = NULL_IF_CONFIG_SMALL("Vidvox HAP decoder"),

Hap not HAP

> +++ b/libavcodec/hapdec.c
...
> +static int setup_texture(AVCodecContext *avctx, size_t length)
> +{
> +    HapContext *ctx = avctx->priv_data;
> +    GetByteContext *gbc = &ctx->gbc;
> +    size_t snappy_size;

int64_t snappy_size;

> +++ b/libavcodec/hapenc.c

avconv -i http://files.kriss.cx/OddDimensions.png -c:v hap out.mov

gives Segmentation fault: 11
...

> +static void compress_texture(AVCodecContext *avctx, const AVFrame *f)
> +{
> +    HapContext *ctx = avctx->priv_data;
> +    uint8_t *out = ctx->tex_buf;
> +    int i, j;
> +
> +    for (j = 0; j < avctx->height; j += 4) {
> +        for (i = 0; i < avctx->width; i += 4) {
> +            uint8_t *p = f->data[0] + i * 4 + j * f->linesize[0];
> +            const int step = ctx->tex_fun(out, f->linesize[0], p);
> +            out += step;
> +        }
> +    }
> +}

As I commented in my review of your previous patch, this will produce
poorly encoded edge pixels when frame dimensions are not a multiple of
4 because the colours beyond the frame will be used to select the four
colours for the block. This should be intuitive, but if you want
confirmation then try with the frame I link above and look down the
right edge (once you've resolved the crash).

Cheers - Tom
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to