Abstract:
A method for compressing encoding data of a sequence of pictures is based on a motion estimation among the successive images to remove the temporal redundancy from the data. The method recognizes a 3:2 pulldown conversion of a series of photograms of a filmed sequence in a sequence of TV frames. The TV frames have a number greater than the number of the photograms by duplicating certain pictures in a certain order. The redundancy due to such picture duplications is eliminated.

Description:
FIELD OF THE INVENTION 
     The present invention relates to transmission of digitized pictures, and, more particularly, to a picture compression technique based on motion estimation algorithms, such as those implemented in MPEG2 video encoders. 
     BACKGROUND OF THE INVENTION 
     World TV standards differ from one another in picture size and the way pictures are transmitted, e.g., frame rate, frequency band, etc. Usually, a motion picture is recorded by a camera at 24 photograms/second. In order for the film to be transmitted with the PAL or SECAM system, which requires a speed of 25 pictures/second, the film is slightly accelerated. This results in minor sound and motion distortions which are not perceived by a TV viewer. However, when the film must be transmitted with the NTSC TV standard, which requires a frame rate of 30 pictures/second, such an acceleration might produce distortions that would be perceived by the TV viewer. In this case, it is necessary to implement a 3:2 pulldown technique which transforms a film recorded at 24 photograms/second to a TV sequence of 30 pictures/second. 
     As shown in FIG. 1, a motion picture is recorded by a common photogram, that is, each picture is acquired as a whole in one instant. In contrast, a television picture is acquired in two distinct instants. A first instant is acquisition of the even lines, which makes up the even semifield (top field) of the picture. A second instant is acquisition of the odd lines, which makes up the odd semifield (bottom field). The sum of these two semifields make up the whole picture, which is also referred to as a video frame. In view of the fact that some time passes between the acquisition of the first and second semifields, there may be relative movements among the objects focused by the video camera. Consequently, an object may occupy slightly different positions in the two fields. 
     Even a photogram may be divided in two fields. The two fields are the even lines forming the top field and the odd lines forming the bottom field. Since the picture is acquired in a single instant, the focused objects will occupy the same position in both fields. The 3:2 pulldown conversion method from 24 to 30 photograms/second includes transforming a sequence of 4 photograms of the film in a sequence of 5 TV frames through the duplication of some fields according to the scheme illustrated in FIG.  2 . In FIG. 2, Top i and Bot i indicate the top field (even lines) and the bottom field (odd lines), respectively, of the photogram i, where i=1,2,3,4. This repetition of fields causes artifacts that do not disturb the TV viewer because the frames repeat themselves at 33 ms intervals. 
     Since the fundamental of picture compression methods is to reduce the amount of information that must be transmitted or recorded, the encoding of repetitive fields could be avoided by coding 5 pictures with the same number of bits that would be required by 4 pictures upon detecting whether the sequence contains a 3:2 pulldown transformation. Hence, it will be a function of the decoder (the receiving station) to reconstruct the sequence of 5 pictures according to the above described scheme. For the same quality of the pictures the compression ratio may be increased, or for the same number of bits available for coding the pictures it is possible to improve their quality. 
     A reliable detection of the 3:2 pulldown may also permit a further improvement of the coding quality for compression algorithms that use motion estimators based on the correlation of generated motion fields. However, the field repetition according to a 3:2 pulldown scheme may cause inconsistencies in the global motion of the pictures. When a field is repeated, the motion estimator senses this as a stop of the motion (even if fictitious) of the picture&#39;s objects, thus verifying the convergence process of the generated vectors. 
     A further beneficial consequence of the detection of the 3:2 pulldown is that its detection will render useless all the predictions permitted by the encoding method, e.g., field prediction, dual prime prediction and frame prediction, etc. Detection of the 3:2 pulldown is also an advantage for the methods that take into consideration the lack of movement among the picture fields, such as the frame prediction methods. 
     To detect the 3:2 pulldown, an analysis of the motion fields generated by the coding system for an acceptable motion estimation among the fields becomes essential. The basic concept of motion estimation is the following. A set of pixels of a field of a picture may be placed in a position of the subsequent picture obtained by translating the preceding one. These transpositions of objects may expose to the video camera parts that were not visible before, as well as changes of their shape, e.g., zooming. 
     The family of algorithms suitable to identify and associate these portions of images is generally referred to as motion estimation. Such an association permits calculation of a difference image. This removes the redundant temporal information making more effective the subsequent process of compression by discrete cosine transform (DCT), quantization and entropic coding. 
     Such a method is found in the MPEG2 standard. Systems of motion estimation as well as the architecture of the present invention are equally useful and are readily applicable to systems for manipulating digitized pictures operating according to a standard different from the MPEG2 standard. A typical block diagram of a video MPEG2 decoder is depicted in FIG.  3 . Such a system is made up of the following functional blocks. 
     Field ordinator. This block is composed of one or several field memories outputting the fields in the coding order required by the MPEG standard. For example, if the input sequence is I B B P B B P etc., the output order will be I P B B P B B . . . . 
     The intra coded picture I is a field and/or a semifield containing temporal redundancy. The predicted-picture P is a field and/or semifield from which the temporal redundancy with respect to the preceding I or P (previously co-decoded) picture has been removed. The bidirectionally predicted picture B is a field and/or a semifield whose temporal redundancy with respect to the preceding I and subsequent P (or preceding P and successive P) picture field has been removed. In both cases, the I and P pictures must be considered as already co/decoded. 
     Each frame buffer in the format 4:2:0 occupies the following memory space: 
     
       
         
               
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 standard PAL 
                   
               
               
                   
                 720 × 576 × 8 for the luminance (Y) = 
                 3,317,760 bits 
               
               
                   
                 360 × 288 × 8 for the chrominance (U) = 
                   829,440 bits 
               
               
                   
                 360 × 288 × 8 for the chrominance (V) = 
                   829,440 bits 
               
               
                   
                 total Y + U + V = 
                 4,976,640 bits 
               
               
                   
                 standard NTSC 
               
               
                   
                 720 × 480 × 8 for the luminance (Y) = 
                 2,764,800 bits 
               
               
                   
                 360 × 240 × 8 for the chrominance (U) = 
                   691,200 bits 
               
               
                   
                 360 × 240 × 8 for the chrominance (V) = 
                   691,200 bits 
               
               
                   
                 total Y + U + V = 
                 4,147,200 bits 
               
               
                   
                   
               
             
          
         
       
     
     Motion Estimator. This block removes the temporal redundancy from the P and B pictures. 
     DCT. This block implements the cosine-discrete transform according to the MPEG-2 standard. The I picture and the error pictures P and B are divided in 8*8 blocks of pixels Y, U, V on which the DCT transform is performed. 
     Quantizer Q. An 8*8 block resulting from the DCT transform is divided by a quantizing matrix to reduce the magnitude of the DCT coefficients. The information associated to the highest frequencies, less visible to human sight, tends to be removed. The result is reordered and sent to the successive block. 
     Variable Length Coding (VLC). The codification words output from the quantizer tend to contain a large number of null coefficients, followed by non-null values. The null values preceding the first non-null value are counted and the count figure forms the first portion of a codification word. The second portion of which represents the non-null coefficient. 
     These paired values tend to assume values more probable than others. The most probable ones are coded with relatively short words (composed of 2, 3 or 4 bits) while the least probable are coded with longer words. Statistically, the number of output bits is less than when these methods are not implemented. 
     Multiplexer and Buffer. Data generated by the variable length coder, the quantizing matrices, the motion vectors and other syntactic elements are assembled for constructing the final syntax processed by the MPEG-2 standard. The resulting bitstream is stored in a memory buffer, the limit size of which is defined by the MPEG-2 standard and cannot be overfilled. The quantizer block Q supports such a limit by making the division of the DCT 8*8 blocks dependant on how far the memory buffer of the system is filled, and on the energy of the 8*8 source block taken upstream of the motion estimation and DCT transform process. 
     Inverse Variable Length Coding (I-VLC). The variable length coding functions specified above are executed in an inverse order. 
     Inverse Quantization (IQ). The words output by the I-VLC block are reordered in the 8*8 block structure, which is multiplied by the same quantizing matrix that was used for its preceding coding. 
     Inverse DCT (I-DCT). The DCT transform function is inverted and applied to the 8*8 block output by the inverse quantization process. This permits passing from the domain of spatial frequencies to the pixel domain. 
     Motion Compensation and Storage. At the output of the I-DCT block the following may alternatively be present. A decoded I picture (or semipicture) that must be stored in a respective memory buffer for removing the temporal redundancy with respect thereto from subsequent P and B pictures. A decoded prediction error picture (semipicture) P or B must be summed to the information removed previously during the motion estimation phase. In case of a P picture, such a resulting sum is stored in a dedicated memory buffer and is used during the motion estimation process for the successive P pictures and B pictures. These field memories are generally distinct from the field memories used for re-arranging the blocks. 
     Display Unit. This unit converts the pictures from the format 4:2:0 to the format 4:2:2 and generates the interlaced format for displaying the images. The arrangement of the functional blocks depicted in FIG. 4 is an architecture implementing the above-described MPEG-2 decoder shown in FIG. 2. A distinctive feature is in the fact that the field rearrangement block, the motion compensation and storage block for storing the already reconstructed P and I pictures, and the multiplexer and buffer block for storing the bitstream produced by the MPEG-2 coding are integrated in memory devices external to the integrated circuit of the decoder. These memory devices are accessed through a single interface managed by an integrated controller. 
     Moreover, the preprocessing block converts the received images from the format 4:2:2 to the format 4:2:0 by filtering and subsampling the chrominance components. The post-processing block implements a reverse function during the decoding and displaying phase of the images. The coding process employs also a decoding step for generating the reference pictures to make operative the motion estimation. For example, the first I picture is coded, then decoded, stored and used for calculating the prediction error that will be used to code the subsequent P and B pictures. 
     The play-back process of the bit stream previously generated by the coding process uses only the inverse functional blocks (I-VLC, I-Q, I-DCT, etc.) and not the direct functional blocks. From this point of view, the coding and the decoding implemented for the subsequent displaying of the images are nonconcurrent processes within the integrated architecture. The scope of motion estimation algorithms is to predict pictures/semipictures in a sequence obtaining the composition of whole blocks of pixels, referred to as predictors, originating from preceding and or future pictures or semifields. 
     According to the MPEG-2 standard, there are three types of pictures (fields) or semifields. The intra coded picture I is a field and/or a semifield containing temporal redundance. The predicted-picture P is a field and/or semifield from which the temporal redundance with respect to the preceding I or P (previously co/decoded) has been removed. The bidirectionally predicted-picture B is a field and/or a semifield whose temporal redundancy with respect to the preceding I and subsequent P (or preceding P and successive P) has been removed. In both cases, the I and P pictures must be considered as already co/decoded. 
     The P field or semifield will now be discussed in greater detail. Two fields of a picture will now be considered: Q 1  at the instant t and the subsequent field Q 2  at the instant t+(kp)*T. The following discussion also applies to the semifields. T is the field period and kp a constant dependent on the number of B fields existing between the preceding I and the subsequent P (or between two P). The field period T is {fraction (1/25)} sec. for the PAL standard, and {fraction (1/30)} sec. for the NTCS standard. Q 1  and Q 2  are formed by luminance and chrominance components. It is assumed that the motion estimation is applied only to the most energetic and, therefore, richer of information component, such as the luminance components represented as a matrix of N lines and M columns. Q 1  and Q 2  are divided into portions called macroblocks, each of R lines and S columns. 
     The results of the divisions N/R and M/S must be two integer numbers, not necessarily equal to each other. Let Mb 2  (i,j) be a macroblock defined as the reference macroblock belonging to the field Q 2  and whose first pixel, in the top left part thereof, is at the intersection between the i-th line and the j-th column. The pair (i,j) is characterized in that i and j are integer multiples of R and S, respectively. 
     FIG. 5 shows how the reference macroblock is positioned on the Q 2  picture while the horizontal dash line arrows indicate the scanning order used to identify the various macroblocks on Q 1 . MB 2  (i,j) is projected on the Q 1  field to obtain MB 1  (i,j). A search window is defined on Q 1  having its center at (i,j) and is composed of the macroblocks MBk[e,f], where k is the macroblock index. The k-th macroblock is identified by the coordinates (e,f), with e and f being an integer number, such that: 
     
       
         − p &lt;=( e−i )&lt;=+ p−q &lt;=( f−j )&lt;=+ q   
       
     
     Each of the macroblocks is a possible predictor of MB 2  (i,j). The different motion estimation algorithms are different among them according to the way they are searched and selected inside the search window. The predictor that minimizes a certain cost function is chosen among the possible predictors. 
     This function may vary according to the motion estimation algorithm selected. For example, in the MPEG2 standard, the predictors that minimize the L 1  norm with respect to the reference macroblock were searched. The norm is equal to the sum of absolute values of the differences among common pixels and belongs to MB 2  (i,j) and MBk (e,f). Each sum contributes R*S values, with a result being referred to as distortion. 
     The predictor most similar to MB 2  (i,j) is identified by the coordinates of the prevailing predictor following the motion estimation. The vector formed by the difference between the position of the prevailing predictor and MB 2  (i,j) is the motion vector. The motion vector describes how MB 2  (i,j) originates from a shift of a similar macroblock inside the preceding field. 
     The B field or semifield will now be discussed in greater detail. Three picture fields are considered: QP n−1  at the instant t, QBk B  at the instant t+(k B )*T and QP n  at the instant t+(k p )*T. The following discussion also applies to the semifields. The variables k p  and k B  are dependent on the number of B fields (or semifields) preventively selected. T is the field period. The field period is {fraction (1/25)} sec. for the PAL standard, and {fraction (1/30)} sec. for the NTSC standard. QP −1 , QBk B  and QP n  are formed by luminance and chrominance components. The motion estimation is applied only to the most energetic and, therefore, richer of the information components, such as the luminance components, representable as a matrix of N lines and M columns. QP n−1 , QBk B  and QP n  are divided in portions called macroblocks, each of R lines and S columns. 
     The results of the divisions N/R and M/S must be two integer numbers, not necessarily equal. MB 2  (i,j) is a macroblock defined as the reference macroblock belonging to the field Q 2  and whose first pixel, in the top left part thereof, is at the intersection between the i-th line and the j-th-column. The pair (i,j) is characterized by the fact that i and j are integer multiples of R and S, respectively. MB 2  (i,j) is projected on the fQP n−1  field to obtain MB 1  (i,j), and is projected on the QP n  field to obtain MB 3  (i,j). 
     A search window is defined on QP n−1  with its center at (i,j), and is composed of the macroblocks MB 1 k[e,f]. A similar search window is defined on Qp n  whose dimension may also be different, or in any case predefined, and is composed of the macroblocks MB 3 k[e,f], where k is the macroblock index. The k-th macroblock on the QP n−1  is identified by the coordinates (e,f), such that: 
     
       
         − p   1 &lt;=( e−i )&lt;=+ p   1 − q   1 &lt;=( f−j )&lt;=+ q   1   
       
     
     The k-th macroblock on the QP n  field is identified by the coordinates (e,f) such that: 
     
       
         − p   3 &lt;=( e−i )&lt;=+ p   3 − q   3 &lt;=( f−j )&lt;=+ q   3   
       
     
     The indexes e and f are integer numbers. Each of the macroblocks is a predictor of MB 2  (i,j). In this case, there are two types of predictors for MB 2  (i,j). A first type is obtained from the field that temporarily precede the one containing the block to be estimated (I or P). This first type is referred to as a forward predictor. A second type is obtained from the field that temporarily follows the one containing the block to be estimated (I or P). This second type is referred to as a backward predictor. 
     Among the two sets of possible predictors, one backward and one forward predictor is selected to minimize a certain cost function of a hardware implementation. The predictors are selected depending on the type of motion estimation algorithm in use. This cost function may vary depending on the type of motion estimation selected. For example, in the MPEG2 standard the predictor that minimizes the L 1  norm with respect to the reference macroblock is searched. Such a norm is equal to the sum of absolute values of the differences among common pixels, and belongs to MB 2  (i,j) and MB 1 k(e,f) or MB 3 k(e,f). Each sum contributes R*S values. The result is called distortion. 
     Hence, a certain number of forward distortion values are obtained among which the lowest is chosen. This identifies a prevailing position (e f , f f ) in the field QP n−1 . Certain backward distortion values are also identified, among which the minimum value is chosen identifying a new prevailing position. (e b , f b ) on the Qp n  field. Moreover, the distortion value between MB 2  (i,j) and a theoretical macroblock obtained by linear interpolation of the two prevailing predictors is calculated. Therefore, MB 2  (i,j) may be estimated using only three types of macroblocks. The forward predictor (e f , f f ), or the backward predictor (e b , f b ) or both, though averaged. The vector formed by the difference components between the position of the prevailing predictor and of MB 2  (i,j) are defined as the motion vectors, and describe how MB 2  (i,j) derives from a translation of a macroblock similar to it in the preceding and/or successive field. 
     SUMMARY OF THE INVENTION 
     An object of the present invention is to improve the efficiency of picture compression methods based on motion estimation algorithms by recognizing the presence of a picture sequence transformation referred to as of 3:2 pulldown. 
     From the above discussion, it is evident how the ability of recognizing the presence of a 3:2 pulldown may have a significant impact on the quality of the images, as well as on the efficiency of the compression process. It is essential to detect a 3:2 pulldown process in a continuous and simultaneous mode in relation to the other processes that take place in the coder. 
     There may be cases in which normal TV sequences are inserted into camera filmed sequences. For example, a TV broadcast film is regularly interrupted by commercials. Therefore, it is necessary to be able to immediately change from a film mode to a normal mode so that fields are not lost. Lost fields may cause an inevitable loss of information. 
     According to the present invention, the compression method of coding the digital data of a sequence of pictures comprises the steps of recognizing a 3:2 pulldown conversion of a certain number of film photograms in a sequence of a larger number of TV frames by duplicating some pictures and eliminating, as a consequence of the recognition, the redundancy due to such a picture duplication. The compression method is commonly based on a motion estimation procedure among successive pictures to remove the temporal redundancy of data. 
     The algorithm of the present invention is able to recognize the existence of repeated fields of a picture with respect to those of a preceding picture, and verifies that such repetitions are in a certain sequence. That is, the sequence corresponds to that of a 3:2 pulldown transformation. It is therefore a pre-requisite for the effectiveness of the method of the invention that the motion estimation algorithm implemented in the coder establish the motion between a frame and its successive frame in the sequence. 
     As already explained, the motion estimation algorithm searches, for each reference macroblock of the current picture, a predictor macroblock within a search window on a preceding frame or on a following frame relatively to the current frame. The best predictor is the one that minimizes a certain cost function (norm L 1 ). 
     The algorithm for recognizing a 3:2 pulldown of the present invention exploits information made available by the system of motion estimation, the prevailing macroblock predictor and the cost function values. Since these data must be calculated during a coding phase, the determination of the 3:2 pulldown according to the method of the invention implies a relatively low impact on the overall complexity of the implementing hardware. 
     In a compression process the motion estimation between successive pictures of a sequence takes place by searching for each reference macroblock of a current picture a predictor macroblock within a search window on a picture temporally preceding or following the current one. By selecting the predictor that minimizes a certain cost function L 1 , the detection of a 3:2 pulldown in a flow of digital coding data of a sequence of pictures takes place through the following operations: 
     defining a reference macroblock of R*S pixels, half positioned on the top field and half positioned on the bottom field of a picture, each half including R*S/2 pixels; 
     searching for each macroblock of the current picture (i), with the exclusion of perimeter macroblocks, within the search window, and searching separately for the top half (Top i ) and bottom half (Bottom i ) for a macroblock of similar dimensions which would better predict (minimize the norm L 1 ) with respect to the common half (Top i−1 , Bottom i−1 ) on the temporarily preceding picture; 
     comparing the norm (L 1   Top ) associated to the prevailing predictor searched on the temporally preceding picture (i−1) with the norm (L 1   Top0 ) obtained by using, as a predictor for the R*S/2 macroblock relative to the top half (Top i ) of the current picture, the macroblock R*S/2 in a common position on the preceding picture (Top i−1 ), and incrementing a first counter (number_ 0 _Top) if the latter norm (L 1   Top0 ) is less than the first one (L 1   Top ); 
     carrying out the same operation of comparison between norms (L 1   bottom , L 1   bottom0 ) relative to the bottom halves, and incrementing a second counter (number_ 0 _Bottom); 
     verifying if the number contained in the first and/or second counter is higher than a certain threshold (a*number of macroblocks, with a&lt;1), and the occurrence of a repetition of one and/or the other half of the current picture with respect to the preceding one; and 
     processing the data of acknowledgment or disacknowledgement of a repetition for a certain number of successive pictures for eventually detecting a coincidence with the repetition pattern of a 3:2 pulldown, thus confirming the detection of a 3:2 pulldown. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 shows an example of a progressive sequence (film) and of an interlaced sequence (TV), according to the prior art. 
     FIG. 2 shows the method referred to as a 3:2 pulldown for converting a series of four photograms of a film into a sequence of five TV frames, according to the prior art. 
     FIG. 3 is a diagram of a MPEG-2 MPML video coder including a motion estimator block within which the present invention is embodied. 
     FIG. 4 is an architectural diagram of the MPEG-2 coder MPML of FIG.  3 . 
     FIG. 5 shows the position of a macroblock on a certain picture in relation to its scanning order, according to the present invention. 
     FIG. 6 depicts the search methodology among macroblocks of common fields: top vs. top and bottom vs. bottom, according to the present invention. 
     FIG. 7 is an architectural scheme of the Motion Estimator block, according to the present invention. 
     FIG. 8 is a block diagram of the 3:2 pulldown detection system, according to the present invention. 
     FIG. 9 illustrates the calculation scheme of Test 1  and Test 2  for the top field, according to the present invention. 
     FIG. 10 illustrates the scheme for determining the presence of repeated fields and for checking the order of repetition, according to the present invention. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     Assume that the reference macroblock, whose dimensions are R*S pixel, is located half on the top field and half on the bottom field, and each half has R*S/2 dimensions. For each macroblock contained in the current frame, with the exception of those belonging to the outermost crown (first and last row, and first and last column), a macroblock of similar dimensions that best predicts (minimizes the L 1  norm) is searched within the search window. The search is conducted separately on the Top i−1 for the R*S/2 part on Top i, and similarly on the Bottom i−1 for the R*S/2 part on Bottom i. 
     The norm L 1  associated to the best predictor R*S/2 found on Top i−1 (indicated by L 1   top ) is compared with the value of the norm that would be obtained if, as a predictor for the R*S/2 macroblock on Top i, the R*S/2 macroblock in a common position on Top i−1 is used (indicated by L 1   top0 ). If L 1   top0  is less than L 1   top , than it is possible that the macroblock R*S/2 on Top i did not shift in relation to the one on Top i−1. In this case, a first counter number_ 0 _top is incremented. 
     A similar process is performed for the bottom field, obtaining L 1   bottom0  and L 1   bottom , comparing them and eventually incrementing a second counter, number_ 0 _bottom. At the end of the scanning of the whole picture, the counter number_ 0 _top contains the number of R*S/2 macroblocks which did not move between Top i−1 and Top i. If this number is higher than a times the total number of macroblocks contained in the picture, a being less than 1, it may be affirmed then that the Top field repeated itself. Similarly, if this condition is verified for the content of the counter number —0 _bottom, then the Bottom field repeated itself. 
     These checks form a first test that may be conventionally defined as test 1 . To establish a further control test, the average values of L 1   top0  and of L 1   bottom0  for the whole picture are calculated. If the average of L 1   bottom0  is greater by b times the average of L 1   top0 , b being greater than 1, then on average the macroblock R*S/2 on Top i is predicted better than the macroblock R*S/2 on Bottom i by the respective predictor in common positions on the fields if the picture is i−1. Therefore, it may be affirmed that the Top field has been duplicated, and vice-versa. 
     Conventionally, this second test is referred to as test 2 . FIG. 7 shows the scheme of how the motion estimation block communicates with the block that detects the 3:2 pulldown. FIG. 9 shows the scheme of the test 1  and test 2  related to the top field. A similar scheme is used for testing the bottom field. Test 1  for the top field and test 1  for the bottom field are not mutually exclusive, so they may produce different values or even the same value contrary to test 2 . 
     For a 3:2 pulldown, the duplicated fields must fit a well defined scheme or pattern. Therefore, as shown in FIG. 8, the block that detects the 3:2 pulldown includes three functional subblocks. The first two subblocks calculate test 1  and test 2  for the Top and for the Bottom field, respectively, and the third subblock controls whether the fields are repeated in the right order or not. Therefore, a table may be generated for showing the pattern of repetition of the fields, and which at any instant, indicates the position of the current picture within such a scheme. 
     
       
         
               
               
               
             
           
               
                   
               
               
                 Repeated Top 
                 Repeated Bottom 
                 Index 
               
               
                   
               
             
             
               
                 1 
                 0 
                 0 
               
               
                 0 
                 0 
                 1 
               
               
                 0 
                 0 
                 2 
               
               
                 0 
                 1 
                 3 
               
               
                 0 
                 0 
                 4 
               
               
                 0 
                 0 
                 4 
               
               
                   
               
             
          
         
       
     
     where: 
     index indicates the position of the current frame within the mask; 
     1 indicates in the specific frame there may be a duplication of that particular field with respect to the preceding frame; and 
     0 indicates that there should not be any duplication of that particular field. 
     The method for determining the presence of duplicated fields may be implemented according to the architectural scheme shown in FIG.  10 . The process is the following: 
     a) index=0? 
     yes{[(test 1  for the top) and (no test 1  for the bottom)] or (test 2  for the top)}? 
     yes then the top field is duplicated. 
     b) index=3? 
     yes{[(test 1  for the bottom) and (no test 1  for the top)] or (test 2  for the bottom)}? 
     yes then the bottom field is duplicated. 
     c) index different from 0 and from 3? 
     yes[(test 2  for the top) and (test 2  for the bottom)]? 
     yes then both the top and bottom field are duplicated. 
     Depending on the position occupied by the picture in the mask (index), a possible repetition of the field that should be duplicated according to a 3:2 pulldown is searched. Therefore, when the index is equal to 0, a repeated top is searched. When the index is equal to 3, a repeated bottom is searched. In all the other cases, both the top and bottom fields are checked to see that they are not repeated. 
     The Control Index block of FIG. 10 controls whether the fields are duplicated in the right order according to the following procedure. Starting from the condition where the 3:2 pulldown is not detected, the index is zero and continues to be so, frame after frame, until a duplication of the top field and a nonduplication of the bottom field are determined (as per scheme). At this point the index is incremented and, therefore, in the successive frame the duplication of the fields as per the table for index equal to 1 (no repetition) is searched. 
     If the repetition is the wrong one, the index returns to zero and the procedure start over. On the contrary, if the repetition of the fields is the right one, the index is incremented and so forth. The 3:2 pulldown is detected upon completion of a mask. The index returns to zero and so forth. From the detection of a 3:2 pulldown, the encoder remains in a film mode until a different field duplication pattern from that of the table for a corresponding index value is encountered. When this occurs, the index returns to zero, the encoder ceases to operate in a film mode and the procedure starts again from the beginning.