In the last days, i updated the patch in the main post:
1) I relocated the standard alarmedpixels code and after relocation to its own function, it began working faster, even faster than the sse2 alarmedpixels code, so i left the sse2 alarmedpixels code included but not used. I could confirm this in my ZM test box and my home server. I suspect relocating the code to its own function allows the compiler to make better use of the available registers.
Just for comparison, here is the CPU usage of the zma process with the same settings used in the previous test:
Code: Select all
Patch - 32bit:
Standard alarmedpixels, before relocation: 15%
SSE2 alarmedpixels: 14%
Standard alarmedpixels, after relocation: 12%
Patch - 24bit:
Standard alarmedpixels, before relocation: 18%
SSE2 alarmedpixels: 17%
Standard alarmedpixels, after relocation: 15%
Patch - 8bit greyscale:
Standard alarmedpixels, before relocation: 9%
SSE2 alarmedpixels: 8%
Standard alarmedpixels, after relocation: 6%
Most USB cameras support the YUYV capture palette and MJPEG(or JPEG). The YUYV capture palette usually requires less CPU time than the JPEG\MJPEG capture palettes, which require decompression of the JPEG. However, USB bandwidth is limited and because of that, many USB cameras only support a small range of resolutions and frame rates when using the YUYV capture palette, and because the JPEG\MJPEG capture palettes were unsupported, people were using mjpeg_streamer as a workaround to this problem.
So now you shouldn't need mjpeg_streamer anymore, enjoy.
3) I added automatic capture palette selection for the local cameras code, this can be enabled by selecting the "Auto" capture palette.
This is mainly to help new users that set up their first monitor and have no idea what capture palette they should use. This works by probing the device for a list of capture palettes it supports and selecting a one based on a priority list for the selected target colourspace.
4) Fixed few small long time bugs, such as alarm lasting forever once triggered or zma crashing when linked to a disabled monitor.
5) Allow the blend percent to be zero, to disable image blending in case anyone wants that.
About the future. I am looking to complete some other stuff and then rebase the patch against the latest SVN version, submit it to Phil and hopefully he approves it
mastertheknife.