Abstract:
Image sequences are advantageously recoded based on an evaluation of complexities before and after trans-coding of the images. Initially, information is extracted representing at least the complexity of recoding each image. A complexity ratio is calculated in accordance with the complexities of images recoded previously using the aforementioned mode to the complexities of the initial coding of said images. After smoothing the complexity ratio undergoes updating. Each image is recoded according to the mode by estimating the complexity of each image to be recoded as the product of the complexity of the initial coding of the image by the smoothed complexity ratio for the mode.

Description:
This application claims the benefit, under 35 U.S.C. §365 of International Application PCT/FR03/00409, filed Feb. 10, 2003, which was published in accordance with PCT Article 21(2) on Aug. 21, 2003 in French and which claims the benefit of French patent application No. 02/01744, filed Feb. 11, 2002. 
     BACKGROUND OF THE INVENTION 
     The development of multimedia applications and the multiplicity of data networks are making data coding systems ever more complex. The interconnection of heterogeneous networks often necessitates the re-encoding, commonly referred to as transcoding, of the data streams that they convey. This re-encoding may be performed in a different compression standard from the initial compression standard (for example, re-encoding according to the MPEG-4 AVC standard (the acronym standing for “Advanced Video Coding”) for streams initially coded according to the MPEG-2 or MPEG-4 standard). 
     Re-encoding is also used chiefly in networks having considerable bit rate constraints. Such re-encoding systems then make it possible to tailor the bit rate of an incoming stream to the requirements and to the limitations of the network. 
     The regulating of bit rates used in MPEG type video coders or transcoders is undertaken by way of a regulating loop acting on the quantization step size of the DCT coefficients (DCT being the acronym for “Discrete Cosine Transform”) of the blocks of the image. The quality and the stability of this regulation depend largely on the quality of prediction of the complexities of the images to be coded for the next group of images. 
     In a context of source images, numerous double pass coding techniques have been developed, the first coding pass providing precise knowledge of the complexities of the images to be coded, the second pass then coding the images as a function of this complexity. 
     Such double pass coding techniques are very powerful but expensive in respect of transcoding systems. 
     BRIEF SUMMARY OF THE INVENTION 
     The invention therefore proposes a device for re-encoding image sequences based on evaluating the complexities before and after transcoding of the images to be re-encoded. 
     Accordingly, the invention proposes a device for re-encoding images according to a given preset bit rate of a video stream comprising image sequences initially coded according to at least one mode, comprising:
         means for extracting information associated with the re-encoding of the images, said information representing at least the complexity (Xrecod) of re-encoding of each image,   means for extracting information, in particular coding complexity information (X init ), associated with the initial coding of the images,       

     According to the invention, the device comprises:
         means for calculating a ratio (Ratio X ), the so-called complexity ratio, of the complexities (X recod ) of re-encoding of the images previously re-encoded according to said mode to the complexities (X init ) of initial coding of these images,   means for updating an averaged complexity ratio (SmoothedRatio X [mode]) for said mode as a function of the complexity ratio (Ratio X ) and   means for re-encoding each image according to said mode by estimating the complexity (X pred ) of each image to be re-encoded as being the product of the complexity (X init ) of initial coding of said image times the averaged complexity ratio for said mode (SmoothedRatio X [mode]).       

     The inventors have realized that, contrary to an idea well known in the coding context, the complexity of an image is not constant in the image transcoding context:
         in the case of transcoding within one and the same compression standard, the complexity depends on the quantization step size applied to the image and therefore on the coding bit rate of the image sequence.   in the case of transcoding with change of compression standard, the complexity depends on each compression algorithm&#39;s own characteristics, as well as on the previous parameters.       

     On the other hand, in both cases of transcoding, the ratio of the complexities of initial and re-encoded images is relatively stable. 
     The extraction of measurements before re-encoding may make it possible to minimize the intelligence required to obtain a sufficient coding quality and the extraction of measurements after re-encoding may make it possible to obtain good operation of the bit rate regulating loop while ensuring good quality of prediction of the complexities of the re-encoded images. 
     The information arising from coding and from re-encoding make it possible to ascertain the complexities of the images and therefore to define the new re-encoding parameters for the future images to be coded. 
     In this way, the invention may allow a reduction in cost, possibly appreciable, relative to devices using double pass coders. 
     According to a preferred embodiment, the device comprises means for storing, for several consecutive images defining a reference period, information associated with the initial coding, said information being
         the complexity of initial coding (GlobalX init ) of the images of the reference period,   the incompressible cost (GlobalOverhead init ) of initial coding of the images of the reference period.       

     For each current image to be coded, according to this preferred embodiment, the device stores the complexities of a certain number of incoming images to be re-encoded and belonging to a determined reference period and uses the complexity of re-encoding of a certain number of previously re-encoded images to determine the quantization step size to be applied to the current image to be re-encoded. 
     According to a preferred embodiment, the means for re-encoding each image are dependent on the information associated with the initial coding of the images belonging to the reference period. 
     Thus, it is possible to obtain temporal stability by basing the re-encoding on the coding and re-encoding information arising from several of the previously re-encoded images. 
     The invention also relates to a process for re-encoding images according to a given preset bit rate of a video stream comprising image sequences initially coded according to at least one mode, comprising the steps of:
         extracting information associated with the re-encoding of certain images, said information representing at least the complexity (Xrecod) of re-encoding of each image,   extracting information, in particular coding complexity information (X init ), associated with the initial coding of certain images,       

     According to the invention, the process it comprises the steps of:
         calculating a ratio (Ratio X ), the so-called complexity ratio, of the complexities (X recod ) of re-encoding of the images previously re-encoded according to said mode to the complexities (X init ) of initial coding of these images,   updating an averaged complexity ratio (SmoothedRatio X  [mode]) for said mode as a function of the complexity ratio (Ratio X ) and   re-encoding each image according to said mode by estimating the complexity (X pred ) of each image to be re-encoded as being the product of the complexity (X init ) of initial coding of said image times the averaged complexity ratio for said mode (SmoothedRatio X  [mode]).       

    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       The invention will be better understood and other features and advantages will become apparent on reading the description of the exemplary embodiments which follow, taken by way of non-limiting examples, with reference to the appended drawings, among which: 
         FIG. 1  represents an embodiment of a system including a device according to the invention, 
         FIG. 2  represents an embodiment of a device according to an embodiment of the invention. 
     
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     A system representing a device  1  for coding video image sequences as well as a device  2  for re-encoding the same sequences is represented in  FIG. 1 . 
     The coding device  1  is a coder of one-pass type. 
     The coding device  1  transmits a data stream, more particularly an audio/video stream, to the re-encoding device  2 . The two devices, coding  1  and re-encoding  2 , are in the given exemplary embodiment, interconnected by way of a communication network and therefore far apart, but may be interconnected locally in other embodiments. 
     The re-encoding device  2  also receives the complexity, X init , and the incompressible cost, Overhead init , associated with each image of the incoming video stream and representative respectively of the complexity and of the incompressible cost of the initial coding performed by the coding device  1  on the video stream. 
     The re-encoding device  2  also uses the re-encoding information arising from the re-encoded outgoing streams. This re-encoding information is the complexity of re-encoding, X recod , and the incompressible cost of re-encoding, Overhead init . 
       FIG. 2  represents an exemplary block diagram, of a re-encoding device according to the invention. 
     The device comprises a decoder  3  connected to a re-encoding loop  4  and to an a priori measurement facility  9 . The decoder  3  as well as the a priori measurement facility  9  receive as input a binary stream emitted by a coding device  1  as represented in  FIG. 1 . The binary stream is composed of sequences representative of coded images. The images may be coded according to various modes and for example according to the MPEG-2, MPEG-4 ASP standards (the acronym standing for “Advanced Simple Profile”) or the MPEG-4 AVC standard (the acronym standing for “Advanced Video Coding”). In a preferred embodiment detailed hereinbelow, the images may be coded according to three modes, intra, bidirectional or predictive according to the MPEG-2 standard. 
     The decoder  3  outputs a video stream which enters the re-encoding loop  4 . 
     The re-encoding loop produces a binary stream re-encoded on the basis of the video stream produced by the decoder  3  and of the quantization value Q recod  provided by a requantization facility  6 . 
     The re-encoding loop  4  is linked to an a posteriori measurement facility  5 . This facility is charged with measuring the complexity X recod , and the incompressible cost, Overhead recod , of the stream output by the re-encoding loop  4 . 
     The a priori measurement facility  9  receives images organized in sequence or otherwise. 
     The a priori measurement facility  9  extracts the compressible cost, Enccost init , of each image. 
     The a priori measurement facility  9  extracts the complexity, X init , of each image. The complexity is expressed as the product of the compressible cost, Enccost init  times the quantization step, Q init . 
     In the embodiment given as an example, the complexity is transmitted in the video stream and a complexity is associated with each image. 
     In a variant of the embodiment, the complexity of each image is not transmitted with the stream and the a priori measurement facility  9  calculates it as a function of the binary stream. 
     The a priori measurement facility  9  also extracts the incompressible cost, referred to also as the syntax cost, Overhead init , of each image. 
     In the embodiment given as an example, the incompressible cost is transmitted in the video stream and an incompressible cost, Overhead init  is associated with each image. 
     In a variant embodiment, the incompressible cost of initial coding of each image is not transmitted with the stream and the a priori measurement facility calculates it as a function of the binary stream. 
     Hence, extraction of the complexity or of the incompressible cost of initial coding is therefore understood to mean the retrieval from the binary stream or the calculation on the basis of the binary stream, of the complexity. 
     When the module  9  receives a certain number of images forming a reference period, so as to obtain better stability over time, it calculates for each reference period, its complexity, GlobalX init , and its incompressible cost, GlobalOverhead init . Once all the images have been received, the re-encoding of each image of the sequence begins. 
     The coding cost consists on the one hand of the compressible cost and on the other hand of the incompressible cost engendered by the syntax and the cost of the vectors. 
     In the case of MPEG-2 or MPEG-4 ASP coding, the compressible cost is due chiefly to the coefficients of the discrete cosine transformation DCT. In the case of MPEG-4 AVC coding, le compressible cost is due to the whole transformation approximating a DCT transformation. 
     The a priori measurement facility  9  provides the measurements of initial complexity, X init , and of initial incompressible costs, Overhead init , of each incoming encoded image to a prediction facility  8 . 
     The a posteriori measurement facility  5  retrieves from the re-encoded output stream, for each image,
         the incompressible cost Overhead recod ,   the quantization step size Q recod .       

     It calculates the complexity of re-encoding of each image (X recod ) which is the product of the compressible cost times the quantization step size. 
     In a preferred embodiment, the coding used is of type DCT, the acronym standing for “discrete cosine transform”. In this preferred mode, the compressible cost corresponds to the coefficients of the discrete cosine transformation (DCT) coded according to a variable length code (VLC). 
     The module  5  outputs the incompressible cost Overhead recod  and the quantization step size Q recod  to the modules  7  and  8 . 
     The prediction facility  8  calculates for each image, the ratio (Ratio overhead ) of the initial incompressible cost of the coded image to the incompressible cost of the re-encoded image and the ratio (Ratio X ) of the initial complexity of the coded image to the complexity of the re-encoded image. 
     The ratios thus calculated are stored. 
     
       
         
           
             
               Ratio 
               overhead 
             
             = 
             
               
                 Overhead 
                 recod 
               
               
                 Overhead 
                 init 
               
             
           
         
       
       
         
           
             
               Ratio 
               X 
             
             = 
             
               
                 X 
                 recod 
               
               
                 X 
                 init 
               
             
           
         
       
     
     The module  8  updates, on the basis of the latest ratios thus stored, an averaged complexity ratio, SmoothedRatio X , and an averaged incompressible cost ratio, SmoothedRatio overhead . The ratios Ratio X  and Ratio overhead  used are evaluated over a period different from the reference period. Specifically, the re-encoding values Overhead recod  and X recod  are not known upon receipt of the video sequence to be re-encoded since these are the re-encoding values that the re-encoding device is just about to calculate. Thus the ratios used for the calculation of the averaged ratios of incompressible cost and of complexity are based on the values calculated previously and updated in tandem with the re-encoding. 
     These two factors are calculated for each coding mode. Thus, each image to be re-encoded according to a mode is estimated as a function of the images re-encoded previously according to the same coding mode. 
     The prediction facility  8  calculates an estimate of the cost of the image to be re-encoded, by calculating an estimate of the complexity of re-encoding, X pred , and an estimate of the incompressible cost of re-encoding, Overhead pred , for the current image and for the reference period in which it lies.
 
