TW200945902A - Method for video encoding and the application thereof - Google Patents

Method for video encoding and the application thereof Download PDF

Info

Publication number
TW200945902A
TW200945902A TW97115690A TW97115690A TW200945902A TW 200945902 A TW200945902 A TW 200945902A TW 97115690 A TW97115690 A TW 97115690A TW 97115690 A TW97115690 A TW 97115690A TW 200945902 A TW200945902 A TW 200945902A
Authority
TW
Taiwan
Prior art keywords
original image
current
frame
difference
histogram
Prior art date
Application number
TW97115690A
Other languages
Chinese (zh)
Other versions
TWI355855B (en
Inventor
Chien-Tang Tseng
Original Assignee
Acer Inc
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 Acer Inc filed Critical Acer Inc
Priority to TW97115690A priority Critical patent/TWI355855B/en
Publication of TW200945902A publication Critical patent/TW200945902A/en
Application granted granted Critical
Publication of TWI355855B publication Critical patent/TWI355855B/en

Links

Abstract

A method for video encoding and the system and video-shooting device thereof are disclosed. The method comprises following steps: fetching a reference pixel information and a reference histogram information from a reference raw image; fetching a current pixel information and a current histogram information from a current raw image; getting a normalized pixel difference, and judging if the pixel difference is greater than or equal to a first threshold to perform an intra frame encoding; getting a normalized histogram difference, and judging if the histogram difference is greater than or equal to a second threshold to perform the intra frame encoding; getting a quantity of macro blocks and judging if the quantity of macro blocks is greater than a third threshold; when the quantity of macro blocks is greater than the third threshold, performing the intra frame encoding, and otherwise performing an inter frame encoding.

Description

200945902 九、發明說明: 【發明所屬之技術領域】 本發明是有關於一種視訊編碼方法及編碼系統與具視 訊編碼功能之攝影裝置,特別是指一種特別適用於大量分 鏡轉換的視訊編碼方法及編碼系統與具視訊編碼功能之攝 影裝置。 【先前技術】 視訊編碼在嵌式系統(Embedded System,又稱嵌入式 〇 系統)中,和一般的電腦系統相較之下’在影像壓縮時所 需的能量非常驚人’尤其是在一執行運動估計(M〇tion Estimation )的計算模組。所謂的運動估計’是為了影像壓 縮的目的,將連續的原始影像(Raw Image )進行處理以去 除時間上的冗餘性(Temporal Redundancy )。執行運動估計 的計算模組可分析每一原始影像,決定原始影像要利用框 内編碼(Intra Frame Encoding)壓縮成 I 訊框(I Frame) 或利用框間編瑪(Inter Frame Encoding )壓縮成P訊框(P ® Frame ),其中I訊框是由原始影像單獨壓縮而成,而P訊框 則是捨棄對應的原始影像,改以預測的方式重新編碼,如 此,連續的I訊框及P訊框重製出和連續原始影像極為相似 的視訊,可大幅去除連續原始影像在時間上的冗餘性,達 到影像壓縮的功效。 利用上述現行之運動估計的計算模組,雖然可以有效 地壓縮連續影像,但是當其中一原始影像及下一原始影像 間發生分鏡轉換(Shot Change)時,執行運動估計的計算 200945902 ' 模組,仍需完整地分析原始影像的内容,以決定原始影像 要壓縮成I訊框或p訊框’而無法有效率地依據下一原始影 像與上一原始影像的差異性而快速地認定下一原始影像應 該壓縮為I訊框。 如上所述’為避免嵌式系統執行大量的運動估計,以 提昇嵌式系統整體的運作效能,因此,有必要尋求解決之 道。 【發明内容】 Ο 因此,本發明之首要目的,即在提供一種視訊編碼方 法。 於是’本發明視訊編碼方法是包含下列步驟:首先, 提取一參考原始影像之複數掃描線之複數像素,產生一參 考像素資料與一參考直方圖資料。然後,提取一現行原始 影像之複數掃描線之複數像素,產生一現行像素資料及一 現行直方圖資料。接著,依據該現行像素資料及該參考像 素資料計算出一正規化之像素差值,再判斷像素差值是否 A於等於-第-Η榧值,若是’則設定對現行原始影像進 行框内編碼。若該像素差值小於該第一門根值,則依據該 現行直方圖資料及該參考直方圖資料計算出一正規化之直 方圖差值,再判斷直方圖差值是否大於等於—第二門捏值 ,若是,則設定對現行原始影像進行框内編碼。若該直方 圖差值小於該第二門檻值,則計算現行原始影像之複數巨 集塊預定進行框内編碼的數量為—巨集塊數量,並於計算 巨集塊數量的同時,即時地判斷巨集塊數量是否大於—第 200945902 一門棰值然後,當巨集塊數量大於第三門棰值時,則設 定對現行原始影像進行框内編碼,反之,則設定對現行原 始影像進行框間編碼。 μ 另外,本發明之另一目的,即在提供一種視訊編碼 統。 於是,本發明視訊編碼系統,用以壓縮複數連續之原 "·/像I 3 ·-輸人單元、_判斷單元…框内編碼單 元、一框間編碼單元,及一輸出單元。輸入單元依序接收 ❹ m始影像為-參考原始影像,及連續之下一原始影 像為一現行原始影像。判斷單元,用以決定現行原始影像 應以框内編碼或框間編碼麼縮,判斷單元包括:一提取模 組、一像素差值判別模組、一直方圖差值判別模組及—運 動估計判別模組。提取模組用以提取參考原始影像之複數 f描線之複數像素’產生一參考像素資料與一參考直方圖 貝料’另外,提取現行原始影像之複數掃描線之複數像素 ,產生一現行像素資料及-現行直方圖資料。像素差值判 賴組心將現行像素資料減去參考像素㈣產生-像素 差值f正規化,再判斷像素差值是否大於等於一第一門檻 若是則疋對現行原始影像進行框内編碼。直方圖 差值判別模組用以將現行直方圖資料減去參考直方圖資料 產生一直方圖差值並正規化,再判斷直方圖差值是否大於 等於-第二門檻值,若是,則設定對現行原始影像進行框 内編碼。運動估計判別模組計算現行原始影像之複數巨集 塊預定進行框内編碼的數量為一巨集塊數量,並於計算巨 200945902 集塊數量的同時,即時地判 集塊數量疋否大於一第三 = “集塊數量大於第三門檻值時,則設定對現行 一 夂之,則設定對現行原始影像進 订框間編碼。框内編碼單元用以壓縮該設定為進行框内編 碼之現仃原始影像為—!訊框。框間編喝單元用以計算該設 疋為進打框間編碼之現行原始影像為—ρ訊框。輸出單元 用以將墨縮為1訊框及ρ訊框之原始影像順序地輸出為—視 訊之位元流》 ❹ ❹ 再者,本發明之再一目的,即在提供-種具視訊編碼 功能之攝影裝置。 於疋本發明具視訊編碼功能之攝影裝置,包含··— 攝像單元冑人單元、-判斷單元、_框内編碼單元、 :運動估計判別模組、一輸出單元及一儲存單元。攝像單 π用以記錄複數連續之原始影像。輸入單元依序接收其中 一原始影像為-參考原始影像,及連續之下一原始影像為 一現行原始影像。判斷單元用以決定現行原始影像應以框 内編碼或框間編碼壓縮,該判斷單元包括:一提取模組、 一像素差值判別模組、一直方圖差值判別模組及一運動估 計判別模組。該提取模組用以提取參考原始影像之複數 描線之複數像素,產生一參考像素資料與一參考直方圖資 料,另外,提取現行原始影像之複數掃描線之複數像素, 產生一現行像素資料及一現行直方圖資料。像素差值判別 模組用以將現行像素資料減去參考像素資料產生一像素差 值並正規化,再判斷像素差值是否大於等於一第一門權值 200945902 則'•又定對現行原始影像進 值判別模組用以將現粁吉方㈣μ 罝方圖差 ▲ 士 將現订直方圖資料減去參考直方圖資料產 生一直方圖差值並正規化,Α划啦士 產 規化再判斷直方圖差值是否大於等 於第一門檻值,若是,則执$ 對現行原始影像進行框内 編碼。運動估計判別模組計算現行原始影像之複數巨集塊 預疋進行框内編碼的數量為一巨集塊數量,並於計算巨隼 塊數量的同時,即時地判斷巨集塊數量是否大於一第三門 第-門檻值時,則設定對現行原 =進订框内編碼,反之,則設定對現行原始影像進行 =内編碼單元用以壓縮該設定為進行框内編碼 仃原始影像為-I訊框。框間編碼單元用以計算續 為進行框間編碼之現行原始影像為—p訊框。輸^ 以將該㈣縮為!訊框及P訊框之原始影像順序地輸出為— 視訊之位元流。儲存單元用以料該視訊之位元流。 參 本發明的優點在於提早決定每一現行原始影像應_ 為1讯框或P訊框,有效減少系統的運算負荷,特別是當參 考原始影像及現行原始影像間包括場景轉換時: 為顯著。 、双果更 【實施方式】 、有關本發明t前述及其他技術内容、特點與功效,在 以下配合參考圖式之一個較佳實施例的詳細說明t, 清楚的呈現。 ° 參閱圖卜本發明視訊編碼系·統】之較佳實施例,是以 一積體電路(Integrated Circuit,IC)晶片實施,適用Z裝 200945902 置在一需要具備視訊編碼功能的攝影裝置上,但並不限於 此,也可以應用於任何需視訊編碼功能的電子裝置上。其 中攝影裝置包含-攝像單元2及__儲存單元3,攝像單元2 在本較佳實施例中包括—鏡頭模組(圖未示),用以在拍攝 後取得複數連續之原始影像(Raw Image ),而儲存單元3 用以儲存一經過編碼系統丨處理後的視訊的位元流(出t Stream)。若攝影裝置為一具紀錄性質的攝影機,則儲存單 疋3可長時間記錄視訊的位元流。若攝影裝置為一具傳輸 性質,如應用於視訊會議的視訊伺服裝置,則儲存單元3 可暫時記錄視訊的位元流,再透過一網際網路將位元流傳 送至至少一接收用的視訊終端裝置。 編碼系統1包含一輸入單元u、一判斷單元12、一框 内編碼單元13、-框間編碼單元14,及—輸出單元15,並 都以電子電路設計製作。 輸入單元11接收”原始影像,並將其巾_原始影像 設為-參考原始影像’在該參考原始影像後的另—原始影 像設為一現行原始影像。 判斷單元12判斷每-現行原始影像應該以框内編碼壓 縮成I訊框,或是以框間編碼壓縮成p訊框。判斷單元12 包括-提取模組121、一像素差值判別模組122、一直方圖 差值判別模組123,及一運動估計判別模組124。 參閱圖1、3,提取模組121可提取(Fetd〇參考原始 影像4的複數掃描線(Sean Line) 41的複數像素(PM) ,在本較佳實施例中且如圖2所示,參考原始影像4的解 10 200945902 析度為320像素x240像素,而被提取的掃插線為五條彼此 相間隔的水平掃描線41。不提取全部掃描線41的原因是可 大幅節省運算能量並加速判斷的效率。提取模組i2i提取 像素後產生一參考像素資料與一參考直方圖資料。必須說 明的是’參考像素資料是指參考絲影像4的五條掃描線 41中,每一像素的三原色:紅、綠、藍(Red、.η、200945902 IX. Description of the Invention: [Technical Field] The present invention relates to a video encoding method and an encoding system and a video encoding device having a video encoding function, and more particularly to a video encoding method particularly suitable for a large number of split mirror conversions. Coding system and photographic device with video coding function. [Prior Art] In the embedded system (Embedded System), compared with the general computer system, the energy required for image compression is very amazing, especially in the execution of motion. Estimate (M〇tion Estimation) calculation module. The so-called motion estimation is for the purpose of image compression, processing a continuous raw image (Raw Image) to remove temporal redundancy (Temporal Redundancy). The calculation module that performs motion estimation can analyze each original image, and determine that the original image is compressed into an I frame by using Intra Frame Encoding or compressed into P by Inter Frame Encoding. Frame (P ® Frame ), in which the I frame is compressed by the original image separately, and the P frame is discarded from the corresponding original image, and then re-encoded in a predictive manner. Thus, the continuous I frame and P The frame reproduces the video which is very similar to the continuous original image, which can greatly remove the temporal redundancy of the continuous original image and achieve the effect of image compression. Using the current motion estimation calculation module, although the continuous image can be effectively compressed, when the Shot Change occurs between one of the original image and the next original image, the motion estimation calculation is performed 200945902 'module Still need to completely analyze the content of the original image to determine that the original image is to be compressed into an I frame or a p-frame, and cannot efficiently determine the next difference based on the difference between the next original image and the previous original image. The original image should be compressed into an I frame. As described above, in order to prevent the embedded system from performing a large amount of motion estimation to improve the overall operational efficiency of the embedded system, it is necessary to seek a solution. SUMMARY OF THE INVENTION Accordingly, it is a primary object of the present invention to provide a video encoding method. Thus, the video encoding method of the present invention comprises the steps of: first, extracting a plurality of pixels of a plurality of scanning lines of a reference original image to generate a reference pixel data and a reference histogram data. Then, a plurality of pixels of a plurality of scan lines of the current original image are extracted to generate a current pixel data and a current histogram data. Then, calculating a normalized pixel difference value according to the current pixel data and the reference pixel data, and then determining whether the pixel difference value is equal to a -th-threshold value, and if yes, setting an in-frame encoding of the current original image . If the pixel difference is less than the first threshold value, calculating a normalized histogram difference according to the current histogram data and the reference histogram data, and then determining whether the histogram difference is greater than or equal—the second gate Pinch, if it is, set the in-frame encoding of the current original image. If the histogram difference is less than the second threshold value, the number of macroblocks in the current original image is calculated to be the number of macroblocks, and the number of macroblocks is calculated, and the number of macroblocks is calculated simultaneously. Whether the number of macroblocks is greater than - 200945902. Then, when the number of macroblocks is greater than the third threshold, the current original image is set to be intra-coded. Otherwise, the current original image is inter-frame encoded. . In addition, another object of the present invention is to provide a video encoding system. Accordingly, the video encoding system of the present invention compresses a plurality of consecutive original "//I 3 ·-input units,_determination units...in-frame coding units, inter-frame coding units, and an output unit. The input unit sequentially receives the ❹ m initial image as a reference original image, and the continuous lower original image is a current original image. The determining unit is configured to determine whether the current original image should be intra-frame coded or inter-frame coded, and the determining unit comprises: an extracting module, a pixel difference discriminating module, a histogram difference discriminating module, and a motion estimation Discriminating module. The extraction module is configured to extract a plurality of pixels of the reference f-line of the original image to generate a reference pixel data and a reference histogram, and extract a plurality of pixels of the plurality of scan lines of the current original image to generate a current pixel data and - Current histogram data. The pixel difference judgment group subtracts the current pixel data from the reference pixel (4) to generate - the pixel difference f is normalized, and then determines whether the pixel difference is greater than or equal to a first threshold. If yes, the current original image is intra-coded. The histogram difference discriminating module is configured to subtract the reference histogram data from the current histogram data to generate a histogram difference and normalize, and then determine whether the histogram difference is greater than or equal to the second threshold value, and if so, set the pair The current original image is encoded in-frame. The motion estimation discriminating module calculates the number of in-frame coding of the complex macroblock of the current original image as the number of macroblocks, and calculates the number of blocks in the 200945902 cluster, and immediately determines whether the number of blocks is greater than one. 3 = "When the number of sets is greater than the third threshold, set the current one, then set the encoding for the current original image. The in-frame coding unit is used to compress the setting to perform the in-frame coding. The original image is a -! frame. The inter-frame composing unit is used to calculate the current original image encoded by the frame as a frame, and the output unit is used to reduce the ink to a frame and a frame. The original image is sequentially output as the bit stream of the video. ❹ ❹ Furthermore, another object of the present invention is to provide a photographic device having a video encoding function. , including ··· camera unit deaf unit, - judging unit, _ in-frame coding unit, motion estimation discriminating module, an output unit and a storage unit. The camera single π is used to record the complex continuous original The input unit sequentially receives one of the original images as a reference original image, and the successive original image is a current original image. The determining unit is configured to determine that the current original image should be compressed by in-frame coding or inter-frame coding, The determining unit comprises: an extracting module, a pixel difference discriminating module, a histogram difference discriminating module and a motion estimation discriminating module. The extracting module is configured to extract a plurality of pixels of the plurality of lines of the reference original image. Generating a reference pixel data and a reference histogram data, and extracting a plurality of pixels of the plurality of scan lines of the current original image to generate a current pixel data and a current histogram data. The pixel difference discrimination module is configured to use the current pixel data Subtracting the reference pixel data to generate a pixel difference and normalizing, and then determining whether the pixel difference is greater than or equal to a first threshold weight of 200945902, then • determining the current original image into the discriminating module for the current 粁 方 (4) μ罝方图差 ▲ The current histogram data is subtracted from the reference histogram data to generate the histogram difference and normalized, Α The standardization of the taxis determines whether the histogram difference is greater than or equal to the first threshold, and if so, the current original image is intra-coded by the $. The motion estimation discriminating module calculates the complex macroblock of the current original image. The number of codes in the frame is a huge number of blocks, and when the number of macro blocks is calculated, and whether the number of macro blocks is greater than a third door threshold value, the current original book binding frame is set. Intra-coded, otherwise, set to the current original image = inner coding unit is used to compress the setting to perform intra-frame coding, and the original image is -I frame. The inter-frame coding unit is used to calculate the current continuous inter-frame coding. The original image is a -p frame. The input is to reduce the (4) to the original image of the frame and the P frame, which is sequentially output as the bit stream of the video. The storage unit is used to feed the bit stream of the video. The invention has the advantages that it is early to determine that each current original image should be a frame or a P frame, which effectively reduces the computing load of the system, especially when the reference original image and the current original image include scene transition: Significant. [Embodiment] The foregoing and other technical contents, features and effects of the present invention are clearly shown in the following detailed description with reference to a preferred embodiment of the drawings. The preferred embodiment of the video coding system of the present invention is implemented by an integrated circuit (IC) chip, and is applied to a photographic device that requires a video encoding function. However, it is not limited thereto, and can be applied to any electronic device that requires video encoding function. The photographic device includes a camera unit 2 and a __ storage unit 3. The camera unit 2 includes a lens module (not shown) in the preferred embodiment for obtaining a plurality of consecutive original images after shooting (Raw Image) And the storage unit 3 is configured to store a bit stream (out of Stream) of the video processed by the encoding system. If the photographic device is a documentary camera, the storage unit 3 can record the bit stream of the video for a long time. If the photographic device is of a transmission nature, such as a video servo device applied to a video conference, the storage unit 3 can temporarily record the bit stream of the video, and then transmit the bit stream to at least one receiving video through an internet network. Terminal device. The encoding system 1 includes an input unit u, a judging unit 12, an in-frame encoding unit 13, an inter-frame encoding unit 14, and an output unit 15, all of which are designed and manufactured by electronic circuits. The input unit 11 receives the "original image, and sets the original image of the towel_original image to the reference original image" after the reference original image as a current original image. The determining unit 12 determines that each of the current original images should be The frame code is compressed into an I frame, or is compressed into a p frame by the interframe coding. The determining unit 12 includes an extraction module 121, a pixel difference discrimination module 122, and a histogram difference discrimination module 123. And a motion estimation discriminating module 124. Referring to Figures 1 and 3, the extracting module 121 can extract (Fetd〇 reference to the complex pixels (PM) of the complex scanning line (Sean Line) 41 of the original image 4, in the preferred embodiment In the example and as shown in FIG. 2, the resolution 10 200945902 of the original image 4 is 320 pixels x 240 pixels, and the extracted sweep line is five horizontal scanning lines 41 spaced apart from each other. The entire scan line 41 is not extracted. The reason is that the computational energy can be greatly saved and the efficiency of the judgment is accelerated. The extraction module i2i extracts the pixel and generates a reference pixel data and a reference histogram data. It must be stated that the reference pixel data refers to the reference silk image 4 In five scanning lines 41, each pixel of the three primary colors: red, green, and blue (Red, .η,

Blue’ RGB)的彩色值。而參考直方圖資料是指參考原始影 像4的五條掃描線41的圖形顏色或亮度特徵分布的統計直 ❹ 方圖。 同理,提取模組121提取現行原始影像的複數掃描線 的複數像素,而現行原始影像中被提取的掃描線係與上述 如圖2所示之參考原始影像4的五條水平掃描線41是相互 對應的。特別要說明的是,參考原始影像4的參考像素資 料與參考直方圖資料,及現行原始影像的現行像素資料與 現行直方圖資料的提取方式係為現有影像壓縮技術的步驟 之一,因此不再贅述。 參閱圖1 ’像素差值判別模組122依據現行像素資料及 參考像素資料計算出-正規化之㈣差值(pixd贿⑽似 ),其中像素差值正規化後的數值範圍是〇〜丨。計算像素差 值係為S有摘測影像畫面變化相關研究中常見的判斷方法 之一,並非本發明之重點,因此不再贅述。像素差值判別 模組122㈣斷像素差值是否大於等於一第—門檀值,在 本較佳實施例中,第一門禮值設為〇5。若是,則代表現行 原始影像及參考原始影像間的差異性較大,因此判斷單元 11 200945902 12設定對現行原始影像進行框内編碼。若像素差值小於〇5 ’則像素差值制模組122將現行原始料交由直方圖差 值判別模組123繼續處理。 直方圖差值判別模!且123處理上述像素差值小於〇 5的 現行原始影像。直方圖差值判別模組123依據現行直方圖 資料及參考直方圖資料計算出—正規化之直方圖差值(The color value of Blue' RGB). The reference histogram data refers to a statistical histogram of the distribution of the color or brightness characteristics of the five scanning lines 41 of the original image 4. Similarly, the extraction module 121 extracts the complex pixels of the complex scan lines of the current original image, and the extracted scan lines in the current original image and the five horizontal scan lines 41 of the reference original image 4 shown in FIG. 2 are mutually corresponding. In particular, reference to the reference pixel data and reference histogram data of the original image 4, and the current pixel data of the current original image and the current histogram data extraction method are one of the steps of the existing image compression technology, and therefore no longer Narration. Referring to FIG. 1 , the pixel difference discrimination module 122 calculates a normalized (four) difference (pixd bribe (10) like) according to the current pixel data and the reference pixel data, wherein the value range after the pixel difference is normalized is 〇 丨 丨. The calculation of the pixel difference value is one of the common judgment methods in the study of the change of the image of the extracted image, and is not the focus of the present invention, so it will not be described again. The pixel difference discrimination module 122 determines whether the pixel difference value is greater than or equal to a first gate value. In the preferred embodiment, the first gate value is set to 〇5. If yes, it means that the difference between the current original image and the reference original image is large, so the determining unit 11 200945902 12 sets the in-frame encoding of the current original image. If the pixel difference is less than 〇5', the pixel difference module 122 passes the current original material to the histogram difference value discriminating module 123 for further processing. Histogram difference discrimination mode! And 123 processes the current original image whose pixel difference is less than 〇 5. The histogram difference discriminating module 123 calculates a normalized histogram difference based on the current histogram data and the reference histogram data (

Hmogram Difference )’其中直方圖差值正規化後的數值範 圍都是0〜卜和像素差值相同,計算直方圖差值係為現有偵 ❿ ㈣像畫面變化相關研究t常見的判斷方法之―,也非本 發明之重點’因此不再贅述。直方圖差值判別模組123再 判斷直方圖差值是否大於等於一第二門檻值,在本較佳實 施例中帛—門檻值設為〇8。若是,則代表現行原始影像 及參考原始影像間的差異性較大,因此判斷單元12設定對 現行原始影像進行框内編碼。若直方圖差值小於q 8,則直 方圖差值判別模組!23將現行原始影像交由運動估計判別 模組124繼續處理。 ❹ 運動估計判別模組124接收上述直方圖差值小於〇 8的 現行原始影像,並計算現行原始影像之複數巨集塊⑽咖 Block)預定進行框内編碼的數量為—巨集塊數量並於計 算巨集塊數量的同時,即時地判斷巨集塊數量是否大於等 於第二門檻值。舉例來說,現行原始影像的巨集塊的數 〇而第二門檻值設為200 ’當運動估計判別模組 124計算到現行原始影像的巨集塊中第細個預定進行框内 編碼的巨集塊時,則判斷單元12設定對現行原始影像預設 12 200945902 進行框内編碼,反之,則判斷單元12設定對現行原始影像 進行框間編碼。 必須注意的是,為達到最佳的運算效能,第三門檻值 並不限疋預設為常數,而可以依據上述直方圖差值彈性調 整。在本較佳實施例中,第三門檻值=巨集塊的總數一(一 基本巨集塊的數量+基本巨集塊的數量χ該正規化之直方圖 差值)。例如,巨集塊的總數為3〇〇個,基本巨集塊的數量 為100個,而現行原始影像和參考原始影像的正規化之直 © 方圖差值為0.6,則第三門檻值= 300- ( 100+Ι00χ0.6)= 140個。其原理在於,若現行原始影像和參考原始影像的直 方圖差值越高,則代表現行原始影像與參考原始影像的差 異性越大,並應該進行框内編碼。上述第三門檻值的計算 方式可以提升運動估計判別模組124判斷現行原始影像進 行框内編碼的效率,大幅增加運算的效能。 框内編碼單元13對騎單元12處理後,且設定為框 ㈣碼之現行原始景彡像施以框㈣碼之處理。被框内編瑪 的現&lt;了原始影像稱為:訊框,是__獨立壓縮的影像訊框。 框間編碼單元14對判斷單元12處理後,且設定為框 、馬之見行原始影像施以框間編碼之處理。被框間編碼 的現订原始影像稱為Ρ訊框,是一利用參考原始影像模擬 出的影像訊框,和現行原始影像相比,ρ訊框所佔用的位元 數極少。 輸出單元15將該等已進行框内編碼及框間編竭之現行 原始影像,也就是—連串的1訊框及Ρ訊框順序地輸出為視 13 200945902 訊之位元流,以供儲存單元3記錄。 參閱圖卜3’本發明視訊編碼方法之較佳實施例,適 用於安裝上述編碼系統丨的攝影裝置上,並包含下列步驟 首先,如步驟51料’攝像單元2透過鏡頭模組記錄 包括連續之原始影像之原始視訊。 然後,如步驟52所示,輸入單元u依序接收其中一原 e ❹ 始影像為參考原始影像,及連續之下一原始影像為現 始影像。 μ 接著,如步驟53所示,判斷單元12判斷現行原始影 像應以框内編碼壓縮為!訊框,或以框間編碼壓縮為ρ訊框 ’其包括下列子步驟: 參閱圖1、4 ’首先’如子步驟531所示,提取模組 121提取參考㈣轉之掃描線之像素產生參考像素資料 與參考直方圖資料。 然後,如子步驟532所示,提取模组121提取現行原 。影像之掃描線之像素’產生現行像素t料及 資料。 接著,如子步驟533所示,依據現行像素資料及參考 素資料汁算出正規化之像素差值’再判斷像素差值是否 於等於第-門檻值(本較佳實施例中設為〇 5)。若是, 則如子步驟534所示’騎單元12設定對現行原始影像進 仃框内編碼。 若像素差值小於第一門檻值,則如子步驟535所示, 14 200945902 直方圖差值判別模組123依據現行直方圖資料及參考直方 圖資料計算出正規化之直#圖差值,再判斷I方圖差值是 否大於等於第二門捏值(在本較佳實施例中設為〇.8)。若 是,則如子步驟534所示,判斷單元12設定對現行原始影 像進行框内編碼。 若直方圖差值小於第二門檀值,則如子步驟別所示 由運動估計判別模組124計算現行原始影像之所有巨隼塊 ❹ Ι:=Γ編碼的數量為巨集塊數量,並於計算巨集 值:巨的隼同:’即時地判斷巨集塊數量是否大於第三門楹 值。右巨集塊數量大於笫二 ,„ 一 、 一門檻值,則如子步驟534所示 若定對該現行原始影像進行框内編碼。反之, τ原始影像之所有巨集塊都計算 小於等於第三門檻值,則如子 而巨集塊數篁 12設定對現^驟537所示,對判斷單元 檻值並不限於設定為常數^編碼°如則所述,第三門 值彈性地調整。 °以依據正規化之直方圖差 參閱圖1、3 ’若判斷單元 &amp; * 框内編碼,則如步驟54 3又疋對現行原始影像進行 始影像進行框内編碼,以二框内編碼單元13對現行原 定對現行原始影像進行^;^1訊框。若判斷單元U設 編碼單元Μ #現行原始雄/則如步心5所示,框間 框。 進仃框間編碼,以壓縮為P訊 接著,如步驟56所示,輪 順序地輪出為視訊之位元漭,、兀15將I訊框及P訊框 以取代原本的連績原始影像 15 200945902 然後,如步驟57所示,儲存單元3儲存視訊之位元流 。若攝影裝置為攝影機,則儲存單元3可長時間記錄視訊 的位元流。若攝影裝置為應用於視訊會議的視訊伺服裝置 ,則儲存單元3可暫時記錄視訊的位元流,再透過網際網 路將位元流傳送至接收用的視訊終端裝置。 利用本發明及習知技術對下列四段測試影片進行影片 編碼實驗,其中前三段測試影片為包括較少場景轉換(Shot 〇 Change ) 的影片 , 而 檔名為Hmogram Difference )' The numerical range after the histogram difference is normalized is 0~b and the pixel difference is the same. Calculating the histogram difference is the existing detection method. (4) The common judgment method of image change related research- Nor is it the focus of the present invention 'and therefore will not be described again. The histogram difference discriminating module 123 further determines whether the histogram difference is greater than or equal to a second threshold. In the preferred embodiment, the threshold value is set to 〇8. If so, the difference between the current original image and the reference original image is large, so the judging unit 12 sets the in-frame encoding of the current original image. If the histogram difference is less than q 8, the histogram difference discriminating module! 23 The current original image is passed to the motion estimation discriminating module 124 for further processing. ❹ The motion estimation discriminating module 124 receives the current original image whose histogram difference is less than 〇8, and calculates the number of macroblocks (10) in the current original image, and the number of in-frame coding is determined as the number of macroblocks. While calculating the number of macroblocks, it is immediately determined whether the number of macroblocks is greater than or equal to the second threshold. For example, the current macroblock of the original image has a number of blocks and the second threshold is set to 200'. When the motion estimation discriminating module 124 calculates the smallest block in the macroblock of the current original image, the in-frame encoding is required. When the block is set, the determining unit 12 sets the intra-frame encoding of the current original image preset 12 200945902. Otherwise, the determining unit 12 sets the inter-frame encoding of the current original image. It must be noted that in order to achieve the best computing performance, the third threshold is not limited to a preset constant, but can be elastically adjusted according to the histogram difference described above. In the preferred embodiment, the third threshold value = the total number of macroblocks (the number of basic macroblocks + the number of basic macroblocks, the normalized histogram difference). For example, the total number of macroblocks is 3, and the number of basic macroblocks is 100. However, the difference between the current original image and the reference original image is 0.6, and the third threshold is 300- (100+Ι00χ0.6)=140. The principle is that if the histogram difference between the current original image and the reference original image is higher, it means that the difference between the current original image and the reference original image is larger, and the in-frame coding should be performed. The calculation method of the third threshold value can improve the efficiency of the motion estimation discriminating module 124 to determine the current intra-frame coding of the original original image, and greatly increase the performance of the operation. The in-frame coding unit 13 processes the current original scene image of the frame (four) code after the processing by the riding unit 12, and applies the frame (four) code. The original image that is framed in the frame is called a frame, which is an __independently compressed image frame. After the inter-frame coding unit 14 processes the determination unit 12, it is set as the processing of inter-frame coding by the frame and the horse's original image. The current original image encoded by the frame is called a frame, and is an image frame simulated by the reference original image. The number of bits occupied by the frame is very small compared with the current original image. The output unit 15 sequentially outputs the current original image that has been intra-frame coded and inter-frame-edited, that is, the series of 1-frames and frames, which are sequentially output as the bit stream of the video 13 200945902 for storage. Unit 3 records. Referring to FIG. 3, a preferred embodiment of the video encoding method of the present invention is applicable to a photographing apparatus for installing the above encoding system, and includes the following steps. First, as shown in step 51, the recording unit 2 records through the lens module including continuous Original video of the original image. Then, as shown in step 52, the input unit u sequentially receives one of the original images as the reference original image, and successively the next original image as the current image. μ Next, as shown in step 53, the judging unit 12 judges that the current original image should be compressed by the in-frame encoding as! Frame, or inter-frame coding compression into a frame </ RTI> which includes the following sub-steps: Referring to Figures 1, 4 'First', as shown in sub-step 531, the extraction module 121 extracts the pixel of the reference (four)-turned scan line to generate a reference. Pixel data and reference histogram data. Then, as shown in sub-step 532, the extraction module 121 extracts the current origin. The pixel of the scan line of the image produces the current pixel material and data. Then, as shown in sub-step 533, the normalized pixel difference value is calculated according to the current pixel data and the reference material data juice to determine whether the pixel difference value is equal to the first threshold value (set to 〇5 in the preferred embodiment). . If so, then as shown in sub-step 534, the riding unit 12 sets the intra-frame encoding of the current original image. If the pixel difference is less than the first threshold, as shown in sub-step 535, the 14 200945902 histogram difference discriminating module 123 calculates the normalized direct graph difference based on the current histogram data and the reference histogram data, and then It is judged whether or not the I square map difference is greater than or equal to the second threshold value (set to 〇.8 in the preferred embodiment). If so, then as indicated by sub-step 534, decision unit 12 sets the in-frame encoding of the current original image. If the histogram difference is smaller than the second threshold value, the motion estimation discriminating module 124 calculates all the giant blocks of the current original image as shown in the sub-steps: Γ the number of the Γ codes is the number of macro blocks, and For calculating the macro value: the huge difference: 'Immediately determine whether the number of macro blocks is greater than the third threshold. If the number of right macroblocks is greater than 笫2, „一、一槛值, if the current original image is intra-coded as shown in sub-step 534. Conversely, all macroblocks of τ original image are calculated to be less than or equal to The three thresholds are as follows, and the number of macroblocks 篁12 is set as shown in the current step 537. The threshold value of the judgment unit is not limited to being set as a constant ^ code. As described above, the third threshold value is elastically adjusted. ° According to the normalized histogram difference, refer to Figure 1, 3 'If the judgment unit &amp; * frame code, then in step 54 3, the current original image is in-frame coded, and the two-frame coding unit is used. 13 For the current original to the current original image ^ ^ ^ 1 frame. If the judgment unit U set the coding unit Μ # current original male / then as shown in step 5, the box between the boxes. Then, as shown in step 56, the wheel sequentially turns out to be the bit of the video, and the frame 15 replaces the original frame and the P frame to replace the original original image 15 200945902 Then, as in step 57 The storage unit 3 stores the bit stream of the video. For the camera, the storage unit 3 can record the bit stream of the video for a long time. If the camera device is a video server applied to the video conference, the storage unit 3 can temporarily record the bit stream of the video and then place the bit through the Internet. The element stream is transmitted to the receiving video terminal device. The following four test films are subjected to a film encoding experiment using the present invention and the prior art, wherein the first three test films are films including less scene change (Shot 〇 Change), and File name

High_Motion—and_Shot_Change.yuv 的測試影片中貝1J 包括大 量的場景轉換。實驗後,可於編碼時間上取得如表1所示 之結果。 表1 測試影片的檔名 編碼時間 (先前技術) 編碼時間 (本發明) VideoConferencel .yuv 31313 ms 31251 ms Webcammoving.Yuv 27110 ms 26985 ms Video_Conference2.yuv 39469 ms 39251 ms HighMotionand ShotChange.yuv 45016 ms 39454 ms 16 200945902 由本發月考先别技術之編石馬時間的比較可以發現,本 發明在-般的測試影片中和習知技術相比具有同等功效, 而在包括大量場景轉換的影片中,則比習知技術更能大幅 減少編碼時間。 綜上所述,在執行運動估計前,利用本發明之視訊編 碼方法提早判斷每-現行原始影像應壓縮為〗訊框或p訊框 ’確實能有效減少嵌式系統的運算負冑。特別是當參考原 始影像及現行原始影像間包括大量的場景轉換時,其效果 ^ 更為顯著。 惟以上所述者,僅為本發明之較佳實施例而已,當不 能以此限定本發明實施之範圍,即大凡依本發明申請專利 範圍及發明說明内容所作之簡單的等效變化與修飾,皆仍 屬本發明專利涵蓋之範圍内。 【圖式簡單說明】 圖1是一系統方塊圖’說明本發明之具視訊編碼功能 之攝影裝置的較佳實施例; Q β 圖2是一晝面示意圖’說明較佳實施例之複數掃描線 圖3是一流程圖,說明較佳實施例之運作流程;及 圖4是一流程圖,說明本發明之視訊編碼方法的較佳 實施例。 17 200945902 【主要元件符號說明】 1…… •…編碼糸統 13......... •框内編碼單元 11 ••… •…輸入單元 14......... •框間編碼早元 12·.··. •…判斷單元 15......... _輸出單元 121… •…提取模組 2 .......... •攝像單元 122… •…像素差值判別 3 .......... •儲存單元 模組 4 .......... 參考原始影像 123… •…直方圖差值判 41......... 掃描線 別模組 51 〜57·.·· 步驟 124… •…運動估計判別 53 卜537 子步驟 模組The test film of High_Motion—and_Shot_Change.yuv contains a large number of scene transitions. After the experiment, the results as shown in Table 1 can be obtained at the encoding time. Table 1 File name encoding time of test film (previous technique) Encoding time (invention) VideoConferencel .yuv 31313 ms 31251 ms Webcammoving.Yuv 27110 ms 26985 ms Video_Conference2.yuv 39469 ms 39251 ms HighMotionand ShotChange.yuv 45016 ms 39454 ms 16 200945902 It can be found from the comparison of the chronograph time of the prior art, the present invention has the same effect in the general test film as compared with the prior art, and in the film including a large number of scene conversions, it is better than the conventional one. Technology can significantly reduce coding time. In summary, before performing motion estimation, using the video coding method of the present invention to determine early that each current original image should be compressed into a frame or a p-frame can effectively reduce the operational deficit of the embedded system. Especially when a large number of scene transitions are included between the reference original image and the current original image, the effect ^ is more significant. The above is only the preferred embodiment of the present invention, and the scope of the invention is not limited thereto, that is, the simple equivalent changes and modifications made by the scope of the invention and the description of the invention are All remain within the scope of the invention patent. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram showing a preferred embodiment of a photographing apparatus having a video encoding function according to the present invention; FIG. 2 is a schematic diagram showing a plurality of scanning lines of the preferred embodiment. 3 is a flow chart illustrating the operational flow of the preferred embodiment; and FIG. 4 is a flow chart illustrating a preferred embodiment of the video encoding method of the present invention. 17 200945902 [Explanation of main component symbols] 1... •...Encoding system 13......... • In-frame coding unit 11 ••... •...Input unit 14......... Inter-frame coding early element 12····.... judgment unit 15........._output unit 121... •... extraction module 2 ........... camera unit 122 ... • Pixel difference discrimination 3 .......... • Storage unit module 4 .......... Reference original image 123... •... Histogram difference judgment 41... ...... Scanning line module 51 ~ 57 ·.·· Step 124... •...Motion estimation discriminator 53 Bu 537 Substep module

1818

Claims (1)

200945902 十、申請專利範園: 1. 一種視訊編碼方法,包含下列步驟: (a) 提取一參考原始影像之複數掃描線之複數像素, 產生一參考像素資料與一參考直方圖資料; (b) 提取一現行原始影像之複數掃描線之複數像素, 產生一現行像素資料及一現行直方圖資料; (c) 依據該現行像素資料及該參考像素資料計算出一 正規化之像素差值,再判斷該像素差值是否大於等於一 第一門檻值,若是,則設定對該現行原始影像進行框内 編碼; (d) 若該像素差值小於該第一門檻值,則依據該現行 直方圖資料及該參考直方圖資料計算出一正規化之直方 圖差值,再判斷該直方圖差值是否大於等於一第二門檻 值,若是,則設定對該現行原始影像進行框内編碼;200945902 X. Patent application garden: 1. A video coding method, comprising the following steps: (a) extracting a plurality of pixels of a plurality of scanning lines of a reference original image to generate a reference pixel data and a reference histogram data; (b) Extracting a plurality of pixels of a plurality of scan lines of a current original image to generate a current pixel data and a current histogram data; (c) calculating a normalized pixel difference value according to the current pixel data and the reference pixel data, and then determining Whether the pixel difference value is greater than or equal to a first threshold value, and if so, setting an intra-frame encoding of the current original image; (d) if the pixel difference value is less than the first threshold value, according to the current histogram data and Calculating a normalized histogram difference value by using the reference histogram data, and determining whether the histogram difference is greater than or equal to a second threshold value, and if so, setting an intra-frame encoding of the current original image; (e) 若該直方圖差值小於該第二門檻值,則計算該現 行原始影像之複數巨集塊預定進行框内編碼的數量為一 巨集塊數量,並於計算該巨集塊數量的同時,即時地判 斷該巨集塊數量是否大於一第三門檻值;及 (f) 當該巨集塊數量大於該第三門檻值時,則設定對 該現行原始影像進杆維&amp; 仃C内編碼,反之,則設定對該現行 原始影像進行框間編碼。 依據申清專利範圍第1 該(a)步驟及該(b)步驟中 描線之數量為3至8條 項所述之視訊編碼方法,其中在 ’該參考原始影像中被提取之掃 ,且該現行原始影像中被提取之 19 2. 200945902 掃描線之數量依據該參考原始影像中被提取之掃描線之 數量’對應地設為3至8條。 3.依據申請專利範圍第丨項所述之視訊編碼方法,其中在 該(c)步驟中,該第一門檻值設為 0.4 至 0.6 。 4·依據申請專利範圍第丨項所述之視訊編碼方法其中在 該(d)步驟中,該第二門檻值設為 0.7 至 0.9 。 5. 依據申請專利範圍第丨項所述之視訊編碼方法,其中在 該(e)步驟中,該第三門檻值=該等巨集塊之總數—(一 © 基本巨集塊之數量+該基本巨集塊之數量X該正規化之直 方圖差值)。 6. —種視訊編碼系統,用以壓縮複數連續之原始影像,並 包含: 一輸入單兀,依序接收其中一原始影像為一參考原 始影像,及連續之下一原始影像為一現行原始影像; 判斷單元’用以決定該現行原始影像應以框内編 碼或框間編碼壓縮,該判斷單元包括: 一提取模組,用以提取該參考原始影像之複數掃描 線之複數像素,產生一參考像素資料與一參考直方圖資 料,另外,提取該現行原始影像之複數掃描線之複數像 素’產生一現行像素資料及一現行直方圖資料, 一像素差值判別模組,用以將該現行像素資料減去 該參考像素資料產生一像素差值並正規化,再判斷該像 素差值是否大於等於一第一門檻值,若是,則設定對該 現行原始影像進行框内編碼, 20 200945902 一直方圖差值判別模組,用以將該現行直方圖資料 減去該參考直方圖資料產生—直方圖差值並正規化,再 判斷該直方圖差值是否切㈣—第二⑽值,若是, 則設定對該現行原始影像進行框内編碼,及 一運動估計判別模組,計算該現行原始影像之複數 巨集塊預定進行框内編碼的數量為―巨集塊數量,並於 計算該巨集塊數量的同時,即時地判斷該巨集塊數量是 否大於第二門檻值’當該巨集塊數量大於該第三門檻 ® 值時’則設定對該現行原始影像進行框内編碼,反之, 則設定對該現行原始影像進行框間編碼, 一框内編碼單元,m«設定為進行框内編碼 之現行原始影像為一 I訊框; :框間編碼單元1料算該設定為進行框間編碼 之現行原始影像為一 P訊框;及 輸出單元,用以將該等壓縮為I訊框及p訊框之 原始影像順序地輸出為一視訊之位元流。 © 7.依據申請專利範圍第6項所述之視訊編碼系統,其中該 判斷單元之提取模組設定該參考原始影像中被提取之掃 描線之數量為3 8條,且該現行原始影像中被提取之 掃描線之數量依據該參考原始影像巾被提取之掃描線之 數量’對應地設為3至8條。 8.依據:請專利範圍第6項所述之視訊編碼系統,其中該 判斷單π之像素差值判別模組設定該第—門檀值設為〇 · 4 至 0·6 〇 21 200945902 專利範圍第6項所述之視訊編碼系統,其中該 ,早…方圖差值判別模組設定該第二門檻 0.7 至 〇.9 〇 10·依射請專利範圍第6項所述之視訊編碼系統,其中該 ^斷單7〇之運動估計判別模組設定該第三門播值=該等巨 集塊之總數一Γ 一其士 口 # (基本巨集塊之數量+該基本巨集塊之 數量X該正規化之直方圖差值)。 11· 一種具視訊編碼功能之攝影裝置,包含:(e) if the histogram difference is less than the second threshold value, calculating the number of in-frame coding of the complex macroblock of the current original image as a macroblock number, and calculating the number of the macroblocks At the same time, it is determined whether the number of the macroblocks is greater than a third threshold value; and (f) when the number of the macroblocks is greater than the third threshold value, setting the current original image into the pole dimension &amp; The inner code, on the other hand, sets the inter-frame coding of the current original image. According to the patent clearing range of the first paragraph (a) and the step (b), the number of lines is 3 to 8, wherein the image is extracted in the reference original image, and the Extracted from the current original image 19 2. 200945902 The number of scan lines is correspondingly set to 3 to 8 according to the number of extracted scan lines in the reference original image. 3. The video encoding method according to the scope of the patent application, wherein in the step (c), the first threshold is set to be 0.4 to 0.6. 4. The video coding method according to the scope of the patent application, wherein in the step (d), the second threshold is set to 0.7 to 0.9. 5. The video encoding method according to the scope of the patent application, wherein in the step (e), the third threshold value = the total number of the macro blocks - (the number of one of the basic macro blocks + The number of basic macroblocks X is the normalized histogram difference). 6. A video encoding system for compressing a plurality of consecutive original images, and comprising: an input unit, sequentially receiving one of the original images as a reference original image, and continuously lowering the original image as a current original image The determining unit is configured to determine that the current original image should be compressed by intra-frame coding or inter-frame coding, and the determining unit comprises: an extraction module, configured to extract a plurality of pixels of the complex scan line of the reference original image to generate a reference Pixel data and a reference histogram data, and extracting a plurality of pixels of the plurality of scan lines of the current original image to generate a current pixel data and a current histogram data, and a pixel difference discrimination module for using the current pixel Subtracting the reference pixel data to generate a pixel difference value and normalizing, and then determining whether the pixel difference value is greater than or equal to a first threshold value, and if so, setting the current original image to be intra-coded, 20 200945902 a difference discriminating module for subtracting the current histogram data from the reference histogram data to generate The difference value is normalized, and then the difference between the histogram difference is determined (4)-the second (10) value, and if so, the current original image is intra-coded, and a motion estimation discriminating module is calculated to calculate the current original image. The number of in-frame coding of the complex macroblock is determined to be the number of macroblocks, and when the number of the macroblocks is calculated, it is immediately determined whether the number of macroblocks is greater than the second threshold value. If the number is greater than the third threshold® value, then the current original image is intra-coded. Otherwise, the current original image is inter-frame encoded, and the in-frame coding unit, m« is set to perform in-frame coding. The current original image is an I frame; the inter-frame coding unit 1 calculates that the current original image set to perform inter-frame coding is a P-frame; and an output unit for compressing the I-frame and The original image of the p-frame is sequentially output as a bit stream of a video. The video encoding system according to claim 6, wherein the extracting module of the determining unit sets the number of extracted scanning lines in the reference original image to be 38, and the current original image is The number of extracted scan lines is correspondingly set to 3 to 8 according to the number of scan lines extracted from the reference original image towel. 8. Basis: The video coding system described in claim 6 of the patent scope, wherein the pixel difference value discriminating module of the judgment unit π sets the first gate value to 〇·4 to 0·6 〇21 200945902 Patent scope The video encoding system according to Item 6, wherein the early square difference value discriminating module sets the video encoding system according to the second threshold 0.7 to 〇.9 〇10· The motion estimation discriminating module of the 断 单 〇 设定 设定 = = = = = = = = = 第三 第三 第三 第三 第三 第三 第三 第三 第三 第三 第三 第三 第三 第三 第三 第三 第三 第三 第三 第三 第三 其 其 其 其 其 其 其The number X is the normalized histogram difference). 11· A photographic device with video coding function, comprising: 一攝像單元,用以記錄複數連續之原始影像; 一輸入單元’依序接收其中一原始影像為一參考原 始影像,及連續之下一原始影像為一現行原始影像; —判斷單元,用以決定該現行原始影像應以框内編 碼或框間編碼壓縮,該判斷單元包括: 一杈取模組,用以提取該參考原始影像之複數掃描 線之複數像素,產生一參考像素資料與一參考直方圖資 料,另外,提取該現行原始影像之複數掃描線之複數像 素’產生一現行像素資料及一現行直方圖資料, 一像素差值判別模組,用以將該現行像素資料減去 該參考像素資料產生一像素差值並正規化,再判斷該像 素差值是否大於等於一第一門檻值,若是,則設定對該 現行原始影像進行框内編碼, 一直方圖差值判別模組,用以將該現行直方圖資料 減去該參考直方圖資料產生一直方圖差值並正規化,再 判斷該直方圖差值是否大於等於一第二門檻值,若是, 22 200945902 則設定對該現行原始影像進行框内編碼及 一運動估計判別模組,計算該現行原始影像之複數 巨集塊預定進行框内編碼的數量為—巨集塊數量,並於 計算該巨集塊數量的同時, 時即時地判斷該巨集塊數量是 否大於一第三門檻值,當 巨集塊數量大於該第三門檻 值^則設定㈣現行原始影像進行框 内編碼,反之^ 則設定對該現行原始影像進行框間編碼, 一框内編碼單元,用 ❹An image capturing unit is configured to record a plurality of consecutive original images; an input unit sequentially receives one of the original images as a reference original image, and successively the next original image is a current original image; The current original image should be compressed by in-frame coding or inter-frame coding. The determining unit includes: a capturing module for extracting a plurality of pixels of the plurality of scanning lines of the reference original image, and generating a reference pixel data and a reference quadrangle In addition, the plurality of pixels of the plurality of scan lines of the current original image are extracted to generate a current pixel data and a current histogram data, and a pixel difference discrimination module is configured to subtract the current pixel data from the reference pixel. The data generates a pixel difference and normalizes, and then determines whether the pixel difference value is greater than or equal to a first threshold value, and if so, sets an intra-frame encoding of the current original image, and the square graph difference discriminating module is used to Subtracting the current histogram data from the reference histogram data to generate a histogram difference and normalizing it, and then judging Whether the histogram difference is greater than or equal to a second threshold value, and if so, 22 200945902 sets an intra-frame coding and a motion estimation discriminating module for the current original image, and calculates a complex macroblock of the current original image to be performed in the frame. The number of codes is - the number of macroblocks, and when calculating the number of the macroblocks, it is immediately determined whether the number of macroblocks is greater than a third threshold value, and when the number of macroblocks is greater than the third threshold value ^ Then, (4) the current original image is encoded in the frame, and vice versa, the inter-frame coding is performed on the current original image, and the coding unit in the frame is used. _ 壓縮該設定為進行框内編碼 之現行原始影像為一I訊框. 一框間編碼單元, 之現行原始影像為一 ρ 用以計算該設定為進行框間編碼 sfl 框; 輸出單it用以將該等壓縮為I訊框及p訊框之 原始影像順序地輸出為一視訊之位元流;及 儲存單70,用精存該視訊之位元流。 12. 依據巾4專利fe圍第丨丨項所述之具視訊編碼功能之攝影 裝置’、中。亥判斷單几之提取模組設定該參考原始影像 中被提取之掃描線之數量為3至8條,且該現行原始影 像中被提取之掃描線之數量依據該參考原始影像中被提 取之掃描線之數量,對應地設為3至8條。 13. 依據圍第u項所述之具視訊編碼功能之攝影 裝置*中該判斷單元之像素差值判別模組設定該第一 門權值設為0.4至〇.6。 14.依據申請專利範圍第u 裝置,其中該判斷單元 項所述之具視訊編碼功能之攝影 之直方圖差值判別模組設定該第 23 200945902 二門檻值設為0.7至0.9。 I5·依據申請專利範圍第12 壯班廿丄 巧所述之具視訊編碼功能之攝影 裝置’其中該判斷單元 ^運動估計判別模組設定該第三 門檻值=該等巨隼娩 果塊之總數~( 一基本巨集塊之數量+該 基本巨集塊之數量X該正規化之直方圖差值)。_ Compress the current original image that is set to be in-frame coded as an I frame. The inter-frame coding unit, the current original image is a ρ used to calculate the setting for the inter-frame coding sfl frame; The original images compressed into the I frame and the p frame are sequentially output as a bit stream of a video; and the storage unit 70 is used to stream the bit stream of the video. 12. In accordance with the photographic apparatus having the video coding function described in the section of the patent of the sac. The number of scan lines extracted from the reference original image is set to 3 to 8, and the number of scan lines extracted in the current original image is based on the extracted scan in the reference original image. The number of lines is correspondingly set to 3 to 8. 13. The pixel difference discriminating module of the judging unit in the photographing device* having the video encoding function described in item u sets the first threshold weight to be 0.4 to 〇.6. 14. According to the apparatus of claim 5, wherein the histogram difference discriminating module of the video encoding function described in the determining unit sets the second threshold of the 23rd 200945902 to be 0.7 to 0.9. I5· According to the patent application scope 12th, the camera device with video coding function described in the patent application scope] wherein the judgment unit ^ motion estimation discriminating module sets the third threshold value = the total number of the giant fruit pieces ~ (the number of basic macroblocks + the number of the basic macroblocks X, the normalized histogram difference). 〇 24〇 24
TW97115690A 2008-04-29 2008-04-29 Method for video encoding and the application ther TWI355855B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW97115690A TWI355855B (en) 2008-04-29 2008-04-29 Method for video encoding and the application ther

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW97115690A TWI355855B (en) 2008-04-29 2008-04-29 Method for video encoding and the application ther

Publications (2)

Publication Number Publication Date
TW200945902A true TW200945902A (en) 2009-11-01
TWI355855B TWI355855B (en) 2012-01-01

Family

ID=44869886

Family Applications (1)

Application Number Title Priority Date Filing Date
TW97115690A TWI355855B (en) 2008-04-29 2008-04-29 Method for video encoding and the application ther

Country Status (1)

Country Link
TW (1) TWI355855B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI568250B (en) * 2015-01-28 2017-01-21 財團法人工業技術研究院 Encoding method and encoding device
US9892338B2 (en) 2015-01-28 2018-02-13 Industrial Technology Research Institute Encoding method and encoder for constructing an initial color table

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI568250B (en) * 2015-01-28 2017-01-21 財團法人工業技術研究院 Encoding method and encoding device
US9892338B2 (en) 2015-01-28 2018-02-13 Industrial Technology Research Institute Encoding method and encoder for constructing an initial color table

Also Published As

Publication number Publication date
TWI355855B (en) 2012-01-01

Similar Documents

Publication Publication Date Title
Jia et al. Spatial-temporal residue network based in-loop filter for video coding
JP6207116B2 (en) Method and apparatus for encoding surveillance video
Li et al. A convolutional neural network-based approach to rate control in HEVC intra coding
EP1021042B1 (en) Methods of scene change detection and fade detection for indexing of video sequences
JP5436458B2 (en) Multi-view image encoding method, multi-view image decoding method, multi-view image encoding device, multi-view image decoding device, multi-view image encoding program, and multi-view image decoding program
US20150163493A1 (en) Motion Analysis Method and Code Stream Conversion Method Based on Video Compression Code Stream and Apparatus Thereof
CN105472205B (en) Real-time video noise reduction method and device in encoding process
US10277901B2 (en) Encoding a video stream having a privacy mask
US20130182776A1 (en) Video Encoding Using Block-Based Mixed-Resolution Data Pruning
CN111010495A (en) Video denoising processing method and device
Kapotas et al. A new data hiding scheme for scene change detection in H. 264 encoded video sequences
US20180302634A1 (en) Advanced video coding method, system, apparatus, and storage medium
KR101149522B1 (en) Apparatus and method for detecting scene change
WO2012015654A1 (en) Method and system for encoding video frames using a plurality of processors
JP2005328183A5 (en)
JP2006203365A5 (en)
TWI421798B (en) Method and apparatus for image compression bit rate control
TW200945902A (en) Method for video encoding and the application thereof
US20120281761A1 (en) System and Method for Macroblock Transcoding
Wang et al. Quality assessment for MPEG-2 video streams using a neural network model
CN116095341A (en) Watermark embedding method, device, equipment and storage medium
WO2022116119A1 (en) Inter-frame predication method, encoder, decoder and storage medium
CN111212288B (en) Video data encoding and decoding method and device, computer equipment and storage medium
WO2022174469A1 (en) Illumination compensation method, encoder, decoder, and storage medium
CN106791864A (en) A kind of implementation method based on raising video code conversion speed under HEVC standard