Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH 1/6] opus: convert encoder and decoder to lavu/tx
Date: Sun, 25 Sep 2022 14:34:38 +0200
Message-ID: <AS8P250MB07442D11617DD983EAB02B698F539@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <NCnd0L6--3-2@lynne.ee>

Lynne:
> Sep 24, 2022, 23:57 by dev@lynne.ee:
> 
>> Sep 24, 2022, 21:40 by martin@martin.st:
>>
>>> What about ac3dsp then - that one seems like it's fairly optimized for arm?
>>>
>> Haven't touched them, they're still being used. Unfortunately, for AC3,
>> the full MDCT optimizations in lavc do make a difference and the overall
>> decoder becomes 15% slower with this patch on for aarch64 with lavu/tx's
>> asm disabled and 7% slower with lavu/tx's asm enabled. I do plan to write
>> an aarch64 MDCT NEON SIMD code in a month or so, unless someone is faster,
>> which should make the decoder at least 10% faster with lavu/tx.
>>
> 
> I'd just like to add this was for the float version of the ac3 decoder. The fixed-point
> version is a few percent faster with the patch on an A53, and quite a bit
> more accurate.
> The lavc fixed-point FFT code also has some weird large spikes in #cycles
> for some transform sizes, so the figure above is an average, but the dips
> went from 117x realtime to 78x realtime, which on a slower CPU may
> be the difference between stuttering and realtime playback.
> On this CPU, the fixed-point version is 23% slower than the float version,
> but on a CPU with slower float ops, it would make more sense to pick that
> decoder up than the float version.
> The 2 decoders produce nearly identical results, minus a few rounding
> errors, since AC3 is inherently a fixed-point codec. The only difference
> are the transforms themselves, and the extra ops needed to convert
> the 25bit ints to floats in the float decoder.

1. You forgot to remove mdct15 requirements from configure in this whole
patchset.
2. You forgot to update the FATE references for several tests; e.g. when
only applying the ac3 patch, then I get this:

TEST    ac3-4.0
stddev:    7.60 PSNR: 78.71 MAXDIFF:  867 bytes:   761856/   761856
MAXDIFF: |867 - 0| >= 1
Test ac3-4.0 failed. Look at tests/data/fate/ac3-4.0.err for details.
make: *** [src/tests/Makefile:307: fate-ac3-4.0] Error 1
TEST    ac3-2.0
stddev:    2.57 PSNR: 88.10 MAXDIFF:  414 bytes:   804864/   804864
MAXDIFF: |414 - 0| >= 1
Test ac3-2.0 failed. Look at tests/data/fate/ac3-2.0.err for details.
make: *** [src/tests/Makefile:307: fate-ac3-2.0] Error 1
TEST    ac3-4.0-downmix-stereo
stddev:    2.99 PSNR: 86.81 MAXDIFF:  198 bytes:   380928/   380928
MAXDIFF: |198 - 0| >= 1
Test ac3-4.0-downmix-stereo failed. Look at
tests/data/fate/ac3-4.0-downmix-stereo.err for details.
make: *** [src/tests/Makefile:307: fate-ac3-4.0-downmix-stereo] Error 1
TEST    ac3-4.0-downmix-mono
stddev:    4.11 PSNR: 84.05 MAXDIFF:  281 bytes:   190464/   190464
MAXDIFF: |281 - 0| >= 1
Test ac3-4.0-downmix-mono failed. Look at
tests/data/fate/ac3-4.0-downmix-mono.err for details.
make: *** [src/tests/Makefile:307: fate-ac3-4.0-downmix-mono] Error 1
TEST    ac3-fixed-2.0
stddev:  382.35 PSNR: 44.68 MAXDIFF:32866 bytes:   804864/   804864
MAXDIFF: |32866 - 0| >= 1
Test ac3-fixed-2.0 failed. Look at tests/data/fate/ac3-fixed-2.0.err for
details.
make: *** [src/tests/Makefile:307: fate-ac3-fixed-2.0] Error 1
TEST    ac3-fixed-4.0-downmix-mono
stddev: 1140.81 PSNR: 35.18 MAXDIFF:34416 bytes:   190464/   190464
MAXDIFF: |34416 - 0| >= 1
Test ac3-fixed-4.0-downmix-mono failed. Look at
tests/data/fate/ac3-fixed-4.0-downmix-mono.err for details.
make: *** [src/tests/Makefile:307: fate-ac3-fixed-4.0-downmix-mono] Error 1
TEST    ac3-fixed-encode
--- -	2022-09-25 14:22:45.695390813 +0200
+++ tests/data/fate/ac3-fixed-encode	2022-09-25 14:22:45.687999547 +0200
@@ -1 +1 @@
-1f548175e11a95e62ce20e442fcc8d08
+e9d78bca187b4bbafc4512bcea8efd3e
Test ac3-fixed-encode failed. Look at
tests/data/fate/ac3-fixed-encode.err for details.
make: *** [src/tests/Makefile:307: fate-ac3-fixed-encode] Error 1

