WO1999038262A1 - Variable-length encoder - Google Patents

Variable-length encoder Download PDF

Info

Publication number
WO1999038262A1
WO1999038262A1 PCT/JP1999/000201 JP9900201W WO9938262A1 WO 1999038262 A1 WO1999038262 A1 WO 1999038262A1 JP 9900201 W JP9900201 W JP 9900201W WO 9938262 A1 WO9938262 A1 WO 9938262A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
image
code
picture
variable
Prior art date
Application number
PCT/JP1999/000201
Other languages
English (en)
French (fr)
Inventor
Akihiro Watabe
Eiji Miyagoshi
Original Assignee
Matsushita Electric Industrial Co., Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co., Ltd. filed Critical Matsushita Electric Industrial Co., Ltd.
Priority to US09/600,573 priority Critical patent/US6741651B1/en
Priority to EP99901125A priority patent/EP1058391A4/en
Priority to JP2000529040A priority patent/JP3416649B2/ja
Publication of WO1999038262A1 publication Critical patent/WO1999038262A1/ja

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/40Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/15Data rate or code amount at the encoder output by monitoring actual compressed data size at the memory before deciding storage at the transmission buffer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/577Motion compensation with bidirectional frame interpolation, i.e. using B-pictures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/587Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal sub-sampling or interpolation, e.g. decimation or subsequent interpolation of pictures in a video sequence
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Definitions

  • the present invention relates to a variable length coding device used in data compression processing.
  • a typical application of the conventional variable-length coding device is a compression processing power S of moving image data.
  • the Moving Picture Experts Group (MPEG), an international standard for video compression, performs differential processing involving DCT (discrete cosine transform), quantization, and motion compensation.
  • DCT discrete cosine transform
  • quantization quantization
  • motion compensation motion compensation based on a unit consisting of 16 vertical and 16 horizontal pixels called a macroblock.
  • variable-length coding is performed, but since variable-length coding reduces the code length stochastically, the amount of coded bits does not always decrease, and image data and video data The amount of coded bits fluctuates depending on the difficulty of coding the picture, such as motion of the picture.
  • the variation in the amount of generated bits is defined by the buffer model of the decoder. Specifically, there is an input buffer in the ideal decoder specified by the standard, and it is specified that this input buffer must not overflow or underflow in real-time decoding. Therefore, the encoder is allowed to fluctuate in the amount of generated bits as much as the capacity of the input buffer of the decoder. Conversely, encoders must ensure that this restriction is respected. Must.
  • rate control As described above, in M PEG, encoding is performed using a variable-length code, but the amount of generated bits must be limited. Generally, this method is called rate control. For such a rate control, for example, as disclosed in Japanese Patent Application Laid-Open No. 7-10747, a method of changing the step at the time of normal quantization is known. Further, as a method of controlling the amount of generated bits after performing variable-length coding, a method disclosed in Japanese Patent Application Laid-Open No. 6-14314 is known.
  • the amount of coded bit generation is expected to decrease, but the actual amount of coded bit generation is unknown until coding is performed.
  • the code amount cannot be accurately predicted, there is a problem that the control method using the quantization step lacks certainty.
  • the upper limit of the amount of coded bits must be reliably suppressed by assuming a situation that seems to be very infrequent even by changing the quantization step in units of macro blocks. Therefore, there is a problem that the image quality is deteriorated even for data that would normally be possible to obtain high image quality.
  • it is almost impossible to re-encode processing such as further optimization by referring to the results of encoding so such safety measures must be taken. Image quality was degraded.
  • variable-length coding apparatus comprising: a variable-length coding unit configured to perform variable-length coding on input data for each processing unit; Buffering means for temporarily storing variable-length coded data; and a code generation amount prepared in advance according to a code generation amount per processing unit of the variable-length coded data stored in the buffering means. It is characterized by comprising code replacement processing means for replacing with a shorter code.
  • the code generation amount per processing unit is reduced by replacing the code generation amount per processing unit with a shorter code as necessary, and the upper limit of the code generation amount is ensured. Can be restricted, and the code generation amount can be suppressed within a predetermined range.
  • variable-length encoding device includes a unit that sets an upper limit value of a code generation amount per processing unit of the input data, the code replacement processing unit, and a variable-length encoding stored in the buffering unit.
  • the upper limit of the code generation amount per processing unit can be set flexibly.As a result of variable-length coding, the code whose generation amount of coded bits per processing unit exceeds the upper limit value is replaced with a shorter code. As a result, the code amount per processing unit can be reliably restricted within the upper limit.
  • the input is data obtained by performing intra-frame compression processing or inter-frame compression processing of moving image data
  • the processing unit is data per picture of moving image data
  • the present invention can be applied to variable-length encoding processing in the process of compressing moving image data, and can be used for variable-length encoding processing of moving image compression processing devices such as MPEG and H.261.
  • the short code prepared in advance to be replaced by the code replacement processing unit is one that can obtain the same decoding result as the replacement processed data of the processing unit already processed by the code replacement processing unit.
  • the image becomes the same as the already decoded image, so that the image quality does not deteriorate.
  • the code replacement processing unit sets the short code prepared in advance to be replaced, and sets the shortest forward intraframe coded image picture in time series.
  • the same decoding result can be obtained as any of the following: forward, closest forward-predicted coded picture, forward-closed intra-frame coded picture, or rear-most likely forward-predicted coded picture. It is preferable to select the data to be obtained.
  • the bidirectional predictive coded image picture data that needs to be replaced is a picture before and after a temporally adjacent picture, It can be replaced with image data that fits in the raw volume, and it is possible to obtain data that does not cause discomfort when decoded as a moving image.
  • the code replacement processing means sets the short code prepared in advance to be replaced as a short code in the time series, and is the closest in-frame coded image picture ahead in time sequence.
  • the data which can obtain the same decoding result as any one of the forward predictive coded image pictures closest to the front, and the forward predictive coded image picture subsequent to the forward predictive coded image picture which is the input data is Preferably, the selected forward picture picture is referred to.
  • the forward predictive coded image picture that needs to be replaced can be replaced with image data that is an adjacent forward picture and falls within a predetermined code generation amount, and is decoded as a moving image. Data without discomfort can be obtained.
  • the replaced forward prediction coded image picture is referred to by another image picture. It is not used for processing and no problems occur.
  • FIG. 1 is a block diagram of an MPEG encoding device according to an embodiment of the present invention.
  • FIG. 2 is a block diagram showing details of the encoder unit 106 of FIG.
  • FIG. 3 is a flowchart of a processing operation of the control unit 107.
  • FIG. 4 is a diagram showing how data is written to the external memory 101.
  • FIG. 5 is a diagram illustrating the replacement pattern 1.
  • FIG. 6 is a diagram illustrating the replacement pattern 2.
  • FIG. 7 is a diagram illustrating another replacement pattern 2.
  • FIG. 8 is a diagram illustrating the replacement pattern 3.
  • variable length coding device of the present invention is applied to an M PEG encoder.
  • FIG. 1 is a block diagram of an MPEG encoder according to the present embodiment. As shown in FIG. 1, it is composed of an external memory 101 and an encoder 102.
  • the encoder 102 further includes an external memory interface 103, an image input interface 104, a code output interface 105, an encoder 106, and a controller 107.
  • the encoding unit 106 corresponds to the variable length coding unit
  • the external memory 101 corresponds to the buffering unit
  • the code replacement processing unit is executed under the control of the control unit 107 as described later.
  • the processing unit is an image picture
  • the picture types are I picture (compressed coded image within a frame), P picture (forward predicted coded image), B picture (bidirectional coded image). (Directional prediction coded image).
  • the external memory 101 serves as a buffer for holding reference image data and outputting a bit stream subjected to encoding processing at a constant bit rate.
  • the external memory interface 103 arbitrates the image input interface 104, the code output interface 105, the encoding unit 106, the write and read requests from multiple blocks, and Executes data input / output with external memory.
  • the image input interface 104 receives the input image 110 from the outside, performs filtering, etc., and stores the input image data 110 via the external memory interface 103 into the external memory. Write to the specified address of 101.
  • the written image data is referred to as source image data.
  • the encoder unit 106 reads image data from the external memory 101, executes an encoding process, and writes the encoded data to the external memory 101. At this time, if the control unit 107 determines that the code generation amount of the encoded data is equal to or more than the set upper limit value as described later, the replacement process is executed, and the replaced data is written to the external memory 101. It is. The detailed operation will be described later.
  • the write pointer 1 21 is a pointer for indicating the address of the written data on the external memory 101, and the write pointer 1 2 1 is increased by the code amount generated in the encoding process. It will be. Also, as described later, the write pointer 122 before the start of the encoding process is passed to the base pointer 124 of the control unit 107, and the write pointer 122 after the encoding process is also controlled by the control unit. Determined whether the amount of generated code of the data passed to 107 and written to the external memory 101 exceeds the upper limit Used for
  • the control unit 107 controls the encoding unit 106 and the code output interface 105, and directly inputs and outputs data to and from the external memory 101 via the external memory interface 103.
  • the upper limit value of the generated code amount to be set is stored in the upper limit value storage area 125, and the replacement process is performed depending on whether the generated code amount after the encoding process by the encoder 106 exceeds the set upper limit value. Judgment of necessity is made, and if it exceeds, the replacement process is executed according to the replacement pattern that takes into account the picture type of the image data and the chronological arrangement.
  • the setting upper limit can be set according to the picture type.
  • the upper limit of B picture type image data is 1 and the upper limit of P picture type image data is ⁇ 2.
  • the base pointer 124 receives and stores the initial value of the write pointer 121 of the encoder 106 before executing the encoding process. It is used to calculate the amount of code generated by the encoding process based on the difference from the light pointer 1221 after the encoding process. Detailed processing operations will be described later.
  • the code output interface 105 internally has a read pointer 122 and a base pointer 123, and outputs an output bitstream 111 according to an external request while comparing the pointers.
  • the lead pointer 122 is a pointer for storing the address of the external memory 101 from which the bit stream has been output
  • the base pointer 122 is used for encoding and replacement processing. This is a pointer for storing the address of the external memory 101 of the data that can be output and output. The detailed operation of the output process will be described later.
  • the encode unit 106 includes an address generation unit 221, which generates an address for reading and writing the processed image data from / to the external memory 101.
  • the outgoing dress generation unit 221 holds the write pointer 122 described above.
  • the encoding unit 106 further includes a motion detection unit 202, a difference image generation unit 212, a DCT unit 206, a quantization unit 207, a variable length encoding unit 208, and an inverse quantization unit 2. 09, an inverse DCT section 210, and a motion compensation section 211.
  • Macro block data 201 is macro block data of 16 ⁇ 16 pixels.
  • the motion detection section 202 uses the reference image data 2 12 read from the external memory 101 as a search area and uses the block data of 16 ⁇ 16 pixels in the reference image data 2 12 and the macro data to be processed. It tries to compare it with the mouth data 201 and finds the block data that matches it. Then, a vector representation of the difference between the macroblock data 201 and the position of the obtained block data is output as a motion vector 217 to the difference image generator 213.
  • the difference image generation unit 2 13 is configured to input the macroblock data of the reference image data 2 12 stored in the external memory 101 based on the given motion vector 2 17. A predicted image 219 is generated from the image data corresponding to 210.
  • the difference image generation unit 213 outputs the difference between the macroblock data 201 and the predicted image 219 as a difference image 204 during the inter compression, and actually outputs the difference during the intra compression.
  • the same data as the macro block data 201 is output as the difference image 204 without taking any difference.
  • the difference image generation unit 2 13 outputs the information for determining whether the processing mode is the inter mode or the intra mode and the motion vector 2 17 as the mode information 205. .
  • the DCT processing unit 206 performs the orthogonal transform on the difference image 204. Performs cosine transform and outputs the result.
  • the quantization unit 207 performs quantization on the output of the DCT processing unit 206 and outputs the result as quantized data 216. This quantization removes high-frequency components as a result of the DCT processing and compresses the data amount.
  • the variable-length coding unit 208 variable-length-codes the quantized data 2 16 based on the mode information 205 and the appearance probability of the data, and outputs the result as an output bit stream 2 14.
  • the mode information 205 including the motion vector 217 is encoded in a part of the output bitstream 218. If it is determined that the amount of generated variable-length coded data exceeds the set upper limit ⁇ 1 or ⁇ 2 in the determination of necessity of replacement by the control unit 107 described later, the control unit 107 7 is executed, and in accordance with the replacement pattern signal 230 issued by the control unit 107, the replacement pattern is replaced with the replacement pattern held by the held replacement pattern holding unit 231 and replaced. The subsequent data is output as output bitstreams 2 14.
  • the encoding unit 106 includes a decoding process performed by a decoder to generate the reference frame image data 220 for the next encoding process along with the generation of the output bit stream 214.
  • the same processing is performed by the inverse quantization unit 209, the inverse 0 ⁇ -section unit 210, and the motion compensation unit 211 to prepare data.
  • the inverse quantization unit 209 inversely quantizes the quantized data 2 16.
  • the output of the DCT unit 206 and the output of the inverse quantization unit 209 do not match because the amount of information is reduced in the quantization, which corresponds to the inverse transform of the quantization.
  • the inverse DC ⁇ unit 210 performs an inverse DCT process on the output of the inverse quantization unit 209.
  • the motion compensating unit 211 performs motion compensation based on the mode information 205 and the predicted image 219. Motion compensation is performed when the mode information 205 is Intra mode. Outputs the result of the inverse DCT unit 210 as it is, and outputs the sum of the predicted image 219 and the output of the inverse DC input unit 210 when the mode information 205 is in the inter mode. I do. This corresponds to the opposite operation of the difference image generation unit 2 13.
  • the output of the motion compensator 211 is sent to the address generator 211 as reference image data 220, written to the external memory 101 via the external memory interface 103, and the next-stage macroblock data Used for 201 code processing.
  • the encoding unit 106 encodes the source image data, creates a bitstream that has been replaced as necessary, and writes the result to the external memory 101. Do.
  • the encoder unit 106 includes a motion detection unit 202 and a motion compensation unit according to the three types of picture coding types (I picture, P picture, and B picture) specified by the control unit 107. Change the operation of part 2 1 2.
  • encoding is performed without using information between frames and a reference image, without performing motion compensation, motion detection, and the like, and writes a locally decoded image to the external memory 101. That is, the motion detection unit 202 does not output the motion vector 217, and the difference image generation unit 213 does not use the reference image 221 and always operates in the intra (no motion compensation) mode. Operate.
  • a P-picture In the case of a P-picture, it encodes using only one reference frame image in front of the time series using motion estimation for the reference image, and writes a local decoded image to the external memory 101.
  • the local decoded image is stored in external memory 101 Do not write. That is, the address generation unit 221 does not perform an operation of writing the reference image data 220 into the external memory 101.
  • the address generation unit 221 does not perform an operation of writing the reference image data 220 into the external memory 101.
  • a B-picture type image is not used as a reference image, and there is no need to hold a locally decoded image.
  • the data change operation for the B picture type has no effect on other frame images.
  • I-type and P-type data change operations affect images in other frames.
  • the above is the configuration of the encoding unit 106.
  • FIG. 3 is a processing flow of the variable-length encoding device of the present invention, centering on the processing operation of the control unit 107.
  • FIG. 4 is a diagram showing how data is written to the external memory 101.
  • the input image 110 is written as a source image to the external memory 101 through the image input interface unit 104. This operation operates independently of other blocks. Hereinafter, a description will be given assuming that the source image has already been stored in the external memory 101.
  • control unit 107 executes an initialization process (step 301).
  • the write pointer 12 1 of the encoder 106, the read pointer 122 of the code output interface 105, the base pointer 123, and the base pointer 124 held by the controller 107 are all set to 0.
  • the picture type is determined (step 302).
  • the picture type sequence is determined by the encoder device side in the MPEG, and the control unit 107 repeats, for example, ⁇ ⁇ ⁇ , ⁇ , ⁇ , ⁇ , ⁇ , ⁇ , ⁇ , ⁇ , ⁇ , ⁇ , ⁇ ,... You can specify a picture type sequence such as.
  • the start-up process of the encoding unit 106 (step 303) is executed, and the process enters the end of the processing of the encoding unit 106 (step 304).
  • the encoder 106 is activated, the light pointer 121 and the base pointer 124 coincide with each other as shown in FIG. 4 (a).
  • the encoding unit 106 captures the image data for one picture from the external memory 101, executes the encoding process, and writes the encoding processing result to the external memory 101.
  • the write pointer 122 of the encoder 106 increases in accordance with the amount of code drawn (FIG. 4 (b)). At this time, the value of the base pointer 123 of the code output interface 105 remains unchanged, and the data currently being encoded is not output to the outside.
  • the control unit 107 performs a code generation amount calculation process (step 305).
  • the control unit 107 reads out the value of the write pointer 121 of the encoding unit 106 and compares it with the base pointer 124 held by the control unit 107 itself. Performed by That is, since the write pointer is increasing in accordance with the code generation amount when the encoding result is written, the code generation amount can be calculated by calculating the increment of the pointer.
  • step 306 it is determined whether or not to execute the replacement process (replacement necessity determination) (step 306).
  • the amount of encoded bits calculated in step 305 exceeds the upper limit. If the picture type of the image data being processed is a B picture, the upper limit value ⁇ 1 is compared. If the picture type of the image data being processed is a ⁇ picture, the upper limit value is compared with 2. If the code generation amount is within the upper limit value, the process proceeds to step 309. If the code generation amount exceeds the upper limit value, the process proceeds to step 307. In the example shown in Fig. 4b, the value exceeds the set upper limit (eg, 1).
  • step 307 the replacement process (step 307, step 308) is executed.
  • step 307 the base pointer 124 of the control unit 107 is returned to the write pointer 121 of the encoder unit 106.
  • the write pointer 122 of the encoder 106 returns to the original value before the encoding result was written (FIG. 4 (c)).
  • step 308 the control unit 107 determines a replacement pattern according to the picture type of the image data being processed and the position of the image data in time series, and this replacement pattern signal 230 To the encoder section 106.
  • the encoding unit 106 adopts data specified from the replacement pattern held by the replacement pattern holding unit 231 as encoded data, and stores the data in the external memory. For 101, the address is overwritten from the address indicated by the write pointer 12 1 returned to the original value. The value of the write pointer 12 21 is updated to the address at the end of writing the overwritten replacement data (Fig. 4 (d)). The remaining data that has not been overwritten is ignored, processing of the next image data is continued from the value of the write pointer in Fig. 4 (d), and the result of the next image data processing is written.
  • the data held by the replacement pattern holding unit 2 3 1 is
  • the control unit 107 updates the pointer for the output process (step 309).
  • the value of the write pointer of the encoding unit is assigned to the base pointer 124 and the base pointer 123 of the code output unit 105.
  • Output processing via the code output interface 105 is as follows. When there is an output request, the code output interface 105 reads out the coded bits until the lead pointer 122 matches the base pointer 123, and outputs it as the output bit stream 111. That is, (1) When the lead pointer 122 and the base pointer 123 do not match, the data of the address indicated by the read pointer 122 is read from the external memory 101 and the output bit stream is output to the outside. Output as 1. Then, the value of the lead window 1 2 2 increases by “1”.
  • the code output interface 105 Since the code output interface 105 operates as described above, the read pointer 122 does not increase beyond the base pointer 123, and data after the base pointer is not output to the outside.
  • the processing shifts to the determination of the reproduction picture type (step 302).
  • the above flow is programmed in the control unit 107 using microcode.
  • the picture coding type of the image data to be processed and the The pattern is determined according to the position of the image.
  • Important points in the replacement pattern discrimination are the following two rules.
  • the data to be replaced must provide the same decoding result as the temporally adjacent reference image.
  • the reproduced image of the replaced image data is temporally closer to the preceding and succeeding images, and the reproduced image is less uncomfortable.
  • Pattern 1 is an image that has undergone the encoding process is a picture coding type B, an image corresponding to immediately after the preceding reference image (I or P picture), and a code that is an encoding result of the image. This is the case when the generated amount exceeds ⁇ 1.
  • This pattern 1 is a pattern that replaces the encode data of the ⁇ picture with data that can obtain the same decoding result as the preceding reference image.
  • Figure 5 shows an example.
  • Fig. 5 (a) shows the state of the image data before the replacement processing arranged in chronological order
  • Fig. 5 (b) shows the state of the moving image display after the replacement processing. As shown in Fig.
  • the picture sequence is I, B, B, B, P, and the images are a, b, c, d, and e, respectively.
  • Pattern 1 corresponds to the case where the encoded data of image b has a code generation amount larger than ⁇ 1.
  • the control unit 107 Since the encoding process is performed in the order of I, ⁇ , ⁇ , it is performed in the order of a, e, b, c, d.
  • the control unit 107 After the encoding process of the image b, if it is determined that replacement is necessary in the replacement necessity determination of the control unit 107 in step 310, the control unit 107 has the picture type B, and Since it is immediately after the forward reference image, it can be determined to be pattern 1 and is designated as data to be replaced, which is the data obtained by the replacement pattern storage unit 231 and which obtains the same decoding result as the forward reference image. At this time, the decoding result is the same as the image a.
  • the reproduced images are a, a, c, d, and e. That is, the image “a” is displayed continuously only for a moment, and the sense of discomfort can be reduced.
  • pattern 2 the encoded image is picture coding type B, the code generation amount as the encoding result of the image exceeds ct 1, and the encoding data of the ⁇ picture is , And is a pattern that replaces the data with which the same decoding result as that of the rear reference image is obtained.
  • Figure 6 shows an example.
  • Fig. 6 (a) shows the state of the image data before replacement processing arranged in chronological order
  • Fig. 6 (b) shows the state of moving image display after the replacement processing. As shown in Fig.
  • Pattern 2 corresponds to the case where the encoded data of image c and image d has a code generation amount larger than ⁇ 1.
  • the image c has a code generation amount larger than ⁇ 1.
  • the encoding process is performed in the order of I, ⁇ , and ⁇ , so that the encoding process is performed in the order of a, e, b, c, and d. If it is determined in step 303 that the replacement is necessary in the control unit 107, the control unit 107 determines that the picture type is B and another Since there is an image b Judgment is pattern 2 and a replacement pattern signal "2" is issued, and data that can obtain the same decoding result as the subsequent reference image held by the replacement pattern holding unit 231 is designated as data to be replaced.
  • This replacement pattern 2 specifies the replacement of all the images up to the subsequent reference image e in the picture sequence with data that can provide the same decoding result as the rear reference image, and encodes the replaced data as encoded data. And Therefore, by the replacement processing in step 308, the reproduced images are a, b, e, e, e as shown in FIG. 6 (b). In other words, the image e is displayed continuously for only a moment, and the uncomfortable appearance can be reduced.
  • Another replacement process can be defined as follows.
  • This alternative replacement pattern 2 will be described with reference to FIG.
  • the encoding process is performed in the order of I, P, and B, and in the order of a, e, b, c, and d.
  • the replacement pattern holding unit 231 advances the processing while updating the encoding result of the B picture image as a third replacement pattern until image data whose code generation amount exceeds the upper limit value 1 appears.
  • the code generation amount for image c exceeds ⁇ 1.
  • the replacement processing of the image c After the encoding processing of the image c, it is determined that the replacement is necessary in the replacement necessity determination of the control unit 107 in step 310, and the control unit 107 has a picture type of ⁇ and the preceding reference image a Since there is another image b in between, it is determined to be pattern 2 and the replacement pattern signal "3" is issued.
  • the pattern signal “3” is designated as a third replacement pattern, that is, data that replaces the encoded data of the image b that is the immediately preceding B picture. Therefore, by the replacement processing in step 308, the reproduced images are a, b, b, d, and e as shown in FIG. 7 (b).
  • the bitstream to be replaced is the B picture data for image b and Similarly, in the processing of the image C, the same bidirectional prediction as that of the image b is performed in all the macroblocks, and the image processing is executed.
  • the data to be replaced is the encoding data of the immediately preceding B picture, which can be prepared in advance.
  • the data creation is very fast and real-time processing can be realized. Further decoding results in the same image as the preceding image b. That is, the image b is displayed continuously only for a moment, and the uncomfortable feeling can be reduced.
  • the encoding data of the image b of the preceding B picture is stored in the replacement pattern storage unit 231 as a third replacement pattern, but the control unit 107 A configuration in which the address in which the encoding data of the B picture image b is drawn is separately held is also acceptable.
  • the control unit 107 converts the encoded data stored in the address held separately to the image c. Copies to the following address as encoding data.
  • the code generation amount of the next B picture is large, it is similarly copied to the following address.
  • the encoding data of the image b may be copied to a continuous address. Even if the replacement process of this another pattern 2 is performed, the amount of generated coding bits of the continuous B picture is all within the upper limit of 1, and the same image is displayed continuously for a moment for the replaced B picture. Feeling of discomfort can be reduced.
  • pattern 3 will be described.
  • the encoded image is a picture coding type P
  • the amount of code generation as the encoding result of the image exceeds ⁇ 2
  • the encoding data of the ⁇ picture is This is a pattern to be replaced with data that can obtain the same decoding result as the preceding reference image.
  • the ⁇ picture replaced The P picture following the P picture refers to the replaced reference image so that it is not used for the reference processing of other image data.
  • Figure 8 shows an example.
  • Fig. 8 (a) shows the state of the image data before replacement processing arranged in chronological order
  • Fig. 8 (b) shows the moving image display after replacement processing. As shown in Fig.
  • Pattern 3 corresponds to a case where the encoded data amount of the encoded data of the image d of the P picture type is larger than ⁇ ; 2.
  • the encoding process is performed in the order of I, ⁇ , ⁇ , so that the processes are performed in the order of a, d, e, b, c.
  • the replacement pattern signal "1"
  • the replacement data specifies replacement of all images up to the reference image d in the picture sequence with data that can obtain the same decoding result as the preceding reference image, and replaces the replaced data with encoded data.
  • the reproduced images are a, a, a, a, and e as shown in FIG. 8 (b).
  • the image data e which is a subsequent P-picture, originally refers to the image data d as a forward reference image, but the image data d has been replaced with data that provides the same decoding result as the image data a. Therefore, the image a is eventually used as the forward reference image.
  • the bit stream to be replaced is, as in Pattern 1, predicted in all macroblocks using motion vector 0 from the preceding reference image a.
  • the data is that the difference between the predicted image and the actual image is "0". That is, in FIG. 2, the motion vector 2 17 is set to “0”, the mode information 2 05 is set to the inter mode in the forward prediction, and the difference image 204 is set to all “0”. Therefore, the DCT results are all "0” and the quantization results are all "0”, and the variable-length coding unit 208 corresponds to the result of encoding all the data "0". . Therefore, since the code does not depend on the input image or the reference image at all, it can be prepared in advance, and the data creation is very fast and real-time processing can be realized. Further decoding results in the same image as the preceding reference image a. That is, the image a is displayed continuously only for a moment, and the sense of discomfort can be reduced.
  • the decoded result of the replaced image is the same as the decoding result of the nearest image.
  • the decoding results are only replaced with images that are very close in time, and are controlled so that the order of the images is not reversed in time. Therefore, the image seems to be frozen for a moment in the vicinity, but the block is not disturbed significantly and the sense of discomfort for viewing is reduced.
  • the bit stream to be replaced is not encoded from the source image data, but is prepared in advance. Writing can be performed at a very high speed, and data can be replaced by real-time processing.
  • the sense of incongruity at the time of decoding can be minimized, and the amount of encoded bits can be reliably controlled.
  • the description has been made on the assumption that the replacement process is performed in units of a picture (a frame in a frame structure, and a field in a field structure).
  • the present invention can be applied to a larger range or a smaller range. This is effective for controlling the amount of generation.
  • processing flow shown in FIG. 3 is programmed in the control unit 107 using microcode, so that a flexible system design is possible.
  • the upper limit value is used as a threshold value, and the necessity of replacement processing is determined by comparing with the code generation amount.
  • the method of determining whether or not to execute the replacement processing is not limited to the method of comparing the code generation amount with the set upper limit value.
  • a configuration may be adopted in which a threshold value is set in consideration of the quantization step and the average luminance value, and the threshold value is compared with the quantization step and the average luminance to determine whether or not the replacement process is necessary.
  • variable length coding apparatus of the present invention can make various changes and modifications to the above method and apparatus without departing from the above inventive concept. Therefore, it should be noted that the present invention is not limited to the above embodiment.
  • the upper limit of the encoding bit generation amount can be controlled reliably by real-time processing, and rate control can be implement
  • the data replacement process can be performed at a very high speed, and the decoded result of the data subjected to the replacement process is the same as that of the adjacent image, so that there is no unnatural feeling in appearance. Furthermore, since the amount of data can be controlled reliably, the quantization step can be reduced without worrying about the breakdown of the rate control, and the quality of a normal image can be improved.
  • variable length encoding device of the present invention since the encoding device generates the encoded data in which the code generation amount is controlled by the encoding process on the encoding device side, no special configuration or mechanism is required on the decoding device side.
  • any decoding device that conforms to the standard can decode data with controlled code generation and generate moving images.

