Video Compression

VideoNerd

Abstract
The purpose of this post is to describe injection of visually lossless noise. The injector generates invisible noise, i.e.  under Human Eye detection threshold (or in other words under JND – just noticeable difference).
Currently JND calculation is based on luminance masking (TBD – texture masking and temporal masking).  For details on Human Vision System refer Elements of Human Vision System

The purpose of the visually lossless noise injector was to check  whether Human Vision System observe the below-JND noise or not.  Moreover, this approach can be exploited in various watermarking schemas. 

 

Luminance-Based JND
The simplest way to compute JND is take into account the luminance masking (according to Weber Law). The frame is divided into 8×8 luma blocks and 4×4 chroma blocks respectively (due to the restriction to 4:2:0) and JND is specified for all pixels in each block. The block-based computation less time consuming than pixel-base one.

 

JND for Luma Pixels
The image is divided into 8×8 blocks and for each luma block we compute JND (which is applied to all pixels of the block).

 

where parameters a, c, d and f are set to values 2, 0.8, 3 and 2, respectively. The ‘b’ stands for the bit depth.  μY is the average of luma pixels in a given 8×8 block.

 

JND for Chroma Pixels
Chroma JNDs tend to be higher than luma ones. However, currently chroma share same luma JNDs.

 

Algo: Adding Visually Lossless Noise

Input:

SrcImg 
JNDmap  –  JND values computed for each 8×8 block

The following pseudo-code is executed to add visually lossless noise:

For each luma pixel (r,c)

{
             Get JND(r,c)
             If JND(r,c)>0 { // in case of JND=0 we can’t modify the pixel without compromising the quality
                   // get range of  deltas
                   PixVal = SrcImg[r,c]
                   maxVal = min(PixVal+JND,255)
                  minVal = max(PixVal-JND,0)
                 range = maxVal-minVal
                 if range=1 { // no sense to make randomization, swap values
                          if PixVal==maxVal {

                               newPixVal = maxVal-1

                         } 

                         elif    PixVal==minVal {

                                newPixVal = minVal+1

                       }
                } // End of range=1
               Else { // range>1
                           Get random value newPixVal from [minVal..maxVal] where PixVal is excluded
                      }
           } // End of JND>0
           Else { newPixVal = PixVal  } //JND=0

} // End For

 

C-code of the visually lossless noise injector is available here 

the compilation:  gcc -o vlossless.exe   vlossless.c

Usage:

 yuv-file   –  input yuv 420p file 

  width    – must be divided by 8

  heigth  – must be divided by 8

  out      – output yuv 420p file

 

Example:

vlossless.exe   test_384x320.yuv 384 320 noise1.yuv

Frame 0
Component Y:Zero JND Counter 0
JND=1 Counter 1576
Max JND 2

Frame 1
Component Y:Zero JND Counter 0
JND=1 Counter 1616
Max JND 2

..

Frame 552
Component Y:Zero JND Counter 0
JND=1 Counter 1614
Max JND 2

Frame 553
Component Y:Zero JND Counter 0
JND=1 Counter 1613
Max JND 2

Frame 554
Component Y:Zero JND Counter 0
JND=1 Counter 1620
Max JND 2

Frame 555
Component Y:Zero JND Counter 0
JND=1 Counter 1620
Max JND 2

12 Responses

  1. hello there and thank you for your info – I’ve certainly picked up anything new from right here. I did however expertise several technical points using this site, as I experienced to reload the site lots of times previous to I could get it to load properly. I had been wondering if your web host is OK? Not that I am complaining, but sluggish loading instances times will often affect your placement in google and could damage your quality score if advertising and marketing with Adwords. Anyway I am adding this RSS to my e-mail and could look out for a lot more of your respective interesting content. Make sure you update this again very soon..

  2. I do enjoy the manner in which you have presented this particular situation and it does give us a lot of fodder for thought. Nevertheless, coming from what I have personally seen, I simply hope when other remarks pack on that folks remain on issue and not embark upon a tirade involving some other news du jour. All the same, thank you for this superb point and while I do not agree with the idea in totality, I value your perspective.

  3. The core of your writing whilst sounding reasonable originally, did not work properly with me after some time. Somewhere throughout the sentences you actually were able to make me a believer unfortunately only for a while. I still have got a problem with your leaps in logic and one would do well to help fill in all those gaps. In the event you actually can accomplish that, I will certainly be fascinated.

  4. I delight in, lead to I discovered just what I was having a look for. You’ve ended my four day lengthy hunt! God Bless you man. Have a nice day. Bye

Leave a Reply

Your email address will not be published. Required fields are marked *