Commits

Francesco Romani  committed 3a5bcfa

lter][vid.stab] 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.

  • Participants
  • Parent commits 738069b
  • Branches transcode-1_1

Comments (0)

Files changed (1)

File filter/stabilize/filter_transform.c

     td = self->userdata;
 
     td->dest = frame->video_buf;
-    memcpy(td->src, frame->video_buf, td->framesize_src);
+    if (frame->id == 0 || td->crop == 1) {
+        memcpy(td->src, frame->video_buf, td->framesize_src);
+    }
     if (td->current_trans >= td->trans_len) {
         tc_log_error(MOD_NAME, "not enough transforms found!\n");
         return TC_ERROR;
         tc_log_error(MOD_NAME, "unsupported Codec: %i\n", td->vob->im_v_codec);
         return TC_ERROR;
     }
+    if (td->crop == 0) {
+        memcpy(td->src, frame->video_buf, td->framesize_src);
+    }
     td->current_trans++;
     return TC_OK;
 }