Description

明 細 書 可変長符号化装置 技術分野
本発明はデータの圧縮処理で利用される可変長符号化装置に関する。 背景技術
従来の可変長符号化装置の代表的な用途として動画データの圧縮処理 力 Sある。
動画圧縮の国際規格である M P E G (Moving Picture Experts Group)で は、 D C T (離散コサイン変換)、 量子化、 動き補償を伴う差分処理を 行う。 M P E Gではマクロブロックと呼ばれる縦 1 6、 横 1 6の画素で 構成される単位をベースに動き補償を行って圧縮率の向上を図っている。
M P E Gにおいては可変長符号化を行なっているが、 この可変長符号 化は確率的に符号長を減少するものであるため必ずしも符号化ビット発 生量が減少するとは限らず、 また画像データ、 映像の動きなどピクチャ のコーディングの困難さに応じて符号化ビッ ト発生量が揺らぐことにな る。
このビット発生量の摇らぎはデコーダのバッファモデルによつて規定 される。 具体的には、 規格によって規定される理想的なデコーダにおい ては入力バッファが存在し、 リアルタイムデコードにおいてこの入カバ ッファがオーバーフロー、 あるいはアンダーフローしてはならないとい う規定がなされている。 よってエンコーダはデコーダの入力バッファの 容量の程度のビット発生量の揺らぎが許されていることになる。 逆にい えばこの制限をエンコーダでは必ず守られるようにェンコ一ドしなけれ ばならない。
このように、 M P E Gでは、可変長符号でェンコ一ドするのであるが、 そのビッ ト発生量に関し制限を与えなければならない。 一般的にその手 法はレートコントロールと呼ばれている。 このようなレートコントロー ルについては例えば特開平 7— 1 0 7 9 4 7号公報に開示されているの ように、 通常量子化する際のステップを変化させる手法などが知られて いる。 また、 可変長符号化を行なったのちに、 ビッ ト発生量を制御する 方法としては特開平 6 - 1 4 3 1 4号公報などに開示された手法が知ら れている。
しかし、 量子化ステップを大きくする方法によると、 符号化ビッ ト発 生量は減少することが予想されるが、 実際の符号化ビッ ト発生量は符号 化を行なうまでは不明である。 このように、 正確に符号量を予測できな い以上、 量子化ステップで制御する方法では、 確実性に欠けるという問 題がある。 このように従来の手法では、 量子化ステップをマクロブロッ ク単位で変更する方法によっても非常に頻度が低いと思われる状況を想 定して符号化ビッ ト発生量の上限を確実に押えなければならないため、 通常はもつと高画質が得られるはずのデータに対しても画質の劣化を招 くという問題があった。 特に、 リアルタイムでのシステムにおいては、 ェンコ一ドした結果を参照してさらに最適化を図るなどの再ェンコ一ド 処理が殆んど不可能であるためこのような安全策を採らざるを得ず画質 の劣化を招いていた。
これらの問題は可変長符号化を行なったのちに制御を行なうことにす れば解決するが、 特開平 6 - 1 4 3 1 4号公報に開示されている手法で は、 全ての可変長符号の長さを記憶しておく必要があるなどハードゥエ ァの規模が増大し、 またローカルデコード画像と、 デコーダによるデコ 一ド画像のずれが生じて画質の劣化が数フレームに渡って継続するとい つた状況が発生する。 さらに画質劣化が特定のマクロプロックに集中す ることがあり、 画質劣化が顕著に表われやすい問題があった。 発明の開示
本発明にかかる可変長符号化装置は、 上記課題を解決し、 リアルタイ ム処理において符号化ビット発生量の上限を画質劣化が目立たないよう に確実に制限することを目的とする。
上記目的を達成するために本発明にかか · 5可変長符号化装置は、 入力 されたデータを処理単位毎に可変長符号化する可変長符号化手段と、 前 記可変長符号化された可変長符号化データを一時的に記憶するバッファ リング手段と、 前記バッファリング手段に記憶された可変長符号化デー タの処理単位当たりの符号発生量に応じて、 あらかじめ用意された前記 符号発生量より短い符号に置き換える符号置き換え処理手段を具備する ことを特徴とする。
上記構成により、 可変長符号化の結果、 処理単位当たりの符号発生量 が多いものを必要に応じて短い符号で置き換えることにより処理単位当 たりの符号量を低減させ、 確実に符号発生量の上限を制限でき、 符号発 生量を所定範囲に抑えることができる。
次に、 前記可変長符号化装置は、 前記入力データの処理単位当たりの 符号発生量の上限値を設定する手段を備え、 前記符号置き換え処理手段 力 前記バッファリング手段に記憶された可変長符号化データの処理単 位当たりの符号発生量が前記上限値を越えた場合にあらかじめ用意され た短い符号に置き換える処理をする手段と、 前記バッファリング手段に 記憶された可変長符号化データの処理単位当たりの符号発生量が前記上 限値を越えない場合に符号の置き換えを行わない処理をする手段とを備 えることが好ましい。 上記構成により、 処理単位当たりの符号発生量の上限を柔軟に設定で き、 可変長符号化の結果、 処理単位当たりの符号化ビッ ト発生量が上限 値を越えたものを短い符号で置き換えることにより処理単位当たりの符 号量を確実に上限値以内に制限できる。
次に、 前記入力は動画像データのフレーム内圧縮処理またはフレーム 間圧縮処理されたデータであって、 前記処理単位は、 動画像データの 1 ピクチャ当たりのデータであることが好ましい。
上記構成により、 動画像データの圧縮処理過程の可変長符号化処理に 適用することができ、 M P E G、 H . 2 6 1などの動画圧縮処理装置の 可変長符号処理に利用することができる。
次に、 前記符号置き換え処理手段が置き換えるあらかじめ用意された 短い符号が、 すでに前記符号置き換え処理手段による処理が済んだ処理 単位にかかる置き換え処理済データと同じデコード結果が得られるもの であることが好ましい。
上記構成により、 置き換えたデータをデコードする際にすでにデコー ドした画像と同一の画像となるので、 画質の劣化を感じさせることがな レ、。
次に、 前記入力データが双方向予測符号化画像ピクチヤである場合、 前記符号置き換え処理手段は、 前記置き換えるあらかじめ用意された短 い符号とし、 時系列上、 前方でもっとも近いフレーム内符号化画像ピク チヤか、 前方でもっとも近い前方予測符号化画像ピクチャか、 後方でも つとも近いフレーム内符号化画像ピクチャか、 後方でもつとも近い前方 予測符号化画像ピクチャのうちのいずれかと、 同じデコード結果が得ら れるデータを選択することが好ましい。
上記構成により、 置き換える必要のある双方向予測符号化画像ピクチ ャデータを、 時間的に近接する前後のピクチャであって、 所定の符号発 生量に収まった画像データと置き換えることができ、 動画像としてデコ 一ドした場合の違和感のないデータを得ることができる。
さらに、 前記選択において後方の画像ピクチャを選んだ場合は、 前記 入力データから前記選択した後方の画像ピクチヤまでの間にある双方向 予測符号化画像ピクチヤすベてを前記選択した後方の画像ピクチャと同 じデコード結果が得られるデータと置き換えることが好ましい。
上記構成により、 双方向予測符号化画像ピクチャデータの置き換え処 理において、 置き換えた画像ピクチャに後続する画像ピクチャが時系列 上過去のデータとなることがなく、 デコードした場合、 画像の時間的順 番が逆転することのない違和感のないデータを得ることができる。 次に、 前記入力データが前方予測符号化画像ピクチャである場合、 前 記符号置き換え処理手段は、 前記置き換えるあらかじめ用意された短い 符号とし、 時系列上、 前方でもっとも近いフレーム内符号化画像ピクチ ャか、 前方でもっとも近い前方予測符号化画像ピクチヤのうちのいずれ かと同じデコード結果が得られるデータを選択し、 前記入力データであ る前方予測符号化画像ピクチヤに後続する前方予測符号化画像ピクチャ は、 前記選択された前方の画像ピクチャを参照することが好ましい。 上記構成により、 置き換える必要のある前方予測符号化画像ピクチャ を、 近接する前方の画像ピクチヤであって、 所定の符号発生量に収まつ た画像データと置き換えることができ、 動画像としてデコードした場合 の違和感のないデータを得ることができる。 また、 置き換えた前方予測 符号化画像ピクチャに後続する前方予測符号化画像ピクチャの参照処理 では前記前方の画像ピクチャを参照するので、 置き換え処理をした前方 予測符号化画像ピクチャが他の画像ピクチヤの参照処理に利用されるこ とがなく、 不具合が発生することがない。
図面の簡単な説明 第 1図は、 本発明の実施形態の M P E Gェンコ一ド装置のプロック図 である。
第 2図は、 第 1図のエンコーダ部 1 0 6の詳細を示すプロック図であ る。
第 3図は、 制御部 1 0 7の処理動作のフローチャートである。
第 4図は、 外部メモリ 1 0 1にデータが書き込まれる様子を示した図 である。
第 5図は、 置き換えパターン 1を説明する図である。
第 6図は、 置き換えパターン 2を説明する図である。
第 7図は、 別の置き換えパターン 2を説明する図である。
第 8図は、 置き換えパターン 3を説明する図である。 発明を実施するための最良の形態
本発明の可変長符号化装置を M P E Gエンコーダに適応した実施形態 を示す。
図 1は本実施形態にかかる M P E Gエンコーダのブロック図である。 図 1に示すように外部メモリ 1 0 1 とエンコーダ 1 0 2とで構成されて いる。
エンコーダ 1 0 2はさらに外部メモリインターフェース 1 0 3、 画像 入力インターフェース 1 0 4、 コード出力インターフェース 1 0 5、 ェ ンコード部 1 0 6、 制御部 1 0 7とで構成されている。
エンコード部 1 0 6が可変長符号化手段に該当し、 外部メモリ 1 0 1 がバッファリング手段に該当し、 後述するように制御部 1 0 7の制御に より符号置き換え処理手段が実行される。 また、 本実施形態では処理単 位は、 画像ピクチャであり、 ピクチャタイプは I ピクチャ (フ I /一ム内 圧縮符号化画像)、 Pピクチャ (前方予測符号化画像)、 Bピクチャ (双 方向予測符号化画像) がある。
外部メモリ 1 0 1は、 参照画像データの保持やェンコ一ド処理された ビッ トス ト リームを一定ビッ トレー トで出力するための緩衝用バッファ としての役割などを果たす。
外部メモリインターフェース 1 0 3は、 画像入カインターフェイス 1 0 4、 コード出力インタフェース 1 0 5、 エンコード部 1 0 6 とレ、ぅ複 数ブロックからの書き込み、 読み出しの要求を調停し、 他のブロックと 外部メモリ とのデータの入出力を実行する。
画像入カインターフェース 1 0 4は、 外部からの入力画像 1 1 0を受 け入れ、 フィルタリングなどを行なった後、 外部メモリインターフエ一 ス 1 0 3を介して入力画像データ 1 1 0を外部メモリ 1 0 1の所定のァ ドレスに書き込む。 以下、 書き込みを行なった画像データをソース画像 データと呼ぶことにする。
ェンコ一ド部 1 0 6は外部メモリ 1 0 1から画像データを読み込み、 エンコード処理を実行し、 エンコードしたデータを外部メモリ 1 0 1に 書き込む。 この際、 後述するようにエンコードしたデータの符号発生量 が設定した上限値以上であると制御部 1 0 7が判断すれば置き換え処理 が実行され、 置き換え後のデータが外部メモリ 1 0 1に書き込まれる。 詳しい動作は後述する。
ここで、 ライ トポインタ 1 2 1は、 書き込んだデータの外部メモリ 1 0 1上のァドレスを示すためのポィンタであり、 ェンコ一ド処理におい て発生した符号量分だけライ トポインタ 1 2 1は増加することとなる。 また、 後述するようにェンコ一ド処理開始前のライ トポインタ 1 2 1は 制御部 1 0 7のベースボインタ 1 2 4に渡され、 また、 ェンコ一ド処理 後のライ トポィンタ 1 2 1 も制御部 1 0 7に渡され、 外部メモリ 1 0 1 に書き込まれたデータの発生符号量が上限値を越えているか否かの判断 に利用される。
制御部 1 0 7は、 エンコード部 1 0 6、 コード出カインターフェース 1 0 5を制御し、 また直接外部メモリインターフェース 1 0 3を通じて 外部メモリ 1 0 1に対してデータ入出力を行う。 設定する発生符号量の 上限値を上限値記憶領域 1 2 5に保持し、 エンコード部 1 0 6によるェ ンコード処理後の発生符号量が設定上限値を越えているか否かによる置 き換え処理実行要否の判断を行い、 越えている場合は、 画像データのピ クチャタイプ、 時系列上の並びを考慮した置き換えパターンに従って置 き換え処理を実行する。 なお、 設定上限値はピクチャタイプに合わせて 設定することができ、 Bピクチャタイプ画像データの上限値がひ 1、 P ピクチャタイプ画像データの上限値が α 2である。 ベースポインタ 1 2 4は、 ェンコ一ド処理実行前のェンコ一ド部 1 0 6のライ トポインタ 1 2 1の初期値を受け取り、 記憶するものである。 エンコード処理後のラ イ トポインタ 1 2 1 との差によりエンコード処理による発生符号量算出 に用いる。 詳しい処理動作は後述する。
コード出力インターフェース 1 0 5は、内部にリードポインタ 1 2 2、 ベースボインタ 1 2 3を保有し、 このボインタを比較しながら外部の要 求に応じて出力ビッ トス ト リーム 1 1 1を出力する。 ここで、 リ一ドボ インタ 1 2 2はビッ トス トリームの出力が済んでいる外部メモリ 1 0 1 のァドレスを記憶するためのボインタであり、ベースボインタ 1 2 2は、 エンコー ド処理、 置き換え処理が済み、 出力可能となったデータの外部 メモリ 1 0 1のァドレスを記憶するためのポィンタである。 出力処理に ついての詳しい動作は後述する。
以下、 エンコード部 1 0 6の構成を述べ、 続いて、 置き換え要否判断 処理、 置き換えパターン判別処理、 置き換え処理、 コード出力インタフ エース 1 0 5を介した出力処理などについて詳しく説明する。 まず、 エンコード部 1 0 6の構成を説明する。 図 2に示すように、 ェ ンコード部 1 0 6は、 外部メモリ 1 0 1 との間で処理画像データを読み 書きするためのァドレスを生成するァドレス生成部 2 2 1を備えている。 了ドレス生成部 2 2 1は、 前述したライ トポインタ 1 2 1を保持してい る。 エンコード部 1 0 6はさらに動き検出部 2 0 2、 差分画像生成部 2 1 3、 D C T部 2 0 6、 量子化部 2 0 7、 可変長符号化部 2 0 8、 逆量 子化部 2 0 9、 逆 D C T部 2 1 0、 動き補償部 2 1 1を備えている。 マクロブロックデータ 2 0 1は 1 6 X 1 6画素のマクロブロックデー タである。
動き検出部 2 0 2は、 外部メモリ 1 0 1から読み出した参照画像デー タ 2 1 2を探索領域として、 参照画像データ 2 1 2中の 1 6 X 1 6画素 のブロックデータと処理対象のマックロブ口ックデータ 2 0 1 との比較 を試行してもつとも合致するプロックデータを求める。 そしてマクロブ 口ックデータ 2 0 1 と求めたブロックデータの位置の差をべク トル表現 したものを動きベク トル 2 1 7として差分画像生成部 2 1 3へ出力する。 差分画像生成部 2 1 3は、 与えられた動きべク トル 2 1 7を基に、 外 部メモリ 1 0 1に記憶されている参照用画像データ 2 1 2のうち入力さ れたマクロブ口ックデータ 2 0 1に対応する画像データから予測画像 2 1 9を生成する。 差分画像生成部 2 1 3は、 インター圧縮時では、 マク ロブ口ックデータ 2 0 1 と予測画像 2 1 9との差分を差分画像 2 0 4と して出力し、 イントラ圧縮時では実際には差分を取らずにマクロプロッ クデータ 2 0 1 と同一のデータを差分画像 2 0 4として出力する。 ここ で、 差分画像生成部 2 1 3は、 処理モードがインターモードであつたの かィントラモードであったのかを判別する情報と動きべク トル 2 1 7と をモー ド情報 2 0 5として出力する。
D C T処理部 2 0 6は、 差分画像 2 0 4に対して直交変換である離散 コサイン変換を行ない、 その結果を出力する。
量子化部 2 0 7は、 D C T処理部 2 0 6の出力に対して量子化を行な い、 その結果を量子化データ 2 1 6として出力する。 この量子化により D C T処理結果の高周波成分が除去されてデータ量が圧縮される。
可変長符号化部 2 0 8は、 モード情報 2 0 5とデータの出現確率に基 づいて量子化データ 2 1 6を可変長符号化して出力ビッ トス ト リーム 2 1 4として出力する。 ここで動きべク トル 2 1 7を含むモード情報 2 0 5は出力ビッ トス ト リーム 2 1 4の一部に符号化される。 後述する制御 部 1 0 7での置き換え要否判断において可変長符号化したデータの発生 符号量が設定した上限値 α 1または α 2を越えていると判断された場合 には、 制御部 1 0 7による置き換え処理が実行され、 制御部 1 0 7が発 行する置き換えパターン信号 2 3 0に従い、 保持している置き換えパタ ーン保持部 2 3 1が保持する置き換えパターンと置き換えられ、 置き換 え後のデータを出力ビッ トス ト リーム 2 1 4として出力する。
エンコー ド部 1 0 6は、 上記出力ビッ トス ト リーム 2 1 4生成ととも に次のェンコ一ド処理のために参照用フレーム画像データ 2 2 0を生成 すべく、 デコーダで行われるデコード処理と同様の処理を逆量子化部 2 0 9、 逆0〇丁部2 1 0、 動き補償部 2 1 1により行いデータを用意す る。
逆量子化部 2 0 9は量子化データ 2 1 6を逆量子化する。 ここで量子 化の逆変換に相当するが量子化において情報量が減少しているために D C T部 2 0 6の出力と逆量子化部 2 0 9の出力とは一致しない。
逆 D C Τ部 2 1 0は逆量子化部 2 0 9の出力に対して逆 D C T処理を 行なう。
動き補償部 2 1 1は、 モード情報 2 0 5や予測画像 2 1 9を基に動き 補償を行なう。 動き補償は、 モード情報 2 0 5がイントラモードの場合 には逆 D C T部 2 1 0の結果をそのまま出力し、 モード情報 2 0 5がィ ンターモードの場合には予測画像 2 1 9 と逆 D C Τ部 2 1 0の出力を加 算したものを出力する。 これは差分画像生成部 2 1 3の逆の動作に相当 する。 動き補償部 2 1 1の出力は参照画像データ 2 2 0としてァドレス 生成部 2 2 1に送られ、 外部メモリインタフェース 1 0 3を介して外部 メモリ 1 0 1に書き込まれ、 次段のマクロブロックデータ 2 0 1のェン コード処理に使用される。
以上のように、 エンコード部 1 0 6は、 ソース画像データをェンコ一 ドし、 必要に応じて置き換え処理されたビッ トス ト リームを作成し、 そ の結果を外部メモリ 1 0 1に書き込む動作を行なう。
なお、 M P E Gではェンコ一ド処理の中で動き補償について入力フレ ーム画像のピクチャコ一ディングタイプに応じて異なった処理が行われ る。 ェンコ一ド部 1 0 6は、 制御部 1 0 7に指定される 3種類のピクチ ヤコーデイングタイプ ( I ピクチャ、 Pピクチャ、 Bピクチャ) の種類 に応じて動き検出部 2 0 2や動き補償部 2 1 2の動作を変更する。
I ピクチャの場合にはフレーム間の情報、 参照画像を利用せず、 動き 補償、 動き検出などを行なわずにエンコードし、 ローカルデコード画像 を外部メモリ 1 0 1に対して書き込む。 即ち、 動き検出部 2 0 2は動き べク トル 2 1 7を出力せず、 差分画像生成部 2 1 3は、 参照画像 2 1 2 を利用せず常にイントラ (動き補償を行なわない) モードで動作する。
Pピクチャの場合には時系列上で前方にある参照フレーム画像を 1つ のみ利用してその参照画像に対する動き予測を利用してエンコードし、 ローカルデコード画像を外部メモリ 1 0 1に対して書き込む。
Bピクチャの場合には時系列上で近隣の 2つの参照フレーム、 例えば 前後の I ピクチャまたは Pピクチャの 2フレームを参照画像として用い る。 このタイプに関してはローカルデコード画像を外部メモリ 1 0 1に 書き込まない。 すなわち、 ア ドレス生成部 2 2 1は、 参照画像データ 2 2 0を外部メモリ 1 0 1に書き込む動作を行なわない。 Bピクチャタイ プの画像は参照画像として用いられることはないためローカルデコード 画像を保持しておく必要がないためである。 逆にいうと Bピクチャタイ プに対してのデータ変更操作は他のフレーム画像に対して影響を全く与 えないことがわかる。 一方、 I タイプ、 Pタイプのデータ変更操作は他 のフレームの画像に影響を与える。
以上が、 エンコード部 1 0 6の構成である。
次に、 本実施形態にかかる可変長符号化装置を利用した MP EGェン コード処理手順を説明する。 図 3は、 制御部 1 0 7の処理動作を中心と した本発明の可変長符号化装置の処理フローである。 図 4は外部メモリ 1 0 1にデータが書き込まれる様子を示した図である。
入力画像 1 1 0はー且、 画像入カインターフェース部 1 04を通じて 外部メモリ 1 0 1にソース画像として書き込まれる。 この動作は他のブ 口ックから独立して動作する。 以下、 既に外部メモリ 1 0 1にソース画 像が取り込まれているものとして説明する。
最初に、 制御部 1 0 7は初期化処理 (ステップ 3 0 1 ) を実行する。 初期化処理では、 エンコード部 1 0 6のライ トポインタ 1 2 1、 コード 出力インターフェース 1 0 5のリードポインタ 1 2 2、 ベースポィンタ 1 2 3、 制御部 1 0 7が保持するベースボインタ 1 24がそれぞれ 0に
BX疋 2·れる。
次にピクチャタイプの決定 (ステップ 3 0 2) が実行される。 ピクチ ャタイプのシーケンスは、 MP E Gではエンコーダ機器側が決めるもの であり、制御部 1 0 7は、例えば Ι, Β, Β, Β, Ρ, Β, Β, Β, Ι, · · · という順番を繰り返すなどのピクチヤタイプのシーケンスを指定するこ とができる。 次に、 エンコード部 1 0 6の起動処理 (ステップ 3 0 3 ) が実行され、 エンコード部 1 0 6の処理終了待ち (ステップ 3 0 4 ) に入る。 ェンコ ード部 1 0 6の起動された時点では図 4 ( a ) に示すようにライ トボイ ンタ 1 2 1 とベースポィンタ 1 2 4は一致している。 次に、 エンコード 部 1 0 6は、 画像データを 1 ピクチャ分外部メモリ 1 0 1から取り込ん でェンコ一ド処理を実行し、 ェンコ一ド処理結果を外部メモリ 1 0 1へ 書き込む。 エンコード部 1 0 6のライ トポインタ 1 2 1は描き込んだ符 号量に従って増加していく (図 4 ( b ) )。 このときコード出力インター フェイス 1 0 5のベースポィンタ 1 2 3の値は前のままであって、 現在 エンコード中のデータは外部へ出力されない。
次に、 制御部 1 0 7は、 エンコード部 1 0 6が 1 ピクチャ分のェンコ ード処理を終了すると、 符号発生量計算処理 (ステップ 3 0 5 ) を行な う。 この符号発生量計算処理は、 制御部 1 0 7がエンコード部 1 0 6の ライ トポインタ 1 2 1の値を読み出して制御部 1 0 7自身が保持してい たベースボインタ 1 2 4と比較することにより行う。 つまりライ トボイ ンタはェンコ一ド結果の書き込みの際に符号発生量に応じて増加してい るのでボインタの増加分を計算することで符号発生量を算出することが できる。
次に置き換え処理を実行するか否かの判断 (置き換え要否判断) を行 う (ステップ 3 0 6 )。 ここでは、 ステップ 3 0 5で計算した符号化ビ ッ ト発生量が上限値を越えているか否かをチユックする。 処理中の画像 データのピクチャタイプが Bピクチャであれば、 上限値 α 1 と比較し、 処理中の画像データのピクチャタイプが Ρピクチャであれば、 上限値ひ 2と比較する。 符号発生量が上限値以内ならばステップ 3 0 9に進み、 符号発生量が上限値を越える場合にはステップ 3 0 7の置き換え処理に 進む。 図 4 bに示した例では設定上限値 (例えばひ 1 ) を越えている。 ステップ 3 0 6で符号化ビッ ト発生量が上限値を越えた場合は、 置き 換え処理 (ステップ 3 0 7、 ステップ 3 0 8 ) を実行する。 まず、 ステ ップ 3 0 7で、 制御部 1 0 7のベースポィンタ 1 2 4をェンコ一ド部 1 0 6のライ トポインタ 1 2 1に戻す。 これにより、 エンコード部 1 0 6 のライ トポインタ 1 2 1はェンコ一ド結果書き込み前の元の値に戻る (図 4 ( c ) )。 次いで、 ステップ 3 0 8で、 制御部 1 0 7は、 処理中の 画像データのピクチャタイプ、 時系列上の画像データの位置に応じて置 き換えパターンを判別し、 この置き換えパターン信号 2 3 0をェンコ一 ド部 1 0 6に与える。 エンコード部 1 0 6は受け取った置き換えパター ン信号 2 3 0に従い、 置き換えパターン保持部 2 3 1が保持する置き換 えパターンから指定されたデータをェンコ一ド処理済みデータとして採 用し、 外部メモリ 1 0 1に対して、 元の値に戻されたライ トポインタ 1 2 1が示すァドレスから上書きして行く。ライ トポインタ 1 2 1の値は、 上書きした置き換えデータの書き込み終了地点のァドレスまで更新され る (図 4 ( d ) )。 上書きされず残っているデータは無視され、 次の画像 データの処理は図 4 ( d ) のライ トポインタの値から続行され、 次の画 像データ処理結果が書き込まれて行く。
置き換えパターン保持部 2 3 1が保持するデータは、
( 1 ) 全マクロプロックを前方予測モード、 動きべク トル 0、 差分デ ータ 0で符号化したもの (前方の参照画像と同じデコード結果が得られ るデータ)
( 2 ) 全マクロブロックを後方予測モード、 動きベク トル 0、 差分デ ータ 0で符号化したもの (後方の参照画像と同じデコード結果が得られ るデータ)
の 2種類である。
これらの短いデータは、 決められたコードとして、 ソース画像を必要 とせずにあらかじめ準備しておく ことができ、 かつデータ量も非常に少 なレ、。
なお上記の置き換えパターン判別処理についての詳細は後述する。 次に、 制御部 1 0 7は、 出力処理のためのポインタ更新を行う (ステ ップ 3 0 9 )。 まず、 エンコード部のライ トポィンタの値をベースポィ ンタ 1 2 4とコード出力部 1 0 5のベースポィンタ 1 2 3に代入する。 コード出力インターフェイス 1 0 5を介した出力処理は以下の通りで ある。 コード出力インターフェイス 1 0 5は、 出力要求があつたとき、 リ一ドボインタ 1 2 2がベースボインタ 1 2 3と一致するまで符号化ビ ッ トを読み出して出力ビッ トストリーム 1 1 1 として出力する。つまり、 ( 1 ) リードボインタ 1 2 2、 ベースボインタ 1 2 3がー致していな いときには、 リードポインタ 1 2 2が指し示すァドレスのデータを外部 メモリ 1 0 1から読み出し外部へ出力ビッ トス ト リーム 1 1 1 として出 力する。 そしてその後リ一ドボインタ 1 2 2の値は " 1 " 増加する。
( 2 ) リードポインタ 1 2 2とベースポインタ 1 2 3がー致している ときは外部に対し出力すべきデータがないことを知らせる。
コード出力インターフェース 1 0 5は以上のような動作をするのでベ ースポインタ 1 2 3を越えてリ一ドボインタ 1 2 2は増加せず、 ベース ボインタ以降のデータは外部へ出力されない。
以上の一連の処理の後、再ぴピクチャタイプの決定(ステップ 3 0 2 ) に処理が移行する。
なお、 上記フローは制御部 1 0 7にマイクロコードを用いてプロダラ ムされている。
次に、 置き換えパターン判別処理の詳細について述べる。 置き換えパ ターンは何種類かのパターンが存在する。 本実施形態では、 処理対象の 画像データのピクチャコ一ディングタイプと、 時系列に並べた場合の当 該画像の位置に応じてパターンを判別する。 置き換えパターン判別にお いて重要な点は以下の 2つのルールである。
( 1 ) 置き換えるデータは時間的に近接する参照画像と同じデコード 結果が得られるものであること。 これにより置き換え後の画像データの 再生画像が前後の画像と時間的に近く、違和感の少ない再生画像となる。
( 2 ) 置き換え後の画像データの時系列の並びが前後の画像データと 逆転していないこと。 これにより置き換え後の画像データの再生画像が 時間的に逆戻りすることがなく、 違和感の少ない再生画像となる。
上記 2点に注目して、 それぞれの置き換えパターンについて説明を行 なう。
パターン 1は、 ェンコ一ド処理を行った画像がピクチャコ一ディング タイプ Bで、 前方の参照画像 ( Iまたは Pピクチャ) の直後に相当する 画像であって、 かつ、 その画像のエンコード結果である符号発生量が α 1を越えている場合である。 このパターン 1は、 当該 Βピクチャのェン コードデータを、 前方の参照画像と同じデコード結果が得られるデータ と置き換えるパターンである。 図 5に一例を示す。 図 5 ( a ) は時系列 順に並べた置き換え処理前の画像データの様子を示し、 図 5 ( b ) が置 き換え処理後の動画表示の様子を示したものである。 図 5 ( a ) に示す ように、 ピクチャシーケンスが I , B, B, B, Pであり、 それぞれの 画像を順に a , b, c, d , e とする。 パターン 1は、 画像 bのェンコ 一ドデータが符号発生量が α 1より大きい場合が該当する。
ここで、 パターン 1の場合の置き換えパターン信号の生成と置き換え 処理について述べる。 エンコード処理の順は I 、 Ρ、 Βの順に行なわれ るので a, e, b, c, dの順で行なわれる。 画像 bのエンコード処理 後、 ステップ 3 0 6の制御部 1 0 7の置き換え要否判断で置き換えが必 要と判断された場合、制御部 1 0 7はピクチャタイプが Bであり、 かつ、 前方の参照画像の直後にあるのでパターン 1 と判定でき、 置き換えパタ ーン保持部 2 3 1が保持している前方の参照画像と同じデコード結果が 得られるデータを置き換えるデータとして指定する。 このときデコード 結果は画像 a と同一のものとなる。 なお、 ステップ 3 0 8の置き換え処 理により、 再生画像は a , a, c, d , e となる。 つまり一瞬だけ画像 aが連続表示されるのみであり、 見た目の違和感を少なくできる。
次に、 パターン 2を説明する。 パターン 2は、 エンコード処理を行つ た画像がピクチャコ一ディングタイプ Bで、 その画像のェンコ一ド結果 である符号発生量が ct 1を越えており、 当該 Βピクチャのェンコ一ドデ ータを、 後方の参照画像と同じデコード結果が得られるデータと置き換 えるパターンである。 特に処理対象である画像データの時系列上の並び が後方の参照画像側に近い場合や、 前方の参照画像までの間にェンコ一 ド処理が所定の発生符号量内に収まった他の画像データが存在する場合 のパターンである。 図 6に一例を示す。 図 6 ( a ) は時系列順に並べた 置き換え処理前の画像データの様子を示し、 図 6 ( b ) が置き換え処理 後の動画表示の様子を示したものである。 図 6 ( a ) に示すように、 ピ クチャシーケンスが I, B, B, B, Pであり、 それぞれの画像を順に a , b , c, d, e とする。 パターン 2は、 画像 cや画像 dのェンコ一 ドデータが符号発生量が α 1 より大きい場合が該当する。 ここでは画像 cが符号発生量が α 1 より大きい場合とする。
パターン 2の場合の置き換えパターン信号の生成と置き換え処理につ いて述べる。パターン 1の場合の説明と同様、 ェンコ一ド処理の順は I、 Ρ、 Βの順に行なわれるので a, e , b, c, dの順で行なわれ、 画像 cのェンコ一ド処理後、 ステップ 3 0 6の制御部 1 0 7の置き換え要否 判断で置き換えが必要と判断されると、 制御部 1 0 7はピクチャタイプ が Bであり、 かつ、 先行する参照画像 a との間に他の画像 bがあるので パターン 2と判定し、 置き換えパターン信号 " 2 " を発行し、 置き換え パターン保持部 2 3 1が保持している後方の参照画像と同じデコード結 果が得られるデータを置き換えるデータとして指定する。 この置き換え パターン 2はピクチャシーケンス上、 後方の参照画像 eまでのすベての 画像に対して、 後方の参照画像と同じデコード結果が得られるデータと の置き換えを指定し、 置き換えたデータをエンコードデータとする。 そ のため、 ステップ 3 0 8の置き換え処理により、 図 6 ( b ) に示すよう に、 再生画像は a, b , e, e, e となる。 つまり一瞬だけ画像 eが連 続表示されるのみであり、 見た目の違和感を少なくできる。
なお、 このパターン 2では、 以下の通り、 別の置き換え処理を規定す ることができる。この別の置き換えパターン 2を図 7を用いて説明する。 上記の置き換えパターン 2と同様、 エンコード処理が I、 P、 Bの順に 行なわれ、 a, e, b , c, dの順で行なわれる。 置き換えパターン保 持部 2 3 1は、 符号発生量が上限値ひ 1を越える画像データが出現する まで、 Bピクチャの画像をのエンコード結果を第 3の置き換えパターン として更新しながら処理を進める。 ここでは、 画像 cに対する符号発生 量が α 1を越えるものとする。 画像 cのエンコード処理後、 ステップ 3 0 6の制御部 1 0 7の置き換え要否判断において置き換えが必要と判断 され、 制御部 1 0 7はピクチャタイプが Βであり、 かつ、 先行する参照 画像 a との間に他の画像 bがあるのでパターン 2と判定し、 置き換えパ ターン信号 " 3 " を発行する。 ここで、 パターン信号 " 3 " は第 3の置 き換えパターン、 つまり直前の Bピクチャである画像 bのエンコードデ ータを置き換えるデータとして指定する。 そのため、 ステップ 3 0 8の 置き換え処理により、 図 7 ( b ) に示すように、 再生画像は a, b, b, d, e となる。
置き換えるビッ トス トリームは、 画像 bに対する Bピクチャデータと 同様であり、 画像 Cの処理では、 全てのマクロブロックにおいて画像 b と同じ双方向予測を行い、 画像処理を実行する。 置き換えるデータは直 前の Bピクチャのェンコ一ドデータであり、 あらかじめ用意しておく こ とが可能であり、 データ作成は非常に高速であってリアルタイム処理が 実現可能である。 さらにデコードした結果は前方の画像 bと同じ画像に なる。 つまり一瞬だけ画像 bが連続表示されるのみであり、 見た目の違 和感を少なくできる。
なお、 上記の別のパターン 2では、 先行した Bピクチャの画像 bのェ ンコードデータを第 3の置き換えパターンとして置き換えパターン保持 部 2 3 1に保持したが、 制御部 1 0 7は、 先行した Bピクチャ画像 bの ェンコ一ドデータを描き込んだァドレスを別に保持しておく構成でも良 レ、。 つまり、 続く Bピクチャ画像 cのエンコード結果の符号化ビッ ト発 生量がひ 1を越えた場合、 制御部 1 0 7が別に保持していたァドレスに 格納されているェンコ一ドデータを画像 cのェンコ一ドデータとして続 くア ドレスにコピーする。 さらに次の Bピクチャの符号発生量も大きけ れば同様に続くァドレスにコピーする。 また置き換え処理が必要となる Bピクチャ画像が連続するときはまとめて連続するァドレスに画像 bの ェンコ一ドデータをコピーしても良い。 この別のパターン 2の置き換え 処理によっても連続する Bピクチャの符号化ビッ ト発生量はすべて上限 値ひ 1以内となり、 置き換えた Bピクチャ分だけ一瞬、 同じ画像が連続 表示されるのみであり、 見た目の違和感を少なくできる。
次に、 パターン 3を説明する。 パターン 3は、 エンコード処理を行つ た画像がピクチャコ一ディングタイプ Pで、 その画像のェンコ一ド結果 である符号発生量が α 2を越えており、 当該 Ρピクチャのェンコ一ドデ ータを、 前方の参照画像と同じデコード結果が得られるデータと置き換 えるパターンである。 このパターン 3では置き換えられた Ρピクチャは 他の画像データの参照処理には用いられないように、 当該 Pピクチャに 続く Pピクチャは置き換えた前方の参照画像を参照する。 図 8に一例を 示す。 図 8 ( a ) は時系列順に並べた置き換え処理前の画像データの様 子を示し、 図 8 ( b ) が置き換え処理後の動画表示の様子を示したもの である。 図 8 ( a ) に示すように、 ピクチャシーケンスが I, B, B , P, Pであり、 それぞれの画像を順に a, b , c, d , eとする。 パタ ーン 3は、 Pピクチャタイプである画像 dのェンコ一ドデータが符号発 生量が ο; 2より大きい場合が該当する。
パターン 3の場合の置き換えパターン信号の生成と置き換え処理につ いて述べる。パターン 1の場合の説明と同様、ェンコ一ド処理の順は I、 Ρ、 Βの順に行なわれるので a, d , e , b, c, の順で行なわれる。 画像 dのェンコ一ド処理後、 ステップ 3 0 6の制御部 1 0 7の置き換え 要否判断で置き換えが必要と判断されると、 制御部 1 0 7はピクチャタ イブが Pであるのでパターン 3と判定し、 置き換えパターン信号 " 1 " を発行し、 前方参照画像と同じデコード結果が得られるデータを置き換 えるデータとして指定する。 この置き換えパターン 3はピクチャシーケ ンス上、 参照画像 dまでのすベての画像に対して前方の参照画像と同じ デコード結果が得られるデータとの置き換えを指定し、 置き換えたデー タをエンコードデータとする。 そのため、 ステップ 3 0 8の置き換え処 理により、 図 8 ( b ) に示すように、 再生画像は a, a , a , a , eと なる。 なお、 後続する Pピクチヤである画像データ eは、 前方参照画像 として元来画像データ dを参照するものであるが、 画像データ dが画像 データ aと同じデコード結果が得られるデータに置き換えられているた め、 結局画像 aを前方の参照画像として用いることとなる。
置き換えるビットストリ一ムはパターン 1 と同様に、 全てのマクロブ ロックにおいて前方の参照画像 aから動きべク トル 0で予測を行ない、 しかも予測と実際の画像との差分が " 0 " であるというデータである。 つまり図 2において動きべク トル 2 1 7を " 0 " に、 モード情報 2 0 5 をィンターモードでかつ前方予測に、 さらに差分画像 2 0 4を全て " 0 " とするものに対応し、 よって、 D C T結果は全て " 0 "、 量子化結果は 全て " 0 " であって、 可変長符号化部 2 0 8は全て " 0 " のデータに対 して符号化を行なったものに相当する。 従って入力画像や参照画像に全 く依存しないコードであるため、 あらかじめ用意しておくことが可能で あるため、 データ作成は非常に高速であってリアルタイム処理が実現可 能である。 さらにデコードした結果は前方の参照画像 a と同じ画像にな る。 つまり一瞬だけ画像 aが連続表示されるのみであり、 見た目の違和 感を少なくできる。
以上 3つの置き換えパターンとその置き換え処理を説明した。 これら の方法は任意に組み合わせることができ、 柔軟に符号発生量を制御でき る。
上記置き換え処理を行なった場合に出力される出力ビッ トス ト リーム 1 1 1は置き換えられた画像のデコード結果がそのごく近くの画像のデ コード結果と同じになる。 つまりこれら置き換え処理はデコード結果が いずれも時間的に非常に近接した画像に置き替わるだけであり、 また時 間的に画像の順番が逆転することがないように制御されている。 よって その付近で画像が一瞬フリーズされるように感じるがプロックが大幅に 乱れるようなことはなく見ための違和感が少なくなる。 また置き換える ビットストリームは、 ソース画像データからェンコ一ドするものではな くあらかじめ用意されているものであって、 書き込みは非常に高速に行 なうことができリアルタイム処理でデータの置き換えが実現できる。 従 つてデコードしたときの違和感を最小限にとどめ、 かつ符号化ビッ ト発 生量が確実に制御できる。 なお、 本実施形態は全てピクチャ単位 (フレーム構造ではフレーム、 フィールド構造ではフィールド) の置き換え処理を前提とした説明とし たが、 より大きい範囲や小さい範囲でも適用することは可能であり符号 化ビッ ト発生量の制御として効果がある。 ただし適用範囲境界での整合 性を図り、 見た目の違和感を小さくすることが好ましい。
また、 図 3に示した処理フローは制御部 1 0 7にマイクロコードを用 いてプログラムされており、 柔軟なシステム設計が可能である。
また、 上記実施形態では、 図 3の処理フローのステップ 3 0 6の置き 換え要否判断において、 上限値をしきい値として用いて、 符号発生量と 比較して置き換え処理の要不要を判断する例としたが、 置き換え処理実 行か否かの判断処理の方法は、 符号発生量と設定した上限値の比較方法 に限られない。 例えば、 量子化ステップ、 平均輝度の値を勘案したしき い値を設定し、 そのしきい値と量子化ステップ、 平均輝度を比較して置 き換え処理の要不要を判断する構成としても良い。
なお、 本発明の可変長符号化装置は、 上記の発明の概念から逸脱する ことなく、 上記の方法及び装置に種々の変更及び変形を成し得ることが 理解されよう。 従って、 本発明は上記実施形態に限定されるものではな いことに注意する必要がある。
産業上の利用可能性
本発明の可変長符号化装置によれば、 リアルタイム処理で符号化ビッ ト発生量の上限を確実に制御でき、 符号発生量を制御してレートコント ロールが実現できる。 データの置き換え処理は非常に高速に行なうこと ができ、 かつ、 置き換え処理を行ったデータのデコード結果は近接する 画像と同じであり、 見た目の違和感がない。 さらにデータ量を確実に制 御できるためレートコントロールの破綻を心配することなく量子化ステ ップを小さくできるので通常の画像の高画質化を図ることができる。 また、 本発明の可変長符号化装置によれば、 エンコード機器側のェン コード処理で符号発生量を制御したェンコ一ドデータを生成するので、 デコード機器側で特別な構成、 仕組みを必要とせず、 規格に対応したど んなデコード機器であっても符号発生量を制御したデータのデコードが でき、 動画像を生成できる。

