reference will now be made in detail to the embodiments of the present invention , examples of which are illustrated in the accompanying drawings , wherein like reference numerals refer to the like elements throughout . the embodiments are described below to explain the present invention by referring to the figures . when it comes to encoding moving pictures , pre - treatment filtering is very important because it can increase the efficiency of encoding the moving pictures by removing noise from images . while a conventional pre - treatment filtering technique for removing noise from images is generally carried out in a spatial pixel block , in the present invention , a noise removal technique is carried out in a dct block in an apparatus for encoding moving pictures . in the present invention , an approximated generalized weiner filtering method is used for removing noise from images . in the approximated generalized weiner filtering method , weiner filtering is realized by taking advantage of fast unitary transformation , such as a discrete cosine transform ( dct ). however , a filtering method other than the approximated generalized weiner filtering method may be selectively used for carrying out filtering in a dct block . fig2 is a block diagram of an approximated generalized weiner filter processing image data whose average is not 0 . in fig2 , v represents an image block containing noise , and ŵ represents a row - ordered column vector of a filtered image block . since the average of the image block v is not 0 , an average estimation unit 210 estimates an average { circumflex over ( m )} of the image block v , and a subtraction unit 220 subtracts the estimated average { circumflex over ( m )} from the image block v . a value z , output from the subtraction unit 220 as a result of the subtraction , is filtered by a filtering unit 230 , and the filtering unit 230 outputs filtered data ŷ as a result of the filtering . an addition unit 240 adds the estimated average { circumflex over ( m )} of the image block v to the filtered data and then outputs desirably filtered data ŵ as a result of the addition . hereinafter , an approximated generalized weiner filtering method for processing an image model whose average is 0 will be described in greater detail . the approximated generalized weiner filtering method for processing an image model whose average is 0 can be expressed by equation ( 1 ) below . in equation ( 1 ), { tilde over ( l )}= al a * t , l =[ i + σ n 2 r − 1 ] − 1 , r = e [ y y t ], z = az , and σ n 2 represents a noise variance value . in addition , in equation ( 1 ), a represents unitary transformation . since in the present embodiment , dct is used as unitary transformation , a represents dct here . supposing that c 8 and { circle around (×)} represent an 8 × 8 dct matrix and a kronecker operator , a = c 8 { circle around (×)} c 8 . since , in most cases , { tilde over ( l )} is approximately diagonalized in a unitary transformation , equation ( 1 ) can be rearranged into equation ( 2 ) below . therefore , by applying equation ( 2 ) to an 8 × 8 block , equation ( 3 ) below can be obtained . in equation ( 4 ), ψ ( k , l ) represents normalized elements placed along a diagonal line of al a * t , and σ 2 represents a variance value of an original image y . in general , σ 2 cannot be known . therefore , σ 2 is substituted by a result of subtracting the noise variance value σ n 2 from a variance value of z . as shown in equation ( 3 ), approximated generalized weiner filtering is carried out on an image block whose average is 0 by multiplying a two - dimensional dct coefficient z ( k , l ) by { tilde over ( p )}( k , l ). once ŷ ( m , n ) is determined , a final , filtered image is obtained by adding { circumflex over ( m )}( m , n ) to ŷ ( m , n ). hereinafter , an approximated generalized weiner filtering method for processing an image model whose average is not 0 will be described in greater detail . let us assume that an average block is obtained by multiplying an input dct block containing noise by s ( k , l ), i . e ., the average block satisfied in equation ( 5 ) below . then , the approximated generalized weiner filter method of fig3 , which carries out addition and subtraction in the dct block , can be restructured into an approximated generalized weiner filter of fig4 a , 4 b , or 4 c . { circumflex over ( m )} ( k , l )= s ( k , l )· v ( k , l ) tm ( 5 ) by using equations ( 3 ) and ( 5 ), an image block filtered in the dct block can be represented by equation ( 6 ) below . f ( k , l ) in equation ( 6 ) can be expressed by equation ( 7 ) below . as shown in equation ( 6 ), the entire filtering process can be simplified into a multiplication of f ( k , l ). equation ( 7 ) shows that f ( k , l ) is determined by a signal - to - noise ratio ( snr ), a covariance matrix , and an average matrix . in order to determine f ( k , l ), it is necessary to obtain an average matrix s ( k , l ). in the present embodiment , among possible candidates for the average matrix s ( k , l ), the one that is satisfied in equation ( 5 ) is selected . the average matrix s ( k , l ) can be represented by equation ( 8 ) below . equation ( 8 ) illustrates one of the simplest forms that the average matrix s ( k , l ) could take in the dct block . hereinafter , a pretreatment process performed in an apparatus for encoding moving pictures will be described in greater detail with reference to fig4 and 5 . as described above , an approximated generalized weiner filtering process can be carried out on an image block whose average is not 0 by multiplying the image block with a dct value . fig4 a through 4c are block diagrams of different types of approximated generalized weiner filters in an apparatus for encoding moving pictures . more specifically , fig4 a through 4c illustrate the structure of an encoding apparatus that processes an intra block . fig4 a and 4b describe that an intra block is encoded by carrying out filtering on the intra block in a dct block and carrying out quantization and variable length coding ( vlc ) on the filtered intra block without performing an inverse dct on the filtered intra block . in other words , fig4 a and 4b describe that filtering is completed by multiplying the dct coefficient by f ( k , l ). in the meantime , quantization is carried out by multiplying or dividing the dct coefficient by a certain value with reference to a quantization table . the filtering carried out by multiplying the dct coefficient by f ( k , l ) and the quantization carried out by multiplying the dct coefficient by a certain value can be integrated into a single operation , as described in fig4 c . as described in fig5 , the concepts of the present invention , described in fig4 a through 4c , can be directly applied to an occasion when an apparatus for encoding moving pictures processes an inter block , as long as the noise has been removed from the motion - compensated block information p ( m , n ). a covariance value ψ ( k , l ) is determined depending on whether an input image block is an inter block or an intra block . therefore , f ( k , l ) of fig5 may be varied depending on whether the input image block is an inter block or an intra block . hereinafter , a method of obtaining an estimated variance value of intra blocks or inter blocks , from each of which their average is subtracted , will be described in detail with reference to equation ( 9 ) below . supposing that s represents an n × n ( where n 32 8 ) block from which an average of the corresponding block has already been subtracted , a variance matrix of the n × n block can be obtained using equation ( 9 ). equation ( 9 ) has been disclosed by w . niehsen and m . brunig in “ covariance analysis of motion - compensated frame differences ”, ieee trans . circ . syst . for video technol ., june 1999 . an estimated variance value can be obtained by applying equation ( 9 ) to a variety of experimental images . where an original image block is an intra block , an original image is divided into 8 × 8 blocks , and then a variance value of each of the 8 × 8 blocks is calculated . on the other hand , where the original image block is an inter block , an estimated variance value is calculated by applying equation ( 9 ) above to each image block that is determined as an inter block . by using the estimated covariance value , the following equation is obtained : r = e [ y y t ]. thereafter , by carrying out dct on r , the following equation is obtained : ψ = ara * t . in equation ( 7 ), the noise variance value σ n 2 can be obtained by using a noise estimator . given that noise and original image pixels are independent random variables , an estimated value { circumflex over ( σ )} 2 of the variance σ 2 of an original image can be calculated using equation ( 10 ) below . { circumflex over ( σ )} 2 = max ({ circumflex over ( σ )} z 2 −{ circumflex over ( σ )} n 2 , 0 ) ( 10 ) in equation ( 10 ), σ z 2 represents a variance value of each macroblock ( mb ). in a typical type of apparatus for encoding moving pictures , σ z 2 is calculated on a macroblock - by - macroblock basis . in the present embodiment , 8 × 8 blocks in the same macroblock are supposed to have the same variance value . therefore , there is no need to perform additional calculations to obtain a variance value of each of the 8 × 8 blocks . fig6 is a block diagram of an apparatus for encoding moving pictures according to an embodiment of the present invention that encodes an input image in consideration of the characteristics of the input image . in the present embodiment a level of noise contained in the input image is adaptively reflected in a quantization matrix . hereinafter , the structure and operation of the apparatus for encoding moving pictures according to a preferred embodiment of the present invention will be described in detail with reference to fig1 through 6 . the apparatus of fig6 includes a discrete cosine transfer unit 610 , a quantization unit ( q ) 620 , a variable length coding unit ( vlc ) 670 , an inverse quantization unit ( iq ) 630 , an inverse dct unit ( idct ) 640 , a frame memory unit 650 , and a motion estimation and compensation unit 660 , which correspond to the dct unit 122 , the quantization unit 124 , the vlc unit 134 , the inverse quantization unit 126 , the inverse dct unit 128 , the frame memory 130 , and the motion estimation and compensation unit 132 , respectively , of the encoding unit 120 of fig1 . in addition , the apparatus further includes a noise estimation unit 680 , a quantization weight matrix determination unit 692 , and a quantization weight matrix storage unit 694 . since the dct unit 610 , the inverse dct unit 640 , the frame memory unit 650 , and the motion estimation and compensation unit 660 serve the same functions as their respective counterparts of fig1 , their description will not be repeated . the quantization weight matrix determination unit 692 determines a quantization weight matrix corresponding to a predetermined macroblock based on a noise variance value σ n 2 received from the noise estimation unit 680 and the predetermined macroblock &# 39 ; s variance value σ z 2 received from the motion estimation and compensation unit 660 . thereafter , the quantization weight matrix determination unit 692 sends index information corresponding to the determined quantization weight matrix to the quantization weight matrix storage unit 694 and the vlc unit 670 . hereinafter , a method of determining a quantization weight matrix corresponding to the predetermined macroblock based on σ n 2 received from the noise estimation unit 680 and σ z 2 received from the motion estimation and compensation unit 660 , will be described in detail . as described above with reference to equation ( 8 ) and fig4 and 5 , f ( k , l ) is determined by equation ( 7 ). once f ( k , l ) is determined , the dct coefficient v ( k , l ) of an 8 × 8 block is multiplied by f ( k , l ), and the result of the multiplication ŵ ( k , l ) is divided by a predetermined quantization weight matrix during a quantization process . the apparatus of fig6 integrates the process of multiplying f ( k , l ) by the dct coefficient v ( k , l ) and the process of dividing ŵ ( k , l ) by the quantization weight matrix into a single process and performs the single process . in other words , if a location component of ( k , l ) of a quantization weight matrix qt is represented by q ( k , l ), then a location of ( k , l ) in a new quantization weight matrix qt ′ is q ( k , l )/ f ( k , l ). in the present embodiment , by integrating the two separate processes into a single process , a plurality of f matrices obtained using σ n 2 and σ z 2 are computed in advance , and then the new quantization weight matrix qt ′ is then computed using the plurality of f matrices and then is stored in the quantization weight matrix storage unit 694 . in addition , in the present embodiment , five new quantization weight matrices obtained using σ n 2 and σ z 2 are stored in the quantization weight matrix storage unit 694 . once σ n 2 and σ z 2 are determined , as shown in equation ( 7 ), f ( k , l ) is determined by s ( k , l ), ψ ( k , l ), and s ( k , l ) is calculated using equation ( 8 ), and ψ ( k , l ) is variably set depending on whether or not an input image is an inter block or an intra block . therefore , there is only one variable left for determining f ( k , l ), i . e ., and their respective quantization weight matrices qt ′ are provided . the provided quantization weight matrices qt ′ are stored in the quantization weight matrix storage unit 694 . based on σ n 2 received from the noise estimation unit 680 and σ z 2 received from the motion estimation and compensation unit 660 . the result of the quantization is transmitted to the quantization weight matrix storage unit 692 and the vlc unit 670 as index information of a quantization matrix corresponding to the predetermined macroblock . for example , if quantization weight matrices stored in the quantization weight matrix storage unit 694 are classified into five different types according to is carried out in five levels , and the index information of each of the five quantization weight matrices is set to 0 , 1 , 2 , 3 , or 4 . especially for blocks having a small variance value , is very large . when is very large , f ( k , l ) approaches 0 , resulting in a severe blocking phenomenon . in order to prevent the blocking phenomenon , t cutoff is used , as shown in equation ( 11 ) below . in general , t cutoff has a value between 1 and 2 . the quantization weight matrix storage unit 694 transmits a quantization weight matrix corresponding to the index information received from the quantization weight matrix determination unit 692 to the quantization unit 620 and the inverse quantization unit 630 . the quantization unit 620 quantizes the predetermined macroblock using the quantization weight matrix received from the quantization weight matrix storage unit 694 . the inverse quantization unit 630 inversely quantizes the predetermined macroblock using the received quantization weight value . the vlc unit 670 carries out vlc on input image data quantized by the quantization unit 620 and inserts the index information of the quantization weight matrix received from the quantization weight matrix determination unit 692 into a macroblock header . in the present embodiment , the index information of the corresponding quantization weight matrix is inserted into the macroblock header and the macroblock header is transmitted . if there are ten quantization weight matrices stored in the quantization weight matrix storage unit 694 , then 4 - bit data is required for each macroblock . adjacent macroblocks are supposed to have similar image characteristics and there is supposedly a correlation among their index values . therefore , a difference between an index value of one macroblock and an index value of an adjacent macroblock may be used as index information . the amount of index information to be transmitted can be considerably reduced in cases where a single quantization weight matrix is applied to an entire sequence . in the present embodiment , a plurality of quantization weight matrices stored in the quantization weight matrix storage unit 694 should also be stored in a decoding unit . it may also be possible to use a plurality of quantization weight matrices transmitted to the decoding unit on a picture - by - picture basis using a picture extension header or transmitted to the decoding unit on a sequence - by - sequence basis using a sequence extension header . as described above , it is possible to remove noise from an input image and enhance the efficiency of encoding the input image by adaptively applying a quantization matrix to each macroblock in consideration of a level of noise contained in the input image . it is also possible for a user to arbitrarily determine quantization weight matrices . in the present embodiment , noise removal has been described as being performed on a y component of an input image block in a dct block . however , the noise removal can also be applied to a u or v component of the input image block , in which case additional quantization weight matrices are required exclusively for the u and v components of the input image block . fig7 is a block diagram of an apparatus for encoding moving pictures according to another preferred embodiment of the present invention that encodes an input image in consideration of the characteristics of the input image . more specifically , among various characteristics of an input image , the edge characteristics of each macroblock of the input image are taken into consideration in the present embodiment . referring to fig7 , an apparatus for encoding moving pictures according to another preferred embodiment of the present invention includes a dct unit 710 , a quantization unit 720 , a vlc unit 770 , an inverse quantization unit 730 , an inverse dct unit 740 , a frame memory unit 750 , and a motion estimation and compensation unit 760 , which correspond to the dct unit 122 , the quantization unit 124 , the vlc unit 134 , the inverse quantization unit 126 , the inverse dct unit 128 , the frame memory 130 , and the motion estimation and compensation unit 132 , respectively , of the encoding unit 120 of fig1 . in addition , the apparatus further includes a quantization matrix determination unit 780 and a quantization matrix storage unit 790 . since the dct unit 710 , the inverse dct unit 740 , the frame memory unit 750 , the motion estimation and compensation unit 760 , and the vlc unit 770 serve the same functions as their respective counterparts of fig1 , their description will not be repeated . the quantization matrix determination unit 780 selects an optimal quantization matrix for each macroblock in consideration of the characteristics of an input image and then transmits index information of the selected quantization matrix to the quantization matrix storage unit 790 and the vlc unit 770 . the quantization matrix determination unit 780 takes the edge characteristics of each macroblock into consideration as a benchmark for selecting one out of a predetermined number of quantization matrices . hereinafter , a method of selecting a quantization matrix in consideration of the edge characteristics of a macro block will be described in detail . in a case where a predetermined macroblock of an input image is an intra block , the size and direction of an edge in each pixel of the predetermined macroblock are computed using such an edge detector as a sobel operator . the sobel operation can be represented by equation ( 12 ). the quantization matrix determination unit 780 calculates the magnitude of a vertical edge and the magnitude of a horizontal edge using equation ( 12 ) above and calculates the intensity and direction of an edge of the predetermined macroblock using the magnitude of the vertical and horizontal edges . thereafter , the quantization matrix determination unit 780 selects one from among a predetermined number of quantization matrices in consideration of the intensity and direction of the edge of the predetermined macroblock and encoding efficiency . in other words , in a case where the predetermined macro block includes a horizontal or vertical edge , the quantization matrix determination unit 780 selects a quantization matrix that can enable quantization in full consideration of the horizontal or vertical edge of the predetermined macro block . in a case where the predetermined macroblock is an inter block , the intensity and direction of an edge included in the predetermined macroblock can also be obtained using such an edge detector as a sobel operator . in the present embodiment , a sobel detector is used for computing the intensity and direction of an edge included in the predetermined macroblock . however , a spatial filter , such as a differential filter or a robert &# 39 ; s filter , can also be used for computing the intensity and direction of the edge included in the predetermined macroblock . in addition , in the present embodiment , a quantization matrix is selected in consideration of the edge characteristics of the predetermined macroblock . however , other characteristics of the predetermined macroblock that can affect encoding efficiency or the quality of an output image can be taken into consideration in adaptively selecting an optimal quantization matrix for the predetermined macroblock . the quantization matrix storage unit 790 selects a quantization matrix based on the index information received from the quantization matrix determination unit 780 and transmits the selected quantization matrix to the quantization unit 720 and the inverse quantization unit 730 . the quantization unit 720 carries out quantization using the quantization matrix received from the quantization matrix storage unit 790 . the inverse quantization unit 730 carries out inverse quantization using the quantization matrix received from the quantization matrix storage unit 790 . the vlc unit 770 carries out vlc on quantized input image data , received from the quantization unit 720 , and index information of a quantization matrix corresponding to the predetermined macroblock , received from the quantization weight matrix determination unit 780 . the index information is inserted into a macroblock header . in the present embodiment , index information of a quantization weight matrix corresponding to a predetermined macroblock is inserted into a header of the predetermined macroblock and then transmitted . a difference between an index value of one macroblock and an index value of an adjacent macroblock may be used as index information . in the present embodiment , a plurality of quantization weight matrices stored in the quantization matrix storage unit 790 are also stored in a decoding unit . however , it may also be possible to use a plurality of quantization weight matrices transmitted to the decoding unit on a picture - by - picture basis using a picture extension header or transmitted to the decoding unit on a sequence - by - sequence basis using a sequence extension header . fig8 is a block diagram of an apparatus for decoding moving pictures according to an embodiment of the present invention . referring to fig8 , the apparatus includes a variable length decoding unit 810 , an inverse quantization unit 820 , an inverse dct unit 830 , a frame memory unit 840 , and a motion compensation unit 850 , which correspond to the variable length decoding unit 142 , the inverse quantization unit 144 , the inverse dct unit 146 , the frame memory unit 148 , and the motion compensation unit 150 , respectively , of the decoding unit 140 of fig1 . in addition , the apparatus further includes a quantization weight matrix storage unit 860 . the inverse dct unit 830 , the frame memory unit 840 , and the motion compensation unit 850 serve the same functions as their respective counterparts of fig1 , and thus their description will not be repeated here . the variable length decoding unit 810 carries out variable length decoding on an input stream , extracts index information of a quantization weight matrix corresponding to a predetermined macroblock of the input stream from a header of the predetermined macroblock , and outputs the extracted index information to the quantization weight matrix storage unit 860 . the quantization weight matrix storage unit 860 outputs a quantization weight matrix corresponding to the index information received from the variable length decoding unit 810 to the inverse quantization unit 820 . the quantization weight matrix storage unit 860 stores a plurality of quantization weight matrices , which are classified according to the characteristics of an input image processed by an encoding unit , for example , a noise variance value as a ratio between an input image variance value and the edge characteristics of the input image . the plurality of quantization weight matrices stored in the quantization weight matrix storage unit 860 can be transmitted on a picture - by - picture basis using a picture extension header or transmitted to the decoding unit on a sequence - by - sequence basis using a sequence extension header . the plurality of quantization weight matrices are transmitted from the variable length decoding unit 810 to the quantization weight matrix storage unit 860 , as marked by a dotted line in fig8 . the present invention can be applied to different types of methods and apparatuses for encoding and / or decoding moving pictures , such as mpeg - 1 , mpeg - 2 , or mpeg - 4 . in addition , the present invention can be realized as computer - readable codes written on a computer - readable recording medium . the computer - readable recording medium includes any type of recording device on which data can be written in a computer - readable manner . for example , the computer - readable recording medium includes rom , ram , cd - rom , a magnetic tape , a hard disk , a floppy disk , flash memory , an optical data storage , and a carrier wave ( such as data transmission through the internet ). in addition , the computer - readable recording medium can be distributed over a plurality of computer systems which are connected to one another in a network sort of way so that computer - readable codes are stored on the computer - readable recording medium in a decentralized manner . as described above , the methods of encoding and / or decoding moving pictures according to the embodiments of present invention , a quantization matrix is adaptively applied to each macroblock of an input image in consideration of the characteristics of the input image . thus , it is possible to enhance the efficiency and performance of encoding the input image . although a few embodiments of the present invention have been shown and described , it would be appreciated by those skilled in the art that changes may be made in this embodiment without departing from the principles and spirit of the invention , the scope of which is defined in the claims and their equivalents .