Repository navigation
feat(harris0r): add Harris shutter effect - #302
Conversation
|
Current CI passes. I also ran the filter under ASan/UBSan without finding an immediate memory-bounds violation. A deterministic 8×8 frame sequence reproduced the mapping, channel-order, counter, and alpha defects above. I request changes before merging, or just confirm what I believe are issues they are intended filter behavior. 1. Medium: Delay does not round-tripThe setter maps normalized values into For example, setting *((double*)param) =
(double)(inst->delay - HARRIS_DELAY_MIN) /
(HARRIS_DELAY_MAX - HARRIS_DELAY_MIN);2. Medium: simple mode advances twice after its first frameThe initialization path sets With delay 1, the second input frame updates channel index 1, skipping index 0. Removing the assignment inside the initialization path would let the common increment advance it once. 3. Medium: RGBA channel handling is endian-dependent and reverses red/blue on little-endian systemsFrei0r defines On common little-endian machines, 4. Medium: simple mode freezes alpha at the first frameEach channel update preserves the remaining bytes from In a deterministic test, alpha remained 5. Low: allocation failures can crash the host
This is especially relevant because smooth mode can consume hundreds of megabytes and the filter supports switching modes. |
A Harris shutter effect. Supports switching between simple and smooth modes. Simple mode is less resource-requiring but also less eye-pleasing; smooth one looks great but requires lots of RAM.
Fix normalized Delay reporting and simple-mode frame sequencing. Address RGBA components by byte position and pass current alpha through in both modes. Check frame-size arithmetic and instance allocation. Retry failed frame-buffer allocations with passthrough output without advancing history, and reset buffers safely on mode changes. Add frame-sequence, parameter, mode-change, in-place, and allocator-failure regression tests. Verified 185 selected native tests, focused GCC and ASan tests, and the ASan/UBSan contract test.
A Harris shutter effect.
When I was younger, cooler and funnier, I had a phone, Sony Xperia SP. Its camera app had an effect called Harris shutter. When I discovered it, I was so fascinated... so that effect has burnt into my brain and soul.
Finally, exactly the same effect, now on Frei0r.
This implementation supports simple and smooth mode.
The smooth mode looks exactly the same as on that Sony phone, but requires lots of RAM.
Simple mode requires only 8 MB of additional memory for 1080p, but drops framerate by three times (not because of intensive computing but because of simpler shutter implementation) and looks a bit stutter-ish, but may be suitable for some use-cases and resource-limited computer configurations.
Parameter are Delay (a Double clamped to 0..16 internally, 16 is the max history frames that can be used) and Simple (boolean), defines if we useing simple or smooth variant.
The effect uses smooth mode by default.
Unfortunately, this effect cannot be used in multi-threaded processing because it needs frame history while MLT for example processes frames independently.
A demo of Harris shutter effect, smooth mode
harris0r.mp4