Claims

請求の範囲
1 . 入力されたデータを処理単位毎に可変長符号化する可変長符号化 手段と、 前記可変長符号化された可変長符号化データを一時的に記憶す るバッファリング手段と、 前記バッファリング手段に記憶された可変長 符号化データの処理単位当たりの符号発生量に応じて、 あらかじめ用意 された前記符号発生量より短い符号に置き換える符号置き換え処理手段 を具備することを特徴とする可変長符号化装置。
2 . 前記入力データの処理単位当たりの符号発生量の上限値を設定す る手段を備え、 前記符号置き換え処理手段が、 前記バッファ リ ング手段 に記憶された可変長符号化データの処理単位当たりの符号発生量が前記 上限値を越えた場合にあらかじめ用意された短い符号に置き換える処理 をする手段と、 前記バッファリング手段に記憶された可変長符号化デー タの処理単位当たりの符号発生量が前記上限値を越えない場合に符号の 置き換えを行わない処理をする手段とを備えた請求項 1に記載の可変長 符号化装置。
3 . 前記入力は動画像データのフレーム内圧縮処理またはフレーム間 圧縮処理されたデータであって、 前記処理単位は、 動画像データの 1 ピ クチャ当たりのデータである請求項 1または 2に記載の可変長符号化装
4 . 前記符号置き換え処理手段が置き換えるあらかじめ用意された短 い符号を、 すでに前記符号置き換え処理手段による処理が済んだ処理単 位にかかる置き換え処理済データと同じデコード結果が得られるものと する請求項 1〜 3いずれか 1項に記載の可変長符号化装置。
5 . 前記入力データが双方向予測符号化画像ピクチヤである場合、 前 記符号置き換え処理手段は、 前記置き換えるあらかじめ用意された短い 符号とし、 時系列上、 前方でもっとも近いフレーム内符号化画像ピクチ ャか、 前方でもっとも近い前方予測符号化画像ピクチャか、 後方でもつ とも近いフレーム内符号化画像ピクチャか、 後方でもつとも近い前方予 測符号化画像ピクチヤのうちのいずれかと同じデコード結果が得られる データを選択する請求項 4に記載の可変長符号化装置。
6 . 前記選択において後方の画像ピクチャを選んだ場合は、 前記入力 データから前記選択した後方の画像ピクチヤまでの間にある双方向予測 符号化画像ピクチャすベてを前記選択した後方の画像ピクチャと同じデ コード結果が得られるデータと置き換える請求項 5に記載の可変長符号 化装置。
7 . 前記入力データが前方予測符号化画像ピクチャである場合、 前記 符号置き換え処理手段は、 前記置き換えるあらかじめ用意された短い符 号とし、 時系列上、 前方でもっとも近いフレーム内符号化画像ピクチャ か、 前方でもっとも近い前方予測符号化画像ピクチャのうちのいずれか と同じデコード結果が得られるデータを選択し、 前記入力データである 前方予測符号化画像ピクチヤに後続する前方予測符号化画像ピクチャは、 前記選択された前方の画像ピクチャを参照する請求項 4に記載の可変長 符号化装置。
PCT/JP1999/000201 1998-01-21 1999-01-20 Variable-length encoder WO1999038262A1 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US09/600,573 US6741651B1 (en) 1998-01-21 1999-01-20 Variable-length encoder
EP99901125A EP1058391A4 (en) 1998-01-21 1999-01-20 ENCODER IN VARIABLE LENGTH
JP2000529040A JP3416649B2 (ja) 1998-01-21 1999-01-20 可変長符号化装置

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP987898 1998-01-21
JP10/9878 1998-01-21

