TW200425745A - Quantization matrix adjusting method for avoiding underflow of data - Google Patents

Quantization matrix adjusting method for avoiding underflow of data Download PDF

Info

Publication number
TW200425745A
TW200425745A TW92112858A TW92112858A TW200425745A TW 200425745 A TW200425745 A TW 200425745A TW 92112858 A TW92112858 A TW 92112858A TW 92112858 A TW92112858 A TW 92112858A TW 200425745 A TW200425745 A TW 200425745A
Authority
TW
Taiwan
Prior art keywords
quantization matrix
quantization
scale factor
image
aforementioned
Prior art date
Application number
TW92112858A
Other languages
Chinese (zh)
Other versions
TWI221743B (en
Inventor
Yung-Ching Chang
Original Assignee
Silicon Integrated Sys Corp
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 Silicon Integrated Sys Corp filed Critical Silicon Integrated Sys Corp
Priority to TW92112858A priority Critical patent/TWI221743B/en
Application granted granted Critical
Publication of TWI221743B publication Critical patent/TWI221743B/en
Publication of TW200425745A publication Critical patent/TW200425745A/en

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

A quantization matrix adjusting method for avoiding underflow of VBV by enlarging the default quantization matrix. The adjusting method comprising the steps of: updating a used bits BB_X and an average quantizer scale Avg_Q; allocating the bit budget BB_C for the current picture; calculating an estimated quantizer scale Est_Q according to the used bits BB_X, average quantizer scale Avg_Q and the bit budget BB_C; deciding the operation mode, the encoder entering an alert mode when the estimated quantizer scale Est_Q is larger than a threshold Th_Q, otherwise the encoder remaining at normal mode; enlarging the default quantization matrix as a new quantization matrix when the operation mode is the alert mode; and coding the current picture, the encoder coding the current using the new quantization matrix and default quantization matrix in the alert mode and normal mode, respectively.

Description

五、發明說明(1) 一、 【發明所屬之技術領域】 t發明係關於避免資料量不足的量化矩陣調整方法, 2 關,利用放大量化矩陣來避免視訊緩衝核驗器資料 里不足的量化矩陣調整方法。 二、 【先前技術】 為了細小影像貧料量,一般會對影像進行壓縮,例如 MPEG格式之影像編碼(c〇ding)。影像編碼之基本單元 (basic unit)為巨集區塊(macr〇_bi〇ck)。若取樣 (sampling)為4:2:0格式,則每個巨集區塊具有6個區塊 (bloc^k),分別為4個丫區塊、一個⑶區塊、以及一個&區 塊。每個區塊必須先經過離散餘弦轉換(discrete⑶幻… transform,以下簡稱DCT)後,再將DCT係數 (coefficient)里化成整數(integer)。一種鋸齒形 (zigzag)掃描或其他替代之掃描方法被用來將二維 (two-hmension)之量化係數陣列排列成一維 (oneydi mens ion)資料。最後,再利用所謂可變長度編碼 (variable - length coding,以下簡稱VLC)進行熵編碼 (entropy coding)。 通常,DCT係數F[v][u]的量化可表示成: QF[v][u] 16 * F[v][u] / (q * w[v][u])…(1) 、其中’ v、u為二維陣列之指標(index),範圍從〇〜7。 Q為母個巨集區塊内之各區塊的量化比例因子(quant scale),可隨著不同之巨集區塊改變。以¥][11]為整張圖 200425745 五、發明說明(2) 像(picture)所定義之量化矩陣(qUantization matrix), 用來指定每個不同DCT係數之權值(weighting factor)。 圖1顯示在MPEG-2規格中對内部區塊(intra block)所定義 的預设篁化矩陣。如圖1之量化矩陣所示,該量化矩陣的 值隨著陣列指標V、U的增加而逐漸變大。此特性使得具有 高頻之量化係數較易變成0,原因是人類的眼睛對於低頻 信號較敏感,而對高頻信號較不敏感。 另外’反量化(inverse —quantization)被使用於回復 (recover) DCT係數。通常量化之DCT係數QF[v] [u]的反量 化被定義為: F’[v][u] = QF[V][U] * Q * w[v][u] / 16 …(2) 其中F’ [v] [u]為回復之DCT係數。原始之DCT係數 F[v][u]與回復之DCT係數F,[v][u]的差值被稱為量化誤差 (quantization error),且被定義為: E[v] [u] = F[v] [u] - F’ [v] [u] ...(3) 而量化比例因子Q被用於調整量化矩陣w [ v ] [ u ]之内容 的比例值’ Q值的範圍係從1〜3 1。應用於mpeg - 1與MPEG-2 之可適應性1化(adaptive quantization)可隨意變化每 個巨集區塊之Q值,但於MPEG-4時僅能些微(slig^tly)調 整相鄰巨集區塊的Q值。而且,MPEG-2具有將量化比例因 子從(1〜3 1)對應到從(〇. 5〜5 6 )之非線性之實際量化比例因 子的功能。 調整量化比例因子Q可以控制巨集區塊之位元消耗 (bit consumption)以及編碼品質(c〇ded quality)。對於V. Description of the invention (1) 1. [Technical field to which the invention belongs] The invention relates to a quantization matrix adjustment method for avoiding insufficient data amount. 2 Offsets, using an enlarged quantization matrix to avoid the adjustment of the quantization matrix in the video buffer checker data. method. 2. [Previous Technology] In order to reduce the amount of poor material in the image, the image is generally compressed, for example, MPEG-based image coding (coding). The basic unit of image coding is a macroblock (macr0_bioc). If the sampling is in the 4: 2: 0 format, each macro block has 6 blocks (bloc ^ k), which are 4 Y blocks, 1 CD block, and 1 & block. . Each block must undergo discrete cosine transform (hereinafter referred to as DCT), and then the DCT coefficients (coefficient) are converted into integers. A zigzag scan or other alternative scanning method is used to arrange two-dimensional (two-hmension) quantization coefficient arrays into one-dimensional (oneydimension) data. Finally, the so-called variable-length coding (VLC for short) is used for entropy coding. Generally, the quantization of the DCT coefficient F [v] [u] can be expressed as: QF [v] [u] 16 * F [v] [u] / (q * w [v] [u]) ... (1), Where 'v, u are indexes of a two-dimensional array, ranging from 0 to 7. Q is a quant scale of each block in the parent macro block, which can be changed with different macro blocks. Take ¥] [11] as the whole picture 200425745 V. Description of the invention (2) The quantization matrix (qUantization matrix) defined by picture is used to specify the weighting factor of each different DCT coefficient. Figure 1 shows the preset dithering matrix defined for the intra block in the MPEG-2 specification. As shown in the quantization matrix of Fig. 1, the value of the quantization matrix gradually increases as the array indexes V and U increase. This characteristic makes quantization coefficients with high frequencies easier to become 0, because human eyes are more sensitive to low-frequency signals and less sensitive to high-frequency signals. In addition, 'inverse-quantization' is used to recover DCT coefficients. The inverse quantization of the commonly quantized DCT coefficient QF [v] [u] is defined as: F '[v] [u] = QF [V] [U] * Q * w [v] [u] / 16… (2 ) Where F '[v] [u] is the DCT coefficient of the reply. The difference between the original DCT coefficient F [v] [u] and the returned DCT coefficient F, [v] [u] is called the quantization error and is defined as: E [v] [u] = F [v] [u]-F '[v] [u] ... (3) and the quantization scale factor Q is used to adjust the scale of the content of the quantization matrix w [v] [u]' Q value range Department from 1 to 3 1. Applied to mpeg-1 and adaptive quantization of MPEG-2 (adaptive quantization) can change the Q value of each macroblock at will, but in MPEG-4 can only adjust the neighboring macros slightly (slig ^ tly) Sets the Q value of the block. In addition, MPEG-2 has a function of quantizing the scale factor from (1 to 3 1) to the non-linear actual quantizing scale factor from (0.5 to 5 6). Adjusting the quantization scale factor Q can control the bit consumption and coding quality of the macro block. for

