[FFmpeg-devel] [PATCH] Add tonemap filter

Vittorio Giovara vittorio.giovara at gmail.com
Mon Aug 14 18:16:31 EEST 2017


>Hi,
>
>On 8/11/17, Vittorio Giovara <vittorio.giovara at gmail.com> wrote:
>[...]
>> +    /* do the tone map */
>> +    for (y = 0; y < in->height; y++)
>> +        for (x = 0; x < in->width; x++)
>> +            tonemap(s, out, in, desc, x, y, peak);
>> +
>> +    /* copy/generate alpha if needed */
>> +    if (desc->flags & AV_PIX_FMT_FLAG_ALPHA && odesc->flags &
>> AV_PIX_FMT_FLAG_ALPHA) {
>> +        av_image_copy_plane(out->data[3], out->linesize[3],
>> +                            in->data[3], in->linesize[3],
>> +                            out->linesize[3], outlink->h);
>> +    } else if (odesc->flags & AV_PIX_FMT_FLAG_ALPHA) {
>> +        for (y = 0; y < outlink->h; y++)
>> +            memset(out->data[3] + y * out->linesize[3], 0xff, outlink->w);
>
>This looks strange.
>
>Rest looks fine.

Ah right, thanks for spotting, replaced with

        for (y = 0; y < out->height; y++) {
            for (x = 0; x < out->width; x++) {
                AV_WN32(out->data[3] + x * odesc->comp[3].step + y *
out->linesize[3],
                        av_float2int(1.0f));
            }
        }

pushing later today unless further objections
-- 
Vittorio


More information about the ffmpeg-devel mailing list