Abstract:
This invention disclosed a visual perception characteristics-combining hierarchical video coding method, comprising: setting priority of visual interest area and setting allocation scheme of video coding resource. The former one is about: due to the richness of video image and selective perception of human visual, visual characteristics saliency of video content has been analyzed from time and space, priority of visual interest area can be labeled. The later one is about improving real-time performance of video coding, while at the same time, quality of video coding and compression efficiency is guaranteed. According to the priority of visual interest area, macroblock coding resource of interest area should be satisfied firstly, to realize hierarchical coding. The video coding scheme of this paper can remit conflict between coding complexity and coding efficiency validly. Compare with H.264/AVC international video coding standard, it can improve 80% of average coding speed, and at the same time it can maintain better quality of video image and lower compression bit-Rate. The video coding performance can be improved dramatically.

Description:
TECHNICAL FIELD 
       [0001]    The invention involves video coding scheme, especially involves a visual perception characteristics-combining hierarchical video coding method. 
       BACKGROUND ART 
       [0002]    With the rapid development of information processing and communication technology, IPTV, PDA, stereoscopic cinematography, 3D video and some diversity video services launched in succession, video coding show its wider development prospect in information processing and relevant area. However, the request of video quality is higher and higher, the performance index of digital video, for example, resolution, quality and frame rate improve fast while network bandwidth and memory space is limited. So, people raise some new request to video coding standard. 
         [0003]    To obtain video coding scheme with low complexity, high quality and high compression ratio, ITU-T and ISO/IEC launched video compression standard, H.264/AVC in 2003, and in January 2010, they set up a JCT-VC (Joint Collaborative Team on Video Coding) group. The proposal suggests that HEVC use mixed coding frame of H.264/AVC, developed new coding technology to solve the contradiction between compression ratio and coding complexity of today&#39;s coding standard to adapt various kinds of network transmission, loading more information processing work. The video coding standard and its&#39; application technology which is real-time, with high compression ratio and high definition, has become one of the hottest research spot in signal and information processing area. 
         [0004]    Up to now, many scholars have done a lot of research in fast video encoding or visual perception area, but less of these researches have combined two areas and study it in one coding frame to optimize video coding performance. 
         [0005]    In visual perception characteristics area, someone use color, luminance, directions and skin color as four kinds of visual characteristics to calculate interest area, but they ignore motion visual characteristics. Someone combine motion, luminance intensity, human face and character as visual characteristics, to reach interest obtain through building a visual caution model; another researcher using motion and vein information to obtain interest area; or someone propose to obtain interest area by compression domain or by wavelet transform. Because of all of global motion estimation algorithm we built is too complex, so that the complexity of visual interest area algorithm is too difficult. Video coding technology based on human visual system, mainly focus on optimizing distribution scheme of bit resource, video image quality is guaranteed when bit resource is limited. But this is short of consideration incalculating distribution, and at the same time, as for additional calculation of visual perception analyzing is complex, attention is not enough, computational efficiency need to improve. 
         [0006]    As for fast coding area, someone control motion estimation points, to realize fast coding at cost of losing of rate-distortion; someone control coding parameter to realize fast coding. But schemes above cannot distinguish the visual importance in different area of video image. Using same coding scheme for all coding content ignore the difference of video scene of human visual system. 
       CONTENTS OF THE INVENTION 
       [0007]    Aiming at these problems above, we raiseda visual perception characteristics-combining hierarchical video coding method. Comprising setting priority of visual interest area and setting allocationscheme of video coding resource; 
         [0008]    The setting priority of visual interest area mainly is: in view of the abundance of video image content and human visual selective perception mechanism, video content usually has double visual characteristics in time and space, calculation formula of [[visual characteristic saliency area]] can be expressed as: 
         [0000]    
       
         
           
             
               ROI 
                
               
                 ( 
                 
                   x 
                   , 
                   y 
                 
                 ) 
               
             
             = 
             
               { 
               
                 
                   
                     
                       3 
                       , 
                     
                   
                   
                     
                       ( 
                       
                         
                           ( 
                           
                             
                               T 
                                
                               
                                 ( 
                                 
                                   x 
                                   , 
                                   y 
                                   , 
                                   MV 
                                 
                                 ) 
                               
                             
                             = 
                             
                               
                                 2 
                                  
                                 
                                     
                                 
                                  
                                 or 
                                  
                                 
                                     
                                 
                                  
                                 
                                   T 
                                    
                                   
                                     ( 
                                     
                                       x 
                                       , 
                                       y 
                                       , 
                                       MV 
                                     
                                     ) 
                                   
                                 
                               
                               = 
                               1 
                             
                           
                           ) 
                         
                          
                         
                            
                           
                             
                               S 
                                
                               
                                 ( 
                                 
                                   x 
                                   , 
                                   y 
                                   , 
                                   Mode 
                                 
                                 ) 
                               
                             
                             = 
                             1 
                           
                           ) 
                         
                       
                       ) 
                     
                   
                 
                 
                   
                     
                         
                     
                   
                   
                     
                       
                         or 
                          
                         
                             
                         
                          
                         
                           S 
                            
                           
                             ( 
                             
                               x 
                               , 
                               y 
                               , 
                               Mode 
                             
                             ) 
                           
                         
                       
                       = 
                       2 
                     
                   
                 
                 
                   
                     
                       2 
                       , 
                     
                   
                   
                     
                       
                         ( 
                         
                           
                             T 
                              
                             
                               ( 
                               
                                 x 
                                 , 
                                 y 
                                 , 
                                 MV 
                               
                               ) 
                             
                           
                           = 
                           
                             
                               2 
                                
                               
                                   
                               
                                
                               or 
                                
                               
                                   
                               
                                
                               
                                 T 
                                  
                                 
                                   ( 
                                   
                                     x 
                                     , 
                                     y 
                                     , 
                                     MV 
                                   
                                   ) 
                                 
                               
                             
                             = 
                             1 
                           
                         
                         ) 
                       
                        
                       
                          
                         
                           
                             S 
                              
                             
                               ( 
                               
                                 x 
                                 , 
                                 y 
                                 , 
                                 Mode 
                               
                               ) 
                             
                           
                           = 
                           0 
                         
                       
                     
                   
                 
                 
                   
                     
                       1 
                       , 
                     
                   
                   
                     
                       
                         T 
                          
                         
                           ( 
                           
                             x 
                             , 
                             y 
                             , 
                             MV 
                           
                           ) 
                         
                       
                       = 
                       
                         0 
                          
                         
                            
                           
                             
                               S 
                                
                               
                                 ( 
                                 
                                   x 
                                   , 
                                   y 
                                   , 
                                   Mode 
                                 
                                 ) 
                               
                             
                             = 
                             1 
                           
                         
                       
                     
                   
                 
                 
                   
                     
                       0 
                       , 
                     
                   
                   
                     
                       
                         
                           
                             T 
                              
                             
                               ( 
                               
                                 x 
                                 , 
                                 y 
                                 , 
                                 MV 
                               
                               ) 
                             
                           
                           = 
                           0 
                         
                         ) 
                       
                        
                       
                          
                         
                           ( 
                           
                             
                               S 
                                
                               
                                 ( 
                                 
                                   x 
                                   , 
                                   y 
                                   , 
                                   Mode 
                                 
                                 ) 
                               
                             
                             = 
                             0 
                           
                         
                       
                     
                   
                 
               
             
           
         
       
     
         [0009]    ROI(x,y) represents visual interest priority of current coding macroblock, T(x,y,MV) represents time visual characteristic saliency of current coding macroblock, S(x,y,Mode) represents space visual characteristic saliency of current coding macroblock, (x, y) represents coordinate of current coding macroblock. 
         [0010]    The setting allocation scheme of video coding resource comprises:first optimizing macroblock coding of interest area so as to improve real-time performance of the video coding, while at the same time the quality and the compression efficiency of video coding is guaranteed; 
         [0011]    Using fast intra-frame prediction algorithm and gray scaly histogram of macroblock to describe the flat level of macroblock, according to the flat level of macroblock to select possible set of inter-frame prediction schema adaptively. 
         [0012]    Using fast inter frame prediction algorithm, through analyzing statistical property of the probability occurrence of inter prediction schema to anticipate on specific patterns so that unnecessary pattern search and calculation of RD cost can be stopped in advance, reducing waste of time. 
         [0013]    Using motion estimation search algorithm, based on relevance of macroblock motion vector, according to coding block movement, to identify search level, realizing high efficient search. 
         [0014]    the setting priority of visual interest area, first, label time visual saliency area, divided into 2 steps, step 1 motion vector noise detection and step 2, translation motion vector detection, used for reduction of the influence of accuracy for estimated value due to reduce motion vector noise and translation motion vector generated by camera motion respectively. To finish the separation between foreground and background, obtain accurate labelled result about time visual saliency area which is suitable for human visual system, then, label space visual characteristics saliency area, at last, according to identified result of visual characteristics saliency area of time and space, complete the label of visual characteristics saliency area. 
         [0015]    Step 1 noise vector calculate formula can be expressed as: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       T 
                       1 
                     
                      
                     
                       ( 
                       
                         x 
                         , 
                         y 
                         , 
                         MV 
                       
                       ) 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             3 
                             , 
                           
                         
                         
                           
                             
                               if 
                                
                               
                                   
                               
                                
                               
                                  
                                 
                                   
                                     V 
                                     rr 
                                   
                                   _ 
                                 
                                  
                               
                             
                             = 
                             0 
                           
                         
                       
                       
                         
                           
                             2 
                             , 
                           
                         
                         
                           
                             
                               elseif 
                                
                               
                                   
                               
                                
                               
                                  
                                 
                                   
                                     V 
                                     → 
                                   
                                   s 
                                 
                                  
                               
                             
                             ≥ 
                             
                                
                               
                                 
                                   V 
                                   rr 
                                 
                                 _ 
                               
                                
                             
                           
                         
                       
                       
                         
                           
                             
                               T 
                               2 
                             
                              
                             
                               ( 
                               
                                 x 
                                 , 
                                 y 
                                 , 
                                 MV 
                               
                               ) 
                             
                           
                         
                         
                           esle 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   1 
                   ) 
                 
               
             
           
         
       
     
         [0016]    (x, y) in (1) represents position coordinates, {right arrow over (V)} s  represents motion vector of current macroblock, {right arrow over (V)} rr  is average vector of motion reference area C rr , defined as: 
         [0000]    
       
         
           
             
               
                 V 
                 _ 
               
               rr 
             
             = 
             
               
                 
                   ∑ 
                   
                     ∈ 
                     
                       C 
                       rr 
                     
                   
                   
                       
                   
                 
                  
                 
                     
                 
                  
                 
                   
                     V 
                     → 
                   
                   rr 
                 
               
               
                 num 
                 
                   C 
                   rr 
                 
               
             
           
         
       
     
         [0017]    {right arrow over (v)} rr  represents macroblock motion vector in C rr , num C     rr    represents accumulation times 
         [0018]    C rr  defined as: shape, position and area of reference area C rr  can self-adapted with the change of motion vector {right arrow over (V)} s    
         [0019]    four macroblock located in upper right, upper left, lower right and lower left of C rr  are MB 1 , MB 2 , MB 3  , MB 4 , the position coordinates defined as: 
         [0000]    
       
         
           
             
               
                 
                   MB 
                   k 
                 
                  
                 
                   ( 
                   
                     
                       x 
                       k 
                     
                     , 
                     
                       y 
                       k 
                     
                   
                   ) 
                 
               
               
                 
                   k 
                   = 
                   1 
                 
                 , 
                 2 
                 , 
                 3 
                 , 
                 4 
               
             
             = 
             
               { 
               
                 
                   
                     
                       
                         
                           
                             
                               MB 
                               1 
                             
                              
                             
                               ( 
                               
                                 
                                   x 
                                   - 
                                   
                                     j 
                                     c 
                                   
                                 
                                 , 
                                 
                                   y 
                                   - 
                                   
                                     i 
                                     c 
                                   
                                 
                               
                               ) 
                             
                           
                         
                       
                       
                         
                           
                             
                               MB 
                               2 
                             
                              
                             
                               ( 
                               
                                 
                                   x 
                                   - 
                                   
                                     j 
                                     c 
                                   
                                 
                                 , 
                                 
                                   y 
                                   + 
                                   
                                     i 
                                     c 
                                   
                                 
                               
                               ) 
                             
                           
                         
                       
                       
                         
                           
                             
                               MB 
                               3 
                             
                              
                             
                               ( 
                               
                                 
                                   x 
                                   + 
                                   
                                     j 
                                     c 
                                   
                                 
                                 , 
                                 
                                   y 
                                   - 
                                   
                                     i 
                                     c 
                                   
                                 
                               
                               ) 
                             
                           
                         
                       
                       
                         
                           
                             
                               MB 
                               4 
                             
                              
                             
                               ( 
                               
                                 
                                   x 
                                   + 
                                   
                                     j 
                                     c 
                                   
                                 
                                 , 
                                 
                                   y 
                                   + 
                                   
                                     i 
                                     c 
                                   
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                      
                     
                       
 
                     
                      
                     
                       i 
                       c 
                     
                   
                   = 
                   
                     [ 
                     
                       
                         
                            
                           
                             
                               V 
                               → 
                             
                             sx 
                           
                            
                         
                         
                           w 
                           s 
                         
                       
                       + 
                       1 
                     
                     ] 
                   
                 
                 , 
                 
                   
                     j 
                     c 
                   
                   = 
                   
                     [ 
                     
                       
                         
                            
                           
                             
                               V 
                               → 
                             
                             sy 
                           
                            
                         
                         
                           h 
                           s 
                         
                       
                       + 
                       1 
                     
                     ] 
                   
                 
                 , 
                 
                    
                   
                     
                       V 
                       → 
                     
                     sx 
                   
                    
                 
                 , 
                 
                   and 
                    
                   
                       
                   
                    
                   
                      
                     
                       
                         V 
                         → 
                       
                       sy 
                     
                      
                   
                 
               
             
           
         
       
     
         [0000]    are motion amplitude of current motion vector {right arrow over (V)} s  in horizontal and vertical. w s  and h s  represents width and height of currentcode block. [·] represents integer calculation. 
         [0020]    If | V   rr |=0. there are no motion vector in C rr , consider {right arrow over (V)} s  is result from motion noise, should be removed, {right arrow over (V)} s  is set as 0. Labelled as T 1 (x, y, MV)=3 
         [0021]    If |{right arrow over (V)} s |≧| V rr   |, current code block has motion characteristic salience compare with near macroblock, which belongs to foreground dynamic area, marked as 
         [0000]      T 1 ( x,y,MV )=2 
         [0022]    If |{right arrow over (V)} s |≧| V rr   |, code block has similar motion characteristics with macroblock, the salience in time is not clear. It needs to do translation motion vector detection to confirm which area this code block belongs to, background area or foreground translation area. Marked as T 2 (x,y,MV). 
         [0023]    The calculation formula of translation motion vector detection: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       T 
                       2 
                     
                      
                     
                       ( 
                       
                         x 
                         , 
                         y 
                         , 
                         MV 
                       
                       ) 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             1 
                             , 
                           
                         
                         
                           
                             
                               if 
                                
                               
                                   
                               
                                
                               
                                 SAD 
                                 
                                   ( 
                                   
                                     x 
                                     , 
                                     y 
                                   
                                   ) 
                                 
                               
                             
                             ≥ 
                             
                               
                                 S 
                                 _ 
                               
                               c 
                             
                           
                         
                       
                       
                         
                           
                             0 
                             , 
                           
                         
                         
                           else 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
           
         
       
     
         [0024]    where (x,y) represents position coordinates of current code block,  S   c  represents dynamic threshold, SAD (x,y)  represents sum of absolute differences between current code block and corresponding station block in previous frame, used to characterize the change between two adjacent corresponding code blocks, defined as: 
         [0000]    
       
         
           
             
               SAD 
               
                 ( 
                 
                   x 
                   , 
                   y 
                 
                 ) 
               
             
             = 
             
               
                 ∑ 
                 
                   i 
                   = 
                   1 
                 
                 M 
               
                
               
                 
                   ∑ 
                   
                     j 
                     = 
                     1 
                   
                   N 
                 
                  
                 
                    
                   
                     
                       s 
                        
                       
                         ( 
                         
                           i 
                           , 
                           j 
                         
                         ) 
                       
                     
                     - 
                     
                       c 
                        
                       
                         ( 
                         
                           i 
                           , 
                           j 
                         
                         ) 
                       
                     
                   
                    
                 
               
             
           
         
       
     
         [0025]    where s(i,j) represents pixel value of current code block, c(i,j) represents corresponding pixel value in pervious frame, M, N represents length and width of current code block respectively 
         [0026]      S   c  represents average value of SAD of all code blocks in background area of pervious frame, defined as: 
         [0000]    
       
         
           
             
               
                 S 
                 _ 
               
               c 
             
             = 
             
               
                 
                   ∑ 
                   
                     x 
                     , 
                     
                       y 
                       ∈ 
                       
                         S 
                         c 
                       
                     
                   
                 
                  
                 
                     
                 
                  
                 
                   SAD 
                   
                     ( 
                     
                       x 
                       , 
                       y 
                     
                     ) 
                   
                 
               
               Num 
             
           
         
       
     
         [0027]    S c  represents background area of pervious frame, 
         [0000]    
       
         
           
             
               ∑ 
               
                 x 
                 , 
                 
                   y 
                   ∈ 
                   
                     S 
                     c 
                   
                 
               
             
              
             
                 
             
              
             
               SAD 
               
                 ( 
                 
                   x 
                   , 
                   y 
                 
                 ) 
               
             
           
         
       
     
         [0000]    represents the sum of SAD value of current code blocks in S c , Num represents accumulation times
       combined with step (1) and step (2) above, formula to label the salience of visual area of time can be expressed as:       
 
         [0000]    
       
         
           
             
               
                 
                   
                     T 
                      
                     
                       ( 
                       
                         x 
                         , 
                         y 
                         , 
                         MV 
                       
                       ) 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             3 
                             , 
                           
                         
                         
                           
                             
                               if 
                                
                               
                                   
                               
                                
                               
                                  
                                 
                                   
                                     V 
                                     rr 
                                   
                                   _ 
                                 
                                  
                               
                             
                             = 
                             0 
                           
                         
                       
                       
                         
                           
                             2 
                             , 
                           
                         
                         
                           
                             
                               elseif 
                                
                               
                                   
                               
                                
                               
                                  
                                 
                                   
                                     V 
                                     → 
                                   
                                   s 
                                 
                                  
                               
                             
                             ≥ 
                             
                                
                               
                                 
                                   V 
                                   rr 
                                 
                                 _ 
                               
                                
                             
                           
                         
                       
                       
                         
                           
                             1 
                             , 
                           
                         
                         
                           
                             
                               elseif 
                                
                               
                                   
                               
                                
                               
                                 SAD 
                                 
                                   ( 
                                   
                                     x 
                                     , 
                                     y 
                                   
                                   ) 
                                 
                               
                             
                             ≥ 
                             
                               
                                 S 
                                 _ 
                               
                               c 
                             
                           
                         
                       
                       
                         
                           
                             0 
                             , 
                           
                         
                         
                           else 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
         [0029]    parameters of (3) are same with (1) and (2) 
         [0030]    then, label the salience of visual area of space, calculation formula can be expressed as: 
         [0000]    
       
         
           
             
               
                 
                   
                     S 
                      
                     
                       ( 
                       
                         x 
                         , 
                         y 
                         , 
                         Mode 
                       
                       ) 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             2 
                             , 
                           
                         
                         
                           
                             
                               Mode 
                               P 
                             
                             ∈ 
                             
                               { 
                               Intra 
                               } 
                             
                           
                         
                       
                       
                         
                           
                             1 
                             , 
                           
                         
                         
                           
                             
                               Mode 
                               P 
                             
                             ∈ 
                             
                               
                                 { 
                                 
                                   Inter 
                                    
                                   
                                       
                                   
                                    
                                   8 
                                 
                                 } 
                               
                                
                               
                                   
                               
                                
                               or 
                                
                               
                                   
                               
                                
                               
                                 Mode 
                                 I 
                               
                             
                             ∈ 
                             
                               Intra 
                                
                               
                                   
                               
                                
                               4 
                               × 
                               4 
                             
                           
                         
                       
                       
                         
                           
                             0 
                             , 
                           
                         
                         
                           
                             
                               Mode 
                               P 
                             
                             ∈ 
                             
                               
                                 { 
                                 
                                   Inter 
                                    
                                   
                                       
                                   
                                    
                                   16 
                                 
                                 } 
                               
                                
                               
                                   
                               
                                
                               or 
                                
                               
                                   
                               
                                
                               
                                 Mode 
                                 I 
                               
                             
                             ∈ 
                             
                               Intra 
                                
                               
                                   
                               
                                
                               16 
                               × 
                               16 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
           
         
       
     
         [0031]    where (x, y) represents position coordinates of current code block, Mode represents prediction pattern of current code block, mode P  represents prediction pattern of current code block in P frame of code, mode I  represents prediction pattern of current code block in I frame of code. 
         [0032]    If mode P  chose intra-frame prediction, visual characteristic salience in space is the highest, belongs to sensitive area, marked as S(x,y,Mode)=2 
         [0033]    If mode P  chose the set of sub-block prediction, Inter8(8×8, 8×4, 4×8, 4×4) or chose Intra4×4 prediction pattern, that indicates spatial detail is rich, and have high visual characteristic salience in space, belongs to the region of interest, marked as: S(x,y,Mode)=1 
         [0034]    If mode P  chose the set of Inter-prediction of macroblock, Inter16(Skip, 16×16, 16×8, 8×16) or mode, chose Intra16×16 prediction, it indicates that space change is flat, and have low visual characteristic salience in space, belongs to non-obvious area, marked as S(x, y,Mode)=0; 
         [0035]    At last, according to the result of visual characteristics salience area identified of time and space to label visual characteristics salience area. 
         [0000]    The specific process of fast intra frame prediction algorithm. 
         [0036]    Step 1, calculate gray histogram of brightness component Y of current macroblock, 
         [0037]    record maximum pixels, Max Value; 
         [0038]    Step 2, set upper threshold Th high  and lower threshold Th low , Th high  and Th low  are integer range from [1,256] 
         [0039]    Step 3, if Max Value≧Th high , consider macroblock flat, give up Intra4×4 prediction, chose Intra16×16 prediction, take minimum overhead rate-distortion mode as the best intra-frame prediction mode, update upper threshold at the same time: 
         [0000]    
       
         
           
             
               
                 Th 
                 
                   high 
                    
                   
                     - 
                   
                    
                   new 
                 
               
               = 
               
                 
                   
                     Th 
                     high 
                   
                   + 
                   MaxValue 
                 
                 2 
               
             
             , 
           
         
       
     
         [0000]    otherwise, pass to step 4 
         [0040]    Step 4, if Max Value≦Th low , consider macroblock is rich in details, abandon Intra16×16 prediction mode, chose Intra4×4 prediction mode, take minimum overhead rate-distortion mode as the best intra-frame prediction mode, update lower threshold at the same time 
         [0000]    
       
         
           
             
               Th 
               
                 low 
                  
                 
                   - 
                 
                  
                 new 
               
             
             = 
             
               
                 
                   Th 
                   low 
                 
                 + 
                 MaxValue 
               
               2 
             
           
         
       
     
         [0000]    otherwise, pass to step 5 
         [0041]    Step 5, if Th row &lt;Max Value&lt;Th high , consider the flatness of macroblock is not obvious, using standard frame prediction algorithm; 
         [0042]    The upper threshold Th high  and lower threshold Th row  is set as 150 and 50 respectively 
         [0043]    The specific process of fast inter prediction algorithm: 
         [0044]    Step 1, Pre-judging of skip mode 
         [0045]    Step 1.1, calculate rate-distortion cost value J skip  of skip mode (mode 0), if it is lower than threshold value, stop searching for other modes, chose skip as the best prediction mode, then skip to step 4, otherwise, pass to step 1.2 
         [0046]    where: T=(0.7−Min − cost/18000)×Min_cost, Min_cost represents the best rate-distortion cost value of pervious code macroblock 
         [0047]    Step 1.2, calculate rate-distortion cost value of Inter16×16 mode (model)) J 16×16 , If J 16×16 &gt;J skip , chose Skip as the best coding mode, then skip to step 4, otherwise pass to step 2 
         [0048]    Step 2, the judgement of inter predictive mode of macroblock/sub-block 
         [0049]    Step 2.1, calculate rate-distortion cost value J 16×16  and J 8×8 , of Inter16×16 mode and Inter8×8 mode, If J 8×8 −J 16×16 &gt;T 0  chose Inter16×16 mode as the best inter code modal, skip to step 4, otherwise pass to step 2.2 
         [0050]    where T 0 =0.2×Min_cost, it is an adaptation experience value obtained from experiment data, the fast judgment prediction mode is guaranteed while it can reduce misjudgment ratio, Min_cost represents the best rate-distortion cost value of pervious code macroblock 
         [0051]    step 2.2, calculate rate-distortion cost value J 4×4 of Inter4×4 mode, If J 4×4 &lt;min(J 16×16 , J 8×8 ) take segmentation of intra frame mode Inter8×8, Inter8×4, Inter4×8 and Inter4×4 (mode 4˜mode 7) as intra frame alternative mode set. Otherwise, take macroblock level intra-frame prediction mode Inter16×16, Inter16×8, Inter8×16 (mode 1˜mode 3) as intra frame alternative mode set, give up segmentation of intra frame mode 
         [0052]    Step 3, Inter-frame mode prediction 
         [0053]    Step 3.1, calculate the ABE (Average Boundary Error) and SBE (Summation Boundary Error) of current code macroblock, ABE reflect macroblock time coherence, ABE=SBE/64 
         [0000]    
       
         
           
             SBE 
             = 
             
               
                 ∑ 
                 
                   i 
                   = 
                   0 
                 
                 15 
               
                
               
                  
                 
                   
                     
                       Y 
                       orig 
                     
                      
                     
                       ( 
                       
                         
                           x 
                           + 
                           i 
                         
                         , 
                         y 
                       
                       ) 
                     
                   
                   - 
                   
                     
                       
                         Y 
                         rec 
                       
                        
                       
                         ( 
                         
                           
                             x 
                             + 
                             i 
                           
                           , 
                           
                             y 
                             - 
                             1 
                           
                         
                         ) 
                       
                     
                      
                     
                        
                       
                         + 
                         
                           
                             ∑ 
                             
                               i 
                               = 
                               0 
                             
                             15 
                           
                            
                           
                              
                             
                               
                                 
                                   Y 
                                   orig 
                                 
                                  
                                 
                                   ( 
                                   
                                     x 
                                     , 
                                     
                                       y 
                                       + 
                                       i 
                                     
                                   
                                   ) 
                                 
                               
                               - 
                               
                                 
                                   Y 
                                   rec 
                                 
                                  
                                 
                                   ( 
                                   
                                     
                                       x 
                                       - 
                                       1 
                                     
                                     , 
                                     
                                       y 
                                       + 
                                       i 
                                     
                                   
                                   ) 
                                 
                               
                             
                              
                           
                         
                       
                     
                   
                 
               
             
           
         
       
     
         [0054]    where Y orig  represents pixel value of current macroblock, Y rec  represents pixel value of rebuild macroblock, (x, y) represents position coordinates of current macroblock 
         [0055]    Step 3.2, calculate AR (Average Rate) of current macroblock, AR reflects macroblock space coherence 
         [0000]        AR=λ Rate/ 384 
         [0056]    λ represents lagrange gene, Rate represents bit number which macroblock needed, 
         [0057]    Step 3.3, compare ABE and AR of macroblock, if ABE&lt;C·AR(C=0.95), it indicates that space redundancy lower than time redundancy, give up traverse calculation of intra-frame prediction, skip to step 4, otherwise, reserve traverse calculation of intra-frame prediction, skip to step 4. 
         [0058]    Step 4, based on rate-distortion rule to calculate and chose the best inter predictive mode, complete inter prediction coding. 
         [0059]    The specific process of Motion estimation search algorithm. 
         [0060]    Step 1, description of macroblock motion characteristics 
         [0061]    Step 1.1, based on rate-distortion rule, calculate motion estimation rate-cost value RD cost motion  of current macroblock 
         [0000]        J   motion ( mv ,ref|λ motion )= SAD[s, r (ref, mv )]+λ motion [ R ( mv −pred)+ R (ref)]
 
         [0000]    where s represents current pixel value of current macroblock, my represents macroblock motion vector, pred represents prediction vector, ref represents selected reference frame, r(ref,mv) represents pixel value of current reference macroblock, R represents consuming bit number when motion vector is doing differential encoding, including coding bit number (difference between motion vector and its&#39; prediction value)and reference coding bit number, λ motion  represents lagrange multipliers SAD represents sum of absolute differences between current block and reference block which is defined as: 
         [0000]    
       
         
           
             
               SAD 
                
               
                 ( 
                 
                   s 
                   , 
                   
                     c 
                      
                     
                       ( 
                       m 
                       ) 
                     
                   
                 
                 ) 
               
             
             = 
             
               
                 ∑ 
                 
                   
                     x 
                     = 
                     1 
                   
                   , 
                   
                     y 
                     = 
                     1 
                   
                 
                 
                   M 
                   , 
                   N 
                 
               
                
               
                  
                 
                   
                     s 
                      
                     
                       [ 
                       
                         x 
                         , 
                         y 
                       
                       ] 
                     
                   
                   - 
                   
                     c 
                      
                     
                       [ 
                       
                         
                           x 
                           - 
                           
                             m 
                             x 
                           
                         
                         , 
                         
                           y 
                           - 
                           
                             m 
                             y 
                           
                         
                       
                       ] 
                     
                   
                 
                  
               
             
           
         
       
     
         [0062]    M,N represents width and height of current macroblock, x, y represents macroblock position, s represents real value, c represents predictive value, m=(m x ,m y ) T  represents macroblock motion vector, m x  and m y  represents macroblock motion vector in horizontal and vertical direction, 
         [0063]    step 1.2, based on rate-distortion rule, calculate rate-cost value RD cost mode  in mode schema 
         [0000]        J   mode |λ mode )= SSD ( s,c, mod  e|QP )+λ mode   ×R ( s,c, mod  e|QP )
 
         [0064]    where Mode represents inter-frame coding schema of current macroblock, S represent origin video signals, c represents rebuild video signals after mode coding, λ mode  represents lagrange multipliers, R(s,c,mode|QP) represents sum of binary number including macroblock head information, motion vector and all DCT block information related to schema and quantization parameter, QP represents coding quantization step, SSD(s,c,mode) represents sum of difference of two squares between origin signals and rebuild signals 
         [0000]    
       
         
           
             
               SSD 
                
               
                 ( 
                 
                   s 
                   , 
                   c 
                   , 
                   
                     
                       mod 
                        
                       
                           
                       
                        
                       e 
                     
                      
                     QP 
                   
                 
                 ) 
               
             
             = 
             
               
                 
                   ∑ 
                   
                     
                       i 
                       = 
                       1 
                     
                     , 
                     
                       j 
                       = 
                       1 
                     
                   
                   
                     B 
                     , 
                     
                       B 
                       2 
                     
                   
                 
                  
                 
                   
                     ( 
                     
                       
                         
                           s 
                           Y 
                         
                          
                         
                           [ 
                           
                             x 
                             , 
                             y 
                           
                           ] 
                         
                       
                       - 
                       
                         
                           c 
                           Y 
                         
                          
                         
                           [ 
                           
                             x 
                             , 
                             y 
                             , 
                             
                               
                                 mod 
                                  
                                 
                                     
                                 
                                  
                                 e 
                               
                                
                               QP 
                             
                           
                           ] 
                         
                       
                     
                     ) 
                   
                   2 
                 
               
               + 
               
                 
                   ∑ 
                   
                     
                       i 
                       = 
                       1 
                     
                     , 
                     
                       j 
                       = 
                       1 
                     
                   
                   
                     B 
                     , 
                     
                       B 
                       2 
                     
                   
                 
                  
                 
                   
                     ( 
                     
                       
                         
                           s 
                           U 
                         
                          
                         
                           [ 
                           
                             x 
                             , 
                             y 
                           
                           ] 
                         
                       
                       - 
                       
                         
                           c 
                           U 
                         
                          
                         
                           [ 
                           
                             x 
                             , 
                             y 
                             , 
                             
                               
                                 mod 
                                  
                                 
                                     
                                 
                                  
                                 e 
                               
                                
                               QP 
                             
                           
                           ] 
                         
                       
                     
                     ) 
                   
                   2 
                 
               
               + 
               
                 
                   ∑ 
                   
                     
                       i 
                       = 
                       1 
                     
                     , 
                     
                       j 
                       = 
                       1 
                     
                   
                   
                     B 
                     , 
                     
                       B 
                       2 
                     
                   
                 
                  
                 
                   
                     ( 
                     
                       
                         
                           s 
                           V 
                         
                          
                         
                           [ 
                           
                             x 
                             , 
                             y 
                           
                           ] 
                         
                       
                       - 
                       
                         
                           c 
                           V 
                         
                          
                         
                           [ 
                           
                             x 
                             , 
                             y 
                             , 
                             
                               
                                 mod 
                                  
                                 
                                     
                                 
                                  
                                 e 
                               
                                
                               QP 
                             
                           
                           ] 
                         
                       
                     
                     ) 
                   
                   2 
                 
               
             
           
         
       
     
         [0000]    where B 1  and B 2  represents pixel number in horizontal and vertical direction of coding block, it can be 16, 8, 4; s Y [x y], c Y [x,y,mode|QP] represents value of brightness signals between origin video and rebuild video, C U ,C V  and s U ,s V  represents corresponding value of color difference signals 
         [0065]    Step 1.3, select minimum rate distortion value RD_min cost from RD cost motion  and RD cost mode ; 
         [0066]    Step 2, judgement of severe degree of macroblock motion, 
         [0067]    The calculation formula can be expressed as: 
         [0000]    
       
         
           
               
             
               { 
               
                 
                   
                     
                       
                         RD_min 
                          
                         
                             
                         
                          
                         cos 
                          
                         
                             
                         
                          
                         t 
                       
                       &lt; 
                       
                         
                           ( 
                           
                             1 
                             + 
                             γ 
                           
                           ) 
                         
                         × 
                         pred_min 
                          
                         
                             
                         
                          
                         cos 
                          
                         
                             
                         
                          
                         t 
                       
                     
                   
                   
                     
                       low 
                        
                       
                           
                       
                        
                       motion 
                        
                       
                           
                       
                        
                       degree 
                     
                   
                 
                 
                   
                     
                       
                         
                           ( 
                           
                             1 
                             + 
                             γ 
                           
                           ) 
                         
                         × 
                         pred_min 
                          
                         
                             
                         
                          
                         cos 
                          
                         
                             
                         
                          
                         t 
                       
                       &lt; 
                       
                         RD_min 
                          
                         
                             
                         
                          
                         cos 
                          
                         
                             
                         
                          
                         t 
                       
                       &lt; 
                     
                   
                   
                     
                       medium 
                        
                       
                           
                       
                        
                       motion 
                        
                       
                           
                       
                        
                       degree 
                     
                   
                 
                 
                   
                     
                       
                         ( 
                         
                           1 
                           + 
                           δ 
                         
                         ) 
                       
                       × 
                       pred_min 
                        
                       
                           
                       
                        
                       cos 
                        
                       
                           
                       
                        
                       t 
                     
                   
                   
                     
                       high 
                        
                       
                           
                       
                        
                       motion 
                        
                       
                           
                       
                        
                       degree 
                     
                   
                 
                 
                   
                     
                       
                         RD_min 
                          
                         
                             
                         
                          
                         cos 
                          
                         
                             
                         
                          
                         t 
                       
                       &gt; 
                       
                         
                           ( 
                           
                             1 
                             + 
                             δ 
                           
                           ) 
                         
                         × 
                         pred_min 
                          
                         
                             
                         
                          
                         cos 
                          
                         
                             
                         
                          
                         t 
                       
                     
                   
                   
                     
                         
                     
                   
                 
               
             
           
         
       
     
         [0068]    where γ, δ represents tuning factor of macroblock motion degree, defined as: 
         [0000]    
       
         
           
             
               γ 
               = 
               
                 
                   
                     B 
                      
                     
                         
                     
                      
                     
                       size 
                        
                       
                         [ 
                         blocktype 
                         ] 
                       
                     
                   
                   
                     pred_min 
                      
                     
                         
                     
                      
                     cos 
                      
                     
                         
                     
                      
                     
                       t 
                       2 
                     
                   
                 
                 - 
                 
                   
                     α 
                     1 
                   
                    
                   
                     [ 
                     blocktype 
                     ] 
                   
                 
               
             
             , 
             
               
 
             
              
             
               δ 
               = 
               
                 
                   
                     B 
                      
                     
                         
                     
                      
                     
                       size 
                        
                       
                         [ 
                         blocktype 
                         ] 
                       
                     
                   
                   
                     pred_min 
                      
                     
                         
                     
                      
                     cos 
                      
                     
                         
                     
                      
                     
                       t 
                       2 
                     
                   
                 
                 - 
                 
                   
                     α 
                     2 
                   
                    
                   
                     [ 
                     blocktype 
                     ] 
                   
                 
               
             
           
         
       
     
         [0069]    where Bsize[blocktype] represents size of current macroblock, there are 7 kinds of value: 16×16, 16×8, 8×16, 8×8, 8×4, 4×8, 4×4; pred_min cost are determined by motion vector prediction schema which is chosen by origin search point of UMHexagonS algorithm 
         [0070]    (1). If origin search point use time prediction motion vector, pred_min cost chose reference frame motion vector, reference frame MV predictor; 
         [0071]    (2). If origin search point did not use time prediction motion vector, divided into two categories: 
         [0072]    (2.1) If the size of current motion estimation macroblock inter predictive mode is large like 16×16, 16×8, 8×16, so pred_min cost is selected, chose median as predictive motion vector, median MV predictor; 
         [0073]    (2.2) If the size of current motion estimation macroblock inter predictive mode is small like 8×8, 8×4, 4×8, 4×4, so select uplayer predictive motion vector as the value of pred —  min cost 
         [0074]    Based on large amount experiments data, define array α 1 [blocktype] and array α 2 [blocktype] respectively: 
         [0000]      α 1 [blocktype]=[−0.23, −0.23, −0.23, −0.25, −0.27, −0.27, −0.28]
 
         [0000]      α 2 [blocktype]=[−2.39, −2.40, −2.40, −2.41, −2.45, −2.45, −2.48]
 
         [0075]    Step 3. determine macroblock motion and estimate search hierarchical 
         [0076]    Step 3.1 when macroblock motion degree is low, doing hexagonal lattice grid search from layer1 to layer3 in step “non-uniform 4 layers of hexagonal lattice grid search” of UMHexagonS algorithm 
         [0077]    Step 3.2 when macroblock motion degree is medium, doing hexagonal lattice grid search from layer1 to layer3 in step “non-uniform 4 layers of hexagonal lattice grid search” of UMHexagonS algorithm 
         [0078]    Step 3.3: when macroblock motion degree is high, doing 4 layers hexagonal lattice grid search in step “non-uniform 4 layers of hexagonal lattice grid search” of UMHexagonS algorithm. 
         [0079]    The invention use double layer structure which are video coding layer and visual perception analysis layer to realize fast coding. The visual perception analysis layer use the information of bit stream of coding layer to analyze visual characteristic salience, label priority visual interest area, cut down calculation time of visual perception analysis dramatically. On the other hand, the multiplex perception analysis layer of coding layer which output analysis result of visual characteristic salience, calculation resource of bit allocation can be optimized, an hierarchical video coding scheme can be realized and improve coding speed. Video image quality and coding efficiency is guaranteed in this invention, at the same time, calculation speed of coding is improved, this invention reaches balance state with three parts of coding speed, subjective video image quality and Compression Rate. 
     
    
     
       DESCRIPTION OF APPENDED DRAWINGS 
         [0080]      FIG. 1  shows the comparative results of bit distortion performance in this invention. 
           [0081]      FIG. 2  shows the comparative results of calculation complexity. 
       
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
       [0082]    The invention will be described in more detail below accompanying the appended drawings with the preferred embodiments comprising: setting priority of visual interest area and setting allocation scheme of video coding resource. The setting priority of visual interest area mainly is: since the richness of video image content and human visual selective perception mechanism, video content usually have double visual characteristics in time and space. To cut down the calculation complexity of time and space visual characteristics of video content, a schema proposed for labelling video salience area of human eyes in time and space by using existed information of video coding bit stream. 
         [0083]    First, the setting priority of visual interest area, first, label time visual saliency area, divided into 2 steps, step 1 motion vector noise detection and step 2, translation motion vector detection, used for reduction of the influence of accuracy for estimated value due to reduce motion vector noise and translation motion vector generated by camera motion respectively, to finish the separation between foreground and background, obtain accurate labelled result about time visual saliency area which is suitable for human visual system. 
         [0084]    (1). Noise Detection of Motion Vector 
         [0085]    Noise vector calculate formula can be expressed as: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       T 
                       1 
                     
                      
                     
                       ( 
                       
                         x 
                         , 
                         y 
                         , 
                         MV 
                       
                       ) 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             3 
                             , 
                           
                         
                         
                           
                             
                               
                                 if 
                                  
                                 
                                     
                                 
                                  
                                 
                                    
                                   
                                     
                                       V 
                                       rr 
                                     
                                     _ 
                                   
                                    
                                 
                               
                               = 
                               0 
                             
                              
                             
                                 
                             
                           
                         
                       
                       
                         
                           
                             2 
                             , 
                           
                         
                         
                           
                             
                               elseif 
                                
                               
                                   
                               
                                
                               
                                  
                                 
                                   
                                     V 
                                     → 
                                   
                                   s 
                                 
                                  
                               
                             
                             ≥ 
                             
                                
                               
                                 
                                   V 
                                   rr 
                                 
                                 _ 
                               
                                
                             
                           
                         
                       
                       
                         
                           
                             
                               T 
                               2 
                             
                              
                             
                               ( 
                               
                                 x 
                                 , 
                                 y 
                                 , 
                                 MV 
                               
                               ) 
                             
                           
                         
                         
                           esle 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   1 
                   ) 
                 
               
             
           
         
       
     
         [0086]    (x, y) in (1) represents position coordinates, {right arrow over (V)} s  represents motion vector of current macroblock,  V   rr  is average vector of motion reference area C rr , defined as: 
         [0000]    
       
         
           
             
               
                 V 
                 _ 
               
               rr 
             
             = 
             
               
                 
                   ∑ 
                   
                     ∈ 
                     
                       C 
                       rr 
                     
                   
                 
                  
                 
                     
                 
                  
                 
                   
                     V 
                     rr 
                   
                   → 
                 
               
               
                 num 
                 
                   C 
                   rr 
                 
               
             
           
         
       
     
         [0087]    {right arrow over (v)} rr  represents macroblock motion vector in C rr , num C     rr    represents accumulation times 
         [0088]    C rr  defined as: shape, position and area of reference area C rr  can self-adapted with the change of motion vector {right arrow over (V)} s    
         [0089]    four macroblocks located in upper right, upper left, lower right and lower left of C rr  are MB 1 , MB 2 , MB 3  , MB 4 , the position coordinates defined as: 
         [0000]    
       
         
           
             
               
                 
                   MB 
                   k 
                 
                  
                 
                   ( 
                   
                     
                       x 
                       k 
                     
                     , 
                     
                       y 
                       k 
                     
                   
                   ) 
                 
               
               
                 
                   k 
                   = 
                   1 
                 
                 , 
                 2 
                 , 
                 3 
                 , 
                 4 
               
             
             = 
             
               [ 
               
                 
                   
                     
                       
                         
                           
                             
                               MB 
                               1 
                             
                              
                             
                               ( 
                               
                                 
                                   x 
                                   - 
                                   
                                     j 
                                     c 
                                   
                                 
                                 , 
                                 
                                   y 
                                   - 
                                   
                                     i 
                                     c 
                                   
                                 
                               
                               ) 
                             
                           
                         
                       
                       
                         
                           
                             
                               MB 
                               2 
                             
                              
                             
                               ( 
                               
                                 
                                   x 
                                   - 
                                   
                                     j 
                                     c 
                                   
                                 
                                 , 
                                 
                                   y 
                                   + 
                                   
                                     i 
                                     c 
                                   
                                 
                               
                               ) 
                             
                           
                         
                       
                       
                         
                           
                             
                               MB 
                               3 
                             
                              
                             
                               ( 
                               
                                 
                                   x 
                                   + 
                                   
                                     j 
                                     c 
                                   
                                 
                                 , 
                                 
                                   y 
                                   - 
                                   
                                     i 
                                     c 
                                   
                                 
                               
                               ) 
                             
                           
                         
                       
                       
                         
                           
                             
                               MB 
                               4 
                             
                              
                             
                               ( 
                               
                                 
                                   x 
                                   + 
                                   
                                     j 
                                     c 
                                   
                                 
                                 , 
                                 
                                   y 
                                   + 
                                   
                                     i 
                                     c 
                                   
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                      
                     
                       
 
                     
                      
                     
                       i 
                       c 
                     
                   
                   = 
                   
                     [ 
                     
                       
                         
                            
                           
                             
                               V 
                               sx 
                             
                             → 
                           
                            
                         
                         
                           w 
                           s 
                         
                       
                       + 
                       1 
                     
                     ] 
                   
                 
                 , 
                 
                   
                     j 
                     c 
                   
                   = 
                   
                     [ 
                     
                       
                         
                            
                           
                             
                               V 
                               sy 
                             
                             → 
                           
                            
                         
                         
                           h 
                           s 
                         
                       
                       + 
                       1 
                     
                     ] 
                   
                 
                 , 
                 
                    
                   
                     
                       V 
                       sx 
                     
                     → 
                   
                    
                 
                 , 
                 
                   and 
                    
                   
                       
                   
                    
                   
                      
                     
                       
                         V 
                         sy 
                       
                       → 
                     
                      
                   
                 
               
             
           
         
       
     
         [0000]    are motion amplitude of current motion vector {right arrow over (V)} s  in horizontal and vertical. w s  and h s  represents width and height of current code block. H represents integer calculation 
         [0090]    If |{right arrow over (V)} rr |=0. there is no motion vector in C rr , consider {right arrow over (V)} s  is result from motion noise, should be removed, {right arrow over (V)} s , is set as 0. Labelled as T 1 (x,y,MV)=3 
         [0091]    If |{right arrow over (V)} s |≧| V rr   |, current code block has motion characteristic salience compare with near macroblock, which belongs to foreground dynamic area, marked as T 1 (x,y,MV)=2 
         [0092]    If |{right arrow over (V)} s |≧| V rr   |, current code block has similar motion characteristic salience with near macroblock, the salience in time is not clear, it needs to do translation motion vector detection to confirm which area this code block belongs to, background area or foreground translation area, marked as T 2 (x,y,MV) 
         [0093]    (2). Translation Motion Vector Detection 
         [0094]    The calculation formula of translation motion vector detection: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       T 
                       2 
                     
                      
                     
                       ( 
                       
                         x 
                         , 
                         y 
                         , 
                         MV 
                       
                       ) 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             1 
                             , 
                           
                         
                         
                           
                             
                               if 
                                
                               
                                   
                               
                                
                               
                                 SAD 
                                 
                                   ( 
                                   
                                     x 
                                     , 
                                     y 
                                   
                                   ) 
                                 
                               
                             
                             ≥ 
                             
                               
                                 S 
                                 _ 
                               
                               c 
                             
                           
                         
                       
                       
                         
                           
                             0 
                             , 
                           
                         
                         
                           else 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
           
         
       
     
         [0095]    where (x,y) represents position coordinates of current code block,  S   c  represents dynamic threshold, SAD (x,y)  represents sum of absolute differences between current code block and corresponding station block in previous frame, used to characterize the change between two adjacent corresponding code blocks, defined as: 
         [0000]    
       
         
           
             
               SAD 
               
                 ( 
                 
                   x 
                   , 
                   y 
                 
                 ) 
               
             
             = 
             
               
                 ∑ 
                 
                   i 
                   = 
                   1 
                 
                 M 
               
                
               
                 
                   ∑ 
                   
                     j 
                     = 
                     1 
                   
                   N 
                 
                  
                 
                    
                   
                     
                       s 
                        
                       
                         ( 
                         
                           i 
                           , 
                           j 
                         
                         ) 
                       
                     
                     - 
                     
                       c 
                        
                       
                         ( 
                         
                           i 
                           , 
                           j 
                         
                         ) 
                       
                     
                   
                    
                 
               
             
           
         
       
     
         [0096]    where s(i,j) represents pixel value of current code block, c(i,j) represents corresponding pixel value in pervious frame, M, N represents length and wide of current code block respectively 
         [0097]      S   c  represents average value of SAD of all code blocks in background area of pervious frame, defined as: 
         [0000]    
       
         
           
             
               
                 S 
                 _ 
               
               c 
             
             = 
             
               
                 
                   ∑ 
                   
                     x 
                     , 
                     
                       y 
                       ∈ 
                       
                         S 
                         c 
                       
                     
                   
                 
                  
                 
                     
                 
                  
                 
                   SAD 
                   
                     ( 
                     
                       x 
                       , 
                       y 
                     
                     ) 
                   
                 
               
               Num 
             
           
         
       
     
         [0098]    S c  represents background area of pervious frame, 
         [0000]    
       
         
           
             
               ∑ 
               
                 x 
                 , 
                 
                   y 
                   ∈ 
                   
                     S 
                     c 
                   
                 
               
             
              
             
                 
             
              
             
               SAD 
               
                 ( 
                 
                   x 
                   , 
                   y 
                 
                 ) 
               
             
           
         
       
     
         [0000]    represents the sum of SAD value of current code blocks in S c , Num represents accumulation times 
         [0099]    Combined with step (1) and step (2) above, the formula for labelling the salience of visual area of time domain can be expressed as: 
         [0000]    
       
         
           
             
               
                 
                   
                     T 
                      
                     
                       ( 
                       
                         x 
                         , 
                         y 
                         , 
                         MV 
                       
                       ) 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             3 
                             , 
                           
                         
                         
                           
                             
                               if 
                                
                               
                                   
                               
                                
                               
                                  
                                 
                                   
                                     V 
                                     rr 
                                   
                                   _ 
                                 
                                  
                               
                             
                             = 
                             0 
                           
                         
                       
                       
                         
                           
                             2 
                             , 
                           
                         
                         
                           
                             
                               elseif 
                                
                               
                                   
                               
                                
                               
                                  
                                 
                                   
                                     V 
                                     → 
                                   
                                   s 
                                 
                                  
                               
                             
                             ≥ 
                             
                                
                               
                                 
                                   V 
                                   rr 
                                 
                                 _ 
                               
                                
                             
                           
                         
                       
                       
                         
                           
                             1 
                             , 
                           
                         
                         
                           
                             
                               elseif 
                                
                               
                                   
                               
                                
                               
                                 SAD 
                                 
                                   ( 
                                   
                                     x 
                                     , 
                                     y 
                                   
                                   ) 
                                 
                               
                             
                             ≥ 
                             
                               
                                 S 
                                 _ 
                               
                               c 
                             
                           
                         
                       
                       
                         
                           
                             0 
                             , 
                           
                         
                         
                           else 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
         [0100]    parameters of (3) are same with (1) and (2) 
         [0101]    then, label the salience of visual area of space, calculation formula can be expressed as: 
         [0000]    
       
         
           
             
               
                 
                   
                     S 
                      
                     
                       ( 
                       
                         x 
                         , 
                         y 
                         , 
                         Mode 
                       
                       ) 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             2 
                             , 
                           
                         
                         
                           
                             
                               Mode 
                               P 
                             
                             ∈ 
                             
                               { 
                               Intra 
                               } 
                             
                           
                         
                       
                       
                         
                           
                             1 
                             , 
                           
                         
                         
                           
                             
                               Mode 
                               P 
                             
                             ∈ 
                             
                               
                                 { 
                                 
                                   Inter 
                                    
                                   
                                       
                                   
                                    
                                   8 
                                 
                                 } 
                               
                                
                               
                                   
                               
                                
                               or 
                                
                               
                                   
                               
                                
                               
                                 Mode 
                                 I 
                               
                             
                             ∈ 
                             
                               Intra 
                                
                               
                                   
                               
                                
                               4 
                               × 
                               4 
                             
                           
                         
                       
                       
                         
                           
                             0 
                             , 
                           
                         
                         
                           
                             
                               Mode 
                               P 
                             
                             ∈ 
                             
                               
                                 { 
                                 
                                   Inter 
                                    
                                   
                                       
                                   
                                    
                                   16 
                                 
                                 } 
                               
                                
                               
                                   
                               
                                
                               or 
                                
                               
                                   
                               
                                
                               
                                 Mode 
                                 I 
                               
                             
                             ∈ 
                             
                               Intra 
                                
                               
                                   
                               
                                
                               16 
                               × 
                               16 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
           
         
       
     
         [0102]    where (x, y) represents position coordinates of current code block, Mode represents prediction pattern of current code block, mode P  represents prediction pattern of current code block in P frame of code, mode 1  represents prediction pattern of current code block in I frame of code, 
         [0103]    If mode P  chose intra-frame prediction, visual characteristic salience in space is the highest, belongs to sensitive area, marked as S(x,y,Mode)=2; 
         [0104]    If mode P  chose the set of sub-block prediction, Inter8(8×8, 8×4, 4×8, 4×4) or chose Intra4×4 prediction pattern, that indicates spatial detail is rich, and have high visual characteristic salience in space, belongs to the region of interest, marked as: S(x,y,Mode)=1 
         [0105]    If mode P  chose the set of Inter-prediction of macroblock, Inter16(Skip, 16×16, 16×8, 8×16) or mode 1  chose Intra16×16 prediction, it indicates that space change is flat, and have low visual characteristic salience in space, belongs to non-obvious area, marked as S(x,y,Mode)=0; 
         [0106]    At last, according to the result of visual characteristics salience area identified of time and space to label visual characteristics salience area. 
         [0107]    The calculation formula is: 
         [0000]    
       
         
           
             
               
                 
                   
                     ROI 
                      
                     
                       ( 
                       
                         x 
                         , 
                         y 
                       
                       ) 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             3 
                             , 
                           
                         
                         
                           
                             ( 
                             
                               
                                 ( 
                                 
                                   
                                     T 
                                      
                                     
                                       ( 
                                       
                                         x 
                                         , 
                                         y 
                                         , 
                                         MV 
                                       
                                       ) 
                                     
                                   
                                   = 
                                   
                                     
                                       2 
                                        
                                       
                                           
                                       
                                        
                                       or 
                                        
                                       
                                           
                                       
                                        
                                       
                                         T 
                                          
                                         
                                           ( 
                                           
                                             x 
                                             , 
                                             y 
                                             , 
                                             MV 
                                           
                                           ) 
                                         
                                       
                                     
                                     = 
                                     1 
                                   
                                 
                                 ) 
                               
                                
                             
                           
                         
                       
                       
                         
                           
                               
                           
                         
                         
                           
                             
                               
                                 
                                   
                                     
                                       S 
                                        
                                       
                                         ( 
                                         
                                           x 
                                           , 
                                           y 
                                           , 
                                           Mode 
                                         
                                         ) 
                                       
                                     
                                     = 
                                     1 
                                   
                                   ) 
                                 
                                 ) 
                               
                                
                               
                                   
                               
                                
                               or 
                                
                               
                                   
                               
                                
                               
                                 S 
                                  
                                 
                                   ( 
                                   
                                     x 
                                     , 
                                     y 
                                     , 
                                     Mode 
                                   
                                   ) 
                                 
                               
                             
                             = 
                             2 
                           
                         
                       
                       
                         
                           
                             2 
                             , 
                           
                         
                         
                           
                             
                               ( 
                               
                                 
                                   T 
                                    
                                   
                                     ( 
                                     
                                       x 
                                       , 
                                       y 
                                       , 
                                       MV 
                                     
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     2 
                                      
                                     
                                         
                                     
                                      
                                     or 
                                      
                                     
                                         
                                     
                                      
                                     
                                       T 
                                        
                                       
                                         ( 
                                         
                                           x 
                                           , 
                                           y 
                                           , 
                                           MV 
                                         
                                         ) 
                                       
                                     
                                   
                                   = 
                                   1 
                                 
                               
                               ) 
                             
                              
                           
                         
                       
                       
                         
                           
                               
                           
                         
                         
                           
                             
                               S 
                                
                               
                                 ( 
                                 
                                   x 
                                   , 
                                   y 
                                   , 
                                   Mode 
                                 
                                 ) 
                               
                             
                             = 
                             0 
                           
                         
                       
                       
                         
                           
                             1 
                             , 
                           
                         
                         
                           
                             
                               T 
                                
                               
                                 ( 
                                 
                                   x 
                                   , 
                                   y 
                                   , 
                                   MV 
                                 
                                 ) 
                               
                             
                             = 
                             
                               0 
                                
                               
                                  
                                 
                                   
                                     S 
                                      
                                     
                                       ( 
                                       
                                         x 
                                         , 
                                         y 
                                         , 
                                         Mode 
                                       
                                       ) 
                                     
                                   
                                   = 
                                   1 
                                 
                               
                             
                           
                         
                       
                       
                         
                           
                             0 
                             , 
                           
                         
                         
                           
                             
                               
                                 
                                   T 
                                    
                                   
                                     ( 
                                     
                                       x 
                                       , 
                                       y 
                                       , 
                                       MV 
                                     
                                     ) 
                                   
                                 
                                 = 
                                 0 
                               
                               ) 
                             
                              
                             
                                
                               
                                 ( 
                                 
                                   
                                     S 
                                      
                                     
                                       ( 
                                       
                                         x 
                                         , 
                                         y 
                                         , 
                                         Mode 
                                       
                                       ) 
                                     
                                   
                                   = 
                                   0 
                                 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
           
         
       
     
         [0108]    ROI(x,y) represents interest priority of current coding macroblock, T(x,y,MV) represents time visual characteristic saliency of current coding macroblock, S(x,y,Mode) represents space visual characteristic saliency of current coding macroblock, (x, y) represents coordinates of current coding macroblock. 
         [0109]    The setting allocation scheme of video coding resource comprises: first optimizing macroblock coding of interest area so as to improve real-time performance of the video coding, while at the same time the quality and the compression efficiency of video coding is guaranteed; 
       Allocation Scheme is Shown in FIG.  1   
       [0110]      
         [0000]    
       
         
               
             
               
               
               
               
               
             
               
               
               
               
               
               
               
             
               
               
               
               
               
               
               
               
             
           
               
                   
               
               
                 FIG. 1 
               
             
          
           
               
                 Coding 
                 intra-frame prediction [1]   
                 Inter prediction [2]   
                 Searching 
                 Reference 
               
             
          
           
               
                 schema 
                 Intra16 × 16 
                 Intra4 × 4 
                 Inter16 
                 Inter8 
                 layer [3]   
                 frame 
               
               
                   
               
             
          
           
               
                 P 
                 ROI(x, y) = 3 
                 Intra16 × 16 
                 Intra4 × 4 
                 — 
                 Inter8 
                 Layer2-layer4 
                 5 
               
               
                 frame 
                 ROI(x, y) = 2 
                 — 
                 — 
                 Inter16 
                 — 
                 Layer1-layer3 
                 3 
               
               
                   
                 ROI(x, y) = 1 
                 — 
                 — 
                 — 
                 Inter8 
                 Layer1-layer2 
                 2 
               
               
                   
                 ROI(x, y) = 0 
                 — 
                 — 
                 Inter16 
                 — 
                 Layer1 
                 1 
               
               
                 I 
                 ROI(x, y) = 1 
                 — 
                 Intra4 × 4 
                 — 
                 — 
                 — 
                 — 
               
               
                 frame 
                 ROI(x, y) = 0 
                 Intra16 × 16 
                 — 
                 — 
                 — 
                 — 
                 — 
               
               
                   
               
             
          
         
       
     
         [0111]      FIG. 1  use fast intra-frame prediction algorithm and gray scaly histogram of macroblock to describe the flat level of macroblock and according to the flat level of macroblock adaptively selecting possible set of inter-frame prediction schema. 
         [0000]    The fundamental principle is: 
         [0112]    Macroblock gray histogram describes gray-level of current macroblock. In mathematics, gray histogram counts occurrence probability or frequency; in graphic, gray histogram is a two-dimensional graphics, x-axis represents gray-level of macroblock, gray level from all black to all white is [0, 255]. Y-axis represents occurrence frequency of pixel point in macroblock at every grey level. 
         [0113]    The shape of macroblock gray histogram can reflect the abundance of macroblock vein. At y-axis of gray histogram, there must have a maximum y value grey level(peak), the number of pixel point which belongs to this grey level is defined as max pixel number of current macroblock, marked as Max Value. If its&#39; occurrence frequency of grey level is higher than another grey level of histogram apparently, it indicates that this max value is the chief component of grey level. The space coherence of macroblock is high and the macroblock is flat, it is suitable for using the set of Intra16×16 prediction mode; otherwise, its&#39; occurrence frequency of grey level is equal to another grey level of gray histogram, it indicates that macroblock covers many grey levels, pixel grey level in macroblock changes violently, vein of macroblock is abundant, it is suitable for using the set of Intra4×4 prediction mode. 
         [0114]    The specific process is: 
         [0115]    Step 1, calculate gray histogram of brightness component Y of current macroblock record maximum pixels, Max Value; 
         [0116]    Step 2, set upper threshold Th high  and lower threshold Th low ,Th high  and Th low  are integer range from [1,256] 
         [0117]    Step 3, if Max Value≧Th high , consider macroblock flat, give up Intra4×4 prediction, chose Intra16×16 prediction, take minimum overhead rate-distortion mode as the best intra-frame prediction mode, update upper threshold at the same time: 
         [0000]    
       
         
           
             
               
                 Th 
                 
                   high 
                    
                   
                     - 
                   
                    
                   new 
                 
               
               = 
               
                 
                   
                     Th 
                     high 
                   
                   + 
                   MaxValue 
                 
                 2 
               
             
             , 
           
         
       
     
         [0000]    otherwise, pass to step 4 
         [0118]    Step 4, if Max Value≧Th low , consider macroblock is rich in details, abandon Intra16×16 prediction mode, chose Intra4×4 prediction mode, take minimum overhead rate-distortion mode as the best intra-frame prediction mode, update lower threshold at the same time 
         [0000]    
       
         
           
             
               Th 
               
                 low 
                  
                 
                   - 
                 
                  
                 new 
               
             
             = 
             
               
                 
                   Th 
                   low 
                 
                 + 
                 MaxValue 
               
               2 
             
           
         
       
     
         [0000]    otherwise, pass to step 5 
         [0119]    Step 5, if Th low &lt;Max Value&lt;Th high , consider the flatness of macroblock is not obvious, using standard frame prediction algorithm; 
         [0120]    Upper threshold Th high  and lower threshold Th low  is set as 150 and 50 respectively. 
         [0121]      FIG. 1  use fast inter prediction algorithm, the prediction of specific mode can be found through analyzing the statistical property of occurrence probability of inter frame prediction, so searching of inter frame prediction and calculation of rate-distortion can be ended in advance. 
         [0122]    The basic principle is: 
         [0123]    To improve precision of coding, H.264/AVC video coding standard use 7 kinds of changeable block prediction modes of inter frame coding, every coding block can be divided into Inter16×16, Inter16×8, Inter8×16 and Inter8×8 mode, Inter8×8 mode and it can be segmented into Inter8×8, Inter8×4, Inter4×8 and Inter4×4 mode. Moreover, H.264/AVC inter frame prediction support the Skip mode and Intra16×16 and intra4×4 intra frame mode. H.264/AVC covers all possible selection of prediction modes of every coding block to obtain the best rate-distortion performance, reach the best prediction effect. 
         [0124]    H.264/AVC is more efficient than other video coding standard because of flexible and diversified inter-frame prediction mode, but increasing of group mode which has been divided result from judgement process of inter-frame prediction mode is very complex, it increases the complexity of coding calculation fast. 
         [0125]    Recent studies show that: video image can be divided into background vein flat area, background vein fine area and motion area. Usually, background vein flat area have the majority percentage of video content, as for these kinds of flat area and motion smooth area, most of it use Skip mode)(mode  or macroblock level inter-frame prediction mode Inter16×16, Inter16×8, Inter8×16(mode 1˜mode 3) to do inter-frame prediction; If it needs more coding mode to do prediction due to complex motion situation, the segmentation of inter-frame prediction mode Inter8×8, Inter8×4, Inter4×8 and Inter4×4 (mode 4˜mode 7) can be used; Intra16×16 and Intra4×4 intra frame prediction (116 MB, 14 MB) will be used only at edge of video image with very low occurrence probability. 
         [0126]    Because of it, the prejudgment could be finished based on statistical property of inter-frame prediction, through diversity sieve to remove coding mode with small occurrence probability, improving coding speed. 
         [0000]    The specific process: 
         [0127]    Step 1. pre-judging of skip mode 
         [0128]    Step 1.1, calculate rate-distortion cost value J skip  of skip mode (mode 0), if it is lower than threshold value, stop searching for other modes, chose skip as the best prediction mode, then skip to step 4, otherwise, pass to step 1.2 
         [0129]    where: T=(0.7−Min_cost/118000)×Min_cost, Min_cost represents the best rate-distortion cost value of pervious code macroblock 
         [0130]    Step 1.2, calculate rate-distortion cost value of Inter16×16 mode (mode 1)) J 16×16 , If J 16×16 &gt;J skip , chose Skip as the best coding mode, then skip to step 4, otherwise pass to step 2 
         [0131]    Step 2, judgement of inter predictive mode of macroblock/sub-block 
         [0132]    Step 2.1, calculate rate-distortion cost value J 16×16  and J 8×8 , of Inter16×16 mode and Inter8×8 mode, if J 8×8 −J 16×16 &gt;T 0  chose Inter16×16 mode as the best inter code modal, skip to step 4, otherwise pass to step 2.2 
         [0133]    where T 0 =0.2×Min_cost, it is an adaptation experience value obtained from experiment data, the fast judgment prediction mode is guaranteed while it can reduce misjudgment ratio, Min_cost represents the best rate-distortion cost value of pervious code macroblock 
         [0134]    Step 2.2, calculate rate-distortion cost value J 4×4 of Inter4×4 mode, If J 4×4 &lt;Min(J 16×16 , J 8×8 ) take segmentation of intra frame mode Inter8×8, Inter8×4, Inter4×8 and Inter4×4 (mode 4˜mode 1) as intra frame alternative mode set, otherwise, take macroblock level intra-frame prediction mode Inter16×16, Inter16×8, Inter8×16 (mode 1˜mode 3) as intra frame alternative mode set, give up segmentation of intra frame mode 
         [0135]    Step 3, Inter-frame mode prediction 
         [0136]    Step 3.1, calculate ABE (Average Boundary Error) and SBE (Summation Boundary Error) of current code macroblock, ABE reflect macroblock time coherence, ABE=SBE/64 
         [0000]    
       
         
           
             SBE 
             = 
             
               
                 
                   ∑ 
                   
                     i 
                     = 
                     0 
                   
                   15 
                 
                  
                 
                    
                   
                     
                       
                         Y 
                         orig 
                       
                        
                       
                         ( 
                         
                           
                             x 
                             + 
                             i 
                           
                           , 
                           y 
                         
                         ) 
                       
                     
                     - 
                     
                       
                         Y 
                         rec 
                       
                        
                       
                         ( 
                         
                           
                             x 
                             + 
                             i 
                           
                           , 
                           
                             y 
                             - 
                             1 
                           
                         
                         ) 
                       
                     
                   
                    
                 
               
               + 
               
                 
                   ∑ 
                   
                     i 
                     = 
                     0 
                   
                   15 
                 
                  
                 
                    
                   
                     
                       
                         Y 
                         orig 
                       
                        
                       
                         ( 
                         
                           x 
                           , 
                           
                             y 
                             + 
                             i 
                           
                         
                         ) 
                       
                     
                     - 
                     
                       
                         Y 
                         rec 
                       
                        
                       
                         ( 
                         
                           
                             x 
                             - 
                             1 
                           
                           , 
                           
                             y 
                             + 
                             i 
                           
                         
                         ) 
                       
                     
                   
                    
                 
               
             
           
         
       
     
         [0137]    where Y orig  represents pixel value of current macroblock, Y rec  represents pixel value of rebuild macroblock, (x, y) represents position coordinates of current macroblock, Step 3.2, calculate AR (Average Rate) of current macroblock, AR reflects macroblock space coherence, 
         [0000]        AR =λRate/384
 
         [0138]    λ represents lagrange gene, Rate represents bit number which macroblock needed 
         [0139]    Step 3.3, compare ABE and AR of macroblock, if ABE&lt;C·AR(C=0.95), it indicates that space redundancy lower than time redundancy, give up traverse calculation of intra-frame prediction skip to step 4, otherwise, reserve traverse calculation of intra-frame prediction, skip to step 4 
         [0140]    Step 4, based on rate-distortion rule to calculate and chose the best inter predictive mode, complete inter prediction coding 
         [0000]    The basic principle is: 
         [0141]    H.264/AVC standard use UMHexagonS algorithm, it is one of the best motion estimate algorithm. But after analyzing large amount of experiment data, the best matching points is uneven distribute in every search step of UMHexagonS algorithm, But in step “Non-uniform 4 levels of hexagonal lattice grid search” of UMHexagonS algorithm, there have no analysis of relevance between motion characteristic of coding block and searching range. No matter how motion level of macroblock is, it must finish 4 layer Non-uniform hexagon search, (4layer×16 search points/layer=64 search points) so that it can do next step of searching, the calculation amount is huge. As for macroblock in motion flat area which have large percent of video content, large searching radius and searching points on outer layer has little contribution for improving the accuracy of motion estimation, but it waste long time to estimate motion. On the other hand, as for minorblock which is in violent motion, the coverage calculation cost for inner layer points caused consuming of time. It indicates that the intensity of motion have a inevitable relevance with motion estimation searching layer of the best matching point. 
         [0142]    If the selection of searching layer could be self-adapted based on macroblock motion level, number of searching points will be saved undoubtedly, reduce calculation complexity of motion estimation. Selection of characteristic and principles to judge motion level of macroblock is a key factor for optimizing motion estimation algorithm. 
         [0143]    Because of it, this invention use non-uniform hexagonal grid search with self-adapted searching layer and the change of macroblock motion level, instead of 4 layer non-uniform hexagonal grid search in pervious UMHexagonS algorithm First, describe motion characteristics of macroblock, and divide it into 3 level: low motion level, medium motion level, high motion level; At last, select corresponding searching layer based on motion level. 
         [0144]    The specific process is: 
         [0145]    Step 1, description of macroblock motion characteristics 
         [0146]    Step 1.1, based on rate-distortion rule, calculate motion estimation rate-cost value RD cost motion  of current macroblock 
         [0000]        J   motion ( mv ,ref|λ motion )= SAD[s,r (ref, mv )]+λ motion [ R ( mv −pred)+ R (ref)]
 
         [0000]    where s represents current pixel value of current macroblock, mv represents macroblock motion vector, peed represents prediction vector, ref represents selected reference frame, r(ref,mv) represents pixel value of current reference macroblock, R represents consuming bit number when motion vector is doing differential encoding, including coding bit number (difference between motion vector and its&#39; prediction value)and reference coding bit number, λ motion  represents lagrange multipliers SAD represents sum of absolute differences between current block and reference block which is defined as: 
         [0000]    
       
         
           
             
               SAD 
                
               
                 ( 
                 
                   s 
                   , 
                   
                     c 
                      
                     
                       ( 
                       m 
                       ) 
                     
                   
                 
                 ) 
               
             
             = 
             
               
                 ∑ 
                 
                   
                     x 
                     = 
                     1 
                   
                   , 
                   
                     y 
                     = 
                     1 
                   
                 
                 
                   M 
                   , 
                   N 
                 
               
                
               
                  
                 
                   
                     s 
                      
                     
                       [ 
                       
                         x 
                         , 
                         y 
                       
                       ] 
                     
                   
                   - 
                   
                     c 
                      
                     
                       [ 
                       
                         
                           x 
                           - 
                           
                             m 
                             x 
                           
                         
                         , 
                         
                           y 
                           - 
                           
                             m 
                             y 
                           
                         
                       
                       ] 
                     
                   
                 
                  
               
             
           
         
       
     
         [0147]    M, N represents width and height of current macroblock, x,y represents macroblock position, s represents real value, c represents predictive value, m=(m x ,m y ) T  represents macroblock motion vector, m x  and m y  represents macroblock motion vector in horizontal and vertical directions 
         [0148]    Step 1.2, based on rate-distortion rule, calculate rate-cost value RD cost mode  in mode schema, 
         [0000]        J   mode ( s,c, mode|λ mode )= SSD ( s,c, mode| QP )+λ mode   ×R ( s,c, mode| QP )
 
         [0149]    where Mode represents inter-frame coding schema of current macroblock, S represent origin video signals, c represents rebuild video signals after mode coding, λ mode  represents lagrange multipliers, R(s,c,mode|QP) represents sum of binary number including macroblock head information, motion vector and all DCT block information related to schema and quantization parameter, QP represents coding quantization step, SSD(s,c,mode) represents sum of difference of two squares between origin signals and rebuild signals 
         [0000]    
       
         
           
             
               SSD 
                
               
                 ( 
                 
                   s 
                   , 
                   c 
                   , 
                   
                     
                       mod 
                        
                       
                           
                       
                        
                       e 
                     
                      
                     QP 
                   
                 
                 ) 
               
             
             = 
             
               
                 
                   ∑ 
                   
                     
                       i 
                       = 
                       1 
                     
                     , 
                     
                       j 
                       = 
                       1 
                     
                   
                   
                     B 
                     , 
                     
                       B 
                       2 
                     
                   
                 
                  
                 
                   
                     ( 
                     
                       
                         
                           s 
                           Y 
                         
                          
                         
                           [ 
                           
                             x 
                             , 
                             y 
                           
                           ] 
                         
                       
                       - 
                       
                         
                           c 
                           Y 
                         
                          
                         
                           [ 
                           
                             x 
                             , 
                             y 
                             , 
                             
                               
                                 mod 
                                  
                                 
                                     
                                 
                                  
                                 e 
                               
                                
                               QP 
                             
                           
                           ] 
                         
                       
                     
                     ) 
                   
                   2 
                 
               
               + 
               
                 
                   ∑ 
                   
                     
                       i 
                       = 
                       1 
                     
                     , 
                     
                       j 
                       = 
                       1 
                     
                   
                   
                     B 
                     , 
                     
                       B 
                       2 
                     
                   
                 
                  
                 
                   
                     ( 
                     
                       
                         
                           s 
                           U 
                         
                          
                         
                           [ 
                           
                             x 
                             , 
                             y 
                           
                           ] 
                         
                       
                       - 
                       
                         
                           c 
                           U 
                         
                          
                         
                           [ 
                           
                             x 
                             , 
                             y 
                             , 
                             
                               
                                 mod 
                                  
                                 
                                     
                                 
                                  
                                 e 
                               
                                
                               QP 
                             
                           
                           ] 
                         
                       
                     
                     ) 
                   
                   2 
                 
               
               + 
               
                 
                   ∑ 
                   
                     
                       i 
                       = 
                       1 
                     
                     , 
                     
                       j 
                       = 
                       1 
                     
                   
                   
                     B 
                     , 
                     
                       B 
                       2 
                     
                   
                 
                  
                 
                   
                     ( 
                     
                       
                         
                           s 
                           V 
                         
                          
                         
                           [ 
                           
                             x 
                             , 
                             y 
                           
                           ] 
                         
                       
                       - 
                       
                         
                           c 
                           V 
                         
                          
                         
                           [ 
                           
                             x 
                             , 
                             y 
                             , 
                             
                               
                                 mod 
                                  
                                 
                                     
                                 
                                  
                                 e 
                               
                                
                               QP 
                             
                           
                           ] 
                         
                       
                     
                     ) 
                   
                   2 
                 
               
             
           
         
       
     
         [0150]    where B 1  and B 2  represents pixel number in horizontal and vertical direction of coding block, it can be 16, 8, 4; s Y [x,y], c Y [x,y,mode|QP] represents value of brightness signals between origin video and rebuild video, c U ,c V , and s U ,s V  represents corresponding value of color difference signals 
         [0151]    Step 1.3, select minimum rate distortion value RD_min cost from RD cost motion  and RD cost mode ; 
         [0152]    Step 2, judgement of severe degree of macroblock motion 
         [0153]    Calculation formula can be expressed as: 
         [0000]    
       
         
           
               
             
               { 
               
                 
                   
                     
                       
                         RD_min 
                          
                         
                             
                         
                          
                         cos 
                          
                         
                             
                         
                          
                         t 
                       
                       &lt; 
                       
                         
                           ( 
                           
                             1 
                             + 
                             γ 
                           
                           ) 
                         
                         × 
                         pred_min 
                          
                         
                             
                         
                          
                         cos 
                          
                         
                             
                         
                          
                         t 
                       
                     
                   
                   
                     
                       low 
                        
                       
                           
                       
                        
                       motion 
                        
                       
                           
                       
                        
                       degree 
                     
                   
                 
                 
                   
                     
                       
                         
                           ( 
                           
                             1 
                             + 
                             γ 
                           
                           ) 
                         
                         × 
                         pred_min 
                          
                         
                             
                         
                          
                         cos 
                          
                         
                             
                         
                          
                         t 
                       
                       &lt; 
                       
                         RD_min 
                          
                         
                             
                         
                          
                         cos 
                          
                         
                             
                         
                          
                         t 
                       
                       &lt; 
                     
                   
                   
                     
                       medium 
                        
                       
                           
                       
                        
                       motion 
                        
                       
                           
                       
                        
                       degree 
                     
                   
                 
                 
                   
                     
                       
                         ( 
                         
                           1 
                           + 
                           δ 
                         
                         ) 
                       
                       × 
                       pred_min 
                        
                       
                           
                       
                        
                       cos 
                        
                       
                           
                       
                        
                       t 
                     
                   
                   
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         RD_min 
                          
                         
                             
                         
                          
                         cos 
                          
                         
                             
                         
                          
                         t 
                       
                       &gt; 
                       
                         
                           ( 
                           
                             1 
                             + 
                             δ 
                           
                           ) 
                         
                         × 
                         pred_min 
                          
                         
                             
                         
                          
                         cos 
                          
                         
                             
                         
                          
                         t 
                       
                     
                   
                   
                     
                       high 
                        
                       
                           
                       
                        
                       motion 
                        
                       
                           
                       
                        
                       degree 
                     
                   
                 
               
             
           
         
       
     
         [0154]    where γ, δ represents tuning factor of macroblock motion degree, defined as: 
         [0000]    
       
         
           
             
               γ 
               = 
               
                 
                   
                     B 
                      
                     
                         
                     
                      
                     
                       size 
                        
                       
                         [ 
                         blocktype 
                         ] 
                       
                     
                   
                   
                     pred_min 
                      
                     
                         
                     
                      
                     cos 
                      
                     
                         
                     
                      
                     
                       t 
                       2 
                     
                   
                 
                 - 
                 
                   
                     α 
                     1 
                   
                    
                   
                     [ 
                     blocktype 
                     ] 
                   
                 
               
             
             , 
             
               
 
             
              
             
               δ 
               = 
               
                 
                   
                     B 
                      
                     
                         
                     
                      
                     
                       size 
                        
                       
                         [ 
                         blocktype 
                         ] 
                       
                     
                   
                   
                     pred_min 
                      
                     
                         
                     
                      
                     cos 
                      
                     
                         
                     
                      
                     
                       t 
                       2 
                     
                   
                 
                 - 
                 
                   
                     α 
                     2 
                   
                    
                   
                     [ 
                     blocktype 
                     ] 
                   
                 
               
             
           
         
       
     
         [0155]    where B size[blocktype] represents size of current macroblock, there are 7 kinds of value: 16×16, 16×8, 8×16, 8×8, 8×4, 4×8, 4×4; pred_min cost are determined by motion vector prediction schema which is chosen by origin search point of UMHexagonS algorithm, 
         [0156]    (1). If origin search point use time prediction motion vector, pred _min cost chose reference frame motion vector, reference frame MV predictor; 
         [0157]    (2). If origin search point did not use time prediction motion vector, divided into two categories: 
         [0158]    (2.1) If size of current motion estimation macroblock inter predictive mode is large like 16×16, 16×8, 8×16, so pred_min cost is selected, chose median as predictive motion vector, median MV predictor; 
         [0159]    (2.2) If size of current motion estimation macroblock inter predictive mode is small like 8×8, 8×4, 4×8, 4×4, so select upper layer predictive motion vector as the value of pred _min cost, 
         [0160]    Based on large amount experiments data, define array α 1 [blocktype] and array α 2 [blocktype] respectively: 
         [0000]      α 1 [blocktype]=[−0.23, −0.23, −0.23, −0.25, −0.27, −0.27, −0.28]
 
         [0000]      α 2 [blocktype]=[−2.39, −2.40, −2.40, −2.41, −2.45, −2.45, −2.48]
 
         [0161]    Step 3. determine macroblock motion and estimate search hierarchical 
         [0162]    Step 3.1 when macroblock motion degree is low, doing hexagonal lattice grid search from layer1 to layer3 in step “non-uniform 4 layers of hexagonal lattice grid search” of UMHexagonS algorithm 
         [0163]    Step 3.2 when macroblock motion degree is medium, doing hexagonal lattice grid search from layer1 to layer3 in step “non-uniform 4 layers of hexagonal lattice grid search” of UMHexagonS algorithm 
         [0164]    Step 3.3: when macroblock motion degree is high, doing 4 layers hexagonal lattice grid search in step “non-uniform 4 layers of hexagonal lattice grid search” of UMHexagonS algorithm 
         [0000]    In P frame coding, according to formula (5): 
         [0165]    When ROI(x, y)=3, in condition {circle around (1)}, coding macroblock belongs to foreground dynamic area(T(x, y, MV)=2) or foreground translation area(T(x, y,)=1), have visual characteristics in time, and S(x,y,Mode)=1 indicates that macroblock chose Inter8 set of inter frame sub-block prediction mode, have visual characteristics in space also, belongs to evident visual characteristics area and vein richness area. When S(x,y,Mode)=2 in condition {circle around (2)} it indicates that P frame use intra frame prediction mode of coding macroblock, belongs to visual characteristics sensitive area in space. Human eyes have the highest interest in these 2 conditions, traverse execution of Inter8 set fast inter frame prediction and fast intra frame prediction, run layer2-layer4 of motion estimation searching, the number of frames which allowed as reference are 5. 
         [0166]    When ROI(x, y)=2, coding macroblock have visual characteristics in time T(x,y,MV)=2 or T(x,y,)=1), and S(x,y,Mode)=0, indicates that macroblock chose Inter16 set of inter frame sub-block prediction mode, visual characteristics in space is not evident, belongs to evident visual characteristics area in time and vein flat area, human eyes interest is lower than above, intra frame prediction is elided, only traverse execution of Inter16 set fast inter frame prediction, run layer1-layer3 of motion estimation searching, the number of frames which allowed as reference are 3. 
         [0167]    When ROI(x,y)=1, there have no visual characteristics of macroblock in time (T(x,y,MV)=0), belongs to non-dynamic background area, and S(x,y,Mode)=1 indicates that macroblock chose Inter8 set of inter frame sub-block prediction mode, have visual characteristics in space, belongs to visual attention area, human eyes interest is lower than the second one above, intra frame prediction is elided, only traverse execution of Inter8 set fast inter frame prediction, run layer1-layer2 of motion estimation searching, the number of frames which allowed as reference is only 1. 
         [0168]    When ROI(x,y)=0, indicates that there are no visual characteristics in time and space of current macroblock, belongs to static flat background area with low interest of human eyes, only traverse execution of Inter16 set fast inter frame prediction, run layer1 of motion estimation searching, the number of frames which allowed as reference is 1. 
         [0169]    In I frame coding, according to formula (5): 
         [0170]    When ROI(x,y)=1, there have no visual characteristic in time of current macroblock (T(x,y,MV)=0), and S(x,y,Mode)=1, indicates that macroblock chose Intra4×4 prediction mode, have abundant space details, also have higher visual characteristics salience in space, belongs to the area of interest, Intra16×16 prediction is elided. 
         [0171]    When ROI(x,y)=0, there are no visual characteristics in time and space of current macroblock, belongs to static flat background area with low interest of human eyes, only run Intra16×16 prediction mode. 
         [0172]    In conclusion, first, analysis and detection of high efficient visual perception characteristics is realized based on low-level coding information in the invention, and then according to the label results of video interest area priority to conduct the selection of coding schema, alternative mode set of predictive code and range of motion estimation searching can be simplified, reduce number of reference frame, lower calculation complexity of video coding. 
         [0173]    The invention also published simulation and statistic results:  FIG. 2 : Performance of this invention compare with H.264/AVC(JM17.0) standard algorithm. 
         [0000]    
       
         
               
             
               
               
               
               
               
               
             
               
             
               
               
               
               
               
               
             
           
               
                   
               
               
                 FIG. 2 
               
             
          
           
               
                 video 
                   
                 ΔTime  
                 ΔBit  
                 PSNR-Y Δ 
                 ROI-PSNR-Y Δ 
               
               
                 sequence 
                 QP 
                 (%) 
                 (%) 
                 (dB) 
                 (dB) 
               
               
                   
               
               
                 Foreman 
                 28 
                 −71.24 
                 +2.19 
                 −0.30 
                 −0.25 
               
               
                   
                 32 
                 −71.92 
                 +2.15 
                 −0.29 
                 −0.21 
               
               
                   
                 36 
                 −70.81 
                 +2.06 
                 −0.17 
                 −0.15 
               
               
                 Hall 
                 28 
                 −83.64 
                 +1.24 
                 −0.21 
                 −0.19 
               
               
                   
                 32 
                 −84.27 
                 +1.17 
                 −0.22 
                 −0.14 
               
               
                   
                 36 
                 −84.98 
                 +1.12 
                 −0.19 
                 −0.13 
               
               
                 Salesman 
                 28 
                 −76.43 
                 +2.12 
                 −0.26 
                 −0.21 
               
               
                   
                 32 
                 −75.92 
                 +1.87 
                 −0.20 
                 −0.15 
               
               
                   
                 36 
                 −76.01 
                 +1.83 
                 −0.14 
                 −0.12 
               
               
                 Car-phone 
                 28 
                 −73.85 
                 +2.84 
                 −0.32 
                 −0.24 
               
               
                   
                 32 
                 −73.36 
                 +2.57 
                 −0.21 
                 −0.19 
               
               
                   
                 36 
                 −74.96 
                 +1.69 
                 −0.14 
                 −0.12 
               
               
                 News 
                 28 
                 −85.47 
                 +2.14 
                 −0.13 
                 −0.11 
               
               
                   
                 32 
                 −85.84 
                 +2.13 
                 −0.12 
                 −0.07 
               
               
                   
                 36 
                 −85.93 
                 +1.86 
                 −0.09 
                 −0.08 
               
               
                 Coastguard 
                 28 
                 −61.24 
                 +2.47 
                 −0.28 
                 −0.24 
               
               
                   
                 32 
                 −62.35 
                 +2.13 
                 −0.29 
                 −0.26 
               
               
                   
                 36 
                 −62.62 
                 +1.76 
                 −0.21 
                 −0.18 
               
               
                 Paris 
                 28 
                 −84.12 
                 +1.07 
                 −0.29 
                 −0.23 
               
               
                   
                 32 
                 −84.61 
                 +1.15 
                 −0.22 
                 −0.21 
               
               
                   
                 36 
                 −84.97 
                 +1.03 
                 −0.21 
                 −0.17 
               
               
                 Silent 
                 28 
                 −80.14 
                 +1.51 
                 −0.24 
                 −0.18 
               
               
                   
                 32 
                 −80.86 
                 +1.42 
                 −0.18 
                 −0.15 
               
               
                   
                 36 
                 −81.32 
                 +1.17 
                 −0.11 
                 −0.09 
               
               
                 Mother &amp;  
                 28 
                 −83.76 
                 +1.85 
                 −0.18 
                 −0.14 
               
               
                 Daughter 
                 32 
                 −83.89 
                 +1.64 
                 −0.10 
                 −0.10 
               
               
                   
                 36 
                 −84.21 
                 +0.09 
                 −0.08 
                 −0.05 
               
               
                 Akiyo 
                 28 
                 −85.64 
                 +1.87 
                 −0.11 
                 −0.09 
               
               
                   
                 32 
                 −85.76 
                 +1.21 
                 −0.08 
                 −0.07 
               
               
                   
                 36 
                 −86.41 
                 +0.08 
                 −0.07 
                 −0.06 
               
             
          
           
               
                 The average results 
               
             
          
           
               
                 QP 
                 28 
                 −78.55 
                 +1.93 
                 −0.188 dB 
                 −0.153 dB 
               
               
                   
                 32 
                 −78.88 
                 +1.74 
                   
                   
               
               
                   
                 36 
                 −79.22 
                 +1.27 
               
               
                   
               
             
          
         
       
     
         [0174]      FIG. 2  show 10 standards test sequences which have different motion characteristics based on invention schema and performance comparison with H.264/AVC(JM17.0) standard algorithm. 
         [0175]    When quantization step QP are 28, 32, 36 respectively, compare with H.264/AVC(JM17.0) standard algorithm, the invention can save coding time with 80% in average; control the increasing of bit rate output within 2% in average; PSNR-Y reduced −0.188 dB in average, PSNR-Y in visual interest area reduced −0.153 dB in average, the priority of video coding quality in visual characteristics perception area is guaranteed, accord with the insensitivity of quality degradation of human eyes in visual characteristics perception area. 
         [0176]    As for controlling of bit rate output, the 2 rate-distortion R-D performance curve is very close to each other, indicates that the invention have advantages of low bit rate and high quality similar with H.264/AVC standard algorithm 
         [0177]    As for reconstruction quality of video image, the average decline of PSNR-Y is guaranteed within −0.2 dB, which is much less than min sensitive value of image change perception (−0.5 dB) of human eyes, so that reconstruction of video quality is well maintained. 
         [0178]    As for improvement of coding speed, the data in  FIG. 2  indicates that compare with H.264/AVC standard algorithm and other current algorithm, the invention have lower calculation complexity. As for Akiyo, Newssequences with gently motion and flat vein, compare with H.264/AVC(JM17.0), the invention can save coding time more than 85% in average. 
         [0179]    The invention proposed a visual perception characteristics-combining hierarchical video coding method, which can improve coding speed greatly at the same time maintain well subjective quality of video image. Experiment result shows that the possibility of using coding information entirely to analyze visual perception with low complexity, the consistence between analyzing results of visual characteristic salience perception and HVS, proving reasonability of scalable coding schema based on visual perception characteristics.