

YUV4MPEG-Denoiser (eventually part of the mjpegtools)
-----------------------------------------------------



1. About
--------

This program can remove noise from your typical video recordings to
increase the compression-ratio to be achieved by mpeg2enc (or if a
fixed bitrate is used, it can dramatically increase the image-
quality). 

The filter mainly reduces color- and luminance-noise and flickering
due to phase errors. It however does *not* do a good job on
color-noise introduced by the common BT8x8 chip-set itself (You will
have noticed, if you ever dared to record vertically reduced sequences
with that chip-set -- say 288 (or 384, or whatever...) lines instead of
full 576 -- that "nice" interleaved color-changes from one line to the
next. This annoying artefact is introduced by BT8x8 chip-set itself, by
only saving one color information for two lines but not interpolating
on the transmitted color-information. Despite of that oddity it has a
reasonable quality for that price... So just record "Full-Pal/NTSC"
and use yuvscaler to downscale your material! The quality is far
better than recording at your destination resolution directly!!!)  




2. Usage
--------

That's really easy! Just pipe a YUV4MPEG-stream into the filter... :)
no switches, no options (NO CARRIER. erm,...) and dare to win (or
loose -- Well, there *is* material which cannot be processed
successfully. It's rare, but it exists! Material containing really
heavy noise is very difficult. So better try it, before you sit and
wait for hours without getting a better result...)

As we now have a border-detection (which is most likely to fail ;-) we
need an option to override it: Just type "yuvdenoise -b xx" being "xx"
any number between 0 (zero, nix, nil, NULL) and a reasonable value
counted from top of the image. That is, "-b 64" will turn the topmost
64 lines in pure black as well as the lowest 64 lines, too... These
black borders seem to be symmetrically ?!? ;-)

My tip: If you can, use this feature (take the value from the
auto-detection as a first guess) as pure YUV-black (16,128,128) is easy
to encode and therefor saves some bits better to be used for the real
frame... Turn this feature off by typing "-b 0"



 
3. My way of using it...
------------------------

* I record at least 352x576 to 768x576 (PAL) with nuvrec (Roman
  Hochleitner's "NuppelVideo"), eg I use to record double the vertical
  resolution, I finally need! This is important for BT8x8 (it may not
  for Mjpeg based cards -- I don't know...).

* I use exportvideo to get rid of annoying borders and to generate a
  YUV4MPEG-stream which is piped ...

* ... into yuvscaler first(!) --> 352x288

* and then into the filter. (Well, the other way would work, too,
  except that the filter doesn't do interlaced MC yet and doesn't do a
  good job on interlaced frames that way... I'll fix that!)




4. Drawbacks
------------

In rare cases you'll notice very clean blocks directly aside totally
noisy ones... Seeing blocks is probably not what you want to get. 

It uses a MC with a search-radius of 32 pixels. It *will* slow down
the encoding process. (I probably will use i686 asm sometime to
increase speed any further).

I really have tested it on various source material (comics,
commercials, movies, video-clips...) I have not found material which
generally does not work -- but you may encounter such material. If so,
feel free to inform me about this.




Stefan Fendt
<stefan@lionfish.ping.de>
