201103338 六、發明說明: 【發明所屬之技術領域】 本發明係有關於視訊處理,特別是有關於視訊資料編 碼0 【先前技術】 視訊資料包括一系列的畫面(frame),每一晝面都是一 張圖片且被分割為多個區塊(block)以供各自分別進行編碼 處理。一視訊區塊可由内部預測模式(intra_m〇de)或外部預 測模式(inter-mode)進行編碼。於内部預測模式下,一視訊 區塊的畫素被與鄰近區塊之晝素相比較,以減少用以編碼 視訊區塊的 比較,以減 之資料量。於外部預測模式下,目前晝面之— 晝素被與一參考畫面之對應位置區塊之晝素相 少用以編碼之資料量。 第以圖為依據内部預測模式進行視訊編碼 碼益100的區塊圖。視訊編碼器1〇〇包括内部 : 102、減除模組!〇4、轉換模組1〇6、以及量化哭、、且 訊區塊首級送至内部預測· 1()2。硯 對視訊區塊進行内部預測,以便依據該視訊區塊=奶 素產生一預測區塊。内部預測模址皿依據多種内晝 模式中的其卜種模式以對視_塊進㈣n剛 圖顯示符合則G洲規格的九種内部預測桓式,、:。第2 -種内部預測模式依據不同的鄰近畫素產生^每 測晝素值。減除模組綱接著將預測區塊之㈣=之預 視訊區塊之原始晝素值減除,以得到該視訊區= 0758D-A34294TWF_MBJI-〇9-〇〇l 4 201103338 餘值。轉換模組1〇6接著進行視訊資料壓縮以將視訊區塊 之預測殘餘值轉換為資料量較少之轉換值。舉例來說,轉 換模組106可能對預測殘餘值進行離散餘弦轉換(discrete cosine transf0rm,DCT)或 Karhunen_L〇eve 轉換(KLT)以得 到轉換值。量化器108最後將轉換質量化為資料量更少而 適於資料儲存或傳輸之量化值。201103338 VI. Description of the Invention: [Technical Field] The present invention relates to video processing, and more particularly to video data encoding. [Prior Art] Video data includes a series of frames, each of which is One picture is divided into a plurality of blocks for respective encoding processing. A video block can be encoded by an intra prediction mode (intra_m〇de) or an external prediction mode (inter-mode). In the intra prediction mode, the pixels of a video block are compared with the pixels of the neighboring blocks to reduce the comparison used to encode the video blocks to reduce the amount of data. In the external prediction mode, the current pixel is less than the data of the corresponding location block of a reference picture for encoding the amount of data. The figure is a block diagram of the video coding code 100 according to the internal prediction mode. Video encoder 1〇〇 includes internal: 102, subtraction module! 〇4, the conversion module 1〇6, and the quantization cry, and the first block of the block is sent to the internal prediction·1()2.进行 Internal prediction of the video block to generate a prediction block based on the video block = milk. The internal prediction model dish is based on the mode of the various intrinsic modes, and the nine internal prediction formulas of the G-country specification are displayed in the corresponding view. The second internal prediction mode generates a per-norm value based on different neighboring pixels. The subtraction module class then subtracts the original pixel value of the pre-visual block of the (4)= prediction block to obtain the video zone = 0758D-A34294TWF_MBJI-〇9-〇〇l 4 201103338 residual value. The conversion module 1〇6 then performs video data compression to convert the predicted residual value of the video block into a converted value with a small amount of data. For example, the conversion module 106 may perform discrete cosine transf0rm (DCT) or Karhunen_L〇eve conversion (KLT) on the predicted residual values to obtain a converted value. The quantizer 108 finally quantifies the conversion to quantized values that are less informative and suitable for data storage or transmission.
^ 。丨預測模式解碼視訊資料之視訊解 碼器150的區塊圖。於一實施例中,視訊解碼器150包括 =ίΓΓ反内部預測模組154、以及相加模組· 反轉換換組152對視訊資料進行解壓縮以將視訊區塊之旦 化值轉換為預測殘餘值。 里 遍七n如 反内相測核、組154依據内部預 測核式進仃内測以產生_預測區塊。相 、 預測殘餘值與制區塊相加 ^ 56將 器15〇接著輸出重建區塊。生重建&塊。視訊解喝 〜然二:I1”之視訊編碼器1〇0仍舊有缺點。首先, = = = :預測模组102依據鄰近區塊之晝 f產生f祕目W塊的—預測區塊„彳 值因此與鄰近區塊之畫素值相闕聯。铁而:素 近區塊之内部預測模式係各自獨立決;、 鄰 同的内部預測模式而產生,導二 塊通常係依據不 預:區塊的畫素值之間發生不連續。因此,需; r切之方法,可以依據鄰近區塊之内部預測 权式對目則區塊進行内部制。此外, 2 據一組固定的轉換係數進行視訊資料厂堅縮。然而,^. The prediction mode decodes the block diagram of the video decoder 150 of the video material. In one embodiment, the video decoder 150 includes an internal anti-interference module 154 and an add-on module/de-transformation group 152 to decompress the video data to convert the DC value of the video block into a prediction residual. value. In the seventh, such as the anti-internal phase kernel, the group 154 is based on the internal prediction kernel to generate the _ prediction block. The phase, the predicted residual value is added to the block, and then the reconstructed block is output. Reconstruction & block. The video encoder 1I0 of I1” still has disadvantages. First, ===: The prediction module 102 generates the f-block of the W-block based on the 昼f of the neighboring block. The value is thus associated with the pixel values of the neighboring blocks. Iron: The internal prediction modes of the near blocks are independent of each other; and the adjacent internal prediction mode is generated. The second block is usually based on the inconsistency: the discontinuity between the pixel values of the block. Therefore, the r-cut method can be used to internally implement the block according to the internal prediction weight of the neighboring block. In addition, 2 the video data factory is contracted according to a fixed set of conversion coefficients. however,
〇758D-A34294TWF_MBJ]-〇9-〇〇J 一 5 201103338 同内部預測模式產生的預測殘餘值需要不同的轉換係數以 達到最佳的轉換效果。因此,需要一種進行視訊資料壓縮 的方法’可依據視訊資料不同的内部預測模式運用不同的 轉換係數以進行資料壓縮。 【發明内容】 有鑑於此,本發明之目的在於提供一種進行内部預測 (她a-prediction)之方法,以解決習知技術存在之問題。首 =’決定-左方區塊的第一内部預測模式,—上方區塊的 J - =刚模式,以及一目前區塊的第三内部預測模 式,八中該左方區塊位於該目前區塊之左方,而該上方區 2位於該目前區塊之上方。接著,自該目前區塊的多㈣ =選:-目標晝素。接著,依據該第一内部預測模式計算 該目標畫素的一第一預測值,依攄兮笔- # 笞哕目/m—㈣預測模式計 ^目才示晝素的一弟二預測值,糾虞該第 ,標畫素的-第三預測值。最後,平均該;= 均預預測值1及該第三預測值,以得到-加權平 本發明提供-種進行視訊資料歷縮的方法。首 定-目標區塊之一内部預測模式。接著型^ 選取對應於該内部預測模式之一目標轉換型式。 標區塊之多個制_值,並依據該目標轉換 ς 預測殘餘值轉換為多個轉換值。其中 字5亥專 弋夕钫笙絲… /、甲對應於该内部預測模 =該㈣換型式係依據制殘餘值之變異數大小被分 0758D-A34294TWFJV1BJ 丨-09-00] 6 201103338 本發明提供一種補1姑 _、 说讯編碼器(Video enc〇der)。於一實 施例中’該視訊編m哭技d/r a - °°接收—目前區塊,其中一左方區塊 位於該目前區塊之左方, _ — 而—上方區塊位於該目前區塊之 上方。於一貫施例中,钤 ,τ , 碌硯訊編碼器包括一内部預測 (Intra-prediction)模组以洛 , , 及一減除模組。該内部預測模組決 如试、上 ^預蜊模式、該上方區塊的第二内 部預測模式’以及該目前 « Γ- ΛΑ ^ , 月J £塊的第三内部預測模式,自該 目前區塊的多個書素Q , —畜、取一目標晝素,依據該第一内部預 測才旲式δ十鼻該目標書辛的唾 ,斤 一1的一弟—預測值,依據該第二内部 預測杈式計鼻該目標畫+ & 、,& 京的一第二預測值,依據該第三内 部預測模式計算該目標查去 7、思常的一第三預測值,以及平均該 第一預測值、該第二預測枯 別值、以及該第三預測值,以得.到 該目標晝素之一加權平祕:22、 、、 ^ 預測值。該減除模組自該目標畫 素減去該加權平均預測值以得到該目標晝素之—預測殘餘 值0 本發明提供一種韻却始· 货J 編碼器(Video encoder)。於 施例中,該視訊編碼器包括 組、一減除模组 實 一内部預測(Intra-prediction)模 Μ及一轉換模組。該内部預測 (Intra-prediction)模紐斗瞀 、 冲异一目標區塊之多個預測畫素值。 該減除模組自該目標區持, & L塊之多個原始晝素值減去該等預測 畫素值,以得到該目樟蚩丢—& 素之多個預測殘餘值。該轉換模 組決定該目標區塊之—肉 内部預測模式,自多個轉換型式選 取對應於制部預測模式之—目標轉換型式,以及依據該 目標轉換型式將該等預測殘餘值轉換為多個轉換值。其中 對應於該内^預㈣式之該等轉換型式係依據預測殘餘值 0758D-A34294TWF_MBJI-09-00] 201103338 之變異數大小被分類。 為:讓本發明之上逃和其他目的、特徵、和優點能更 明顯易It下文特舉數較佳實施例,並配合所附圖示,作 詳細說明如下: 【實施方式】 第3圖為依據本發明之一實施例的被依内部預測模組 所處理之目前區塊303及兩鄰近區塊3〇1與3〇2。兩鄰近 區塊包括一左方區塊301及一上方區塊3〇2。左方區塊 3(Π、上方區塊302、目前區塊3〇3都是位於一視訊資料的 同一晝面(frame)中。於畫面中,左方區塊3〇1 位於目前區 塊303的左方,而上方區塊3〇2位於目前區塊3〇3的上方。 左方區塊301、上方區塊3〇2、目前區塊3〇3皆包括固定數 目之晝素(Pixel) ’每一晝素具有一晝素值以表示該晝素之 顏色。於一實施例中,目前區塊303包括16 (4x4)個晝素, 位置分別為(〇,〇)〜(3, 3)。 第4圖為依據本發明之一實施例的用以進行内部預測 (intra-prediction)之方法400的流程圖。方法400被稱為重 疊區塊内部預測(overlapped block intra-prediction ; 0BIP)。 假設一内部預測模組接收到第3圖中的目前區塊303以進 行内部預測。一左方區塊301位於目前區塊303的左方, 而一上方區塊302位於目前區塊303的上方。左方區塊 3(Π、上方區塊302、目前區塊303的内部預測模式可能係 各自不同的。内部預測模組因此先決定左方區塊301的第 一内部預測模式,上方區塊302的第二内部預測模式,以 0758D-A34294TWF_MBJI-09-001 201103338 及目前^塊303的第三内部預測模式(步驟402)。 目前區塊303包括吝你I查丰 , 义厂说夕個畫素。内部預測模組接著自目 剛區塊烟的多個晝素中選取一目標畫 =者自目 預測模組首先依據左方區塊301的第n 内^ :=!。:值?_4°6)。内部預測模組接著 楚 £塊逝的第二内部預測模式計算該目標晝素的 -預測值卩2(步驟4〇8)。内部預測模組巴塊 3〇3的第三内部預測模式者:目心塊 nn , 、T#忑目祕畫素的第三預測值 410)。因此’第一預測值ρι、第二預 預測值P3分別對應左方區塊 弟一 方W彻从银 匕尾观的第一内部預測模式、上 塊3〇2的第二内部預測模式、目前區塊303的第-内 部預測模式。 尼的弟二内 第一 ' 第二預測值 &、 ==二雜得到一平均值以作為該目標晝素之内 =3::二、%,供對第—預測值^第二預測 ,、值3進仃加權平均(步驟412)。於一實施 例中’目標加權參數W]、w w 、只 ^ rr W3係依據目刖區塊303之 置:二及該目標畫素位於目前區塊303内之位 儲存-'力捲史叙^%例中’内部預測模組包括一記憶體以 3供紀錄多組加權參數,而内部預測模 二圖二依據本發明之—實施例的加權參數表心 的多組加;、 核參數。加權參數表500中 ,權 > 數係以目前區塊303的内部預測模式以及艮, 〇758D-A34294TWF_MBJI-〇9-〇〇i ' ^ ] 201103338 的前303内之位置作為索引。加權參數表 training)^ φ ^加權參數係由非在線的訓練(°ff]ine 二你序中經由線性避歸(linear %⑽㈣而決定。 若目標晝素之位置為(G,2),而目前區塊3Q3之 霄,掩式為垂直模式〇’則目標加權參數%、%、 :二π,2),W⑽ =(3, 3),而目前區塊303之内部預测模式為水平 力;,rw2、w-決定為w㈣ 後,内邦箱、、3」胃目仏加權參數Wl、W2、W3被決定 對笛—°、測杈組接著依據該目標加權參數W,、w2、w3 平一預測值Pl、第二預測值p2、第三預測值p3進行加權 心:/得到該目標晝素之-内部預測值 執行内邱 W3XP3](步驟414)。内部預測模組接著重複 之二2測值之計算步驟404〜414,直到目前區塊303 二j的内部預測值皆已計#得到(步驟416)。目前區 塊If 内部預測值接著魏集以得到—預測區 :内:預測模組將該預測區塊輸出至一減除模組,該 組將預測區塊之畫素預測值自目前區塊303之書辛 之^箱以得到預測殘餘值,如第1A圖所示。預測區塊 旦素目予^值因此為分別依據左方區塊301、上方區塊 P2、p^=:;之内部預測模式所產生的預測值P1、 ^^^,供平均預測值以义之加權參數 該目=、去3係依據目前區塊303之第三預測模式h以及 目“旦素位於目前區塊303内之位置而決定。然而,加 〇758D-A34294TWF_MBJl-〇9-〇〇I |0 201103338 權參數表5針包含有9種類的預定加權參數分別對應於 内部預測模式〇〜8 ’而對絲其他㈣預_式的此等預 定加權參數可能較對應於目前區塊如之預測模式&的加 榷參數產生帶有較少之影像失真的預測平均值。因此,於 -實施例中’目標加權參數W】、%、%係依據對應於多 個預定加權參數的位元率·失真最佳化(—on optimization)成本而自對應於多個内部預尋式的該等預 定加權參數選出。舉例來說,内部預測缝可於步驟412 產生分別對應9個内部預測模式的9组加權參數,接著於 步驟414依據9組加權參數分別對第—預測值&、第二預 測值P2、第二預測值P3進行加權平均以得到該目_之 9個内部預測值。内步預測魅接著分別收集所有匕之9 種内部預測值以產生9個_區塊,並計算9個區塊之位 兀率-失真最佳化成本’最後選取具有最低的位科-失直 最佳化成本的·區塊作錢出。視訊資料之數個位元;r 用以儲存目標區塊之被選取的内部制模式,以便傳遞至 解碼器時指示解碼器目標區塊係依據何内部預測模式編 瑪0 第4圖之方法400產生包括多個加權平均預測值之預 測區塊。然而’包括多個加權平均預測值之預測區塊可能 較僅僅依據目標區塊之單-内部預測模式所產生的預測區 塊具有較高的位元率-失真最佳化成本。目此,於一實施例 中,内部預測模組具有-機制,卩自動決定是否依據方法 400產生包括多個加權平均預測值之預測區塊。亦即,内 部預測模組可自動的於巨集區塊(macr〇bl〇ck)的層次決 0758D-A34294TWF_MBJI-〇9-0〇1 201103338 是否啟動或關閉重疊區塊内部預測功能400。於一實施例 中,當目前區塊之所有畫素之加權平均預測值均計算完畢 後,内部預測模組收集所有的加權平均預測值以得到一第 一預測區塊,並收集所有依據目標區塊之内部預測模式所 產生的第三預測值P3得到一第二預測區塊。接著,内部預 測模組分別計算第一預測區塊及第二區塊的位元率-失真 最佳化成本。當第一預測區塊的位元率·失真最佳化成本高 於第二預測區塊的位元率-失真最佳化成本,依據目標區塊 之内部預測模式所產生的第二預測區塊將被選取以作為内 部預測模組的輸出。於一實施例中,視訊資料的一位元被 用以紀錄重疊區塊内部預測功能(OBIP)開或關,以通知解 碼器對解碼流程進行對應的調整。 當一減除模組自目前區塊減除預測區塊以得到預測 殘餘值後,預測殘餘值會被送至一轉換模組進行資料壓 縮。第6圖為依據本發明之一實施例對視訊資料進行資料 壓縮的方法600之流程圖。假設視訊編碼器之轉換模組支 援多種轉換型式,其中每一轉換型式對應於預測殘餘值之 一變異數(variance)大小層級。轉換模組首先接收包含欲進 行壓縮之預測殘餘值的一目標區塊,並決定該目標區塊之 内部預測模式(步驟602)。接著,轉換模組自多個轉換型式 中選取對應於目標區塊的内部預測模式之目標轉換型式 (步驟608)。於另一實施例中,轉換模組分別計算對應於多 個轉換型式之多個位元率-失真最佳化成本,並選取對應於 最低的位元率-失真最佳化成本之轉換型式作為目標轉換 型式。 0758D-A34294TWF MBJI-09-001 12 201103338 於部分實施例中,不同的轉換型式係表示以不同組的 轉換係數進行轉換。常用在視訊編碼過程中的轉換方法包 括離散餘弦轉換(discrete cosine transform,DCT)以及〇758D-A34294TWF_MBJ]-〇9-〇〇J a 5 201103338 The predicted residual values generated by the internal prediction mode require different conversion coefficients to achieve the best conversion effect. Therefore, there is a need for a method for compressing video data. Depending on the internal prediction mode of the video data, different conversion coefficients can be used for data compression. SUMMARY OF THE INVENTION In view of the above, it is an object of the present invention to provide a method for performing a-prediction to solve the problems of the prior art. First = 'Decision - the first internal prediction mode of the left block, the J - = just mode of the upper block, and the third internal prediction mode of the current block, where the left block is located in the current area The left side of the block, and the upper area 2 is located above the current block. Then, from the current block, multiple (four) = select: - target element. Then, calculating a first predicted value of the target pixel according to the first internal prediction mode, and determining a predicted value of the second derivative of the pixel by the - pen-# 笞哕目/m-(four) prediction mode. Correct the first, the third predicted value of the scalar. Finally, averaging the == pre-predicted value 1 and the third predicted value to obtain a -weighted flat. The present invention provides a method for performing video data shrinking. First-in-one prediction mode of one of the target blocks. Then type ^ selects a target conversion pattern corresponding to one of the internal prediction modes. The multiple values of the standard block are converted into multiple converted values according to the target conversion ς predicted residual value. The word 5 hai special 弋 钫笙 ...... /, A corresponds to the internal prediction mode = the (four) change type is based on the variation of the residual value of the system is divided into 0758D-A34294TWFJV1BJ 丨-09-00] 6 201103338 The present invention provides A supplemental 1 _, a video encoder (Video enc〇der). In an embodiment, the video block is d/ra - °° received - the current block, wherein a left block is located to the left of the current block, and the upper block is located in the current area. Above the block. In the usual example, the 钤, τ, and 砚 encoders include an Intra-prediction module, and a subtraction module. The internal prediction module is determined by the test, the upper mode, the second internal prediction mode of the upper block, and the third internal prediction mode of the current « Γ- ΛΑ ^ , month J £ block, from the current zone a plurality of books Q of the block, the animal, taking a target element, according to the first internal prediction, the singularity of the target, the singularity of the target book Xin, the younger brother of the jin-1, the predicted value, according to the second The internal prediction formula is a second predicted value of the target + &, & Jing, the third internal prediction mode is calculated according to the third internal prediction mode, a third predicted value of the target is checked, and the average is The first predicted value, the second predicted dry value, and the third predicted value are obtained by weighting one of the target elements: 22, , , and ^ predicted values. The subtraction module subtracts the weighted average prediction value from the target pixel to obtain the target pixel - the predicted residual value 0. The present invention provides a video encoder. In the embodiment, the video encoder includes a group, a subtraction module, an intra-prediction module, and a conversion module. The intra-prediction model has a plurality of predicted pixel values of the target block. The subtraction module subtracts the predicted pixel values from the plurality of original pixel values of the & L block from the target area to obtain a plurality of predicted residual values of the target drop-& prime. The conversion module determines a meat internal prediction mode of the target block, selects a target conversion pattern corresponding to the system prediction mode from the plurality of conversion patterns, and converts the predicted residual values into multiple according to the target conversion pattern. Convert the value. The conversion patterns corresponding to the inner (pre) (four) formula are classified according to the magnitude of the variance of the predicted residual value 0758D-A34294TWF_MBJI-09-00] 201103338. It is to be understood that the present invention will be described in detail with reference to the accompanying drawings. The current block 303 and the two adjacent blocks 3〇1 and 3〇2 processed by the internal prediction module according to an embodiment of the present invention. The two adjacent blocks include a left block 301 and an upper block 3〇2. The left block 3 (Π, the upper block 302, and the current block 3〇3 are all located in the same frame of a video material. In the picture, the left block 3〇1 is located in the current block 303. The left block and the upper block 3〇2 are located above the current block 3〇3. The left block 301, the upper block 3〇2, and the current block 3〇3 all include a fixed number of pixels (Pixel) Each element has a pixel value to indicate the color of the element. In one embodiment, block 303 currently includes 16 (4x4) pixels, respectively located at (〇, 〇)~(3, 3 Figure 4 is a flow diagram of a method 400 for performing intra-prediction in accordance with an embodiment of the present invention. Method 400 is referred to as overlapped block intra-prediction (0BIP). It is assumed that an internal prediction module receives the current block 303 in Fig. 3 for internal prediction. One left block 301 is located to the left of the current block 303, and an upper block 302 is located at the current block 303. The internal prediction modes of the left block 3 (Π, upper block 302, current block 303 may be different). The prediction module thus determines the first internal prediction mode of the left block 301, and the second internal prediction mode of the upper block 302, with the third internal prediction mode of 0758D-A34294TWF_MBJI-09-001 201103338 and the current block 303. (Step 402). The current block 303 includes IYou I Chafeng, and the Yichang said a picture of the celestial element. The internal prediction module then selects a target picture from the plurality of elements of the target block smoke. The module first depends on the nth inner ^^=.: value ?_4°6 of the left block 301. The internal prediction module then calculates the predicted value of the target pixel by the second internal prediction mode.卩 2 (step 4〇8). The third internal prediction mode of the intra prediction module block 3〇3: the centroid block nn, the third predicted value 410 of the T# 忑目目素. Therefore, the first predicted value ρι and the second predicted value P3 respectively correspond to the first internal prediction mode of the left block, the second internal prediction mode of the upper block 3〇2, and the current region. The first internal prediction mode of block 303. In the second brother of the second brother, the second 'predicted value &, == two miscellaneously get an average value as the target element: =3::2, %, for the second prediction of the first prediction value, The value is a weighted average (step 412). In an embodiment, the 'target weighting parameter W', ww, and only rr W3 are based on the location block 303: and the target pixel is located in the current block 303. In the example, the 'internal prediction module includes a memory for recording a plurality of sets of weighting parameters, and the internal prediction mode 2 is a plurality of sets of weighting parameter cents according to the embodiment of the invention; and a kernel parameter. In the weighting parameter table 500, the weight > number is indexed by the position in the first 303 of the current block 303 and the position in the first 303 of 〇, 758D-A34294TWF_MBJI-〇9-〇〇i ' ^ ] 201103338. Weighting parameter table training) ^ φ ^ weighting parameter is determined by linear non-linear training (°ff]ine in your order via linear avoidance (linear %(10)(4). If the position of the target element is (G, 2), At the current block 3Q3, the mask is in the vertical mode 〇' then the target weighting parameter %, %, : two π, 2), W(10) = (3, 3), and the current prediction mode of the block 303 is the horizontal force. ;, rw2, w- is determined to be w (four), after the inner box, 3" stomach target weighting parameters Wl, W2, W3 is determined to the flute - °, the test group then according to the target weighting parameters W,, w2, w3 The first prediction value P1, the second prediction value p2, and the third prediction value p3 are weighted: / the internal prediction value is obtained - the internal prediction value is executed (step 414). The internal prediction module is repeated 2 The calculation steps 404 to 414 are performed until the current prediction values of the block 303 and the second block are all obtained (step 416). Currently, the block If internal prediction value is followed by the Wei set to obtain the prediction region: the inner: prediction mode The group outputs the prediction block to a subtraction module, which predicts the pixel prediction value of the block from the current block 303 The box is used to obtain the predicted residual value, as shown in Fig. 1A. The predicted block singularity is therefore based on the internal prediction mode of the left block 301 and the upper block P2, p^=:; The generated predicted values P1 and ^^^ are used as weighting parameters for the average predicted value. The target is based on the third prediction mode h of the current block 303 and the position of the target in the current block 303. And decided. However, the crown 758D-A34294TWF_MBJl-〇9-〇〇I |0 201103338 weight parameter table 5 pin contains 9 kinds of predetermined weighting parameters respectively corresponding to the internal prediction mode 〇~8 ' and the other (four) pre- Such predetermined weighting parameters of the formula may produce a predicted average with less image distortion than the twisting parameters corresponding to the current block, such as the prediction mode & therefore, in the embodiment - the 'target weighting parameter W' , %, % are selected from the predetermined weighting parameters corresponding to the plurality of internal pre-seeks according to the bit rate-distortion optimization cost corresponding to the plurality of predetermined weighting parameters. For example, The internal prediction seam can be generated in step 412 to correspond to 9 9 sets of weighting parameters of the internal prediction mode, and then performing weighted averaging of the first prediction value & the second prediction value P2 and the second prediction value P3 according to the 9 sets of weighting parameters in step 414 to obtain 9 items of the target _ Internal prediction value. The inner step prediction charm then collects 9 internal prediction values of all the 以 to generate 9 _blocks, and calculates the bit rate-distortion optimization cost of 9 blocks. The last selection has the lowest bit. Section--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- The block system generates a prediction block including a plurality of weighted average prediction values according to the method 400 of the internal prediction mode. However, a prediction block comprising a plurality of weighted average prediction values may have a higher bit rate-distortion optimization cost than a prediction block generated solely from the single-internal prediction mode of the target block. Thus, in one embodiment, the intra prediction module has a mechanism to automatically determine whether to generate a prediction block comprising a plurality of weighted average prediction values in accordance with method 400. That is, the internal prediction module can automatically determine the level of the macro block (macr〇bl〇ck). 0758D-A34294TWF_MBJI-〇9-0〇1 201103338 Whether to enable or disable the overlapping block internal prediction function 400. In an embodiment, after the weighted average prediction values of all the pixels of the current block are calculated, the internal prediction module collects all the weighted average prediction values to obtain a first prediction block, and collects all the target areas. The third predicted value P3 generated by the intra prediction mode of the block results in a second prediction block. Then, the internal prediction module calculates the bit rate-distortion optimization cost of the first prediction block and the second block, respectively. When the bit rate·distortion optimization cost of the first prediction block is higher than the bit rate-distortion optimization cost of the second prediction block, the second prediction block generated according to the internal prediction mode of the target block Will be selected as the output of the internal prediction module. In one embodiment, a bit of video data is used to record an Overlay Block Internal Prediction Function (OBIP) on or off to inform the decoder to adjust the decoding process accordingly. When a subtraction module subtracts the prediction block from the current block to obtain the predicted residual value, the predicted residual value is sent to a conversion module for data compression. Figure 6 is a flow diagram of a method 600 of compressing video data in accordance with an embodiment of the present invention. It is assumed that the video encoder's conversion module supports a plurality of conversion patterns, each of which corresponds to a variance size level of the prediction residual value. The conversion module first receives a target block containing the predicted residual value to be compressed and determines an internal prediction mode for the target block (step 602). Next, the conversion module selects a target conversion pattern corresponding to the intra prediction mode of the target block from the plurality of conversion patterns (step 608). In another embodiment, the conversion module separately calculates a plurality of bit rate-distortion optimization costs corresponding to the plurality of conversion patterns, and selects a conversion pattern corresponding to the lowest bit rate-distortion optimization cost as Target conversion pattern. 0758D-A34294TWF MBJI-09-001 12 201103338 In some embodiments, different conversion patterns represent conversions with different sets of conversion coefficients. Conversion methods commonly used in video coding include discrete cosine transform (DCT) and
Karhmien L〇eve轉換(KLT)。轉換係數組依據不同的内部 預測杈式及變異數大小排序,其中各組轉換係數是由多個 預疋轉換係數所組成的。於一實施例中,轉換模組以一轉 換係數表儲存多_定轉換係數。第7圖為依據本發明一 實施利之儲存多組轉換係數的轉換係數表7〇〇。轉換係數Karhmien L〇eve Conversion (KLT). The conversion coefficient group is sorted according to different internal prediction formulas and variance numbers, wherein each group of conversion coefficients is composed of multiple pre-transformation coefficients. In one embodiment, the conversion module stores a plurality of constant conversion coefficients in a conversion coefficient table. Figure 7 is a graph showing the conversion coefficients of a plurality of sets of conversion coefficients in accordance with an embodiment of the present invention. Conversion factor
表700中的多組轉換係數係、依據不同的内部預測模式〇〜8 及變異數大小層級A、B、(:儲存。舉例來說,轉換係數組 C°A對應於垂直内部預測模式〇及最低之變異數大小層級 A,咖係數組C8c對應於水平偏上之内部預測模式8及 最南之變異數大小層級C。 轉換模組接著依據對應於目標轉換型式之内部預測 模式及變異數大小決定—组目標轉換係數。於—實施例 中,轉換模組依據對應於目標轉換型式之内部預測模式及 變異數大小搜尋·係數表·,以得到目標轉換係數。 接者,轉換模組掃描該目標區塊之多個書素以取得目標區 =之多難(_叫並域㈣轉換型式所對 μ之目&轉換係數轉換該等預測殘餘值為多個轉換值(步 驟610)。於一實施例中,# ' 中轉換拉組依據目標轉換型式決定 金疋::描順序’亚依該掃描,序掃描該目標區塊之多 Γη::以:到該Τ預測殘餘值。轉換模組接著重覆步驟 3目塊 <所有_殘餘值均已被轉換為轉 才、值:·、止(步驟612)。因此,針對不同内部預測模式的巨集 0758D-A34294TWF_MBJI-〇9.〇〇i 13 201103338 區塊,本發明之轉換模組可依據其内部預測模式所對應的 不同轉換型式進行轉換處理。 雖然本發明已以較佳實施例揭露如上,然其並非用以 限定本發明,任何熟習此項技術者,在不脫離本發明之精 神和範圍内,當可作些許之更動與潤飾,因此本發明之保 護範圍當視後附之申請專利範圍所界定者為準。 【圖式簡單說明】 第1A圖為依據内部預測模式進行視訊編碼的視訊編 碼器的區塊圖; 第1B圖為依據内部預測模式解碼視訊資料之視訊解 碼器的區塊圖; 第2圖顯示符合VCEG-N54規格的九種内部預測模式 0〜8 ; 第3圖為依據本發明之一實施例的被依内部預測模組 所處理之目前區塊及兩鄰近區塊; 第4圖為依據本發明之一實施例的用以進行内部預測 之方法的流程圖; 第5圖係依據本發明之一實施例的加權參數表; 第6圖為依據本發明之一實施例的對視訊資料進行資 料壓縮的方法之流程圖; 第7圖為依據本發明一實施利之儲存多組轉換係數的 轉換係數表。 【主要元件符號說明】 0758D-A34294TWF MBJI-09-001 14 201103338 100〜視訊編碼器; 102〜内部預測模組; 104〜減除模組; 106〜轉換模組; 108〜量化器; 150〜視訊解碼器; 152〜反轉換模組; 154〜反内部預測模組; 156〜相加模組; 301〜左方區塊; 302〜上方區塊; 303〜目前區塊。The plurality of sets of conversion coefficients in the table 700 are based on different internal prediction modes 〇8 and the sizing size levels A, B, (: storage. For example, the conversion coefficient group C°A corresponds to the vertical internal prediction mode 〇 The lowest variance size level A, the coffee coefficient group C8c corresponds to the horizontally upper internal prediction mode 8 and the southernmost variation size level C. The conversion module is then based on the internal prediction mode and the variance number corresponding to the target conversion pattern. Determining the group target conversion coefficient. In the embodiment, the conversion module searches for the target conversion coefficient according to the internal prediction mode and the variance number corresponding to the target conversion pattern. The plurality of pixels of the target block are used to obtain the target area = how difficult it is (the _ called the parallel (four) conversion pattern is for the target of the μ & conversion coefficient to convert the predicted residual values to a plurality of converted values (step 610). In one embodiment, the #' medium conversion pull group determines the gold 依据 according to the target conversion pattern:: the scan sequence, the scan of the target block, and the scan of the target block, Γη:: to: the predicted residual value. The conversion module then repeats the step 3 block < all_residual values have been converted to conversions, values: ·, and then (step 612). Therefore, the macros for different internal prediction modes 0758D-A34294TWF_MBJI-〇9 〇〇i 13 201103338 block, the conversion module of the present invention can be converted according to different conversion modes corresponding to its internal prediction mode. Although the present invention has been disclosed above in the preferred embodiment, it is not intended to limit the present invention. The invention is to be understood as being limited by the scope of the invention, and the scope of the invention is defined by the scope of the appended claims. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1A is a block diagram of a video encoder for video encoding according to an internal prediction mode; FIG. 1B is a block diagram of a video decoder for decoding video data according to an internal prediction mode; Nine internal prediction modes of the VCEG-N54 specification 0 to 8; FIG. 3 is a current block and two adjacent blocks processed by the internal prediction module according to an embodiment of the present invention; A flowchart for a method for performing internal prediction according to an embodiment of the present invention; FIG. 5 is a weighting parameter table according to an embodiment of the present invention; FIG. 6 is a video view according to an embodiment of the present invention; A flowchart of a method for data compression of data; Fig. 7 is a table of conversion coefficients for storing a plurality of sets of conversion coefficients according to an embodiment of the present invention. [Description of main component symbols] 0758D-A34294TWF MBJI-09-001 14 201103338 100~Video coding 102~ internal prediction module; 104~ subtraction module; 106~ conversion module; 108~ quantizer; 150~ video decoder; 152~ anti-conversion module; 154~ anti-internal prediction module; Adding module; 301~left block; 302~ upper block; 303~ current block.
0758D-A34294TWT MBJI-09-001 150758D-A34294TWT MBJI-09-001 15