Abstract:
A method of video compression comprising: (a) receiving a first block of video frames; (b) fully compressing the first one or more video frames and partially compressing the other frames in said block of video frames; (c) optionally adding a next block of video frames to the already processed video frames, wherein said processed video frames comprises fully decoded video frames and partially decoded video frames; (d) fully compressing the next one or more frames and partially compressing other frames in said already processed video frames and said optionally next block of video frames; and repeating steps (c) and (d).

Description:
CROSS-REFERENCE TO RELATED PATENT APPLICATIONS 
       [0001]    This patent application claims priority from and is related to U.S. Provisional Patent Application Ser. No. 62/022,227, filed 9 Jul. 2014, this U.S. Provisional Patent Application incorporated by reference in its entirety herein. 
     
    
     TECHNOLOGY FIELD 
       [0002]    The present invention is in the field of video processing. 
       BACKGROUND 
       [0003]    Raw video files are huge. For example, an Ultra High Definition (UHD) movie with 120 frames per second (fps), 3840×2160 pixels per frame, 3 colors per pixel, and 16 bits per color, requires bandwidth of:
       3840*2160*120*3*16=47,775,744,000 Bits per sec≈50 Giga bits per sec, equivalent to about 500 high speed (100 Mbps) fiber channels.       
 
         [0005]    If the movie last for two hours, as usual, it requires storage of:
       47,775,744,000*7,200≈343,985 Giga bits≈45 Tera bytes, equivalent to about 9,000 regular (5 Gbytes) DVD disks.       
 
         [0007]    Video compression,
       “The art of reducing the video size without affecting its visual quality”, is therefore a necessary tool for any applications that deals with video.       
 
         [0009]    In general, a video consists of several components, such as in the RGB color space or in the YUV color space. However, without loss of generality we consider here only one such component. 
         [0010]    PCT application no. PCT/IB2013/059007 to the same applicant provides a video frame compression method given the entire video (or cut), namely frames preceding and following the currently compressed frame. 
         [0011]    PCT application no. PCT/IB2014/062524 to the same applicant provides a video frame compression method given at least part of the preceding frames. 
         [0012]    U.S. application Ser. No. 12/448,733 to the same applicant provides Entropy Coding/Decoding methods for image and video compression. 
       SUMMARY 
       [0013]    In a first aspect of the present invention there is provided a method of video compression comprising: (a) receiving a block of video frames; (b) fully compressing the first one or more video frames and partially compressing the other frames in said block of video frames; (c) optionally adding a next block of video frames to the already processed video, wherein said processed video comprises fully decoded compressed video frames and partially decoded compressed video frames; (d) fully compressing the next one or more frames and partially compressing the other frames in said already processed video and said optionally next block of video frames; and repeating steps (c) and (d). 
         [0014]    In a second aspect of the present invention there is provided a method of video decompression comprising: decoding a plurality of video frames, said decoding comprising decoding a fully compressed first one or more video frames and partially compressed other frames in said plurality of video frames; and repeatedly decoding a next fully compressed one or more video frames and partially compressed video frames. 
         [0015]    In a third aspect of the present invention there is provided a video codec comprising: an encoding unit configured to: a. receive a block of video frames; b. fully encode the first one or more video frames and partially encode the other frames in said block of video frames; c. optionally add a next block of video frames to the already processed video, 
         [0000]    wherein said processed video comprises fully decoded video frames and partially decoded video frames; d. fully encode the next one or more frames and partially encode the other frames in said already processed video frames and said optionally next block of video frames; and e. repeat steps c) and d); an entropy coding unit configured to create a compressed bitstream from said encoded frames, said compressed bitstream serves as input to the decoder; an entropy decoding unit configured to receive the compressed bitstream and decompress it to a plurality of encoded video frames; and a reconstructing unit configured to fully decode the first one or more video frames and partially decode the other frames in said plurality of video frames; and repeatedly fully decode the next one or more video frames and partially decode the other video frames. 
         [0016]    The next block of video frames may comprise a predefined number of video frames. 
         [0017]    The next block of video frames may comprise only one frame. 
         [0018]    The next block of video frames may be adapted dynamically to satisfy working conditions. 
         [0019]    The working conditions may comprise at least one of: desired latency, fluctuations in the network bandwidth, memory constraints, CPU power and GPU availability. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0020]      FIG. 1  is a diagram of the Universal video compression algorithm—initial stage; 
           [0021]      FIG. 2  is a diagram of the Universal video compression algorithm—stage n; 
           [0022]      FIG. 3  is a diagram of the Universal Video Codec; 
           [0023]      FIG. 4  is a diagram of the input to the Encoding unit—initial stage; 
           [0024]      FIG. 5  is a diagram of the output from the Encoding unit—initial stage; 
           [0025]      FIG. 6  is a diagram of the output from the Reconstructing unit—initial stage; 
           [0026]      FIG. 7  is a diagram of the input to the Encoding unit—stage n; 
           [0027]      FIG. 8  is a diagram of the output from the Encoding unit—stage n; and 
           [0028]      FIG. 9  is a diagram of the output from the Reconstructing unit—stage n. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0029]    The present invention provides a new video compression algorithm that generalizes the algorithms presented in Pat [1], and Pat [2]. For example, in Pat [2] we presented the No Latency video codec whereby the algorithm is limited by latency constraints to that of processing only one new frame at each step. In the present invention this is generalized to the processing of any number of new frames at each step. More generally the present invention adapts itself dynamically to the existing working conditions such as the required latency, the fluctuations in the network bandwidth, the memory constraints, the CPU power, the GPU availability etc. 
       DEFINITIONS 
       [0000]    
       
         
           
             1. The terms “compress”, “compressed”, “compression” and “encode”, “encoded”, “encoding” are used respectively throughout this document interchangeably. 
             2. The terms “decompress”, “decompressed”, “decompression” and “decode”, “decoded”, “decoding” are used respectively throughout this document interchangeably. 
             3. Fully compressed video frame: a video frame which has undergone a full compression process according to the existing working conditions and will not be further compressed. In other words, all the data required for fully compressing the video frame is available from previous fully compressed frames and later partially compressed frames.
           A fully compressed video frame is created by fully compressing a partially compressed video frame or a non-compressed video frame.   
         
             4. Partially compressed video frame: a video frame which has undergone a partial compression process, namely according to the existing working conditions the frame needs to be further compressed. In other words, not all the data required for fully compressing the video frame is available from previous fully compressed frames and later partially compressed frames. Video frames may be in various stages of partial compression. 
           
         
       
     
         [0035]    A partially compressed video frame is created by partially compressing a previously partially compressed video frame or a non-compressed video frame. 
         [0036]    In the following description and examples reference is made to one frame being fully encoded and decoded at each step, however this limitation has been introduced for simplifying the explanation and it is understood that the method of the present invention lends itself to more than one frame being encoded and decoded at each step. 
         [0037]    In  FIGS. 1 and 2 , we describe the new Universal video compression algorithm. At each step, a new frame is being fully encoded and decoded and possibly displayed. Namely, at step n, n=0, . . . , N, where N is the total number of video frames, frame number n is being fully encoded and decoded and possibly displayed. 
         [0038]    This is done as follows: 
         [0039]    Initially, at step n=0, see  FIG. 1 , the first 1+m 0  frames, where m 0 ≧0, are processed, and
       The first frame, frame number n=0, is being fully encoded/decoded and possibly displayed.   The next m 0  frames are being partially encoded/decoded.       
 
         [0042]    Then, at step n=1, . . . , N, see  FIG. 2 , the first n+1+m n  frames, where 
         [0000]      1+ m   n   ≧m   n-1   ,m   n ≧0
 
         [0000]    are processed. Here,
       The first n frames have already been fully encoded/decoded.   The next m n-1  frames have already been partially encoded/decoded.   The next m n −m n-1 +1 frames are new frames.       
 
         [0046]    The result of this step is:
       A new next frame, namely frame number n, being fully encoded/decoded and possibly displayed.   In case m n-1 &gt;1, the next m n-1 −1 frames being further partially encoded/decoded.   The next new m n −m n-1 +1 frames being partially encoded/decoded for the first time.       
 
         [0050]    The Universal Video Codec is depicted in  FIG. 3 . It consists of the following:
       An Encoder  300  having three main components:
           the Encoding unit  310 ,   the Entropy Coding unit  320 ; and   the Reconstructing unit  330 .   
           The compressed bitstream  340 .   A Decoder  350  having two main components:
           the Entropy Decoding unit  360 ; and   the Reconstructing unit  330 .   
               
 
         [0059]    The input to the Encoding unit is the correspondingly next new frames, and the correspondingly previously fully or/and partially decoded frames, see  FIGS. 1 and 2 . The output from the Encoding unit is the correspondingly resulting fully and/or partially encoded frames. The output from the Encoding unit is fed as input to both the Entropy Coding unit and to the Reconstructing unit. 
         [0060]    The Entropy Coding unit uses entropy coding methods such as discussed in Pat[3] to compress the resulting fully and/or partially encoded frames into the compressed bitstream. The Reconstructing unit applying the operations done in the Encoding unit, in a reverse order, reconstructs the correspondingly fully and/or partially decoded frames. These decoded frames are then fed back to the Encoding unit as an additional input for the next step as discussed above. 
         [0061]    The compressed bitstream which is the output from the Encoder is also the input to the Decoder. The compressed bitstream is the input to the Entropy Decoding unit. The output from the Entropy Decoding unit is the fully and/or partially encoded frames, and is the same as the output from the Encoding unit. 
         [0062]    The Decoder Reconstructing unit is therefore the same as that of the Encoder and it serves to reconstruct the correspondingly fully and/or partially decoded frames. The Decoder may now display the correspondingly next fully decoded frames, see  FIG. 2 . 
         [0063]    In  FIG. 4 , we depict the input to the initial stage of the Encoding unit. The input consists of the first 1+m 0  frames of the video. These frames are processed by the Encoding unit and the result is a fully encoded first frame, and the partially encoded next m 0  frames, see  FIG. 5 . The Encoding is done as in Pat [1] and Pat [2], only that now the next m 0  frames are considered to be only partially encoded and not fully encoded. The encoded frames are then sent to the Entropy Encoding unit which creates the compressed bitstream as discussed above. This compressed bitstream contains the fully compressed first frame, and the partially compressed next frames. The encoded frames are also fed back to the Reconstructing unit of the Encoder, as described in  FIG. 3 . In  FIG. 6 , we depict the result of the initial stage of the Decoder. The result is a fully decoded first frame, and the partially decoded next m 0  frames. At this point, the Decoder may also display the fully decoded first frame. Again, decoding is done as in Pat [1] and Pat [2], with the similar observation that now the next m 0  frames are considered to be only partially decoded and not fully decoded. 
         [0064]    In  FIG. 7 , we depict the input to the Encoding unit stage n. The input consists of the first n+1+m n  frames of which; n are the first fully decoded frames; the next m n-1  frames are the partially decoded frames from the previous stages; and the next m n −m n-1 +1 frames are the next new frames. These frames are processed by the Encoding unit and the result is a new fully encoded next frame, that is frame number n, and the next m n  partially encoded frames, see  FIG. 8 . Again, the Encoding is done as in Pat [1] and Pat [2], where the next m n  frames are considered to be only partially encoded and not fully encoded. The encoded frames are then sent to the Entropy Encoding unit which creates the compressed bitstream as discussed above. The encoded frames are also fed back to the Reconstructing unit of the Encoder, as described in  FIG. 3 . 
         [0065]    In  FIG. 9 , we depict the result of stage n of the Decoder. The result is a fully decoded next frame, that is frame number n, and the partially decoded next m n  frames. At this point, the Decoder may also display the new fully decoded frame, namely frame number n. Again, decoding is done as in Pat [1] and Pat [2], with the similar observation that now the next m n  frames are considered to be only partially decoded and not fully decoded. 
         [0066]    To conclude, in all the discussions above, one can replace the statement “fully encoding/decoding the first/next video frame”, with the corresponding text of “fully encoding/decoding the first/next one or more video frames” with no significant change to the structure of the algorithm. 
       A Working Example Describing Partial and Full Compression 
       [0067]    Assume for simplicity that we have a monochrome video (no color), where each frame consists of 1 row and 4 columns only, and that we have a total of 4 frames. 
         [0068]    Denote the pixels of the  4  input frames by:
       X=(69, 121, 91, 129),   Y=(65, 105, 114, 136),   Z=(85, 134, 66, 125),   W=(35, 86, 158, 136)       
 
         [0073]    Then, to represent the video using 8 bits per pixel, requires 128 bits. 
         [0074]    The following method utilizing partial and full compression requires only 48 bits. 
       Stage I: 
       [0075]    We start by compressing the pixels of frames Z and Y to the nearest multiples of 20, 
         [0000]        Z =(85,134,66,125)→(80,140,60,120)=(4,7,3,6)*20,
 
         [0000]        Y =(65,105,114,136)→(60,100,120,140)=(3,5,6,7)*20,
 
         [0076]    And compressing X, by setting 
         [0000]        X =( Z+Y )/2=(70,120,90,130). 
         [0077]    Note that after this stage, X will not be further compressed, and therefore it is called a fully compressed frame. Frames Y and Z will go through further compression and are therefore called partially compressed frames. 
         [0078]    We require 3 bits to represent the coefficients of Y and Z for a total of 24 bits. 
       Stage II: 
       [0079]    We now compress W to the nearest multiples of 20, namely 
         [0000]        W =(35,86,158,136)→(40,80,160,140)=(2,4,8,7)*20.
 
         [0080]    We further update Z to the nearest multiple of 10, namely, 
         [0000]        Z =(80,140,60,120)→ Z +(1,−1,1,1)*10=(90,130,70,130).
 
         [0081]    Then we compress Y by setting 
         [0000]        Y =( W+Z )/2=(65,105,115,135). 
         [0082]    Note that by this stage, Y has also become fully compressed, and Z and W are yet partially compressed. 
         [0083]    We now require additional 12 bits for representing W, and 4 bits for the update of Z, for a total of 40 bits altogether. 
       Stage III 
       [0084]    We now update Z to the nearest multiples of 5, namely 
         [0000]        Z =(90,130,70,130)→ Z +(−1,1,−1,−1)*5=(85,135,65,125).
 
         [0085]    Then we update W by the same method, replacing the factor 5 by 10, namely 
         [0000]        W =(40,80,160,140)→ W +(−1,1,−1,−1)*10=(30,90,150,130)
 
         [0086]    After this stage, Z is fully compressed, and W is still partially compressed. 
         [0087]    We require 4 more bits for this stage, for a total of 44 bits. 
       Stage IV 
       [0088]    Finally, we update W to the nearest multiples of 5, namely 
         [0000]        W =(30,90,150,130)→ W +(1,−1,1,1)*5=(35,85,155,135)
 
         [0089]    Now W has also become fully compressed. 
         [0090]    We require 4 more bits for this stage, for a total of 48 bits. 
         [0091]    To conclude: using partial compressed frames we received almost the same result: 
         [0000]        X =(69,121,91,129),→(70,120,90,130)
 
         [0000]        Y =(65,105,114,136),→(65,105,115,135)
 
         [0000]        Z =(85,134,66,125),→(85,135,65,125)
 
         [0000]        W =(35,86,154,136)→(35,85,155,135)
 
         [0092]    Using only about one third of the number of bits used at first. 
       PATENTS 
       [0093]    Pat [1] Ilan Bar-On and Oleg Kostenko,
       A New Algorithm for Video Compression,   App. No. PCT/IB2013/059007       
 
         [0096]    Pat [2] Ilan Bar-On and Oleg Kostenko,
       Multi-Level Spatial-Temporal Resolution Increase of Video   App. No. PCT/IB2014/062524       
 
         [0099]    Pat [3] Ilan Bar-On and Oleg Kostenko,
       A Method And A System For Wavelet Based Processing,       
 
         [0101]    U.S. application Ser. No. 12/448,733