Overhead pred =SmoothedRatio overhead [mode]×Overhead init  
 
X pred =SmoothedRatio X [mode]×X init  
 
     The module  8  also calculates the incompressible cost (GlobalOverhead pred ) and the complexity of re-encoding (GlobalX pred ) of the reference period in which the current image lies. 
     
       
         
           
             
               GlobalOverhead 
               pred 
             
             = 
             
               
                 ∑ 
                 mode 
               
               ⁢ 
               
                 
                   
                     SmoothedRatio 
                     overhead 
                   
                   ⁡ 
                   
                     [ 
                     mode 
                     ] 
                   
                 
                 × 
                 
                   
 
                 
                 ⁢ 
                 
                     
                 
                 ⁢ 
                 
                   
                     GlobalOverhead 
                     init 
                   
                   ⁡ 
                   
                     [ 
                     mode 
                     ] 
                   
                 
               
             
           
         
       
       
         
           
             
               GlobalX 
               pred 
             
             = 
             
               
                 ∑ 
                 mode 
               
               ⁢ 
               
                 
                   
                     SmoothedRatio 
                     X 
                   
                   ⁡ 
                   
                     [ 
                     mode 
                     ] 
                   
                 
                 × 
                 
                   
                     GlobalX 
                     init 
                   
                   ⁡ 
                   
                     [ 
                     mode 
                     ] 
                   
                 
               
             
           
         
       
     
     This facility can thus, on the basis of these measurements, provide an estimate of the relative weight of the image to be re-encoded in the image reference period. 
     The image level regulating facility  7  calculates the image preset compressible cost (Targetcost) as a function of the bit rate preset provided by an external supervising module (not represented), enabling a user to control the re-encoding, and of the predictions of image and global complexity. 
     
       
         
           
             Targetcost 
             = 
             
               
                 
                   X 
                   pred 
                 
                 
                   GlobalX 
                   pred 
                 
               
               × 
               GlobalTargetcost 
               ⁢ 
               
                   
               
               ⁢ 
               and 
             
           
         
       
       
         
           
             GlobalTargetcost 
             = 
             
               
                 [ 
                 
                   
                     
                       D 
                       recod 
                     
                     frame_rate 
                   
                   × 
                   Nbimages 
                 
                 ] 
               
               - 
               
                 
 
               
               ⁢ 
               
                   
               
               ⁢ 
               
                 GlobalOverhead 
                 pred 
               
             
           
         
       
     
     Where:
         D recod  is the re-encoding preset bit rate, expressed in bit/s.   Nbimages is the number of images in the reference period.   frame_rate is the number of images per second.       

     In the case of a transcoding in a different compression standard, the image preset bit rate (TargetCost) calculated previously enables the quantization facility  6  to calculate the average quantization step size Q recod  to be applied to the image to be re-encoded on the basis of the following formula:
 
 X   pred =TargetCost× Q   recod  
 
     In the case of a transcoding in one and the same compression standard, the image preset bit rate makes it possible to deduce a compression gain, applicable for the calculation of the re-encoding quantization step size Q recod  to be applied to each of the macroblocks of the image to be re-encoded. The image level regulating facility  7  deduces therefrom the compression gain (GainC) to be achieved on the image according to the following formula: 
     
       
         
           
             GainC 
             = 
             
               
                 
                   
                     Enccost 
                     int 
                   
                   ⁢ 
                   t 
                 
                 - 
                 Targetcost 
               
               
                 Enccost 
                 init 
               
             
           
         
       
     
     The image level regulating facility  7  transmits the gain, GainC, to the requantization facility  6 . 
     On the basis of the gain, GainC, the requantization facility  6  calculates the quantization step size Q recod  to be applied to the image to be re-encoded (globally or for each of the macroblocks) on the basis of the following formulae:
 
 X   pred =Targetcost× Q   recod  
 
 X   init =Enccost init   ×Q   init  
 
     
       
         
           
             
               X 
               pred 
             
             = 
             
               
                 X 
                 init 
               
               × 
               
                 
                   SmoothedRatio 
                   X 
                 
                 ⁡ 
                 
                   [ 
                   mode 
                   ] 
                 
               
             
           
         
       
       
         
           
             
               Hence 
               ⁢ 
               
                   
               
               ⁢ 
               
                 Q 
                 recod 
               
             
             = 
             
               
                 
                   
                     SmoothedRatio 
                     X 
                   
                   ⁡ 
                   
                     [ 
                     mode 
                     ] 
                   
                 
                 
                   1 
                   - 
                   GainC 
                 
               
               × 
               
                 Q 
                 init 
               
             
           
         
       
     
     The re-encoding loop therefore uses the new quantization step size Q recod  so as to recode the new incoming image entering the re-encoding loop. 
     1—The example given below describes a particular embodiment in the case of a transcoder of MPEG-2 to MPEG-2 type. 
     The length of a reference period is the length of a group of images called a GOP, the acronym standing for &lt;&lt;Group Of Pictures)&gt;&gt;. 
     The various coding modes are the Intra (I), Bidirectional (B) or Predictive (P) mode. 
     In the case of a coding of MPEG-2 type, the granularity is sometimes finer than a granularity of image type and may lie at the macroblock level. In this case, each macroblock of the image is coded with its own quantization step size. 
     The a priori measurement facility  9  therefore extracts for each macroblock of the image:
         the initial compressible cost and the initial incompressible cost,   the quantization step size,       

     It next calculates for each macroblock the macroblock complexity, as being the product of the compressible cost times the quantization step size. 
     Next for each image, it calculates:
         the initial compressible cost, Enccost init ,   the initial incompressible cost, Overhead init ,   the initial image complexity, X init ,       

     by adding respectively the compressible and incompressible costs and the initial complexities of the macroblocks forming this image. 
     The measurement facility next calculates for each group of images (GOP),
         the aggregate of the initial compressible costs of the I images,   the aggregate of the initial compressible costs of the B images,   the aggregate of the initial compressible costs of the P images,   the aggregate of the initial incompressible costs of the I images, IGOPOverhead init .   the aggregate of the initial incompressible costs of the B images, BGOPoverhead init .   the aggregate of the initial incompressible costs of the P images, PGOPoverhead init .   the aggregate of the initial complexities of the I images, IGOPX init ,   the aggregate of the initial complexities of the B images, BGOPX init ,   the aggregate of the initial complexities of the P images, PGOPX init ,   the initial total cost of the GOP, GOPcost.       

     The a posteriori measurement facility  5  calculates for each macroblock of the re-encoded image:
         the compressible cost,   the quantization step size,   the macroblock complexity, as being the product of the compressible cost times the quantization step size,       

     The module  8  calculates the ratio of the outgoing bit rates, MeanBpp recod , of the re-encoding loop  4  to the ratio of the incoming bit rates, MeanBpp init , in the re-encoding loop  4 . 
     The outgoing bit rate, MeanBpp recod  is calculated on the basis of the preset bit rate provided by the supervising facility. 
     
       
         
           
             
               MeanBpp 
               recod 
             
             = 
             
               
                 
                   D 
                   recod 
                 
                 frame_rate 
               
               × 
               nbimages 
             
           
         
       
     
     Where:
         D recod  is the re-encoding preset bit rate, expressed in bit/s.   Nbimages is the number of images in the reference period.   frame_rate is the number of images per second.       

     
       
         
           
             
               MeanBpp 
               init 
             
             = 
             
               GOPcost 
               Nbimages_GOP 
             
           
         
       
     
     Where:
         GOPcost represents the total cost (compressible and incompressible) of a GOP.   Nbimages_GOP represents the number of images in the GOP.       

     The module  8  estimates the complexity and the incompressible cost of each image to be re-encoded and of the current GOP to which the image to be re-encoded belongs. 
     The prediction facility  8  calculates for each image, as indicated previously in the general embodiment, the ratio (Ratio overhead ) of the initial incompressible cost of the coded image to the incompressible cost of the re-encoded image and the ratio (Ratio X ) of the initial complexity of the coded image to the complexity of the re-encoded image. 
     To avoid having to take abrupt account of one of the previous ratios that may have lain outside the acceptable limit, and that may for example have arisen from a poor measurement or from an image manifesting a point feature, the ratios are bounded according to the following formula:
 
