1246323 九、發明說明: 【發明所屬之技術領域】 本發明係關於一種動態影像估測之裝置及方法,尤指 一種適用於壓縮影像過程中進行變動影像估測之裝置及方 5 法0 【先前技術】 10 15 夕媒體影像係包括視訊(vide〇 )訊號以及音訊(时心〇 ) 訊號1對於視訊訊號,為了保有較高之影像解析度以及較 小之資料儲存量,-般係使用動態影像壓縮技術以達到此 目的。動態影像壓縮技術乃是將變動影像間的差值以及其 對應之位移量作編碼來達到減少資料量的目的。其中,: 動影像之位移量以運動向量(moti〇n vect〇r,Mv)來表示二 其理由乃在於目前影像幾乎係由先前影像所組成, 目前影像時,僅需將變動影像從先前影像之原始位 至位移後位置後(依據Μν)再加回變動影像間 = 即可得到目前影像,即藉由先前影像、睛及變動’ =值而取得目前影像。變動影像之财的取得1師 動態影像估測以比較目前影像及先前影像。由二 ^像之位移以會太Α,所以執行動態影絲 、: 而對事先規劃搜尋區域(pre士fined咖灿打 像相似度之辨別或比較’並計算出不同相對位置卜^ 異度最小之影像,再計算兩者影像間之向量值,:象I 變動影像t MV,而不需對先前影像之整幅影可取得 20 1246323 相似度之判斷。此種針對事先預估搜尋區域以進行影像比 士之方法又稱之為區塊比對(block matching )。 如圖1所示,美國專利第6,421,466 B1號,發明名稱 Hierarchical motion estimation with levels of varying bit width for dlgltai vide〇 c〇mpressi〇n」揭露一種動態影像估 測=方法,係依序取得目前影像之1/4、1/16、及1/64縮 1〜像,並作像素色彩位元值(pixel bit rate )之變更,再 T目前影像之1/64縮小影像與4塊相㈣前影像之1/64 =小#像進仃影像相似度之比對,再依序進行目前影像之 、16: 1M之縮小影像、及全影像進行影像相似度之比對, 以取付變動影像之Mv,此方法之執行步驟如圖2及圖3 也 ㊇乃沄不僅對兩個時間連續」 15 像進行4層縮小處理,«其像素色彩位元值進行 理,不但執行效率低落,程序執行時間冗長二 J 之位移量大於預期時,亦盔 之女丨。^ ,去弹性调整事先預估搜尋區土 大,J另外,α判變動影像之Mv日寺,亦本 施或方法,上述缺失將無法❹者於動態影像估測之需= 【發明内容】 本發明之主要目的係在 置及方法,俾㈣㈣㈣像估測之装 ⑽逮地取得變動影像之MV。 本發明之另—日a# + t 置及方法,於動能旦:提供—種動態影像估測之褒 ^像偵測之過程中,俾能選出至少二^ 20 1246323 選區塊之MV,並分別進行影像相似度之比 變動影像之MV之可能。 '’咸夕誤判 為:成上述目的’本發明揭露一種動態影像 5 10 15 置用以比對目前影像之變動影像與先前影 : 劃搜哥區域進行影像比對,以產 爭死規 = 括:至少一第一位移暫存器,係用以分別儲: >一目别影像之影像資料,並輪出之;第—多工器 2第-選取訊號而輸出其對應之至少_目前^像 ΐ料;至少—第二位移暫存器,係、用以分別儲存至少= 别影像之影像資料,並輸出之;至少一二維差值 先 係^比對至少一目前影像之影像資料、至少一先前影像 象貧:、i至少一第二位移暫存器所儲存之至少-先 如衫像之影像貢料,或匕卜斜楚 夕 〜 十&比對弟一多工器所輸出之至少一目 =像之影像資料及至少一第二位移暫存器所儲存之至少 則影像之影像資料,以輸出至少-差值累積值;第三 位移暫存器,係用以儲存一 _ ' 一 至m 仔主乂 一維差值累積器所輸出之 第二雙取=並輪出之;第二多工器,係用以依據 写而輸出至少—加總過後的差值累積值;加法 ^糸用以對至少—二維差㈣積器所輸出 累積值、第三位移暫存器所輸出之至少 ^值 加鲍、十铱—夕 左值累積值進仃 錢:一夕工器所輸出之至少一加總過後的差值累積 總’並輸出至少一加總過後的差值累積值;第四 的差值二t係用以儲存加法器所輸出之至少-加總過後 的差值累積值’並輸出之;以及比較器,係用以對至少一 20 1246323 如圖4所示,本發明動態影像估測之裝置 列元件:位移暫存器u、位移暫 ’、匕括下 仅移暫存為12、二維差值累積器 (difference accumulate unit,DAin n ^ ι c 一 , U) 13、位移暫存器 14、 5 10 15 :子=一、准差值累積器16、位移暫存器17、比較 為.加法裔20、位移暫存器21、多工㈣。當中,位 暫存器1 1、12、14、17較佳係為4位元έ ( 組(Bytes)位移暫 存盗(shlftregister) ’即輸人資料與輸出資料之時序上相 f 4時脈時間;位移暫存器15較佳係為以立元組位移暫存 器位私暫存器21較佳係為25位元組位移暫存器。二維差 值累積器13及二維差值累積器16係用以進行相似度之比 對,於本發明中使用絕對差總和(sum ⑽erences,S AD )以作為區塊比對演算法(⑽仏 algorithm’ BMA)之依據,故二維差值累積器以二維差 值累積器16可將比對後所產生之SAD輸出。本發明動態影 =估測之裝置10較佳係使用二個二維差值累積器以加速大 $影像比對之速度,可想而知地,使用者亦可依據實際之 需求而增加或減少二維差值累積器之數目。 一維差值累積為13/二維差值累積器丨6之結構如圖5所 示,包括:四個串接之5位元組位移暫存器;以圖9為例, 維差值累積益3 5,可用以計算並累積先前影像r〇至r3與 目如影像r0至r3之差值’並以每一位元時間輸出一個 sad; —維差值累積器36可用以計算並累積圖9先前影像^ 至r4與目前影像r〇sr32差值;一維差值累積器37可用以 叶算並累積圖9先前影像r2至r5與目前影像Γ〇至r3之差值; 20 1246323 一維差值累積器38可用以計算並累積圖9先前影像r3至!·6 與目前影像rO至1*3之差值;一維差值累積器39可用以計算 並累積圖9先前影像r4至r7與目前影像rO至r3之差值;及多 工器40係用以選取一維差值累積器35、36、37、38、及39 5 之輸出。其中^ 一維差值累積之實施方式有許多’如美 國專利公告第 6,421,466 Β1,發明名稱「Hierarchical motion estimation with levels of varying bit width for digital video compression」中所揭露之數位訊號處理器(Digital-Signal Processor,DSP ),但不以此為限。 10 圖6係本發明動態影像估測方法之流程圖,其執行步 驟如下所示: 步驟S60 :選取目前影像之特定方塊為層級0目前影 像,並進行縮小取樣(down-sampling)處理,以取得層級 1目前影像及層級2目前影像。 15 步驟S61 :選取先前影像之特定方塊為層級0先前影 像,並進行縮小取樣處理,以取得層級1先前影像及層級2 先前影像。如圖7所示,假設,目前影像70及先前影像兩者 影像75大小皆為352x288,而特定方塊係為變動影像,並稱 之為層級0目前影像71,其影像大小較佳係為16x16。為了 20 取得此變動影像之MV,故選取事先規劃搜尋區域,並稱之 為層級0先前影像76,使影像大小較佳係為60x60。其中, 層級0目前影像71應包含於層級0先前影像76中,並記錄彼 此之相對位置,以記錄MV之起點。可想而知地,上述目前 影像70、層級0目前影像71、先前影像75、及層級0先前影 25 像76之影像大小可依使用者實際需求而定,並不以此為限。 1246323 士圖8之示,對層級〇目前影像7丨進行四點取一之縮小 取樣處理,即可得到層級1目前影像72,其影像大小為8X8, · f對層級1目前影像72進行四點取一之縮小取樣處理,即可_ 得到層級2目前影像73,其影像大小為4x4。相同地處理方 5樣以處理層級〇先前影像%,則可得到影像大小為IN之 層級1先前影像77以及影像大小為12Χ12之層級2先前影像 78 ° 步驟S62:比對層級2目前影像及層級2先前影像以取 得二個暫時MV。由於層級2目前影像73及層級2先前影像78 # 10兩者皆經過二次縮小取樣處理,故其影像特性仍為相似, 故可進行影像之比對。此外,為避免區域最小值SAD(i〇cai mm】mum SAD)所造成MV誤判之結果,較佳係選出二個 SAD最小之MV以作為暫時MV,再於步驟S64中再進行一次 較精準之影像比較。如圖9所*,由於層級2先前影像78之 15尺寸通大於層級2目前影像73,所以將層級2先前影像78區 分成二塊影像··左半先前資料PL、中間先前資料?訄、及右 半先前資料PR;並分成二回合做比對,第一次比對…至巧 之影像,第二次比對r4至rll之影像。如圖1〇所示,本發明 _ 變動影像估測裝置10第一回進行層級2影像比對時,層級2 20目丽影像73係作為第一目前資料C1,並將層級2先前影像 78左半先前資料PL作為第一先前資料ρι,中間先前資料 PM作為第二先前資料P2,右半先前資料pR作為第三先前 · 資料P3,並由二維差值累積器13以及二維差值累積器“執 · 行層級2影像比對,此時,第一選取訊號31係選取第一目 11 1246323 前資料ci之輸出,第二選取訊號82係選取,〇,之輸出。二維 差值累積器13係進行層級2目前影像73、左半先前資料 PL、及中間先前資料pM之比對,並將其產生之SAD輸出至 比較器18以進行比較;當二維差值累積器13進行層級影像 5比對後’ 一維差值累積器16亦開始比對層級2目前影像7 3、 中間先前資料PM、及右半先前資料pr。如圖丨丨所示,由 於層級2目前影像73及左半先前資料PL係直接輸入至二維 差值累積器13 ’所以一維差值累積器3 5係比對層級2目前影 像73以及左半先前資料PL(r〇至r3)以取得表示兩者差異 10之SAD0,並將此SAD0輸出至比較器18。比較器a之預設 值為極大值,並以此極大值與此SAD〇進行比較,並將數值 較小之值儲存成侯選之最小SAD。之後,一維差值累積5| 35亦輸出SAD1至SAD4至比較器18,與侯選之最小SAD進 行比較。並由於位移暫存器3 1之作用,故一維差值累積器 15 36較晚開始對層級2目前影像73、左半先前資料pL、及中 間先前資料PM之進行比對,並於一維差值累積器%完成 SAD5至SAD9輸出後,開始輸出SAD。依此類推,一維差 值累積器37、一維差值累積器38、及一維差值累積器”亦 依序輸出SAD10至SAD24。由於某一時間内僅有單__維 20差值累積器輸出SAD,故二維差值累積器13可順利輸出25 個SAD至比較器18以進行SAD大小之比較。另一方面,由 於位移暫存器12、位移暫存器14及位移暫存器15之作用, 所以二維差值累積器16較二維差值累積器13較晚開始對層 級2目前影像73、中間先前資料pM、及右半先前資料1>尺進 1246323 行比對,其運作方式與二維差值累積器13相似,並由於位 移暫存器14及位移暫存器15之作用,所以二維差值累積器 16所輸出之25個SAD可順利輸入至比較器18以進行SAD之 比較,以取得最小二個Sad。 5 當完成第一回層級2影像比對後,本發明動態影像估 測裝置10再進行第二回層級2影像比對,其與第一回層級2 影像比對之主要差別乃在於其比對資料係為左半先前影像 PL、中間先前影像PM、及右半先前影像]?11之以至^丨之資 料,而非W至r7之資料,且由於一維差值累積器35、36、、 10 37、38、及39彼此之間之連結方式係為管、線(pipeline)連 結,故可於第一回層級2目前影像73輸入完畢後,直接再輸 入層級2目岫影像73,以進行第二回層級2影像比對,因而 再產生二組25個SAD。最後,再由比較器18進行SAD大小 之比較,並選出二個數值最小之SAD,並輸出之。 15 步驟S63 :選取對應此二個暫時MV之二個小型層·級工 先A〜像。如圖12所示,由於得知二個數值最小之§ AD即 可知知一個暫時MV,故依據此二個暫時“乂而選取二個大 小為12*12之小型層級1先前影像772及774,如此一來,層 、及1目則影像72即不需與較大資料量之層級丨先前影像”進 '對僅吳兩個較小資料量之層級1先前影像772和774 進行比對,以節省本發明動態影像估測之裝置1〇進行資料 比對之時間。 步驟S64 ··比對層級!目前影像72及此二個層級}先前 影像以取得具有最小SAD之參考Mv。如圖13所示,本發明 13 1246323 動態影像估測之裝置10分別將對層級1目前影像72與層級i 先前影像772及774進行比對。由於層級1目前影像72係大於 層級2目前影像73,因此將其區分成左半目前影像cL及右 半目前影像CR,並將左半目前影像CL作為第一目前資料 5 c 1 ’右半目前影像CR作為第二目前資料C2,此時,第一 選取訊號S1係選取第二目前資料C2之輸出,第二選取訊號 S2係選取’0,當多工器22的輸入。層級1先前影像772/774區 分成:左半先前影像PL、中間先前影像PM、及右半先前影 像PR。如圖14所示,二維差值累積器13先執行左半目前影 10像CL與左半先前影像PL及中間先前影像卩撾之比對,二維 差值累積器16再執行右半目前影像CR與中間先前影像卩]^ 及右半先前影像PR之比對,上述比對過程與步驟S62相 似。當二維差值累積器13開始輸出25個8八1)時,由於位移 暫存器17的作用,二維差值累積器13輸出的每個sad都會 15被延遲4個時脈(clock cycle),因此二維差值累積器13依 序輸出的25個SAD會連同二維差值累積器丨6所依序輸出之 25個SAD,一起輸入至加法器2〇以取得乃個層級i目前影像 72所對應之暫時SAD,並將此25個暫時sad儲存至位移暫 存裔2丨後,選取訊號s2選取位移暫存器21之輸出當多工器 20 22的輸入,連同二維差值累積器13、二維差值累積器16” 回合輸出的25個SAD—起輸入至加法器2〇以取得25個層級 1目前影像72所對應之最終SAD並將此乃個最終sad儲存 至位移暫存器21。接著,位移暫存器21所儲存之乃個層級工 目刖影像72所對應之最終SAD依序輸出至比較器18以進行 14 1246323 比較,以取得對應至層級1先前影像772之最小SAD,並輸 出之。重覆上述步驟,亦可得到另一個對應至層級1先前影 像774之最小SAD,最後再比較上述二個SAD以取得參考 SAD,並取得參考SAD對應之參考MV。 5 步驟S65 :選取對應此參考MV之層級0小型先前影像 762。如圖15所示,依據此參考MV而選取大小為20*20之小 型層級0先前影像762,如此一來,層級0目前影像71即不需 與較大資料量之層級0先前影像76進行比對,僅與較小資料 量之層級0先前影像762進行比對,以節省本發明動態影像 10 估測之裝置10進行資料比對之時間。 步驟S66:比對層級0目前影像71及層級0小型先前影 像762以取得最終MV及其SAD。如圖16所示,本發明動態 影像估測之裝置10將對層級0目前影像71與層級0小型先前 影像762進行比對。層級0目前影像71區分成左半目前影像 15 CLL、左中目前影像CLM、中右目前影像CMR、及右半目 前影像CRR。層級0先前影像762區分成:左半先前影像 PLL、左中先前影像PLM、中間先前影像PMM、右中先前 影像PMR、及右半先前影像PRR,此時,第一選取訊號S1 係選取第二目前資料C2之輸出,第二選取訊號S2係選取’0’ 20 當多工器22的輸入。如圖17所示,二維差值累積器13先執 行左半目前影像CLL與左半先前資料PLL及左中先前資料 PLM之比對,二維差值累積器16再執行左中目前影像CLM 與左中先前影像PLM及中間先前影像PMM之比對,上述比 對過程與步驟S62相似。當二維差值累積器13開始輸出25 15 1246323 個SAD時,由於位移暫存器17的作用,二維差值累積器i3 輸出的每個SAD都會被延遲4個時脈(cl〇ckcycie),因此 一維差值累積器13依序輸出的25個SAD會連同二維差值累 積夯16所依序輸出之25個SAD,一起輸入至加法器2〇以取 5得25個層級〇目前影像71所對應之第—暫時_,並將此25 個第一暫時SAD儲存至位移暫存器21後,接著選取訊號以 選取位移暫存器21之輸出當多工器22的輸入,連同二維差 值累積器13、二維差值累積器16第2回合輸出的25個8入1> 起輸入至加法器20以取得25個層級〇目前影像7丨所對應 ίο之第一暫時sAD並將此25個第二暫時sad儲存至位移暫存 器21。接著,二維差值累積器13執行完中右目前影像 與中間先前影像PMM及右中先前影像PMR之比對,以及二 維差值累積器16執行完右半目前影像CRR與右中先前影像 PMR及右半先前影像PRR之比對後各輸出另外25.sad, 15選取訊號S2選取位移暫存器21之輸出當多工器22的輸 入,因此二維差值累積器13依序輸出的25個3八〇會連同二 維差值累積器16所依序輸出之25個SAD,連同位移暫存器 =所輸出之2 5個第二暫時S A D,—起輸人至加法器2⑽取· 付累加後之25個第三暫時SAD,並儲存此25個第三暫時 20 SAD至位移暫存器21,接著選取訊號幻選取位移暫存器幻 之輸出當多工器22的輸入,連同二維差值累積器13、二維 差值累積器16第2回合輸出的25個SAD —起輸入至加法器 · 20以取得25個層級〇目前影像71所對應之最終sad並將此 _ 25個最終SAD儲存至位移暫存器21。最後,位移暫存器2ι 16 1246323 將此25個最終SAD依序輸出至比較器18 逆订比較,以取 得對應至層級0之前影像71之最小SAD, i别出之,佑撼士 最小SAD即可得知最佳MV。 跟1246323 IX. Description of the invention: [Technical field to which the invention belongs] The present invention relates to a device and method for dynamic image estimation, in particular to a device and method suitable for performing variable image estimation in the process of compressing an image. Technology] 10 15 The media image system includes video (video) signal and audio (time heart 〇) signal. 1 For video signals, in order to maintain a higher image resolution and smaller data storage,-generally use dynamic images Compression technology to achieve this. The dynamic image compression technology is to encode the difference between variable images and its corresponding displacement to reduce the amount of data. Among them: The displacement of a moving image is expressed by a motion vector (moti〇n vect〇r, Mv). The reason is that the current image is almost composed of the previous image. In the current image, only the changing image needs to be changed from the previous image. After the original position to the position after displacement (according to Μν) and then adding back to the changed image = can get the current image, that is, the current image is obtained by the previous image, eyes and changes' = value. Acquiring the wealth of changing images 1 Division Dynamic image estimation to compare the current image with the previous image. Since the displacement of the two images will be too Α, the dynamic shadowing is performed: and the similarity of the similarity of the search area (pre-finished coffee can be identified or compared ') is calculated, and the different relative positions are calculated. The difference is the smallest Then calculate the vector value between the two images: change the image t MV like I, without the need to determine the similarity of 20 1246323 for the entire image of the previous image. This is to estimate the search area in advance to perform The method of video biscuits is also called block matching. As shown in FIG. 1, US Patent No. 6,421,466 B1, and the invention name Hierarchical motion estimation with levels of varying bit width for dlgltai vide〇c〇 "mpressi〇n" reveals a dynamic image estimation = method, which sequentially obtains 1/4, 1/16, and 1/64 of the current image, and uses them as pixel bit rate values. Change, then compare the 1/64 reduced image of the current image with 1/64 of the 4 previous images = small #image into the image similarity comparison, and then sequentially reduce the 16: 1M reduced image of the current image , And full image similarity Yes, in order to obtain the Mv of the changing image, the execution steps of this method are shown in Figure 2 and Figure 3. It is also not only that the two images are continuously reduced in time. 15 images are processed by 4 layers of reduction. «The pixel color bit values are processed, not only The execution efficiency is low, and the program execution time is long. When the displacement of J is larger than expected, the helmet is also a female girl. ^, The flexibility is adjusted to predict the size of the search area in advance. J In addition, α judges the change image of Mv Risi, also this The method or method, the above-mentioned deficiency will not meet the needs of dynamic image estimation = [contents of the invention] The main purpose of the present invention is to install and method, the method of image estimation to capture the MV of the changing image. Another invention—day a # + t placement and method, in kinetic energy: provide—a kind of dynamic image estimation. During the process of image detection, at least two ^ 20 1246323 selected MVs can be selected and imaged separately. The similarity ratio may change the MV of the video. ”Xianxi misjudged: to achieve the above purpose. The present invention discloses a dynamic image 5 10 15 to compare the changed image of the current image with the previous image: Shadow The comparison is based on the rules of production competition = including: at least one first displacement register, which is used to store: > image data of a single image and rotate it out; the first-multiplexer 2-the selected signal And output its corresponding at least _current ^ image data; at least-a second displacement register, which is used to store and output at least = other image data separately; at least a two-dimensional difference is first ^ ratio Image data of at least one current image, at least one previous image: i, at least one image stored in at least a second displacement register, such as a shirt-like image, or a dagger oblique Chu Xi ~ ten & Compare at least one item = image data output by the brother multiplexer and at least one image data stored in at least one second displacement register to output at least-difference cumulative value; the third displacement is temporarily stored The second multiplexer is used to store the second double fetched by the one-dimensional difference accumulator output from the main frame of the _ 'one to the m. The second multiplexer is used to output at least-total based on the write Cumulative accumulated value after the addition; addition ^ 糸 is used to input at least-two-dimensional difference integrator The accumulated value, at least ^ value output from the third displacement register, plus the accumulated value of ten iridium-left left value: Save the accumulated value of the difference after the sum of at least one output from the industrial machine. Output at least one cumulative difference value after the sum; the fourth difference two t is used to store and output at least-the cumulative difference value after the summation output by the adder; and a comparator is used to For at least one 20 1246323, as shown in FIG. 4, the device elements of the device for dynamic image estimation according to the present invention are: a shift register u, a shift register, and only a temporary shift register of 12, and a two-dimensional difference accumulator (difference accumulate unit, DAin n ^ c a, U) 13, displacement register 14, 5 10 15: sub = one, quasi-difference accumulator 16, displacement register 17, comparison is. Addition 20, displacement temporary Register 21, multiplexing. Among them, the bit register 1 1, 12, 14, 17 is preferably a 4-bit (bytes) shift register (shlftregister) 'that is, the timing of input data and output data is f 4 clock Time; the shift register 15 is preferably a three-byte shift register, and the private register 21 is preferably a 25-byte shift register. The two-dimensional difference accumulator 13 and the two-dimensional difference The accumulator 16 is used for comparison of similarity. In the present invention, the sum of absolute differences (S AD) is used as the basis of the block comparison algorithm (⑽ 仏 algorithm 'BMA), so the two-dimensional difference The value accumulator uses the two-dimensional difference accumulator 16 to output the SAD generated after the comparison. The dynamic shadow = estimation device 10 of the present invention preferably uses two two-dimensional difference accumulators to accelerate the large image ratio. Regarding the speed, it is conceivable that the user can also increase or decrease the number of two-dimensional difference accumulators according to actual needs. The structure of one-dimensional difference accumulation is 13 / two-dimensional difference accumulator. As shown in Figure 5, it includes: four 5-byte shift registers connected in series; taking Figure 9 as an example, the cumulative benefit of the dimensional difference value is 35, which is available Calculate and accumulate the difference between the previous images r0 to r3 and the visual images r0 to r3 'and output a sad at each bit time;-The dimensional difference accumulator 36 can be used to calculate and accumulate the previous images of Fig. 9 ^ to r4 Difference from the current image r0sr32; One-dimensional difference accumulator 37 can be used to calculate and accumulate the difference between the previous images r2 to r5 and the current image Γ0 to r3 in FIG. 9; 20 1246323 One-dimensional difference accumulator 38 is available To calculate and accumulate the differences between the previous images r3 to! · 6 in FIG. 9 and the current images rO to 1 * 3; the one-dimensional difference accumulator 39 can be used to calculate and accumulate the previous images r4 to r7 and the current images rO to r3 in FIG. 9 The difference; and the multiplexer 40 is used to select the output of the one-dimensional difference accumulators 35, 36, 37, 38, and 39 5. Among them, there are many implementations of the one-dimensional difference accumulation method, such as the US Patent Bulletin No. 6,421,466 B1, the digital signal processor (DSP) disclosed in the invention name "Hierarchical motion estimation with levels of varying bit width for digital video compression", but not limited to this. 10 Figure 6 The flowchart of the dynamic image estimation method of the present invention The execution steps are as follows: Step S60: Select a specific block of the current image as the current image of level 0, and perform down-sampling processing to obtain the current image of level 1 and the current image of level 2. 15 Step S61: Select The specific box of the previous image is the level 0 previous image, and downsampling processing is performed to obtain the level 1 previous image and the level 2 previous image. As shown in FIG. 7, it is assumed that the size of both the current image 70 and the previous image 75 is 352x288, and the specific block is a variable image, which is called level 0 current image 71, and the image size is preferably 16x16. In order to obtain the MV of this changing image, a pre-planned search area is selected and called the level 0 previous image 76, so that the image size is preferably 60x60. Among them, the current image 71 of level 0 should be included in the previous image 76 of level 0, and the relative positions of them should be recorded to record the starting point of the MV. It is conceivable that the size of the current image 70, the current image of level 0 71, the previous image 75, and the previous image of level 0 25 and 76 may be determined according to the actual needs of the user, and are not limited thereto. 1246323 As shown in Figure 8, by performing a four-point-one downsampling process on the current image 7 of level 0, you can get the current image 72 of level 1 with an image size of 8X8. Take one of the downsampling processes to get the current image 73 of level 2 with an image size of 4x4. Process 5 squares in the same way to process level 0 previous image%, then you can get level 1 previous image 77 with image size IN and level 2 previous image with image size 12 × 12 78 ° Step S62: compare the current image and level of level 2 2 Previous images to obtain two temporary MVs. Because the current image 73 of level 2 and the previous image 78 # 10 of level 2 have undergone sub-sampling processing, their image characteristics are still similar, so image comparison can be performed. In addition, in order to avoid the result of MV misjudgment caused by the regional minimum SAD (iocai mm) mum SAD, it is better to select two MVs with the smallest SAD as temporary MVs, and then perform a more accurate one in step S64. Image comparison. As shown in Figure 9 *, since the size of the previous image 78 of level 2 is larger than that of current image 73 of level 2, the previous image 78 of level 2 is divided into two images. · Left half previous data PL, middle previous data?訄, and the right half of the previous data PR; and divided into two rounds for comparison, the first comparison ... to the image of Qiao, the second comparison of the images from r4 to rll. As shown in FIG. 10, when the present invention _ variable image estimation device 10 performs the first level 2 image comparison, the level 2 20 mesh image 73 is the first current data C1, and the previous image 78 of the level 2 is left The semi-prior data PL is used as the first previous data, the middle pre-data PM is used as the second previous data P2, and the right-half previous data pR is used as the third previous data P3, which is accumulated by the two-dimensional difference accumulator 13 and the two-dimensional difference. The device "performs level 2 image comparison. At this time, the first selection signal 31 is the output of the first item 11 1246323 before the data ci, and the second selection signal 82 is the output of the 0, which is the output of the two-dimensional difference. The comparator 13 compares the current image 73 of the level 2, the previous data PL in the left half, and the pM of the middle previous data, and outputs the generated SAD to the comparator 18 for comparison; when the two-dimensional difference accumulator 13 performs the hierarchy After the comparison of image 5, the one-dimensional difference accumulator 16 also starts to compare the current image of level 2 7 3, the previous data in the middle PM, and the previous data pr in the right half. As shown in Figure 丨 丨, the current image 73 and The left half of the previous data PL is directly input to the two-dimensional Difference accumulator 13 'So the one-dimensional difference accumulator 3 5 compares the current image 73 of level 2 and the previous data PL (r0 to r3) of the left half to obtain SAD0 indicating the difference 10 between the two, and outputs this SAD0 Go to comparator 18. The preset value of comparator a is the maximum value, and the maximum value is compared with this SAD0, and the smaller value is stored as the candidate minimum SAD. After that, the one-dimensional difference value is accumulated 5 | 35 also outputs SAD1 to SAD4 to comparator 18, and compares it with the candidate minimum SAD. Because of the effect of the shift register 31, the one-dimensional difference accumulator 15 36 starts later on the current image of level 2 73, left half The previous data pL and the intermediate previous data PM are compared, and SAD5 to SAD9 are output after the one-dimensional difference accumulator% completes, and SAD is output. By analogy, the one-dimensional difference accumulator 37 and the one-dimensional difference The accumulator 38 and the one-dimensional difference accumulator "also sequentially output SAD10 to SAD24. Since only a single __20-dimensional difference accumulator outputs SAD at a certain time, the two-dimensional difference accumulator 13 can smoothly output 25 SADs to the comparator 18 for comparison of SAD sizes. On the other hand, due to the functions of the displacement register 12, the displacement register 14, and the displacement register 15, the two-dimensional difference accumulator 16 starts the current image 73 of the level 2 later than the two-dimensional difference accumulator 13. , Middle previous data pM, and right half previous data 1 > rule advance 1246323, its operation is similar to the two-dimensional difference accumulator 13, and because of the functions of the displacement register 14 and the displacement register 15, The 25 SADs output by the two-dimensional difference accumulator 16 can be smoothly input to the comparator 18 for comparison of SADs to obtain a minimum of two Sads. 5 After completing the first round of Level 2 image comparison, the dynamic image estimation device 10 of the present invention performs the second round of Level 2 image comparison. The main difference between it and the first round of Level 2 image comparison is its comparison. The data is the data of the left half previous image PL, the middle previous image PM, and the right half previous image]? 11 to ^ 丨, not W to r7, and because of the one-dimensional difference accumulators 35, 36 ,, 10 37, 38, and 39 are connected to each other by a pipe or a pipeline. Therefore, after the current image 73 of the first level 2 is input, you can directly input the image 2 of level 2 to perform In the second round of Level 2 image comparison, two sets of 25 SADs are generated. Finally, the size of the SAD is compared by the comparator 18, and the two SADs with the smallest value are selected and output. 15 Step S63: Select two small-level, level-level workers A ~ images corresponding to the two temporary MVs. As shown in FIG. 12, since § AD, which has the smallest two values, can know a temporary MV, based on these two temporary “乂”, two small level 1 previous images 772 and 774 with a size of 12 * 12 are selected. In this way, the layer and the first image 72 need not be compared with the previous image with a larger amount of data. The previous images 772 and 774 of level 1 with only two smaller data are compared. It saves the time of data comparison by the apparatus 10 for dynamic image estimation of the present invention. Step S64 · Compare levels! The current image 72 and these two levels} previous images to obtain the reference Mv with the smallest SAD. As shown in FIG. 13, the present invention 13 1246323 dynamic image estimation device 10 compares the current image 72 of level 1 with the previous images 772 and 774 of level i, respectively. Since the current image 72 of level 1 is larger than the current image 73 of level 2, it is divided into the left half current image cL and the right half current image CR, and the left half current image CL is used as the first current data 5 c 1 'right half current The image CR serves as the second current data C2. At this time, the first selection signal S1 selects the output of the second current data C2, and the second selection signal S2 selects '0' as the input of the multiplexer 22. The Level 1 previous image 772/774 is divided into: the left half previous image PL, the middle previous image PM, and the right half previous image PR. As shown in FIG. 14, the two-dimensional difference accumulator 13 first performs a comparison between the left-half current image 10 image CL and the left-half previous image PL and the middle previous image Laos, and the two-dimensional difference accumulator 16 then executes the right half current The comparison between the image CR and the middle previous image 卩] ^ and the right-half previous image PR is similar to that in step S62. When the two-dimensional difference accumulator 13 starts to output 25 8 8 1), due to the role of the displacement register 17, each sad output by the two-dimensional difference accumulator 13 will be delayed by 4 clocks (clock cycle). ), So the 25 SADs sequentially output by the two-dimensional difference accumulator 13 will be input to the adder 20 together with the 25 SADs output by the two-dimensional difference accumulator 丨 6 in order to obtain the current level i. After the temporary SAD corresponding to image 72 is stored in the 25 temporary saddles, the signal s2 is selected to select the output of the temporary buffer 21 as the input of the multiplexer 20 22, together with the two-dimensional difference Accumulator 13, 2D difference accumulator 16 ”Round output 25 SADs—from input to adder 20 to get 25 final SADs corresponding to current image 72 of level 1 and store this final sad to displacement Register 21. Then, the final SAD corresponding to the image 72 of the hierarchy stored in the displacement register 21 is sequentially output to the comparator 18 for 14 1246323 comparison to obtain the previous image 772 corresponding to level 1. The minimum SAD and output it. Repeat the above steps to get another pair It should reach the minimum SAD of the previous image 774 of level 1, and finally compare the two SADs above to obtain the reference SAD, and obtain the reference MV corresponding to the reference SAD. 5 Step S65: Select the level 0 small previous image 762 corresponding to this reference MV. As shown in FIG. 15, according to this reference MV, a small level 0 previous image 762 with a size of 20 * 20 is selected. In this way, the current image 71 of level 0 does not need to be compared with the previous image 76 of level 0 with a large amount of data. , Only compare with the previous image 762 of level 0 with a small amount of data, so as to save the time of data comparison by the device 10 estimated by the dynamic image 10 of the present invention. Step S66: compare the current image 71 of level 0 and the small of level 0 The previous image 762 is used to obtain the final MV and its SAD. As shown in FIG. 16, the dynamic image estimation device 10 of the present invention will compare the current image 71 of level 0 with the small previous image 762 of level 0. Level 0 current image 71 area Divided into left half current image 15 CLL, left middle current image CLM, middle right current image CMR, and right half current image CRR. Level 0 previous image 762 is divided into: left half previous image PLL, left middle previous image PLM, middle previous Image PMM, right middle previous image PMR, and right half previous image PRR. At this time, the first selection signal S1 is to select the output of the second current data C2, and the second selection signal S2 is to select '0'. 20 When the multiplexer 22 As shown in FIG. 17, the two-dimensional difference accumulator 13 first performs a comparison between the left half of the current image CLL and the left half of the previous data PLL and the left middle previous data PLM, and the two-dimensional difference accumulator 16 then executes the left middle The comparison of the current image CLM with the previous middle image PLM and the middle previous image PMM. The above comparison process is similar to step S62. When the two-dimensional difference accumulator 13 starts to output 25 15 1246323 SADs, each SAD output by the two-dimensional difference accumulator i3 is delayed by 4 clocks due to the effect of the displacement register 17. Therefore, the 25 SADs sequentially output by the one-dimensional difference accumulator 13 will be input to the adder 20 with the 25 SADs sequentially output by the two-dimensional difference accumulation ram 16 to obtain 5 to obtain 25 levels. After the first-temporary _ corresponding to image 71, and store the 25 first temporary SADs in the displacement register 21, then select a signal to select the output of the displacement register 21 as the input of the multiplexer 22, together with two The dimensional difference accumulator 13 and the two-dimensional difference accumulator 16 output 25 8-in-1s from the second round and input to the adder 20 to obtain 25 levels. The first temporary sAD corresponding to the current image 7 and The 25 second temporary sads are stored in the displacement register 21. Next, the two-dimensional difference accumulator 13 performs the comparison between the middle right current image and the middle previous image PMM and the right middle previous image PMR, and the two-dimensional difference accumulator 16 performs the right half of the current image CRR and the right middle previous image. After the comparison between the PMR and the previous half of the previous image PRR, each output is another 25.sad, 15 selects the signal S2 and selects the output of the shift register 21 as the input of the multiplexer 22, so the two-dimensional difference accumulator 13 sequentially outputs 25 3800 will be outputted together with the 25 SADs output by the two-dimensional difference accumulator 16 in sequence, together with the displacement register = 2 5 second temporary SADs output—from the input to the adder 2 to grab · After adding the 25 third temporary SADs and storing the 25 third temporary 20 SADs to the displacement register 21, then select the signal magic and select the output of the displacement register magic as the input of the multiplexer 22, together with two Dimensional difference accumulator 13, 2D difference accumulator 16 25 SADs output in the second round — input to adder 20 to get 25 levels 〇 The final sad corresponding to the current image 71 and this _ 25 Finally, the SAD is stored in the displacement register 21. Finally, the displacement register 2m 16 1246323 sequentially outputs the 25 final SADs to the comparator 18 and reverses the comparison to obtain the minimum SAD corresponding to the image 71 before the level 0. You can see the best MV. with
上述貫施例僅係為了方便說明而舉例而已,本發明所 主張之權職圍自應以中請專·圍所述為準 x 於上述實施例。 M 【圖式簡單說明】 圖1係習知動態影像估測方法之示意圖。 圖2係習知動態影像估測方法之上半部流程圖。 圖3係習知動態影像估測方法之下半部流程^。 圖4係本發明動態影像估測裝置之方塊圖。 圖5係本發明二維差值累積器之方塊圖。 圖6係本發明動態影像估測方法之流程圖。 圖7係目前影像與先前影像之示意圖。 圖8係目前影像進行縮小取樣之示意圖。 圖9係層級2先前影像與層級2目前影像之示意圖。 _圖1〇係二維差值累積器13進行層級2目前影像與層級 2先前影像比較之資料流示意圖。 圖11係二維差值累積器進行層級2目前影像與層級2 先前影像比較之另一示意圖。 圖\2係由層級2目前影像與層級2先前影像產生層級! 小型先所影像,及其與層級丨先前影像關係之示意圖。 17 1246323 圖13係層級1小型先前影像與層級1目前影像之示意 圖。 圖14係二維差值累積器13及16進行層級1目前影像與 層級1小型先前影像比較之資料流示意圖。 5 圖1 5係由層級1目前影像與層級1小型先前影像產生 層級0小型先前影像及其與層級〇先前影像關係之示意圖。 圖1 6係層級〇小型先前影像與,層級〇目前影像之示咅、 圖。 圖17係二維差值累積器13及16進行層級〇先前影像與 10層級0目前影像比較之資料流示意圖。 【主要元件符號說明】 位移暫存器 位移暫存器 位移暫存器 位移暫存器 位移暫存器 一維差值累積器 一維差值累積器 目前影像 層級2目前影像 層級1先前影像 ‘型先前影像 10本發明動態影像估測裝置 u 15位移暫存器 18比較器 22多工器 32位移暫存器 12位移暫存器 13二維差值累積器14 16二維差值累積器17 2〇加法器 21 30位移暫存器 31 33位移暫存器 乃 36 -維差值累積器37 一維差值累積器以 39 —維差值累積器4〇多工器 η層級〇目前影像72層級i目前影像乃 75先前影像 76層級〇先前影像77 7 8層級2先前影像 762層級〇小型先前影像772層級h 18 1246323 774 層級1小型先前影像 PM 中間先前資料 PLL左半先前影像 PMM中間先前影像 PRR右半先前影像 CR 右半目前影像 CLM左中目前影像 CRR右半目前影像 PL 左半先前資料 PR 右半先前資料 PLM左中先前影像 PMR右中先前影像 CL 左半目前影像 CLL左半目前影像 CMR中右目前影像The above-mentioned embodiments are merely examples for the convenience of description. The rights and duties claimed in the present invention shall be subject to the requirements of the Chinese patent and the above-mentioned embodiments. M [Schematic description] Figure 1 is a schematic diagram of a conventional dynamic image estimation method. FIG. 2 is a flowchart of the first half of a conventional method for estimating dynamic images. Figure 3 shows the lower half of the conventional dynamic image estimation method ^. FIG. 4 is a block diagram of a dynamic image estimation device according to the present invention. FIG. 5 is a block diagram of a two-dimensional difference accumulator of the present invention. FIG. 6 is a flowchart of a dynamic image estimation method according to the present invention. Figure 7 is a schematic diagram of the current image and the previous image. Figure 8 is a schematic diagram of downsampling of the current image. Figure 9 is a schematic diagram of the previous image of level 2 and the current image of level 2. Figure 10 is a schematic diagram of the data flow of the two-dimensional difference accumulator 13 comparing the current image of level 2 with the previous image of level 2. FIG. 11 is another schematic diagram of comparing a current image of level 2 with a previous image of level 2 by a two-dimensional difference accumulator. Figure \ 2 is a hierarchy generated from the current image of level 2 and the previous image of level 2! Schematic representation of the small first image and its relationship with the previous image in the hierarchy. 17 1246323 Figure 13 is a schematic diagram of a small previous image of level 1 and a current image of level 1. Figure 14 is a schematic diagram of the data flow of the two-dimensional difference accumulators 13 and 16 comparing the current image of level 1 with the small previous image of level 1. 5 Figure 1 Figure 5 is a schematic diagram of the level 0 small previous image and the level 0 small previous image. Fig. 16 Shows and images of 6 series of level 0 small previous images and level 0 current images. Figure 17 is a schematic diagram of the data flow of the two-dimensional difference accumulators 13 and 16 comparing the level 0 previous image with the level 0 current image. [Description of main component symbols] Displacement register Displacement register Displacement register Displacement register Displacement register One-dimensional difference accumulator One-dimensional difference accumulator Current image level 2 Current image level 1 Previous image 'type Previous image 10 The present invention dynamic image estimation device u 15 displacement register 18 comparator 22 multiplexer 32 displacement register 12 displacement register 13 two-dimensional difference accumulator 14 16 two-dimensional difference accumulator 17 2 〇 Adder 21 30 Displacement register 31 33 Displacement register 36-dimensional difference accumulator 37 One-dimensional difference accumulator 39-dimensional difference accumulator 4 multiplexer η level 〇 current image 72 levels i The current image is 75 previous images 76 levels 0 previous images 77 7 8 levels 2 previous images 762 levels 0 small previous images 772 levels h 18 1246323 774 level 1 small previous images PM middle previous data PLL left half previous images PMM middle previous images PRR Right half previous image CR right half current image CLM left middle current image CRR right half current image PL left half previous data PR right half previous data PLM left middle previous image PMR right middle previous image CL left half current image CLL left half current image CMR center right current image
1919