Publications (1)

Publication Number Publication Date
WO1999038262A1 true WO1999038262A1 (en) 1999-07-29

Family

ID=11732424

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP1999/000201 WO1999038262A1 (en) 1998-01-21 1999-01-20 Variable-length encoder

Country Status (6)

Country Link
US (1) US6741651B1 (ja)
EP (1) EP1058391A4 (ja)
JP (1) JP3416649B2 (ja)
KR (1) KR100384102B1 (ja)
CN (1) CN1169304C (ja)
WO (1) WO1999038262A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009075326A1 (ja) * 2007-12-11 2009-06-18 Nippon Telegraph And Telephone Corporation 符号化方法、復号化方法、これらの方法を用いた装置、プログラム、記録媒体

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003230148A (ja) * 2002-02-01 2003-08-15 Mitsubishi Electric Corp 画像データ符号化装置
JP2005333609A (ja) 2004-04-22 2005-12-02 Sanyo Electric Co Ltd 符号化制御回路及び符号化回路
US7936938B2 (en) * 2004-09-07 2011-05-03 Canon Kabushiki Kaisha Methods and devices for encoding a digital image signal and associated decoding methods and devices
WO2006049408A2 (en) * 2004-11-02 2006-05-11 Lg Electronics Inc. Recording medium, and method and apparatus for reproducing data from the recording medium
JP4825644B2 (ja) * 2006-11-14 2011-11-30 ルネサスエレクトロニクス株式会社 画像復号装置、画像符号化装置、およびシステムlsi
JP4987080B2 (ja) * 2007-07-17 2012-07-25 日本電信電話株式会社 映像符号化装置および方法、映像符号化プログラムおよびそのプログラムを記録した記録媒体
US9578333B2 (en) 2013-03-15 2017-02-21 Qualcomm Incorporated Method for decreasing the bit rate needed to transmit videos over a network by dropping video frames

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH039684A (ja) * 1989-06-06 1991-01-17 Nec Corp フレーム間予測符号化装置の発生情報制御方式
JPH0568243A (ja) * 1991-09-09 1993-03-19 Hitachi Ltd 可変長符号化制御方式
JPH0738888A (ja) * 1993-07-02 1995-02-07 Oki Electric Ind Co Ltd 動画像復号化装置
JPH0823535A (ja) * 1994-07-05 1996-01-23 Matsushita Electric Ind Co Ltd ビデオ符号化方法
JPH0898138A (ja) * 1994-09-26 1996-04-12 Mitsubishi Electric Corp ディジタル映像信号記録再生装置
JPH08137817A (ja) * 1994-11-10 1996-05-31 Nissan Motor Co Ltd データ通信方法
JPH08265751A (ja) * 1995-03-24 1996-10-11 Nippon Steel Corp Mpeg方式による画像再生器
JPH08275158A (ja) * 1995-03-27 1996-10-18 Internatl Business Mach Corp <Ibm> 保証されたビット発生限界を有する動画像圧縮システム
JPH09200749A (ja) * 1995-11-16 1997-07-31 Hitachi Denshi Ltd 符号化復号化システム

