1314423 九、發明說明: 【發明所屬之技術領域】 本發明係指一種解碼視訊訊號的方法,尤指一種可於解碼視訊 訊號時一宏塊接著一宏塊的解碼及去區塊濾波的方法。 • 【先前技術】 _ 隨著通訊技術及電腦技術的快速演進,影像應用變得越來越多 樣化。大部分的影像應用(包括視訊會議、手機或公眾交換電話 網路的視電話、網路視訊、以及數位電視廣播等)都需要使用 有效率的資料壓縮方法,以將大量的影像資訊轉變成適合傳輸於 較乍頻見的通§fL通道,並使得重建(reconstmcted)後的影像資料 中有令人滿意的影像品質。 為了要對隨時間變化的視訊序列進行壓縮,在時域(temp〇ral • domam)以及在二維空間象限(two dimensional spatial domain)上 的冗餘性(redundancy)都必須盡量減低。在mpEG (M〇ving晝 面Experts Group)標準中,係使用離散餘弦轉換⑽似扯⑽― transform ’ DCT)來降低在二維空間象限上的冗餘性,並使用移 動補償(motion compensation)的方式來降低在時間領域上的冗餘除。 弟1圖顯示了 MPEG 4/AVC壓縮下,複數個相鄰的4X4像素區 塊100、102、104的示意圖。在處理一移動影像時,這些區塊1〇〇、 102、104會被個別處理,以增大壓縮率(compressi〇nrati〇)以及 1314423 編碼效率(coding efflcienCy)。然而,由於離散餘弦轉換及量化的 影響,這種「個別的」處理方式,會導致區塊間的區塊邊界(bl〇ck boundary)變的較為明顯,而出現可察覺的「區塊效應」(bl〇cking artifacts)。在水平區塊邊界1〇6以及垂直區塊邊界1〇8皆會產生出 方塊式型樣(square patterns,亦即區塊效應),而容易被人眼所察 覺出來。 ^ 在傳統以區塊決鼻為基礎的(bi〇ck_base(j)視訊塵縮標準之中, 區塊效應是-種最容易被察覺出來的人為影像缺陷(artifact)。因 此,科技界陸續發展出幾種可以在編碼系、统(對個別區塊分別進 行處理)中降低區塊效應的方法。在H 264/MpEG 4 AVC視訊編 碼標準之中’内建有一種複雜的迴路内〇n-l〇〇p)去區塊化滤波 器,此一迴路内去區塊化濾波器會沿著4χ4區塊(這是H 264視 訊編解碼器的基本編碼單位)或8χ8區塊的區塊邊界執行一維渡 波。這種迴路内去區塊化方法可以增進主觀與客觀品質。 舉例來說’根據MPEG 4/AVC,H.264標準,在一完整之解碼晝 面的進行-晝面重建流程(晝面⑺nstrueti()np_ss)後,習知技 ^會依次對該畫面的每-宏塊(MaaOblGek)進行—去區塊遽波流 程。也就是說,由於-晝面的某些部分會被用來進行晝面内預測 技術(畫面内預測)’因此該晝面的所有宏塊必須被解碼及重建以 形成完整的畫面後,才會對該晝面的每—區塊進行去區塊遽波流 程以輪出並播放該晝面。因此,在對一晝面進行迴路内去區塊濾 1314423 波前,該畫面必須完整地被重建,這樣階段化的流程對於影像解 螞的程式設計是合理的。然而,當去區塊流程係以硬體實現時, 如以特殊用途積體電路(app〗icati〇n Spec出c integrated咖此) 實現,去區塊流程的運算需要耗費極大的硬體資源(特別是記憶 體的存取)’且由於輸出一晝面所需的時間等於解碼出完整的晝面 與對該晝面進行完整的去區塊運算之時間總合,因此降低了輪出 影像的效率。 因此,由於上述的各點關,衫㈣知技術僅會顧於在較 小晝面大小的去區塊傾波玉作’而不義在含有較多像素或區 塊的較大晝面中(如包含超過_χ刪個取樣的畫面)。然而, 由於MPEG的應用越來越廣泛(例如DVD練位電視),對於 MPEG編碼槪所驗觸錢塊傾波技躺需求也變得 格外地重要。 【發明内容】 因此,本發明之主要目的即在於提供—_來解碼一視訊訊 號之一畫面的方法及其相關裝置。 本發明揭露一種用來解碼—视訊訊號之-晝面的方法,其包 含有建立該畫面之H儲存雜塊中需細來進行一晝面内 預測運算㈣料,似對_魏行—魏塊驗流程。— 1314423 本發明另揭露一種用來解碼—視訊訊號之一畫面的視訊訊號 解石馬益’其包含有一宏塊建立單元用來建立該晝面之一宏塊,一 暫存益用來儲存該宏塊中需被用來進行一晝面内預測運算的資 料’以及一去區塊濾波器用來對該宏塊執行一去區塊濾波流程。 【實施方式】 根據MPEG 4/AVC標準’一視訊訊號序列的每一晝面必須在進 行去區塊濾波流程之前,完整地被重建,其主要原因在於重建晝 面時可能會使用晝面内預測運算,而晝面内預測運算所需的資料 必南疋未進行過去區塊濾波流程的資料。也就是說,晝面内預測 運,根據-晝面中某-宏塊附近未經過去區塊濾、波的像素值,以 計算該宏塊的像素值,此,當解碼—晝面時,—宏塊的某些部 分會被用來解碼另一宏塊。 考第3圖’第3圖所示為本發明—實施姻來解碼一視1 峨半序列之—4面的流程3G之示意圖。流程3〇包含以下步驟: 步驟300:開始。 步驟302:建立該晝面之—宏塊。 =驟綱:儲存該宏塊巾_來進彳 步驟306:對該宏塊執行-去區塊魏流程。异的貝^ 步驟308 :結束。 根據流程30,當解碼一視訊訊 號序列之一晝面時 ’本發明會先 1314423 儲存-魏中被时進行晝面_測運算的_,因此本發明可 直接繼續對該宏塊進行去區塊舰流程的處理,以形成該晝面的 一部分’而非先將此未精純塊濾波流㈣完整像素值暫存下 來換句》舌5兒’當建立該宏塊後,該宏塊的部分資料會被儲存, 以提供後續鄰狀翻酬運,朋日⑽前職行去區塊 濾波流程。因此,錢行核塊触前,該畫_所有宏塊 =需全被解碼及建立完成,—則不需將未進行去區塊舰流程的 龙儲存再則進行去區塊遽波流程時也不需要重新讀取資料, 因而解碼的效率因而增加。 因此,藉由流程30,視訊訊號序列的解碼更有效率,可減少記 匕體的存取,並減少系統所需資源。進一步地,請參考第2圖, 圖所示為本發明一實施例用來解碼一視訊訊號序列之一晝面 的々‘ 20之示意圖。流程2〇包含以下步驟: 步驟200 :開始。 步驟202 :接收對應於該畫面之一位元序列。 步驟204 :判斷該位元序列之一編碼語法。 步驟206 ·根據該編碼語法,由該位元序列建立該畫面之一宏塊。 步爾208:儲存該宏塊中被用來進行一晝面内預測運算之資料。 步驟210 :對該宏塊執行一去區塊濾波流程。 ^驟212 ·判斷該晝面是否建立完成。若是,則進行下一步驟; 若否’則進行步驟206。 步驟2U:輪出該晝面。 1314423 =根據",L^ 20,當解碼一視訊訊號序列之—畫面時,本發明會先 儲存-宏塊中被絲進行畫面内綱縣的倾,本發明可 直,繼續對該宏塊進行核猶波流㈣處理,以形成該晝面的 ^ 73而非先將此未進行去區塊濾波流程的完整像素值暫存下 t換句話說,當由位祕列解碼及建立該宏塊後,該宏塊的部 分貧料會被存至-暫存器中,以提供後續鄰近宏塊内預測運算 用’並同時對該宏塊執行去區塊濾波流程。因此,在進行去區塊 %、波桃程&,該畫㈣所有宏塊不需全被解碼及建立完成,一則 =而將未進行去區塊遽波流程的宏塊儲存,再則進行去區塊遽波 流程時也不需要重新讀取資料,因而解碼的效率因而增加。 相較之下,習知技術必須在執行迴路内去區塊滤波運算前,完 整地解碼整健面,而本發軌(pipdine)縣—宏塊的 解碼及去Hi域波運算,從而減少記憶體的存取。 簡言之4於畫面_翁算會暫停去區馳波流程的進行, 因此本發明鱗畫面簡測縣㈣㈣料至—儲純置, 執行去區塊濾波流程 存器、外接式記憶體等。如此-來,當每—魏建立後,可产即 在實現流程20或流程3〇時,本領域具通常知識者可 接式記憶體中-暫存區塊,用來儲存晝面_測運算所需的資料。 * 1314423 请參考第4圖,第4圖所示為本發明一實施例用來解碼一視% 訊號之-畫面的視訊訊號解碼器4〇之示意圖。視訊訊號解碼器如 包含有-宏塊建立單it 暫存器概及一去區塊濟波哭 4〇4。宏塊建立單元4〇〇用來建立該晝面之一宏塊,暫存器^用 •來儲存該宏塊中需被用來進行-晝面内酬運算的資料’以及去 -區塊遽波器404用來對該宏塊執行-去區塊遽波程。因此,透 過視龜賴碼H 4G,當解碼—魏訊餅狀—晝面時,宏塊 建立單元400會先建立-宏塊,暫存器4〇2會儲存該宏塊中被用 來進行晝面内預測運算的資料,因此去區塊滤波器姻可直接繼 '續對該宏塊進行去區塊遽波流程的處理,以形成該晝面的一部 分’而非先減未進行去區塊敎流程的完整像素值暫存下來。 換句話說’當宏塊建立單元傷建立該宏塊後,該宏塊的部分資 料會被存至暫存器402中’以提供後續鄰近宏塊内預測運算用, 並同時透過去區塊滤波器對該宏塊執行去區塊遽波流程。因 φ 此,在進行去區塊遽波流程前,該晝面的所有宏塊不需全被解碼 及建立完成,一則不需將未進行去區塊濾波流程的宏塊儲存,再 則進行去區塊濾波流程時也不需要重新讀取資料,因而解碼的效 率因而增加。 為了確認暫存器402足夠大,較佳的暫存區塊大小等於: 2 * (PicWidthlnMbs + 1) * (MbYInSam * BitDepY + 2 * MbCblnSam * BitDepC) 其中,PicWidthlnMbs表示該晝面之水平方向的宏塊數,MbYInSam 1314423 表不—宏塊之水平方向的亮度取樣數,MbCblnSam表示該宏塊之 乂平方向的彩度取樣數,BitDepY表示一亮度取樣的位元數,以 及BltDepC表示—做取獅位元數。 • 特別注意的是,上述判斷暫存區塊大小的運算式為一較佳實施 •例’同時考4了處理單位為m是m本領域具通常 知識者當可作出不同之變化,而不跳脫本發明之精神。流程20及 Φ殷私3〇較佳地可實現於一消費性電子產品(如行動電話、視訊會 議系統、數位魏、高畫f數位電視、f麟圖晶>|等)之視訊 解碼器的程式碼十。 口在刪的崎度,4:4:4親格,且每㈣張畫面的播 放扣負下’本發明可以省下約376mb/s的記憶體存取資料量。因 此’藉由暫存-宏塊中被用來進行畫面内預測運算的資料,本發 •日月可減少5己憶體的妹(特別是對於高解析度的視訊訊號序列), 增加解碼效率,並減少系統所需資源。 以上所述僅為本發明之較佳實關,凡依本發明巾請專利範 圍所做之均等變化與修倚,皆應屬本發明之涵蓋範圍。 【圖式簡單說明】 第1圖顯不了 MPEG4/AVC壓縮下,複數個相鄰的4χ4像素區 " 塊的示意圖。 1314423 =圖所示為本發明—實施例用來解碑_觀 面的流裡圖。 旦 第4圖所示為本發明一實施例用轉碼一視訊訊號之— 視訊訊號解碼器之示意圖。 旦面的 像素區塊 水平區塊邊界 垂直區塊邊界 流程 【主要元件符號說明】 100、102、104 106 108 20、30 40 400 402 視訊訊號解碼器 宏塊建立單元 暫存器 404 去區塊濾波器 200、202、204、206、208、210、212、214、300、302、304、306、308 步驟 (?1314423 IX. Description of the Invention: [Technical Field] The present invention relates to a method for decoding a video signal, and more particularly to a method for decoding and deblocking a macroblock followed by a macroblock when decoding a video signal. • [Prior Art] _ With the rapid evolution of communication technology and computer technology, imaging applications are becoming more and more diverse. Most imaging applications (including video conferencing, video telephony on the mobile or public switched telephone network, videoconferencing, and digital TV broadcasting) require efficient data compression to transform large amounts of video information into fits. It is transmitted through the §fL channel, which is more frequently seen, and has satisfactory image quality in the reconstmcted image data. In order to compress video sequences that change over time, the redundancy in the time domain (temp〇ral • domam) and in the two dimensional spatial domain must be minimized. In the mpEG (M〇ving昼 Experts Group) standard, discrete cosine transform (10) is used to reduce the redundancy in the two-dimensional space quadrant and use motion compensation. Ways to reduce redundancy in the time domain. Figure 1 shows a schematic diagram of a plurality of adjacent 4X4 pixel blocks 100, 102, 104 under MPEG 4/AVC compression. When processing a moving image, these blocks 1, 102, 104 are processed individually to increase the compression ratio (compressi〇nrati〇) and 1314423 encoding efficiency (coding efflcienCy). However, due to the influence of discrete cosine transform and quantization, this "individual" processing method will result in a more obvious block boundary (bl〇ck boundary) between blocks, and a perceptible "block effect" will occur. (bl〇cking artifacts). At the horizontal block boundary 1〇6 and the vertical block boundary 1〇8, square patterns, that is, block effects, are generated, which are easily perceived by the human eye. ^ In the traditional block-based (bi〇ck_base(j) video dust reduction standard, the block effect is the most easily perceived human artifact. Therefore, the scientific and technological community has developed. There are several ways to reduce the block effect in the coding system and system (processing separately for individual blocks). In the H 264/MpEG 4 AVC video coding standard, there is a built-in complex loop 〇nl〇 〇p) Deblocking filter, the deblocking filter in this loop will execute along the block boundary of 4χ4 block (this is the basic coding unit of H 264 video codec) or 8χ8 block Weidubo. This method of de-blocking in the loop can improve subjective and objective quality. For example, according to the MPEG 4/AVC, H.264 standard, after a complete decoding process - the face reconstruction process (昼7(ns) nstrueti() np_ss), the conventional technique will sequentially - Macroblock (MaaOblGek) - Deblocking chopping process. That is, since some parts of the - surface will be used for in-plane prediction (intra-picture prediction) 'so all macroblocks of the picture must be decoded and reconstructed to form a complete picture. A deblocking chopping process is performed on each block of the face to rotate and play the face. Therefore, in the in-loop deblocking of the 1314423 wavefront, the picture must be completely reconstructed, so that the staged process is reasonable for the image decoding program. However, when the deblocking process is implemented in hardware, such as a special-purpose integrated circuit (app icati〇n Spec), the operation of the deblocking process requires a lot of hardware resources ( In particular, the memory access) and the time required to output a face is equal to the sum of the time to decode the complete face and the complete deblocking of the face, thus reducing the round-up image. effectiveness. Therefore, due to the above-mentioned various points, the shirt (four) knowing technology only takes care of the de-blocking of the smaller-sized slabs, and does not mean that it is in a large surface containing more pixels or blocks (such as Contains more than _χ to delete a sample of the screen). However, due to the increasing use of MPEG (such as DVD training TV), the demand for MPEG encoding is also particularly important. SUMMARY OF THE INVENTION Accordingly, it is a primary object of the present invention to provide a method for decoding a picture of a video signal and related apparatus. The invention discloses a method for decoding a video signal, which comprises the method of establishing an H-stored block of the picture to perform an in-plane prediction operation (four), which is similar to Wei Wei-Wei Block inspection process. — 1314423 The invention further discloses a video signal for decoding a picture of a video signal, which comprises a macroblock establishing unit for establishing a macroblock of the page, and a temporary storage for storing the The data in the macroblock that needs to be used for an in-plane prediction operation and a deblocking filter are used to perform a deblocking filtering process on the macroblock. [Embodiment] According to the MPEG 4/AVC standard, each facet of a video signal sequence must be completely reconstructed before the deblocking filtering process. The main reason is that the in-plane prediction may be used when reconstructing the facet. The data required for the operation of the in-plane prediction operation must not be used for the past block filtering process. That is to say, in the face-to-face prediction operation, the pixel value of the macro block is calculated according to the pixel value of the wave in the vicinity of a certain macroblock in the vicinity of the macroblock, and when decoding the facet, - Some parts of the macroblock are used to decode another macroblock. Fig. 3 is a diagram showing a flow 3G of the present invention for implementing the -4 side of the half-sequence of the present invention. The process 3〇 includes the following steps: Step 300: Start. Step 302: Establish the macroblock of the facet. = Schematic: Store the macroblock _ to proceed 彳 Step 306: Perform a -deblock Wei process on the macroblock. Different shells ^ Step 308: End. According to the process 30, when one of the video signal sequences is decoded, the present invention will first store 1314423 - the time when the Weizhong is performed, so the present invention can directly continue to deblock the macroblock. The processing of the ship's process to form part of the facet' instead of first storing the unpure block filter stream (4) the full pixel value is temporarily stored for the sentence "5" when the macroblock is created, the part of the macroblock The data will be stored to provide follow-up neighbors, and the postal (10) predecessor will go to the block filtering process. Therefore, the money bank is in front of the block, the picture _ all macro blocks = need to be fully decoded and established, - then do not need to carry out the deblocking ship process of the dragon storage and then go to the block chopping process There is no need to re-read the data, so the efficiency of decoding is thus increased. Therefore, by the process 30, the decoding of the video signal sequence is more efficient, which reduces the access of the logger and reduces the resources required by the system. Further, please refer to FIG. 2, which is a schematic diagram of a frame 々20 for decoding one of the video signal sequences according to an embodiment of the present invention. The process 2〇 includes the following steps: Step 200: Start. Step 202: Receive a sequence of bits corresponding to the picture. Step 204: Determine one of the bit sequence encoding syntax. Step 206: According to the coding syntax, one macroblock of the picture is established by the bit sequence. Step 208: Store the data in the macroblock that is used to perform an in-plane prediction operation. Step 210: Perform a deblocking filtering process on the macroblock. ^Step 212 · Determine whether the face is established or not. If yes, proceed to the next step; if no, proceed to step 206. Step 2U: Turn the face out. 1314423=According to ", L^20, when decoding a picture of a video signal sequence, the present invention first stores - the macroblock is tilted by the wire in the picture, and the present invention can directly continue the macro block. Performing nuclear heave flow (4) processing to form the surface of the surface instead of first storing the complete pixel value of the undeblocking filtering process, in other words, when the macro is decoded and the macro is created After the block, a portion of the poor block of the macroblock is stored in the - scratchpad to provide a subsequent prediction operation for the adjacent macroblocks and a deblocking filtering process is performed on the macroblock at the same time. Therefore, in the deblocking %, wave peach process &, the picture (four) all macroblocks do not need to be fully decoded and established, one = the macro block without the deblocking chopping process is stored, and then There is also no need to re-read the data when going to the block chopping process, so the efficiency of decoding is increased. In contrast, the prior art must completely decode the whole face before performing the deblocking operation in the loop, and the pipdine county-macroblock decoding and de-Hi domain operation reduces the memory. Body access. In short, in the picture _ Weng will suspend the process of the deciphering process, so the scale picture of the invention is simple (4) (4), to the pure memory, to perform the deblocking filter process, external memory and so on. In this way, when each Wei is established, it can be produced in the process of implementing Process 20 or Process 3, and the person in the field can access the memory in the field - the temporary storage block is used to store the memory. Required information. * 1314423 Please refer to FIG. 4, which is a schematic diagram of a video signal decoder 4 for decoding a picture of a view % signal according to an embodiment of the present invention. The video signal decoder includes a macro block to create a single it register and a deblock block. The macroblock establishing unit 4 is used to create a macroblock of the page, and the register is used to store the data of the macroblock that needs to be used for the internal operation and the de-block. Waveform 404 is used to perform a -deblock hopping process on the macroblock. Therefore, by using the turtle code H 4G, when decoding - Wei Xun cake - face, the macro block building unit 400 will first establish a macro block, and the register 4 〇 2 will store the macro block used for the purpose. The data of the intra-plane prediction operation, so the deblocking filter can directly follow the processing of the deblocking chopping process of the macroblock to form part of the facet instead of first de-deleting The full pixel value of the block 敎 process is temporarily saved. In other words, 'when the macroblock is created, the macroblock is created, and part of the data of the macroblock is stored in the buffer 402' to provide subsequent intra-macroblock prediction operations, and at the same time through deblocking filtering. The device performs a deblocking chopping process on the macroblock. Because of φ, before performing the deblocking chopping process, all the macroblocks of the facet need not be fully decoded and established, and one does not need to store the macroblocks that have not been subjected to the deblocking filtering process, and then go to The block filtering process also does not require re-reading of the data, so the efficiency of decoding is increased. In order to confirm that the register 402 is large enough, the preferred temporary block size is equal to: 2 * (PicWidthlnMbs + 1) * (MbYInSam * BitDepY + 2 * MbCblnSam * BitDepC) where PicWidthlnMbs represents the macro of the horizontal direction of the facet The number of blocks, MbYInSam 1314423, the number of luma samples in the horizontal direction of the macroblock, MbCblnSam indicates the number of chroma samples in the horizontal direction of the macroblock, BitDepY indicates the number of bits in a luma sample, and BltDepC indicates that the lion is taken The number of bits. • It is particularly important to note that the above formula for judging the size of the temporary block is a preferred implementation. • At the same time, the processing unit is m. m. The general knowledge in the field can be changed differently without jumping. The spirit of the invention is removed. The process 20 and the Φ 殷 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 The code is ten. The mouth is deleted, the 4:4:4 parent, and the broadcast of each (four) picture is deducted. The invention can save about 376 mb/s of memory access data. Therefore, by using the data stored in the temporary block-macroblock for intra-picture prediction operations, the present day/month can reduce the number of five-remembered girls (especially for high-resolution video signal sequences), increasing decoding efficiency. And reduce the resources required by the system. The above description is only a preferred embodiment of the present invention, and all variations and modifications made by the invention in accordance with the invention are intended to be within the scope of the present invention. [Simple description of the diagram] Figure 1 shows a schematic diagram of a plurality of adjacent 4χ4 pixel regions " blocks under MPEG4/AVC compression. 1314423 = The figure shows a flow chart for solving the monument_view of the present invention. 4 is a schematic diagram of a video signal decoder for transcoding a video signal according to an embodiment of the present invention. Pixel block horizontal block boundary vertical block boundary flow [main component symbol description] 100, 102, 104 106 108 20, 30 40 400 402 video signal decoder macroblock establishment unit register 404 deblocking filter 200, 202, 204, 206, 208, 210, 212, 214, 300, 302, 304, 306, 308 steps (?