From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v2 2/2] random_seed: Improve behaviour with small timer increments with high precision timers
Date: Wed, 12 Feb 2025 20:45:20 +0100
Message-ID: <20250212194520.GQ4991@pb2> (raw)
In-Reply-To: <9cfa4774-50b1-7f98-4f8-e17ad8793dfb@martin.st>
[-- Attachment #1.1: Type: text/plain, Size: 1469 bytes --]
Hi Martin
On Wed, Feb 12, 2025 at 11:25:03AM +0200, Martin Storsjö wrote:
[...]
> > Heres an example where the SWAP is needed:
> > noswap swap
> > 5 -> [x 5] [x 5]
> > 4 -> [5 4] [5 4]
> > 5 -> [5 4] [4 5]
> > 6 -> [4 6] [5 6]
> > 5 -> [6 5] [6 5]
> >
> > In the last case the 5 is in the old* when the swap was used but not
> > when it was not used
>
> Sorry, but your examples do not make sense or do not contain enough context
> (it does not include the initial states of the two old values, and it
> requires guesswork which ones of the two [x y] values is old and which one
> is old2).
>
> But to be clear:
>
> Please specify the initial values of the variables new, old and old2, for a
> case where
>
> > > if (old2 == new) {
> > > FFSWAP(old,old2);
> > > } else if (old != new) {
> > > old2 = old;
> > > old = new;
> > > }
>
> produces a different end result than
>
> > > if (old != new) {
> > > old2 = old;
> > > old = new;
> > > }
>
> I claim that for any values of these variables, the end result is the same.
yes, you are correct, i thought you intended to run the old2/old update only if
new differs from both old and old2.
The actual code you wrote is fine and nicely optimizes the swap out
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The worst form of inequality is to try to make unequal things equal.
-- Aristotle
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
next prev parent reply other threads:[~2025-02-12 19:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-05 22:18 [FFmpeg-devel] [PATCH v2 1/2] random_seed: Reorder if clauses for gathering entropy Martin Storsjö
2025-02-05 22:18 ` [FFmpeg-devel] [PATCH v2 2/2] random_seed: Improve behaviour with small timer increments with high precision timers Martin Storsjö
2025-02-06 0:16 ` Michael Niedermayer
2025-02-06 12:38 ` Martin Storsjö
2025-02-06 16:04 ` Michael Niedermayer
2025-02-06 22:04 ` Martin Storsjö
2025-02-09 22:28 ` Michael Niedermayer
2025-02-10 13:54 ` Martin Storsjö
2025-02-11 23:49 ` Michael Niedermayer
2025-02-12 9:25 ` Martin Storsjö
2025-02-12 19:45 ` Michael Niedermayer [this message]
2025-02-12 19:52 ` Martin Storsjö
2025-02-12 21:47 ` Michael Niedermayer
2025-02-06 2:08 ` [FFmpeg-devel] [PATCH v2 1/2] random_seed: Reorder if clauses for gathering entropy Michael Niedermayer
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=20250212194520.GQ4991@pb2 \
--to=michael@niedermayer.cc \
--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