Nicolas George (12019-07-19): > Sorry, I thought I missed the spot and you already applied it. > > This patch could be merged with this one: > > avcodec/ffwavesynth: More correct cast in wavesynth_seek() > > but it is not very important. > > As for: > > avcodec/ffwavesynth: Fix backward lcg_seek() > avcodec/ffwavesynth: Simplify lcg_seek(), avoid negative case > > If you checked they generate the same sequence, then ok and thanks. If > not, then I can do the testing tomorrow.
I tested with the following testing code, and the new version behaves perfectly. I do not believe this requires including the test program as part of the code base. It would have been if somebody had not had the bad idea of removing the possibility of having just "#if TEST \n int main() {...}" for quick tests. Regards, -- Nicolas George #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <inttypes.h> #define N 10000000 static uint32_t val[N]; int main(void) { uint32_t state = 'P' | ('I' << 8) | ('N' << 16) | ('K' << 24); unsigned i, pos, target; int64_t off; for (i = 0; i < N; i++) { val[i] = state; state = lcg_next(&state); } printf("final state = %08x\n", (unsigned)state); pos = 0; state = val[pos]; for (i = 0; i < 10000; i++) { target = val[pos] % N; off = (int64_t)target - (int64_t)pos; lcg_seek(&state, off); printf("seeking from %10d to %10d by %10"PRId64": %08x vs %08x\n", pos, target, off, (unsigned)state, (unsigned)val[target]); if (state != val[target]) exit(1); pos = target; } return 0; }
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".