[FFmpeg-devel] [PATCH v3] lavfi/delogo: take SAR into account

Jean Delvare khali at linux-fr.org
Wed Jul 3 10:22:23 CEST 2013

On Mon, 1 Jul 2013 16:28:59 +0200, Jean Delvare wrote:
> When interpolating, weights are based on relative distances, which
> assume square pixels. If a non-1:1 sample aspect ratio is used, it
> should be taken into account when comparing distances, because the
> human eye and brain care about the picture as it is displayed, not
> stored.

For the record, I tested this patch with my instrumented code, on 3
different input files, each with 3 different real-world logo areas (not
matching the input video, of course), so a total of 9 tests. The
results are as follows:

* The accumulated reconstruction error (sum of differences between
  original video and interpolated results) went down in 8 cases, from a
  negligible -0.1% to a significant -4.9% in the best case. In one
  case, it went up, by +1.0%. On average the reconstruction error went
  down by -2.2%.

* In terms of absolute error, the error went down on average by -0.8
  for 4 pixels (which are 4 luma samples and 2 chroma samples for my
  YUV 4:2:0 input files.) This is a small gain (0.8/1530) compared to
  my previous patch, but still a gain on average.

Jean Delvare

More information about the ffmpeg-devel mailing list