Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Martin Storsjö" <martin@martin.st>
To: "Swinney, Jonathan" <jswinney@amazon.com>
Cc: "Pop, Sebastian" <spop@amazon.com>,
	"ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v2 0/2] checkasm: added additional dstW tests for hscale
Date: Wed, 25 May 2022 10:54:40 +0300 (EEST)
Message-ID: <a652a330-f8a0-2299-f322-e5a2fe01f6e@martin.st> (raw)
In-Reply-To: <7a6e659930f74fa3827c967e5858d9d4@EX13D07UWB004.ant.amazon.com>

On Wed, 25 May 2022, Swinney, Jonathan wrote:

> This is a resubmission of changes to the hscale function for aarch64. I 
> added a test as a separate patch so that it would be easier to get 
> consistent before and after performance data. After Martin already 
> submitted the improvement to the final section which adds up the 
> results, the additional performance gains of the changes to the 
> filterSize == 8 were marginal, so I took them out of this patch to show 
> only the work with clear improvement. I may submit changes to the other 
> function in the future.
>
> I also removed my changes to vertical scaling from the patch series 
> because there are some problems with the existing checkasm for 
> yuv2planeX in aarch64. Martin, do you know why there is a different 
> reference function used for testing in tests/checkasm/sw_scale.c than 
> the one in libswscale/output.c? I haven't figured out how to reconcile 
> these differences so I will resubmit that change later once I do.

It looks to me like that there's some amount of functions that aren't 
bitexact there, see the comment:

     // The reference function is not the scalar function selected when mmx
     // is deactivated as the SIMD functions do not give the same result as
     // the scalar ones due to rounding. The SIMD functions are activated by
     // the flag SWS_ACCURATE_RND

This is a bit tricky...

If I understand it, the test tries to do a bitexact test of what the 
non-bitexact function does, and thus provides a separate C replacement 
that does rounding in the same way as this specific SIMD function.


I think a more comprehensive test would work like this:

- Initialize sws with SWS_ACCURATE_RND
- Do the regular check_func()
- Test that the output indeed is exact compared with the reference (the
   default C function used in swscale)

If I understand correctly, the x86 routines are inexact and wouldn't be 
tested by this. Therefore, afterwards, the test could do this:

- Initialize sws without SWS_ACCURATE_RND
- Call check_func("yuv2yuv..._inexact") to get a separate function name
   and reference for that
- Do a fuzzy test for the output, i.e. allow each pixel to be off by e.g.
   1 from the expected reference value.

This would be less strict for the current x86 routines, as it doesn't 
check that it rounds exactly like the specific reference in the test, but 
would allow testing all exact functions, and all inexact functions even if 
they round differently.

// Martin

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

      reply	other threads:[~2022-05-25  7:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25  1:21 Swinney, Jonathan
2022-05-25  7:54 ` Martin Storsjö [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a652a330-f8a0-2299-f322-e5a2fe01f6e@martin.st \
    --to=martin@martin.st \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=jswinney@amazon.com \
    --cc=spop@amazon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git