RedFactor overhead =Ratio overhead ε[MINRatio overhead ,1]
 
RedFactor X =Ratio X ε[MINRatio X ,1]
 
Where:
 
MINRatio overhead =(1−Weight overhead [mode])+Weight overhead [mode]×ratiorate
 
MINRatio X =(1−Weight X [mode])+Weight X [mode]×ratiorate
 
     Where Weight overhead [mode] and Weight X [mode] are constants. 
     The maximum bound chosen is &lt;&lt;1&gt;&gt; because the re-encoding cannot create an increase complexity. 
     The complexity and coding cost ratios are dependent on the ratio of the bit rates entering the re-encoding loop and of the bit rates exiting the re-encoding loop and also differ depending on the coding mode. 
     The module  8  calculates an averaged incompressible cost ratio, and an averaged complexity ratio for each coding mode: 
     For the images coded in intra (I) mode
 
SmoothedRatio overhead =RedFactor overhead  
 
SmoothedRatio X =RedFactor X  
 
     For the images coded in Bidirectional (B) or Predictive (P) mode: 
     
       
         
           
             
               SmoothedRatio 
               overhead 
             
             = 
             
               
                 
                   
                     
                       
                         2 
                         × 
                         
                           SmoothedRatio 
                           overhead 
                         
                       
                       + 
                     
                   
                 
                 
                   
                     
                       RedFactor 
                       overhead 
                     
                   
                 
               
               3 
             
           
         
       
       
         
           
             
               SmoothedRatio 
               X 
             
             = 
             
               
                 
                   2 
                   × 
                   
                     SmoothedRatio 
                     X 
                   
                 
                 + 
                 
                   RedFactor 
                   X 
                 
               
               3 
             
           
         
       
     
     These two ratios being initialized respectively to the following values:
 
