TWI280804B - Method for splitting 8x8 DCT into four 4x4 modified DCTS used in AVC/H. 264 - Google Patents

Method for splitting 8x8 DCT into four 4x4 modified DCTS used in AVC/H. 264 Download PDF

Info

Publication number
TWI280804B
TWI280804B TW94133402A TW94133402A TWI280804B TW I280804 B TWI280804 B TW I280804B TW 94133402 A TW94133402 A TW 94133402A TW 94133402 A TW94133402 A TW 94133402A TW I280804 B TWI280804 B TW I280804B
Authority
TW
Taiwan
Prior art keywords
discrete cosine
cosine transform
type
avc
tan
Prior art date
Application number
TW94133402A
Other languages
Chinese (zh)
Other versions
TW200714076A (en
Inventor
Yuh-Jue Chuang
Ja-Ling Wu
Original Assignee
Yuh-Jue Chuang
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 Yuh-Jue Chuang filed Critical Yuh-Jue Chuang
Priority to TW94133402A priority Critical patent/TWI280804B/en
Publication of TW200714076A publication Critical patent/TW200714076A/en
Application granted granted Critical
Publication of TWI280804B publication Critical patent/TWI280804B/en

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The present invention provides that: (1) with the proposed efficient post processes, the existing DCT splitting algorithms still can be applied to complete the MPEG-2-to-AVC/H.264 conversion. (2) For absorbing some operations into quantization step and allowing 16-bit arithmetic implementation, the quantization table is re-defined. With the aid of the invention, an efficient MPEG-2-to-AVC/H.264 transcoder can be realized accordingly, and the de-compression process of the receiver is without any change.

Description

1280804 九、發明說明: 【發明所屬之技術領域】 本案係為一種分割型式二離散餘弦轉換方塊之 方法,尤指一種適用於MPEG-2及AVC/H.264之離 散餘弦核心轉換的分割型式二離散餘弦轉換方塊之 方法。 【先前技術】 由於MPEG-2的壓縮品質良好,包括DVD及近 年各國極力推廣的數位電視/高晝質電視 (DTV/HDTV)均採用MPEG_2作為壓縮的標準,進而 使得MPEG-2影片廣泛流通。然而,目前最新的影片 壓縮標準是AVC/H.264,與MPEG-2採用8x8的方 塊來做型式二離散餘弦轉換(Type-Π DCT)不同的 是,AVC/H.264採用4x4的方塊來做近似型式二離散 餘弦轉換,再配合其他技巧可以達到更好的壓縮效 果。這表示AVC/H.264可以使用比MPEG-2更少的 資訊量來表示同樣的影片品質,是一個更有效的壓縮 方法。 欲完成MPEG-2與AVC/H.264之間的格式轉 換,需要解決的問題包括運動向量的補償(motion vector compensation)、離散餘弦轉換核心的變換 (transform kernel conversion)及頻率域上畫面内預測 技術(transform_domainintra prediction)等,本發明主 ⑧ 6 1280804 要針對離散餘弦轉換核心的變換提出有效率的作 法。檢視先前關於影片格式轉換的技術及核心變換的 作法,由於AVC/H.264非採用標準型式二之離散餘 弦轉換(Type-II DCT),因此先前技術無法適用於 MPEG_2與AVC/H.264之間的格式轉換。 與本發明有關之學術論文:1280804 IX. Description of the invention: [Technical field of invention] This case is a method of splitting two discrete cosine transform blocks, especially a split type II suitable for MPEG-2 and AVC/H.264 discrete cosine core transform A method of discrete cosine transform blocks. [Prior Art] Due to the good compression quality of MPEG-2, including DVD and digital TV/HDTV (DTV/HDTV) promoted by countries in recent years, MPEG_2 is used as the compression standard, which makes MPEG-2 movies widely available. However, the latest video compression standard is AVC/H.264. Unlike MPEG-2, which uses 8x8 blocks for Type 2 Discrete Cosine Transform (Type-Π DCT), AVC/H.264 uses 4x4 blocks. Do an approximate type of two discrete cosine transforms, and with other techniques can achieve better compression. This means that AVC/H.264 can use the amount of information less than MPEG-2 to represent the same video quality, which is a more efficient compression method. To solve the format conversion between MPEG-2 and AVC/H.264, the problems to be solved include motion vector compensation, transform kernel conversion, and intra-picture prediction in the frequency domain. Technique (transform_domainintra prediction), etc., the present invention main 8 6 1280804 proposes an efficient method for the transformation of the discrete cosine transform core. Examining the previous techniques and core transformations for video format conversion, since AVC/H.264 does not use the standard type 2 discrete cosine transform (Type-II DCT), the prior art cannot be applied to MPEG_2 and AVC/H.264. Format conversion between. Academic papers related to the present invention:

Yuh-Jue Chuang and Ja-Ling Wu? uAn Efficient Matrix-Based 2-D DCT Splitter and Merger for SIMD Instructions”, IEICE Trans. On Information and Systems, Vol. E88-D,No· 7, 2005·Yuh-Jue Chuang and Ja-Ling Wu? uAn Efficient Matrix-Based 2-D DCT Splitter and Merger for SIMD Instructions”, IEICE Trans. On Information and Systems, Vol. E88-D, No· 7, 2005·

Yuh-Jue Chuang and Ja_Ling Wu, “Direct Splitting and Merging of 2-D DCT in the DCT domain’’, Digital Signal Processing,Vol· 14, Issue 6, Nov· 2004· Yuh-Jue Chuang, Ting-Jian Pan, Ja-Ling Wu, “General Splitting and Merging of 2-D DCT in the DCT Domain”,Proceedings of the IEEE International Midwest Symposium on Circuits and Systems,vol 1, pp. 17-20, 2004·Yuh-Jue Chuang and Ja_Ling Wu, “Direct Splitting and Merging of 2-D DCT in the DCT domain'', Digital Signal Processing, Vol· 14, Issue 6, Nov·2004· Yuh-Jue Chuang, Ting-Jian Pan, Ja-Ling Wu, "General Splitting and Merging of 2-D DCT in the DCT Domain", Proceedings of the IEEE International Midwest Symposium on Circuits and Systems, vol 1, pp. 17-20, 2004·

Athanassios N. Skodras,"Direct Transform to Transform Computation,” IEEE Trans, on Signal Processing Letters,Vol.6 Νο·8, Aug 1999. R. Dugad and N. Ahuja,’’A Fast Scheme for Image Size Change in the Compressed Domain,1’ IEEE Trans. 1280804 on Circuit and System for Video Technologies,Vol· 11 No.4, Apr. 2001. 與本發明之比較:上述論文採用不同方法,利用 前N/2點及後N/2點的型式二之離散餘弦轉換係數 (Type_II DCT coefficients)快速計算合併為N點之離 散餘弦轉換係數的方法,但由於AVC/H.264所採用 的轉換核心並非標準型式二之離散餘弦轉換,因此以 上論文無法解決MPEG-2與AVC/H.264的離散餘 弦核心轉換。 與本發明有關之美國專利說明如下: 專利編號· 6 8 6 818 8 專利名稱· Efficient down-scaling of DCT compressed images 與本發明之比較:上述專利提出一個利用前N/2點及 後N/2點的型式二之離散餘弦轉換係數(Type_n dct coefficients)快速計算合併為N點之離散餘弦轉換 係數的方法,並可利用此方法來作影像的放大及縮 小’其概念與本發明相似,但由於AVC/H.264所採 用的轉換核心並非標準型式二之離散餘弦轉換,因此 US 6868188號專利與本發明所提出的MpEG-2與 AVC/H.264的離散餘弦轉換格式轉換並不相同。 專利編號:6577767 ⑧ 8 1280804 專利名稱:Transcoding using block-based motion vectors 與本發明之比較:此專利主要是針對Motion JPEG 與 MPEG 及 DV (Digital Video)與 MPEG-2 之間的 格式轉換,由於AVC/H.264所採用的轉換核心與 Motion JPEG 及 DV 均不相同,因此 US 6577767 號專利所提出之Transcoding工作無法適用於本發明 所提出之AVC/H.264與MPEG-2間的格式轉換。 專利編號:6898241 專利名稱:Video transcoder with up-sampling 與本發明之比較:此專利針對mpeg影片,提出一 個可以在離散餘弦轉換域下將影片解析度放大的方 法。由於AVC/H.264所採用的轉換核心並非標準型 式二之離散餘弦轉換,因此,US 689824號專利所提 出之方法也無法解決本發明所專注之MPEG-2與 AVC/H.264間格式互換的問題。 專利編號:6671332 專利名稱:Video transcoder with spatial resolution reduction 與本發明之比較:此專利提出一個在離散餘弦轉換域 下改變影片解析度的方法,由於AVC/H.264所採用 的轉換核心並非標準型式二之離散餘弦轉換,因此,Athanassios N. Skodras, "Direct Transform to Transform Computation," IEEE Trans, on Signal Processing Letters, Vol.6 Νο·8, Aug 1999. R. Dugad and N. Ahuja, ''A Fast Scheme for Image Size Change in The Compressed Domain, 1' IEEE Trans. 1280804 on Circuit and System for Video Technologies, Vol. 11 No. 4, Apr. 2001. Comparison with the present invention: The above paper uses different methods, using the first N/2 points and the latter N The /2-point type 2 discrete cosine transform coefficient (Type_II DCT coefficients) quickly calculates the method of combining the discrete cosine transform coefficients into N points, but the conversion core used in AVC/H.264 is not the discrete cosine transform of the standard type 2 Therefore, the above paper cannot solve the discrete cosine core conversion of MPEG-2 and AVC/H.264. The US patents related to the present invention are described as follows: Patent No. 6 8 6 818 8 Patent Name · Efficient down-scaling of DCT compressed images Comparison with the present invention: the above patent proposes a discrete cosine transform coefficient of type 2 using the first N/2 point and the last N/2 point (Type_n dct coefficient s) Quickly calculate the method of combining the discrete cosine transform coefficients of N points, and use this method to enlarge and reduce the image. The concept is similar to the present invention, but the conversion core used in AVC/H.264 is not standard. The discrete cosine transform of the second type, so the US 6868188 patent and the MpEG-2 and AVC/H.264 discrete cosine transform format conversion proposed by the present invention are not the same. Patent No.: 6577767 8 8 1280804 Patent Name: Transcoding using block -based motion vectors vs. the present invention: This patent is mainly for the conversion between Motion JPEG and MPEG and DV (Digital Video) and MPEG-2, due to the conversion core and Motion JPEG used in AVC/H.264. The DVs are all different, so the Transcoding work proposed in US Pat. No. 6,577,767 cannot be applied to the format conversion between AVC/H.264 and MPEG-2 proposed by the present invention. Patent No.: 6908241 Patent Name: Video transcoder with up-sampling Comparison with the present invention: This patent proposes a method for amplifying the resolution of a movie in a discrete cosine transform domain for an mpeg film. Since the conversion core used in AVC/H.264 is not the discrete cosine transform of the standard type 2, the method proposed in the patent No. 689824 cannot solve the format interchange between MPEG-2 and AVC/H.264 which the present invention focuses on. The problem. Patent No.: 6671332 Patent Name: Video transcoder with spatial resolution reduction. Comparison with the present invention: This patent proposes a method for changing the resolution of a movie in a discrete cosine transform domain, since the conversion core used in AVC/H.264 is not a standard type. Two discrete cosine transforms, therefore,

9 1280804 US 6671332號專利無法解決本發明所解決之 MPEG-2與AVC/H.264間格式互換的問題。 專利編號:6647061 專利名稱:Video size conversion and transcoding from MPEG-2 to MPEG-4 與本發明之比較:此專利目的在解決影片解析度及影 片格式MPEG-2與MPEG-4之間的轉換,但無法解決 本發明所提及之MPEG-2與AVC/H.264間格式互換 的問題。 爰是之故,申請人有鑑於習知技術之缺失,發明 出本案「分割型式二離散餘弦轉換方塊的方法」,用 以改善上述習用手段之缺失。 【發明内容】 本案之主要目的係針對原有「將一個8x8的型式 二離散餘弦轉換方塊分割成四個4x4的型式二離散 餘弦轉換方塊的方法」,提出了 一個通用的後處理程 序’及修正過後的AVC/H.264量化表(quantization table),如此一來,則可以適用於MPEG-2及 AVC/H.264的離散餘弦核心轉換。 根據上述構想,本案係提供一種分割型式二離散 餘弦轉換方塊之方法,其步驟包含接收一影像資料; 對該影像資料進行可變長度解碼與解量化,以產生 1280804 8x8型式二離散餘弦轉換方塊;將該8x8型式二離散 餘弦轉換方塊分割成四個4x4型式二離散餘弦轉換 方塊;對該4x4型式二離散餘弦轉換方塊進行一後處 理程序A2,以產生四個4χ4近似型式二離散餘弦轉換 方塊,其中該後處理程序A?可表示為9 1280804 US Pat. No. 6,671,332 fails to solve the problem of the format interchange between MPEG-2 and AVC/H.264 solved by the present invention. Patent No.:6647061 Patent Name: Video size conversion and transcoding from MPEG-2 to MPEG-4 Comparison with the present invention: This patent aims to resolve the resolution between the film resolution and the film format MPEG-2 and MPEG-4, but The problem of the format interchange between MPEG-2 and AVC/H.264 mentioned in the present invention cannot be solved. For this reason, the applicant has invented the "method of splitting the two-discrete cosine transform block" in view of the lack of the prior art, in order to improve the lack of the above-mentioned conventional means. SUMMARY OF THE INVENTION The main purpose of the present invention is to provide a general post-processing program and a correction for the original method of dividing an 8x8 type two-discrete cosine transform block into four 4x4 type two-discrete cosine transform blocks. Subsequent AVC/H.264 quantization table, in this way, can be applied to the discrete cosine core conversion of MPEG-2 and AVC/H.264. According to the above concept, the present invention provides a method for dividing a type two discrete cosine transform block, the method comprising: receiving an image data; performing variable length decoding and dequantization on the image data to generate a 1280804 8x8 type two discrete cosine transform block; The 8x8 type two discrete cosine transform block is divided into four 4x4 type two discrete cosine transform blocks; a post-processing program A2 is performed on the 4x4 type two discrete cosine transform block to generate four 4χ4 approximate type two discrete cosine transform blocks. Where the post-processing program A? can be expressed as

1 0 0 0 0 0 tan(85.93°) 0 -1 0 0 0 1 0 0 0 1 0 tan(85.93°) 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 _0 0 0 0 0 〇 〇 〇 〇 〇 tan(85.93°) 0 1 0 0 0 0 0 0 0 0 0 0 0 -1 1 0 0 tan(85.93°) 量化該等4x4近似型式二離散餘弦轉換方塊。 如所述之方法,該影像資料係為一 MPEG-2格式 之影像資料,量化該等4x4近似型式二離散餘弦轉換 方塊之步驟係使用下列量化參數: (/, j) = j)}[(I m7) 14X A(Qm , /, j) + /2,3+&) »(13 + ρ,)], for (/, j) = {(1,2), (1,4), (3,2), (3,4)} U^{X(/57*)}[(| X{iJ) I 4xA(QM,Uj) + f2l5+^ ) » (15+ 0£)],otherwise m,i) M(QMa) 声(2m,3) fora/) = (0,0),(0,2),(2,0),(2,2) for(/5y) = (1,1),(1,3),(3,1),(3,3) for(U) = (U),(l,4),(3,2),(3,4) for(U) = (2,l),(0,2),(2,0),(2,2) 1280804 13107 44933 905 13108 11916 41725 840 11650 10082 36508 735 10485 9362 32450 654 9118 8192 29208 588 8388 7282 25398 512 7233 如所述之方法,該等量化參數係由原AVC/H.264 規格書所制訂之量化參數修改而成。1 0 0 0 0 0 tan(85.93°) 0 -1 0 0 0 1 0 0 0 1 0 tan(85.93°) 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 _0 0 0 0 0 〇 〇〇〇〇tan(85.93°) 0 1 0 0 0 0 0 0 0 0 0 0 0 -1 1 0 0 tan(85.93°) Quantizes these 4x4 approximations of two discrete cosine transform blocks. As described, the image data is an MPEG-2 format image data, and the steps of quantizing the 4x4 approximation type two discrete cosine transform blocks use the following quantization parameters: (/, j) = j)}[( I m7) 14X A(Qm , /, j) + /2,3+&) »(13 + ρ,)], for (/, j) = {(1,2), (1,4), (3,2), (3,4)} U^{X(/57*)}[(| X{iJ) I 4xA(QM,Uj) + f2l5+^ ) » (15+ 0£)], otherwise m,i) M(QMa) sound (2m,3) fora/) = (0,0),(0,2),(2,0),(2,2) for(/5y) = (1, 1),(1,3),(3,1),(3,3) for(U) = (U),(l,4),(3,2),(3,4) for(U) = (2,l),(0,2),(2,0),(2,2) 1280804 13107 44933 905 13108 11916 41725 840 11650 10082 36508 735 10485 9362 32450 654 9118 8192 29208 588 8388 7282 25398 512 7233 In the method described, the quantization parameters are modified from quantization parameters defined in the original AVC/H.264 specification.

