[vlc-devel] [PATCH v2 2/2] mmal: Add deinterlace filter
Julian Scheel
julian at jusst.de
Wed Sep 3 09:23:52 CEST 2014
Am 03.09.2014 um 02:01 schrieb Jean-Baptiste Kempf:
> On 02 Sep, Julian Scheel wrote :
>> + int i;
>> +
>> + memset(&picture_res, 0, sizeof(picture_resource_t));
>> + sys->pictures = calloc(sys->output->buffer_num, sizeof(picture_t *));
>
> Unchecked calloc
Ack.
>> + for (i = 0; i < sys->output->buffer_num; i++) {
>
> We're still C99 :)
Sorry, I'm really a C89 guy ;) - but I changed it there now.
>> + picture_res.p_sys = calloc(1, sizeof(picture_sys_t));
>
> Unchecked calloc
Ack.
>> +static int Open(filter_t *filter)
>> +{
>> + int32_t frame_duration = 1000000 /
>> + ((double)filter->fmt_in.video.i_frame_rate /
>> + filter->fmt_in.video.i_frame_rate_base);
>
> Do you need the double here?
> Why not, 1000000 * filter->fmt_in.video.i_frame_rate_base /
> filter->fmt_in.video.i_frame_rate ?
I had that because 1000000 * filter->fmt_in.video.i_frame_rate_base
might exceed a 32 bit int. Anyway, I convert to int64_t for computation
now so no floating point required anymore.
>> + /*
>> + * Do not deinterlace if framerate is > 30fps. This is unlikely to work
>> + * well in any case.
>> + */
>
> Are you sure that's a good idea?
Removed it. Before I did the picture pool rework pushing more than 30fps
through the deinterlace caused major issues, now it just works. Besides
that I have never seen >30fps (60 fields ps) interlaced content, but
that shall be handled by the codec and it's flags...
Will send v3 in a moment.
More information about the vlc-devel
mailing list