(1−Weight overhead [mode])+Weight overhead [mode]×Ratiorate
 
(1−Weight X [mode])+Weight X [mode]×Ratiorate
 
     The module  8  next estimates the complexity, X pred , and the cost of incompressible re-encoding, Overhead pred , of the current image to be re-encoded as indicated in the general exemplary embodiment. 
     Next; it estimates the complexity, GOPX pred , and the incompressible cost, GOPOverhead pred , of the current GOP according to the following formulae:
 
 GOP Overhead pred =SmoothedRatio overhead   [I]×IGOP Overhead init +SmoothedRatio overhead   [B]×BGOP Overhead init +SmoothedRatio overhead   [P]×PGOP Overhead init  
 
 GOPX   pred   =ZI× SmoothedRatio X   [I]×IGOPX   init   +ZP× SmoothedRatio X   [P]×PGOPX   init   +ZB× SmoothedRatio X   [B]×BGOPX   init  
 
     The weighting constants ZI, ZB, ZP are constants obeying the rule:
 
 ZI×QI=ZP×QP=ZB×QP  
 
     These constants manifest the fact that to get a constant impression of coding quality, the I, B and P images should be quantized differently, the B images being quantized more severely. 
     The regulating facility  7  calculates the image preset cost as a function of the complexities estimated according to the following formula: 
     
       
         
           
             Targetcost 
             = 
             
               
                 
                   Z 
                   ⁡ 
                   
                     [ 
                     mode 
                     ] 
                   
                 
                 
                   GOPX 
                   pred 
                 
               
               × 
               
                 X 
                 pred 
               
               × 
               GOPTargetcost 
             
           
         
       
     
     with
 
 GOP Targetcost=(Mean BPP   recod   ×Nb images)− GOP Overhead pred  
 
     It also calculates the gain, GainC, to be achieved on the image to be re-encoded, as a percentage, in accordance with the formula: 
     
       
         
           
             GainC 
             = 
             
               
                 100 
                 × 
                 
                   ( 
                   
                     
                       Enccost 
                       init 
                     
                     - 
                     Targetcost 
                   
                   ) 
                 
               
               
                 Enccost 
                 init 
               
             
           
         
       
     
     This gain is transmitted to the requantization facility  6  which calculates the re-encoding quantization step size, Q recod , according to the following formula: 
     
       
         
           
             
               Q 
               recod 
             
             = 
             
               
                 
                   
                     SmoothedRatio 
                     X 
                   
                   ⁡ 
                   
                     [ 
                     mode 
                     ] 
                   
                 
                 
                   1 
                   - 
                   GainC 
                 
               
               × 
               
                 Q 
                 init 
               
             
           
         
       
     
     2—The example given below describes a particular embodiment in the case of a transcoder of MPEG-2 to MPEG-4 AVC type. 
     The various coding modes are still the Intra (I), Bidirectional (B) or Predictive (P) mode. 
     The a priori measurement facility  9  extracts as in the previous example for each macroblock of the image:
         the initial compressible cost and the initial incompressible cost,   the quantization step size,       

     It next calculates for each macroblock the macroblock complexity, as being the product of the compressible cost times the quantization step size. 
     Next for each image, it calculates:
         the initial compressible cost, Enccost init ,   the initial incompressible cost, Overhead init ,   the initial image complexity, X init ,       

     by adding respectively the compressible and incompressible costs and the initial complexities of the macroblocks forming this image. 
     The measurement facility next calculates for each group of images (GOP),
         the aggregate of the initial compressible costs of the I images,   the aggregate of the initial compressible costs of the B images,   the aggregate of the initial compressible costs of the P images,   the aggregate of the initial incompressible costs of the I images, IGOPOverhead init .   the aggregate of the initial incompressible costs of the B images, BGOPoverhead init .   the aggregate of the initial incompressible costs of the P images, PGOPoverhead init .   the aggregate of the initial complexities of the I images, IGOPX init ,   the aggregate of the initial complexities of the B images, BGOPX init ,   the aggregate of the initial complexities of the P images, PGOPX init ,   the initial total cost of the GOP, GOPcost.       

     The a posteriori measurement facility  5  calculates for each macroblock of the re-encoded image:
         the compressible cost,   the quantization step size,   the macroblock complexity, as being the product of the compressible cost times the quantization step size,       

     The module  8  calculates the ratio of the outgoing bit rates, MeanBpp recod , of the re-encoding loop  4  to the ratio of the incoming bit rates, MeanBpp init , in the re-encoding loop  4 . 
     The outgoing bit rate, MeanBpp recod , is calculated on the basis of the preset bit rate provided by the supervising facility. 
     
       
         
           
             
               MeanBpp 
               recod 
             
             = 
             
               
                 
                   D 
                   recod 
                 
                 frame_rate 
               
               × 
               nbimages 
             
           
         
       
     
     Where:
         D recod  is the re-encoding preset bit rate, expressed in bit/s.   Nbimages is the number of images in the reference period.   frame_rate is the number of images per second.       

     
       
         
           
             
               MeanBpp 
               init 
             
             = 
             
               GOPcost 
               Nbimages_GOP 
             
           
         
       
     
     Where:
         GOPcost represents the total cost (compressible and incompressible) of a GOP.   Nbimages_GOP represents the number of images in the GOP.       

     The module  8  estimates the complexity and the incompressible cost of each image to be re-encoded and of the current GOP to which the image to be re-encoded belongs. 
     The prediction facility  8  calculates for each image, as indicated previously in the general embodiment, the ratio (Ratio overhead ) of the initial incompressible cost of the coded image to the incompressible cost of the re-encoded image and the ratio (Ratio X ) of the initial complexity of the coded image to the complexity of the re-encoded image. 
     To avoid having to take abrupt account of one of the previous ratios that may have lain outside the acceptable limit, and that may for example have arisen from a poor measurement or from an image manifesting a point feature, the ratios are bounded according to the following formula:
 
