The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention, and together with the general description given above and the detailed description of the embodiments given below, serve to explain the principles of the invention.
An embodiment of this invention will be described with reference to the accompanying drawings.
As shown in
In the present embodiment, propagation of an error occurring in a neighboring MB is prevented by performing a slice dividing process so as to set a refresh MB to a head MB. Further, in the present embodiment, a deteriorating the coding efficiency is prevented by performing the intra prediction process by using an inter MB other than the refresh MB as a reference MB. Since it is assumed that the present embodiment is applied to H.264/AVC, the intra prediction unit 13 can perform the intra prediction process in the block unit of 4×4 pixels, and particularly, the intra prediction process in the macro block unit of 16×16 pixels.
When a video signal 101 of an original image is input in the frame unit to the video encoder, a residual signal 102 between the video signal 101 and a prediction image signal 111 is generated by the residual signal calculating unit 1. One of an intra prediction signal 109 output from the intra prediction unit 13 and an inter prediction image signal 108 output from the inter prediction unit 8 is selected as a prediction image signal 111 by the prediction selecting unit 10. Prediction in a case where a pixel used for prediction belongs to the same frame as that of a to-be-coded pixel is called intra prediction and prediction in a case where the pixel belongs to a different frame is called inter prediction.
The DCT/quantization unit 2 subjects a residual signal 102 to DCT and quantization and outputs a quantized transform coefficient signal 103. The quantized transform coefficient signal 103 is input to the encoding unit 3 and IDCT/inverse quantization unit 4. The IDCT/inverse quantization unit 4 subjects the quantized transform coefficient signal 103 to inverse quantization and IDCT, generates a decoded signal 104 and outputs the same to the decoder unit 5.
The decoding unit 5 generates a decoded image signal 105 corresponding to the input video signal 101 by adding the decoded signal 104 of the residual signal 102 and the prediction image signal 111 and outputs the decoded image signal 105 to the deblocking filter 6. The deblocking filter 6 is a factor inherent to H.264/AVC and adaptively filters the decoded image signal 105 according to the rate of occurrence of distortion in order to reduce occurrence of block distortion. A decoded image signal 106 obtained after the filtering process is stored as a reference image signal in the reference frame memory 7. That is, the reference frame memory 7 sequentially stores image signals corresponding to a plurality of frames lying before and after the to-be-coded frame of the video signal 101 as reference image signals.
The motion vector detecting unit 9 reads out a reference image signal 107 from the reference frame memory 7 and detects a motion vector 110 in the macro block unit. In general, since a motion vector of a certain block (a target block) has strong correlation with respect to motion vectors of surrounding blocks, it can be predicted based on the surrounding blocks. A coding amount is reduced by encoding a difference vector between the motion vector of the target block and the prediction vector predicted based on the surrounding blocks. In H.264/AVC, the median of the motion vectors of the surrounding blocks is used as a prediction vector. Further, in H.264/AVC, variable block-size motion compensation and motion compensation for plural reference images are used.
The inter prediction unit 8 makes an inter prediction by subjecting the reference image signal to motion compensation by use of the motion vector 110 detected by the motion vector detecting unit 9 and generates a prediction image signal/evaluation value 108. The evaluation value expresses the degree of similarity between the reference image signal and the motion image signal. For example, the sum of square difference (SSD) and the sum of absolute difference (SAD) between the reference image signal and the motion image signal are generally used. The prediction image signal/evaluation value 108 is output to the prediction selecting unit 10.
The refresh control unit 11 determines the insertion position of the refresh MB and outputs the position information as refresh information 112 to the slice control unit 12. The slice control unit 12 makes slice division based on the refresh information 112 and outputs slice information 113 indicating that a slice to which the to-be-processed MB belongs is changed to the encoding unit 3, prediction selecting unit 10 and intra prediction unit 13. The intra prediction unit 13 makes an intra prediction in the slice to which the to-be-processed MB belongs by using a head MB as the refresh MB based on the slice information 113.
When receiving the slice information 113 from the slice control unit 12, the encoding unit 3 generates and encodes a slice header by use of a head MB of a new slice and outputs coded data 114 of the input video signal.
When detecting that the slice to which the to-be-processed MB belongs is changed based on the slice information 113, that is, the to-be-processed MB is a refresh MB, the prediction selecting unit 10 preferentially selects an intra prediction image signal 109 subjected to intra prediction by the intra prediction unit 13. If the to-be-processed MB is not a refresh MB, the prediction selecting unit 10 may compare an evaluation value 109 from the intra prediction unit 13 with an evaluation value 108 from the inter prediction unit 8 and select a candidate prediction image signal having a larger evaluation value.
As described above, in the video encoder according to the present embodiment, attention is paid to the fact that an MB outside the slice cannot be referred to in intra prediction of H.264 and slice division is made to cause the refresh MB to become a head MB of each slice as shown in
Next, a flow of a sequence of processes by the video encoder according to the present embodiment of this invention is explained in more detail with reference to the flowchart of
First, the operation of initializing various variables and flags are performed (step S1). Specifically, “0” is set into a variable: MbAdd which indicates an address of a to-be-processed MB and “FALSE” (indicating that the MB is not a refresh MB) is set into a flag: refreshFlag which indicates whether the MB is a refresh MB or not.
Then, the encoding unit 3 generates and encodes a slice header and outputs coded data 114 of an input video signal 101(step S2). The slice header is always required for the head MB of the slice.
Next, whether the to-be-processed MB is a refresh start MB or not is determined (step S3). Specifically, if the variable: MbAdd is equal to a variable: RefreshMbAdd indicating an address of the refresh start MB (the determination result of S3 is “Yes”), the process proceeds to the step S4, and if not (the determination result of S3 is “No”), the process proceeds to the step S6.
In the step S4, “TRUE” (indicating that the MB is a refresh MB) is set into the flag: refreshFlag and “0” is set into a counter: countRefreshMB of the refresh MB. Then, slice division is made, the slice header is generated and encoded and the coded data 114 of the input video signal is output (step S5). After this, whether the to-be-processed MB is a refresh MB or not is determined (step S6). Specifically, the state of the flag: refreshFlag is detected and if refreshFlag is “TRUE” (the determination result of S6 is “Yes”), the process proceeds to the step S7, and if not (the determination result of S6 is “No”), the process proceeds to the step S11.
In the step S7, an intra prediction is made by the intra prediction unit 13 with respect to an MB corresponding to the to-be-processed MB which is determined to be a refresh MB in the step S6. Next, the value of the counter: countRefreshMB is incremented by one (step S8). Then, whether a variable: numRefreshMb indicating the number of refresh MBs in a slice is smaller than the value of the counter: countRefreshMb or not is determined (step S9). Specifically, if the variable: numRefreshMb is smaller than the value of the counter: countRefreshMb (the determination result of S9 is “Yes”), the process proceeds to the step S10, and if not (the determination result of S9 is “No”), the process proceeds to the step S14.
In the step S10, “FALSE” is set into the flag: refreshFlag and the process proceeds to the step S14. That is, the loop of the refresh process (step S3→step S6→step S9→step S14→step S15→step S3) is repeated by the preset number: numRefreshMb of refresh MBs and then the flag: refreshFlag is set to “FALSE” in the present step.
In the step S11, the intra prediction unit 13 makes an intra prediction to generate an intra prediction image signal 109. Next, the inter prediction unit 8 makes an inter prediction to generate an inter prediction image signal 108 (step S12). Then, the prediction selecting unit 10 selects one of the intra prediction image signal 109 created in the step S11 and the inter prediction image signal 108 generated in the step S12 as a prediction image signal 111 and the process proceeds to the step S14 (step S13).
In the step S14, the variable: MbAdd is incremented by one in order to change the to-be-processed MB to a next MB. Then, whether the variable: numMB indicating the number of MBs in the frame is smaller than the variable: MbAdd or not is determined (step S15). Specifically, if the variable: numMB is smaller than the variable: MbAdd (the determination result of S15 is “Yes”), the process proceeds to the step S16, and if not (the determination result of S15 is “No”), the process returns to the step S3. That is, the above process (steps S3 to S14) is repeatedly performed for all of the MBs of the processing unit (one frame).
In the step S16, the starting position of the refresh MB is updated. Specifically, the updating process is performed by adding the variable: numRefreshMB to a variable: RefreshMBAdd. When a sequence of processes is thus ended, the same process is performed for a next frame (step S17).
As described above, in the video encoder according to the present embodiment of this invention, the refresh control unit 11 determines an insertion position of the refresh MB and deals with the position information as refresh information 112, and the slice control unit 12 makes slice division to cause the refresh MB to become a head MB of each slice based on the refresh information 112 and generates slice information 113 indicating a slice to which a to-be-processed MB belongs is changed. Further, the intra prediction unit 13 makes an intra prediction in a slice to which a to-be-processed MB belongs based on the slice information 113. Also, when it is detected that a to-be-processed MB is a refresh MB based on the slice information 113, the prediction selecting unit 10 preferentially selects an intra prediction.
Upon transmission, a microphone 58 detects a sound made by a user as a sound signal. A preamplifier 59 amplifies the sound signal. Then, the sound codec 55 digitalizes the amplified signal and compresses the digitalized signal in accordance with a predetermined sound coding system to obtain transmitted sound data. The transmitted sound data is input to the CDMA codec 54. The CDMA codec 54 then subjects the data to spreading and orthogonal modulation. A transmitting unit 53 then subjects the orthogonal modulated signal thus obtained to a digital-analog conversion and a frequency conversion (up convert) to convert it into an RF signal. The power amplifier then amplifies the RF signal and supplies the amplified signal to the antenna 50 via the duplexer 51. As a result, the RF signal is radiated to the air as an electric wave and transmitted to the base station.
A control unit 60 consisting of a central processing unit (CPU) controls each unit, performs various mathematical operations, and processes video and text information. The control unit 60 connects not only to the CDMA codec 54 and sound codec 55 but also to a key input unit 61, a display 62, a video codec 63, and a camera (imaging device) 64. Each unit is supplied with power from a battery (not shown) under the control of the control unit 60.
The video codec 63 conforms to H.264/AVC and includes the video encoder shown in
If the received data is a compressed motion picture signal, the CDAM codec 54 converts the received data into a coded bit stream. The coded bit stream is input to the video decoder. The video decoder decodes the coded bit stream to generate a motion picture signal. The motion picture signal generated by the video decoder is supplied to the display 62 under the control of the control unit 60. Consequently, the display 62 shows the signal as an image.
The CPU of the control unit 60 uses software to execute a part of the processing required for the video encoder (for example, determination of a prediction mode) and a part of the processing required for the video decoder.
Additional advantages and modifications will readily occur to those skilled in the art. Therefore, the invention in its broader aspects is not limited to the specific details and representative embodiments shown and described herein. Accordingly, various modifications may be made without departing from the spirit or scope of the general inventive concept as defined by the appended claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
2006-187168 | Jul 2006 | JP | national |