根據上述構想,本案另提供一種分割型式二離散 餘弦轉換方塊之方法,其步驟包含接收一 MPEG-2 格式之影像資料;對該影像資料進行可變長度解碼與 解量化,以產生8x8型式二離散餘弦轉換方塊;將該 8x8型式二離散餘弦轉換方塊分割成四個4x4型式二 離散餘弦轉換方塊;對該4x4型式二離散餘弦轉換方 塊進行一後處理程序A2,以產生四個4x4近似型式二 離散餘弦轉換方塊,其中該後處理程序A2可表示為According to the above concept, the present invention further provides a method for dividing a type two discrete cosine transform block, the method comprising: receiving an image data of an MPEG-2 format; performing variable length decoding and dequantization on the image data to generate an 8x8 type two discrete a cosine transform block; dividing the 8x8 type two discrete cosine transform block into four 4x4 type two discrete cosine transform blocks; performing a post-processing procedure A2 on the 4x4 type two discrete cosine transform block to generate four 4x4 approximation patterns a cosine transform block, wherein the post-processing program A2 can be represented as

1 0 0 0 tan(85.93°) 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 tan(85.93°) 0 0 0 0 0 0 0 0 0 0 0 0 1 ο ο Ο tan(85.93°) Ο ο ο ο ο ο ο ο ο ο ο —1 1 ο Ο 1 Ο tan(85.93〇) ;以及 量化該等4x4近似型式二離散餘弦轉換方塊。 如所述之方法,量化該等4x4近似型式二離散餘 弦轉換方塊之步驟係使用下列量化參數: 12 1280804 sign{X{U 7)}[(1 X(U J) I 4 x A{QM, U j) + /2u+Qe )»(13 + Qe )], for (/, j) = {(1,2), (1,4), (3,2), (3,4)} sign{X(z, 7)}[(1 X(/, 7) | 4x A(QM, /, j) + /215+Qe ) »(15 + )], otherwise M(Qm ?0) for (U j) = (〇?〇)? (〇?2)? (2?0)? (2?2) M(2m,1) for (/,刀=(1,1),(1,3),(3,1),(3,3) M{Qm ?2) for (/, j) = (1,2), (1,4), (3?2)? (3,4) M{Qm ,3) for (/· j) = (2?1)? (0,2), (2,0), (2?2)1 0 0 0 tan(85.93°) 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 tan(85.93°) 0 0 0 0 0 0 0 0 0 0 0 0 ο ο Ο tan(85.93°) Ο ο ο ο ο ο ο ο ο ο ο — 1 1 ο Ο 1 Ο tan (85.93〇) ; and quantize the 4x4 approximation type two discrete cosine transform blocks. As described, the steps of quantizing the 4x4 approximation type two discrete cosine transform blocks use the following quantization parameters: 12 1280804 sign{X{U 7)}[(1 X(UJ) I 4 x A{QM, U j) + /2u+Qe )»(13 + Qe )], for (/, j) = {(1,2), (1,4), (3,2), (3,4)} sign{ X(z, 7)}[(1 X(/, 7) | 4x A(QM, /, j) + /215+Qe ) »(15 + )], otherwise M(Qm ?0) for (U j ) = (〇?〇)? (〇?2)? (2?0)? (2?2) M(2m,1) for (/,刀=(1,1),(1,3),( 3,1),(3,3) M{Qm ?2) for (/, j) = (1,2), (1,4), (3?2)? (3,4) M{Qm , 3) for (/· j) = (2?1)? (0,2), (2,0), (2?2)

13107 44933 905 13108 11916 41725 840 11650 10082 36508 735 10485 9362 32450 654 9118 8192 29208 588 8388 7282 25398 512 7233_ 如所述之方法,該等量化參數係由原AVC/H.264 規格書所制訂之量化參數修改而成。 根據上述構想,本案又提供一種分割型式二離散 餘弦轉換方塊之方法,其步驟包含接收一 MPEG-2 格式之影像資料;對該影像資料進行可變長度解碼與 • 解量化,以產生8x8型式二離散餘弦轉換方塊;將該 8x8型式二離散餘弦轉換方塊分割成四個4x4型式二 離散餘弦轉換方塊;對該4x4型式二離散餘弦轉換方 塊進行一後處理程序A2,以產生四個4x4近似型式二 離散餘弦轉換方塊,其中該後處理程序A2可表示為13107 44933 905 13108 11916 41725 840 11650 10082 36508 735 10485 9362 32450 654 9118 8192 29208 588 8388 7282 25398 512 7233_ As described, these quantization parameters are modified by the quantization parameters established by the original AVC/H.264 specification. Made. According to the above concept, the present invention further provides a method for dividing a type two discrete cosine transform block, the method comprising: receiving an image data of an MPEG-2 format; performing variable length decoding and dequantization on the image data to generate an 8x8 type II a discrete cosine transform block; dividing the 8x8 type two discrete cosine transform block into four 4x4 type two discrete cosine transform blocks; performing a post-processing procedure A2 on the 4x4 type two discrete cosine transform block to generate four 4x4 approximation patterns a discrete cosine transform block, wherein the post-processing program A2 can be represented as

13 1280804 ;以及 使用下列量化參數來量化該等4x4近似型式二離散 餘弦轉換方塊 sign{X{U 7)}[(| j) I 4x A{Qm , z, j) + /213+& ) »(13 + )]? for (/, j) = {(1,2), (1,4), (3,2), (3,4)} sign{X(i, 7)} [(1 X(z, j) | 4xA(QM, i, j) + /215+Qe ) »(15 + )], otherwise for (/,力=(0,0),(0,2),(2,0),(2,2) for(/,y) = (l,l),(l,3),(3,l),(3,3) f〇r(U) = (l,2),(l,4),(3,2),(3,4) fora/) = (2,l),(0,2),(2,0),(2,2)13 1280804; and using the following quantization parameters to quantize the 4x4 approximation type two discrete cosine transform blocks sign{X{U 7)}[(| j) I 4x A{Qm , z, j) + /213+& ) »(13 + )]? for (/, j) = {(1,2), (1,4), (3,2), (3,4)} sign{X(i, 7)} [( 1 X(z, j) | 4xA(QM, i, j) + /215+Qe ) »(15 + )], otherwise for (/, force=(0,0),(0,2),(2 ,0),(2,2) for(/,y) = (l,l),(l,3),(3,l),(3,3) f〇r(U) = (l,2 ),(l,4),(3,2),(3,4) fora/) = (2,l),(0,2),(2,0),(2,2)

10 0 0 0 tan(85.93°) 0 -1 0 0 10 0 1 0 tan(85.93°) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 tan(85.93。) 0 -1 0 0 1 0 0 1 0 tan(85.9310 0 0 0 tan(85.93°) 0 -1 0 0 10 0 1 0 tan(85.93°) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 tan(85.93.) 0 -1 0 0 1 0 0 1 0 tan(85.93

Xq{iJ) = 灣m,3) 13107 44933 905 13108 11916 41725 840 11650 10082 36508 735 10485 9362 32450 654 9118 8192 29208 588 8388 7282 25398 512 7233 如所述之方法,該等量化參數係由原AVC/H.264 規格書所制訂之量化參數修改而成。 【實施方式】 由於終端用戶(end-user)的網路環境、電腦效 14 1280804 能、顯示裝置及播放工具各異,因此,媒體内容提供 者(content provider)針對同一份影片往往需要準備多 種不同的版本以符合眾多用戶的需求’卻也同時造成 了儲存空間的浪費。透過即時的影片格式、大小互相 轉換(Video Transcoding)的技術,媒體内容提供者只 需要準備一份檔案,便可以針對使用者的需求進行檔 案格式或是大小等的轉換,從而達到全方位多媒體存 取(universal multimedia access)的目的。 近年來,由於DVD及HDTV的風行,以]vjpeg,〕 壓縮的影片不斷增加,進而使得MPEG-2影片廣泛流 通,大多數家庭均有DVD播放器或是數位電視接收 器,擁有收看MroG-2影片的能力。然而,目前最新 的影片壓縮標準則是由ITU_T及ISO/IEC所共同制 訂的AVC/H.264,與MPEG-2採用8x8的方塊來做 型式二離散餘弦轉換(Type-II DCT)最大的不同在 於,AVC/H.264採用4x4的方塊來做「近似」型式二 離散餘弦轉換。AVC/H.264採用近似的型式二離散餘 弦轉換配合矩陣分解的技巧,可以讓離散餘弦轉換的 核心利用整數的運算來完成,再加上其他AVC/H.264 所制訂的技巧,則可以達到與MPEG-2相比,在同樣 的影片品質下,壓縮率可以有1 ·5到2倍的進步,這 代表AVC/H.264可以使用比MPEG-2更少的資訊量 來表示同樣的影片品質,是一個更有效的壓縮方法。 也因此,我們相信,未來無論是將影片格式由 ⑧ 15 .1280804 MPEG-2轉成AVC/H.264以降低檔案大小,或是將 AVC/H.264的影片轉成最廣泛流通的MPEG-2影 片,都是絕對必要的! 請參閱第一圖,其係習用MPEG-2至AVC/H.264 轉碼器之架構圖,該架構包含一 MPEG-2解碼器π 與一 AVC/H.264編碼器12。該MPEG-2解碼器u 係接收一 MPEG-2格式之影像資料,隨後該影像資料 經過可變長度解碼111與解量化112後產生8X8型式 二離散餘弦轉換方塊,接著針對每一 8x8型式二離散 餘弦轉換方塊進行逆向離散餘弦轉換113,將資料轉 換至空間域,並傳送至該AVC/H· 264編碼器12。為 了執行該影像資料之解碼作業,該MPEG-2解崎哭u 尚包含執行移動補償114與訊框儲存115等作業。 當該AVC/H· 264編碼器12接收到該8χ8空間域 資料方塊時,即對該8x8方塊分割成四個4χ4之子方 塊,並分別對四個子方塊進行4x4近似型式二離气飲 弦轉換121與量化122。為了執行該影像資料之 作業,該AVC/H· 264編碼器12尚包含執行解旦化 124、解離散餘弦轉換125、訊框儲存ΐ2β、移動估* 127、移動補償128、内訊框預測129及燏值編 τ 等作業。 由上可知,該影像資料首先經過該Mpeg_2 器11解壓縮,再由該AVC/H.264編碼哭‘ 碼 wU重新壓 縮。由於該AVC/H.264編碼器12並非採用掉準型气 16 1280804 二之離散餘弦轉換(Type-IIDCT),先前關於影片格式 轉換的技術及核心變換的作法均無法適用於 MPEG-2至AVC/H.264轉碼器。本發明的重點在於為 MPEG-2與AVC/H.264格式轉換時的離散餘弦轉換 核心變換提出有效率的作法,避免於該MPEG-2解碼 器11端執行逆向離散餘弦轉換113及於該 AVC/H.264編碼器12端執行正向離散餘弦轉換 121。為了進一步節省計算量,部分的運算合併於該 AVC/H.264編碼器12的量化模組122中,因此量化 模組122所需之量化表亦需作相對應的修改。 本發明針對AVC/H.264所採用的「近似」型式 二離散餘弦轉換與標準型式二離散餘弦轉換的關 係,提出一個有效率並維持影片品質的後處理程序, 結合任何「將一個8x8的型式二離散餘弦轉換方塊分 割成四個4x4的型式二離散餘弦轉換方塊的方法」, 即可以完成MPEG-2至AVC/H.264的離散餘弦核心 轉換,反之亦然。 二維的情況可以視為一維情況的延伸,為了方便 說明起見,以下我們以一維的情形來作說明,令厶為 長度8點之型式二離散餘弦轉換係數,7/及7/分別 為長度8點及4點之標準型式二離散餘弦轉換,7’4則 為AVC/H.264所定義為長度4點之近似型式二離散 餘弦轉換。假設S為8 X 8的矩陣’表不「將一個長度 8點型式二離散餘弦轉換係數分割成二個長度4點型 ③ 17 !28〇8〇4 」的方法,則S可用以下式子Xq{iJ) = bay m, 3) 13107 44933 905 13108 11916 41725 840 11650 10082 36508 735 10485 9362 32450 654 9118 8192 29208 588 8388 7282 25398 512 7233 As described, these quantitative parameters are derived from the original AVC/H The quantitative parameters developed by the .264 specification have been modified. [Embodiment] Since the end-user network environment, the computer system 14 1280804, the display device, and the playback tool are different, the content provider often needs to prepare a plurality of different videos for the same movie. The version meets the needs of many users' but it also creates a waste of storage space. Through the instant video format and video transcoding technology, the media content provider only needs to prepare a file, and then can convert the file format or size according to the user's needs, thereby achieving full multimedia storage. Take the purpose of (universal multimedia access). In recent years, due to the popularity of DVDs and HDTVs, the number of compressed movies with [vjpeg,] has been increasing, which has led to the widespread circulation of MPEG-2 movies. Most homes have DVD players or digital TV receivers with MroG-2. The ability of the film. However, the latest video compression standard is AVC/H.264 jointly developed by ITU_T and ISO/IEC, which is the biggest difference between MPEG-2 and 8x8 blocks for Type II II DCT. In fact, AVC/H.264 uses 4x4 squares for "approximate" type two discrete cosine transforms. AVC/H.264 uses an approximate type of two-discrete cosine transform combined with matrix decomposition techniques, which allows the core of discrete cosine transform to be completed using integer arithmetic, plus other techniques developed by AVC/H.264. Compared with MPEG-2, the compression ratio can be improved by 1.5 to 2 times under the same film quality, which means that AVC/H.264 can use less information than MPEG-2 to represent the same movie. Quality is a more efficient compression method. Therefore, we believe that in the future, whether the film format is converted from 8 15 .1280804 MPEG-2 to AVC/H.264 to reduce the file size, or to convert AVC/H.264 movies into the most widely distributed MPEG- 2 videos are absolutely necessary! Please refer to the first figure, which is an architectural diagram of an MPEG-2 to AVC/H.264 transcoder comprising an MPEG-2 decoder π and an AVC/H.264 encoder 12. The MPEG-2 decoder u receives an MPEG-2 format image data, and then the image data is subjected to variable length decoding 111 and dequantization 112 to generate an 8×8 type two discrete cosine transform block, and then for each 8×8 type two discrete The cosine transform block performs inverse discrete cosine transform 113, converts the data to the spatial domain, and transmits it to the AVC/H.264 encoder 12. In order to perform the decoding operation of the image data, the MPEG-2 solution includes executing the operations of the motion compensation 114 and the frame storage 115. When the AVC/H.264 encoder 12 receives the 8χ8 spatial domain data block, the 8x8 square is divided into four 4χ4 sub-blocks, and the four sub-blocks are respectively subjected to a 4×4 approximation type two gas-free chord conversion 121. With quantization 122. In order to perform the operation of the image data, the AVC/H.264 encoder 12 further includes an execution solution 124, a de-discrete cosine transform 125, a frame storage ΐ2β, a motion estimation 127, a motion compensation 128, and a frame prediction 129. And 燏 value editing τ and other operations. As can be seen from the above, the image data is first decompressed by the Mpeg_2 device 11, and then the AVC/H.264 code is crying 'code wU recompressed. Since the AVC/H.264 encoder 12 does not use the Discrete Cosine Transform (Type-IIDCT) of the PM 16 1280804, the previous techniques for video format conversion and core conversion cannot be applied to MPEG-2 to AVC. /H.264 transcoder. The present invention focuses on an efficient method for discrete cosine transform core conversion in MPEG-2 and AVC/H.264 format conversion, avoiding performing inverse discrete cosine transform 113 on the MPEG-2 decoder 11 end and the AVC. The /H.264 encoder 12 performs a forward discrete cosine transform 121. In order to further reduce the amount of calculation, part of the operation is incorporated in the quantization module 122 of the AVC/H.264 encoder 12, so the quantization table required by the quantization module 122 also needs to be modified accordingly. The invention relates to the relationship between the "approximate" type two discrete cosine transform adopted by AVC/H.264 and the standard type two discrete cosine transform, and proposes a post-processing program which is efficient and maintains the quality of the film, combining any "will be an 8x8 type" The method of dividing the two discrete cosine transform blocks into four 4x4 type two discrete cosine transform blocks, that is, the discrete cosine core transform of MPEG-2 to AVC/H.264 can be completed, and vice versa. The two-dimensional case can be regarded as an extension of the one-dimensional case. For the convenience of explanation, the following is a one-dimensional case. Let 厶 be a type 2 discrete cosine transform coefficient of length 8 points, 7/ and 7/ respectively It is a standard type two discrete cosine transform with lengths of 8 points and 4 points, and 7'4 is an approximate type two discrete cosine transform defined by AVC/H.264 with a length of 4 points. Suppose that S is a matrix of 8 X 8 and the method of dividing a length 8-point type two-discrete cosine transform coefficient into two lengths of four-point type 3 17 !28〇8〇4", then S can be expressed by the following formula.

式一離散餘弦轉換係數 來表示: [Tf] 經由S的運算’相當於對長度8點之型式二離散餘弦 轉換係數’ /s ’執行反型式二離散餘弦轉換,[〇A discrete cosine transform coefficient is expressed as: [Tf] The operation via S' is equivalent to performing an inverse two-discrete cosine transform on a type 2 discrete cosine transform coefficient ' /s ' of length 8 points, [〇

轉回原工間域’再接著分別對前半部及後半部執行4 點之型式二離散餘弦轉換,即[〇。 同理,今fg 0 為另一 8x8的矩陣,表示「將一個長度 尘式一雜政餘弦轉換向量分割成二個長度4點的 VC/H.264所定義的近似型式二離散餘弦轉換向量」 的方法’則义可用以下式子來表示: [τ\]Switch back to the original work area' and then perform a 4-point discrete cosine transform on the first half and the second half, ie [〇. Similarly, fg 0 is another 8x8 matrix, which means "divide a length of a dusty-poly cosine transform vector into two approximate lengths of four points VC/H.264 defined by the approximate type two discrete cosine transform vector" The method 'is defined by the following formula: [τ\]

[Λ] [r8"]-1 (2) 為了希主可以利用原有$的成果,我們令夕仇$,万 本务月所^出的後處理程序,也就是經^處理後的 、、口果再經由万的後處理將與直接透過處理的結果 相當。而矩陣厶則可以視為 廿’4 ] 0 - \T4r 〇 ' -0 [T\l -0 [τ4γι (3)[Λ] [r8"]-1 (2) In order for the Greeks to use the results of the original $, we will make the post-processing program of the eve of the moon, and the levy of the month, that is, after the processing of ^, The post-treatment of the fruit will be equivalent to the result of the direct permeation treatment. The matrix 可以 can be regarded as 廿'4 ] 0 - \T4r 〇 ' -0 [T\l -0 [τ4γι (3)

18 1280804 假設/’為8x8的型式二離散餘弦轉換係數(Type_n DCT coefficients)方塊,貝丨J「將一個8x8型式二離散 餘弦轉換方塊直接分割成四個4x4的AVC/H 264所 定義的近似型式二離散餘弦轉換方塊」的方法可以表 示成 S^rxS^BxSxFx^xg. (4) (5) 根據MPEG_2及AVC/H·264規格書的定義 1/2 1/2 1/2 1/2 ' \τπλ= ^C0S^ Visin(f) ~Visin(f) ~ViC0S(f) 4 1/2 -1/2 一 1/2 1/2 _Visin(f) ~ViC0S(f) Vicos(f) -Visin(f) 且 1/2 1/2 1/2 1/2 因此 V2/5 ViTTo -λ/ΪΤΪΟ -λ/275 1/2 -1/2 -1/2 1/2 _VT7Io -λ/275 V275 - ViTTo 1 0 0 0 0 0 0 cosf+ Visinf 0 s^nf ~Vicosf 0 0 0 vT 0 1 0 0 0 [厶8]= 0 cos Ι V^sinf 0 再 cosf + ^/Isinf 0 0 0 Ο 0 0 1 0 0 0 0 0 0 0 0 0 0 0 -\/τ c〇s T + sin |. 0 0 0 0 0 λ/τ cos T ^ sin - 0 0 0 ο ⑹ ο ο ο ο #cosf+VI為了化簡矩陣5的複雜度,我們今 7 Vf %sin(63.43。)及 ⑺ sm丟18 1280804 Assume /' is a type 2n discrete cosine transform coefficient (Type_n DCT coefficients) block of 8x8, Beckham J "directs an 8x8 type two discrete cosine transform block into four 4x4 AVC/H 264 defined approximations The method of the two-discrete cosine transform block can be expressed as S^rxS^BxSxFx^xg. (4) (5) According to the definition of MPEG_2 and AVC/H.264, 1/2 1/2 1/2 1/2 ' \τπλ= ^C0S^ Visin(f) ~Visin(f) ~ViC0S(f) 4 1/2 -1/2 1/2 1/2 _Visin(f) ~ViC0S(f) Vicos(f) -Visin (f) and 1/2 1/2 1/2 1/2 Therefore V2/5 ViTTo -λ/ΪΤΪΟ -λ/275 1/2 -1/2 -1/2 1/2 _VT7Io -λ/275 V275 - ViTTo 1 0 0 0 0 0 0 cosf+ Visinf 0 s^nf ~Vicosf 0 0 0 vT 0 1 0 0 0 [厶8]= 0 cos Ι V^sinf 0 then cosf + ^/Isinf 0 0 0 Ο 0 0 1 0 0 0 0 0 0 0 0 0 0 0 -\/τ c〇s T + sin |. 0 0 0 0 0 λ/τ cos T ^ sin - 0 0 0 ο (6) ο ο ο ο #cosf+VI Simplify the complexity of matrix 5, we are now 7 Vf %sin (63.43.) and (7) sm lost

19 1280804 • 々βα^63·43。;),並配合三角公式,得出4cosf + Wsinf = sin(85.93。)且 ^〇^_^也| = (^(85.93。), 代入矩陣B後可以得到 B = 根據壓縮標準制訂的流程,接續離散餘弦轉換的是係 數畺化步驟,為了進一步降低計算的複雜度,我們將 矩陣B分解,並將部分運算併入量化表,與量化步驟 合併執行。我們將矩陣B分解如下: 1 0 0 0 0 〇 sin(85.93°) 〇 -cos(85.93°) 0 0 〇 1 0 0 〇 cos(85.93°) 〇 sin(85.93°) 0 0 〇 0 0 1 0 〇 0 0 0 〇 0 0 0 〇 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sin(85.93°) 〇 -c〇s(85.93°) 0 0 1 〇 0 cos(85.93°) 〇 sin(85.93°) (8) Φ 20 (9) 128080419 1280804 • 々βα^63·43. ;), and with the triangle formula, get 4cosf + Wsinf = sin(85.93.) and ^〇^_^ also | = (^(85.93.), after substituting into matrix B, you can get B = according to the process of compression standard, Following the discrete cosine transform is the coefficient deconstruction step. In order to further reduce the computational complexity, we decompose the matrix B and incorporate part of the operation into the quantization table, which is combined with the quantization step. We decompose the matrix B as follows: 1 0 0 0 0 〇sin(85.93°) 〇-cos(85.93°) 0 0 〇1 0 0 〇cos(85.93°) 〇sin(85.93°) 0 0 〇0 0 1 0 〇0 0 0 〇0 0 0 〇0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sin(85.93°) 〇-c〇s(85.93°) 0 0 1 〇0 cos(85.93°) 〇sin(85.93°) (8) Φ 20 (9) 1280804

5 =為為其中 1 05 = for 1 0

A c〇s(85.93°) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 cos(85.93°) 0 0 0 0 0 1 0 0 0 0 0 cos(85.93°) 0 0 0 0 0 1 0 0 0 0 0 1 0 0 tan(85.93°) 〇 0 〇 1 〇 0 〇 0 〇 0 0 ο 0 0 0 0 0 0 -1 0 0 0 1 0 0 0 0 0 tan(85.93°) 0 0 0 0 0 1 0 0 0 0 0 tan(85.93°) 0 0 0 0 0 1 0 0 0 1 0 οοοο οο ο cos(85.93°) Ο ' Ο Ο Ο Ο -1 Ο tan(85.93°) (1〇) 我們將矩陣Α併入AVC/H.264的量化表中,則後處 理程序5可以進一步簡化為々,即,只需要四個乘法 數及四個加法數便可完成。為了配合16位元的實作 需求’ AVC/H.264的規格書中所定義的量化模組相關 函式及表格,均需要作相對應的修改,包括: 量化公式4由 j) = sign{X(/, j)}[(1 X(U j) I A{QU?j) + f2l5+QE )»(\5 + qe)] 改成 21 (12) (13) 1280804 量化公式4中的J由 M(Qm ?0) for i and j are odds. M{Qm ?1) for i and j are evens M(Qm ,0) otherwise 改成 (14) M{Qm ,0) for (/? j) - (0,0), (0,2), (2?0)? (2,2) M{QmX) for (/,力=(14),(1,3),(3,1),(3,3) M(0m,2) for (U) = (1,2),(1,4),(3,2),(3,4) M(2m,3) for (/,y) = (2,1),(0,2),(2,0),(2,2) 中的Λ/則由 改為 Μ Μ 13107 5243 8066 11916 4660 7490 10082 4164 6554 9362 3647 5825 8192 3355 5243 7282 2893 4559_ •13107 44933 905 13108 11916 41725 840 11650 10082 36508 735 10485 9362 32450 654 9118 8192 29208 588 8388 7282 25398 512 7233 (15) (16) 本發明之特點為: 1.本發明可以結合任何現有「將一個8x8的型式二離 散餘弦轉換方塊分割成四個4x4的型式二離散餘 22 1280804 • 弦轉換方塊」的方法,直接將MPEG-2中一個8x8 的型式二離散餘弦轉換方塊分割成四個4x4的 AVC/H.264所定義的近似型式二離散餘弦轉換方 塊,避免執行一個8x8的反型式二離散餘弦轉換及 四個4x4的AVC/H.264所定義的近似型式二離散 餘弦轉換。 m 胃 2.由於電腦可以表達的位元數固定,因此每一次浮點 運算後均需要取接近的值來代替(rounding),因而 造成誤差,影響影片的品質。習用的方法需要兩次 取近似值的動作,分別在執行一個8x8的反型式二 離散餘弦轉換後及四個4x4的AVC/H.264所定義 的近似型式二離散餘弦轉換後,本發明由於直接將 鲁一個8x8的型式二離散餘弦轉換方塊分割成四個 4x4的近似型式二離散餘弦轉換方塊,因此只需要 一次取近似值的動作,因此比傳統方法少一次,所 以格式轉換後的影像品質也比傳統的方法來得好。 3.修改AVC/H.264定義的量化表,可以使得格式轉 換的計算量降低,同時不影響終端用戶收到轉換過 後檔案的解壓縮過程。 ⑧ 23 1280804 本發明之實例與功效: 本發明之功效經過實際模擬,可分兩方面來說明,第 一方面是計算量的分析,第二方面則是影像品質的分 析。 1·計算量分析: 由上述說明,顯示後處理程序々(算式(4))可由四個 加法與四個乘法完成,與習用的方法s,需要272乘法 數及752加法數相比,後處理程序a結合我們先前的 研究 s (Ref: Yuh-Jue Chuang,Ja_Ling Wu,“Direct Splitting and Merging of 2-D DCT in the DCT domain”, Digital Signal Processing,Vol· 14,Issue 6,Nov· 2004),則只需要224個乘法數及464個加法數。 若執行電腦支援單指令多資料處理技術(SIMD,A c〇s(85.93°) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 cos(85.93°) 0 0 0 0 0 1 0 0 0 0 0 cos(85.93° 0 0 0 0 0 1 0 0 0 0 0 1 0 0 tan(85.93°) 〇0 〇1 〇0 〇0 〇0 0 ο 0 0 0 0 0 0 -1 0 0 0 1 0 0 0 0 0 tan (85.93°) 0 0 0 0 0 1 0 0 0 0 0 tan(85.93°) 0 0 0 0 0 1 0 0 0 1 0 οοοο οο ο cos(85.93°) Ο ' Ο Ο Ο Ο -1 Ο tan( 85.93°) (1〇) We merge the matrix into the quantization table of AVC/H.264, and the post-processing program 5 can be further simplified to 々, that is, only four multiplication numbers and four addition numbers can be completed. . In order to comply with the 16-bit implementation requirements, the quantitative module related functions and tables defined in the AVC/H.264 specification need to be modified accordingly, including: Quantization formula 4 by j) = sign{ X(/, j)}[(1 X(U j) IA{QU?j) + f2l5+QE )»(\5 + qe)] Changed to 21 (12) (13) 1280804 Quantizes J in Formula 4 M(Qm ?0) for i and j are odds. M{Qm ?1) for i and j are evens M(Qm ,0) otherwise changed to (14) M{Qm ,0) for (/? j) - (0,0), (0,2), (2?0)? (2,2) M{QmX) for (/, force=(14),(1,3),(3,1), (3,3) M(0m,2) for (U) = (1,2),(1,4),(3,2),(3,4) M(2m,3) for (/,y ) = (2,1), (0,2),(2,0),(2,2) The Λ/则 is changed to Μ Μ 13107 5243 8066 11916 4660 7490 10082 4164 6554 9362 3647 5825 8192 3355 5243 7282 2893 4559_ • 13107 44933 905 13108 11916 41725 840 11650 10082 36508 735 10485 9362 32450 654 9118 8192 29208 588 8388 7282 25398 512 7233 (15) (16) The invention is characterized by: 1. The invention can be combined with any existing "will An 8x8 type two discrete cosine transform block is divided into four The 4x4 type 2 discrete residual 22 1280804 • Chord conversion block method directly divides an 8x8 type two discrete cosine transform block in MPEG-2 into four 4x4 AVC/H.264 defined type two discrete cosines. Convert the block to avoid performing an 8x8 inverse two-fold cosine transform and four 4x4 AVC/H.264 defined approximate two-fold discrete cosine transforms. m Stomach 2. Since the number of bits that the computer can express is fixed, each After a floating-point operation, it is necessary to take close values instead of (rounding), thus causing errors and affecting the quality of the film. The conventional method requires two actions of approximating values, respectively, after performing an 8x8 inverse type two discrete cosine transform. And after four 4x4 AVC/H.264 defined approximate two-fold discrete cosine transform, the present invention directly divides a 8x8 type two-discrete cosine transform block into four 4x4 approximate type two discrete cosine transform blocks. Therefore, it only takes one action to take an approximation, so it is less than the traditional method, so the image quality after format conversion is better than the traditional method. . 3. Modifying the quantization table defined by AVC/H.264 can reduce the amount of computation of format conversion without affecting the decompression process of the file after the end user receives the conversion. 8 23 1280804 Examples and Efficacy of the Invention: The efficacy of the present invention has been empirically simulated and can be illustrated in two aspects. The first aspect is the analysis of the calculated amount, and the second aspect is the analysis of the image quality. 1. Calculation analysis: From the above description, it is shown that the post-processing program 算 (formula (4)) can be completed by four additions and four multiplications, compared with the conventional method s, which requires 272 multiplication numbers and 752 addition numbers, post-processing Program a combines our previous research s (Ref: Yuh-Jue Chuang, Ja_Ling Wu, "Direct Splitting and Merging of 2-D DCT in the DCT domain", Digital Signal Processing, Vol. 14, Issue 6, Nov. 2004) , only 224 multiplication numbers and 464 addition numbers are needed. If you perform computer support single instruction multiple data processing technology (SIMD,

Single Instruction Multiple Data),A(算式(4))更可以 一個PMADDWD指令完成,結合我們先前的研究S, 本發明僅需要6個PMADDWD指令及5個PMADD ③ 24 1280804 指令,少於習用方法需要7個PMADDWD指令及5 個PMADD指令。 2.影像品質分析· . 首先我們以18張常見的測試影像,在不考慮之 後量化的情形下,測試透過習用方法與本發明方法將 8x8型式二離散餘弦轉換方塊直接分割成四個4x4的 AVC/H.264所定義的近似型式二離散餘弦轉換方塊 後的影像品質,計算與原圖的PSNR (Peak signal_to-noise ratio)值,PSNR值愈高代表與原圖愈 相近,表一為實驗結果。從表一可知,本發明之方法 的PSNR值均比習用方法來得高,平均值大約高了 3dB。 影像 PSNR (未量化) 本發明方法 傳統方法 airfield.bmp 58.922086 55.740291 airplane.bmp 58.875425 55.776364 bridge.bmp 58.829261 55.728460 couple.bmp 58.895136 55.774052 crowd.bmp 58.924472 55.787553 fruits.bmp 62.706741 59.713580 goldhill.bmp 58.907797 55.724269 lax.bmp 58.907797 55.765203 lena.bmp 58.907005 55.770972 25 1280804Single Instruction Multiple Data), A (Formula (4)) can be completed by a PMADDWD instruction. In combination with our previous study S, the present invention requires only 6 PMADDWD instructions and 5 PMADD 3 24 1280804 instructions, which is less than the conventional method. PMADDWD instruction and 5 PMADD instructions. 2. Image quality analysis · . First, we use 18 common test images, without considering the subsequent quantization, the test directly divides the 8x8 type two discrete cosine transform block into four 4x4 AVCs by the conventional method and the method of the present invention. The image quality after approximating the two-discrete cosine transform block defined by /H.264, and calculating the PSNR (Peak signal_to-noise ratio) value of the original image. The higher the PSNR value, the closer the original picture is, and the first one is the experimental result. . As can be seen from Table 1, the PSNR values of the method of the present invention are higher than the conventional methods, and the average value is about 3 dB higher. Image PSNR (unquantized) Method of the Invention Traditional Method airfield.bmp 58.922086 55.740291 airplane.bmp 58.875425 55.776364 bridge.bmp 58.829261 55.728460 couple.bmp 58.895136 55.774052 crowd.bmp 58.924472 55.787553 fruits.bmp 62.706741 59.713580 goldhill.bmp 58.907797 55.724269 lax.bmp 58.907797 55.765203 lena.bmp 58.907005 55.770972 25 1280804

man.bmp peppers.bmp sailboat.bmp splash.bmp statue.bmp tiffany.bmp tool.bmp truck.bmp woman.bmp Avg.PSNR 58.918907 58.942010 58.950805 58.971665 62.893145 58.917318 59.075025 58.945206 58.934827 59.356924 55.710583 55.818183 55.769048 55.741820 59.756727 55.746027 55.922533 55.817016 55.799159 56.214547 我們考慮量化後的結果,統計本發明方法與習用 方法與原始影像的誤差。AVC/H.264的量化級距由0 至51,量化級距愈大,代表壓縮的效率愈高,但影 像失真也會愈大。我們由前述18張常用的測試影像 中隨機取出18萬個8x8的方塊,分別採用兩種方法 執行四個4x4的AVC/H.264所定義的近似型式二離 散餘弦轉換後,再實行不同的量化級距,計算每一個 方塊與原始資料的像素平均誤差值,第二圖繪出習用 方法的誤差值減去本發明方法得出的誤差值與 AVC/H.264的量化級距關係圖,X轴代表AVC/H.264 的量化級距,Y軸代表兩個方法的差距,Y值為正值 代表本發明方法的誤差小於習用方法所得出的誤差 值0 ⑧ 26 1280804 第二圖之量化級距關係以六個級距為一個循 環,這是因為AVC/H.264的量化級距正是以六為一 個單位,每增加六級,量化值便增加一倍的緣故,其 中,原AVC.H.264規格書中對量化級距為六的倍數 加二(例如:2, 8, 14, ...,50)的設計特別精良,因此, 本發明的方法在這些級距與習用方法效果相當,除此 之外,本發明方法所產生的誤差均小於習用方法所產 生的誤差,即使當量化級距很大時。由此也可證明本 發明方法的優異性。 綜上所述,本發明針對原有「將一個8x8的型式 二離散餘弦轉換方塊分割成四個4x4的型式二離散 餘弦轉換方塊的方法」,提出了 一個通用的後處理程 序,及修正過後的AVC/H.264量化表(quantization table),如此一來,則可以適用於MPEG_2及 AVC/H.264的離散餘弦核心轉換,有效改善習知技術 之缺失,是故具有產業價值,進而達成發展本案之目 的。 本案得由熟悉本技藝之人士任施匠思而為諸般 修飾,然皆不脫如附申請專利範圍所欲保護者。 【圖式簡單說明】 第一圖:其係習用MPEG-2至AVC/H.264轉碼器之架 構圖。 ⑧ 27 1280804 第二圖:其係習用方法的誤差值減去本發明方法得出 的誤差值與AVC/H.264的量化級距關係圖。 【主要元件符號說明】 ll:MPEG-2解碼器 12:AVC/H.264 編碼器 111:可變長度解碼 112:解量化 113:逆向離散餘弦轉換 114:移動補償 115:訊框儲存 221·.離散餘弦轉換 222··量化 223:熵值編碼 224:解量化 225:解離散餘弦轉換 226:訊框儲存 227:移動估算 228:移動補償 229:内訊框預測Man.bmp peppers.bmp sailboat.bmp splash.bmp statue.bmp tiffany.bmp tool.bmp truck.bmp woman.bmp Avg.PSNR 58.918907 58.942010 58.950805 58.971665 62.893145 58.917318 59.075025 58.945206 58.934827 59.356924 55.710583 55.818183 55.769048 55.741820 59.756727 55.746027 55.922533 55.817016 55.799159 56.214547 We consider the quantified results and calculate the error between the method of the present invention and the conventional method and the original image. The quantization step of AVC/H.264 is from 0 to 51. The larger the quantization step, the higher the efficiency of compression, but the larger the image distortion. We randomly extracted 180,000 8x8 squares from the 18 commonly used test images, and performed two different methods of performing the approximate type two discrete cosine transform defined by AVC/H.264 in two methods. The step size is used to calculate the pixel average error value of each block and the original data. The second figure plots the error value of the conventional method minus the error value obtained by the method of the present invention and the quantization step relationship of AVC/H.264, X. The axis represents the quantization step of AVC/H.264, and the Y axis represents the difference between the two methods. The positive value of Y represents that the error of the method of the present invention is smaller than the error value obtained by the conventional method. 0 8 26 1280804 Quantization level of the second figure The distance relationship is a cycle of six steps. This is because the quantization step of AVC/H.264 is exactly one unit of six. For each additional six levels, the quantization value is doubled. Among them, the original AVC. In the H.264 specification, the design of the multiple of the quantization step size plus two (for example, 2, 8, 14, ..., 50) is particularly well-designed. Therefore, the method of the present invention has effect in these steps and the conventional method. Quite, in addition to the methods produced by the method of the invention The difference is less than the conventional method of generating an error, even when the quantization step is large distance. The superiority of the method of the invention can thus also be demonstrated. In summary, the present invention proposes a general post-processing procedure and a modified method for splitting an 8x8 type two-discrete cosine transform block into four 4x4 type two-discrete cosine transform blocks. AVC/H.264 quantization table, so that it can be applied to the discrete cosine core conversion of MPEG_2 and AVC/H.264, effectively improving the lack of conventional technology, so it has industrial value, and then achieves development. The purpose of this case. This case has been modified by people who are familiar with the art, but it is not intended to be protected by the scope of the patent application. [Simple description of the diagram] The first picture: It is a frame composition of the MPEG-2 to AVC/H.264 transcoder. 8 27 1280804 Second figure: The error value of the conventional method is subtracted from the error value obtained by the method of the present invention and the quantization step distance of AVC/H.264. [Main component symbol description] ll: MPEG-2 decoder 12: AVC/H.264 encoder 111: variable length decoding 112: dequantization 113: inverse discrete cosine transform 114: motion compensation 115: frame storage 221. Discrete Cosine Transform 222··Quantization 223: Entropy Value Encoding 224: Dequantization 225: De-Discrete Cosine Transform 226: Frame Storage 227: Motion Estimation 228: Motion Compensation 229: Interframe Prediction

2828

Claims (1)

1280804 日修淺:)正替換頁 十、申請專利範圍: 1· 一種分割型式二離散餘弦 包含·. 接收一影像資料; 對該影像資料進行可變長度解碼與解量化, 生一 8x8型式二離散餘弦轉換方塊;將該8x8型式二離散餘拔赫播仏 雕欣钵弦轉換方塊分割成四個 4x4 5L式一離散餘弦轉換方塊· 對該4x4型式二離散餘弦轉換方塊進行一後處理 程序Α2’ =產生四個4χ4近似型式二離散餘弦轉換方 塊〉其中该後處理程序h可表 、 1 〇 0 ο η ,丁与 轉換方塊之方法,其步 驟 〇 tan(85.93°) 〇 — ι 〇 0 0 1 0 〇 0 1 〇 tan(85.93°) 〇 0 0 〇 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ο o tan(85.93°) 〇 0 0 1 Ο ° 1 〇 tan(85.93°) ;以及 夏化該等4x4近似型式二離散餘弦轉換方塊。 =請專利範圍第!項所述之方法,其中該影像資 料知為一 MPEG_2格式之影像資料。 3·如申請專利範圍第1項所述之方法,其巾量化,亥 等4x4近似型式二離散餘弦轉換方塊 係 下列量化參數: (h j) = lsign^x(^ J)} [(1 y) 14 x a(qm 5 /; j)+f2 )>>(13,0 )Ί f r U洲邓,侧術)丨4χΙυ)+/2叫〇>>((]5 + = ^^W,2 观 29 12808041280804 日修浅:) is replacing page ten, the scope of patent application: 1 · A split type two discrete cosine inclusion · Receive an image data; variable length decoding and dequantization of the image data, generate an 8x8 type two discrete a cosine transform block; the 8x8 type two-discrete residual 拔 仏 仏 钵 钵 钵 转换 转换 转换 分割 分割 分割 分割 分割 分割 分割 分割 分割 分割 分割 分割 分割 分割 分割 分割 分割 分割 ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' = Generate four 4χ4 approximation type two discrete cosine transform squares> The post-processing program h can be table, 1 〇0 ο η, and the method of converting the square, the steps 〇tan(85.93°) 〇— ι 〇0 0 1 0 〇0 1 〇tan(85.93°) 〇0 0 〇0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ο o tan(85.93°) 〇0 0 1 Ο ° 1 〇tan (85.93°); and summer 4x4 approximation type two discrete cosine transform blocks. = The method described in the scope of the patent, wherein the image data is known as an image data in the MPEG_2 format. 3. The method described in claim 1 of the patent scope, the towel quantification, Hai et al. 4x4 approximation type two discrete cosine transform block is the following quantization parameter: (hj) = lsign^x(^ J)} [(1 y) 14 xa(qm 5 /; j)+f2 )>>(13,0 )Ί fr U Chau Deng, side surgery)丨4χΙυ)+/2叫〇>>((]5 + = ^^ W,2 view 29 1280804 for (z·, y·) = (0,0),(0,2),(2,0),(2,2) f〇r(D) = (l,l),(l,3),(3,l),(3,3) for (/, 7) = (1,2), (1,4), (3?2)? (3,4) for (/,7)-(2,1),(0,2), (2,0),(2,2) 13107 44933 905 13108 11916 41725 840 11650 10082 36508 735 10485 9362 32450 654 9118 8192 29208 588 8388For (z·, y·) = (0,0),(0,2),(2,0),(2,2) f〇r(D) = (l,l),(l,3) ,(3,l),(3,3) for (/, 7) = (1,2), (1,4), (3?2)? (3,4) for (/,7)-( 2,1),(0,2), (2,0),(2,2) 13107 44933 905 13108 11916 41725 840 11650 10082 36508 735 10485 9362 32450 654 9118 8192 29208 588 8388 7282 25398 512 7233 4. 如申請專利範圍第3項所述之方法,其中該等量 化參數係由原AVC/H.264規格書所制訂之量化參數 修改而成。 5. —種分割型式二離散餘弦轉換方塊之方法,其步驟 包含: 接收一 MPEG-2格式之影像資料;7282 25398 512 7233 4. The method of claim 3, wherein the quantified parameters are modified from quantitative parameters established by the original AVC/H.264 specification. 5. A method of splitting a type two discrete cosine transform block, the method comprising: receiving an image data in an MPEG-2 format; Μ(βΛ,,〇) M{QMX) m,2) M(Q,n3) M = 對該影像資料進行可變長度解碼與解量化,以產 生一 8x8型式二離散餘弦轉換方塊; 將該8x8型式二離散餘弦轉換方塊分割成四個 4x4型式二離散餘弦轉換方塊; 對該4x4型式二離散餘弦轉換方塊進行一後處理 程序A2,以產生四個4x4近似型式二離散餘弦轉換方 塊,其中該後處理程序A2可表示為 30 12808° 4 1 Ο Ο 量化該等4x4近似型式二離散餘弦轉換方塊。 6·如申請專利範圍第5項所述之方法,其中量化該 等4x4近似型式二離散餘弦轉換方塊之步驟係使用 下列量化參數: for (/, y) = (〇?〇χ(〇?2)? (2,0),(2,2) for(/5y) = (1,1),(1,3), (3,1),(3,3) f〇r(i,/) = (l,2),(l,4)5(3,2),(3,4) f〇r(/?7') = (2,1),(0,2), (2,0),(2,2)Μ(βΛ,,〇) M{QMX) m,2) M(Q,n3) M = variable length decoding and dequantization of the image data to generate an 8x8 type two discrete cosine transform block; The type 2 discrete cosine transform block is divided into four 4x4 type two discrete cosine transform blocks; a post-processing program A2 is performed on the 4x4 type two discrete cosine transform block to generate four 4x4 approximate type two discrete cosine transform blocks, wherein the latter The process A2 can be expressed as 30 12808° 4 1 Ο 量化 Quantify the 4x4 approximation type two discrete cosine transform blocks. 6. The method of claim 5, wherein the step of quantizing the 4x4 approximation type two discrete cosine transform blocks uses the following quantization parameters: for (/, y) = (〇?〇χ(〇?2) )? (2,0),(2,2) for(/5y) = (1,1),(1,3), (3,1),(3,3) f〇r(i,/) = (l,2),(l,4)5(3,2),(3,4) f〇r(/?7') = (2,1),(0,2), (2,0 ), (2, 2) 〇 tan(85.93°)〇 tan (85.93°) ;以及 為 13107 44933 905 13108' 11916 41725 840 11650 10082 36508 735 10485 9362 32450 654 9118 8192 29208 588 8388 — 7282 25398 512 7233 7 ·如申請專利範圍第6項所述之方法,其中該等量 化參數係由原AVC/H.264規格書所制訂之量化參數 修改而成。 8·—種分割型式二離散餘弦轉換方塊之方法,其步驟 31And 13107 44933 905 13108' 11916 41725 840 11650 10082 36508 735 10485 9362 32450 654 9118 8192 29208 588 8388 — 7282 25398 512 7233 7 The method of claim 6 wherein the quantitative parameters are The quantitative parameters developed by the original AVC/H.264 specification were modified. 8·- a method for dividing a type two discrete cosine transform block, the step 31 1280804 包含: 接收一 MPEG_2格式之影像資料; 對該影像資料進行可變長度解碼與解量化,p 生一 8x8型式二離散餘弦轉換方塊; 里’以產 ㈣_㈣二離散餘弦轉換方塊分割成 4x4型式二離散餘弦轉換方塊; 對該4x4型式二離散餘弦轉換方塊進行一後處理 程序Α2,以產生四個㈣近似型式二離散餘弦轉^方 塊,其中該後處理程序Α2可表示為、 0 Π Α ^ . 0 Λ 0 tan(85.93°) 0 一 ι 〇 〇 0 1 〇 〇 0 1 〇 tan(85.93°) 〇 〇 〇 〇 〇 1 〇 0 0 〇 〇 Ο Ο 〇 〇 Ο Ο 〇 Ο 〇 〇 Ο 〇 〇 Ο Ο ο ο 1 ο Ο Ο ο tan(85.93°) 〇 — ι 〇 〇 1 Ο 0 1 Ο tan(85.93°) ;以及 使用下列量化參數來量化該等4χ4近似型式二離 散餘弦轉換方塊 j) = \sign^x^ I 4x a(Qm 5 h j) + /213+Qe )»(l3-l·QE )], for (/, j) = {(1,2), (1,4), (3,2),(3,4)} (/,7)}[(1 ^(/, y) I 4X A(Qm , /, j) + f2^) »(15 + ^)],Otherwise '灣m,〇) M{QmX) ' m(qm a) 、灣 m,3) for (/5y) = (〇?〇)?(〇52)? (2,0), (2,2) for (/,7) = (1,1), (1,3),(3,1), (3,3) f〇r(U) = (l,2),(l,4),(3,2),(3,4) for (/, y) = (2?l)? (0,2),(2,0), (2,2) 32 1280804 Μ 13107 44933 905 13108 11916 41725 840 11650 10082 36508 735 10485 9362 32450 654 9118 8192 29208 588 8388 7282 25398 512 7233 9·如申請專利範圍第8項所述之方法,其中該等量 化參數係由原AVC/H.264規格書所制訂之量化參數 修改而成。1280804 includes: receiving an image data of an MPEG_2 format; performing variable length decoding and dequantization on the image data, and generating an 8x8 type two discrete cosine transform block; and dividing the product into a 4x4 type by a (four)_(four) two discrete cosine transform block. a discrete cosine transform block; performing a post-processing procedure Α2 on the 4x4 type two-discrete cosine transform block to generate four (four) approximation type two discrete cosine transform blocks, wherein the post-processing program Α2 can be expressed as 0 Π Α ^ . 0 Λ 0 tan(85.93°) 0 一ι 〇〇0 1 〇〇0 1 〇tan(85.93°) 〇〇〇〇〇1 〇0 0 〇〇Ο Ο 〇〇Ο Ο 〇Ο 〇〇Ο 〇〇Ο ο ο ο 1 ο Ο Ο ο tan(85.93°) 〇— ι 〇〇1 Ο 0 1 Ο tan(85.93°) ; and use the following quantization parameters to quantify the 4 χ 4 approximation type two discrete cosine transform blocks j) = \ Sign^x^ I 4x a(Qm 5 hj) + /213+Qe )»(l3-l·QE )], for (/, j) = {(1,2), (1,4), (3 ,2),(3,4)} (/,7)}[(1 ^(/, y) I 4X A(Qm , /, j) + f2^) »(15 + ^)],Otherwise 'Bay m,〇) M{QmX) ' m(qm a) , bay m,3) f Or (/5y) = (〇?〇)?(〇52)? (2,0), (2,2) for (/,7) = (1,1), (1,3),(3, 1), (3,3) f〇r(U) = (l,2),(l,4),(3,2),(3,4) for (/, y) = (2?l) ? (0,2),(2,0), (2,2) 32 1280804 Μ 13107 44933 905 13108 11916 41725 840 11650 10082 36508 735 10485 9362 32450 654 9118 8192 29208 588 8388 7282 25398 512 7233 9·If you apply for a patent The method of clause 8, wherein the quantized parameters are modified from quantization parameters defined by the original AVC/H.264 specification. 3333
TW94133402A 2005-09-26 2005-09-26 Method for splitting 8x8 DCT into four 4x4 modified DCTS used in AVC/H. 264 TWI280804B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW94133402A TWI280804B (en) 2005-09-26 2005-09-26 Method for splitting 8x8 DCT into four 4x4 modified DCTS used in AVC/H. 264

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW94133402A TWI280804B (en) 2005-09-26 2005-09-26 Method for splitting 8x8 DCT into four 4x4 modified DCTS used in AVC/H. 264

Publications (2)

Publication Number Publication Date
TW200714076A TW200714076A (en) 2007-04-01
TWI280804B true TWI280804B (en) 2007-05-01

Family

ID=38742604

Family Applications (1)

Application Number Title Priority Date Filing Date
TW94133402A TWI280804B (en) 2005-09-26 2005-09-26 Method for splitting 8x8 DCT into four 4x4 modified DCTS used in AVC/H. 264

Country Status (1)

Country Link
TW (1) TWI280804B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102098502A (en) * 2009-12-14 2011-06-15 无锡中星微电子有限公司 Method and device for converting coding formats
US9069713B2 (en) 2009-06-05 2015-06-30 Qualcomm Incorporated 4X4 transform for media coding

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9110849B2 (en) 2009-04-15 2015-08-18 Qualcomm Incorporated Computing even-sized discrete cosine transforms
US8762441B2 (en) 2009-06-05 2014-06-24 Qualcomm Incorporated 4X4 transform for media coding
US8451904B2 (en) 2009-06-24 2013-05-28 Qualcomm Incorporated 8-point transform for media data coding
US9081733B2 (en) 2009-06-24 2015-07-14 Qualcomm Incorporated 16-point transform for media data coding
US9118898B2 (en) 2009-06-24 2015-08-25 Qualcomm Incorporated 8-point transform for media data coding
US9075757B2 (en) 2009-06-24 2015-07-07 Qualcomm Incorporated 16-point transform for media data coding
US9824066B2 (en) 2011-01-10 2017-11-21 Qualcomm Incorporated 32-point transform for media data coding

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9069713B2 (en) 2009-06-05 2015-06-30 Qualcomm Incorporated 4X4 transform for media coding
CN102098502A (en) * 2009-12-14 2011-06-15 无锡中星微电子有限公司 Method and device for converting coding formats
CN102098502B (en) * 2009-12-14 2015-06-03 无锡中星微电子有限公司 Method and device for converting coding formats

Also Published As

Publication number Publication date
TW200714076A (en) 2007-04-01

Similar Documents

Publication Publication Date Title
TWI280804B (en) Method for splitting 8x8 DCT into four 4x4 modified DCTS used in AVC/H. 264
JP5797774B2 (en) 32-point conversion for media data coding
TWI382767B (en) Reduction of errors during computation of inverse discrete cosine transform
JP2020141416A (en) Method for decoding hybrid upward compatible data stream
CA2665243C (en) Signalling of maximum dynamic range of inverse discrete cosine transform
JP2008501250A (en) Method for transcoding input video based on a first conversion kernel to output video based on a second conversion kernel, and transcoder for converting input video having an input format to output video having an output format
JPH1175186A (en) Scaled forward and backward discrete cosine transform and video compression and expansion system using the conversion
TW201108743A (en) 4x4 transform for media coding
JP2013502625A (en) 16 point conversion for media data coding
JP2008306711A (en) Efficient encoding/decoding of sequence of data frames
CN105474642A (en) Re-encoding image sets using frequency-domain differences
JP2013502626A (en) 16 point conversion for media data coding
WO2023040600A1 (en) Image encoding method and apparatus, image decoding method and apparatus, electronic device, and medium
RU2419855C2 (en) Reducing errors when calculating inverse discrete cosine transform
JP7342261B2 (en) Method, apparatus and computer program for decoding an encoded video bitstream
US20110110435A1 (en) Multi-standard video decoding system
Zheng et al. Research in a fast DCT algorithm based on JPEG
WO2023011005A1 (en) Image processing method and apparatus, electronic device, and storage medium
Jridi et al. Low complexity DCT engine for image and video compression
CN109756735A (en) Method and device for video playing
KR20140014722A (en) Decoding apparatus for performing inverse quantiation \and inverse transform in h.264/avc decoder and decoding method using decoding apparatus
CN100477791C (en) Method for transmitting dynamic pictures in mobile communication terminal
TWI573440B (en) Advanced video coding and decoding chip and advanced video coding and decoding method
JP2004289290A (en) Image processing apparatus
JP6013964B2 (en) Image encoding method, image decoding method, image encoding device, image decoding device, program thereof, and recording medium