FIELD OF THE INVENTION

[0001]
The present invention relates to a method of and a corresponding device for transcoding a primary coded signal previously quantized with a first quantization scale into a secondary coded signal quantized with a second quantization scale, said method of transcoding comprising at least the steps of:

[0002]
partially decoding the primary coded signal, using the first quantization scale and providing a dequantized signal including DCT coefficients,

[0003]
quantizing the dequantized signal, using quantization matrices and the second quantization scale and providing a quantized signal,

[0004]
encoding the quantized signal so as to obtain the secondary coded signal.

[0005]
The invention also relates to a corresponding device for carrying out such a method of transcoding.

[0006]
This invention is particularly relevant for the transcoding of MPEG compressed video signals.
BACKGROUND OF THE INVENTION

[0007]
Bit rate transcoding is a technique which allows a primary video stream encoded at a bit rate D1 to be converted into a secondary video stream encoded at a bit rate D2 lower than D1, the bit rate reduction being performed in order to meet requirements imposed by the means of transport during broadcasting. A possible method of transcoding is described in the document entitled “Seamless Concatenation—A 21st Century Dream”, by M. J. Knee and N. D. Wells, and disclosed at the International Television Symposium (Montreux, Switzerland, Jun. 1317, 1997). Said document presents a transcoder, which is depicted in FIG. 1 of the present invention. Such a transcoder comprises, in series, a variable length decoder (VLD), an inverse quantizer (IQ), a quantizer (Q), a variable length encoder and a buffer (VLC/BUF), and a rate control device (REG).

[0008]
Unfortunately, such a transcoding method from a bit rate D1 to a bit rate D2 often leads to a substantial degradation of the picture quality, especially when the transcoded sequence of pictures is compared with the same sequence directly encoded at a bit rate D2, blurring effects or blocking artifacts being far more conspicuous on the transcoded sequence of pictures.
SUMMARY OF THE INVENTION

[0009]
It is an object of the invention to provide a method of transcoding and a corresponding device which lead to a minimal degradation in picture quality.

[0010]
To this end, the method of transcoding according to the invention is characterized in that it comprises a quantization step that uses correction matrices in order to cancel undesired DCT coefficients of the dequantized signal.

[0011]
The use of correction matrices comes from the following observations. The primary signal has been encoded by a video encoder at a high bit rate D1. As a result of this high bit rate, small quantization scales are used, leading to a lot of small DCT coefficients equal to 1 or −1. As a consequence, when quantizing, the encoder does not favor the cancellation of the small DCT coefficients especially in the high frequency domain, as shown in FIG. 2a. If the primary signal is encoded at a bit rate D2 lower than D1, most of the small high frequency DCT coefficients are set to 0, as shown on FIG. 2b, due to the use of higher quantization scales. However, when the primary signal is transcoded from the bit rate D1 to the bit rate D2, most of the small DCT coefficients of the primary coded signal remain ‘1’ or ‘−1’ after the requantization process, as shown in FIG. 2c. These coefficients are then undesired since they do not contribute to the picture quality. On the contrary, these coefficients are encoded using the escape coding defined by the MPEG2 standard, which is bit consuming. For a constant bit rate encoding, the bits really allocated to the picture quality are consequently decreased, resulting in an increase of the quantization scale and leading to a degradation of the picture quality. The aim of the correction matrices is to correct this negative effect, which is due to the rounding process of the requantization step.

[0012]
The method of transcoding according to the invention is also characterized in that the quantization step comprises a substep of testing the neighborhood of the DCT coefficients in order to determine if the correction matrices have to be applied or not.

[0013]
Such a testing substep allows the correction matrices to be applied in a more efficient way, leading to an improvement of the quality of the transcoded pictures.

[0014]
These and other aspects of the invention will be apparent from and will be elucidated with reference to the embodiments described hereinafter.
BRIEF DESCRIPTION OF THE DRAWINGS

[0015]
The present invention will now be described in more detail, by way of example, with reference to the accompanying drawings, wherein:

[0016]
[0016]FIG. 1 is a block diagram corresponding to a transcoder according to the background art,

[0017]
[0017]FIGS. 2a, 2 b and 2 c represent three 8×8 DCT blocks corresponding to the same area of a picture respectively encoded at a bit rate D1, encoded at a bit rate D2 and transcoded from a bit rate D1 to a bit rate D2,

[0018]
[0018]FIG. 3 is a block diagram corresponding to a first embodiment of a transcoding device according to the invention,

[0019]
[0019]FIGS. 4a and 4 b are two examples of correction matrices respectively used for Intracoded pictures and Predicted or Bidirectional pictures,

[0020]
[0020]FIG. 5 is a block diagram corresponding to a second embodiment of a transcoding device according to the invention and comprising means for motion compensation,