第7頁 200425745Page 7 200425745

車父,之Q值會使量化DCT係數變小,而造成更多 係數為0。因此,經過VLC處理後的編碼位元流 stream)會變短。然而,結果會造成量化誤差變 =碼後之影像品質變差。若我們希望得到較好的影像1^ 質,則必須設定較小的Q值以降低量化 元流會變長。 左仁疋編碼位 ^在一般的應用中,…以位元流的位元率(bit-rate)曰 受到限制的(constrained)。例如,在數位影音光碟 疋 (Digital Versatile Disk , DVD)的標準中即^義MpEG—2 視訊流(video stream)的位元率不可高於每秒98仙,所 以在編碼過程中必須控制位元消耗來滿足該項限制。 在一連串視訊晝面中的每張圖像的内容均有變化,且 編碼之複雜度(complexity)在每個部分亦不盡相同。使用 於MPEG-1之視訊緩衝核驗器(vide〇 buffer verifier 以 下簡稱VBV)對於不同圖像雖多少有提供位元率消耗之通融 性(f 1 ex i b i 1 i ty ),但長時間之整體位元率仍為固定位元"" 率(constant bit rate ,以下簡稱CBR)。而MPEG-2引進了 可變位元率(variable bit rate,以下簡稱VBR)操作模 式,提供了每張圖像位元率消耗之變化更大通融性。VBV 缓衝器被用來模仿(emulate)MPEG解碼器之輸入緩衝器, 且由MPEG編碼器產生之位元流不可違反(violate) VBV緩 衝器之限制,否則位元流將無法適當地被解碼。圖2顯示 VBV緩衝器在CBR操作模式之示意圖。如該圖所示,斜線部 分係表示以固定位元率輸入緩衝器之編碼資料,而垂直線Car parent, the Q value will make the quantized DCT coefficient smaller, and cause more coefficients to be 0. Therefore, the encoded bit stream (stream) after VLC processing becomes shorter. However, the result will be that the quantization error will change = the image quality will deteriorate after coding. If we want to get better image quality, we must set a smaller Q value to reduce the quantization element stream will become longer. Zuo Renyi coded bits ^ In general applications, ... are constrained at the bit-rate of the bitstream. For example, in the standard of Digital Versatile Disk (DVD), which means that the bit rate of MpEG-2 video stream cannot be higher than 98 cents per second, so the bit must be controlled during the encoding process. Consume to meet this limit. The content of each image in a series of video diurnal changes, and the complexity of the encoding varies from part to part. Although used for MPEG-1 video buffer verifier (VideObuffer verifier hereinafter referred to as VBV), it provides the bit rate consumption flexibility (f 1 ex ibi 1 ity) for different images, but the overall bit for a long time. The bit rate is still a constant bit rate (constant bit rate, hereinafter referred to as CBR). MPEG-2 introduces a variable bit rate (VBR) operation mode, which provides greater flexibility in the change in bit rate consumption of each image. The VBV buffer is used to emulate the input buffer of the MPEG decoder, and the bit stream generated by the MPEG encoder must not violate the restrictions of the VBV buffer, otherwise the bit stream cannot be decoded properly . Figure 2 shows the VBV buffer in CBR operation mode. As shown in the figure, the oblique line represents the coded data input to the buffer at a fixed bit rate, while the vertical line

第8頁Page 8

459 200425745459 200425745

部分係表示從緩衝器瞬間移出之被解碼圖像的資料。 為了使位元流滿足MPEG位元控制的要求,當解瑪器要 解碼圖像時,圖像的資料必須已經儲存於緩衝器内解 碼器之緩衝器不可過滿(overfiu)。參考圖2,若一張圖 像消耗太多位元’則V B V緩衝器或許會資料不足 ° (underflow),因此可分配位元(all〇cataMe Mts)的上 限(upper bound)為UB。相同的,若一張圖像消耗太少位 元,則VBV緩衝器或許會資料溢流(〇verfl〇w),因此可分 配位元(allocatable bits)的下限(1〇wer b〇und)為u。Part indicates the data of the decoded image that is momentarily removed from the buffer. In order to make the bit stream meet the requirements of MPEG bit control, when the decoder needs to decode the image, the image data must have been stored in the buffer. The decoder's buffer must not be overfiu. Referring to Fig. 2, if an image consumes too many bits', the V B V buffer may have insufficient data (underflow), so the upper bound of allocable bits (all0cataMe Mts) is UB. Similarly, if an image consumes too few bits, the VBV buffer may overflow the data (〇verfl0w), so the lower limit (10wer b〇und) of allocableable bits is u.

圖3顯示VBV緩衝器在VBR操作模式之示意圖。VBR與cbr操 作模式之差異性是VBR操作模式是以指定的最大位元率輸 入VBV緩衝器直到VBV緩衝器滿載為止,因此VBR操作模式 的平均位元率輸入率是可變的。所以,VBR沒有最少位元 率之限制,只有可分配最大位元率υβ的限制。FIG. 3 shows the VBV buffer in VBR operation mode. The difference between VBR and cbr operation modes is that the VBR operation mode is input into the VBV buffer at the specified maximum bit rate until the VBV buffer is fully loaded, so the average bit rate input rate of the VBR operation mode is variable. Therefore, VBR does not have a limitation on the minimum bit rate, only a limitation on the maximum bit rate υβ that can be allocated.

為了滿足VBV的限制,編碼器必須對每張圖像分配一 個位元預算值(bit budget),之後試著控制實際的消耗位 π接近位元預算值。一般是利用虛擬緩衝機制(virtual buffer mechanism)來控制位元消耗。當緩衝器佔有量低 =〇時,則將量化比例因子Q對應為i ;而當緩衝器佔有量 同於門松值R ( ΐ h r e s h ο 1 d )時,則將量化比例因子q對應 為31。門檻值R—般被稱為反應因子(reacti〇n fact〇r)。 在對一張圖像編碼之前,虛擬緩衝器之佔有量])初始為 dO ’初始之量化比例因子q為q〇,貝|Jd〇 = R * / 31。 編碼器即利用該量化比例因子q對第一個巨集區塊進行量In order to meet the limitation of VBV, the encoder must allocate a bit budget to each image, and then try to control the actual consumption bit π close to the bit budget. Generally, a virtual buffer mechanism is used to control the bit consumption. When the buffer occupancy is low = 0, the quantization scale factor Q is corresponding to i; and when the buffer occupancy is the same as the gate loose value R (ΐ h r e s h ο 1 d), the quantization scale factor q is corresponding to 31. The threshold value R is generally called a response factor (react factor). Before encoding an image, the occupancy of the virtual buffer]) is initially dO ′, and the initial quantization scale factor q is q0, | Jd0 = R * / 31. The encoder uses the quantization scale factor q to perform the first macro block amount.

