From: Michael Niedermayer <michael@niedermayer.cc> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [PATCH] avutil/eval: Use better PRNG Date: Thu, 4 Jan 2024 04:19:43 +0100 Message-ID: <20240104031943.GC6420@pb2> (raw) In-Reply-To: <ZZX0swjqOXbF2dpD@mariano> [-- Attachment #1.1: Type: text/plain, Size: 2651 bytes --] On Thu, Jan 04, 2024 at 12:58:43AM +0100, Stefano Sabatini wrote: > On date Wednesday 2024-01-03 23:24:33 +0100, Michael Niedermayer wrote: [...] > > > +typedef struct KISS64State{ > > + uint64_t x,y,z,c; > > +}KISS64State; > > missing namespace here and in the functions below. > > For this you could probably use AVKISS64PRNG (or AVKISS64), and use > av_kiss64prng_ or av_kiss64_ as function prefix (I'd probably go with > the shortest variant). > > > + > > +static inline uint64_t get_random64(KISS64State *s){ > > av_kiss64_get() ? as its not a public API yet, ill leave the av_ out but will switch to your names, they are nice and short [...] > > > + //Constants based on SHA512 of "FFmpeg" and Marsaglias values so seed=0 matches his > > + s->x = 1234567890987654321ULL ^ seed; > > + s->y =( 362436362436362436ULL ^ (0xd255973df01e5086*seed)) | 4; > > + s->z = 1066149217761810ULL + seed; > > + s->c = 123456123456123456ULL - 0x33730c0524f137da*seed; > > +} > > + > > +#endif /* AVUTIL_KISS__PRNGH */ > > diff --git a/tests/fate/libswresample.mak b/tests/fate/libswresample.mak > > index 0d29f760248..ea421d45fb6 100644 > > --- a/tests/fate/libswresample.mak > > +++ b/tests/fate/libswresample.mak > > @@ -359,7 +359,7 @@ fate-swr-resample_nn-s16p-8000-44100: SIZE_TOLERANCE = 96000 - 20480 > > define ARESAMPLE_ASYNC > > FATE_SWR_RESAMPLE += fate-swr-resample_async-$(3)-$(1)-$(2) > > fate-swr-resample_async-$(3)-$(1)-$(2): tests/data/asynth-$(1)-1.wav > > -fate-swr-resample_async-$(3)-$(1)-$(2): CMD = ffmpeg -i $(TARGET_PATH)/tests/data/asynth-$(1)-1.wav -af atrim=end_sample=10240,asetpts=PTS+random\(0\)*200-100,aresample=$(2):async=50:min_hard_comp=0.100000:first_pts=0:linear_interp=0:exact_rational=0:internal_sample_fmt=$(3),aformat=$(3),aresample=$(1):linear_interp=0:exact_rational=0:internal_sample_fmt=$(3) -f wav -c:a pcm_s16le - > > +fate-swr-resample_async-$(3)-$(1)-$(2): CMD = ffmpeg -i $(TARGET_PATH)/tests/data/asynth-$(1)-1.wav -af atrim=end_sample=10240,asetpts=PTS+random\(1\)*200-100,aresample=$(2):async=50:min_hard_comp=0.100000:first_pts=0:linear_interp=0:exact_rational=0:internal_sample_fmt=$(3),aformat=$(3),aresample=$(1):linear_interp=0:exact_rational=0:internal_sample_fmt=$(3) -f wav -c:a pcm_s16le - > > any reason to change the random() index? yes because i forgot removing that hunk. That was not intended to be in the patch [....] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB During times of universal deceit, telling the truth becomes a revolutionary act. -- George Orwell [-- 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".
prev parent reply other threads:[~2024-01-04 3:19 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-01-03 22:24 Michael Niedermayer 2024-01-03 23:58 ` Stefano Sabatini 2024-01-04 0:02 ` James Almer 2024-01-04 3:19 ` Michael Niedermayer [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=20240104031943.GC6420@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