I ran into some unpleasant problem with my recorder. Some people still use it with analog tuners, and analog tuners tend to spit out “snow” if there is no signal.
The problem is that when noise enters the encoder, it becomes completely crazy and first consumes the entire processor, and then freezes. Since the main question is that the recorder should remain on and work no matter what I need, I have to figure out how to do this, so the encoder will not be exposed to data that it cannot process.
So, the idea is to create an “entropy detector” - a simple and small subroutine that will go through the frame buffer data and calculate the entropy index, that is, how the data in the picture is actually random.
The result of this procedure will be a number equal to 0 for a complete inverse image, and 1 for a completely random image - snow, that is.
The procedure itself should only be for forward scanning, with several local variables that fit well into the registers.
I could use zlib or 7z api for such a task, but I really would like to cook something myself.
Any ideas?
c ++ video entropy
Daniel Mošmondor Dec 05 '10 at 10:01 2010-12-05 10:01
source share