Hi Francesco, On Friday 28 October 2011, Francesco Romani wrote: > On 10/20/2011 08:30 PM, Francesco Romani wrote: > > All patches I found are been applied. The is the repo: > > > > https://bitbucket.org/france/transcode-tcforge > > > > Things missing before the tag (and thus the release) > > > > - a bit of testing from mine > > - a fix for a stabilizer bug reported privately from me > > All relevant patches applied. Merged the (not trivial and interesting) > configure patch from the F16 pile. Thanks Nicolas! > > The vid.stab fix (still WIP) is applied too.
You fix does not do the right thing unfortunatelly. I attached a patch that should be applied instead of it (3a5bcfab52ec) and does what it should do, IMO. We really have to store the previous stabilized frame, or put otherwise we need a separate buffer for the output, that is partly overwritten every frame. We cannot work on the framebuffer directly as before. Regards, Georg > > Testing is now in progress. The merge window is now closed for > everything except blocker (~= segfault like) bugs. Tip will hopefully > tagged as 1.1.6 as soon as the testing finishes. > > Thanks everyone for the contribution. > > +++ > > I'd like to collect some ideas and maybe hack something for a brand new > from-scratch processing engine. > Let's see. Anyone interested stay tuned on bitbucket. > > References: > https://bitbucket.org/france > https://github.com/mojaves > private mail :) > > So long and thanks for all the fish! -- ---- Georg Martius, Tel: +49 177 6413311 ----- --------- http://georg.hronopik.de -------------
# HG changeset patch # User Georg Martius <georg dot martius at web dot de> # Date 1319841278 -7200 # Branch transcode-1_1 # Node ID 7b30925b26f6f7996736111dc918a71934de2496 # Parent 45a8f0fcc5fef5d4f5db8c722c6d486a034e2d05 In crop mode, use border from previous stabilized frame. The pixel border not suitable for stabilization are not equal to the preceding frame as should be and is claimed in the description of the "crop" flag. The output should be initialized using the *previous* output frame instead of the input frame, which is not stabilized. Pointed out by Guido Torelli. corrected version of commit 3a5bcfab52ec on bitbucket (use instead of it) diff -r 45a8f0fcc5fe -r 7b30925b26f6 filter/stabilize/filter_transform.c --- a/filter/stabilize/filter_transform.c Fri Oct 14 22:10:12 2011 +0200 +++ b/filter/stabilize/filter_transform.c Sat Oct 29 00:34:38 2011 +0200 @@ -787,7 +787,7 @@ * MAX_PLANES * sizeof(char) * 2 * td->vob->im_v_height * 2; */ td->framesize_src = td->vob->im_v_size; - td->src = tc_zalloc(td->framesize_src); /* FIXME */ + td->src = tc_malloc(td->framesize_src); /* FIXME */ if (td->src == NULL) { tc_log_error(MOD_NAME, "tc_malloc failed\n"); return TC_ERROR; @@ -894,6 +894,16 @@ return TC_ERROR; } + // if we keep the borders, we need a second buffer so store + // the previous stabilized frame + if(td->crop == 0){ + td->dest = tc_malloc(td->framesize_dest); + if (td->dest == NULL) { + tc_log_error(MOD_NAME, "tc_malloc failed\n"); + return TC_ERROR; + } + } + switch(td->interpoltype){ case 0: interpolate = &interpolateZero; break; case 1: interpolate = &interpolateLin; break; @@ -932,9 +942,16 @@ TC_MODULE_SELF_CHECK(frame, "filter_video"); td = self->userdata; - - td->dest = frame->video_buf; + memcpy(td->src, frame->video_buf, td->framesize_src); + if (td->crop == 0) { + if(frame->id == 0) { + // if we keep borders, save first frame into the background buffer (dest) + memcpy(td->dest, frame->video_buf, td->framesize_src); + } + }else{ // otherwise we directly operate on the framebuffer + td->dest = frame->video_buf; + } if (td->current_trans >= td->trans_len) { td->current_trans = td->trans_len-1; if(!td->warned_transform_end) @@ -950,6 +967,11 @@ tc_log_error(MOD_NAME, "unsupported Codec: %i\n", td->vob->im_v_codec); return TC_ERROR; } + if(td->crop == 0){ + // note: dest stores stabilized frame to be the default for next frame + memcpy(frame->video_buf, td->dest, td->framesize_src); + } + td->current_trans++; return TC_OK; }