第9頁 468 200425745Page 9 468 200425745

五、發明說明(5) 化並編碼。一個巨集區塊所消耗之位元量若大於平均位元 預算值,則虛擬緩衝器佔有量D增加,否則虛擬緩衝器佔& 有量D減少。若虛擬缓衝器佔有量d增加超過⑽+ R/31, 則將量化比例因子Q設定成q〇 + 1。此狀況意味著位元消 耗量超過太多,所以增加量化比例因子q來試圖減少位元 消耗率。若虛擬緩衝器佔有量D減少低於dO - R/31,則將 量化比例因子Q設定成q〇 — 1。此狀況意味著位元消耗量' 低於預期值,所以減少量化比例因子q來試圖增加位二 耗率。 使用虛擬緩衝機制來控制位元消耗的問題是要如何指 定虛擬緩衝器初始佔有量d 〇。該虛擬緩衝器初始佔有量己〇 可視為目前圖片之編碼複雜度的估測值(estimati〇n)。辦 於一個固定的位7C預算值而言,若目前圖像之複雜度相鮮 的較高,則必須選擇較高之虛擬緩衝器初始佔有量⑽,使 得每個巨集區塊之量化比例因子Q相對的提高。但是,編 碼器並不知道目前圖像之複雜度直到該圖像被實際編碼 後。一種解決方式是繼承(inherit)前一張圖像之虛擬緩 衝器佔有量。此種簡單方式可處理大部分狀況而不會有嚴 重問題,但是當一連串之視訊的影像内容有快速改變時, 則會造成VBV資料不足。 每個巨集區塊之量化比例因子9的範圍是從i至31,此 範圍可以處理視訊編碼之大部分狀況。然而,當一連串之 視訊都很複雜’且目標位元率很低時,則無法避免VBV資 料不足(underHow)。甚至當量化比例因子卩被設定成31,V. Description of the invention (5) Transform and encode. If the amount of bits consumed by a macro block is greater than the average bit budget value, the virtual buffer occupancy D increases, otherwise the virtual buffer occupancy & D decreases. If the virtual buffer occupancy d increases beyond ⑽ + R / 31, the quantization scale factor Q is set to q0 + 1. This condition means that the bit consumption is too much, so the quantization scale factor q is increased to try to reduce the bit consumption rate. If the virtual buffer occupancy D decreases below dO-R / 31, the quantization scale factor Q is set to q0-1. This situation means that the bit consumption 'is lower than expected, so the quantization scale factor q is reduced in an attempt to increase the bit two consumption rate. The problem of using the virtual buffer mechanism to control the bit consumption is how to specify the initial occupied amount of virtual buffer d0. The initial occupancy of the virtual buffer can be regarded as an estimated value of the coding complexity of the current picture (estimation). For a fixed budget value of 7C, if the complexity of the current image is relatively high, you must choose a higher initial occupancy of the virtual buffer, so that the quantization scale factor of each macro block Q is relatively high. However, the encoder does not know the complexity of the current image until the image is actually encoded. One solution is to inherit the virtual buffer occupancy of the previous image. This simple method can handle most situations without serious problems, but when the content of a series of video images changes rapidly, VBV data will be insufficient. The range of the quantization scale factor 9 of each macro block is from i to 31, and this range can handle most situations of video coding. However, when a series of videos are very complicated ’and the target bit rate is low, it is impossible to avoid the underhow of VBV. Even when the quantization scale factor 卩 is set to 31,

第10頁 ----- 461 200425745 五、發明說明(6) 對於每個巨集區塊仍然需要女炙从a - 而聲太多的位兀消耗量。美國專利 第5,8 0 1,7 7 9號專利提出一種”腎|禮々 · 、:七 士 ^ ^ ^ 裡緊急模式(panic mode),,來 克服此狀況。遠緊急模式是扁欲1 —— 1、八疋在編碼完每個巨集區塊後,監 視VBV緩衝器之佔有量。若女夕a 一 a L 卞匕尾傻孤 访t , 右太多位兀被消耗掉且在編碼完 整個圖像後會造成VBV資料石? ^ .^ /枓不足,則該編碼器進入緊急模 土二f緊急模二時,編碼器寧可選擇以inter模式進行巨 :則不編碼。若巨集區塊以―式 2巨集區塊編碼(1圖像之巨集區塊必須為intra模式), 僅有一部份係數被編碼,其餘孫 ^ M _ /、餘係數為0來減少位元數。雖 然此種方式可避免VBV資料不足,乂 ,、s门 低。 M 7十+足’但部是圖像品質嚴重降 内上I 上含對根計量急器 明於 。成包;係值測緊碼 發鑒β法達法子,算估為編 ί有Μ方為方因子預當定當 實 、 V整 整例因元,設, 三VB調 調比例位式則陣 容】 述問題,本發明之目的是提供一種可避免 同時不會使圖像品質嚴重降低之量化矩陣 述目的,本發明避免資料量不足的量化矩陣 下列步驟:更新已使用位元量以及平均量化 目前圖像指定位元預算值;言十算估測量化比 據已使用位元*、平均量化比例因子、以及 算估測量化比例因判斷是否進入緊急模 化比例因子大於—量化比例因子門檻值時, 权式’否則保持為—般模式;調整量化矩 進入緊急模式日寺,將預設之量化矩陣放大;Page 10 ----- 461 200425745 V. Description of the invention (6) For each macro block, women still need to follow from a-while too much bit consumption. U.S. Patent No. 5,8 0,1,77,9 proposes a "kidney | li 々 ::: 七 ^^ panic mode" to overcome this situation. The far emergency mode is the flat one —— 1. Hachiman monitors the VBV buffer's occupancy after encoding each macro block. If the girl Xi a a a L 卞 dagger visits t stupidly, too many bits on the right are consumed and Will the VBV data stone be generated after the entire image is encoded? ^. ^ / 枓 is insufficient, when the encoder enters the emergency mode soil f f emergency mode 2, the encoder would prefer to use the inter mode to perform the giant: no encoding. If the giant The set block is coded with ―style 2 macro block (the macro block of 1 image must be in intra mode), only a part of the coefficients are encoded, and the rest of the sun ^ M _ /, the co coefficient is 0 to reduce the bits Although this method can avoid the lack of VBV data, 乂 ,, s door is low. M 7 ten + feet 'but the image quality is severely reduced. The upper part of the upper part contains the measuring device for measuring the root. It is included in the package; The value-tightening code is sent to the beta method. It is estimated to be compiled as follows: the square factor is pre-determined, the whole factor is V, and VB is adjusted. The problem is described below. The purpose of the present invention is to provide a quantization matrix that can avoid the serious degradation of image quality at the same time. The present invention avoids a quantization matrix with insufficient data volume. The following steps: update the used bits And the average quantization of the current specified bit budget value of the image; the number of calculations based on the measured bit rate *, the average quantization scale factor, and the ratio of the calculation and measurement scale to determine whether the scale factor for emergency modeling is greater than-quantization When the threshold value of the scale factor is set, the weight formula 'otherwise remains in the normal mode; adjust the quantization moment to enter the emergency mode Risi, and enlarge the preset quantization matrix;

第11頁Page 11

