From: "Martin Storsjö" <martin@martin.st>
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 21:52:35 +0200 (EET)
Message-ID: <bb30d61b-7363-d81-3c5b-48b6a6a76d6@martin.st> (raw)
In-Reply-To: <20250212194520.GQ4991@pb2>
On Wed, 12 Feb 2025, Michael Niedermayer wrote:
> 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
Thanks, then I'll push it soon. And after some delay, I'd also backport it
to a couple branches if that's ok; without this, "make fate" hangs on my
machine.
// 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".
next prev parent reply other threads:[~2025-02-12 19:52 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
2025-02-12 19:52 ` Martin Storsjö [this message]
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=bb30d61b-7363-d81-3c5b-48b6a6a76d6@martin.st \
--to=martin@martin.st \
--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