1221741 五、發明說明(2) 聯合技術委員會,致力於發展視、音訊的壓縮及多路傳殊 的表現方式,這些標準規定了壓縮位元流的語法(syntax) 以及解碼的方法,但對於編碼器所使用的演算法而言,卻 為編碼的新穎性與多樣性保留了相當多的自由度。 根據MPEG,一連串的視訊晝面(picture)分成一序列 的畫面群組(group of picture,GOP),其中每組GOP以I-晝面開始,後面跟著P -晝面和B -晝面的安排,第1圖以顯 示的順序說明一組典型的G0P。I -晝面之編碼毋須參考先 刖或將來的晝面,P -畫面則參考連串的視訊晝面中在時間 上最接近的I -晝面或P-畫面來進行編碼,而B—晝面散佈於 I -晝面和P-畫面之間。並且利用先前的、將來的或兩者兼 具的緊鄰I -晝面和P-晝面來編碼。雖然好幾張B_晝面可以 緊接著連續出現,但絕不能以B-畫面預估其他的晝面。 母張畫面具有三種成分:亮度值(luminance,以γ表 示)’紅色差值(red color difference,以Cr表示),以 及藍色差值(blue color difference,以Cb表示)。對於 Μ P E G的4 : 2 : 0的格式而言,每一種c r和c b成分的取樣點在 水平與垂直方向只有γ成分的一半。如第2圖所示,一張 MPEG的畫面其基本構成方塊係大區塊(macr〇bl〇ck,以㈣ 表示)°以4 ·· 2 ·· 〇的視訊為例,每個MB包含一個γ成分16χ16 取樣點的陣列’以及兩個C r和C b成分8 X 8取樣點的區塊, 其中Y成分16x16取樣點的陣列實際上由4個8x8取樣點的區 塊所組成。 編碼器的作用在於決定何種晝面編碼型態以及何種預1221741 V. Description of the invention (2) Joint technical committee is devoted to the development of video and audio compression and multi-channel transmission. These standards specify the syntax of the compressed bit stream and the decoding method. As far as the algorithm used by the encoder is concerned, it retains a considerable amount of freedom for the novelty and diversity of the encoding. According to MPEG, a series of video diurnal pictures are divided into a series of group of pictures (GOP), where each group of GOPs starts with I-dimension, followed by the arrangement of P-dimension and B-dimension Figure 1 illustrates a typical set of GOPs in the order shown. The encoding of the I-day plane does not need to refer to the previous or future day plane, the P-picture refers to the I-day plane or P-picture that is closest in time to the serial video day plane, and the B-day The planes are interspersed between the I-day plane and the P-picture. It is coded using the immediate, future, or both immediate I-day and P-day. Although several B_ daylights can appear next to each other in succession, the B-picture must not be used to estimate other daylights. The master picture has three components: a brightness value (represented by γ), a red color difference (represented by Cr), and a blue color difference (represented by Cb). For the 4: 2: 0 format of MP PEG, the sampling points for each of the cr and c b components are only half of the γ component in the horizontal and vertical directions. As shown in Figure 2, the basic composition of an MPEG picture is a large block (macr bloc, represented by ㈣). Taking 4 ·· 2 ·· 〇 as an example, each MB contains one An array of 16x16 sampling points of the gamma component 'and two blocks of 8x8 sampling points of the Cr and Cb components, wherein the array of 16x16 sampling points of the Y component is actually composed of four blocks of 8x8 sampling points. The role of the encoder is to determine what type of day-and-day encoding and what kind of prediction
0702-7302TWf(nl);90P97;Lin.ptd 第7頁 1221741 五、發明說明(3) 測模式為最佳。對每張卜晝面,MB中的每個8x8方塊均經 過離散餘弦轉換(discrete cosine transform,DCT)而形 成8x8轉換係數陣列,轉換係數接著以一量化矩陣進行量 化,然後用Z字形(Zig-Zag)掃瞄DCT係數的量化結果而得 到一連串的DCT係數,並且此DCT係數序列以可變長度碼 (^ari able length code,VLC)進行編碼。P-畫面必須決 定將每個MB以I型MB或P型MB進行編碼,I型MB的編碼係二 ,方式為之,而對於每個P_,則需得到;= 則畫面所做之預測,此預測係藉由一種移動向量(mo 先别畫面中的預估ΜΒ之間的變動,預估ΜΒ0702-7302TWf (nl); 90P97; Lin.ptd Page 7 1221741 V. Description of the invention (3) The test mode is the best. For each day of the day, each 8x8 block in MB is subjected to a discrete cosine transform (DCT) to form an array of 8x8 conversion coefficients. The conversion coefficients are then quantized with a quantization matrix and then zigzag (Zig- Zag) scans the quantization results of the DCT coefficients to obtain a series of DCT coefficients, and the DCT coefficient sequence is encoded with a variable length code (Variable Length Code, VLC). The P-picture must decide to encode each MB with I-type MB or P-type MB. The encoding of the I-type MB is the second way, and for each P_, it needs to be obtained; = the prediction made by the picture, This prediction is based on a motion vector (mo
間的預測誤差則以DCT、量化、ζ丰带产 ,、目月j MB 碼。 里化Z子形知瞄以及VLC進行編 處理B-畫面時,必須決定以下 個〇 模式、F模式、B模式以及”模,=來編碼每 身而不借助移動補償來編碼(如!型仙'一 ^式係以MB本 的向前預測編碼,係、以先前畫 ^ ’莫式為單向 型MB-般);反之,B模式二動補仏的預估(如p 來的畫面得到移動補償的預# :特广編碼,係以後 向的預測編碼’運用向前的孩=B模式,其係雙 做内插(inter_tion)而得到的移動補償預估兩者來 ^ B F B „ ^ ^ 0 形掃瞄以及VLC進行編碼。 使用DCT、量化、2字 編碼器需要為整張晝 _ 取里化位階以便在給定的位 0702-7302TWf(nl);90P97;Lin.ptd 第8頁 1221741 五、發明說明(4) 元率下控制可 量化位階編碼 中並不存在一 階下,決定一 見的失 張畫 器很重要的一 的係很有智慧 元數,使編碼 提高編碼視訊 卻相當複雜, 理。 有鑑於此 單次、即時的 像視訊屡縮的 及裝置。 -個逆轉 '張畫面 點即為 地分配 過的視 的視覺 通常需 真,然 面所用 函數, 所用的 位元率 編碼每 訊於解 品質。 進行好 而直到實 的實際位 能夠在給 實際位元 的控制。 張畫面及 碼器進行 不過,傳 幾次才能 際編碼後,以 凡數才會得知 定希望達到的 數1此,視 位元率控制之 其中每個MB所 解碼時,能儘 統的位元率控 元成視訊編媽 選擇的 ’現實 量化位 訊編碼 主要目 用的位 可能的 制方法 的處 禎:需一種新穎的位元率控制技冑 ::編碼ϋ ’再者,亦期待】: 圖摘層級ar_-level)之位元率控::法- 【發明内容】 根據本發明,每一張查 先前畫面的編碼社果和^ ^ ^ 目標位元的分配,係基於 析的活動*,再;1f即f被編碼的目前畫面其預先分 及先前編碼晝面之實:晝:J預先分析的活動量以 度。由於畫面複雜雜度’㉟夠估計目前畫面之複雜 種預估的目前晝面:含了編碼後的品質資訊,這 以更精確地分配目=度對視訊編碼器是非常有用的,可 畫面間更平均的視;::頜度給每張畫面,而能達到不同 0702-7302TWf(nl);90P97;Lin.ptd 1221741 五、發明說明(5) 本發明係針對一接& ^ 首先為-即將被編碼的像:訊位元率控制之方法, 該目前畫面係在一視訊:!面來汁异其全活動量,其中 於目前晝面之全活動量及^ 一組連續晝面之令;接著基 編碼畫面其活動量對 /組連續晝面中同型態的先前 、,並且以目前晝面預估的2 ^比,估計目前畫面之複雜度 複雜度;目前晝面之目栌稷〃度更新本組連續晝面之瞬間 雜度以及瞬間複雜度而‘ · = f度的分配,係依預估的複 序列中的目前畫面進行編满二於目標位元額度,對視訊 目前晝面之全活動量、目;*在目前畫面編碼之後,根據 晝面之平均量化位階,^之實際消耗位元數和目前 比,就這點而言,目前書:刖畫面其活動量對複雜度之 晝面之全活動量成正比’盥活$量對複雜度之比與目前 以及平均量化位階成反比。 則畫面之貫際消耗位元數 另一方面,本發明還揭 制之裝置,包括一移動估筲抑_ 動態景> 像視訊位元率控 額分派器以及一參數更新^早=叙一複雜度估計器、一配 裡的一組連續畫面中即將被 估算單元接收視訊序列 移動估算的區塊匹配時,計算此的^前畫面,用來在執行 於目前畫面之全活動量以及這組|刖晝面之全活動量。基 編碼畫面其活動量對複雜度之比、,晝面中同型態之先前 來估計目前晝面之複雜度。以目丄複雜度估計器可因此用 額分派器更新本組連續晝面之 =面預估的複雜度,配 複雜度以及瞬間複雜度,分配L複雜度,且根據預估的 ‘位元額度給目前畫面。 第1[|頁 0702-7302TWf(nl);90P97;Lin.ptd 1221741 五、發明說明(6) 參數更新器以目前晝面之全活 、 位元數和目前晝面之平均二、目前晝面之實際消耗 其活動量對複雜度之:?里化位階為基礎’計算目前晝面 【實施方式】 下文ί:本ί:之上述目的、特徵和優點能更明释易懂 :文特舉一較佳實施例’並配合所附圖式,作詳;=如 一開始’預測用的I〜書面条Ρ — 器内解碼,利用計算原始書面解;咖編瑪 (root mean square)誤差,可π本丨切s」乃很 访曰十 Γ以传到解碼晝面其品質的空 觀$度。以均方根誤差作為解 、勺各 ^ ^ 鮮碼畫面之失真度,則解碼書 面的複雜度(complex)-C定義如下· 旦The prediction error is based on DCT, quantization, ζ abundance, and MBJ code. When Lihua Z-shaped sighting and VLC are editing B-pictures, the following 〇 mode, F mode, B mode, and “mode” must be determined to encode each body without using motion compensation to encode (such as! 'Yi ^ formula is based on the forward prediction encoding of the MB version, which is based on the previous drawing ^' Mo formula is a unidirectional MB-like); on the other hand, the prediction of the two-motion complement of the B mode (such as the picture from p) Pre- # for motion compensation: Extra-wide encoding, which is the backward-predictive encoding. 'Using forward-child = B mode, which is a motion compensation estimate obtained by double-interpolation (inter_tion). BFB ^ ^ ^ 0-shaped scanning and VLC encoding. Using DCT, quantization, 2-word encoder requires the entire day_ order to be in order to be at the given bit 0702-7302TWf (nl); 90P97; Lin.ptd Page 81221741 V. Description of the invention (4) There is no first order in the quantifiable level coding under the control of the element rate. The one that determines the loss of the picture at first sight is very intelligent. It makes the coding of the coding video very complicated. In view of this single, real-time video and video shrinking and installation.- Reversing the vision that is assigned to the point of the picture is usually true, but the function used and the bit rate encoding used are always good for the quality of the solution. Do it until the actual actual bit can reach the actual bit. However, after the picture and encoder are transmitted for several times, the number can be determined by ordinary numbers, and the number that is expected to be achieved will be known. When each MB of the bit rate control is decoded, it can be completely controlled. The bit rate control element selected by the video editor's choice of the "real quantization bit coding method is mainly used for the possible bit method": requires a new bit rate control technology :: encoding, 'Moreover, also Expectation]: Bit rate control of ar_-level) :: Method-[Content of the invention] According to the present invention, the coding social fruit and ^ ^ ^ target bit allocation of each previous picture is based on analysis. The activity *, again; 1f is the current picture of f being coded, which is divided into the previous code and the day and time: Day: J is the amount of activity analyzed in advance. Due to the complexity of the picture, it is not enough to estimate the current day and time of the complex picture of the current picture: it contains the encoded quality information, which is more accurate for the purpose of assigning a target. The degree is very useful for video encoders. More average vision; :: Jaw angle is given to each picture, and can reach different 0702-7302TWf (nl); 90P97; Lin.ptd 1221741 V. Description of the invention (5) The present invention is directed to a connection & ^ The first is- The image to be encoded: the bit rate control method, the current picture is in a video:! The difference between the total activity of the face, which is the current activity of the current day and a set of continuous day-to-day orders; then the activity of the base code picture is the same as the previous type of the continuous day and Based on the current day-to-day estimated 2 ^ ratio, the complexity of the current picture is estimated; the current day-to-day view updates the instantaneous complexity and instantaneous complexity of this group of continuous day-to-day and '· = f degree The allocation is based on the current picture in the estimated complex sequence, which is full and equal to the target bit quota, and the current day-to-day activity and video of the video; * After the current picture is encoded, the quantization level is based on the average of the day-and-day. ^ The actual number of bits consumed and the current ratio, in this regard, the current book: the amount of activity in the picture is directly proportional to the total activity of the daytime complexity of the complexity 'the ratio of the amount of $$ to the complexity and the current and The average quantization level is inversely proportional. The number of bits consumed by the frame of the picture. On the other hand, the device disclosed in the present invention includes a motion estimation suppressor _ dynamic scene> video bit rate control amount dispatcher and a parameter update ^ early = Syria The complexity estimator and a set of consecutive pictures in a pair of matching pictures are about to receive the video sequence motion estimation block matching. The previous picture is calculated and used to perform the full amount of activity on the current picture and this group. | 刖 Day face full activity. Based on the ratio of the amount of activity to the complexity of the coded picture, the complexity of the current type of the diurnal surface was estimated previously. The eye-level complexity estimator can therefore use the amount dispatcher to update the complexity of this group of continuous day-to-day estimates, with complexity and instantaneous complexity, assign L complexity, and according to the estimated 'bit quota' Give the current picture. Page 1 [| 0702-7302TWf (nl); 90P97; Lin.ptd 1221741 V. Description of the invention (6) The parameter updater uses the current full-time activity, the number of bits, and the average of the current day-surface. The actual consumption of its activity versus complexity: The calculation of the current day surface is based on the level of refining. [Embodiment] The following: This: The above-mentioned purpose, characteristics and advantages can be more clearly explained and understood: Wen Te cites a preferred embodiment, and cooperates with the drawings. Detailed; = If at the beginning of the 'predictive I ~ written strip P — decoded in the device, the original written solution is calculated; the root mean square error can be π this 丨 cut s "is very popular Passed to the decoding of the daytime view of its quality. Taking the root mean square error as the solution and the distortion of each ^ ^ fresh code picture, the complexity of the decoded book (complex) -C is defined as follows:
Or X d 其中’ r係編碼該畫面所需的位元率,d係解碼的晝面 之失真度理刚上’平均的量化位階(q u a n t i z a ΐ i ο n s ΐ e p s i ze )和失真度之間為一比例關係,故,畫面的複雜度可 定義成:Or X d where 'r is the bit rate required to encode the picture, and d is the distortion level of the decoded diurnal plane just above the average quantization level (quantiza ΐ i ο ns ΐ epsi ze) and the distortion is A proportional relationship, so the complexity of the picture can be defined as:
第11頁 1221741 五、發明說明(7) 其中’ q係該畫面的平均量化位階。在晝面編碼之後 ’將可得知位元率(實際消耗位元數)以及平均量化位階, 而該晝面的複雜度亦因此獲得。 晝面之複雜度端視畫面的本質及其編碼的形式而定。 先前技術利用最近編碼晝面之複雜度來表示目前書面之複 雜度’並且為I -、P-及B-晝面分別保持其複雜度以減輕不 同編碼形式的影響,倘若視訊序列的畫面其内容為平順的 變化,則此方式可達到相當不錯的效果。然而,由於書面 編碼的目標位元配額與其實際消耗位元數之間不相符;, 如果視訊序列的内容大幅變動,上述方式並不適合用來達 成一致的視覺品質。 根據本發明,預先分析目前晝面的活動量(a c t丨v丨^ y) 以及先前編碼畫面的實際複雜度之間的關係,目前書面之 複雜度將能藉此預估。活動量係一種在畫面編碼後其位元 率和品質的量度嘗試,假設一整張晝面的全活動量/正比 於複雜度C,則 !ζ A = kxC^ — xrxq = k*xr x a 2 ^ 其中’ k係比例常數。若k為活動量對複雜度之比 (activity-to-complexity ratio,ACR),則全活動量八還 可以下列式子表示: " A = ACR xrxq 根據本發明’可以從相同型態的先前編碼晝面來預估 。觀念上,先在編碼一張晝面前計算其全活動量A,然後Page 11 1221741 V. Description of the invention (7) where 'q is the average quantization level of the picture. After the day-plane coding, the bit rate (the number of bits actually consumed) and the average quantization level will be known, and the complexity of the day-plane will be obtained as a result. The complexity of the day surface depends on the nature of the picture and the form of its encoding. The prior art used the complexity of the recently coded day-plane to represent the current written complexity 'and maintained its complexity for the I-, P-, and B-day-planes, respectively, to mitigate the effects of different encoding forms, provided that the content of the video sequence picture For smooth changes, this method can achieve quite good results. However, because the target bit quota of the written encoding does not match the actual number of bits consumed; if the content of the video sequence changes significantly, the above method is not suitable for achieving consistent visual quality. According to the present invention, the relationship between the current diurnal activity (a c t 丨 v 丨 ^ y) and the actual complexity of the previously coded picture is analyzed in advance, and the complexity of the current writing can be estimated from this. Activity is a measure of its bit rate and quality after the picture is encoded. Assuming the full activity of a whole day / surface is proportional to complexity C, then ζ A = kxC ^ — xrxq = k * xr xa 2 ^ Where 'k is the proportionality constant. If k is the activity-to-complexity ratio (ACR), then the full activity amount can also be expressed by the following formula: " A = ACR xrxq According to the present invention, the Coding day and time to estimate. Conceptually, calculate the full activity A before coding a day, and then
0702-7302TWf(nl);90P97;Lin.ptd 第12頁 1221741 圖式簡單說明 第1圖係以顯示的順序呈現典型的晝面群組(GOP); 第2圖係MPEG之大區塊; 第3圖係本發明較佳實施例的位元率控制裝置之方塊 示意圖;以及 第4圖係本發明之操作流程圖。 符號說明 3 0 0〜動態影像視訊編碼器; 3 1 0〜移動估算單元; 3 1 2〜訊號線; 3 2 0〜複雜度估計器; 3 3 0〜配額分派器; 340〜參數更新器; 3 5 0〜影像編碼器; P(1)〜晝面; A(1)〜全活動量; 巧〜預估複雜度; A C R( 1〉〜活動量對複雜度之比; EB〜超用位元量; TB(n〜目標位元額度; AQ(i)〜平均量化位階; UB(i)〜實際消耗位元數; CD〜編碼後的資料。0702-7302TWf (nl); 90P97; Lin.ptd Page 12 1221741 Brief description of the diagram Figure 1 shows a typical daytime group (GOP) in the order shown; Figure 2 is a large block of MPEG; FIG. 3 is a block diagram of a bit rate control device according to a preferred embodiment of the present invention; and FIG. 4 is an operation flowchart of the present invention. Symbol description 3 0 0 ~ Motion video encoder; 3 1 0 ~ Motion estimation unit; 3 1 2 ~ Signal line; 3 2 0 ~ Complexity estimator; 3 3 0 ~ Quota dispatcher; 340 ~ Parameter updater; 3 5 0 ~ Image encoder; P (1) ~ Day surface; A (1) ~ Full activity; Smart ~ Estimated complexity; ACR (1> ~ Ratio of activity to complexity; EB ~ Overuse bit Quantities; TB (n ~ target bit quota; AQ (i) ~ average quantization level; UB (i) ~ actual number of bits consumed; CD ~ encoded data.
0702-7302TWf(nl);90P97;Lin.ptd 第22頁0702-7302TWf (nl); 90P97; Lin.ptd Page 22