4κ7 2004257454κ7 200425745

五、發明說明(7) 以及編碼,當編碼器進入緊 矩陣進行編碼,當編碼器為 矩陣進行編碼。 由於該發明在緊急模式 此可有效地降低量化比例因 空間’使得編碼後之影像品 資料量不足。 急模式時,根據放大後之量化 般模式時,根據預設之量化V. Description of the invention (7) and encoding, when the encoder enters the tight matrix for encoding, and when the encoder encodes for the matrix. Since the invention is in the emergency mode, this can effectively reduce the quantization scale factor space ', so that the amount of data of the encoded video product is insufficient. In emergency mode, according to the quantization after zooming In normal mode, according to the preset quantization

時將預設之量化矩陣放大,因 子’讓量化比例因子具有調整 質可以提昇,且不會造成VBV 四、【實施方式】When the preset quantization matrix is enlarged, the factor ’allows the quantization scale factor to be adjusted. The quality can be improved without causing VBV. 4. Implementation

以:參考圖式詳細說明本發明避免資料量不足的 矩陣調整方法。 曰VBV貝料不足是發生於目前圖像是以預設(default)之 =化矩陣W [ V ] [ U ]與最大之量化比例因子Q進行編碼。由於 量化比例因子Q從丨至31為規袼所制定,無法改變,因此, 本發明以放大預設之量化矩陣?[v] [u]來減少量化DCt係數 QF[v][u](參考式(1))。With reference to the drawings, the matrix adjustment method of the present invention to avoid insufficient data amount will be described in detail. That is, the lack of VBV material occurs when the current image is encoded with a default = W = V [V] [U] and the largest quantization scale factor Q. Since the quantization scale factor Q is established by regulations from 31 to 31 and cannot be changed, the present invention enlarges the preset quantization matrix? [v] [u] to reduce the quantized DCt coefficient QF [v] [u] (refer to equation (1)).

/在MPEG-1與MPEG-2規格中,在每個編碼位元流的開頭 必須配置一串標頭(sequenCe header)資料,且該標頭可 被加入隨後的位元流。一旦解碼器接收到標頭資料,則量 化矩陣W[ v] [u]會被設定成預設值。在Mp^ — 丨中,定製 (customized)的量化矩陣w[v][u]僅可在標頭中設定,且 该標頭僅可插入一圖像群組(Group of pi ctures,以下簡 稱GOP)之前。此意味著當解碼器要變更量化矩陣時,解碼 1§必須重新起始一個G 〇 P,在G 0 P前插入一標頭資料,且在/ In the MPEG-1 and MPEG-2 specifications, a sequence of header data must be placed at the beginning of each encoded bit stream, and this header can be added to subsequent bit streams. Once the decoder receives the header data, the quantization matrix W [v] [u] will be set to the default value. In Mp ^ — 丨, the customized (quantized) quantization matrix w [v] [u] can only be set in the header, and the header can only be inserted into a group of pictures (hereinafter referred to as "Group of pictures" for short) GOP). This means that when the decoder wants to change the quantization matrix, decoding 1§ must restart a G 〇 P, insert a header data before G 0 P, and

