[FFmpeg-devel] [Patch] beautified + accelerated vf_fillborders – Please review

Ulf Zibis Ulf.Zibis at CoSoCo.de
Tue Mar 19 16:57:56 EET 2019


Hi again,

Am 12.03.19 um 00:37 schrieb Carl Eugen Hoyos:
> 2019-03-12 0:25 GMT+01:00, Moritz Barsnick <barsnick at gmx.net>:
>> Ideally, you use the START_TIMER/STOP_TIMER macros to
>> profile the actual functions you changed. (Check this mailing list's
>> archives for some examples, and play with the code.)
> But this should not be needed if time (the command) and / or
> benchmark (the FFmpeg option) show clear improvements.

With the benchmark option I can not see the time for the filter, just
for the de/encoding, and as I assume, that this filter is much faster
than the de/encoding around it, I suspect, the overall time will be helpful.

So I have "played" with the START_TIMER/STOP_TIMER macros.

Now I'm kind of helpless, as the numbers I get are varying in wide
range. It seems, that my changes help a little for e.g. "-vf
fillborders:0:0:5:5:mirror". This is what I expected by bypassing the
code loops for the right/left borders, when there is nothing to do, but
the timer results are "noisy".

I attach the patches for the first 2 chunks again, and too the patches
for my timed version. Hopefully you have the time to play a little with
that and can give me hints, how I could get more reliable numbers. (I
just had closed all other applications like Firefox, Transmission etc.
before running the benchmarks)

-Ulf

==========================================================================
$ debug/fillborders.sh
Test[0] ======> 3-plane 8-bit YUV-colour:    CYD_1005.jpg <======
./ffmpeg-p1 : CYD_1005.jpg --> ZZ_CYD_1005_mirror-0-0-5-5.jpg
 122670 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 133020 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 119430 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 118350 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 124740 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 122130 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
./ffmpeg-p2 : CYD_1005.jpg --> ZZ_CYD_1005_mirror-0-0-5-5.jpg
 118800 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 123840 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 121500 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 135090 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 126270 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 125730 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
./ffmpeg-p1 : CYD_1005.jpg --> ZZ_CYD_1005_mirror-5-5-0-0.jpg
 557730 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 614880 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 598410 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 545940 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 591030 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 566910 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
./ffmpeg-p2 : CYD_1005.jpg --> ZZ_CYD_1005_mirror-5-5-0-0.jpg
 542430 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 567900 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 490050 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 579330 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 521370 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 890370 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
./ffmpeg-p1 : CYD_1005.jpg --> ZZ_CYD_1005_mirror-5-5-5-5.jpg
 576540 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 597060 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 599940 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 621900 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 588870 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 606600 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
./ffmpeg-p2 : CYD_1005.jpg --> ZZ_CYD_1005_mirror-5-5-5-5.jpg
 522090 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 655650 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 609660 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 600300 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 561510 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 630090 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
=====================================================================================
$ debug/fillborders.sh
Test[0] ======> 3-plane 8-bit YUV-colour:    CYD_1005.jpg <======
./ffmpeg-p1 : CYD_1005.jpg --> ZZ_CYD_1005_mirror-0-0-5-5.jpg
 131220 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 141030 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 135900 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 133380 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 148230 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 119880 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
./ffmpeg-p2 : CYD_1005.jpg --> ZZ_CYD_1005_mirror-0-0-5-5.jpg
 165870 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 120960 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 126450 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 122310 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 132660 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 122940 decicycles in fillborders=0:0:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
./ffmpeg-p1 : CYD_1005.jpg --> ZZ_CYD_1005_mirror-5-5-0-0.jpg
 578160 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 571140 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 652320 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 571500 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 756810 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 515880 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
./ffmpeg-p2 : CYD_1005.jpg --> ZZ_CYD_1005_mirror-5-5-0-0.jpg
 625140 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 595260 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 552600 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 636390 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 687960 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
 648900 decicycles in fillborders=5:5:0:0:mirror 3p-8bit-1x1,       1
runs,      0 skips
./ffmpeg-p1 : CYD_1005.jpg --> ZZ_CYD_1005_mirror-5-5-5-5.jpg
 578610 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 552060 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 604980 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 486900 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 498780 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 549900 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
./ffmpeg-p2 : CYD_1005.jpg --> ZZ_CYD_1005_mirror-5-5-5-5.jpg
 642240 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 658710 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
1701630 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 676350 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 622350 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
 693630 decicycles in fillborders=5:5:5:5:mirror 3p-8bit-1x1,       1
runs,      0 skips
==============================================================================


-------------- next part --------------
A non-text attachment was scrubbed...
Name: vf_fillborders_1.patch
Type: text/x-patch
Size: 13463 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190319/b6361f27/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vf_fillborders_2.patch
Type: text/x-patch
Size: 11405 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190319/b6361f27/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vf_fillbd_benchmark_1.patch
Type: text/x-patch
Size: 2201 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190319/b6361f27/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vf_fillbd_benchmark_2.patch
Type: text/x-patch
Size: 12647 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190319/b6361f27/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CYD_1005.jpg
Type: image/jpeg
Size: 64855 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190319/b6361f27/attachment.jpg>


More information about the ffmpeg-devel mailing list