CN100477794C - Moving picture coding device, coding method thereof, and moving picture imaging device - Google Patents
Moving picture coding device, coding method thereof, and moving picture imaging device Download PDFInfo
- Publication number
- CN100477794C CN100477794C CN 200510102459 CN200510102459A CN100477794C CN 100477794 C CN100477794 C CN 100477794C CN 200510102459 CN200510102459 CN 200510102459 CN 200510102459 A CN200510102459 A CN 200510102459A CN 100477794 C CN100477794 C CN 100477794C
- Authority
- CN
- China
- Prior art keywords
- frame
- quantization step
- encoding
- coding
- amount
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
当帧n+1在帧n已经进行了帧间编码后将进行帧间编码时(步骤S141:帧间),运动图像编码装置采用第一方法基于帧n产生的编码量确定用于量化帧n+1的量化步长Q[n+1](步骤S143)。当帧n+1在帧n已经帧内编码后(步骤S142:帧内)将进行帧间编码时,运动图像编码装置采用第二方法基于帧n产生的编码量确定用于量化帧n+1的量化步长Q[n+1](步骤S144)。通过采用第二方法确定的量化步长获得的值小于通过采用第一方法确定的量化步长。
When frame n+1 will be inter-frame encoded after frame n has been inter-frame encoded (step S141: inter-frame), the moving image encoding device uses the first method to determine the amount of code used to quantize frame n based on the code amount generated by frame n. +1 quantization step size Q[n+1] (step S143). When frame n+1 will be inter-frame encoded after frame n has been intra-frame encoded (step S142: intra-frame), the moving image encoding device uses the second method to determine the amount of code used to quantize frame n+1 based on the code amount generated by frame n. The quantization step size Q[n+1] (step S144). The value obtained by using the quantization step size determined by using the second method is smaller than the value obtained by using the quantization step size determined by using the first method.
Description
技术领域 technical field
本发明涉及运动图像编码装置、运动图像编码方法以及用于编码运动图像的运动图像的成像装置。本发明尤其涉及在量化运动图像数据中使用的用于确定量化步长的技术。The present invention relates to a moving picture coding device, a moving picture coding method, and a moving picture imaging device for coding a moving picture. In particular, the present invention relates to a technique for determining a quantization step size used in quantizing moving image data.
背景技术 Background technique
通常,运动图像成像装置配备有用于压缩运动图像成像装置具有的运动图像数据的运动图像编码装置。该运动图像编码装置通过量化来压缩数据。量化是一种由离散的代表值代替数据值来压缩数据的方法。代表值之间的间隔由称为量化步长的参数限定。随着量化步长的增大,压缩率也随之变高(即,编码大小变小)。Generally, a moving image imaging device is equipped with a moving image encoding device for compressing moving image data that the moving image imaging device has. This video encoding device compresses data by quantization. Quantization is a method of compressing data by replacing data values with discrete representative values. The interval between representative values is defined by a parameter called the quantization step size. As the quantization step size increases, the compression ratio becomes higher (ie, the code size becomes smaller).
根据运动图像编码装置的传统模型的实施例,对于帧内编码的帧(所谓的I图像)采用固定值作为量化步长以确定用于各帧间编码的帧(所谓的P图像或B图像)的不同量化步长(例如参见ISO/IEC-14496-2)。为了确定用于帧间编码的各帧的量化步长,使用下述公式1。According to an embodiment of a conventional model of a moving picture coding apparatus, a fixed value is used as a quantization step size for intra-coded frames (so-called I-pictures) to determine frames for each inter-frame coding (so-called P-pictures or B-pictures) different quantization step sizes (see for example ISO/IEC-14496-2). In order to determine the quantization step size of each frame used for inter-coding, the following
Qp[n+1]=(Cn/dstC)*Qp[n] 公式1Qp[n+1]=(Cn/dstC)*Qp[n]
在该公式中,Qp[n]为用于第n帧量化的量化步长,Cn为在第n帧产生的编码量,并且dstC为对于一个帧预定要产生的编码的目标量。In this formula, Qp[n] is the quantization step size for quantization of the n-th frame, Cn is the generated code amount of the n-th frame, and dstC is the target amount of codes scheduled to be generated for one frame.
根据公式1,用于第n+1帧的量化步长Qn[n+1]随着在第n帧产生的编码量Cn和目标编码量dstC比值变大而变大。公式1以抑制在n+1帧产生的编码量的方式工作。通过以上述方式为各帧确定量化步长,所述运动图像编码装置使帧间编码帧产生的编码量更接近于产生的目标编码量。According to
因为帧内编码帧产生的编码量很大程度上影响图像质量,对于要进行帧内编码的帧的量化步长通常确定为使产生于这些帧的编码量大于目标编码量。在这种情况下,上述运动图像编码装置设法抑制在紧跟于帧间编码帧(帧1)之后的帧2产生的编码量。因此,帧2产生的编码量小于目标编码量。然后,运动图像编码装置使产生于帧3的编码量大于目标编码量。如上所述,通过常规的运动图像编码装置,在跟随于帧内编码帧之后的几个帧中产生的编码量存在波动(hunting)。Because the amount of code generated by intra-coded frames largely affects image quality, the quantization step size for frames to be intra-coded is usually determined so that the code amount generated by these frames is greater than the target code amount. In this case, the above-described moving image encoding device tries to suppress the amount of encoding generated in
图1A和图1B所示为在传统的运动图像编码装置中产生于各帧的编码量和图像质量变化图。FIG. 1A and FIG. 1B are graphs showing changes in the amount of coding and image quality for each frame in a conventional moving picture coding apparatus.
在该实施例中,帧1、11和21为帧内编码帧,其他帧为帧间编码帧。图中,在紧跟在帧内编码帧后的四个帧中可以观察到如上所述的产生的编码量的波动(图1A)。In this embodiment,
通常,随着产生的编码量的增加,图像质量逐渐得到改善。因此,产生的编码量的波动使图像质量不稳定(图1B)。因此,该图像变得难以观看。In general, image quality gradually improves as the amount of codes produced increases. Therefore, fluctuations in the generated encoding amount destabilize image quality (FIG. 1B). Therefore, the image becomes difficult to view.
该问题不限于对于各帧确定量化步长的模型,在各块线(位于图像矩阵中的宏块的线)中确定量化步长的模型中也存在这样的问题。This problem is not limited to the model in which the quantization step size is determined for each frame, but also exists in the model in which the quantization step size is determined in each block line (line of a macroblock located in the image matrix).
发明内容 Contents of the invention
本发明的目的为提供可以抑制在紧跟随于帧内编码帧之后的几个帧中产生的编码量的波动的运动图像编码装置、运动图像编码方法以及运动图像的成像装置。An object of the present invention is to provide a moving picture coding device, a moving picture coding method, and a moving picture imaging device capable of suppressing fluctuations in the amount of coding generated in several frames immediately following an intra-coded frame.
根据本发明的运动图像编码装置包括用于对运动图像的多个帧中各帧数据选择性地进行帧间编码或帧内编码的编码单元,该帧内编码和帧间编码均包括量化;用于根据第一帧产生的编码量确定用于第二帧数据量化的量化步长的确定单元,其中当编码单元对第二帧的数据进行帧间编码时,如果第一帧的数据已经进行帧间编码,通过采用(i)第一方法做出决定,或者如果第一帧的数据已经进行帧内编码采用(ii)第二方法作出决定,通过采用第二方法确定的量化步长得到的值小于通过采用第一方法确定的量化步长得到的值。The moving picture coding device according to the present invention includes a coding unit for selectively performing inter-frame coding or intra-frame coding on each frame data of a plurality of frames of a moving picture, and the intra-frame coding and inter-frame coding both include quantization; The determining unit is based on determining the quantization step size used for quantizing the data of the second frame according to the amount of code generated in the first frame, wherein when the encoding unit performs inter-frame encoding on the data of the second frame, if the data of the first frame has been frame-encoded Inter-coding, determined by (i) the first method, or (ii) the second method if the data of the first frame has been intra-coded, by using the value obtained by the quantization step size determined by the second method is smaller than the value obtained by using the quantization step size determined by the first method.
根据上述结构,当第一帧为帧内编码时,采用第二方法确定第二帧的量化步长。因此,第二帧的量化步长小于采用第一方法的情况。According to the above structure, when the first frame is intra-frame encoded, the second method is used to determine the quantization step size of the second frame. Therefore, the quantization step size of the second frame is smaller than that of the first method.
在传统技术中,第二帧的量化步长采用同样的方法确定(即,第一方法),而不考虑在第一帧中执行的预测编码的类型。In the conventional technique, the quantization step size of the second frame is determined by the same method (ie, the first method), regardless of the type of predictive coding performed in the first frame.
另一方面,在本发明中第二帧的量化步长变得比传统技术的量化步长小,并且因此可以减少第二帧中产生的编码量的突然降低。因此,可以抑制在跟随于帧内编码帧之后的几帧中产生的编码量的波动。On the other hand, in the present invention, the quantization step size of the second frame becomes smaller than that of the conventional art, and thus the sudden decrease in the amount of encoding generated in the second frame can be reduced. Therefore, it is possible to suppress fluctuations in the amount of encoding generated in several frames following the intra-coded frame.
上述运动图像编码装置也可以使得第二方法以通过采用第二方法确定的量化步长落入采用第一方法确定的量化步长1/5到1/3的范围的方式设置。The above moving image coding apparatus may also cause the second method to be set in such a manner that the quantization step size determined by using the second method falls within the range of 1/5 to 1/3 of the quantization step size determined by using the first method.
通常,如果使用同样的量化步长,帧内编码帧中产生的编码量为帧间编码帧中产生的编码量三到五倍。根据上述结构,第二帧的量化步长大致一样,不论第一帧为帧内编码还是帧间编码。具体地,即使当第一帧为帧内编码时,在确定量化步长时也要像第一帧为帧间编码一样来处理。通常,在帧间编码的帧的部分不会经常发生波动。因此,通过应用上述结构,可以抑制第二帧之后的多帧产生的编码量的波动。Typically, if the same quantization step size is used, the amount of codes produced in an intra-coded frame is three to five times that of an inter-coded frame. According to the above structure, the quantization step size of the second frame is roughly the same regardless of whether the first frame is intra-frame encoded or inter-frame encoded. Specifically, even when the first frame is intra-frame encoded, the quantization step size should be determined as if the first frame is inter-frame encoded. Typically, the portion of the frame coded between frames does not fluctuate very often. Therefore, by applying the above structure, it is possible to suppress fluctuations in the amount of encoding generated in the frames after the second frame.
上述运动图像编码装置可以进一步包括用于在(i)产生于第一帧和先于第一帧的各帧中的累积编码量和(ii)第一帧和先于第一帧的各帧中预定编码的累积目标量之间获得差值的差值获得单元,其中第一方法和第二方法以确定的量化步长随着产生的编码量的差值变大而增加的方式设置。The above-mentioned moving image coding apparatus may further include a method for calculating (i) the cumulative code amount generated in the first frame and frames preceding the first frame and (ii) the first frame and frames preceding the first frame A difference obtaining unit that obtains a difference between cumulative target amounts of predetermined encoding, wherein the first method and the second method are set in such a manner that the determined quantization step size increases as the difference of generated encoding amounts becomes larger.
根据上述结构,随着累积产生的编码量和累积目标编码量之间的差值变大,第二帧的量化步长也变大。具体地,使其起作用以抑制产生于第二帧的编码量。因此,累积产生的编码量改变以大致和累积目标编码量相当。因此,可以使产生的编码量接近于对于整个运动图像的目标编码量。According to the above structure, as the difference between the accumulatively generated code amount and the cumulative target code amount becomes larger, the quantization step size of the second frame also becomes larger. Specifically, it is made to function to suppress the amount of encoding generated in the second frame. Therefore, the accumulatively generated code amount changes to roughly correspond to the cumulative target code amount. Therefore, the generated code amount can be made close to the target code amount for the entire moving image.
上述运动图像编码装置也可以为在累积产生的编码量小于累积目标编码量时,以量化步长随着产生编码量的变大而变大的方式设置第一和第二方法,而不考虑差值。The above-mentioned moving image coding apparatus may set the first and second methods in such a manner that the quantization step size becomes larger as the generated code amount becomes larger when the cumulatively generated coded amount is smaller than the accumulated target coded amount, regardless of the difference. value.
在运动图像中,当帧之间的相关性很高时,在各帧中产生的编码量相对于目标编码量降低。然而,根据上述结构,即使在这种情况下,产生的编码量也不会提高,并且可以在存储器容量中存在多余的自由空间。这时,即使在各帧之间的相关性突然下降时也可以避免存储器容量的溢出。In moving images, when the correlation between frames is high, the amount of codes generated in each frame decreases with respect to the target code amount. However, according to the above structure, even in this case, the generated encoding amount does not increase, and there may be an excess free space in the memory capacity. At this time, overflow of the memory capacity can be avoided even when the correlation between frames suddenly drops.
运动图像编码装置可以进一步包括用于存储运动图像的编码数据的缓冲器,其中当该缓冲器具有大于预定大小的自由空间(free space)时,该第一和第二方法以量化步长随着产生编码量的变大而变大的方式设置,而不考虑差值量。The moving image coding apparatus may further include a buffer for storing encoded data of moving images, wherein when the buffer has a free space larger than a predetermined size, the first and second methods follow the quantization step size Set in such a way that the amount of encoding becomes larger and larger, regardless of the amount of difference.
根据上述结构,当自由空间为预定尺寸或更大时,该装置工作以抑制产生于第二帧的编码量。因此,可以避免缓冲器的溢出。According to the above structure, when the free space is a predetermined size or more, the device operates to suppress the amount of encoding generated in the second frame. Therefore, overflow of the buffer can be avoided.
该上述运动图像编码装置也可以为在编码单元将对第二帧的数据进行帧内编码时,确定单元设定固定值为量化步长。In the above moving image encoding device, when the encoding unit performs intra-frame encoding on the data of the second frame, the determination unit sets a fixed value as the quantization step size.
根据上述的结构,在帧进行帧内编码时不必每次都确定量化步长。因此,可以缩小运动图像编码装置的电路尺寸。According to the above structure, it is not necessary to determine the quantization step size each time a frame is intra-coded. Therefore, the circuit size of the video encoding device can be reduced.
上述运动图像编码装置也可以为当编码单元在编码第一帧的数据以后将对第二帧数据进行帧内编码时,确定单元通过采用第三方法确定量化步长,通过采用第三方法确定的量化步长获得的值大于通过第一方法确定的值。The above moving image encoding device may also be that when the encoding unit performs intra-frame encoding on the second frame data after encoding the data of the first frame, the determination unit determines the quantization step size by using the third method, and the quantization step size determined by the third method The value obtained by the quantization step size is larger than the value determined by the first method.
根据上述结构,第二帧的量化步长采用第三方法确定。通过采用该方法,和使用第一方法的情况比较第二帧的量化步长变大。因此,产生于第二帧的编码量比在采用第一方法时变小,并且可以避免在第二帧产生的编码量变得过大。According to the above structure, the quantization step size of the second frame is determined by the third method. By adopting this method, the quantization step size of the second frame becomes larger compared with the case of using the first method. Therefore, the amount of codes generated in the second frame becomes smaller than when the first method is used, and the amount of codes generated in the second frame can be prevented from becoming excessively large.
上述运动图像编码装置可以进一步包括用于存储运动图像的编码数据的缓冲器,其中当编码单元在编码第一帧数据以后对第二帧的数据进行帧内编码时,(i)如果缓冲器具有大于预定大小的自由空间,确定单元设定量化步长为固定值,并且(ii)如果缓冲器存在的自由空间为预定大小或更小,确定单元通过采用第三方法确定量化步长,通过采用第三方法确定的量化步长获得的值大于通过第一方法确定的值。The above-mentioned moving image encoding device may further include a buffer for storing encoded data of the moving image, wherein when the encoding unit intra-encodes the data of the second frame after encoding the first frame data, (i) if the buffer has greater than a predetermined size of the free space, the determination unit sets the quantization step to a fixed value, and (ii) if the free space in which the buffer exists is a predetermined size or less, the determination unit determines the quantization step by using a third method, by using The quantization step determined by the third method obtains a value larger than that determined by the first method.
根据上述结构,可以根据缓冲器自由空间的大小调整帧内编码帧产生的编码量。因此,可以避免缓冲器的溢出。According to the above structure, the amount of codes generated by the intra-coded frames can be adjusted according to the size of the buffer free space. Therefore, overflow of the buffer can be avoided.
上述运动图像编码装置可以为当编码单元在编码第一帧数据后对第二帧数据进行帧内编码时,确定单元基于用于第一帧量化的量化步长确定第二帧的量化步长,而不考虑产生的编码量。The above moving image encoding device may be that when the encoding unit performs intra-coding on the second frame data after encoding the first frame data, the determining unit determines the quantization step size of the second frame based on the quantization step size used for quantization of the first frame, Regardless of the amount of code produced.
根据上述结构,不考虑在第一帧中产生的编码量确定量化步长。因此,和根据产生的编码量确定量化步长的情况比较,可以减少运动图像编码装置的处理量(processing load)。According to the above structure, the quantization step size is determined regardless of the amount of codes generated in the first frame. Therefore, compared with the case where the quantization step size is determined based on the amount of generated codes, it is possible to reduce the processing load of the video coding device.
上述运动图像编码装置也可以为当编码单元在编码第一帧数据以后对第二帧数据进行帧内编码时,确定单元通过由预定值乘以用于第一帧的量化步长确定用于第二帧的量化步长。The above moving image encoding device may also be such that when the encoding unit intra-encodes the second frame data after encoding the first frame data, the determination unit determines the quantization step size for the first frame by multiplying the predetermined value by the quantization step size for the first frame. The quantization step size of two frames.
根据上述结构,基于第一帧的量化步长确定用于第二帧的量化步长。According to the above structure, the quantization step size for the second frame is determined based on the quantization step size for the first frame.
上述运动图像编码装置也可以为:预定值在5/4到4/3范围内。In the above moving image encoding device, the predetermined value may also be in the range of 5/4 to 4/3.
根据上述结构,随着预定值变大,对于帧内编码帧产生的编码量的抑制效果得到改善,但是图像质量变差。仿真结果表明通过将预定值设定在5/4到4/3的范围内可以既可以获得帧内编码帧产生的编码量的抑制效果又能获得极好的图像质量。According to the above structure, as the predetermined value becomes larger, the suppressing effect on the amount of codes generated by intra-coded frames is improved, but the image quality is deteriorated. The simulation results show that by setting the predetermined value in the range of 5/4 to 4/3, it is possible to obtain both the suppression effect of the code amount produced by the intra-coded frame and excellent image quality.
上述运动图像编码装置可以进一步包括记录单元,用于记录表示在第一帧的量化步长和第二帧量化步长之间的对应关系的表,其中确定单元参照该表基于用于第一帧的量化步长确定用于第二帧的量化步长。The above moving image coding apparatus may further include a recording unit for recording a table representing a correspondence relationship between the quantization step size of the first frame and the quantization step size of the second frame, wherein the determination unit refers to the table based on The quantization step size of determines the quantization step size used for the second frame.
根据上述结构,可以基于用于第一帧的量化步长确定用于第二帧的量化步长。According to the above structure, the quantization step size for the second frame can be determined based on the quantization step size for the first frame.
上述运动图像编码装置也可以为:确定单元基于除用于第一帧的量化步长之外还有用在预定数量的前帧的各量化步长确定用于第二帧的量化步长。The above moving image encoding device may be such that the determining unit determines the quantization step for the second frame based on quantization steps used for a predetermined number of preceding frames in addition to the quantization step for the first frame.
通过基于不止一帧确定的量化步长,虽然提高了运动图像编码装置的处理量,但是可以改善抑制波动的效果。By determining the quantization step size based on more than one frame, although the throughput of the moving image encoding device is increased, the effect of suppressing fluctuations can be improved.
此外,根据本发明的运动图像编码装置包括:用于对运动图像中多个块线的各数据选择性地进行帧间编码或帧内编码的编码单元,帧间编码和帧内编码均包括量化;校正单元,用于(i)采用第一方法对预定数量的编码块线中的一个或多个帧间编码块线中产生的编码量进行校正,以及(ii)采用第二方法对预定量的编码块线中的一个或多个帧内编码块线产生的编码量进行校正,通过采用第二方法校正后的一个或多个帧内编码块线产生的编码量获得的值小于通过第一方法校正后的值;以及确定单元,当编码单元要帧间编码下一块线的数据时,用于基于已校正的帧内编码块线和帧间编码块线产生的编码总量确定要用于下一块线数据量化的量化步长。In addition, the moving picture coding device according to the present invention includes: a coding unit for selectively performing inter-frame coding or intra-frame coding on each data of a plurality of block lines in the moving picture, and both the inter-frame coding and the intra-frame coding include quantization a correction unit, used for (i) correcting the coding amount generated in one or more inter-frame coding block lines in the predetermined number of coding block lines by using the first method, and (ii) using the second method to correct the predetermined amount Correct the code amount generated by one or more intra-frame coded block lines in the coded block line, and the value obtained by the coded amount generated by one or more intra-frame coded block lines corrected by the second method is smaller than that obtained by the first method The corrected value of the method; and the determination unit, when the coding unit is to inter-code the data of the next block line, it is used to determine the total amount of codes to be used based on the corrected intra-frame coding block line and the inter-frame coding block line. The quantization step size of the next line data quantization.
根据上述结构,和不考虑编码方法校正产生的编码量的情况相比较,用于要编码的下一块线的量化步长可以更小。因此在进行编码时在块线中产生的编码量不容易降低。因此,可以抑制在紧跟于帧内编码块之后的几个块线中产生的编码量的波动。According to the above structure, the quantization step size for the next line to be encoded can be made smaller compared to the case where the amount of encoding produced by the encoding method is not corrected. Therefore, the amount of codes generated in the block lines when coding is not easily reduced. Therefore, it is possible to suppress fluctuations in the amount of encoding generated in several block lines immediately following the intra-encoded block.
上述运动图像编码装置也可以为:以通过采用第二方法在一个或多个帧间编码块线中产生的编码量落入通过采用第一方法校正的编码量的1/5到1/3的范围内的方式设定第二方法。The above-mentioned moving picture coding apparatus may also be: such that the code amount generated in one or more inter-frame coding block lines by using the second method falls within 1/5 to 1/3 of the code amount corrected by using the first method The method within the range is set to the second method.
通常,如果使用同样的量化步长,帧内编码块线产生的编码量大于帧间编码块线中产生的编码量的三到五倍。根据上述结构,即使当第一块线为帧内编码时,在确定第二块线量化步长时也要像第一帧为帧间编码一样来处理。通常,在帧间编码块线的部分不会经常发生波动。因此,通过应用上述结构,可以抑制在第二块线之后的多块线产生的编码量的波动。In general, if the same quantization step size is used, the amount of code produced by intra-coding block lines is three to five times greater than that produced by inter-coded block lines. According to the above structure, even when the first block line is intra-frame encoded, the determination of the quantization step size of the second block line is handled as if the first frame was inter-frame encoded. Typically, the part of the inter-coded block line does not fluctuate very often. Therefore, by applying the above structure, it is possible to suppress fluctuations in the amount of encoding generated by the multi-block lines subsequent to the second block line.
根据本发明的运动图像成像装置包括用于采集目标图像以产生运动图像的成像器件;用于对运动图像的多帧中的各数据选择性地进行帧间编码或帧内编码的编码单元,帧间编码和帧内编码均包括量化;用于根据产生于第一帧的编码量确定用于第二帧数据量化的量化步长的确定单元,其中当编码单元对第二帧的数据进行帧间编码时,(i)通过如果第一帧的数据已经帧间编码,采用第一方法作出决定,或者(ii)如果第一帧的数据已经帧内编码采用第二方法作出决定,通过采用第二方法确定的量化步长得到的值小于通过采用第一方法确定的量化步长得到的值。A moving image imaging device according to the present invention includes an imaging device for capturing an image of a target to generate a moving image; an encoding unit for selectively performing inter-frame encoding or intra-frame encoding on each data in a plurality of frames of the moving image, the frame Both inter-coding and intra-frame coding include quantization; a determination unit for determining a quantization step size for quantization of second frame data according to the amount of coding generated in the first frame, wherein when the coding unit performs inter-frame encoding on the data of the second frame When encoding, either (i) make a decision by using the first method if the data of the first frame has been inter-coded, or (ii) make a decision by using the second method if the data of the first frame has been intra-coded, by using the second The quantization step size determined by the method results in a smaller value than the quantization step size determined by using the first method.
此外,根据本发明运动图像成像装置包括:成像器件,用于采集目标图像以产生运动图像;编码单元,用于对运动图像的多个块线中的各数据选择性地进行帧间编码或帧内编码,其中帧间编码和帧内编码均包括量化;校正单元,用于(i)采用第一方法校正在预定数量的编码块线中的一个或多个帧间编码块线产生的编码量,以及(ii)采用第二方法校正在预定数量的编码块线中的一个或多个帧内编码块线产生的编码量,通过采用第二方法校正的产生于一个或多个帧内编码块线的编码量获得的值小于通过第一方法校正的编码量;以及确定单元长,当编码单元要帧间编码下一块线的数据时,用于基于已校正的帧内编码块线和帧间编码块线产生的编码总量确定用于下一块线数据量化的量化步长。In addition, according to the present invention, the moving picture imaging device includes: an imaging device for capturing an object image to generate a moving picture; a coding unit for selectively performing inter-frame coding or frame encoding on each data in a plurality of block lines of the moving picture Intra-coding, wherein both inter-frame coding and intra-frame coding include quantization; a correction unit for (i) correcting the amount of code generated by one or more inter-coded block lines among the predetermined number of coded block lines using a first method , and (ii) using the second method to correct the amount of code generated in one or more intra-frame coding block lines among the predetermined number of coding block lines, by using the second method to correct the code amount generated in one or more intra-frame coding block lines The value obtained by the coding amount of the line is smaller than the coding amount corrected by the first method; and determining the unit length, when the coding unit is to inter-code the data of the next line, it is used to encode the block line based on the corrected intra-frame and the inter-frame The total amount of codes produced by an encoded block line determines the quantization step size used for quantization of the next block line data.
根据上述结构,可以获得和上述运动图像编码装置一样的效果。According to the above structure, the same effect as that of the above-mentioned moving picture encoding device can be obtained.
根据本发明的运动图像编码方法包括:编码步骤,选择性地对运动图像的多帧中的各数据进行帧间编码或帧内编码,其中帧间编码和帧内编码均包括量化;确定步骤,根据产生于第一帧的编码量确定第二帧数据量化的量化步长,其中当对第二帧的数据进行帧间编码时,通过(i)如果第一帧的数据已经帧间编码,采用第一方法作出决定,或者(ii)如果第一帧的数据已经帧内编码采用第二方法作出决定,其中,通过采用第二方法确定的量化步长得到的值小于通过采用第一方法确定的量化步长得到的值。The moving image encoding method according to the present invention includes: an encoding step of selectively performing inter-frame encoding or intra-frame encoding on each data in multiple frames of the moving image, wherein both the inter-frame encoding and the intra-frame encoding include quantization; the determining step, The quantization step size of the data quantization of the second frame is determined according to the amount of coding generated in the first frame, wherein when the data of the second frame is inter-frame encoded, by (i) if the data of the first frame has been inter-frame encoded, adopt The decision is made by the first method, or (ii) if the data of the first frame has been intra-coded, the decision is made by the second method, wherein the value obtained by the quantization step determined by the second method is smaller than the value determined by the first method The value obtained by the quantization step size.
此外,根据本发明的运动图像编码方法包括:编码步骤,选择性地对运动图像中多块线的各数据进行帧间编码或帧内编码,其中帧间编码和帧内编码均包括量化;校正步骤,(i)采用第一方法校正在预定数量的编码块线中的一个或多个帧间编码块线产生的编码量,以及(ii)采用第二方法校正在预定数量的编码块线中的一个或多个帧内编码块线的编码量,其中,通过采用第二方法校正的一个或多个帧内编码块线产生的编码量获得的值小于通过第一方法校正的编码量;以及确定步骤,在帧间编码下一块线的数据时,用于基于已校正的帧内编码块线和帧间编码块线产生的编码总量确定要用于下一块线数据量化的量化步长。In addition, the moving image encoding method according to the present invention includes: an encoding step of selectively performing inter-frame encoding or intra-frame encoding on each data of the multi-block lines in the moving image, wherein both the inter-frame encoding and the intra-frame encoding include quantization; correcting Steps, (i) using the first method to correct the amount of code generated by one or more inter-coded block lines in the predetermined number of coded block lines, and (ii) using the second method to correct the code amount generated in the predetermined number of coded block lines The code amount of the one or more intra-coded block lines corrected by the second method is smaller than the code amount corrected by the first method; and The determining step is used to determine the quantization step size to be used for quantization of the next line data based on the corrected intra-coded block line and the inter-coded block line generated by the corrected coding amount when the data of the next block line is inter-coded.
根据上述结构,可以获得和上述运动图像编码装置一样的效果。According to the above structure, the same effect as that of the above-mentioned moving picture encoding device can be obtained.
附图说明 Description of drawings
通过以下的说明以及结合本发明的具体实施方式的附图,将使本发明的这些和其它目的、优点和特征变得更加明显。These and other objects, advantages and features of the present invention will become more apparent from the following description and accompanying drawings in conjunction with specific embodiments of the present invention.
附图中:In the attached picture:
图1A和图1B所示为在传统运动图像编码装置中产生于各帧的编码量和图像质量的变化的示意图;FIG. 1A and FIG. 1B are schematic diagrams showing changes in the amount of coding and image quality generated in each frame in a conventional moving image coding device;
图2所示为根据第一实施方式的运动图像成像装置的结构;FIG. 2 shows the structure of the moving picture imaging device according to the first embodiment;
图3所示为编码校正单元12详细结构的实施例;Fig. 3 shows the embodiment of the detailed structure of
图4所示为根据第一实施方式运动图像编码装置31的操作的示意图;FIG. 4 is a schematic diagram showing the operation of the moving
图5所示为根据第一实施方式确定量化步长的操作的详细示意图;FIG. 5 is a detailed schematic diagram of the operation of determining the quantization step size according to the first embodiment;
图6A到图6D所示为根据第一实施方式的量化步长、产生于各帧的编码量、图像质量以及产生的编码总量按时间顺序变化的示意图;6A to FIG. 6D are schematic diagrams illustrating changes in time sequence of the quantization step size, the amount of codes generated in each frame, the image quality, and the total amount of codes generated according to the first embodiment;
图7所示为根据第二实施方式确定量化步长操作的详细示意图;FIG. 7 is a detailed schematic diagram of the operation of determining the quantization step size according to the second embodiment;
图8A到图8D所示为根据第二实施方式量化步长、产生于各帧的编码量、图像质量以及产生的编码总量按时间顺序变化的示意图;8A to FIG. 8D are schematic diagrams showing the change in time sequence of the quantization step size, the amount of codes generated in each frame, the image quality, and the total amount of codes generated according to the second embodiment;
图9所示为根据第三实施方式的运动图像成像装置的结构;FIG. 9 shows the structure of a moving picture imaging device according to a third embodiment;
图10所示为差值计算单元14和目标编码校正单元15的详细结构的实施例;Fig. 10 shows the embodiment of the detailed structure of
图11所示为根据第三实施方式的运动图像编码装置33的操作;FIG. 11 shows the operation of the moving
图12所示为根据第三实施方式的校正目标编码量的详细操作;FIG. 12 shows the detailed operation of correcting the target code amount according to the third embodiment;
图13A到图13D所示为根据第三实施方式量化步长、产生于各帧的编码量、图像质量以及产生的编码总量按时间顺序变化的示意图;13A to 13D are schematic diagrams showing the change in time sequence of the quantization step size, the amount of codes generated in each frame, the image quality, and the total amount of codes generated according to the third embodiment;
图14所示为根据第四实施方式的运动图像成像装置的结构;FIG. 14 shows the structure of a moving picture imaging device according to a fourth embodiment;
图15所示为根据第四实施方式确定量化步长操作的详细示意图;FIG. 15 is a detailed schematic diagram of the operation of determining the quantization step size according to the fourth embodiment;
图16所示为根据第五实施方式的运动图像成像装置的结构;FIG. 16 shows the structure of a moving picture imaging device according to a fifth embodiment;
图17所示为根据第五实施方式的运动图像编码装置35的操作;FIG. 17 shows the operation of the moving picture encoding device 35 according to the fifth embodiment;
图18所示为根据第六实施方式确定量化步长操作的详细示意图;FIG. 18 is a detailed schematic diagram of determining the quantization step size according to the sixth embodiment;
图19A到图19C所示为根据第六实施方式量化步长、产生于各帧的编码量以及图像质量按时间顺序变化的示意图;Fig. 19A to Fig. 19C are schematic diagrams showing the change of the quantization step size, the coding amount generated in each frame and the image quality in time order according to the sixth embodiment;
图20所示为根据第七实施方式的运动图像成像装置的结构;FIG. 20 shows the structure of a moving picture imaging device according to a seventh embodiment;
图21所示为存储在表存储单元19的表的实施例;Figure 21 shows the embodiment that is stored in the table of
图22所示为根据第七实施方式确定量化步长操作的详细示意图;Fig. 22 is a detailed schematic diagram of determining the quantization step size according to the seventh embodiment;
图23所示为根据第八实施方式的运动图像成像装置的结构;FIG. 23 shows the structure of a moving picture imaging device according to an eighth embodiment;
图24所示为编码校正单元12的详细结构的实施例;Fig. 24 shows the embodiment of the detailed structure of
图25所示为根据第八实施方式的运动图像编码装置38的操作;FIG. 25 shows the operation of the moving
图26所示为根据第八实施方式确定量化步长操作的详细示意图;Fig. 26 is a detailed schematic diagram of determining the quantization step size according to the eighth embodiment;
图27所示为根据第八实施方式编码量按时间顺序变化的示意图;以及Fig. 27 is a schematic diagram showing the change of the encoding amount in time order according to the eighth embodiment; and
图28所示为根据第九实施方式的运动图像成像装置的结构。FIG. 28 shows the structure of a moving picture imaging device according to a ninth embodiment.
具体实施方式 Detailed ways
以下参考附图说明本发明的优选实施方式。Preferred embodiments of the present invention are described below with reference to the drawings.
第一实施方式first embodiment
图2所示为根据第一实施方式的运动图像成像装置的结构。FIG. 2 shows the structure of the moving picture imaging device according to the first embodiment.
运动图像成像装置设置有成像透镜1、成像传感器2、运动图像编码装置31、微计算机4、程序存储器5以及视频流存储器6。成像透镜1在成像传感器2上产生目标图像。该成像传感器2采集目标图像以产生运动图像数据。运动图像编码装置31通过压缩由成像传感器2产生的运动图像的数据编码产生视频流。微计算机4根据存储在程序存储器5中的程序总体上控制运动图像装置。视频流存储器6存储通过运动图像编码装置31产生的视频流。The moving image imaging device is provided with an
运动图像编码装置31包括编码单元11、编码校正单元12以及量化步长确定单元13。The moving
编码单元11是所谓的MPEG编码器,其对运动图像各帧数据选择性地进行帧间编码或帧内编码。帧间编码的例子包括帧间预测编码、离散余弦变换(DCT)、量化以及可变长度编码。帧内编码的例子包括帧内预测编码、DCT、量化以及可变长度编码。根据来自微计算机4的指令在帧间编码和帧内编码之间作出选择。在第一实施方式中,以十个帧中有一个帧为帧内编码而其他九个帧为帧间编码的情况作为实施例。The
用于帧量化的量化步长由量化步长确定单元13提供。The quantization step size used for frame quantization is provided by the quantization step
编码校正单元12测量产生于各帧的编码量,并根据以下用于校正的公式(公式2和公式3)校正编码量。The
在帧n为帧内编码时:When frame n is intra-coded:
Cn’=Cn*P1 公式2Cn’=Cn*
在帧n为帧间编码时:When frame n is inter-coded:
Cn’=Cn*P2 公式3Cn’=Cn*
在上述的公式中,Cn为在对帧n编码后产生的编码量,P1和P2为关系为P1<P2的校正系数。在第一实施方式中,采用P1=P,其中(0<P<1)且P2=1的情况作为实施例。该校正系数P满足如下公式4。In the above formula, Cn is the amount of code generated after encoding frame n, and P1 and P2 are correction coefficients with a relationship of P1<P2. In the first embodiment, the case where P1=P where (0<P<1) and P2=1 is taken as an example. The correction coefficient P satisfies the following
P=Cinter/Cintra 公式4P=Cinter/
在该公式中,Cinter为在指定的帧采用指定的量化步长进行帧间编码时产生的编码量,并且Cintra为在同样的帧采用同样的量化步长进行帧内编码时产生的编码量。该校正系数P用于将帧内编码产生的编码量转换为帧间编码产生的编码量。In this formula, Cinter is the code amount generated when inter-frame coding is performed on a specified frame using a specified quantization step size, and Cintra is the code amount generated when intra-frame coding is performed on the same frame using the same quantization step size. The correction coefficient P is used to convert the coding amount generated by intra-frame coding into the coding amount generated by inter-frame coding.
一般而言,某一帧通过帧内编码产生的编码量大约是对同一帧通过帧间编码产生编码量的三到五倍。因此,第一实施方式中的校正系数P设置为落入1/5到1/3范围内的固定值。注意该编码校正单元12根据来自微计算机4的指令指定该帧为帧内编码还是帧间编码。Generally speaking, the amount of codes generated by intra-frame coding for a certain frame is about three to five times that of the same frame by inter-frame coding. Therefore, the correction coefficient P in the first embodiment is set to a fixed value falling within the range of 1/5 to 1/3. Note that the
量化步长确定单元13根据以下的公式5和公式6确定用于帧((n+1)的量化步长。The quantization step
当帧(n+1)将进行帧内编码时:When frame (n+1) will be intra-coded:
Qp[n+1]=Qpintra 公式5Qp[n+1]=
当帧(n+1)将进行帧间编码时:When frame (n+1) will be inter-coded:
Qp[n+1]=(Cn’/dstC)*Qp[n] 公式6Qp[n+1]=(Cn’/dstC)*Qp[n]
在上述公式5和6中,Qpintra为预定值,dstC为提前设定的目标编码量。In the
在第一实施方式中,在帧(n+1)进行帧内编码时Qpintra用作量化步长。在帧(n+1)进行帧间编码时,基于Cn’和量化步长Qp[n]确定量化步长,其中Cn’为通过编码校正单元12校正后的编码量。In the first embodiment, Qpintra is used as the quantization step size when frame (n+1) is intra-coded. When frame (n+1) is subjected to inter-frame coding, the quantization step size is determined based on Cn' and the quantization step size Qp[n], where Cn' is the code amount corrected by the
编码校正单元12在帧n进行帧内编码时根据公式2帧n产生的编码量,以及在帧n进行帧间编码时根据公式3校正帧n产生的编码量。以下说明用于实现上述情况的结构的实施例。The
图3所示为编码校正单元12的详细结构的实施例。FIG. 3 shows an example of the detailed structure of the
编码校正单元12包括编码测量单元121、帧编码存储器122、寄存器R1和R2、选择器S1以及乘法器M1。The
编码测量单元121测量帧n通过编码单元11编码产生的编码量。寄存器R1保持校正系数P,并且寄存器R2保持校正系数1。根据来自微计算机4的指令,选择器S1在帧n进行帧内编码时将校正系数P施加给乘法器M1,并且在帧n进行帧间编码时将将校正系数1施加给乘法器M1。The
该乘法器M1将产生的编码量Cn和选择的校正系数相乘。该帧编码存储器122存储由乘法器M1乘积的结果,并将该结果交给量化步长确定单元13。The multiplier M1 multiplies the generated code amount Cn by the selected correction coefficient. The
通过上述的结构,在帧n进行帧内编码时该编码校正单元12可以输出校正的编码量Cn’=Cn*P,并且当帧n为帧间编码时编码校正单元12输出校正编码量Cn’=Cn。Through the above-mentioned structure, the
图4所示为根据第一实施方式运动图像编码装置31的操作示意图。FIG. 4 is a schematic diagram showing the operation of the moving
运动图像编码装置31响应于来自微计算机4的指令启动编码。首先,运动图像编码装置31对帧1帧内编码(步骤S11)。因为帧1没有前帧,故帧1总是帧内编码。作为量化步长的初始值,使用在进行帧内编码时要使用的Qpintra。那么,运动图像编码装置31在帧编码存储器122中存储帧1产生的编码量(步骤S12)。因为帧1为帧内编码,C1*P存储于帧编码存储器122中。The moving
接下来,运动图像编码装置31基于产生的编码量和用于帧1的量化步长确定用于帧2的量化步长(步骤S14)。然后,该运动图像编码装置31采用确定的量化步长帧间编码帧2(步骤S15)。Next, the moving
运动图像编码装置31在帧编码存储器122中存储产生于帧2的编码量(步骤S16)。因为帧2为帧间编码,C2存储在帧编码存储器122中。此后,运动图像编码装置31重复从步骤S13到步骤S17的操作直到微计算机4指示停止成像。The moving
图5所示为根据第一实施方式确定量化步长的操作详细示意图。Fig. 5 is a detailed schematic diagram of the operation of determining the quantization step size according to the first embodiment.
当微计算机4指示帧间编码帧(n+1)(步骤S141:帧间)并且帧n已经进行了帧间编码(步骤S142:帧间)时,运动图像编码装置31确定用于量化帧(n+1)的量化步长Qp[n+1]为(Cn/dstC)*Qp[n](步骤S143)。当帧n已经帧内编码时(步骤S142:帧内),运动图像编码装置31确定用于量化帧(n+1)的量化步长Qp[n+1]为(Cn*P/dstC)*Qp[n](步骤S144)。When the
另一方面,当微计算机4指示帧内编码帧(n+1)(步骤S141:帧内)时,运动图像编码装置31确定用于量化帧(n+1)的量化步长Qp[n+1]为Qpintra(步骤S145)。On the other hand, when the
[效果][Effect]
图6A到图6D所示为根据第一实施方式量化步长、产生于各帧的编码量、图像质量以及产生的编码总量按时间顺序变化的示意图。6A to FIG. 6D are schematic diagrams illustrating changes in time sequence of the quantization step size, the amount of codes generated in each frame, the image quality, and the total amount of codes generated according to the first embodiment.
帧1、11和21为帧内编码帧,而其他帧为帧间编码帧。
图6A表示量化步长。在第一实施方式中,用于帧内编码帧的量化步长设定为固定值Qpintra(参见图5中的步骤S145)。因此,如图6A所示,用于帧1、11和21的量化步长采用同一值。通常,设定该固定值使得帧内编码帧中产生的编码量大于一帧的目标编码量。这是因为帧内编码帧中产生的编码量很大程度上影响整个运动图像的图像质量,并且帧内编码帧中产生的编码量可以导致运动图像的图像质量整体退化。Fig. 6A shows the quantization step size. In the first embodiment, the quantization step size for an intra-coded frame is set to a fixed value Qpintra (see step S145 in FIG. 5 ). Therefore, as shown in FIG. 6A, the quantization steps for
图6B表示编码量。产生的编码量C1远大于目标编码量。与产生编码量重叠示出的校正编码量C1*P表示通过编码校正单元12校正的编码量。将该校正编码量C1*P转换为由帧间编码产生的编码量,并和诸如帧2的帧间编码帧产生的编码量具有大致一样的大小。因此,与在帧1产生的编码量没有校正的情况相比,帧2的量化步长变小。因此,和基于帧1产生的没有校正的编码量确定的用于帧的量化步长的情况比较,帧2产生的编码量变得更大,并且产生于帧2的编码量大致和帧目标编码量一样。因为产生于帧2的编码量大致和一帧的目标编码量匹配,产生于帧3到10的编码量也在目标编码量周围变化。以上述方式可以抑制在紧跟于帧内编码帧之后的几个帧间编码帧产生的编码量的波动。Fig. 6B shows the amount of encoding. The generated code amount C1 is much larger than the target code amount. The corrected code amount C1 *P shown superimposed on the generated code amount indicates the code amount corrected by the
图6C表示图像质量。因为以上述的方式可以抑制在紧跟于帧内编码帧之后的几个帧间编码帧产生的编码量的波动,因此图像质量变得稳定。Figure 6C shows image quality. Since fluctuations in the amount of encoding generated in several inter-coded frames immediately following an intra-coded frame can be suppressed in the above-described manner, image quality becomes stable.
图6D表示总编码量。在第一实施方式中,用于帧内编码帧的量化步长为固定值Qpintra。设定该固定值Qpintra使得帧内编码帧产生的编码量大于目标编码量。因此,总编码量大于累积目标编码量。Fig. 6D shows the total code amount. In the first embodiment, the quantization step size for intra-coded frames is a fixed value Qpintra. The fixed value Qpintra is set so that the code amount generated by the intra-coded frame is greater than the target code amount. Therefore, the total encoding amount is larger than the cumulative target encoding amount.
第二实施方式second embodiment
在第一实施方式中,固定值Qpintra用作用于帧内编码帧的量化步长。然而,在第二实施方式中,同样适当地确定帧内编码帧的量化步长。In the first embodiment, a fixed value Qpintra is used as the quantization step size for intra-coded frames. However, also in the second embodiment, the quantization step size of the intra-coded frame is appropriately determined.
[结构][structure]
根据第二实施方式的运动图像编码装置和根据第一实施方式的运动图像编码装置结构基本上一样。因此,也参考图2给出说明。The moving picture coding device according to the second embodiment has basically the same structure as the moving picture coding device according to the first embodiment. Therefore, description is also given with reference to FIG. 2 .
编码校正单元12测量各帧中产生的编码量,然后根据以下的校正公式(公式7、8和9)校正产生的编码量。The
当帧(n+1)将进行帧间编码,并且帧n已经进行了帧内编码时:When frame (n+1) is to be inter-coded, and frame n is already intra-coded:
Cn’=Cn*P1 公式7Cn’=Cn*
当帧(n+1)将进行帧间编码,并且帧n已经进行了帧间编码时:When frame (n+1) is to be inter-coded, and frame n is already inter-coded:
Cn’=Cn*P2 公式8Cn’=Cn*
当帧(n+1)将进行帧内编码:When frame (n+1) will be intra-coded:
Cn’=Cn*P3 公式9Cn’=Cn*P3 Formula 9
P1、P2和P3为关系为P1<P2<P3的校正系数。在第二实施方式中,以P1=P,其中(0<P<1),P2=1且P3=1/P情况为实施例进行说明。该校正系数P满足公式4的系数。P1, P2 and P3 are correction coefficients with a relationship of P1<P2<P3. In the second embodiment, the case of P1=P, where (0<P<1), P2=1 and P3=1/P is taken as an example for description. This correction coefficient P satisfies the coefficient of
量化步长确定单元13根据以下公式10确定用于帧(n+1)的量化步长。The quantization step
Qp[n+1]=(Cn’/dstC)*Qp[n] 公式10Qp[n+1]=(Cn’/dstC)*Qp[n] Formula 10
[操作][operate]
图7所示为根据第二实施方式确定量化步长操作的详细示意图。Fig. 7 is a detailed schematic diagram of determining the quantization step size according to the second embodiment.
当微计算机4指示帧间编码帧(n+1)(步骤S241:帧间)并且帧n已经进行了帧间编码(步骤S242:帧间)时,运动图像编码装置31确定用于量化帧(n+1)的量化步长QP[n+1]为(Cn/dstC)*Qp[n](步骤S243)。另一方面,当帧n已经进行了帧内编码时(步骤S242:帧内),运动图像编码装置31确定用于量化帧(n+1)的量化步长Qp[n+1]为(Cn*P/dstC)*Qp[n](步骤S244)。When the
而且,当微计算机4指示对于帧(n+1)的预测编码采用帧内编码时(步骤S241:帧内),运动图像编码装置31确定用于量化帧(n+1)的量化步长Qp[n+1]为(Cn/(dstC*P))*Qp[n](步骤S145)。Also, when the
[效果][Effect]
图8A到图8D所示为根据第二实施方式量化步长、产生于各帧的编码量、图像质量以及产生编码总量按时间顺序变化的示意图。8A to 8D are schematic diagrams showing the change of the quantization step size, the amount of codes generated in each frame, the image quality, and the total amount of generated codes in time order according to the second embodiment.
图8A表示量化步长。在第二实施方式中,适当地确定用于帧内编码帧的量化步长(参见图7中的步骤S245)。因此,如图8A所示,用于帧1、11和21的量化步长没有采用同一值。例如,基于前帧10产生的编码量确定用于帧11的量化步长。因为帧1没有前帧,因此指定固定值作为帧1量化步长的初始值。Fig. 8A shows the quantization step size. In the second embodiment, the quantization step size for an intra-coded frame is appropriately determined (see step S245 in FIG. 7 ). Therefore, as shown in FIG. 8A, the quantization steps for
图8B表示编码量。帧1到帧10产生的编码量和第一实施方式一样。帧11产生的帧内编码及以后各帧的编码量和目标编码量基本一样。Fig. 8B shows the amount of encoding. The amount of codes generated from
图8C表示图像质量。因为抑制了产生的编码量的波动,因此图像质量变得稳定。但是,因为帧内编码帧(帧11和21)产生的编码量均很小,因此图像质量整体退化。Figure 8C shows image quality. Image quality becomes stable because fluctuations in the generated encoding amount are suppressed. However, since the amount of codes generated by the intra-coded frames (frames 11 and 21) is small, the image quality degrades overall.
图8D表示总编码量。在第二实施方式中,适当地确定用于帧内编码帧的量化步长使得帧内编码帧产生的编码量与目标编码量基本相当。因此,总编码量接近于累积目标编码量。Fig. 8D shows the total code amount. In the second embodiment, the quantization step size for the intra-coded frame is properly determined so that the code amount generated by the intra-frame coded frame is basically equal to the target code amount. Therefore, the total encoding amount is close to the cumulative target encoding amount.
第三实施方式third embodiment
在第一实施方式中,帧内编码帧中产生的编码量设定为大于目标编码量。因此,编码总量大于累积目标编码总量。In the first embodiment, the code amount generated in an intra-coded frame is set to be larger than the target code amount. Therefore, the total amount of codes is greater than the cumulative target total amount of codes.
在第三实施方式中,以下说明一种编码总量基本与累积目标编码量相当同时可以尽可能抑制图像质量变差的技术。In the third embodiment, a technique for suppressing deterioration of image quality as much as possible while the total amount of encoding is substantially equal to the cumulative target encoding amount will be described below.
[结构][structure]
图9所示为根据第三实施方式的运动图像成像装置的结构。FIG. 9 shows the structure of a moving image imaging device according to a third embodiment.
根据第三实施方式的运动图像编码装置33的结构除了附加的差值计算单元14和目标编码校正单元15基本与根据第一实施方式的运动图像编码装置31一样。除了差值计算单元14和目标编码校正单元15以外,运动图像编码装置31中一样的元件均包括在第三实施方式的运动图像编码装置中。因此,这里对于同样元件不作说明。The structure of the moving
在编码帧(n+1)时,差值计算单元14计算通过从帧n和帧n以前的各帧产生的总编码量中减去帧n和帧n以前的各帧产生的目标编码量得出的累积差值IntC。When encoding frame (n+1), the
IntC=∑(Cn-dstC) 公式11IntC=∑(Cn-dstC)
当累积差值大于0时,当累积差值越大,目标编码校正单元15将目标编码量校正得更小。当累积差异为0或者更小时,该目标编码校正单元15不校正目标编码量。具体地,根据如下公式12和13执行校正操作。When the cumulative difference is greater than 0, the target
在IntC大于0时:When IntC is greater than 0:
dstC’=dstC-IntC/d 公式12dstC'=dstC-IntC/
在IntC小于或等于0时:When IntC is less than or equal to 0:
dstC’=dstC 公式13dstC'=
在该公式中,d为预定为大于1的调整参数。In this formula, d is an adjustment parameter predetermined to be greater than 1.
量化步长确定单元13根据如下公式14和15确定用于帧(n+1)量化的量化步长。The quantization step
在帧(n+1)将进行帧内编码时:When frame (n+1) will be intra-coded:
Qp[n+1]=Qpintra 公式14Qp[n+1]=
在帧(n+1)将进行帧间编码时:When frame (n+1) will be inter-coded:
Qp[n+1]=(Cn’/dstC’)*Qp[n] 公式15Qp[n+1]=(Cn’/dstC’)*Qp[n]
注意编码校正单元12以和第一实施方式一样方式工作,并将校正编码量Cn’传给量化步长确定单元13。Note that the
以下说明用于实现上述差值计算单元14和目标编码校正单元15差值计算结构的实施例。An embodiment for realizing the difference calculation structure of the above-mentioned
图10所示为差值计算单元14和目标编码校正单元15的详细结构的实施例。FIG. 10 shows an example of the detailed structure of the
该差值计算单元14包括编码测量单元141、寄存器R1和R2以及加法器A1和A2。The
编码测量单元141测量帧n通过编码单元11编码后的产生的编码量。寄存器R1保持目标编码量dstC,并且寄存器R2保持帧n和帧n以前各帧的累积差值。The
在加法器A1,从产生的编码量Cn中减去目标编码量dstC。在加法器A2,从加法器A1输出的(Cn-dstC)加上保持在寄存器R2中的累积差值。然后从加法器A2输出的该累积差值IntC保存到寄存器R2中,并输出给目标编码校正单元15。In the adder A1, the target code amount dstC is subtracted from the generated code amount Cn. In adder A2, (Cn-dstC) output from adder A1 is added to the cumulative difference held in register R2. The cumulative difference value IntC output from the adder A2 is then stored in the register R2 and output to the target
目标编码校正单元15包括确定单元151、寄存器R3、R4和R5、选择器S1以及加法器A3。The target
确定单元151确定累积差值151是否大于0,然后向选择器S1的控制端输出结果。The
根据确定单元151的判断结果,在IntC大于0时,选择器S1向乘法器M1传送该累积差值IntC,并在IntC小于或等于0时将保持在寄存器R4的0传递给乘法器M1。According to the judgment result of the
该乘法器M1将累积差值IntC和用于调节的参数1/d相乘。该加法器A3从保持在寄存器R5中的目标编码量dstC中减去乘积结果,并向量化步长确定单元13输出该减除结果。This multiplier M1 multiplies the cumulative difference IntC by the
通过上述结构,在累积差值大于0时,目标编码校正单元15可以实现随着累积差值增大将目标编码量校正得更小的操作,并且当累积差值等于或小于0时不校正目标编码量。Through the above structure, when the cumulative difference is greater than 0, the target
[操作][operate]
图11所示为根据第三实施方式的运动图像编码装置33的操作。FIG. 11 shows the operation of the moving
运动图像编码装置33响应于来自微计算机4的指令启动编码。首先,运动图像编码装置33对帧1进行帧内编码(步骤S31)。因为帧1没有前帧,故帧1总是进行帧内编码。第三实施方式中,在进行帧内编码时要使用Qpintra作为量化步长的初始值。那么,该运动图像编码装置33在帧编码存储器122中存储帧1产生的编码量(步骤S32)。因为帧1为帧内编码,C1*P存储于帧编码存储器122中。The moving
接下来,运动图像编码装置33校正目标编码量(步骤S34),并基于帧1产生的编码量、用于帧1的量化步长和校正后的目标编码量确定用于帧2的量化步长(步骤S35)。然后,该运动图像编码装置33采用确定的量化步长对帧2进行帧间编码(步骤S36)。Next, the moving
该运动图像编码装置33在帧编码存储器122中存储帧2产生的编码量(步骤S37)。因为帧2为帧间编码,C2存储在帧编码存储器122中。此后,该运动图像编码装置33重复从步骤S33到步骤S38的操作直到微计算机4指示停止成像。The moving
图12所示为根据第三实施方式的校正目标编码量的详细操作。FIG. 12 shows the detailed operation of correcting the target code amount according to the third embodiment.
差值计算单元14计算累积差值IntC(步骤S341)。The
在累积差值IntC大于0时(步骤S342:是),目标编码校正单元15将目标编码量校正为dstC-IntC/d。当累积差异小于或等于0时(步骤S342:否),目标编码校正单元15不校正目标编码量并保持dstC(步骤S344)。When the cumulative difference value IntC is greater than 0 (step S342: Yes), the target
确定量化步长的操作和第一实施方式基本上一样,并因此这里不详细说明。The operation of determining the quantization step size is basically the same as that of the first embodiment, and thus will not be described in detail here.
[效果][Effect]
图13A到图13D所示为根据第三实施方式量化步长、产生于各帧的编码量、图像质量以及产生编码总量按时间顺序变化的示意图。13A to 13D are schematic diagrams showing the change in time sequence of the quantization step size, the amount of codes generated in each frame, the image quality, and the total amount of generated codes according to the third embodiment.
图13A表示量化步长。在第三实施方式中,用于帧内编码帧的量化步长设定为固定值Qpintra。Fig. 13A shows the quantization step size. In the third embodiment, the quantization step size for an intra-coded frame is set to a fixed value Qpintra.
图13B表示编码量。将帧1产生的编码量C1校正为校正编码量C1*P。将目标编码量dstC校正为校正编码量dstC’。校正后的目标编码量dstC’变得比目标编码量dstC小不超过一个编码量,该编码量为产生的编码量C1超出目标编码量dstC的编码量。Fig. 13B shows the amount of encoding. The code amount C1 generated in
帧2产生的编码量C2和校正后的目标编码量dstC’大致相当。The code amount C2 generated by
产生于帧3的编码量C3比产生于帧2的编码量C2更接近于目标编码量。这是因为在帧3处的累积差异IntC小于帧2处的累积差异IntC,并因此在帧3校正后的目标编码量比帧2更接近于目标编码量dstC。The code amount C3 generated in
而且,在第三实施方式中,由于采用累积差值,所以尽管一帧的编码量会急剧增加,但是可以实现平滑改变。这也应用于不是在帧内编码的帧之后立即到来的多个帧。例如,帧26产生的编码量急剧增加,但是在随后帧27和28产生的编码量的变化是平滑的。Also, in the third embodiment, since the cumulative difference is employed, although the encoding amount of one frame will increase sharply, smooth change can be realized. This also applies to frames that do not come immediately after the intra-coded frame. For example, frame 26 produces a sharp increase in the amount of code, but changes in the amount of code produced in subsequent frames 27 and 28 are smooth.
图13C表示图像质量。因为可以抑制在紧跟于帧内编码帧之后的几个帧间编码帧产生的编码量的波动,因此图像质量变得稳定。此外,因为产生于帧间编码帧的编码量和第一实施方式的情况一样,因此总体图像质量不会向第二实施方式一样退化。Fig. 13C shows image quality. Image quality becomes stable because it is possible to suppress fluctuations in the amount of encoding generated in several inter-coded frames immediately following an intra-coded frame. Furthermore, since the amount of codes resulting from inter-coded frames is the same as in the case of the first embodiment, overall image quality does not degrade like the second embodiment.
图13D表示总编码量。在第三实施方式中,在累积差值IntC大于0时,校正该目标编码量使其随着累积差值的变大而变小。因此,由于即使帧内编码帧产生的编码量超出目标编码量,但是帧内编码帧之后的几个帧中产生的编码量变得比目标编码量小,因此编码总量更接近于累积目标编码量。Fig. 13D shows the total code amount. In the third embodiment, when the cumulative difference value IntC is greater than 0, the target coding amount is corrected to become smaller as the cumulative difference value becomes larger. Therefore, since even if the amount of codes generated by an intra-coded frame exceeds the target code amount, the code amount generated in several frames after the intra-coded frame becomes smaller than the target code amount, the total amount of codes is closer to the cumulative target code amount .
第四实施方式Fourth Embodiment
在第四实施方式中,根据缓冲器的剩余空间大小通过在量化步长设定为固定值的第一模式和适当地确定量化步长的第二模式的两个模式之间切换来确定帧内编码帧的量化步长。In the fourth embodiment, the intra frame is determined by switching between the first mode in which the quantization step size is set to a fixed value and the second mode in which the quantization step size is appropriately determined according to the remaining space size of the buffer. Quantization step size for encoded frames.
[结构][structure]
图14所示为根据第四实施方式的运动图像成像装置的结构。FIG. 14 shows the structure of a moving picture imaging device according to a fourth embodiment.
根据第四实施方式的运动图像编码装置34具有在根据第一实施方式的运动图像编码装置31中添加了空间测量单元16、缓冲器17以及传输单元18的结构。除了空间测量单元16、缓冲器17以及传输单元18以外,运动图像编码装置34具有和根据第一实施方式的运动图像编码装置31基本一样的结构,并因此这里不作说明。The moving
空间测量单元16测量缓冲器17剩余空间的大小,并将测量结果通知量化步长确定单元13。The
缓冲器17暂存由编码单元11产生的视频流。传输单元18将存储在缓冲器17中的视频流转移到视频流存储器6中。The
量化步长确定单元13根据如下的公式16和17确定帧(n+1)量化的量化步长。The quantization step
当帧(n+1)将进行帧内编码并且缓冲器17的自由空间大于预定大小(例如,缓冲器的20%)时:When frame (n+1) is to be intra-coded and the free space of
Qp[n+1]=Qpintra 公式16Qp[n+1]=
当帧(n+1)将进行帧内编码并且缓冲器17的自由空间小于或等于预定大When frame (n+1) is to be intra-coded and the free space of
小时或在帧(n+1)将进行帧间编码时:hours or when frame(n+1) will be inter-coded:
Qp[n+1]=(Cn’/dstC’)*Qp[n] 公式17Qp[n+1]=(Cn’/dstC’)*Qp[n]
在上述的公式中,Cn’和公式7、8和9的Cn’一样。In the above formulas, Cn' is the same as Cn' in
上述说明当缓冲器17的自由空间大于预定大小时,以和第一实施方式一样操作的第一模式执行操作,并且当缓冲器17的自由空间小于或等于预定大小时,以和第二实施方式一样操作的第二模式执行操作。The above description performs the operation in the first mode that operates as in the first embodiment when the free space of the
[操作][operate]
图15所示为根据第四实施方式确定量化步长操作的详细示意图。Fig. 15 is a detailed schematic diagram of determining the quantization step size according to the fourth embodiment.
在微计算机4指示对帧(n+1)进行帧间编码(步骤S441:帧间)并且帧n已经进行帧间编码(步骤S442:帧间)时,该运动图像编码装置34确定用于帧(n+1)量化的量化步长Qp[n+1]为(Cn/dstC)*Qp[n](步骤S443)。另一方面,当帧n已经帧内编码时(步骤S442:帧内),该运动图像编码装置34确定用于帧(n+1)量化的量化步长Qp[n+1]为(Cn*P/dstC)*Qp[n](步骤S444)。When the
而且,在微计算机4指示对帧(n+1)进行帧内编码时(步骤S441:帧内)并且自由空间小于或等于预定大小(步骤S445:否),该运动图像编码装置34确定用于帧(n+1)量化的量化步长Qp[n+1]为(Cn/(dstC*P))*Qp[n](步骤S446)。如果自由空间大于预定大小(步骤S445:是),那么该运动图像编码装置34确定用于帧(n+1)量化的量化步长Qp[n+1]为Qpintra(步骤S447)。Also, when the
[效果][Effect]
当用于帧内编码帧量化的量化步长采用固定值时,尽管缓冲器几乎溢出也不可以调整帧内编码帧产生的编码量。然而,如果适当地确定用于帧内编码帧量化的量化步长则可以抑制帧内编码帧产生的编码量。When the quantization step size used for intra-coded frame quantization takes a fixed value, the amount of codes produced by the intra-coded frame cannot be adjusted even though the buffer almost overflows. However, if the quantization step size used for intra-coded frame quantization is properly determined, the amount of code generated by the intra-coded frame can be suppressed.
因此,如果缓冲器即将溢出,那么本发明在通过适当地确定用于帧内编码帧量化的量化步长来减少缓冲器溢出的可能性方面具有优点。Therefore, if the buffer is about to overflow, the present invention has the advantage of reducing the possibility of buffer overflow by properly determining the quantization step size for intra-coded frame quantization.
第五实施方式Fifth Embodiment
在第五实施方式中,根据缓冲器的剩余空间大小通过在不校正目标编码量的第一模式和校正目标编码量的的第二模式的两个模式之间进行切换来确定帧间编码帧的量化步长。In the fifth embodiment, according to the size of the remaining space of the buffer, the number of inter-coded frames is determined by switching between the first mode of not correcting the target code amount and the second mode of correcting the target code amount Quantization step size.
[结构][structure]
图16所示为根据第五实施方式的运动图像成像装置的结构。FIG. 16 shows the structure of a moving image imaging device according to a fifth embodiment.
根据第五实施方式的运动图像编码装置35具有在根据第三实施方式的运动图像编码装置33中添加了空间测量单元16、缓冲器17以及传输单元18的结构。除了空间测量单元16、缓冲器17以及传输单元18以外,运动图像编码装置35具有和根据第三实施方式的运动图像编码装置33基本一样的结构,并因此这里不作说明。The moving image encoding device 35 according to the fifth embodiment has a structure in which the
空间测量单元16、缓冲器17以及传输单元18和第四实施方式的一样。The
量化步长确定单元13根据如下的公式18、19和20确定用于帧(n+1)量化的量化步长。The quantization step
当帧(n+1)将进行帧内编码时:When frame (n+1) will be intra-coded:
Qp[n+1]=Qpintra 公式18Qp[n+1]=
当帧(n+1)将进行帧间编码并且缓冲器17的自由空间大于预定大小时:When frame (n+1) is to be inter-coded and the free space of
Qp[n+1]=(Cn’/dstC)*Qp[n] 公式19Qp[n+1]=(Cn’/dstC)*Qp[n]
当帧(n+1)将进行帧间编码并且缓冲器17的自由空间小于或等于预定大小时:When frame (n+1) is to be inter-coded and the free space of
Qp[n+1]=(Cn’/dstC’)*Qp[n] 公式20Qp[n+1]=(Cn’/dstC’)*Qp[n] Formula 20
在上述的公式中,Cn’和公式7、8和9的Cn’一样,并且dstC’和公式12、13中的dstC’一样。In the above formulas, Cn' is the same as Cn' in
上述说明当缓冲器17的自由空间大于预定大小时,以和第二实施方式一样操作的第一模式执行操作,并且当缓冲器17的自由空间小于或等于预定大小时,以和第三实施方式一样操作的第二模式执行操作。The above description performs operations in the first mode that operates as in the second embodiment when the free space of the
[操作][operate]
图17所示为根据第五实施方式的运动图像编码装置35的操作。FIG. 17 shows the operation of the moving picture encoding device 35 according to the fifth embodiment.
运动图像编码装置35响应于来自微计算机4的指令启动编码。首先,运动图像编码装置35对帧1进行帧内编码(步骤S51)。因为帧1没有前帧,故帧1总是帧内编码。第五实施方式中,在进行帧内编码时要使用Qpintra作为量化步长的初始值。然后,该运动图像编码装置35在帧编码存储器122中存储帧1产生的编码量(步骤S52)。因为帧1为帧内编码,C1*P存储于帧编码存储器122中。The moving image encoding device 35 starts encoding in response to an instruction from the
当自由空间小于或等于预定大小时(步骤S54:否),运动图像编码装置35校正目标编码量(步骤S55),并且当自由空间大于预定大小时(步骤S54:是),运动图像编码装置35跳过用于校正目标编码量的步骤55。When the free space is less than or equal to the predetermined size (step S54: No), the moving image encoding device 35 corrects the target encoding amount (step S55), and when the free space is larger than the predetermined size (step S54: Yes), the moving image encoding device 35
运动图像编码装置35基于获得的目标编码量确定用于帧2的编码比例(步骤S56)。然后,运动图像编码装置35采用该确定的量化步长对帧2进行帧间编码(步骤S57)。The moving image encoding device 35 determines the encoding scale for
运动图像编码装置35在帧编码存储器122中存储帧2产生的编码量(步骤S58)。因为帧2为帧间编码,C2存储于帧编码存储器122。此后,该运动图像编码装置35重复从步骤S53到步骤S58的操作直到微计算机4指示停止成像。The moving picture encoding device 35 stores the amount of encoding generated by the
[效果][Effect]
该根据第五实施方式的运动图像编码装置35在缓冲器将要溢出时根据帧n和帧n以前多帧的超额量校正在帧(n+1)产生的编码量。因此,可以降低缓冲器溢出的可能性。The moving picture encoding device 35 according to the fifth embodiment corrects the encoding amount generated at frame (n+1) according to the excess amount of frame n and frames before frame n when the buffer is about to overflow. Therefore, the possibility of buffer overflow can be reduced.
第六实施方式Sixth Embodiment
在第六实施方式中,在帧(n+1)为帧内编码时,基于用于帧n的量化步长确定量化步长。这是和第一实施方式仅有的区别。其他和第一实施方式一样,并因此这里不作解释。In the sixth embodiment, when frame (n+1) is intra-coded, the quantization step size is determined based on the quantization step size for frame n. This is the only difference from the first embodiment. Others are the same as the first embodiment, and therefore will not be explained here.
[结构][structure]
如果帧(n+1)进行帧内编码,编码校正单元12不校正产生的编码量。If the frame (n+1) is intra-coded, the
量化步长确定单元13根据以下公式21、22和23确定用于帧(n+1)量化的量化步长。The quantization step
当帧(n+1)将进行帧间编码时:When frame (n+1) will be inter-coded:
Qp[n+1]=(Cn’/dstC)*Qp[n] 公式21Qp[n+1]=(Cn’/dstC)*Qp[n] Formula 21
当帧(n+1)将进行帧内编码,并且帧n已经进行了帧间编码时:When frame (n+1) is to be intra-coded, and frame n is already inter-coded:
Qp[n+1]=Pq1*Qp[n] 公式22Qp[n+1]=Pq1*Qp[n] Formula 22
当帧(n+1)将进行帧内编码,并且帧n已经进行了帧内编码时:When frame (n+1) is to be intra-coded, and frame n is already intra-coded:
Qp[n+1]=Pq2*Qp[n] 公式23Qp[n+1]=Pq2*Qp[n] Formula 23
这里,Pq1和Pq2为预定系数。具体地,两个系数均设定在5/4到4/3的范围内。Here, Pq1 and Pq2 are predetermined coefficients. Specifically, both coefficients are set within the range of 5/4 to 4/3.
随着系数Pq1和Pq2的逐渐变大,帧内编码帧产生的编码量的抑制效果增加。然而,这同时引起图像质量退化。仿真结果表明通过将系数Pq1和Pq2设定在5/4到4/3的范围内既可以实现帧内编码帧产生的编码量的抑制效果又可以获得优秀的图像质量。As the coefficients Pq1 and Pq2 gradually become larger, the effect of suppressing the amount of coding generated by intra-coding frames increases. However, this simultaneously causes image quality degradation. The simulation results show that by setting the coefficients Pq1 and Pq2 in the range of 5/4 to 4/3, both the suppression effect of the code amount produced by the intra-coded frame and the excellent image quality can be obtained.
[操作][operate]
图18所示为根据第六实施方式确定量化步长操作的详细示意图。Fig. 18 is a detailed schematic diagram of determining the quantization step size according to the sixth embodiment.
在微计算机4指示对帧(n+1)进行帧间编码(步骤S641:帧间)并且帧n已经进行帧间编码(步骤S642:帧间)时,该运动图像编码装置31确定用于帧(n+1)量化的量化步长Qp[n+1]为(Cn/dstC)*Qp[n](步骤S643)。当帧n已经进行帧内编码时(步骤S642:帧内),该运动图像编码装置31确定用于帧(n+1)量化的量化步长Qp[n+1]为(Cn*P/dstC)*Qp[n](步骤S644)。When the
而且,在微计算机4指示对帧(n+1)进行帧内编码(步骤S641:帧内)并且帧n已经进行帧间编码(步骤S645:帧间)时,该运动图像编码装置31确定用于帧(n+1)量化的量化步长Qp[n+1]为Pq1*Qp[n](步骤S646)。如果帧n已经进行帧内编码(步骤S645:帧内),那么该运动图像编码装置31确定用于帧(n+1)量化的量化步长Pq2*Qp[n](步骤S647)。Also, when the
图19A到图19C所示为根据第六实施方式量化步长、产生于各帧的编码量以及图像质量按时间顺序变化的示意图。FIG. 19A to FIG. 19C are diagrams showing the time-sequential change of the quantization step size, the code amount generated in each frame, and the image quality according to the sixth embodiment.
图19A表示量化步长。在第六实施方式中,适当地确定用于帧内编码帧的量化步长(参见图18的步骤S645)。因此,如图19A所示,帧1、11和21的量化步长采用不同的值。例如,基于前帧10的量化步长确定帧11的量化步长。因为帧1之前不存在帧,将固定值指定为用于帧1的量化步长的初始值。Fig. 19A shows the quantization step size. In the sixth embodiment, the quantization step size for an intra-coded frame is appropriately determined (see step S645 of FIG. 18 ). Therefore, as shown in FIG. 19A, the quantization step sizes of
图19B表示编码量。帧1到帧10产生的编码量和第一实施方式一样。帧11以及之后帧的帧内编码帧产生的编码量基本和目标编码量相等。Fig. 19B shows the amount of encoding. The amount of codes generated from
图19C表示图像质量。因为可以抑制产生的编码量的波动,因此图像质量变得稳定。然而,因为帧内编码帧(帧11和21)产生的编码量保持很小,因此图像质量整体退化。Fig. 19C shows image quality. Since fluctuations in the amount of encoding generated can be suppressed, image quality becomes stable. However, since the amount of codes generated by the intra-coded frames (frames 11 and 21) remains small, the image quality degrades overall.
在第六实施方式中总编码量的变化和第二实施方式基本一样,并因此在此不作说明。The change of the total code amount in the sixth embodiment is basically the same as that in the second embodiment, and thus will not be described here.
在第六实施方式中,当进行帧内编码时,适当地确定编码步长。因此,第六实施方式如同在第二实施方式一样,可以获得好的图像效果并且编码变得稳定。In the sixth embodiment, when performing intra coding, the coding step size is appropriately determined. Therefore, in the sixth embodiment, as in the second embodiment, good image effects can be obtained and encoding becomes stable.
此外在第六实施方式中,在帧内编码时,不考虑前一帧产生的编码量确定量化步长。因此,和第二实施方式比较可以减少运动图像编码装置操作中的处理量。In addition, in the sixth embodiment, during intra-frame encoding, the quantization step size is determined regardless of the amount of encoding generated in the previous frame. Therefore, compared with the second embodiment, the amount of processing in the operation of the moving picture encoding device can be reduced.
第七实施方式Seventh Embodiment
在第七实施方式中,当帧(n+1)为帧内编码时,基于用于帧n的量化步长确定量化步长。这是和第一实施方式仅有的区别。其他和第一实施方式一样,并因此这里不作解释。In the seventh embodiment, when frame (n+1) is intra-coded, the quantization step size is determined based on the quantization step size for frame n. This is the only difference from the first embodiment. Others are the same as the first embodiment, and therefore will not be explained here.
[结构][structure]
图20所示为根据第七实施方式的运动图像成像装置的结构。FIG. 20 shows the structure of a moving picture imaging device according to a seventh embodiment.
运动图像编码装置37包括编码单元11、编码校正单元12、量化步长确定单元13和表存储单元19。The moving
表存储单元19存储表示帧n的量化步长和帧(n+1)量化步长之间关系的表。The
当帧(n+1)将帧内编码时,量化步长确定单元13参照表存储单元19中存储的表以基于用于帧n的量化步长确定用于帧(n+1)的量化步长。When the frame (n+1) is to be intra-coded, the quantization step
图21所示为存储在表存储单元19的表的实施例。FIG. 21 shows an example of a table stored in the
在帧n为帧间编码时,用于帧(n+1)的量化步长确定为Qnew1。在帧n为帧内编码时,帧(n+1)的量化步长确定为Qnew2。When frame n is inter-coded, the quantization step size for frame (n+1) is determined to be Qnew1. When frame n is intra-frame encoded, the quantization step size of frame (n+1) is determined to be Qnew2.
[操作][operate]
图22所示为根据第七实施方式确定量化步长操作的详细示意图。Fig. 22 is a detailed schematic diagram of determining the quantization step size according to the seventh embodiment.
在微计算机4指示对帧(n+1)进行帧间编码(步骤S741:帧间)并且帧n已经进行了帧间编码(步骤S742:帧间)时,该运动图像编码装置37确定用于帧(n+1)量化的量化步长Qp[n+1]为(Cn/dstC)*Qp[n](步骤S743)。如果帧n已经进行帧内编码(步骤S742:帧内),该运动图像编码装置37确定用于帧(n+1)量化的量化步长Qp[n+1]为(Cn*P/dstC)*Qp[n](步骤S744)。When the
而且,在微计算机4指示对帧(n+1)进行帧内编码(步骤S741:帧内)并且帧n已经进行帧间编码(步骤S745:帧间)时,该运动图像编码装置37确定用于帧(n+1)量化的量化步长Qp[n+1]为Qnew1(步骤S746)。如果帧n已经进行了帧内编码(步骤S745:帧内),那么该运动图像编码装置37确定用于帧(n+1)量化的量化步长Qnew2(步骤S747)。Also, when the
[效果][Effect]
通过第七实施方式,可以获得和第六实施方式一样的效果。According to the seventh embodiment, the same effect as that of the sixth embodiment can be obtained.
第八实施方式Eighth embodiment
在第八实施方式中,对于各块线确定量化步长。该块线为在图像中以矩阵形成排列的一条线的宏块。In the eighth embodiment, the quantization step size is determined for each block line. The block line is a line of macroblocks arranged in a matrix in an image.
[结构][structure]
图23所示为根据第八实施方式的运动图像成像装置的结构。FIG. 23 shows the structure of a moving picture imaging device according to an eighth embodiment.
根据第八实施方式的运动图像编码装置38和根据第三实施方式的运动图像编码装置33基本一样,并且仅有编码校正单元12和量化步长确定单元13的结构不同于第三实施方式。因此,这里对于相同的元件不作说明。The moving
该编码校正单元12测量各块线产生的编码量,并根据用于校正的公式24校正产生的编码量。注意,在第八实施方式中,参照预定数量块线产生的编码量以确定块线(n+1)的量化步长。这里,说明一帧包括7条块线,且参照块线(n+1)前的7条块线以确定用于块线(n+1)的量化步长的实施例。The
Cn’=CAna*P1+CAnb*P2 公式24Cn’=CAna*P1+CAnb*P2 Formula 24
在上述的公式中,CAna为在最近的7条块线中产生的编码量中在进行帧内编码的块线中产生的编码量,并且CAnb在最近的7条块线中产生的编码量中在进行帧间编码的块线中产生的编码量。此外,P1和P2为关系为P1<P2的校正系数。在第八实施方式中,以P1=P(0<P<1)并且P2=1的情况为实施例。校正系数P满足公式4。In the above formula, CAna is the code amount generated in the block line for intra-coding among the code amounts generated in the latest 7 block lines, and CAnb is in the code amount generated in the latest 7 block lines Amount of codes produced in block lines that are inter-coded. In addition, P1 and P2 are correction coefficients with a relationship of P1<P2. In the eighth embodiment, the case where P1=P (0<P<1) and P2=1 is taken as an example. The correction coefficient P satisfies
量化步长确定单元13根据如下的公式25和26确定用于块线(n+1)量化的量化步长。The quantization step
当块线(n+1)将进行帧内编码时:When block lines (n+1) are to be intra-coded:
Qp[n+1]=Qpintra 公式25Qp[n+1]=Qpintra Formula 25
当块线(n+1)进行帧间编码时:When the block line (n+1) is inter-coded:
Qp[n+1]=(Cn’/dstC’)*Qp[An] 公式26Qp[n+1]=(Cn’/dstC’)*Qp[An] Formula 26
在上述公式中,Qp[An]为用于要参考的7条块线的量化步长的平均值或模值。In the above formula, Qp[An] is the average or modulus value of the quantization steps for the 7 block lines to be referenced.
以下说明用于实现公式24计算的结构的实施例。An example of a structure for realizing the calculation of Equation 24 is described below.
图24所示为编码校正单元12详细结构的实施例。FIG. 24 shows an example of the detailed structure of the
编码校正单元12包括编码测量单元121、块线编码存储器123、寄存器R1和R2、选择器S1、乘法器M1以及加法器A1。The
编码测量单元121测量在已经由编码单元11编码的块线n产生的编码量Cn。寄存器R1保持校正系数P,并且寄存器R2保持校正系数1。根据来自微计算机4的指令,选择器S1在块线n进行帧内编码时将校正系数P施加给乘法器M1,并且在块线n进行帧间编码时将将校正系数1施加给乘法器M1。The
该乘法器M1将产生的编码量Cn和指定的校正系数相乘。The multiplier M1 multiplies the generated code amount Cn by a specified correction coefficient.
该块线编码存储器123为由7个寄存器构成的移位寄存器。在块线编码存储器123中顺序存储乘法器M1的计算结果。加法器A1将存储结果相加,并得出校正编码量Cn’。The block
在图24中,C5到C11分别产生的编码量。在图中,假设C5到C7为帧内编码,并且C8到C11为帧间编码。In Fig. 24, C5 to C11 respectively generate code amounts. In the figure, it is assumed that C5 to C7 are intra-frame encoded, and C8 to C11 are inter-frame encoded.
在这种情况下,在加法器A1中的计算结果为如下公式27。In this case, the calculation result in the adder A1 is the following formula 27.
Cn’=(C5+C6+C7)*P+(C8+C9+C10+C11) 公式27Cn’=(C5+C6+C7)*P+(C8+C9+C10+C11) Formula 27
在上述公式中,C5+C6+C7为帧内编码块线产生的的编码总量CAna,且C8+C9+C10+C11为帧间编码块线产生的编码总量CAnb。In the above formula, C5+C6+C7 is the total amount of codes CAna generated by intra-frame coding block lines, and C8+C9+C10+C11 is the total amount of codes CAnb generated by inter-frame coded block lines.
通过上述结构,编码校正单元12可以通过公式24输出校正编码量Cn’。With the above structure, the
[操作][operate]
图25所示为根据第八实施方式的运动图像编码装置38的操作。FIG. 25 shows the operation of the moving
运动图像编码装置38响应于来自微计算机4的指令启动编码。首先,运动图像编码装置38对块线1进行帧内编码(步骤S82)。因为块线1没有前块线,故块线1总是进行帧内编码。在对块线进行帧内编码时使用Qpintra作为量化步长的初始值。那么,该运动图像编码装置38在块线编码存储器123中存储块线1产生的编码量(步骤S82)。因为块线1为帧内编码,C1*P存储于块线编码存储器123中。The moving
此后,该运动图像编码装置38重复从步骤S81到步骤S84的操作直到完成块线7的编码,并因此,完成帧1的帧内编码。Thereafter, the moving
一旦完成块线7的帧内编码,运动图像编码装置38校正目标编码量(步骤S86),并基于块线1到7产生的编码总量、块线1到7的量化步长以及校正目标编码量确定用于块线8的量化步长(步骤S87)。该运动图像编码装置38采用确定的量化步长帧间编码块线8(步骤S88)。Once the intra-frame encoding of
运动图像编码装置38在块线编码存储器123中存储块线8产生的编码量(步骤S89)。因为块线8为帧间编码,故C8存储于块线编码存储器123中。此后,运动图像编码装置38重复步骤S85到步骤S90的操作直到微计算机4指示结束成像。The moving
图26所示为根据第八实施方式确定量化步长操作的详细示意图。Fig. 26 is a detailed schematic diagram of determining the quantization step size according to the eighth embodiment.
在微计算机4指示对块线(n+1)进行帧间编码(步骤S851:帧间),该运动图像编码装置38确定用于块线(n+1)量化的量化步长Qp[n+1]为{(CAna*P+CAnb)/dstC’}*Qp[An](步骤S852)。When the
另一方面,在微计算机4指示对块线(n+1)进行帧内编码(步骤S851:帧内)时,该运动图像编码装置38确定用于块线(n+1)量化的量化步长Qp[n+1]为Qpintra(步骤S853)。On the other hand, when the
校正目标编码量的操作和第三实施方式一样,因此这里不作说明。The operation of correcting the target code amount is the same as that of the third embodiment, so it will not be described here.
[效果][Effect]
图27所示为根据第八实施方式编码量按时间顺序变化的示意图。Fig. 27 is a schematic diagram showing the change of the encoding amount in time sequence according to the eighth embodiment.
在确定用于块线12的量化步长时,参照包括在A5部分中的7条块线(块线C5到C11)产生的编码量。位于A5部分的7条块线中,位于子部分A5a中的块线5到7为帧内编码,并因此要进行校正。A5部分中的7条块线中位于子部分A5b中的块线8到11为帧间编码,并因此不必进行校正。In determining the quantization step size for the
如上所述述,通过确定各块线的量化步长,可以通过较小时间段的单元将编码量调整稳定。As described above, by determining the quantization step size of each block line, the amount of coding can be adjusted and stabilized in units of smaller time segments.
第九实施方式Ninth Embodiment
在第九实施方式中,运动图像编码装置39可以执行从第一到第八实施方式的确定量化步长的所有类型的方法,并且使用由用户随意选择其中之一方法来确定量化步长。In the ninth embodiment, the moving
[结构][structure]
图28所示为根据第九实施方式的运动图像成像装置的结构。FIG. 28 shows the structure of a moving picture imaging device according to a ninth embodiment.
该运动图像成像装置设置有一模式切换按钮7。除此以外,根据第九实施方式的运动图像成像装置和根据第一到第八实施方式的运动图像成像装置一样,因此这里不作说明。The moving image imaging device is provided with a
模式切换按钮7接受确定量化步长的方法其中之一的选择。将该选择经由微计算机4通知给运动图像编码装置39。该运动图像编码装置39采用选出的确定量化步长的方法编码运动图像。The
以上说明了基于优选实施方式的运动图像成像装置和运动图像编码装置。然而,本发明并不限于以上实施方式,并且下面的变形也包括在本发明中。The moving picture imaging device and moving picture encoding device based on the preferred embodiments have been described above. However, the present invention is not limited to the above embodiments, and the following modifications are also included in the present invention.
(1)在以上优选实施方式中,编码校正单元12通过将Cn和校正系数相乘来执行校正,以实现公式Qp[n+1]=(Cn*P/dstC)*Qp[n]。然而,公式的解释不限于上述实施方式。例如,可以采用以下的解释,替代校正产生的编码量,在帧n已经进行帧内编码时目标编码量可以校正为P/dstC。在这种情况,图1所示的编码校正单元12是没必要的,量化步长确定单元13选择P/dstC作为帧n已经进行帧内编码时的目标编码量,而选择1/dstC作为帧n已经进行帧间编码时的目标编码量。(1) In the above preferred embodiments, the
(2)在以上的优选实施方式中,校正系数P为固定值。然而,校正系数P不限于固定值,并可以随着要参考的帧的量化步长变小而增大,如同下述公式28。(2) In the above preferred embodiments, the correction coefficient P is a fixed value. However, the correction coefficient P is not limited to a fixed value, and can be increased as the quantization step size of the frame to be referred to becomes smaller, as in Formula 28 below.
P=1/(Qn-b)+c 公式28P=1/(Qn-b)+c Formula 28
在该公式中,b和c为可调参数。In this formula, b and c are adjustable parameters.
而且,也可以参照近似于公式28的直线或常数,或者参照指定给各量化步长的表来确定该量化步长。Also, the quantization step size may be determined with reference to a straight line or a constant approximate to Formula 28, or with reference to a table assigned to each quantization step size.
(3)在第六实施方式中,逐帧执行目标编码量的校正。但是,也可以对各块线执行该校正。(3) In the sixth embodiment, correction of the target encoding amount is performed frame by frame. However, this correction may also be performed for each block line.
(4)将编码单元11解释为MPEG编码器。但是,如果编码单元可以采用预测编码和量化二者来编码数据,则编码单元11不限于MPEG编码器。(4) The
(5)在上述优选实施方式中,通过计算确定帧(n+1)的量化步长。然而,本发明不限于此。例如,可以从存储于与帧n的预测编码、量化步长以及产生的编码量的组合相对应的多个量化步长中选择用于帧(n+1)的量化步长。在这种情况下,不用对于各帧计算就可以确定量化步长。(5) In the above preferred embodiment, the quantization step size of frame (n+1) is determined by calculation. However, the present invention is not limited thereto. For example, the quantization step size for frame (n+1) may be selected from a plurality of quantization step sizes stored corresponding to combinations of predictive encoding, quantization step size, and generated code amount of frame n. In this case, the quantization step size can be determined without calculation for each frame.
(6)在上述优选实施方式中,考虑帧n的各种参数(帧n的预测编码、量化步长和产生的编码量)。但是,本发明不限于该实施例,并可以采用帧(n+1)以前的任意帧的参数。例如,可以使用帧(n-1)的参数。(6) In the above-mentioned preferred embodiments, various parameters of frame n (predictive coding of frame n, quantization step size, and generated code amount) are considered. However, the present invention is not limited to this embodiment, and parameters of an arbitrary frame before frame (n+1) may be used. For example, parameters of frame (n-1) may be used.
(7)在上述优选实施方式中,要考虑一帧的各种参数。但是,本发明不限于此。可以使用不止一帧的参数。尽管使用不止一帧的参数提高了运动图像编码装置的处理量,但是在采用不止一帧的参数时对波动的抑制效果更佳。(7) In the above preferred embodiments, various parameters of one frame are considered. However, the present invention is not limited thereto. More than one frame parameter can be used. Although the use of parameters of more than one frame improves the processing capacity of the motion image encoding device, the effect of suppressing fluctuations is better when the parameters of more than one frame are used.
尽管已经参照附图以实施例方式对本发明进行了完整的描述,但是应该注意的是,很显然对于本领域的技术人员而言,可以对本发明做出各种变型和改进。因此,除非这些变型和改进脱离开本发明的范围,否则将认为它们包含在本发明中。Although the present invention has been fully described by way of embodiments with reference to the accompanying drawings, it should be noted that various modifications and improvements to the present invention will be apparent to those skilled in the art. Therefore, unless otherwise such modifications and improvements depart from the scope of the present invention, they should be construed as being included therein.
Claims (19)
Applications Claiming Priority (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004264418 | 2004-09-10 | ||
JP2004264418 | 2004-09-10 | ||
JP2005255228 | 2005-09-02 |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1747553A CN1747553A (en) | 2006-03-15 |
CN100477794C true CN100477794C (en) | 2009-04-08 |
Family
ID=36166851
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 200510102459 Active CN100477794C (en) | 2004-09-10 | 2005-09-09 | Moving picture coding device, coding method thereof, and moving picture imaging device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100477794C (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2334079B1 (en) * | 2008-09-29 | 2014-05-14 | Panasonic Corporation | Method for encoding moving picture and moving picture encoding device |
JP5421727B2 (en) * | 2009-10-20 | 2014-02-19 | キヤノン株式会社 | Image processing apparatus and control method thereof |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1124434A (en) * | 1994-07-08 | 1996-06-12 | 三星电子株式会社 | Device for qualitizing step length controlling using nervous network |
WO1998037701A1 (en) * | 1997-02-12 | 1998-08-27 | Sarnoff Corporation | Apparatus and method for optimizing the rate control in a coding system |
-
2005
- 2005-09-09 CN CN 200510102459 patent/CN100477794C/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1124434A (en) * | 1994-07-08 | 1996-06-12 | 三星电子株式会社 | Device for qualitizing step length controlling using nervous network |
WO1998037701A1 (en) * | 1997-02-12 | 1998-08-27 | Sarnoff Corporation | Apparatus and method for optimizing the rate control in a coding system |
Also Published As
Publication number | Publication date |
---|---|
CN1747553A (en) | 2006-03-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101518358B1 (en) | Buffer-based rate control using frame complexity, buffer level and location of intra frames in video coding | |
US7023914B2 (en) | Video encoding apparatus and method | |
AU2006221586B2 (en) | Encoding method, encoding device, processing program for encoding, and recording medium having the processing program for encoding recorded therein | |
EP1063851B1 (en) | Apparatus and method of encoding moving picture signal | |
RU2502213C2 (en) | Image processing device and image processing method | |
JP2001169281A (en) | Device and method for encoding moving image | |
CN101325714B (en) | Transform data processing method and device, encoding and decoding method and device | |
US6052488A (en) | Image coding apparatus for converting image information to variable length codes of predetermined code size, method of image coding and apparatus for storing/transmitting image | |
US6661840B1 (en) | Image encoder and method of the same | |
US8587683B2 (en) | Imaging apparatus having improved usability when moving images and still images are recorded | |
CN101888556B (en) | Encoding, decoding method and encoding, decoding device | |
US6714592B1 (en) | Picture information conversion method and apparatus | |
US20100111180A1 (en) | Scene change detection | |
JP2002511668A (en) | Method and apparatus for performing adaptive encoding rate control of a video information stream containing 3: 2 pulldown video information | |
CN100477794C (en) | Moving picture coding device, coding method thereof, and moving picture imaging device | |
JP4800712B2 (en) | Moving picture coding apparatus, moving picture coding method, and moving picture imaging apparatus | |
US20090060039A1 (en) | Method and apparatus for compression-encoding moving image | |
US7106796B2 (en) | Apparatus and method for adaptively controlling bit rate of video transcoder | |
US8116577B2 (en) | Encoding method, encoding device, encoding process program, and recording medium on which encoding process program is recorded | |
US7801214B2 (en) | Method and apparatus for controlling encoding rate and quantization scales | |
JP2001016580A (en) | Encoding device | |
US7899261B2 (en) | Imaging device that generates photographic image data | |
US20020106021A1 (en) | Method and apparatus for reducing the amount of computation of the video images motion estimation | |
JP2007336005A (en) | Image coding apparatus and image coding method | |
JP2000287210A (en) | Method and unit for compressing image |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20200605 Address after: Japan Patentee after: Panasonic semiconductor solutions Co.,Ltd. Address before: Osaka Patentee before: Panasonic Corp. |
|
TR01 | Transfer of patent right |