[0021]
[0021]FIG. 6 is a block diagram corresponding to a third embodiment of a transcoding device according to the invention and comprising improved means for motion compensation.
DETAILED DESCRIPTION OF THE INVENTION

[0022]
A transcoding device allows a primary coded signal (S1) previously encoded with a first quantization scale, hereafter referred to as Q1, to be converted into a secondary coded signal (S2) encoded with a second quantization scale, hereafter referred to as Q2.

[0023]
Such a transcoding device is depicted in FIG. 3 and comprises at least the following elements:

[0024]
partial decoding means (PD) for receiving the primary coded signal and providing a dequantized signal (IQS), including DCT coefficients, using the first quantization scale. These partial decoding means comprise in series a variable length decoder (VLD) and an inverse quantizer (IQ).

[0025]
quantization means (Q) for receiving the dequantized signal and providing a quantized signal (QS) using quantization matrices and the second quantization scale.

[0026]
partial encoding means (PE) for receiving the quantized signal and providing the secondary coded signal. These partial encoding means comprise, in series, a variable length encoder (VLC), a buffer (BUF) and regulation means (REG). These regulation means calculate the second quantization scale in order to keep a constant picture quality but also to fit the buffer occupancy.

[0027]
As stated hereinbefore, the present invention aims at improving the quantization means. For that purpose, said quantization means comprises correction means (COR) in order to cancel undesired DCT coefficients of the dequantized signal, the undesired coefficients being the small high frequency DCT coefficients as described in the summary of the invention.

[0028]
The quantization method according to the invention will now be described in the case of an MPEG2 coded signal including DCT coefficients but it will be apparent to a person skilled in the art that such a method is applicable to any coded signal that has been encoded with a blockbased compression method such as, for example, the one described in MPEG4, H.261 or H.263 standards. Said quantization method comprises at least:

[0029]
a first processing step applied to the coded signal, using quantization matrices and providing a weighted coded signal,

[0030]
a second processing step applied to the weighted coded signal, using a quantization scale and providing a quantized signal.

[0031]
These two steps are implemented in a different way for Intracoded (I) pictures and for Predicted (P) or Bidirectional (B) pictures.

[0032]
For Intracoded pictures, the first processing step computes, for each DCT coefficient acI(u,v) of a 8×8 DCT block, a weighted DCT coefficient wacI(u,v) using a weighted coefficient wI(u,v) of a quantization matrix wI:

wacI(u,v)=16×acI(u,v)//wI(u,v)

[0033]
where:

[0034]
// is the division with a rounding to the nearest integer,

[0035]
u and v are integers such as u=1 to 8 and v=1 to 8.

[0036]
The quantization matrix wI is either the matrix that is defined by the MPEG2 standard or a matrix defined by a user and downloaded with the Quant_matrix_extension procedure described by said standard in the document “Coding of moving pictures and associated audio, Video, ISO/IEC 138182, International Standard.

[0037]
Then, during the second processing step, a rounding value rounding_val is computed in order to obtain the quantized value QacI(u,v) of the weighted DCT coefficient wacI(u,v):

rounding _{—} val sign[acI(u,v)]×(p×Q2//q)

QacI(u,v)=(wacI(u,v)+rounding _{—} val×mat _{—} correction _{—} I(u,v))/(2×Q2)

[0038]
where:

[0039]
p and q are integers, which are, for example p=3 and q=4, as defined in the Test Model 4.2 “Coded representation of picture and audio information, ISOIEC/JTC1/SC29/WG11”,

[0040]
sign[y] is a finction that returns the sign of y,

[0041]
/ is the division with a rounding to the lowest integer.

[0042]
The correction matrix mat_correction_I is defined to reduce the rounding value effect, especially for high frequency DCT coefficients, corresponding to high values of u and v. An example of such a matrix is given in FIG. 4a but it will be obvious to a person skilled in the art that the invention is not limited to the use of such a matrix, the main characteristics of the correction matrix being that its high frequency coefficients are equal to or lower than its low frequency coefficients.

[0043]
For Predicted or Bidirectional pictures, the first processing step computes, for each DCT coefficient acPB(u,v), a weighted DCT coefficient wacPB(u,v) using a weighted coefficient wPB(u,v) of a quantization matrix wPB:

wacPB(u,v)=16×acPB(u,v)//wPB(u,v)

[0044]
The quantization matrix wPB is either the matrix that is defined by the MPEG2 standard or a matrix defined by the user and downloaded with the Quant_matrix_extension described by said standard.

[0045]
The second processing step computes the quantized value QacPB(u,v) of the weighted DCT coefficient wacPB(u,v) as follows:

QacPB(u,v)=wacPB(u,v)×mat _{—} correction _{—} PB(u,v))/(2×Q2)

