Moving Picture Encoding Apparatus
Data of both MPEG-2 and MPEG-4 is generated simultaneously with a small circuit scale and a small power consumption. A moving picture encoding apparatus for encoding a moving picture through motion-compensated inter-frame prediction has: a MPEG-2 encoding unit including a motion vector estimator, a frame memory, a forward prediction circuit, a bidirectional prediction circuit, a prediction selection circuit, an intra-frame encoding circuit and a local decoding circuit; a MPEG-4 encoding unit including a frame extraction circuit for extracting a predetermined MPEG-2 frame and a transcoder for encoding the extracted frame; a motion vector calculator calculating a motion vector to be used for MPEG-4 prediction from a motion vector to be used for MPEG-2 prediction; and a prediction mode controller controlling the prediction mode of the MPEG-2 encoding unit in such that the MPEG-2 prediction mode becomes coincident with the MPEG-4 prediction mode.
Latest Hitachi, Ltd. Patents:
- COMPUTER SYSTEM AND SERVICE RECOMMENDATION METHOD
- Management system and management method for managing parts in manufacturing made from renewable energy
- Board analysis supporting method and board analysis supporting system
- Multi-speaker diarization of audio input using a neural network
- Automatic copy configuration
The present application is a divisional of and claims priority from U.S. application Ser. No. 11/190,272, filed Jul. 26, 2005, which application claims priority from U.S. application Ser. No. 10/279,370, filed Oct. 23, 2002, which application claims priority from Japanese Patent Application No. 2002-175720, filed Jun. 17, 2002, all of which are incorporated by reference.
BACKGROUND OF THE INVENTIONThe present invention relates to a moving picture encoding apparatus for encoding a moving picture by utilizing motion-compensated inter-frame prediction and to a moving picture recording/reproducing apparatus for recording and reproducing encoded data.
Technique of converting data encoded by MPEG-2 into encoded data of MPEG-4 and the like having a different frame rate and a different image size is introduced into IEEE TRANSACTIONS ON MULTIMEDIA, Vol. 2, No. 2, JUNE 2000, pp. 101 to 110.
BRIEF SUMMARY OF THE INVENTIONThis conventional technique adopts a method of decoding data by MPEG-2 and then encoding it by MPEG-4, and is associated with some problems of a large circuit scale or a large consumption power because of a large computation amount.
Although the conventional technique discloses the conversion into encoded data having a different frame rate and a different image size, it does not teach the capability of converting data with a small circuit scale or a small consumption power by reducing the computation amount. It neither teaches the simultaneous generation of encoded data having a different frame rate and a different image size.
It is an object of the invention to provide a moving picture encoding apparatus and a moving picture recording/reproducing apparatus capable of converting or generating at the same time encoded data having a different frame rate and a different picture size with a small computation amount, i.e., with a small circuit scale or a small consumption power.
In order to achieve the above object, a moving picture encoding apparatus for encoding a moving picture by utilizing motion-compensated inter-frame prediction, comprises: a first encoding module for encoding the moving picture at a first frame rate and at a first image size; a second encoding module for encoding the moving picture at a second frame rate and at a second image size; a prediction mode control module for controlling to make a prediction mode of the first encoding module be coincident with a prediction mode of the second encoding module; and a motion vector calculation module for calculating a motion vector to be used by the second encoding module from a motion vector to be used by the first encoding module.
BRIEF DESCRIPTION OF THE DRAWINGSThese and other features, objects and advantages of the present invention will become more apparent from the following description when taken in conjunction with the accompanying drawings wherein:
Embodiments of a moving picture encoding apparatus according to the invention will be described with reference to the accompanying drawings.
The structure of the moving picture encoding apparatus shown in
The motion vector estimator 11 obtains forward or bidirectional motion vector by performing block matching between moving picture data F input to the moving picture input terminal T1 and a past or future reference frame Fr stored in the frame memory 12-1.
The frame memory 12-1 stores a past or future reference frame Fr.
The forward prediction circuit 13-1 performs forward prediction through motion compensation between the input moving picture data F and the reference frame Fr in accordance with the motion vector to thereby generate difference data ΔP.
The bidirectional prediction circuit 14-1 performs bidirectional prediction through motion compensation between the input moving picture data F and the reference frame Fr in accordance with the motion vector obtained by the motion vector estimator 11 to thereby generate difference data ΔB.
The prediction selection circuit 15-1 selects one of the input moving picture data F itself, forward predicted difference data ΔP and bidirectionally predicted difference data ΔB in accordance with an instruction from the bidirectional mode control circuit 16.
The prediction mode control circuit 16 controls the prediction mode of the prediction selection circuit 15-1 in such a manner that the encoding prediction mode of the first encoding module becomes coincident with the encoding prediction mode of the second encoding module.
The intra-frame encoder circuit 17-1 encodes data selected by the prediction selection circuit 15-1 by a compression method utilizing intra-frame correlation such as DCT (Discrete Fourier Transform) to output high-definition encoded data (MPEG-2).
The local decoder circuit 18-1 decodes an I or P frame in the encoded data to generate a reference frame Fr to be used for next prediction.
The frame memory 12-2 stores a past or future reference frame Fr′.
The forward prediction circuit 13-2 performs forward prediction through motion compensation between the an output F′ of the size conversion circuit 25 and the reference frame Fr′ in accordance with a motion vector calculated by the vector calculator 21 to thereby generate difference data ΔP′.
The bidirectional prediction circuit 14-2 performs bidirectional prediction through motion compensation between the output F′ of the size conversion circuit 25 and the reference frame Fr′ in accordance with the motion vector calculated by the motion vector calculator 21 to thereby generate difference data ΔB′. The prediction selection circuit 15-2 selects one of the input moving picture data F′ itself, forward predicted difference data ΔP′ and bidirectionally predicted difference data ΔB′ in accordance with an instruction from the prediction mode control circuit 16.
The prediction mode control circuit 16 controls the prediction mode of the prediction selection circuit 15-2 in such a manner that the encoding prediction mode of the first encoding module becomes coincident with the encoding prediction mode of the second encoding module.
The intra-frame encoder circuit 17-2 encodes data selected by the prediction selection circuit 15-2 by a compression method utilizing intra-frame correlation such as DCT to output low-definition encoded data (MPEG-4).
The local decoder circuit 18-2 decodes an I or P frame in the encoded data to generate a reference frame Fr′ to be used for next prediction.
The motion vector calculator 21 calculates a motion vector to be used after conversion by the second encoding module, by using the motion vector for forward prediction obtained by the motion vector estimator 11.
The size conversion circuit 25 reduces the size of the moving picture data F input from the moving picture input terminal T1 so as to match MPEG-4.
The moving picture input terminal T1 receives the moving picture data F.
The high-definition encoded data output terminal T2 is used for outputting high-definition encoded data (MPEG-2) encoded by the intra-frame encoding circuit 17-1.
The low-definition encoded data output terminal T3 is used for outputting low-definition encoded data (MPEG-4) encoded by the intra-frame encoding circuit 17-2.
The first encoding module constitutes an encoder of MPEG-2, whereas the second encoding module constitutes an encoder of MPEG-4. The encoder of MPEG-4 is provided with the size conversion circuit. This embodiment is characterized in that both of the prediction modes are made coincident and that the motion vector of MPEG-4 is calculated from the motion vector estimated by MPEG-2.
By making coincident both the prediction modes of the first and second encoding modules, it is possible to allow the encoder of MPEG-4 to use the motion vector estimated by MPEG-2. It is not necessary for the encoder of MPEG-4 to estimate the motion vector. The computation amount can therefore be reduced considerably.
The structure and operation of a moving picture encoding apparatus shown in
The motion vector estimator 11 obtains forward or bidirectional motion vector by performing block matching between moving picture data F input to the moving picture input terminal T1 and a past or future reference frame Fr stored in the frame memory 12.
The frame memory 12 stores a past or future reference frame Fr.
The forward prediction circuit 13 performs forward prediction through motion compensation between the input moving picture data F and the reference frame Fr in accordance with the motion vector to thereby generate difference data ΔP.
The bidirectional prediction circuit 14 performs bidirectional prediction through motion compensation between the input moving picture data F and the reference frame Fr in accordance with the motion vector obtained by the motion vector estimator 11 to thereby generate difference data ΔB.
The prediction selection circuit 15 selects one of the input moving picture data F itself, forward predicted difference data ΔP and bidirectionally predicted difference data ΔB in accordance with an instruction from the prediction mode control circuit 16. Namely, the prediction selection circuit 15 outputs picture data after motion compensation.
The prediction mode control circuit 16 controls the prediction mode of the prediction selection circuit 15 and the frame extraction circuit 19 in such a manner that the encoding prediction mode of the first encoding module becomes coincident with the encoding prediction mode of the second encoding module.
The intra-frame encoder circuit 17 encodes data selected by the prediction selection circuit 15 by a compression method utilizing intra-frame correlation such as DCT (Discrete Fourier Transform) to output high-definition encoded data (MPEG-2).
The local decoder circuit 18 decodes an I or P frame in the encoded data to generate a reference frame Fr to be used for next prediction.
In response to a control signal from the prediction mode control circuit 16, the frame extraction circuit 19 extracts image data or DCT coefficients of the I and P frame in high-definition data under encoding, as shown in the lower row in
The transcoder circuit 20 converts encoded data of the I and P frames into encoded data having a small image size by using the motion vector calculated by the motion vector calculator 21. Namely, this circuit changes a resolution. In the transcoder circuit 20, image data after motion compensation is subjected to resolution conversion and thereafter encoded by a compression method utilizing inter-frame correlation such as DCT, or alternatively coefficient data after DCT is directly converted to coefficient data after resolution conversion to encode the data.
The motion vector calculator 21 calculates motion vector for transcoding at the transcoder circuit 20 by using the motion vector for forward prediction obtained by the motion vector estimator 11.
The moving picture input terminal T1 receives the moving picture data F.
The high-definition encoded data output terminal T2 is used for outputting high-definition encoded data (MPEG-2) encoded by the intra-frame encoding circuit 17.
The low-definition encoded data output terminal T3 is used for outputting low-definition encoded data (MPEG-4) transformed by the transcoder circuit 20.
The operation of the moving picture encoding apparatus 1 of the invention will be described. The motion vector estimator 11 obtains forward or bidirectional motion vector through block matching between moving picture data F input to the moving picture input terminal T1 and the past or future reference frame Fr stored in the frame memory 12, and sends it to the forward prediction circuit 13 or bidirectional prediction circuit 14.
The forward prediction circuit 13 performs forward prediction through motion compensation between the input moving picture data F and the reference frame Fr in accordance with the motion vector to generate the difference data ΔP. The bidirectional prediction circuit 14 performs bidirectional prediction through motion compensation between the input moving picture data F and the reference frame Fr in accordance with the motion vector to generate the difference data ΔB. In response to an instruction from the prediction mode control circuit 16, the prediction selection circuit 15 selects one of the input moving picture data F itself, forward predicted difference ΔP and bidirectionally predicted difference ΔB and sends the selected one to the intra-frame encoding circuit 17. The intra-frame encoding circuit 17 encodes the selected data by a compression method utilizing intra-frame correlation such as DCT to generate high-definition encoded data (MPEG-2) which is output from the high-definition encoded data output terminal T2.
In this embodiment, the control of the prediction mode for encoding (prediction mode) is intended to include both a frame type selection control for controlling which one of the I/P/B frames is to be selected as a frame to be encoded and a macro block mode selection control for controlling which one of intra/inter is to be selected for each macro block. Also in this embodiment, the process starting from the input terminal T1 to the prediction selection circuit 15 is called motion compensation.
The control of the encoding prediction mode is performed so that the pattern such as shown in the middle row of
(1) A frame 12 is encoded by using only the frame F2.
(2) A frame B0 is encoded by using the frame F0 and a reference frame (hereinafter the reference frame is indicated by a broken line) Fr2 decoded from the I2 frame.
(3) A frame B1 is encoded by using the frame F1 and the reference frame Fr2 decoded from the i2 frame.
(4) A frame P5 is encoded by using the frame F5 and the reference frame Fr2 decoded from the I2 frame.
(5) A frame B3 is encoded by using the frame F3 and the reference frames Fr2 and Fr5 decoded from the I2 P5 frames.
(6) A frame B4 is encoded by using the frame F4 and the reference frames Fr2 and Fr5 decoded from the I2 P5 frames.
(7) A frame P8 is encoded by using the frame F8 and the reference frame Fr5 decoded from the P5 frame.
(8) A frame B6 is encoded by using the frame F6 and the reference frames Fr5 and Fr8 decoded from the P5 P8 frames.
(9) A frame B7 is encoded by using the frame F7 and the reference frames Fr5 and Fr8 decoded from the P5 and P8 frames.
(10) A frame P11 is encoded by using the frame F11 and the reference frame Fr8 decoded from the P8 frame.
(11) A frame B9 is encoded by using the frame F9 and the reference frames Fr8 and Fr11 decoded from the P8 and P11 frames.
(12) A frame B10 is encoded by using the frame F11 and the reference frames Fr8 and Fr11 decoded from the P8 and P11 frames.
Encoding is performed thereafter in a similar manner by forward and bidirectional predictions.
The local decoder circuit 18 decodes the I and P frames in the encoded data and stores it in the frame memory 12 as the reference frame Fr to be used for the next prediction.
Next, the operation of low-definition encoding will be described. In response to a control signal from the prediction control circuit 16, the frame extraction circuit 19 extracts data of the I and P frames from the high-definition encoded data under encoding and sends it to the transcoder circuit 20.
The transcoder circuit 20 converts the encoded data of the I and P frames into encoded data (MPEG-4) having a smaller image size and outputs it from the low-definition encoded data output terminal T3. In this case, the motion vector calculator 21 calculates the motion vector after conversion by using the motion vector for forward prediction obtained by the motion vector estimator 11.
With the above operations, since the same prediction mode is used for the high-definition encoding and low-definition encoding, it is not necessary to perform motion vector estimation for low-definition encoding. Since the computation amount can be reduced, both the high-definition and low-definition data can be generated at the same time with a small circuit scale and a small consumption power.
Next, the control of a macro block mode by the prediction selection circuit will be described with reference to
The frame mode selection circuit 151 selects one of the input data F, ΔP and ΔBm in accordance with which one of the frames I/P/B is selected. If the I frame is selected, the input data F is selected. If the P frame is selected, the forward prediction difference ΔP is selected.
If the B frame is selected, the intra/inter judgement circuit 152 judges whether it is more efficient to encode either the moving picture data F itself or the bidirectional prediction difference ΔB, both incoming at each micro block which is the encoding unit. In accordance with the judgement result, the macro block selection circuit 153 selects the moving picture data F or difference ΔB for each macro block and outputs difference data ΔBm selected for each macro block. This judgement for each macro block is not performed for the P frame.
The state of the intra (encoding of moving picture itself)/inter (encoding of prediction difference value) of a micro block before and after encoding of each frame will be described with reference to
If the macro block mode of the P frame is performed only by the inter scheme, an encoding efficiency and an image quality may be lowered when an abrupt picture change such as a scene change occurs.
Next, the embodiment dealing with such a case will be described with reference to the block diagram of
The image quality deterioration detection circuit 22 receives information representative of quantization coarseness or the like having a high correlation with the image quality from the intra-frame encoding circuit 17, monitors this information to detect an image quality deterioration of a P frame to be caused by a scene change or the like, and issues a command at the next P frame to the frame unit macro block mode selection circuit 154.
The frame unit macro block mode selection circuit 154 selects, during the next frame which received the command, the input moving picture data F itself (intra micro blocks) in place of the forward prediction difference data ΔP. Therefore, even if the image quality is deteriorated by the scene change, the efficiency is improved in the next P frame with intra macro blocks so that the image quality can be recovered.
Next, another embodiment will be described with reference to
The motion vector comparison circuit 24 compares the selected motion vector with a plurality of motion vectors, and if there is a large difference, issues a command to the difference value invalidating circuit 23. Upon reception of this command, the difference value invalidating circuit 23 replaces the difference value components corresponding to the motion vector with a value of 0. This replacement state is illustrated in
Therefore, although there is some deviation from an original image, thee is no image quality deterioration such as large noises to be caused by different difference data. It is therefore unnecessary to perform again motion compensation prediction also for the image portion with different motion vectors. The computation amount can therefore be reduced, and both the high-definition and low-definition data can be generated at the same time with a small circuit scale and a small consumption power.
With reference to the block diagram shown in
The reproducing apparatus is constituted of a reproducing circuit 101, a frame memory 52, a forward prediction circuit 53, a bidirectional prediction circuit 54, a prediction selection circuit 55, a prediction mode detection circuit 56, an intra-frame decoding circuit 57, a frame extraction circuit 19, a transcoder circuit 20, a motion vector calculator 21, a low-definition encoded data output terminal T3, and a moving picture data output terminal T4.
The reproducing circuit 101 reproduces high-definition encoded data (MPEG-2) from the storage medium not shown.
The frame memory 52 stores data (I/P/B frame) selected by the prediction selection circuit 55 as a next reference frame Fr.
The forward prediction circuit 53 performs forward prediction through motion compensation by the reference frame Fr in accordance with the motion vector contained in the data decoded by the intra-frame decoding circuit 57, and adds the difference value ΔP to recover the original data (P frame).
The bidirectional prediction circuit 54 performs bidirectional prediction through motion compensation by the reference frame Fr in accordance with the motion vector contained in the data decoded by the intra-frame decoding circuit 57, and adds the difference value ΔB to recover the original data (B frame).
The prediction selection circuit 55 selects one of the decoded moving picture data (I frame) itself, data (P frame) recovered by forward prediction and data (B frame) recovered by bidirectional prediction, in accordance with I/P/B information.
The prediction mode detection circuit 56 detects I/P/B information in accordance with prediction mode information decoded by the intra-frame decoding circuit 57.
The intra-frame decoding circuit 57 decodes high-definition encoded data reproduced by the reproducing circuit 101 to generate the moving picture data (I frame) itself, prediction difference value ΔP or ΔB. The intra-frame decoding circuit 57 also decodes I/P/B prediction mode information and a motion vector value.
The frame extraction circuit 19 extracts I or P frame data from high-definition encoded data under decoding as shown in the lower row in
The transcoder circuit 20 converts I and P frame encoded data into low-definition encoded data (MPEG-4) having a smaller image size.
The motion vector calculator 21 calculates motion vector after conversion by using a forward prediction motion vector.
The low-definition encoded data output terminal T3 is used for outputting low-definition encoded data (MPEG-4).
The moving picture data output terminal T4 is used for outputting data (I/P/B frame) selected by the prediction selection circuit 55.
Next, the reproduction operation will be described. The intra-frame decoding circuit 57 decodes the high-definition encoded data (MPEG-2) reproduced from the storage medium by the reproducing circuit 101 to generate the moving picture data (I frame) itself, prediction difference value ΔP or ΔB. The intra-frame decoding circuit 57 also decodes the I/P/B prediction mode information and a motion vector value.
The forward prediction circuit 53 performs forward prediction through motion compensation by the reference frame Fr in accordance with the motion vector, and adds the difference value ΔP to recover the original data (P frame). The bidirectional prediction circuit 54 performs bidirectional prediction through motion compensation by the reference frame Fr in accordance with the motion vector, and adds the difference value ΔB to recover the original data (B frame).
The prediction selection circuit 55 selects one of the decoded moving picture data (I frame) itself, the data (P frame) recovered by forward prediction and the data (B frame) recovered by bidirectional prediction, in accordance with the I/P/B information detected by the prediction mode detection circuit 56. The selected data is output from the moving picture data output terminal T4, and stored in the frame memory 52 as the next reference frame.
Next, conversion into low-definition encoded data will be described with reference to
With the above operations, since the same prediction mode is used for the high-definition encoding and low-definition encoding, it is not necessary to perform vector estimation for low-definition encoding. Since the computation amount can be reduced, the low-definition data can be converted from the high-definition data, with a small circuit scale and a small consumption power.
Next, the control of a macro block mode during the reproduction will be described with reference to
The frame mode selection circuit 551 selects data in accordance with I/P/B information.
The macro block mode selection circuits 552 and 553 select the I frame information, forward prediction data ΔP or bidirectional prediction data ΔB decoded by the intra-frame decoding circuit 57, in accordance with intra/inter information which is attribute information of each macro block. Data output from the macro block mode selection circuit 552 is represented by Pm, and data output from the macro mode selection circuit 553 is represented by Bm.
The frame mode selection circuit 551 selects data in accordance with I/P/B information. The intra-frame decoding circuit 57 decodes the intra/inter information of each macro block, and in accordance with the decoded information, the macro block mode selection circuits 552 and 553 select data.
The detailed block diagram of the prediction selection circuit 15 of the recording apparatus is the same as that shown in
In
Next, another embodiment will be described with reference to
The motion vector comparison circuit 24 compares the selected motion vector with a plurality of motion vectors, and if there is a large difference, issues a command to the difference value invalidating circuit 23. Upon reception of this command, the difference value invalidating circuit 23 replaces the difference value components corresponding to the motion vector with a value of 0. This replacement state is illustrated in
The image replaced with 0 after transcoding is filled with the reference image data subjected to motion compensation by the same motion vector as nearby motion vectors. Therefore, although there is some deviation from an original image, there is no image quality deterioration such as large noises to be caused by different difference data. It is therefore unnecessary to perform again motion compensation prediction also for the image portion with different motion vectors. The computation amount can therefore be reduced, and both the high-definition and low-definition data can be generated at the same time with a small circuit scale and a small consumption power.
As described so far in each embodiment, in encoding of MPEG-4, the motion vector estimation is not performed. A half of the consumption power is occupied by the motion vector estimation. According to each embodiment of the invention, the power consumption of MPEG-4 can be halved. For example, in dual encoding of MPEG-2 and MPEG-4, the consumption power of MPEG-4 is about one fifth of the total power consumption. Since the consumption power of MPEG-4 is halved, the total consumption power can be reduced by about one tenth.
According to the invention, it is possible to generate both high and low-definition encoded data at the same time with a small circuit scale and with a small power consumption and to convert high-definition encoded data into low-definition encoded data.
While we have shown and described several embodiments in accordance with our invention, it should by understood that disclosed embodiments are susceptible of changes and modifications without departing from the scope of the invention. Therefore, we do not intend to be bound by the details shown and described herein but intend to cover all such changes and modifications within the ambit of the appended claims.
Claims
1. A moving picture encoding apparatus for encoding a moving picture by utilizing motion-compensated inter-frame prediction, comprising:
- a first encoding module for encoding the moving picture at a first frame rate and at a first image size;
- a second encoding module for encoding the moving picture at a second frame rate and at a second image size;
- a motion vector calculation module for calculating a motion vector to be used by said second encoding module from a motion vector to be used by said first encoding module; and
- a prediction mode control module for controlling to make a prediction mode of said first encoding module be coincident with a prediction mode of said second encoding module, so that said motion vector calculated by said motion vector calculation module can be used by said second encoding module.
2. A moving picture encoding method of encoding a moving picture by utilizing motion-compensated inter-frame prediction, comprising:
- a first encoding step of encoding the moving picture at a first frame rate and at a first image size;
- a second encoding step of encoding the moving picture at a second frame rate and at a second image size;
- a motion vector calculation step of calculating a motion vector to be used by said second encoding step from a motion vector to be used by said first encoding step; and
- a prediction mode control step of controlling to make a prediction mode of said first encoding step be coincident with a prediction mode of said second encoding step, so that said motion vector calculated by said motion vector calculation step can be used by said second encoding step.
3. A moving picture encoding apparatus for encoding a moving picture by utilizing motion-compensated inter-frame prediction, comprising:
- a first encoding module for encoding the moving picture at a first frame rate and at a first image size;
- a second encoding module for encoding the moving picture at a second frame rate and at a second image size;
- a motion vector calculation module for calculating a second motion vector to be used by said second encoding module from a first motion vector to be used by said first encoding module; and
- a prediction mode control module for controlling in such a manner that a reference frame of the second motion vector calculated by said motion vector calculation module becomes correspondent with a reference frame of the first motion vector of said second encoding module.
Type: Application
Filed: Aug 20, 2007
Publication Date: Dec 27, 2007
Applicant: Hitachi, Ltd. (Tokyo)
Inventors: Masaru Takahashi (Yokohama), Taku Nakamura (Yokohama)
Application Number: 11/841,112
International Classification: H04N 7/12 (20060101);