第12頁 200425745 五、發明說明(8) 標頭資料中配置新的量化矩陣。而在MPeg 矩陣不僅可以配置於標頭資料中,亦可插入’新的量化 陣。所以,若解碼器要變更量化矩陣時,=γ外延量化矩 編碼之前。 、必須在每張圖像 圖4顯示本發明避免資料量不足的量 第一實施例的流程圖。該實施例的流程u皁调整方法 前圖像事先分析即進行目前圖像之編碼動作有對目 沒有事先掃描分析圖像之複雜度即對圖 $於編碼器 習知TEST模型5(test model 5,ΤΜ5)位元率^制=二就像 (rate control aig0rithm),編碼器只能利 ^ 法 ;像來預估目前圖像之複雜度。胃第一實施例的步驟:碼 步驟:4。2 :更新已使用位元量ββ—χ以及平均量化 因子Avg—Q。在一張χ圖像(χ包含j ,碼之後,編碼器即取得㈣ 最後虛擬緩衝器佔有已使用位元子量 -=S404 ··準備編碼x類圖像並對目前圖像指定位元 ^异=旦—c。在一般狀況下,下一張圖像之初始虛擬緩衝 器佔s里dO — X會被設定成最後虛擬緩衝器佔有量d —X,且 初始里化比例因子會被設定成平均量化比例因子。 由圖框層位元率控制(frame — ievei rate control) 來指定目前圖像之位元預算值BB_C。 步驟S406 :計算估測量化比例因子EstQ_c。由於相同 第13頁 ini 200425745 五、發明說明(9) 格式之相鄰圖像其活動程度大致相同,因此該解碼器利用 前一張圖像之已使用位元量BB一X、目前圖像之位元預算值 BB一C、以及平均量化比例因子Avg-Q來計算目前圖像之估 測量化比例因子EstQ_C :Page 12 200425745 V. Description of the invention (8) A new quantization matrix is configured in the header information. The MPeg matrix can not only be placed in the header data, but also a new quantization matrix can be inserted. Therefore, if the decoder is to change the quantization matrix, it is equal to the γ epitaxial quantization moment before encoding. Every image must be shown in Figure 4. Figure 4 shows the flow chart of the first embodiment of the present invention to avoid insufficient data. The process of this embodiment is the method of adjusting the image before the image is analyzed in advance, that is, the encoding of the current image is performed. The complexity of the image is not scanned and analyzed in advance, that is, the image is known to the encoder. (TM5) Bit rate = system control = 2 Like (rate control aig0rithm), the encoder can only use the method to estimate the complexity of the current image. Steps of the first embodiment of the stomach: Code Step: 4.2: Update the used bit quantity ββ-χ and the average quantization factor Avg-Q. In a χ image (χ contains j, the code is obtained by the encoder.) Finally, the virtual buffer occupies the used bit quantity-= S404. · Ready to encode a class x image and assign bits to the current image ^ Different = Dan—c. Under normal circumstances, the initial virtual buffer occupation s in the next image dO — X will be set to the final virtual buffer occupation d — X, and the initial dilation scale factor will be set The average quantization scale factor is specified by the frame — ievei rate control to specify the bit budget value BB_C of the current image. Step S406: Calculate the estimated scale factor EstQ_c. Because of the same pagei. 200425745 V. Description of the invention (9) Adjacent pictures in format (9) have approximately the same degree of activity, so the decoder uses the used bit amount BB-X of the previous picture and the bit budget value BB- of the current picture C, and the average quantization scale factor Avg-Q to calculate the estimated measurement scale factor EstQ_C of the current image:

EstQ_C = (BB一X/BB—C) * Avg—Q ."(4) 步驟S408 :偵測是否進入緊急模式。當估測量化比例 因子EstQ_C大於一比例因子門檻值ThQj時,例如ThQ_X為 2 4至2 8 ’表示該視訊之圖像内容對於所給的位元率而言是 相當複雜的。若上一張編碼圖像之已使用位元量ββ_χ以及 指定給目前圖像之位元預算值ΒΒ一C大致相等,則可猜測以 指定給目前圖像之位元預算值BB_C將不容易對目前圖像進 行編碼。因此,當估測量化比例因子仏⑶^大於比例因子 門檻值ThQ一X時,則編碼器進入步驟S410的緊急模式,否 則以步驟S4 1 6的一般模式處理。 步驟S 41 0 :放大預設量化矩陣成為新的量化矩陣。在 緊急模式中,編碼器會希望將目前圖像之最後平均量化比 例因子降低到一個安全值SQ_X,而該安全值SQ_X可能會小 於或等於比例因子門檻值ThQ_X。因此,本發明係利用一 調整因子(adjustment factor)S來放大預設之量化矩陣, 且初始虛擬緩衝器佔有量會被減少成dO_X/S。該調整因子 S為一個大於1的數值,且可由下式計算: S = EstQ—C / SQ—X --(5) 而新的量化矩陣W’ [v] [u]為: W’ [v] [u] = W0[v][u] * S …(6)EstQ_C = (BB-X / BB-C) * Avg-Q. &Quot; (4) Step S408: Detect whether to enter the emergency mode. When the measured scale factor EstQ_C is greater than a scale factor threshold ThQj, for example, ThQ_X is 2 4 to 2 8 ′, which indicates that the image content of the video is quite complicated for the given bit rate. If the used bit amount ββ_χ of the previous coded image and the bit budget value BB-C assigned to the current image are approximately equal, it can be guessed that the bit budget value BB_C assigned to the current image will not be easy to match. The image is currently encoded. Therefore, when the estimated scale factor 仏 CD ^ is greater than the scale factor threshold ThQ-X, the encoder enters the emergency mode of step S410, otherwise it is processed in the general mode of step S4 16. Step S 41 0: Enlarge the preset quantization matrix into a new quantization matrix. In the emergency mode, the encoder may wish to reduce the final average quantization scale factor of the current image to a safety value SQ_X, and the safety value SQ_X may be less than or equal to the scale factor threshold ThQ_X. Therefore, the present invention uses an adjustment factor S to enlarge the preset quantization matrix, and the initial virtual buffer occupancy is reduced to dO_X / S. The adjustment factor S is a value greater than 1, and can be calculated by the following formula: S = EstQ—C / SQ—X-(5) and the new quantization matrix W '[v] [u] is: W' [v ] [u] = W0 [v] [u] * S… (6)

第14頁 200425745 五、發明說明(ίο) 其中v與u為0〜7的指標。w〇[v][u]可為預設之量化矩 陣或為使用者定義之量化矩陣。因此,安全值即_义越小, 調整因子S就會越大。由於量化矩陣的最大值為255,因此 W’ [ v] [u]之内容的最大值被限制為255。 另外’編碼器中會使用兩個量化矩陣,一個是給内部 (intra)區塊使用,而另一個是給互相關聯(inter)區塊使 用。由於更新一個量化矩陣需要5丨2位元來編碼該量化矩 陣本身以及一些額外的位元,因此在位元使用量有限的情 況下,可儘量減少量化矩陣更新的數量。例如,丨圖像僅 需要内部量化矩陣,而B圖像可能僅需要更新互相關聯量 化矩陣即足夠。而對於P圖像而言,則要依據該圖像存在 多少内部編碼的巨集區塊。若内部編碼的巨集區塊大於一 門檻值,則必須更新内部量化矩陣與互相關聯量化矩陣, 否則只需更新互相關聯量化矩陣即可。 步驟S412 :以新的量化矩陣對目前之圖像進行編碼。 、步驟S 4 1 4 ·檢查目前圖像是否編碼完成,若編碼完 成,則跳回步驟S402,若尚未完成則跳回步驟s41〇。 步驟S41 6 :以預設的量化矩陣對目前之圖像進行編 碼。 、步驟S418 :檢查目前圖像是否編碼完成,若編碼完 成,則跳回步驟S402,若尚未完成則跳回步驟s41〇。 在上述步驟中,若編碼之χ圖像進入緊急模式,則量 化矩陣會放大S倍,由於巨集區塊以新的量化矩陣來量 化,因此在計算平均量化比例因子Avg — Q時,亦必須將該Page 14 200425745 V. Description of the Invention (ίο) Where v and u are indexes of 0 ~ 7. w〇 [v] [u] can be a preset quantization matrix or a user-defined quantization matrix. Therefore, the smaller the safety value is, the larger the adjustment factor S is. Since the maximum value of the quantization matrix is 255, the maximum value of the content of W '[v] [u] is limited to 255. In addition, the encoder uses two quantization matrices, one for intra blocks and the other for inter blocks. Since updating a quantization matrix requires 5 丨 2 bits to encode the quantization matrix itself and some additional bits, the number of quantization matrix updates can be minimized when the bit usage is limited. For example, the image only needs the internal quantization matrix, and the B image may only need to update the interrelated quantization matrix. For a P picture, it depends on how many internally encoded macro blocks exist in the picture. If the internally coded macroblock is larger than a threshold value, the internal quantization matrix and the interrelated quantization matrix must be updated; otherwise, only the interrelated quantization matrix needs to be updated. Step S412: encode the current image with a new quantization matrix. Step S 4 1 4 • Check whether the current image is encoded. If the encoding is completed, skip back to step S402. If it is not completed, skip back to step s41. Step S41 6: encode the current image with a preset quantization matrix. Step S418: Check whether the encoding of the current image is completed. If the encoding is completed, skip back to step S402. If the encoding is not completed, skip back to step s41. In the above steps, if the encoded χ image enters the emergency mode, the quantization matrix will be enlarged by S times. Since the macro block is quantized by the new quantization matrix, it must also be used to calculate the average quantization scale factor Avg — Q. Will be

第15頁Page 15

200425745 五、發明說明(π) 等巨集區塊之Q值放大S倍以反映實際 再者,當對於相鄰圖像之調二碼差^ 對每個圖像變更量化矩陣來反應該微小差異不大’則 式。因此,可以在調整因子3的差異超過二;子的方 行量化矩陣的變更。另夕卜,有一種解 =值時才進 S預設幾個範®,並計算好其對應之量疋將调整因子 調整因子SO可設定為丨.1、丨.2、丨.3 例如預設200425745 V. Description of the invention (π) The Q value of macro blocks such as (π) is enlarged by S times to reflect the actual situation. When the two-dimensional code difference for adjacent images is changed ^ The quantization matrix is changed for each image to reflect the slight difference. Not big 'regular expression. Therefore, the difference in the adjustment factor 3 can be more than two; the change of the child's square quantization matrix. In addition, when there is a solution = the value is entered into S to preset several ranges ®, and the corresponding quantities are calculated. The adjustment factor SO can be set to 丨 .1, 丨 .2, 丨 .3 Assume

應之量化矩陣分別為W1、W2、W3,,因此因:對 為h 21 18、l 16、1.22或1.2時,1更新田之1旦几子S 韓2,且只有第一張圖像需要將量化矩 里化矩陣 流,其餘幾張圖像亦使用量化矩陣W2 =到位元 圖5顯示本發明避免資料量不足的量^車改調遣整方、、去 第-貫施例的流程圖。肖實施例的流程對 前圖像分析後’再進行目前圖像之編 以對圖像預先分析來收集複雜度估測之資m 可更正確地決定是否變更量化矩陣以及如何變&。一二 言,目前圖像之複雜度可藉由進行動作估測(m〇ti〇n又 estimation)時來進行估測。對於!圖像而言, :2集區塊的相異(variance)。對於?與^圖像 而a ,必須根據内部編碼與互相關聯編碼模 ^模式判斷(mode decisis)。相異的總和—般被稱為目 刚圖像之活動程度(activity)。在進行圖像編碼之前,編 碼器可以獲得該圖像之活動程度Act_c。而在圖像編碼之 後,平均量化比例因子Avg_Q以及實際使用位元ΒΒ—χ可以The corresponding quantization matrices are W1, W2, and W3 respectively. Therefore, when the pair is h 21 18, l 16, 1.22, or 1.2, 1 updates Tian Zhi 1 Dan Ji S Han 2 and only the first image is needed. The quantization moment is used to quantize the matrix stream, and the remaining images also use the quantization matrix W2 = in place. Figure 5 shows the flow chart of the present invention to avoid the insufficient amount of data. The process of the embodiment of Example is to edit the current image after the previous image analysis, to analyze the image in advance to collect the complexity estimation information m, and to more accurately decide whether to change the quantization matrix and how to change it. In one or two words, the complexity of the current image can be estimated by performing motion estimation. for! In terms of images, there are 2 sets of block variations. For? And ^ images and a, mode decisis must be determined according to the internal coding and interrelated coding mode. The sum of the differences-generally called the activity of the target image. Before encoding the image, the encoder can obtain the degree of activity of the image, Act_c. After image coding, the average quantization scale factor Avg_Q and the actual bits ΒΒχ can be

第16頁Page 16

EstQ—C =(BB—X/BB—C)*Avg—Q*(Act—C/Act—X) ···(? 式(7)與式(4)的差異是式(7)在計算估測量化比例因 的活動程度高於前一張圖像之 估測量化比例因子EstQ一C會相 後之位元率不會超過位元預算 200425745 五、發明說明(12) 用來計算該圖像之複雜度Com。 當編竭器無法對圖像預先分析目前圖像時,編碼器只 能根據前一張解碼圖像來決定是否變更量化矩陣以及如何 變更。但是當相鄰兩張圖片的圖像内容有快速變化時,此 種方式的決定可能錯誤。例如,當前一張圖像之平均量化 比例因子Avg—Q僅稍低於比例因子門檻值ThQ一X時,目前圖 片將不會進入緊急模式。然而,若目前圖像之編碼複雜度 遠大於前一張圖像之複雜度時,目前圖像編碼後之位元率 將遠超過位元預算值,而造成VBV資料不足。相反的,若 前一張圖像之複雜度相當高,但目前圖像之複雜度相當 低,則過於放大之量化矩陣將造成影像品質大為衰減。 因此’第二實施例之方法與第一實施例之方法的差異是該 實施例預先估測目前圖像之活動程度Act —C後,再根據該 活動程度Act —C進行估測量化比例因子estQ — C之計算。估 測量化比例因子E s t Q - C之計算如下式: 子EstQ一C時,除了考慮位元預算值、平均量化比例因子 Avg_Q外’還同時考慮活動程度Ac1;。亦即,當位元預算值 與平均量化比例因子Avg一Q均相等的狀況下,若目前圖像 活動程度,則所計算出來的 對的提高,使目前圖像編碼 值太多。相反的,若目前圖EstQ—C = (BB—X / BB—C) * Avg—Q * (Act—C / Act—X) ··· (? The difference between formula (7) and formula (4) is that formula (7) is calculating The degree of activity of the estimated measurement scale factor is higher than the estimated measurement scale factor EstQ-C of the previous image. The bit rate after the meeting will not exceed the bit budget 200425745 V. Description of the invention (12) Used to calculate the figure The complexity of the image Com. When the coding exhauster cannot analyze the current image in advance, the encoder can only decide whether to change the quantization matrix and how to change it based on the previous decoded image. But when the This decision may be wrong when the image content changes rapidly. For example, when the average quantization scale factor Avg-Q of the current image is only slightly lower than the scale factor threshold ThQ-X, the current picture will not enter Emergency mode. However, if the encoding complexity of the current image is much larger than the complexity of the previous image, the bit rate of the current image after encoding will far exceed the bit budget value, resulting in insufficient VBV data. On the contrary , If the complexity of the previous image is quite high, but the complexity of the current image is quite low Then the over-enlarged quantization matrix will cause the image quality to be greatly attenuated. Therefore, the difference between the method of the second embodiment and the method of the first embodiment is that this embodiment estimates the current degree of activity of the current image, Act-C, and then The calculation of the estimated scale factor estQ-C is performed according to the activity level Act —C. The calculated scale factor E st Q-C is calculated as follows: When the sub-EstQ-C is considered, in addition to the bit budget value and the average quantized scale The factor Avg_Q 'also considers the degree of activity Ac1; that is, when the bit budget value is equal to the average quantization scale factor Avg-Q, if the current degree of image activity, the calculated pair increases, Make the current image encoding value too much. Conversely, if the current image

像的活動程度低於前一張圖像之活動程度,則所計算出來The activity level of the image is lower than the activity level of the previous image, it is calculated

第17頁 200425745 五、發明說明(13) 的估測量化比例因子Es tQ-C會相對的降低’使目前圖像編 碼後之位元率不會低餘位元預算值太多。 當計算出估測量化比例因子Es tQ-C後,第二實施例與 第一實施例相同,均利用估測量化比例因子EstQ一C來判斷 是否進入緊急模式。當估測量化比例因子EstQ-C大於比例 因子門檻值ThQ一X時,則進入緊急模式,否則以一般模式 處理。 當進入緊急模式後,編碼器將量化矩陣放大成為新的 量化矩陣。在緊急模式中,編碼器會希望將目前圖像之最 後平均量化比例因子降低到一個安全值SQ_X,而該安全值 · SQ一X可能會小於或等於比例因子門檻值ThQ_X。因此,本 發明係將利用一調整因子(adjustment factor)S來放大預 設之量化矩陣,且初值初始虛擬緩衝器佔有量會被減少成 dO_X/S。該調整因子S為一個大於1的數值,且可由式(5) 計算出來。而新的量化矩陣W’ [v][u]可由式(6)計算出 來。由於量化矩陣的最大值為255,因此w,[v] [u]之内容 的最大值被限制為2 5 5。後續之動作與第一實施例相同, 不再重複說明。 以上雖以實施例說明本發明,但並不因此限定本發明 _ 之範圍,只要不脫離本發明之要旨,該行業者可進行各種 變形或變更。Page 17 200425745 V. Description of the invention (13) The estimated scale factor Es tQ-C will be relatively lowered 'so that the current bit rate after image coding will not be lower than the remaining bit budget value. After the estimated measurement scale factor Est tQ-C is calculated, the second embodiment is the same as the first embodiment, and both use the estimated measurement scale factor EstQ-C to determine whether to enter the emergency mode. When the measured scale factor EstQ-C is greater than the scale factor threshold ThQ-X, it enters the emergency mode, otherwise it is processed in the general mode. When entering the emergency mode, the encoder enlarges the quantization matrix into a new quantization matrix. In the emergency mode, the encoder will hope to reduce the last average quantization scale factor of the current image to a safe value SQ_X, and the safety value SQ-X may be less than or equal to the scale factor threshold ThQ_X. Therefore, the present invention will use an adjustment factor S to enlarge the preset quantization matrix, and the initial virtual buffer occupancy will be reduced to dO_X / S. The adjustment factor S is a value greater than 1, and can be calculated by equation (5). The new quantization matrix W '[v] [u] can be calculated from equation (6). Since the maximum value of the quantization matrix is 255, the maximum value of the content of w, [v] [u] is limited to 2 5 5. The subsequent operations are the same as those of the first embodiment, and will not be described repeatedly. Although the present invention has been described by way of examples, the scope of the present invention is not limited thereby, as long as it does not deviate from the gist of the present invention, those skilled in the art can make various modifications or changes.

第18頁Page 18

469 200425745469 200425745

顯示在MPEG-2規格中對内 部區塊所定義的預設量化 圖 矩陣。 圖2顯示VBV緩衝器在CBR操作 圖3顯不VBV緩衝器在VBR操作 圖4顯示本發明避免資料量不 第一實施例的流程圖。 圖5顯示本發明避免資料量不 二實施例的流裎圖。 模式之示意圖。 模式之示意圖。 足的量化矩陣調整方法 足的量化矩陣調整方法第A matrix of preset quantization maps defined in the MPEG-2 specification for internal blocks is displayed. Fig. 2 shows the operation of the VBV buffer in CBR. Fig. 3 shows the operation of the VBV buffer in VBR. Fig. 4 shows a flowchart of the first embodiment of the present invention to avoid data volume. Fig. 5 shows a flow chart of a second embodiment of the present invention for avoiding the amount of data. Schematic diagram of the mode. Schematic diagram of the mode. Full quantization matrix adjustment method Full quantization matrix adjustment method

Claims (1)

200425745 六、申請專利範圍 1. 一種避免資料量不足的 / 、〆 編碼器對一連串圖像進行 車凋整方法,係以 矩陣,該調整方法包含下列:,該編螞器具有預設之量化 3卜列步驟: 更新已使用位元量以另 對目前圖像指定量化比例因子; 叶算估測量化比例因子, 刖述平均量化比例因子、以二x 別述已使用位元量、 化比例因子; 則述位元預算值計算估測量 判斷是否進入緊急模式,♦二 於-量化比例因子門檻值時::述估測量化比例因子大 式,否則保持為-般模^則將編碼模式設定為緊急模 凋整量化矩陣,當編碼模* 設之量化矩陣放大;以及、”、、,、〜、模式時,將前述預 進行圖像編碼,當編碼模 化矩陣進行圖像編石馬,、當編碼;ΪΓ',根據放大 則根據預設之量化矩陣進行圖像編2梃式為一般楔式時, 2·如申請專利範圍第1項所、”、、° 量化矩陣調整方法,其中前述計算載估之避旦免資料 驟中’前述估測量化比例因子=(二_b,例因子的步 值)*平均量化比例因子。 兀量/位元預算 3. 如申請專利範圍第2項 量化拓卩鱼,軟士 4 ^ ^ H ^ 5己載之避免資料|尤σ 以一ΐί Γ 前述調整量化矩陣的二的 以一调整因子來放大預設之量化矩陣 少騍中,係 4. 如申請專利範圍第3項所記載之避 里不足的 第20頁 200425745 六、申請專利範圍 量化矩陣調整方法,其中前述調整量化矩陣的步驟中,前 述調整因子為前述估测量化比例因子與一安全量化比例因 子的比值。 5 ·如申請專利範圍第4項所記載之避免資料量不足的 量化矩陣調整方法,其中前述安全量化比例因子為2 8。 6 ·如申請專利範圍第4項所記載之避免資料量不足的 量化矩陣調整方法,其中該編碼器包含複數個預設調整因 子,以及複數個對應之放大量化矩陣,當進入緊急模式 時,選擇預設調整因子中最接近前述調整因子之一組對應 的放大里化矩陣作為放大後之量化矩陣。 7· —種避免資料量不足的量化矩陣調整方法,係以一 編碼器對一連串圖像進行編碼,該編碼器具有預設之量化 矩陣’該調整方法包含下列步驟: 更新已使用位元量、已編碼圖像之活動程度Act — X、 以及平均量化比例因子; 對目前圖像指定位元預算值; 計算目前圖像之活動程度A c t c ; 前 及 於 式 計算估測量化比例因子,係根據前述已使用位元量200425745 6. Scope of patent application 1. A method for avoiding insufficient data volume by using a 〆 / 〆 encoder to carry out a series of image correction on a series of images, using a matrix. The adjustment method includes the following: The editor has a preset quantization 3 Steps to list: Update the used bit quantity to specify a quantization scale factor for the current image; Leaf calculation estimates the measured scale factor, describe the average quantization scale factor, use x to specify the used bit quantity, and the scale factor ; Then the bit budget value is calculated to estimate whether to enter the emergency mode. ♦ When the threshold value of the quantization scale factor is: The measurement scale factor is estimated, otherwise it is set to the normal mode, and the coding mode is set to The emergency mode withdraws the quantization matrix. When the quantization matrix set by the encoding mode * is enlarged; and, ",,,, ~, mode, the aforementioned pre-encoded image is encoded, and when the encoding mode matrix is used for image editing, When encoding; ΪΓ ', according to the enlargement, the image is compiled according to the preset quantization matrix. 2 When the formula is a general wedge, 2 · As in the first patent application, A matrix adjustment method, wherein the aforementioned calculation includes the avoidance data in the estimation step. The aforementioned estimation measures the scaling factor = (two_b, the step value of the factor) * the average quantization scaling factor. Volume / bit budget 3. If the second scope of the patent application is for the quantification extension tuna, the soft man 4 ^ ^ H ^ 5 contains the avoided data | especially σ to ΐ ΐ Γ to adjust the two to one adjustment of the quantization matrix The factor is used to enlarge the preset quantization matrix, which is 4. As described in section 3 of the scope of patent application for avoiding shortages, page 20, 200425745 6. Method for adjusting the scope of quantization matrix of patent application, in which the aforementioned steps of adjusting the quantization matrix Here, the aforementioned adjustment factor is a ratio of the aforementioned estimated measurable scale factor to a safe quantified scale factor. 5 · The quantization matrix adjustment method for avoiding insufficient data as described in item 4 of the scope of patent application, wherein the aforementioned security quantization scale factor is 2 8. 6 · The quantization matrix adjustment method for avoiding insufficient data as described in item 4 of the scope of patent application, wherein the encoder includes a plurality of preset adjustment factors and a plurality of corresponding enlarged quantization matrices. When entering the emergency mode, select The magnification and reduction matrix corresponding to the group of the preset adjustment factors closest to one of the aforementioned adjustment factors is used as the quantization matrix after the magnification. 7. · A method for adjusting the quantization matrix to avoid insufficient data, which uses a coder to encode a series of images. The coder has a preset quantization matrix. The adjustment method includes the following steps: updating the used bit amount, The degree of activity of the coded image Act — X, and the average quantization scale factor; Specify a bit budget value for the current image; Calculate the degree of activity of the current image A ctc; Previously used bit amount 土平均量化比例因子、前述活動程度Act c、 別述位元預算值計算估測量化比例因子;一 一 判斷是否進入緊急模式,去舒、+、#、ηϊ s ^ 曰 、叭 田刖述估測量化比例因子 —ϊ化比例因子門檻值時,目丨丨μ ^ ,不日丨π」 f則將編碼模式設定為緊急 ,否則保持為一般模式; 調整量化矩陣,當編碼模式A 1A為緊急模式時,將前述Soil average quantified scale factor, the aforementioned activity level Act c, other-specified bit budget value calculation and measurement scale factor; judge one by one whether to enter the emergency mode, go to Shu, +, #, ηϊ s ^, and pit field to measure measurement scale Scale factor—When the threshold value of the scale factor is reduced, set the coding mode to emergency, otherwise, keep the normal mode; adjust the quantization matrix when the coding mode A 1A is the emergency mode , The aforementioned 200425745 六、申請專利範圍 設之量化矩陣放大;以及 進行圖像編碼,當編碼模 後之量化矩陣進行圖像編碼,時,根據放大 則根據狀之量化矩陣進行圖;編碼。、式為-般模式時, 8·如申請專利範圍第7項所記 量化矩陣調整方法,其中前述計算載 免貝料量不足的 驟中,前述估測量化比例因子= 用化比例因子的步 值)*(活動程度Act C/活動_ ^ 兀量/位元預算 子。 —/舌動耘度Act-X)*平均量化比例因 9·如申請專利範圍第8項所記載之避 量化矩陣調整方法,其中前述 貝枓里不足的 以一调整因子來放大預設之量化矩陣。 糸 θ 乂專利範圍第9項所記載之避免資料量不足的 二化:陣調整方法,其中前述調整量 g 子為前述估測量化比例因子與一安全量=例= 子的比值。 1 1.如申請專利範圍篦1 n is & — 1 軍巳固弟1 U項所圮載之避免資料量不足 的量化矩陣調整方法,#中前述安全量化比例因子為28。200425745 VI. The scope of the patent application is set to enlarge the quantization matrix; and image coding is performed. When the quantization matrix after the encoding mode is used to encode the image, according to the enlargement, the map is based on the quantization matrix; encoding. When the formula is in the normal mode, 8. The method of adjusting the quantization matrix as described in item 7 of the scope of the patent application, wherein in the step of calculating the lack of loading and exempting the amount of shellfish, the foregoing estimation and measurement scale factor = the step of using the scale factor Value) * (Activity level Act C / Activity _ ^ Volume / bit budget.-/ Tongue activity ACT-X) * Average quantization ratio due to 9 · Avoid quantization matrix as described in item 8 of the scope of patent application The adjusting method, wherein the aforementioned insufficient Berry is enlarged by a preset quantization matrix with an adjusting factor.糸 θ 乂 The two methods described in the patent scope No. 9 to avoid the lack of data: matrix adjustment method, where the aforementioned adjustment amount g is the ratio of the aforementioned estimated measurement scale factor and a safe amount = example = sub. 1 1. As described in the scope of the patent application, 1 n is & — 1 The quantization matrix adjustment method contained in item 1 U of the military army to avoid insufficient data, the aforementioned security quantization scale factor in # is 28. 曰12·如申請專利範圍第10項所記載之避免資料量不足 的量化矩陣調整方法,#中該編碼器包含複數個預設調整 因子,以及複數個對應之放大量化矩陣,冑進人緊急模式 時,選擇預設調整因子中最接近前述調整因子之一組對應 的放大量化矩陣作為放大後之量化矩陣。 1 3·如申請專利範圍第7項所記載之避免資料量不足的Day 12: As described in Item 10 of the scope of patent application, a method for adjusting the quantization matrix to avoid insufficient data volume, the encoder in # includes a plurality of preset adjustment factors and a plurality of corresponding enlarged quantization matrices to enter the emergency mode. In this case, an enlarged quantization matrix corresponding to a group of the preset adjustment factors closest to one of the foregoing adjustment factors is selected as the enlarged quantization matrix. 1 3 · As described in item 7 of the scope of patent application to avoid insufficient data 473 200425745 六、申請專利範圍 量化矩陣調整方法,其中前述計算目前圖像之活動程度 Act_C的步驟中,對於I圖像而言,係取得每個内部編碼之 巨集區塊的相異,對於P與B圖像而言,係根據内部編碼與 互相關聯編碼模式之相異來進行模式判斷,其相異的總和 係為目前圖像之活動程度Act_C。473 200425745 VI. Method for adjusting patented quantization matrix, wherein in the aforementioned step of calculating the current degree of activity Act_C of the image, for the I image, the difference between each internally encoded macro block is obtained, and for the P As for the B picture, the mode judgment is performed according to the difference between the internal coding and the interrelated coding modes. The sum of the differences is the current degree of activity Act_C. 第23頁Page 23
TW92112858A 2003-05-12 2003-05-12 Quantization matrix adjusting method for avoiding underflow of data TWI221743B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW92112858A TWI221743B (en) 2003-05-12 2003-05-12 Quantization matrix adjusting method for avoiding underflow of data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW92112858A TWI221743B (en) 2003-05-12 2003-05-12 Quantization matrix adjusting method for avoiding underflow of data

Publications (2)

Publication Number Publication Date
TWI221743B TWI221743B (en) 2004-10-01
TW200425745A true TW200425745A (en) 2004-11-16

Family

ID=34389022

Family Applications (1)

Application Number Title Priority Date Filing Date
TW92112858A TWI221743B (en) 2003-05-12 2003-05-12 Quantization matrix adjusting method for avoiding underflow of data

Country Status (1)

Country Link
TW (1) TWI221743B (en)

Also Published As

Publication number Publication date
TWI221743B (en) 2004-10-01

Similar Documents

Publication Publication Date Title
KR100953152B1 (en) Method and Apparatus for selecting macroblock quantization parameters in a video encoder
US8194735B2 (en) Video encoding apparatus and video encoding method
CN1726709B (en) Method and device for encoding image of uncompressed digital video frequency sequence
KR100484148B1 (en) Advanced method for rate control and apparatus thereof
RU2527740C2 (en) Video encoding control method, video encoding device and video encoding programme
US7388995B2 (en) Quantization matrix adjusting method for avoiding underflow of data
TW200948091A (en) Fast macroblock delta QP decision
WO2011080925A1 (en) Image coding device and method
US10085030B2 (en) Method and apparatus for SSIM-based bit allocation
US20070116124A1 (en) Regulation of decode-side processing based on perceptual masking
CN102271257A (en) Image processing device, method, and program
JP2003018603A (en) Method and device for encoding moving image
JPWO2008111454A1 (en) Quantization control method and apparatus, program thereof, and recording medium recording program
US20050232354A1 (en) Rate controlling method and apparatus for use in a transcoder
US7965768B2 (en) Video signal encoding apparatus and computer readable medium with quantization control
US6654416B1 (en) Device and process for regulating bit rate in system for the statistical multiplexing of image streams coded according to MPEG2 coding
US8780977B2 (en) Transcoder
US8218646B2 (en) Moving image encoding apparatus, moving image encoding method, and program
KR100950275B1 (en) System and Methods for rate control based model parameter, Storage medium storing the same
TW200425745A (en) Quantization matrix adjusting method for avoiding underflow of data
JP2004320707A (en) Apparatus for simultaneously encoding multiple video information
US7391916B2 (en) Quantization matrix adjusting method for quality improvement
KR101168007B1 (en) A Method for Adaptive Rate Control in Unit-level for Real-time H.264/AVC
CN109547780A (en) Image encoding method and device
TWI221742B (en) Quantization matrix adjusting method for quality improvement