[0046]
An example of such a correction matrix mat_correction_PB is given in FIG. 4b but it will be obvious to a person skilled in the art that the invention is not limited to the use of such a matrix for the previously described reasons.

[0047]
The above described method can be improved by applying the correction matrices as a function of the neighborhood of the DCT coefficients. The criteria used to determine if a coefficient of the correction matrix has to be applied or not is based on the fact that image texture has smooth spatial variations in a local area, so that one can expect that details of the pictures are characterized by nonzero DCT coefficients, though small, in a small frequential neighborhood. In this case, even if an a priori undesired DCT coefficient is observed (typically a very small DCT coefficient in the HF), no correction will be applied to this DCT coefficient since its neighbors are constituted by nonzero values. On the contrary, if an isolated undesired DCT coefficient is observed, a correction measure is applied, by using the correction matrices. This second embodiment is implemented as follows:

[0048]
if (Nb_null_DCT_coeff(u,v)>Nb_null_DCT_coeff_min)

[0049]
then apply mat_correction_I(u,v) or mat_correction_PB(u,v)

[0050]
else do not modify the DCT coefficient

[0051]
where:

[0052]
Nb_null_DCT_coeff(u,v) is the number of DCT coefficients equal to 0 in a neighborhood defined around the position (u,v), for example Nb_null_DCT_coeff min=2 according to the settings of the second embodiment,

[0053]
S(u,v) defines a set of positions around the position (u,v), for example S(u,j)={(u−1,v), (u+1,v), (u,v−1), (u,v+1)} according to the settings of the second embodiment.

[0054]
The above described quantization methods are more particularly intended to be integrated in a transcoding process. However, they can be also integrated in an encoding process.

[0055]
The transcoder of FIG. 3 is a simple one that contains mainly a requantization step. FIGS. 5 and 6 show more complex transcoders using means for motion compensation. Such motion compensation means are used to correct the error drift on P/B pictures that occurs when using only requantization.

[0056]
In FIG. 5, the transcoder comprises:

[0057]
a partial decoding channel (PD) for receiving the primary coded signal which is composed of a Variable Length Decoding block VLD connected in series with a dequantization block IQ,

[0058]
an encodingdecoding channel comprising a quantization block Q using correction means COR and connected in series with a Variable Length Coding block VLC, the output of the quantization block being also connected to an extra dequantization block DQm,

[0059]
a partial encoding channel (PE) for receiving the quantized signal (QS) from the quantization block and comprising, in series, a variable length encoder (VLC), a buffer (BUF) and regulation means (REG), the buffer providing the secondary coded signal and the regulation means providing a quantization scale to the quantization block,

[0060]
an interface subassembly, connected between the decoding channel and the encodingdecoding channel, and comprising:

[0061]
a first subtractor s1, whose positive input receives the output of the decoding channel and whose output provides a dequantized signal (IQS) to the input of the Q block,

[0062]
a second subtractor s2, whose positive input receives the output of the DQm block and whose negative input is connected to the output of the first subtractor,

[0063]
an Inverse Discrete Cosine Transform block IDCT, a frame memory MEM, a motion compensation block MC and a Discrete Cosine Transform block DCT, all connected in series between the output of the second subtractor and the negative input of the first subtractor, the motion compensation being performed using motion vectors representing the motion of each macroblock of the current picture with respect to the corresponding macroblock of a previous picture in the transmission order.

[0064]
The transcoder in FIG. 6 is more sophisticated and comprises:

[0065]
a partial decoding channel (PD) composed of a Variable Length Decoding block VLD connected in series with a dequantization block DQ and an Inverse Discrete Cosine Transform block IDCT,

[0066]
an encodingdecoding channel comprising a Discrete Cosine Transform block DCT for providing a dequantized signal (IQS) to a quantization block Q using corrections means COR, and a Variable Length Coding block VLC, the output of the quantization block being also connected to an extra dequantization block DQ_{m }followed by an extra Inverse Discrete Cosine Transform block IDCT_{m},

[0067]
a partial encoding channel (PE) as described with reference to FIG. 5,

[0068]
an interface subassembly, connected between the decoding channel and the encodingdecoding channel, and comprising:

[0069]
a first subtractor s1, whose positive input receives the output of the decoding channel and whose output is connected to the input of the DCT block,

[0070]
a second subtractor s2, whose positive input receives the ouput of the IDCT_{m }block and whose negative input is connected to the output of the first subtractor,

[0071]
a frame memory MEM and a motion compensation block MC connected in series between the output of the second subtractor and the negative input of the first subtractor.

[0072]
It will be obvious that the verb “to comprise” and its conjugations does not exclude the presence of any other steps or elements besides those defined in any claim.