<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Sorry, yes, just tried it again and it was related to the const char[] in the deint structure but I can see that the suggested patch addresses that.<div class=""><br class=""></div><div class="">I should have realised that at the time. My bad.<br class=""><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On 10 Jul 2017, at 13:55, Oliver Collyer <<a href="mailto:ovcollyer@mac.com" class="">ovcollyer@mac.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">On 10 Jul 2017, at 10:02, Steve Lhomme <<a href="mailto:robux4@gmail.com" class="">robux4@gmail.com</a>> wrote:<br class=""><br class="">A little late...<br class=""><br class="">On Fri, Jul 7, 2017 at 9:09 AM, Oliver Collyer <<a href="mailto:git@videolan.org" class="">git@videolan.org</a>> wrote:<br class=""><blockquote type="cite" class="">vlc | branch: master | Oliver Collyer <<a href="mailto:ovcollyer@mac.com" class="">ovcollyer@mac.com</a>> | Thu Jul 6 20:43:38 2017 +0300| [c932d06d31de5cd6161345db4ab4a284589be1a4] | committer: Thomas Guillem<br class=""><br class="">hw: vaapi: double framerate for Bob and X deint modes<br class=""><br class="">Signed-off-by: Victorien Le Couviour--Tuffet <<a href="mailto:victorien.lecouviour.tuffet@gmail.com" class="">victorien.lecouviour.tuffet@gmail.com</a>><br class="">Signed-off-by: Thomas Guillem <<a href="mailto:thomas@gllm.fr" class="">thomas@gllm.fr</a>><br class=""><br class=""><blockquote type="cite" class=""><a href="http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c932d06d31de5cd6161345db4ab4a284589be1a4" class="">http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c932d06d31de5cd6161345db4ab4a284589be1a4</a><br class=""></blockquote>---<br class=""><br class="">modules/hw/vaapi/filters.c | 142 +++++++++++++++++++++++++++++++++++++++------<br class="">1 file changed, 124 insertions(+), 18 deletions(-)<br class=""><br class="">diff --git a/modules/hw/vaapi/filters.c b/modules/hw/vaapi/filters.c<br class="">old mode 100644<br class="">new mode 100755<br class="">index 6d124b5ab9..091a949f24<br class="">--- a/modules/hw/vaapi/filters.c<br class="">+++ b/modules/hw/vaapi/filters.c<br class="">@@ -222,16 +222,19 @@ struct deint_mode<br class="">{<br class=""> char const name[5];<br class=""> VAProcDeinterlacingType type;<br class="">+ bool b_double_rate;<br class="">};<br class=""><br class="">static struct deint_mode const deint_modes[] =<br class="">{<br class="">- { "x", VAProcDeinterlacingMotionAdaptive },<br class="">- { "x", VAProcDeinterlacingMotionCompensated },<br class="">- { "bob", VAProcDeinterlacingBob },<br class="">- { "mean", VAProcDeinterlacingWeave }<br class="">+ { "x", VAProcDeinterlacingMotionAdaptive, true },<br class="">+ { "x", VAProcDeinterlacingMotionCompensated, true },<br class="">+ { "bob", VAProcDeinterlacingBob, true },<br class="">+ { "mean", VAProcDeinterlacingWeave, false }<br class="">};<br class=""><br class="">+#define METADATA_SIZE 3<br class="">+<br class="">struct deint_data<br class="">{<br class=""> struct<br class="">@@ -247,6 +250,15 @@ struct deint_data<br class=""> VASurfaceID * surfaces;<br class=""> unsigned int sz;<br class=""> } backward_refs, forward_refs;<br class="">+<br class="">+ struct<br class="">+ {<br class="">+ mtime_t date;<br class="">+ int i_nb_fields;<br class="">+ } meta[METADATA_SIZE];<br class="">+<br class="">+ bool b_double_rate;<br class="">+ unsigned int cur_frame;<br class="">};<br class=""><br class="">/********************<br class="">@@ -813,6 +825,20 @@ Deinterlace_UpdateHistory(struct deint_data * p_deint_data, picture_t * src)<br class="">}<br class=""><br class="">static void<br class="">+Deinterlace_UpdateFilterParams(void * p_data, void * va_params)<br class="">+{<br class="">+ struct deint_data *const p_deint_data = p_data;<br class="">+ VAProcFilterParameterBufferDeinterlacing *const p_va_params = va_params;<br class="">+<br class="">+ p_va_params->flags =<br class="">+ p_deint_data->history.pp_cur_pic[0]->b_top_field_first ?<br class="">+ 0 : VA_DEINTERLACING_BOTTOM_FIELD_FIRST;<br class="">+ if (p_deint_data->cur_frame ==<br class="">+ (p_deint_data->history.pp_cur_pic[0]->b_top_field_first ? 1 : 0))<br class="">+ p_va_params->flags |= VA_DEINTERLACING_BOTTOM_FIELD;<br class="">+}<br class="">+<br class="">+static void<br class="">Deinterlace_UpdateReferenceFrames(void * p_data)<br class="">{<br class=""> struct deint_data *const p_deint_data = p_data;<br class="">@@ -842,10 +868,6 @@ Deinterlace_UpdatePipelineParams<br class="">{<br class=""> struct deint_data *const p_deint_data = p_data;<br class=""><br class="">- pipeline_param->filter_flags =<br class="">- p_deint_data->history.pp_cur_pic[0]->b_top_field_first ?<br class="">- 0 : VA_DEINTERLACING_BOTTOM_FIELD_FIRST;<br class="">-<br class=""> pipeline_param->backward_references = p_deint_data->backward_refs.surfaces;<br class=""> pipeline_param->forward_references = p_deint_data->forward_refs.surfaces;<br class=""> pipeline_param->num_backward_references = p_deint_data->backward_refs.sz;<br class="">@@ -863,7 +885,8 @@ Deinterlace(filter_t * filter, picture_t * src)<br class=""> return NULL;<br class=""><br class=""> picture_t *const dest =<br class="">- Filter(filter, src, NULL,<br class="">+ Filter(filter, src,<br class="">+ Deinterlace_UpdateFilterParams,<br class=""> Deinterlace_UpdateReferenceFrames,<br class=""> Deinterlace_UpdatePipelineParams);<br class=""><br class="">@@ -873,6 +896,71 @@ Deinterlace(filter_t * filter, picture_t * src)<br class=""> return dest;<br class="">}<br class=""><br class="">+static picture_t *<br class="">+DeinterlaceX2(filter_t * filter, picture_t * src)<br class="">+{<br class="">+ filter_sys_t *const filter_sys = filter->p_sys;<br class="">+ struct deint_data *const p_deint_data = filter_sys->p_data;<br class="">+ const video_format_t * fmt = &filter->fmt_out.video;<br class="">+<br class="">+ /* TODO: could use the meta array and calculation from deinterlace/common<br class="">+ but then it would also be appropriate to use the picture history array<br class="">+ too and the callback system...so a rewrite of this module basically.*/<br class="">+ for (unsigned int i = 1; i < METADATA_SIZE; ++i)<br class="">+ p_deint_data->meta[i-1] = p_deint_data->meta[i];<br class="">+ p_deint_data->meta[METADATA_SIZE-1].date = src->date;<br class="">+ p_deint_data->meta[METADATA_SIZE-1].i_nb_fields = src->i_nb_fields;<br class="">+<br class="">+ picture_t * cur = Deinterlace_UpdateHistory(p_deint_data, src);<br class="">+ if (p_deint_data->history.num_pics < p_deint_data->history.sz)<br class="">+ return NULL;<br class="">+<br class="">+ mtime_t i_field_dur = 0;<br class="">+ unsigned int i = 0;<br class="">+ for ( ; i < METADATA_SIZE-1; i ++)<br class="">+ if (p_deint_data->meta[i].date > VLC_TS_INVALID)<br class="">+ break;<br class="">+ if (i < METADATA_SIZE-1) {<br class="">+ unsigned int i_fields_total = 0;<br class="">+ for (unsigned int j = i; j < METADATA_SIZE-1; ++j)<br class="">+ i_fields_total += p_deint_data->meta[j].i_nb_fields;<br class="">+ i_field_dur = (src->date - p_deint_data->meta[i].date) / i_fields_total;<br class="">+ }<br class="">+ else if (fmt->i_frame_rate_base)<br class="">+ i_field_dur = CLOCK_FREQ * fmt->i_frame_rate_base / fmt->i_frame_rate;<br class="">+<br class="">+ picture_t *dest[2] = {NULL, NULL};<br class="">+ for (i = 0; i < 2; ++i)<br class="">+ {<br class="">+ p_deint_data->cur_frame = i;<br class="">+ dest[i] = Filter(filter, cur,<br class="">+ Deinterlace_UpdateFilterParams,<br class="">+ Deinterlace_UpdateReferenceFrames,<br class="">+ Deinterlace_UpdatePipelineParams);<br class="">+ if (!dest[i])<br class="">+ goto error;<br class="">+<br class="">+ dest[i]->b_progressive = true;<br class="">+ dest[i]->i_nb_fields = 1;<br class="">+ }<br class="">+<br class="">+ dest[0]->p_next = dest[1];<br class="">+ dest[0]->date = cur->date;<br class="">+ if (dest[0]->date > VLC_TS_INVALID)<br class="">+ dest[1]->date = dest[0]->date + i_field_dur;<br class="">+ else<br class="">+ dest[1]->date = VLC_TS_INVALID;<br class="">+<br class="">+ return dest[0];<br class="">+<br class="">+error:<br class="">+ for (i = 0; i < 2; ++i)<br class="">+ if (dest[i])<br class="">+ picture_Release(dest[i]);<br class="">+<br class="">+ return NULL;<br class="">+}<br class="">+<br class="">static void<br class="">Deinterlace_Flush(filter_t *filter)<br class="">{<br class="">@@ -884,6 +972,12 @@ Deinterlace_Flush(filter_t *filter)<br class=""> p_deint_data->history.pp_pics[--p_deint_data->history.num_pics];<br class=""> picture_Release(pic);<br class=""> }<br class="">+<br class="">+ for (unsigned int i = 0; i < METADATA_SIZE; ++i)<br class="">+ {<br class="">+ p_deint_data->meta[i].date = VLC_TS_INVALID;<br class="">+ p_deint_data->meta[i].i_nb_fields = 2;<br class="">+ }<br class="">}<br class=""><br class="">static inline bool<br class="">@@ -901,7 +995,7 @@ OpenDeinterlace_IsValidType(filter_t * filter,<br class=""><br class="">static inline int<br class="">OpenDeinterlace_GetMode(filter_t * filter, char const * deint_mode,<br class="">- VAProcDeinterlacingType * p_deint_mode,<br class="">+ struct deint_mode * p_deint_mode,<br class=""> VAProcDeinterlacingType const caps[],<br class=""> unsigned int num_caps)<br class="">{<br class="">@@ -915,7 +1009,7 @@ OpenDeinterlace_GetMode(filter_t * filter, char const * deint_mode,<br class=""> if (OpenDeinterlace_IsValidType(filter, caps, num_caps,<br class=""> deint_modes + i))<br class=""> {<br class="">- *p_deint_mode = deint_modes[i].type;<br class="">+ memcpy(p_deint_mode, &deint_modes[i], sizeof(*p_deint_mode));<br class=""></blockquote><br class="">*p_deint_mode = deint_modes[i] was fine. That's one good thing about structure.<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Yeah...that's how I had it actually, but it gave a compile error (sorry I can't remember which one now, but I'm using a self-built gcc 5.4.0 on a deliberately old version of Ubuntu - 12.04 ), so I figured something about the compiler flags was disallowing this.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br class=""><blockquote type="cite" class=""> msg_Dbg(filter, "using %s deinterlace method",<br class=""> deint_modes[i].name);<br class=""> return VLC_SUCCESS;<br class="">@@ -929,7 +1023,7 @@ OpenDeinterlace_GetMode(filter_t * filter, char const * deint_mode,<br class=""> if (OpenDeinterlace_IsValidType(filter, caps, num_caps,<br class=""> deint_modes + i))<br class=""> {<br class="">- *p_deint_mode = deint_modes[i].type;<br class="">+ memcpy(p_deint_mode, &deint_modes[i], sizeof(*p_deint_mode));<br class=""></blockquote><br class="">idem<br class=""><br class=""><blockquote type="cite" class=""> if (fallback)<br class=""> msg_Info(filter, "%s algorithm not available, falling back to "<br class=""> "%s algorithm", deint_mode, deint_modes[i].name);<br class="">@@ -952,7 +1046,8 @@ OpenDeinterlace_InitFilterParams(filter_t * filter, void * p_data,<br class=""> void ** pp_va_params,<br class=""> uint32_t * p_va_param_sz,<br class=""> uint32_t * p_num_va_params)<br class="">-{ VLC_UNUSED(p_data);<br class="">+{<br class="">+ struct deint_data *const p_deint_data = p_data;<br class=""> filter_sys_t *const filter_sys = filter->p_sys;<br class=""> VAProcDeinterlacingType caps[VAProcDeinterlacingCount];<br class=""> unsigned int num_caps = VAProcDeinterlacingCount;<br class="">@@ -964,12 +1059,12 @@ OpenDeinterlace_InitFilterParams(filter_t * filter, void * p_data,<br class=""> &caps, &num_caps))<br class=""> return VLC_EGENERIC;<br class=""><br class="">- VAProcDeinterlacingType va_mode;<br class="">- char *const psz_deint_mode =<br class="">+ struct deint_mode deint_mode;<br class="">+ char *const psz_deint_mode =<br class=""> var_InheritString(filter, "deinterlace-mode");<br class=""><br class=""> int ret = OpenDeinterlace_GetMode(filter, psz_deint_mode,<br class="">- &va_mode, caps, num_caps);<br class="">+ &deint_mode, caps, num_caps);<br class=""> free(psz_deint_mode);<br class=""> if (ret)<br class=""> return VLC_EGENERIC;<br class="">@@ -984,9 +1079,11 @@ OpenDeinterlace_InitFilterParams(filter_t * filter, void * p_data,<br class=""> return VLC_ENOMEM;<br class=""><br class=""> p_va_param->type = VAProcFilterDeinterlacing;<br class="">- p_va_param->algorithm = va_mode;<br class="">+ p_va_param->algorithm = deint_mode.type;<br class=""> *pp_va_params = p_va_param;<br class=""><br class="">+ p_deint_data->b_double_rate = deint_mode.b_double_rate;<br class="">+<br class=""> return VLC_SUCCESS;<br class="">}<br class=""><br class="">@@ -1040,9 +1137,18 @@ OpenDeinterlace(vlc_object_t * obj)<br class=""> OpenDeinterlace_InitFilterParams, OpenDeinterlace_InitHistory))<br class=""> goto error;<br class=""><br class="">- filter->pf_video_filter = Deinterlace;<br class="">+ if (p_data->b_double_rate)<br class="">+ filter->pf_video_filter = DeinterlaceX2;<br class="">+ else<br class="">+ filter->pf_video_filter = Deinterlace;<br class=""> filter->pf_flush = Deinterlace_Flush;<br class=""><br class="">+ for (unsigned int i = 0; i < METADATA_SIZE; ++i)<br class="">+ {<br class="">+ p_data->meta[i].date = VLC_TS_INVALID;<br class="">+ p_data->meta[i].i_nb_fields = 2;<br class="">+ }<br class="">+<br class=""> return VLC_SUCCESS;<br class=""><br class="">error:<br class=""><br class="">_______________________________________________<br class="">vlc-commits mailing list<br class=""><a href="mailto:vlc-commits@videolan.org" class="">vlc-commits@videolan.org</a><br class="">https://mailman.videolan.org/listinfo/vlc-commits<br class=""></blockquote>_______________________________________________<br class="">vlc-devel mailing list<br class="">To unsubscribe or modify your subscription options:<br class=""><a href="https://mailman.videolan.org/listinfo/vlc-devel" class="">https://mailman.videolan.org/listinfo/vlc-devel</a><br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">vlc-devel mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">To unsubscribe or modify your subscription options:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://mailman.videolan.org/listinfo/vlc-devel" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://mailman.videolan.org/listinfo/vlc-devel</a></div></blockquote></div><br class=""></div></div></body></html>