(Additionally, checksums in unknown_layout-ac3, lavf-rm, shortest,
copy-shortest1 and copy-shortest2 need to be updated.)

As the above shows, the difference between the reference files and the
decoded output becomes larger in several tests, i.e. the reference files
won't be usable lateron. If the new float and fixed-point decoders
produce indeed produce nearly identical output, then one could write
tests that decode the same file with both the floating point and the
fixed point decoder, check that both are nearly identical and print a
checksum of the output of the fixed point decoder.

Also note that there is currently no test that directly verifies your
claims of greater accuracy. One could write such a test by encoding a
file with ac3-fixed and decoding it again (with the fixed point decoder)
and printing the psnr of input and output. No encoding tests does this
at the moment.

- Andreas

_______________________________________________
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-09-25 12:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23 23:14 Lynne
     [not found] ` <NCgcUxK--3-2@lynne.ee-NCgcZNj----2>
2022-09-23 23:15   ` [FFmpeg-devel] [PATCH 2/6] atrac9dec: switch " Lynne
     [not found]   ` <NCgciJh--3-2@lynne.ee-NCgclLI----2>
2022-09-23 23:18     ` [FFmpeg-devel] [PATCH 3/6] ac3: convert encoder and decoder " Lynne
     [not found]     ` <NCgdFqI--B-2@lynne.ee-NCgdIwE----2>
2022-09-23 23:18       ` [FFmpeg-devel] [PATCH 4/6] vorbisdec: convert " Lynne
     [not found]       ` <NCgdOA8--3-2@lynne.ee-NCgdR4N----2>
2022-09-23 23:19         ` [FFmpeg-devel] [PATCH 5/6] twinvq: " Lynne
     [not found]         ` <NCgdYSD--3-2@lynne.ee-NCgdaK4----2>
2022-09-23 23:20           ` [FFmpeg-devel] [PATCH 6/6] wmaprodec: " Lynne
2022-09-25 12:38             ` Andreas Rheinhardt
2022-09-24 18:42 ` [FFmpeg-devel] [PATCH 1/6] opus: convert encoder and decoder " Martin Storsjö
2022-09-24 19:26   ` Hendrik Leppkes
2022-09-24 19:31     ` Hendrik Leppkes
2022-09-24 19:40       ` Martin Storsjö
2022-09-24 21:57         ` Lynne
2022-09-25 19:55           ` Martin Storsjö
2022-09-25 20:45             ` Lynne
     [not found]         ` <NClNyyy--3-2@lynne.ee-NClVNO6----2>
2022-09-25  7:54           ` Lynne
2022-09-25 12:34             ` Andreas Rheinhardt [this message]
2022-09-25 21:08               ` Lynne
2022-09-25 21:17                 ` Andreas Rheinhardt
2022-09-25 21:46                   ` Lynne

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=AS8P250MB07442D11617DD983EAB02B698F539@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /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