RedFactor overhead =Ratio overhead ε[MINRatio overhead ,1]
 
RedFactor X =Ratio X ε[MINRatio X ,1]
 
Where:
 
MINRatio overhead =(1−Weight overhead [mode])+Weight overhead [mode]×ratiorate
 
MINRatio X =(1−Weight X [mode])+Weight X [mode]×ratiorate
 
     Where Weight overhead [mode] and Weight X [mode] are constants. 
     The complexity and coding cost ratios are dependent on the ratio of the bit rates entering the re-encoding loop and of the bit rates exiting the re-encoding loop and also differ depending on the coding mode. 
     The module  8  calculates an averaged incompressible cost ratio, and an averaged complexity ratio for each coding mode: 
     For the images coded in intra (I) mode
 
SmoothedRatio overhead =RedFactor overhead  
 
SmoothedRatio X =RedFactor X  
 
     For the images coded in Bidirectional (B) or Predictive (P) mode: 
     
       
         
           
             
               SmoothedRatio 
               overhead 
             
             = 
             
               
                 
                   2 
                   × 
                   
                     SmoothedRatio 
                     overhead 
                   
                 
                 + 
                 
                   RedFactor 
                   overhead 
                 
               
               3 
             
           
         
       
       
         
           
             
               SmoothedRatio 
               X 
             
             = 
             
               
                 
                   2 
                   × 
                   
                     SmoothedRatio 
                     X 
                   
                 
                 + 
                 
                   RedFactor 
                   X 
                 
               
               3 
             
           
         
       
     
     These two ratios being initialized respectively to the following values:
 
