[vlc-devel] [PATCH] hw: vaapi: double framerate for Bob and X deint modes
Victorien Le Couviour--Tuffet
victorien.lecouviour.tuffet at gmail.com
Thu Jul 6 18:17:40 CEST 2017
On Thu, Jul 06, 2017 at 05:48:32PM +0300, Oliver Collyer wrote:
In order to avoid useless computation you could store the return of
Deinterlace_UpdateHistory in a tmp variable and move up this block:
> + src = Deinterlace_UpdateHistory(p_deint_data, src);
> + if (p_deint_data->history.num_pics < p_deint_data->history.sz)
> + return NULL;
between this one:
> + for (unsigned int i = 1; i < METADATA_SIZE; ++i)
> + p_deint_data->meta[i-1] = p_deint_data->meta[i];
> + p_deint_data->meta[METADATA_SIZE-1].date = src->date;
> + p_deint_data->meta[METADATA_SIZE-1].i_nb_fields = src->i_nb_fields;
and this one:
> + mtime_t i_field_dur = 0;
> + unsigned int i = 0;
> + for ( ; i < METADATA_SIZE-1; i ++)
> + if (p_deint_data->meta[i].date > VLC_TS_INVALID)
> + break;
> + if (i < METADATA_SIZE-1) {
> + unsigned int i_fields_total = 0;
> + for (unsigned int j = i; j < METADATA_SIZE-1; ++j)
> + i_fields_total += p_deint_data->meta[j].i_nb_fields;
> + i_field_dur = (src->date - p_deint_data->meta[i].date) / i_fields_total;
> + }
> + else if (fmt->i_frame_rate_base)
> + i_field_dur = CLOCK_FREQ * fmt->i_frame_rate_base / fmt->i_frame_rate;
Also, I've added a flush callback in which you have to flush your metadata in
order to avoid frame drops / displayed late.
Regards,
Victorien Le Couviour--Tuffet.
More information about the vlc-devel
mailing list