When operating on subsampled chroma planes, some rounding is taking
place. The left and top borders are rounded down while the width and
height are rounded up, so all rounding is done outward to guarantee the
logo area is fully covered.
The problem is that the width and height are counted from the
unrounded left and top borders, respectively. So if the left or top
border position has indeed been rounded down, and the width or height
needs no rounding (up), the position of the the right or bottom border
will be effectively rounded down, i.e. inward.
The issue can easily be seen with a yuv240p input and
-vf delogo=45:45:60:40:show=1 -vframes 1 delogo-bug.png
(or virtually any logo area with odd x and y and even width and
height.) The right and bottom chroma borders (in green) are clearly
off.
In order to fix this, the width and height must be adjusted to include
the bits lost in the rounding of the left and top border positions,
respectively, prior to being themselves rounded up.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The original delogo algorithm interpolates both horizontally and
vertically and uses the average to compute the resulting sample. This
works reasonably well when the logo area is almost square. However
when the logo area is significantly larger than high or higher than
large, the result is largely suboptimal.
The issue can be clearly seen by testing the delogo filter with a fake
logo area that is 200 pixels large and 2 pixels high. Vertical
interpolation gives a very good result in that case, horizontal
interpolation gives a very bad result, and the overall result is poor,
because both are given the same weight.
Even when the logo is roughly square, the current algorithm gives poor
results on the borders of the logo area, because it always gives
horizontal and vertical interpolations an equal weight, and this is
suboptimal on borders. For example, in the middle of the left hand
side border of the logo, you want to trust the left known point much
more than the right known point (which the current algorithm already
does) but also much more than the top and bottom known points (which
the current algorithm doesn't do.)
By properly weighting each known point when computing the value of
each interpolated pixel, the visual result is much better, especially
on borders and/or for high or large logo areas.
The algorithm I implemented guarantees that the weight of each of the
4 known points directly depends on its distance to the interpolated
point. It is largely inspired from the original algorithm, the key
difference being that it computes the relative weights globally
instead of separating the vertical and horizontal interpolations and
combining them afterward.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
Also replace custom tests for MD5 with those published in RFC 2202
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Tha fate tests change because the edge mirroring was wrong before this commit
Reviewed-by: Nicolas BERTRAND <nicoinattendu@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Adding an arbitrary amount of padding bytes at the end of the
ID3 metadata fixes cover art display for some software (iTunes,
Traktor, Serato, Torq).
For reference (ID3 metadata):
[ Apic frames ] -> cover doesn't show up
[ Apic frames, Padding ] -> ok
[ Apic frames, ID3 frames ] -> ok
[ ID3 frames, Apic frames ] -> cover doesn't show up
[ ID3 frames, Apic frames, Padding ] -> ok
* qatar/master:
doc: Mention the target_samples and ld variables for fate configs
fate.sh: Allow specifying --as via a specific variable
Conflicts:
doc/fate.texi
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '2d2d6a4883479403798f4ed46941d5b365823570':
lavf: add a raw WavPack muxer.
apetag: add support for writing APE tags
matroskaenc: support muxing WavPack
Conflicts:
libavformat/Makefile
libavformat/allformats.c
libavformat/apetag.h
libavformat/version.h
libavformat/wvenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '4a27a52a1f74016095b7aee1b4a422cf62217ade':
fate: Don't use files from SRC_PATH in the actual tests
indeo4: reuse context block VLC for band instead of defaulting
Conflicts:
tests/Makefile
Merged-by: Michael Niedermayer <michaelni@gmx.at>
The quantization code needs more work, not so much work
merging but more work investigating what is correct.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
If building out of tree, make sure the filter scripts are copied
into the build tree before running tests. This makes sure that
SRC_PATH doesn't need to exist on the remote system (or doesn't
need to exist at the same path).
Signed-off-by: Martin Storsjö <martin@martin.st>
This more evenly distributes the load between threads
This also fixes the chroma filtering where the filter was applied twice
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Fixes out of array writes
No FFmpeg release is affected by this
This also fixes some artifacts
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
If the "build_only" variable is set in the configuration file, the
FATE client will skip running tests and just compile all targets.
Signed-off-by: Martin Storsjö <martin@martin.st>
* commit '8e673efc6f5b7a095557664660305148f2788d30':
prores: update FATE test to account for alpha plane present in the test sample
configure: Add basic valgrind-massif support
Conflicts:
tests/fate/prores.mak
tests/ref/fate/prores-alpha
Merged-by: Michael Niedermayer <michaelni@gmx.at>
According to the PIFF specification[1] the base_data_offset field MUST be
omitteed. See section 5.2.17. Since the ISMV files created by ffmpeg state
that they are 'piff' compatible via 'ftyp' box, this needs to be corrected.
[1] http://www.iis.net/learn/media/smooth-streaming/protected-interoperable-file-format
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This replaces a large number of checks for the second field by
fixing the pointers when they are setup.
This should also fix I/BI field pictures.
Changes checksums for vc1_sa10143, the file becomes slightly closer
to what the reference decoder outputs.
Based on "vc1dec: the second field is written wrong to the picture"
by Sebastian Sandberg <sebastiand.sandberg@gmail.com>.
Signed-off-by: Martin Storsjö <martin@martin.st>
* commit 'e0c53c3408181d2e7d544eb65fc7355a79438dfe':
nut: use meaningful error values
FATE: use a less ambiguous end time for filter-trim-time test
Conflicts:
libavformat/nutdec.c
tests/fate/filter-video.mak
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This is the first 2 MB of the official test7.mkv.
That length seems to be enough to detect the bugs
we had in our code so far.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* commit '768e44d044bc32de1e58c198a3708d186af7e966':
build: tune down the output of lcov/gcov
Conflicts:
tests/Makefile
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'b333f3a22a4db4cf65d6a0457ac82ecbe7c7ac44':
lavf-regression: use -frames instead of -t for image tests
Conflicts:
tests/lavf-regression.sh
Merged-by: Michael Niedermayer <michaelni@gmx.at>
${1} is now the filter args and is inappropriate as a unique name for
the test (and causes some FATE issues because of the ':' in them).
${filter} is not used either to replace the ${1} because ${outfile}
already contains a unique name for the test.
* commit 'e036bb7899d0faca9159206be9bf5552e76e7633':
lavc: clear AVBuffers on decoded frames if refcounted_frames is not set
FATE: add an additional indeo3 test
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This makes -t sample-accurate for audio and will allow further
simplication in the future.
Most of the FATE changes are due to audio now being sample accurate. In
some cases a video frame was incorrectly passed with the old code, while
its was over the limit.