(1−Weight overhead [mode])+Weight overhead [mode]×Ratiorate
 
(1−Weight X [mode])+Weight X [mode]×Ratiorate
 
     The module  8  next estimates the complexity, X pred , and the cost of incompressible re-encoding, Overhead pred , of the current image to be re-encoded as indicated in the general exemplary embodiment. 
     Next, it estimates the complexity, GOPX pred , and the incompressible cost, GOPOverhead pred , of the current GOP according to the following formulae:
 
 GOP Overhead pred =SmoothedRatio overhead   [I]×IGOP Overhead init +SmoothedRatio overhead   [B]×BGOP Overhead init +SmoothedRatio overhead   [P]×PGOP Overhead init  
 
 GOPX   pred   =ZI× SmoothedRatio X   [I]×IGOPX   init   +ZP× SmoothedRatio X   [P]×PGOPX   init   +ZB×SmoothedRatio   X   [B]×BGOPX   init  
 
     The weighting constants ZI, ZB, ZP are constants obeying the rule:
 
 ZI×QI=ZP×QP=ZB×QP  
 
     These constants manifest the fact that to get a constant impression of coding quality, the I, B and P images should be quantized differently, the B images being quantized more severely. 
     The regulating facility  7  calculates the image preset cost as a function of the complexities estimated according to the following formula: 
     
       
         
           
             Targetcost 
             = 
             
               
                 
                   Z 
                   ⁡ 
                   
                     [ 
                     mode 
                     ] 
                   
                 
                 
                   GOPX 
                   pred 
                 
               
               × 
               
                 X 
                 pred 
               
               × 
               
                 GOPTarget 
                 ⁢ 
                 cost 
               
             
           
         
       
     
     with
 
 GOP Targetcost=(Mean BPP   recod   ×Nb images)− GOP Overhead pred  
 
     This image preset cost is transmitted to the requantization module  6 . As a function of this preset cost, the module  6  will quantize the image to be re-encoded.