On Sat, May 30, 2015 at 5:35 PM, Tom Butterworth <[email protected]> wrote:
> 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

amended locally

>> +++ 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
> ...

umh, I was sure I tested this part, but probably only with a multiple
of 2 rather than an odd one, sorry about that.

>> +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).

OK, fair enough, then I'll probably just disable anything just not
multiple of four as I'd rather not tinker with emu_edge right now, nor
complicate the dsp either. Would it be ok with you or do you have
code/ideas around it?
Cheers,
-- 
Vittorio
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to