Family Cites Families (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2016641C (en) * 1989-05-12 1995-07-11 Toshiyuki Tanoi Adaptive interframe prediction coded video communications system
JP2969867B2 (ja) * 1990-08-31 1999-11-02 ソニー株式会社 ディジタル画像信号の高能率符号化装置
US5440344A (en) 1992-04-28 1995-08-08 Mitsubishi Denki Kabushiki Kaisha Video encoder using adjacent pixel difference for quantizer control
JP3208601B2 (ja) 1992-06-25 2001-09-17 三菱電機株式会社 高能率符号化装置
DE69330043T2 (de) * 1992-10-28 2001-07-19 Victor Company Of Japan Kodiervorrichtung und -verfahren mit variablen Übertragungsraten
JP2897585B2 (ja) 1993-03-29 1999-05-31 松下電器産業株式会社 画像符号化記録再生装置
JPH07107479A (ja) 1993-10-04 1995-04-21 Sanyo Electric Co Ltd 画像符号化装置
JPH0837662A (ja) * 1994-07-22 1996-02-06 Hitachi Ltd 画像符号化復号化装置
CN1158865C (zh) 1994-09-26 2004-07-21 三菱电机株式会社 数字视频信号的记录和重放设备及其记录和重放的方法
US6104754A (en) * 1995-03-15 2000-08-15 Kabushiki Kaisha Toshiba Moving picture coding and/or decoding systems, and variable-length coding and/or decoding system
KR0185927B1 (ko) * 1995-09-29 1999-05-01 김광호 입력비트열의 프레임레이트를 변환하는 영상복호화장치 및 방법
US5959672A (en) * 1995-09-29 1999-09-28 Nippondenso Co., Ltd. Picture signal encoding system, picture signal decoding system and picture recognition system
JPH09107547A (ja) 1995-10-09 1997-04-22 Hitachi Ltd 既圧縮動画データ量削減装置および既圧縮動画データ量削減システムならびに既圧縮動画データ量削減方法
EP0774869A3 (en) 1995-11-16 1999-09-29 Hitachi Denshi Kabushiki Kaisha Image data coding/decoding system
US5956088A (en) * 1995-11-21 1999-09-21 Imedia Corporation Method and apparatus for modifying encoded digital video for improved channel utilization
WO1997039588A1 (en) * 1996-04-12 1997-10-23 Sony Corporation Image encoder, image encoding method and medium on which image encoding program is recorded
US5821887A (en) * 1996-11-12 1998-10-13 Intel Corporation Method and apparatus for decoding variable length codes
JPH10336670A (ja) * 1997-04-04 1998-12-18 Sony Corp 画像伝送装置および画像伝送方法、提供媒体
CN1198457C (zh) * 1998-03-17 2005-04-20 松下电器产业株式会社 图象信号处理装置

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH039684A (ja) * 1989-06-06 1991-01-17 Nec Corp フレーム間予測符号化装置の発生情報制御方式
JPH0568243A (ja) * 1991-09-09 1993-03-19 Hitachi Ltd 可変長符号化制御方式
JPH0738888A (ja) * 1993-07-02 1995-02-07 Oki Electric Ind Co Ltd 動画像復号化装置
JPH0823535A (ja) * 1994-07-05 1996-01-23 Matsushita Electric Ind Co Ltd ビデオ符号化方法
JPH0898138A (ja) * 1994-09-26 1996-04-12 Mitsubishi Electric Corp ディジタル映像信号記録再生装置
JPH08137817A (ja) * 1994-11-10 1996-05-31 Nissan Motor Co Ltd データ通信方法
JPH08265751A (ja) * 1995-03-24 1996-10-11 Nippon Steel Corp Mpeg方式による画像再生器
JPH08275158A (ja) * 1995-03-27 1996-10-18 Internatl Business Mach Corp <Ibm> 保証されたビット発生限界を有する動画像圧縮システム
JPH09200749A (ja) * 1995-11-16 1997-07-31 Hitachi Denshi Ltd 符号化復号化システム

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP1058391A4 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009075326A1 (ja) * 2007-12-11 2009-06-18 Nippon Telegraph And Telephone Corporation 符号化方法、復号化方法、これらの方法を用いた装置、プログラム、記録媒体
US8068042B2 (en) 2007-12-11 2011-11-29 Nippon Telegraph And Telephone Corporation Coding method, decoding method, and apparatuses, programs and recording media therefor
JP4825916B2 (ja) * 2007-12-11 2011-11-30 日本電信電話株式会社 符号化方法、復号化方法、これらの方法を用いた装置、プログラム、記録媒体
US8653991B2 (en) 2007-12-11 2014-02-18 Nippon Telegraph And Telephone Corporation Coding method, decoding method, and apparatuses, programs and recording media therefor

Also Published As

Publication number Publication date
EP1058391A1 (en) 2000-12-06
EP1058391A4 (en) 2006-01-25
KR100384102B1 (ko) 2003-05-14
CN1169304C (zh) 2004-09-29
US6741651B1 (en) 2004-05-25
JP3416649B2 (ja) 2003-06-16
KR20010034304A (ko) 2001-04-25
CN1294786A (zh) 2001-05-09

Similar Documents

Publication Publication Date Title
JP2012502590A (ja) 構成参照フレームを用いた動画符号化システムおよび方法
JPH09247681A (ja) 動画像復号方法および動画像復号装置
JP2000102008A (ja) ビットレ―ト制御方法
JP2001054110A (ja) 信号処理装置、信号処理方法及びコンピュータプログラム製品
WO1999038262A1 (en) Variable-length encoder
WO2015188585A1 (zh) 图像编码方法和装置以及图像解码方法和装置
KR20000023504A (ko) 가변비트율 부호화장치
JP4010617B2 (ja) 画像復号化装置及び画像復号化方法
JP2003348594A (ja) 画像復号装置及び方法
JP3487205B2 (ja) 画像データ編集装置
JPH11308617A (ja) ディジタル画像符号化装置とこれに用いる動きベクトル検出装置
JP2000261809A (ja) 画像特徴に応じた画像符号化装置
JP2002199408A (ja) 動画像符号化方法および動画像符号化装置
JPH0744686B2 (ja) 可変伝送速度画像符号化装置
JPH08154250A (ja) 動画像符号化装置
JP3307367B2 (ja) 可変転送レート符号化装置
JP2004015351A (ja) 符号化装置及び方法、プログラム、記録媒体
KR20040066397A (ko) 디지털 영상압축 시스템 및 그 방법
KR200309401Y1 (ko) 디지털 영상압축 시스템
JP2001258039A (ja) 可変画像レート符号化装置、可変画像レート復号化装置、可変画像レート符号化方法、及び可変画像レート復号化方法
JP2010239230A (ja) 画像符号化装置
JP3507042B2 (ja) 動画像圧縮装置
JP2001094937A (ja) 画像記録装置及び方法並びに記憶媒体
JP2000270333A (ja) 画像信号符号化装置
JP2000287212A (ja) 画像符号化装置

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 99804260.9

Country of ref document: CN

AK Designated states

Kind code of ref document: A1

Designated state(s): CN JP KR US

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): AT BE CH CY DE DK ES FI FR GB GR IE IT LU MC NL PT SE

DFPE Request for preliminary examination filed prior to expiration of 19th month from priority date (pct application filed before 20040101)
121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 09600573

Country of ref document: US

WWE Wipo information: entry into national phase

Ref document number: 1020007008022

Country of ref document: KR

WWE Wipo information: entry into national phase

Ref document number: 1999901125

Country of ref document: EP

WWP Wipo information: published in national office

Ref document number: 1999901125

Country of ref document: EP

WWP Wipo information: published in national office

Ref document number: 1020007008022

Country of ref document: KR

WWR Wipo information: refused in national office

Ref document number: 1020007008022

Country of ref document: KR