mmozeiko

Joined 15 years ago

Karma
697
Submissions
149
Member since
Jul 27
https://github.com/mmozeiko/
View on Hacker News

Recent submissions

Comment · 12 days ago
> Inverses exist for each operation, which makes decryption possible.

It is worth mentioning that in modern AES usage this feature does not really matter, because block cipher is used in CTR mode. In CTR block cipher is used to create long keystream bytes (pretty much one-time-pad key). This keystream gets xor'ed with plaintext to get ciphertext. Then getting from ciphertext back to plaintext is exactly the same xor operation with same keystream, no inverse AES operations needed.

Comment · 2 months ago
Comment · 6 months ago
Comment · 6 months ago
xor swap trick was useful in older simd (sse1/sse2) when based on some condition you want to swap values or not:

  tmp = (a ^ b) & mask
  a ^= tmp
  b ^= tmp
If mask = 0xfff...fff then a/b will be swapped, otherwise if mask = 0 then they'll remain the same.
Comment · 7 months ago
How does it compare to rendering SVG by Direct2D itself? When using ID2D1DeviceContext5::DrawSvgDocument method, and ID2D1SvgDocument can be loaded from file with ID2D1DeviceContext5::CreateSvgDocument + SHCreateStreamOnFileW.
Comment · 1 year ago
Ah, I see. Yeah, then the current approach is fine.
Comment · 1 year ago
From what I understand from code those unwarps are just doing matrix multiply to get unwraped pixel location? In this case doing these operations directly in fragment shader instead of texture lookup will be faster. Memory bandwidth is not free. But simple ALU like this (just couple FMA's) can easily hide in shadow of texture sampling that happens afterwards. So simply upload those undistortion matrices (mat1 & mat2) as uniforms and do matrix multiply in shader for adjusting texcoords.
Comment · 1 year ago
There's also Windows.Graphics.Capture. It allows to get texture not only for whole desktop, but just individual windows.
Comment · 1 year ago
Comment · 1 year ago
If you change logic and/or to bitwise and/or then it'll be branchless.
Comment · 1 year ago
https://github.com/veluca93/fpnge is a very fast png encoder. A bit lower compression ratio, but runs significantly faster than alternatives. Here is a presentation with benchmarks:

https://www.lucaversari.it/FJXL_and_FPNGE.pdf

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton