201015875 »i * vu-vv J5 27484twf.doc/n 九、發明說明: 【發明所屬之技術領域】 本發明疋有關於-種解碼裝置,且特別是有關於一種 以組合代碼以同時解碼多個基本符號(s〇_ 碼裝置。 【先前技術】 隧著數位多媒體資料的大量使用以及利用網路分享 數位多媒體資料已經蔚為風潮,因此多媒體資料的壓縮盘 解碼技術變的相當重要。而有許多的影像標準是為了不^ 的目的而建立,例如MPEG用於多媒體,H 263用於視訊 會議,在將影片等影像資料儲存於各種儲存媒體時,為了 月b夠節省所佔用之儲存空間,通常都會應用如 (Motioti Picture Expert Group ’ 簡稱 MPEG)等之影像壓縮 標準,來壓縮原始影像資料,MPEG之壓縮比一般由8倍 到40倍不等。 口 φ 而這些標準的編解碼技術都會應用到離散餘弦轉換 (discrete cosine transform, DCT)、運動補償(moti〇n compensation,MC)、量化(quantization)以及可變長度解碼 (variable length decode,VLD)等。其中可變長度解碼是對資 料串流中取出的字碼(codeword)做查表的動作,以解出 此字碼所代表的係數(DC/AC coefficients)。 在進行編解碼時,最常使用的編碼方式是哈夫曼編碼 (Huffinan Coding),以哈夫曼樹(即最優二元樹(binaiy tree)), 201015875 'AJL ^ 27484twf.doc/n 也就是加權路徑長度最小的二元樹來進行數據壓縮。「哈夫曼 編碼」又稱”熵編碼法"(entropy coding),在進行資料編碼時會 使用一張特殊的編碼表(查找表)對基本符號(s〇urce symb〇1) (例如某文件中的一個符號、字元或數字)進行編碼。這張編 碼表疋根據母一個基本付號出現的估算機率而建立起來的,盆 中出現機率尚的字元使用較短的編碼,反之出現機率低的則使 用較長的編碼,這便使編碼之後的位元串的平均期望長度降 低’並達到無損壓縮數據的目的。 在可變長度解碼器(variable length decoder)進行解碼 時’則反向根據查找表解碼所輸入的資料位元流 (bitstream,BS),查找表中會包括符號(symb〇1)與代碼 (code),如圖1所示,圖1為根據習知技術之查找表。其 中查找表100所包括的[符说]以a、b、c、d為例,其對應 的[代碼]分別為0、10、110、111。若資料位元流為 [00000010100010110111],可變長度解碼器會根據資料位 元流的字碼(codeword)順序依序比對查找表1〇〇的代碼以 ❹ 解碼出相對的符號。經解碼後,[000000101000101101 所對應的符號串流(symbol stream)則為[aaaaaabbaabcd],其 解碼所需的時間總共為13週期,儲存查找表100的代碼所 需的大小為12位元(最長位元的符號d所對應的代碼為3 位元’共計4個符號)。 【發明内容】 本發明提供一種解碼裝置,適用於可變長度解碼,其 201015875 9 wJ5 27484twfdoc/n 中用以解碼的查找表具有基本代碼與組合代碼, 元長度限制來選取所需的組合代碼,不僅 需的記憶體空間,更可有效降低解碼所需的時^了找表所 所Π月?供一種解碼方法,利用位元長度_來選取 =:::度除可節省查找表所需的記憶體空間外, ❹ 承上述’本發明提出一種用以解碼一資料位 =置於包括一輸入端口,一解碼單元以及一輪出:口解 二二輸入端口用以接收一資料位元流,上述資料位元流 ;解碼單元具有—查找表,並根據上述查找 上述資料位元流以產生對應的符輸, 碼以及多個組合代碼,基本代 ’ 1*應於基本付遽,組合代碼對應於組 :合r包括兩個以上的基本代碼合併後長度小;= n有組合。輸出端明用以輸出所解碼 的順實施例中’上述解碼單元更根據上述代碼 號串流7 ‘。之上述基本赠或上述組合符號以組成符 在本發明一實施例中,其中若基本符號 二代碼的個數為2;若基本符號為數 么數基本符號為英文字母,則基本 π 基本付唬代表數字、字母、符號或位元 201015875 “ *----J5 27484twf.doc/n 串’而代碼與組合代碼的形式為二進位。 在本發明一實施例中,上述解碼單元包括一可變長度 解碼器,根據上述查找表解碼所接收的上述資料位元 產生對應的符號串流,其中上述資料位元流是可變長度編 碼格式。 Ο ❹ 本發明另提出一種用以解碼一資料位元流的解碼方 法,包括下列步驟:接收一包含多個代碼的資料位元产. 根據二查找表解碼上述資料位元流以產生—符號位元= 上述符號位it流包含龍於上述代碼的乡_號;以及輸 ,上述符號位元流;其中上述查找表包含多個基本代碼和 夕個組合代碼所對應的多個基本符號和多個組合符號,上 述組合代碼包含至少兩絲本代碼組成的長度小於等於N =所有組合’ N為正整數且A於或等於上縣本代碼中最 ^基本代碼的位元數。此解碼方法的其餘操作細節 印 > 照上述解碼裝置的說明,在此不再贅述。 從另-個角度來看,本發明另提出一種用以解碼一資 2元流的解碼方法,包括下列步驟:首先,根據多個基 本代碼組成產生長度小於或等於關多個組合代碼,n為201015875 »i * vu-vv J5 27484twf.doc/n IX. Description of the Invention: [Technical Field] The present invention relates to a decoding apparatus, and in particular to a combination of codes for simultaneously decoding a plurality of basics Symbol (s〇_code device. [Prior Art] The massive use of digital multimedia data and the sharing of digital multimedia data through the Internet have become a trend, so the compression disk decoding technology of multimedia data has become quite important. Image standards are established for the purpose of not being used. For example, MPEG is used for multimedia, and H 263 is used for video conferencing. When storing video data such as movies in various storage media, it is usually necessary to save the storage space occupied by the monthly b. The image compression standard such as (Motioti Picture Expert Group ' MPEG for short) is used to compress the original image data. The compression ratio of MPEG generally ranges from 8 times to 40 times. Port φ and these standard codec technologies are applied to discrete Discrete cosine transform (DCT), motion compensation (moti〇n compensation, MC), quantization (quantization) And variable length decoding (VLD), etc. wherein the variable length decoding is a table lookup of the codeword extracted in the data stream to solve the coefficient represented by the code (DC/AC) Coefficients. When coding and decoding, the most commonly used encoding method is Huffinan Coding, which is a Huffman tree (ie, the optimal binaiy tree), 201015875 'AJL ^ 27484twf.doc/ n is the binary tree with the smallest weighted path length for data compression. "Huffman coding" is also called "entropy coding", which uses a special coding table when searching for data. Table) encodes the basic symbol (s〇urce symb〇1) (such as a symbol, character, or number in a file). This code table is established based on the estimated probability of a parent's basic payment. Characters with a high probability in the basin use a shorter encoding, whereas those with a lower probability use a longer encoding, which reduces the average expected length of the encoded string after the encoding and achieves the purpose of lossless compression. When decoding is performed by a variable length decoder, the input bit stream (BS) is decoded in the reverse direction according to the lookup table. The lookup table includes symbols (symb〇1) and code (code). As shown in FIG. 1, FIG. 1 is a lookup table according to the prior art. The [characteristics] included in the lookup table 100 is a, b, c, and d, and the corresponding [codes] are 0, 10, 110, and 111, respectively. If the data bit stream is [00000010100010110111], the variable length decoder will sequentially compare the code of the table 1〇〇 according to the codeword sequence of the data bit stream to decode the relative symbols. After decoding, the symbol stream corresponding to [000000101000101101 is [aaaaaabbaabcd], the time required for decoding is 13 cycles in total, and the size required to store the code of the lookup table 100 is 12 bits (the longest bit) The code corresponding to the symbol d of the element is 3 bits 'total 4 symbols'). SUMMARY OF THE INVENTION The present invention provides a decoding apparatus suitable for variable length decoding. The lookup table used for decoding in 201015875 9 wJ5 27484twfdoc/n has a basic code and a combination code, and a meta length limit is selected to select a required combination code. Not only the memory space required, but also can effectively reduce the time required for decoding. For a decoding method, use the bit length _ to select =::: degree to save the lookup table. In addition to the memory space, the present invention proposes a method for decoding a data bit = placed on an input port, a decoding unit, and a round-out: two-input port for receiving a data bit stream, a data bit stream; the decoding unit has a lookup table, and searches for the data bit stream according to the above to generate a corresponding symbol, code, and a plurality of combined codes, the basic generation '1* should be based on the basic payment, and the combination code corresponds to Group: The combination of r and more than two basic codes is small in length; = n has a combination. The output is operative to output the decoded embodiment in the above-described decoding unit, further based on the above-described code number stream 7 '. The above basic gift or the above combination symbol is a component in the embodiment of the present invention, wherein if the number of basic symbol two codes is 2; if the basic symbol is a number, the basic symbol is an English letter, then the basic π basic representation Numbers, letters, symbols or bits 201015875 "*----J5 27484twf.doc/n string' and the code and combination code are in the form of binary. In an embodiment of the invention, the decoding unit comprises a variable length The decoder generates a corresponding symbol stream according to the above-mentioned lookup table decoding the received data bit, wherein the data bit stream is a variable length coding format. Ο ❹ The present invention further provides a method for decoding a data bit stream. The decoding method comprises the steps of: receiving a data bit product containing a plurality of codes. Decoding the data bit stream according to the second lookup table to generate a symbol bit = the above sign bit stream contains a dragon in the code _ And the input symbol bit stream; wherein the lookup table includes a plurality of basic symbols and a plurality of combination symbols corresponding to the plurality of basic codes and the evening combination code The combination code includes at least two lines of code whose length is less than or equal to N = all combinations 'N is a positive integer and A is equal to or equal to the number of bits of the most basic code in the upper code. The remaining operation details of this decoding method Printing > According to the description of the above decoding apparatus, it will not be described here. From another point of view, the present invention further provides a decoding method for decoding a 2-ary stream, comprising the following steps: First, according to a plurality of The basic code composition produces a length less than or equal to the closed combination code, n is
Si二St述基本代碼和上述組合代碼產生對應的多 ,基本付號和多個組合符號;接收—包含多個位元的資料 位疋Γ,根據上述基本代媽和上述組合代碼分割上述資料 的上述位福最大長度的組合;依序查找上述位元 以L割=對應於上述基本符號和上述組合符號的一者; 及組δ上述分聽合對應的上述基本賴和上述組合符 的 27484twf.doc/n 201015875 .流。其中n大於 :碼方法的其餘操作細節請參照‘解: .說η=:其餘操作細節請參^ :£F:二 =符 ° =:力效。在解碼流程方面,由於:明== 夕個=,因此可減少解石馬所需的運算次數以及時L出 ^本發明之上述特徵和優點能更明顯易懂,下 牛較佳實關,並配合所關式,作詳細朗如下。、 【實施方式】 不用=發然::適下:::配合圖示來閣述說明,但並 ❹ 第一實施你丨 «月參照圖2 ’圖2為根據本發明第一實施例之 資料解碼裝置圖。解碼裝置綱包括解碼單元 變 長度解碼器2H)與查找表215戶斤組成)、反量化模組㈣⑽ =^t1Zatlon)220以及反離散餘弦轉換模組(^沉此 3〇其中反畺化模組220轉接於可變長度解碼器210 ”反離散餘弦轉換模組230之間,查找表215耗接於可變 長度解碼器21〇。在本實施例中,查找表215可儲存於記 8 J5 27484twf.doc/n 201015875 隐元件中例如丨夬閃5己憶體(flash memory)、快取記悚體 (Cache Memory)、唯讀記憶體 或隨機處耽憶離andGm A職MemGry,RAM)或硬碟 (Hard Disk, HD)等泛指可儲存資料之媒體。 —可變長度解碼If UG經由輸人端σ(未繪*)接收資料 位元流BS,並根據查找表215將其解碼為數值列(符號串 流)’經由輸it{端π(未料)獅以進行反量化以及反離散 餘旋轉換等運算。其中,可變長度解碼器210與查找表215 可視為一個可變長度解碼裝置,根據查找表215内的符號 ,代碼的對應隱,將可變長度㈣(㈣位元流)解碼為 付號串流。 接下來’進-步說明查找纟215的符號與代碼的對應 2。請同時參照圖1朗3,目3為根據本實施例之查 找表212的列表’其中基本符號(s〇職啊㈣與圖ι相 二二,e ' d為例說明’所謂基本符號即表示原始資 基本字元或符號。舉例來說,若原始資料為二進位 ^料,則基本符號有兩種,分別為i與〇 ;若原始資料 =英文字母所組成,則基本符號有26個字母。其餘基本. ’逗點等也可算是基本符號的-種,本技 者在經由本發明之減後射輕易推知其餘 唬,在此不加累述。 τ 有美包括原始資料中的所 =施例中僅以a、b、c、d為例)以及由基本 I成的、、且5符號’如aaa、aa、ab、ba。對應於基本符 9 201015875乃 27484twf.doc/n 號的代碼稱為基本代碼(即〇、10、110、1U),而對應於組 • 合符號的代碼稱為組合代碼(即〇〇〇、〇〇、1〇1、100),所有 符號與代碼之間的對應關係則請參照圖3。 組合代碼疋由基本代碼組合的位元串所形成,以基本 符號[a]為例,其對應的基本代碼為[〇],因此對應於組合符 號[aaa]的組合代碼即為[〇〇〇],即是由3個基本代碼[〇]組合 而成的位元串’其餘組合代碼則依此類推。此外,在本實 施例中,組合代碼的選取是依照其位元長度來決定。首先, 組合代碼的長度限制必須大於等於最長基本代碼(即丨i 1) 的位元數,也就是3位元。圖3即是以3位元為長度限制 來選取對應的組合代碼,圖3列出所有基本代碼以及所有 長度小於等於3位元的組合代碼。經比對後,組合符號 aaa、aa、ab、ba所對應的組合代碼的長度小於等於3位元, 因此一併列入查找表215中。 換句話說,對應於基本符號的代碼可組成多個位元 串,而組合代碼則包括所有長度小於或等於N位元之該些 參 位元串’ N為正整數,也就是說組合代石馬包括兩個以上的The Si second St basic code and the above combined code generate corresponding multiple, basic paying numbers and multiple combined symbols; receiving - a data bit containing a plurality of bits, and dividing the above data according to the above basic generation mother and the above combined code a combination of the maximum lengths of the above-mentioned bits; sequentially searching for the above-mentioned bits to be L-cut = one corresponding to the above-mentioned basic symbols and the above-mentioned combination symbols; and the group δ corresponding to the above-mentioned basic conjugates and 27484 twf of the above-mentioned combination. Doc/n 201015875 . Stream. Where n is greater than: The rest of the operation of the code method, please refer to ‘solution: . η=: For the rest of the operation details, please refer to ^: £F: two = symbol ° =: force effect. In the decoding process, since: == 夕 =, so the number of operations required to solve the stone is reduced, and the above features and advantages of the present invention can be more clearly understood, and the lower cow is better. And with the closed type, make a detailed description as follows. [Embodiment] No = sth:: appropriate::: with the illustration to illustrate, but also the first implementation of your 丨 «月 reference to Figure 2 ' Figure 2 is the first embodiment of the present invention according to the information Decoding device diagram. The decoding device includes a decoding unit variable length decoder 2H) and a lookup table 215, an inverse quantization module (4) (10) = ^t1Zatlon) 220, and an inverse discrete cosine conversion module (^ Shen 3) The switch 220 is switched between the variable length decoder 210 and the inverse discrete cosine transform module 230. The lookup table 215 is consumed by the variable length decoder 21. In this embodiment, the lookup table 215 can be stored in the record J J5. 27484twf.doc/n 201015875 In the hidden component, for example, flash memory, cache memory, read-only memory or random memory, and Gm A job MemGry, RAM) or Hard Disk (HD), etc. generally refers to media that can store data. - Variable length decoding If UG receives the data bit stream BS via the input terminal σ (not drawn *) and decodes it according to the lookup table 215 The numerical column (symbol stream) 'transforms via the input { end π (unexpected) lion for inverse quantization and inverse discrete rotation, etc., wherein the variable length decoder 210 and the lookup table 215 can be regarded as one variable length. The decoding device, according to the symbol in the lookup table 215, the corresponding concealment of the code will be variable length (4) ((4) bit stream) is decoded into a token stream. Next, the description of the symbol of the search 纟 215 and the code 2 is described in the following step. Please refer to FIG. 1 for the same, and the object 3 is the lookup table according to the present embodiment. The list of 212 'where the basic symbols (s 〇 啊 ( 四 四 四 四 四 四 四 四 四 四 , , , , , , e e e e e e e e e e e e e e e e e e e e e e e e e e e ^ material, there are two basic symbols, respectively, i and 〇; if the original data = English letters, the basic symbol has 26 letters. The rest of the basic. 'Comic points can also be regarded as the basic symbol - this, this The technician can easily infer the remaining defects through the subtraction of the present invention, and does not add to the description here. τ has the beauty including the original data, the example only uses a, b, c, d as an example) and I is the same as the 5 symbol ', such as aaa, aa, ab, ba. The code corresponding to the basic symbol 9 201015875 or 27484twf.doc / n is called the basic code (ie 〇, 10, 110, 1U), and corresponds to The code for the group • symbol is called the combination code (ie 〇〇〇, 〇〇, 1〇 1, 100), all symbols and For the correspondence between codes, please refer to Fig. 3. The combined code is formed by a string of basic code combinations, taking the basic symbol [a] as an example, and the corresponding basic code is [〇], thus corresponding to the combined symbol The combination code of [aaa] is [〇〇〇], that is, the bit string composed of 3 basic codes [〇], and the rest of the combination code is deduced by analogy. Further, in this embodiment, the combination code The choice is based on the length of its bit. First, the length limit of the combined code must be greater than or equal to the number of bits of the longest base code (ie 丨i 1), which is 3 bits. Figure 3 shows the corresponding combination code with a 3-bit length limit. Figure 3 lists all the basic codes and all combinations of lengths less than or equal to 3 bits. After the comparison, the combined code corresponding to the combination symbols aaa, aa, ab, and ba has a length of less than or equal to 3 bits, and is therefore included in the lookup table 215. In other words, the code corresponding to the basic symbol may constitute a plurality of bit strings, and the combined code includes all the bit strings 'N whose length is less than or equal to N bits, and N is a positive integer, that is, a combination generation stone Horses include more than two
基本代碼合併後長度小於等於!^位元的所有組合,其中N 的數值可依照设s十需求而定,N值越大,查找表内的組合 代碼越多’其解碼的速度越快,但查找表所需的記憶空間 越大。在本實施例中,僅以N等於3為例說明,但n並不 限定於3〇 解碼的流程請參照圖4,圖4為根據本實施例之資料 位兀流解碼示意圖。其中,資料位元流為 201015875^ 27484twf.doc/n __1__咖叫,在獅Ti巾 中的代碼比較可解碼出符號[aaa];在週[] i在1=;°[则3中的代碼比較可解碼出符號 ’週』4中,貝料位凡[刚]與圖3中的代碼比較可 號_;在週期T5中,資料位元_则”的The length of the basic code after merging is less than or equal! ^All combinations of bits, where the value of N can be set according to the requirement of s ten. The larger the value of N, the more combination code in the lookup table, the faster the decoding speed, but the more memory space required for the lookup table Big. In the present embodiment, only N is equal to 3 as an example, but n is not limited to 3〇. For the decoding process, please refer to FIG. 4. FIG. 4 is a schematic diagram of data bit stream decoding according to the embodiment. Among them, the data bit stream is 201015875^ 27484twf.doc/n __1__ coffee bar, the code in the lion Ti towel can be decoded out of the symbol [aaa]; in the week [] i in 1 =; ° [the 3 The code comparison can decode the symbol 'week' 4, the shell material level [just] can be compared with the code in Figure 3 can be number _; in the period T5, the data bit _ then"
出符綱;在週期Τ6中,資料位元_ 圖—3中的代碼比較可解碼出符號[c];在週期丁7中 才Μ立元[111]與圖3中的代碼比較可解碼出符號⑷。、 被解D中的資料位元[叫僅有[1〇] ,解馬為符綱’其最後一個資料位元⑴尚未解碼到因 ^納入週期T4巾,賴進行輯與解碼。在進行資料位 til割時’會依據組成資料位元流的代碼數目為最小 =來進行分割。例如,圖4中的資料位元流的前6個In the period Τ6, the code comparison in the data bit _Fig. 3 can decode the symbol [c]; in the period 丁7, the Μ立元 [111] can be decoded compared with the code in Fig. 3 Symbol (4). The data bit in the solution D is called [only [1〇], and the solution is the symbol]. The last data bit (1) has not been decoded until it is included in the cycle T4. When the data bit is cut, the segmentation is performed according to the minimum number of codes constituting the data bit stream. For example, the first 6 data bit streams in Figure 4
個“:,此會將其分割為兩個“麵”以對應於兩 =組口料aaa,而不會將其分割為6個“〇,,的組 二=:最:割資料位元流時會使得組成資料位元流的 =此,利用本實施例之查找表215,可變長度解碼器 可於7個週期内完成解碼以輸出對應的符號 [a:aaabbaabcd]。相較於習知技術的查找表(請參照圖^, ^施例所需的解碼時間由13週期減少為7個週期,而杳 找表212中代碼所需的記憶體㈣僅由12位元提 ^ 位兀(4個基本代碼加4他合代碼,每個代碼所需的儲存 11 27484twf.doc/n 201015875 U3 二間為3位凡)。因此,本實施例僅需小幅提升查找表的大 .小,即可大幅降低解碼所需的時間。 J二實全社 在本發明另一實施例中,查找表的代碼長度限制可以 調整為4位元(N等於4),其查找表的組成請參照圖5,圖 5為根據本發明第二實施例之查找表。查找表·中包括 所有基本代碼以及所有長度小於等於4位元的組合代碼。 f巾,基本代碼職於所㈣本符號,_有組合代碼則 疋由,個或兩個以上的基本代碼所組合而成,對應於多個 組合符號,如圖4所示。關於組合代碼的選取,可根據基 本代碼的長度來選擇組合的方式,例如組合!位元與3位 兀長度的基本代碼或者2位元與2位元長度的基本代碼, 或者1位元與2位元長度的基本代碼,其餘類推。只要基 f代碼纽合後的位元㈣長度小於等於4位元皆屬於本實 施例之Μ合代碼的範嘴。組合代碼可有相同的基本代碼或 不同的基本代碼組合而成,本實施例並不受限,只要組合 ❹ 代碼的長度小於等於所設定的Ν位元即可。 、口 利用圖5的查找表來進行解碼的流程請參照圖6,圖 6為才艮據本發明第二實施例之資料位元流解碼示意圖。其 中,=料位元流為[0000001〇1〇〇〇1〇11〇111],在週期 τ6ι 甲貝料位7〇陶0]與® 5巾的代碼比較可解碼出符號 纖ί在週期T62中,資料位元[〇_與圖5中的代碼比 ^可出符號[aab];在週期Τ63巾,資料位元與 的代碼比較可解碼出符號[baa];在週期Τ64中,資 12 201015875 ,“一 —J5 27484twf.doc/n 碎位元_1]與圖5中的代碼比較可解碼 期撕中,資料位元[剛與圖5中的代碼比較可】解= ^號⑽在週期T66中,資料位元⑴與圖5中的代竭出 較可解碼出符號[c]。 ,匕":, this will split it into two "faces" to correspond to the two = group of materials aaa, and will not be divided into six "〇,, group two =: most: cut data bit stream When the data of the data bit stream is formed, the variable length decoder can complete the decoding in 7 cycles to output the corresponding symbol [a:aaabbaabcd]. Compared with the look-up table of the prior art (please refer to FIG. 2, the decoding time required for the embodiment is reduced from 13 cycles to 7 cycles, and the memory required for the code in the look-up table 212 (four) is only 12 bits. ^ 兀 (4 basic code plus 4 other code, each code required storage 11 27484twf.doc / n 201015875 U3 two rooms are 3). Therefore, this embodiment only needs to slightly increase the lookup table Large and small, the time required for decoding can be greatly reduced. In another embodiment of the present invention, the code length limit of the lookup table can be adjusted to 4 bits (N is equal to 4), and the composition of the lookup table is Please refer to Fig. 5. Fig. 5 is a lookup table according to a second embodiment of the present invention. The lookup table includes all basic codes and all combinations of codes having a length of 4 or less. f towel, basic code is used in (4) the symbol , _ has a combination code is composed of one or more basic codes, corresponding to a plurality of combination symbols, as shown in Figure 4. Regarding the selection of the combination code, the combination can be selected according to the length of the basic code Ways such as combination! Bits with 3 digits length The basic code or the basic code of 2-bit and 2-bit length, or the basic code of 1-bit and 2-bit length, and the like. As long as the length of the base (f) after the base-f code is less than or equal to 4 bits The combination code of the combination code of the embodiment may have the same basic code or different basic code combinations, and the embodiment is not limited, as long as the length of the combination code is less than or equal to the set position. Please refer to FIG. 6 for the flow of decoding using the lookup table of FIG. 5, and FIG. 6 is a schematic diagram of data bit stream decoding according to the second embodiment of the present invention. [0000001〇1〇〇〇1〇11〇111], in the period τ6ι 甲贝料7〇陶0] and the о 5 towel code can decode the symbol fiber ί in the period T62, the data bit [〇_ Compared with the code in Fig. 5, the symbol [aab] can be obtained; in the period Τ63, the data bit is compared with the code to decode the symbol [baa]; in the period Τ64, the capital 12 201015875, "一—J5 27484twf. Doc/n broken bit _1] compared with the code in Figure 5 can be decoded during the tearing, data bit [Compared with the code in Fig. 5] Solution = ^ number (10) In the period T66, the data bit (1) is more decodable than the generation in Fig. 5 [c].
查找表5〇〇中代碼所需的記憶體空間為68位元 其解碼的時間可縮短為6個週期,因此相較於習知技術^ f發明僅S小幅提升麵表的大]、便可有效提升解碼的 又。關於本實施例之其餘細節請參照上述第 明,在此不加累述。 此外,值得注意的是,在本實施例中,資料位元流 bs的字碼(codeword)可代表多數個變動值/級值ς (mn-length c〇de) ’其個別表示形式為(,levd),其中變動 值’’run”便是指在轉_散餘轉換絲讀連續零的個 數;而級值’’level”則是非零的係數值,據此可算出此字碼所 代表的DC或AC係數之絕對值。查找表212則儲存代崎與 符號的對應關係,代碼可對應於資料位元流Bs的字碼順 序,而符號則對應於變動級值的數值。此外,值得注意的是, 本實施例所述之資料位元流BS並不限定於多媒體資^料疋只 要是經可變長度編碼後之資料皆可。 在設定查找表的代碼長度限制方面,只要大於基本代 碼L對應於基本符號)的最大長度即可,例如當基本代碼中 的最長基本代碼的長度為3位元時,使用者可選擇3位元 以上的長度(如3位元、4位元或5位元)來挑選符合長度的 組合代碼以形成查找表。所設定的代碼長度愈長,符合的 13 201015875 ' *-----)5 27484twf.doc/n 組合代碼轉乡,其麵表所 碼所需的時間愈短。設計人員昭心二間愈大,但解 定適合最長代碼長度。此=解瑪需求,設 元長度限制的組合代碼時,仍=找出所有符合位 碼(例如原始文件中使用機率較低^二,除部分組合代 低查找表的大小。本發合代碼)以進一步降 例,使用者可依照自身需求進^調整'不限制於上述實施 综合上述第一實施例蛊篦- 歸納出-£ 明’本發明可 m料方㈣简喝—資料 先接I,,明第三實施例之解碼方法流Si 根據-杳找i:二=碼的資料位元流(步驟s7i〇),然後 位元流;ίίΓ 流以產生一符號位元流,符號 石民—Γ匕3應於上述代碼的多個符號(步驟s72〇)。在解 馬元成後,輸出符號位元流(步驟S730)。 和夕得注意岐,上述查找表中包含多個基本代碼 =個〜代騎對應的多個基本符號和多健合符號, 述組合代碼包含至少兩個基本代碼組成的長度小於等於 =所有組合’其中,N為正整數且大於或等於基本代碼 最長之基本代碼的位元數。關於查找表的組成以及解碼 法的操作細節請參照上述第一實施例與第二實施例的說 明’在此不再贅述。 從另一個角度來看,本發明提出一種解碼方法,請參 14 201015875 vixw〇-wv)5 27484twf.doc/n ❹ 照圖8, ® 8為根據本發明第四實_之解碼方法流程圖。 1·先,根據翅基本代碼組成產生長度小於鱗於N的多 個組合代碼’ N為正整數(步驟s⑽);然後,根據上述基 本代碼和組合代碼產生對應Μ個基本符號和多個組合符 號(步驟S820)。接下來,接收一包含多個位元的資料位元 流(步驟SMO),然:後根據上述基本代碼和上述組合代碼分 割所接收的資料位元流的位元騎大長度的组合(步驟 S840)。在步驟S請中,所謂最大長度的組合是指在解碼 過程中’是根齡合代碼巾的最纽元長絲進行分割盘 解碼。如圖3與圖4所示,因查找表215中的代碼的最大 位兀長度為3位元,因此圖4中是以每3個位元為單位來 分割資料位元流以及進行解碼。 然後,依序查找上述位元的分割組合對應於查找表中 基本符號和組合符_-者(步驟S85G),以及組合上述分 割組合所對應的基本符號和組合符號以產生資料位元流對 應的一符號串流(步驟伽0),其解碼方式則如圖4所示。 ❹纟巾’值躲朗是’ N為正整數且切或科基本代碼 中最長之基本代碼的位元數。關於查找表的組成以及解碼 方法的操作細節請參照上述第一實施例與第二實施例的說 明,在此不再贅述。 练上所述,本發明因利用位元長度來挑選組合代碼以 形成查找表’且在誠表巾㈣基本代碼,因此在進行可 變長度解稱可㈣解碼多個符號或單—個符號,相較於 習知技術,本發明可大幅降低所需的解碼時間。此外,本 15 201015875^ w05 27484twf.d〇c/n 發明的查找表的形成方式相當便利’不需經由複雜的運算 即可形成,所需的記憶體空間也較小。因此,使用者可以 更快的設定出符合記憶體空間以及解碼速度需求的查找 表。 雖然本發明已以較佳實施例揭露如上’然其並非用以 限定本發明’任何所屬技術領域中具有通常知識者,在不 脫離本發明之精神和範圍内,當可作些許之更動與濶飾, 因此本發明之保護範圍當視後附之申請專利範圍所界定者 ® 為準。 【圖式簡單說明】 圖1為根據習知技術之查找表。 圖2為根據本發明第一實施例之多媒體資料解碼裝置 圖。 & 圖3為根據本發明第一實施例之查找表212的列表。 圖4為根據本發明第一實施例之資料位元流解碼示音 ❹圖。 ^ 圖5為根據本發明第二實施例之查找表。 圖圖6為根據本發明第二實施例之資料位元流解碼示意 圖7為根據本發明第三實施例之解碼方法流程圖。 圖8為根據本發明第三實施例之解碼方法流程圖。 【主要元件符號說明】 16 27484twf.doc/n 201015875 V X J. vu~wv)5 200 :解碼裝置 201 :解碼單元 210 :可變長度解碼器 215、500查找表 220 :反量化模組 230 :反離散餘弦轉換模組 T1〜T7、T61〜T66 :週期 BS :資料位元流 ❹ S710〜S730、S810〜S860 :解碼步驟The memory space required to find the code in Table 5〇〇 is 68 bits, and the decoding time can be shortened to 6 cycles. Therefore, compared with the conventional technique, only a small increase in the surface size of the S surface can be obtained. Effectively improve the decoding again. For the rest of the details of the embodiment, please refer to the above description, and no further description is given here. In addition, it is worth noting that in the present embodiment, the codeword of the data bit stream bs may represent a plurality of variation values/level values mn (mn-length c〇de) 'the individual representations thereof are (, levd ), where the change value ''run' refers to the number of consecutive zeros in the conversion_scattering conversion wire; and the level value ''level') is a non-zero coefficient value, from which the DC represented by the word can be calculated Or the absolute value of the AC coefficient. The lookup table 212 stores the correspondence between the saki and the symbol, the code may correspond to the word order of the data bit stream Bs, and the symbol corresponds to the value of the change level value. In addition, it should be noted that the data bit stream BS described in this embodiment is not limited to the multimedia material, and only the variable length coded data can be used. In terms of setting the code length limit of the lookup table, as long as the maximum length of the basic code L corresponds to the basic symbol), for example, when the length of the longest basic code in the basic code is 3 bits, the user can select 3 bits. The above length (such as 3-bit, 4-bit or 5-bit) is used to select a combination code that matches the length to form a lookup table. The longer the code length is set, the 13 201015875 ' *-----) 5 27484twf.doc/n combination code, the shorter the time required for the face code. The designer is more ambitious, but the solution is suitable for the longest code length. This = the solution requirement, when the combination code of the length limit is set, still = find all the matching bit codes (for example, the probability of using the original file is lower ^ two, except for the partial combination of the low lookup table size. In order to further reduce the number of users, the user can adjust according to their own needs. The invention is not limited to the above-mentioned implementation. The above-mentioned first embodiment is summarized - the summary - the invention can be m-square (four) simple drink - the data is first connected to I, The decoding method stream of the third embodiment is based on - looking for i: two = code data bit stream (step s7i 〇), then bit stream; ίί Γ stream to generate a symbol bit stream, symbol Shimin - Γ匕3 should be a plurality of symbols of the above code (step s72〇). After the solution, the symbol bit stream is output (step S730). And the evening note that the above-mentioned lookup table includes a plurality of basic codes=a plurality of basic symbols corresponding to the riding and a plurality of basic symbols, and the combined code includes at least two basic codes composed of lengths less than or equal to=all combinations' Where N is a positive integer and is greater than or equal to the number of bits of the base code whose base code is the longest. Regarding the composition of the lookup table and the operation details of the decoding method, please refer to the description of the first embodiment and the second embodiment described above, and details are not described herein again. From another point of view, the present invention proposes a decoding method, please refer to FIG. 8 and FIG. 8 is a flowchart of a decoding method according to the fourth embodiment of the present invention. 1. First, according to the wing basic code composition, a plurality of combination codes whose length is smaller than the scale N are positive integers (step s(10)); then, corresponding basic symbols and a plurality of combined symbols are generated according to the above basic code and combined code. (Step S820). Next, a data bit stream including a plurality of bits is received (step SMO), and then the bit length of the received data bit stream is divided according to the basic code and the combination code (step S840). ). In the step S, the combination of the maximum length means that the disc is the most ray filament of the root age code in the decoding process. As shown in Figs. 3 and 4, since the maximum bit length of the code in the lookup table 215 is 3 bits, the data bit stream is divided and decoded in units of 3 bits in Fig. 4 . Then, sequentially searching for the split combination of the above-mentioned bit elements corresponds to the basic symbols and the combination symbols in the lookup table (step S85G), and combining the basic symbols and the combined symbols corresponding to the above-described split combination to generate corresponding data bit streams. A symbol stream (step gamma 0), the decoding method is shown in Figure 4. The value of the scarf 'value is 'n' is a positive integer and the number of bits of the longest basic code in the basic code. For the details of the operation of the lookup table and the operation of the decoding method, please refer to the description of the first embodiment and the second embodiment, and details are not described herein. As described above, the present invention utilizes the length of the bit to select the combined code to form the lookup table 'and the basic code of the face towel (4), so the variable length can be decoded to decode the plurality of symbols or single symbols. Compared to the prior art, the present invention can greatly reduce the required decoding time. In addition, this 15 201015875^ w05 27484twf.d〇c/n invention table is formed in a convenient manner. It can be formed without complicated operations, and the required memory space is also small. Therefore, the user can quickly set up a lookup table that meets the memory space and decoding speed requirements. Although the present invention has been disclosed in its preferred embodiments, as described above, it is not intended to limit the scope of the present invention, and it is possible to make a few changes and modifications without departing from the spirit and scope of the invention. The scope of protection of the present invention is therefore defined by the scope defined in the appended claims. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a look-up table according to a conventional technique. Figure 2 is a diagram showing a multimedia data decoding apparatus according to a first embodiment of the present invention. & Figure 3 is a listing of a lookup table 212 in accordance with a first embodiment of the present invention. Fig. 4 is a block diagram showing the decoding of a bit stream of a data bit according to the first embodiment of the present invention. Figure 5 is a lookup table in accordance with a second embodiment of the present invention. Figure 6 is a schematic diagram of data bit stream decoding in accordance with a second embodiment of the present invention. Figure 7 is a flow chart of a decoding method in accordance with a third embodiment of the present invention. Figure 8 is a flow chart of a decoding method in accordance with a third embodiment of the present invention. [Major component symbol description] 16 27484twf.doc/n 201015875 VX J. vu~wv) 5 200 : decoding device 201: decoding unit 210: variable length decoder 215, 500 lookup table 220: inverse quantization module 230: inverse Discrete cosine transform modules T1~T7, T61~T66: period BS: data bit stream 710S710~S730, S810~S860: decoding step
1717