TWI635742B - Dynamic image encoding apparatus and dynamic image encoding method - Google Patents
Dynamic image encoding apparatus and dynamic image encoding method Download PDFInfo
- Publication number
- TWI635742B TWI635742B TW106100619A TW106100619A TWI635742B TW I635742 B TWI635742 B TW I635742B TW 106100619 A TW106100619 A TW 106100619A TW 106100619 A TW106100619 A TW 106100619A TW I635742 B TWI635742 B TW I635742B
- Authority
- TW
- Taiwan
- Prior art keywords
- sum
- data
- circuit
- weighted
- frame prediction
- Prior art date
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/103—Selection of coding mode or of prediction mode
- H04N19/105—Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/103—Selection of coding mode or of prediction mode
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/146—Data rate or code amount at the encoder output
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/146—Data rate or code amount at the encoder output
- H04N19/147—Data rate or code amount at the encoder output according to rate distortion criteria
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/146—Data rate or code amount at the encoder output
- H04N19/149—Data rate or code amount at the encoder output by estimating the code amount by means of a model, e.g. mathematical model or statistical model
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/176—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/625—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
- H04N19/51—Motion estimation or motion compensation
- H04N19/567—Motion estimation based on rate distortion criteria
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Algebra (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Discrete Mathematics (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本發明提供一種動態影像編碼裝置,其中之控制器包含加總電路、資料量估計電路與評估電路。複數種框內預測/移動補償模式中的每一種模式各自對應於一組轉換量化後殘差資料。該加總電路針對每一組轉換量化後殘差資料,計算其中之非零元素的絕對值總和以及該等非零元素相對於一參考點的座標值總和。該資料量估計電路針對每一種框內預測/移動補償模式,根據其相對應轉換量化後殘差資料之該絕對值總和與該座標值總和,產生一資料量估計值。該評估電路根據該複數個資料量估計值,自該複數種框內預測/移動補償模式中選擇一最佳模式。 The invention provides a dynamic image encoding device, wherein the controller comprises a totaling circuit, a data amount estimating circuit and an evaluation circuit. Each of the plurality of in-frame prediction/motion compensation modes each corresponds to a set of converted quantized residual data. The summing circuit converts the quantized residual data for each group, calculates the sum of the absolute values of the non-zero elements therein, and the sum of the coordinate values of the non-zero elements with respect to a reference point. The data amount estimation circuit generates an estimated amount of data for each of the in-frame prediction/motion compensation modes according to the sum of the absolute values of the corresponding residual data and the coordinate value. The evaluation circuit selects an optimal mode from the plurality of in-frame prediction/motion compensation modes based on the plurality of data amount estimates.
Description
本發明與影像處理技術相關,並且尤其與根據資料量自多種影像處理模式中選擇一最佳模式的技術相關。 The present invention relates to image processing techniques and, in particular, to techniques for selecting an optimal mode from a plurality of image processing modes based on the amount of data.
近年來,隨著各種電子相關技術蓬勃發展,家庭劇院等多媒體系統日益普及。在多數多媒體系統中,最重要的硬體裝置便屬影像顯示設備。為了滿足觀看者對於逼真影像的需求,影像顯示設備目前的發展趨勢之一是持續提升圖框(frame)的尺寸和解析度,因而使得每一張圖框的影像資料量大幅增加。如何在保有良好畫質的同時,透過壓縮技術將影像資料量盡可能降低以節省儲存空間與傳輸資源,是值得關注的議題。 In recent years, with the rapid development of various electronic related technologies, multimedia systems such as home theaters have become increasingly popular. In most multimedia systems, the most important hardware device is an image display device. In order to meet the viewer's demand for realistic images, one of the current development trends of image display devices is to continuously increase the size and resolution of the frame, thereby greatly increasing the amount of image data of each frame. How to save the storage space and transmission resources through compression technology while maintaining good image quality is a topic worthy of attention.
圖一呈現目前被廣泛使用的動態影像編碼系統之功能方塊圖。每一圖框通常會被分割為多個影像區塊,做為編碼的基本單位。將一待編碼區塊的參考資料輸入框內預測(intra-prediction)/移動補償(motion compensation)電路101,上述電路101經過運算後輸出一參考區塊。其中框內預測(intra-prediction)/移動補償電路亦包含移動估測的功能,不在本發明討論範疇,在此不做贅述。接著,殘差產生電路102負責找出 待編碼區塊與參考區塊的差異。此通稱為殘差(residual)資料的區塊間差異會交由轉換電路103A進行離散餘弦轉換(discrete cosine transform,DCT)並交由量化電路103B進行量化(quantization)程序。隨後,熵編碼電路104負責對轉換量化後殘差資料及其相對應的中介資料(metadata)施以熵編碼(entropy encoding),以產生一編碼結果。 Figure 1 shows a functional block diagram of a currently widely used motion picture coding system. Each frame is usually divided into multiple image blocks as the basic unit of coding. The reference data of the block to be coded is input to an intra-prediction/motion compensation circuit 101, and the circuit 101 is operated to output a reference block. The intra-prediction/motion compensation circuit also includes the function of the motion estimation, which is not discussed in the scope of the present invention and will not be described herein. Next, the residual generation circuit 102 is responsible for finding out The difference between the block to be coded and the reference block. This inter-block difference, which is generally referred to as residual data, is subjected to a discrete cosine transform (DCT) by the conversion circuit 103A and subjected to quantization circuit 103B for quantization. Subsequently, the entropy encoding circuit 104 is responsible for applying entropy encoding to the converted quantized residual data and its corresponding mediation to generate an encoded result.
反量化電路106A與反轉換電路106B模擬影像解碼端接收到轉換量化後殘差資料後會產生的還原後殘差資料。加法電路107將還原後殘差資料與參考區塊相加之後存入緩衝器108,做為供框內預測/移動補償電路101使用的框內預測/移動補償參考資料。 The inverse quantization circuit 106A and the inverse conversion circuit 106B simulate the restored residual data which is generated after the image decoding end receives the converted residual residual data. The adding circuit 107 adds the restored residual data to the reference block and stores it in the buffer 108 as the in-frame prediction/motion compensation reference material for use in the in-frame prediction/motion compensation circuit 101.
實務上,框內預測/移動補償電路101可採用的框內預測/移動補償模式多達數十種,且各自導向不同的編碼結果。現行普遍採用拉格朗日法(Lagrange method)評估出最能兼顧低資料量與低失真兩種需求的框內預測/移動補償模式。在圖一繪示的動態影像編碼系統100中,控制電路110A控制框內預測/移動補償電路101逐一嘗試各種框內預測/移動補償模式。控制器110還包含一資料量計算電路110B、一失真量計算電路110C與一評估電路110D。資料量計算電路110B負責計算一編碼結果的資料量R。失真量計算電路110C則是分別接收殘差產生電路102產生的殘差資料與反轉換電路106B產生的還原後殘差資料,並據以計算出轉換電路103A與量化電路103B進行的程序會造成多大的失真量D,提供給評估電路110D參考。隨後,評估電路110D根據拉格朗日法為每一種框內預測/移動補償模式計算分數。概略地說,編碼結果的資料量R愈低,該 分數愈低;失真量D愈低,該分數也愈低。因此,評估電路110D會選出分數最低的框內預測/移動補償模式做為一最佳模式。 In practice, the in-frame prediction/motion compensation circuit 101 can employ up to dozens of in-frame prediction/motion compensation modes, and each directs different coding results. The Lagrange method is commonly used to estimate the in-frame prediction/motion compensation mode that best meets both low data volume and low distortion requirements. In the motion picture encoding system 100 illustrated in FIG. 1, the control circuit 110A controls the in-frame prediction/motion compensation circuit 101 to try various in-frame prediction/motion compensation modes one by one. The controller 110 further includes a data amount calculation circuit 110B, a distortion amount calculation circuit 110C, and an evaluation circuit 110D. The data amount calculation circuit 110B is responsible for calculating the data amount R of an encoded result. The distortion amount calculation circuit 110C receives the residual data generated by the residual generation circuit 102 and the restored residual data generated by the inverse conversion circuit 106B, respectively, and calculates how much the program performed by the conversion circuit 103A and the quantization circuit 103B is caused. The amount of distortion D is provided to the evaluation circuit 110D for reference. Subsequently, the evaluation circuit 110D calculates a score for each of the in-frame prediction/motion compensation modes according to the Lagrangian method. Roughly speaking, the lower the amount of data R of the coding result, the lower the score; the lower the distortion amount D , the lower the score. Therefore, the evaluation circuit 110D selects the lowest intra prediction/motion compensation mode as the best mode.
在評估電路110D選出最佳模式前,熵編碼電路104產生的每一個編碼結果都被先暫存在暫存記憶體109中。直到評估電路110D選出最佳模式,暫存記憶體109再送出最佳模式對應的編碼結果(在圖中標示為最佳編碼結果),做為動態影像編碼系統100的輸出信號。 Each of the encoded results generated by the entropy encoding circuit 104 is temporarily stored in the temporary memory 109 before the evaluation circuit 110D selects the optimum mode. Until the evaluation circuit 110D selects the best mode, the temporary memory 109 sends the encoded result corresponding to the optimal mode (labeled as the best encoding result in the figure) as the output signal of the motion picture encoding system 100.
動態影像編碼系統100中這種逐一計算出各框內預測/移動補償模式之編碼結果資料量以及失真量的做法雖然能準確選出最佳模式,但過程相當耗時,並且需要動用大量運算資源。 In the dynamic image encoding system 100, the method of calculating the data amount and the distortion amount of the encoding result in each frame in the prediction/motion compensation mode one by one can accurately select the optimal mode, but the process is quite time consuming and requires a large amount of computing resources.
為解決上述問題,本發明提出一種新的動態影像編碼裝置及動態影像編碼方法。 In order to solve the above problems, the present invention provides a new motion picture coding apparatus and a motion picture coding method.
根據本發明之一具體實施例為一種動態影像編碼裝置,其中包含一框內預測/移動補償電路、一殘差產生電路、一轉換電路、一量化電路與一控制器。該框內預測/移動補償電路分別採用複數種框內預測/移動補償模式為一待編碼影像區塊找出複數種參考區塊。該殘差產生電路根據該待編碼影像區塊與該複數種參考區塊產生相對應的複數組殘差資料。該轉換電路針對每一組殘差資料進行一離散餘弦轉換程序,以產生一轉換後矩陣。該量化電路針對每一個轉換後矩陣進行一量化程序,以產生一組轉換量化後殘差資料。該控制器包含一加總電路、一資料量估計電路與一評 估電路。該加總電路針對每一組轉換量化後殘差資料,計算其中之非零元素的絕對值總和以及該等非零元素相對於一參考點的座標值總和。該資料量估計電路針對每一種框內預測/移動補償模式,根據其相對應轉換量化後殘差資料之該絕對值總和與該座標值總和,產生一資料量估計值。該評估電路根據該複數個資料量估計值,自該複數種框內預測/移動補償模式中選擇一最佳模式。 According to an embodiment of the present invention, a dynamic image encoding device includes an in-frame prediction/motion compensation circuit, a residual generation circuit, a conversion circuit, a quantization circuit, and a controller. The in-frame prediction/motion compensation circuit uses a plurality of intra-frame prediction/motion compensation modes to find a plurality of reference blocks for a to-be-coded image block. The residual generation circuit generates corresponding complex array residual data according to the to-be-coded image block and the plurality of reference blocks. The conversion circuit performs a discrete cosine transform procedure for each set of residual data to produce a transformed matrix. The quantization circuit performs a quantization procedure for each of the transformed matrices to generate a set of transformed quantized residual data. The controller includes a total adding circuit, a data amount estimating circuit and a comment Estimate the circuit. The summing circuit converts the quantized residual data for each group, calculates the sum of the absolute values of the non-zero elements therein, and the sum of the coordinate values of the non-zero elements with respect to a reference point. The data amount estimation circuit generates an estimated amount of data for each of the in-frame prediction/motion compensation modes according to the sum of the absolute values of the corresponding residual data and the coordinate value. The evaluation circuit selects an optimal mode from the plurality of in-frame prediction/motion compensation modes based on the plurality of data amount estimates.
根據本發明之另一具體實施例為一種動態影像編碼方法。首先,分別採用複數種框內預測/移動補償模式,一待編碼影像區塊的複數種參考區塊被找出。接著,根據該待編碼影像區塊與該複數種參考區塊,相對應的複數組殘差資料被產生。隨後,每一組殘差資料被施加以一離散餘弦轉換程序與一量化程序,以產生一組轉換量化後殘差資料。針對每一組轉換量化後殘差資料,其中之非零元素的絕對值總和以及該等非零元素相對於一參考點的座標值總和被計算出來。針對每一種框內預測/移動補償模式,根據其相對應轉換量化後殘差資料之該絕對值總和與該座標值總和,一資料量估計值被產生。根據該複數個資料量估計值,自該複數種框內預測/移動補償模式中,一最佳模式被選出。 Another embodiment of the present invention is a dynamic image encoding method. First, a plurality of intra-frame prediction/motion compensation modes are respectively used, and a plurality of reference blocks of a to-be-coded image block are found. Then, according to the to-be-coded image block and the plurality of reference blocks, corresponding complex array residual data is generated. Subsequently, each set of residual data is applied with a discrete cosine transform procedure and a quantization procedure to produce a set of transformed quantized residual data. The quantized residual data is converted for each group, wherein the sum of the absolute values of the non-zero elements and the sum of the coordinate values of the non-zero elements with respect to a reference point are calculated. For each of the in-frame prediction/motion compensation modes, a data amount estimation value is generated according to the sum of the absolute values of the corresponding residual data and the coordinate value. Based on the plurality of data amount estimates, an optimal mode is selected from the plurality of in-frame prediction/motion compensation modes.
關於本發明的優點與精神可以藉由以下發明詳述及所附圖式得到進一步的瞭解。 The advantages and spirit of the present invention will be further understood from the following detailed description of the invention.
100、200‧‧‧動態影像編碼系統 100, 200‧‧‧ Motion Picture Coding System
101、201‧‧‧框內預測/移動補償電路 101, 201‧‧‧ In-frame prediction/motion compensation circuit
102、202‧‧‧殘差產生電路 102, 202‧‧‧ residual generation circuit
103A、203A‧‧‧轉換電路 103A, 203A‧‧‧ conversion circuit
103B、203B‧‧‧量化電路 103B, 203B‧‧‧Quantitative Circuit
104、204‧‧‧熵編碼電路 104, 204‧‧‧ Entropy coding circuit
106A、206A‧‧‧反量化電路 106A, 206A‧‧‧ inverse quantization circuit
106B、206B‧‧‧反轉換電路 106B, 206B‧‧‧ reverse conversion circuit
107、207‧‧‧加法電路 107, 207‧‧‧Addition circuit
108、208‧‧‧緩衝器 108, 208‧‧‧ buffer
109、209‧‧‧暫存記憶體 109, 209‧‧‧ temporary memory
110、210‧‧‧控制器 110, 210‧‧‧ controller
110A、210A‧‧‧控制電路 110A, 210A‧‧‧ control circuit
110B‧‧‧資料量計算電路 110B‧‧‧ data volume calculation circuit
210B‧‧‧資料量估計電路 210B‧‧‧ Data Estimation Circuit
110C、210C‧‧‧失真量計算電路 110C, 210C‧‧‧ distortion calculation circuit
110D、210D‧‧‧評估電路 110D, 210D‧‧‧Evaluation Circuit
210E‧‧‧加總電路 210E‧‧‧ total circuit
210F‧‧‧失真量估計電路 210F‧‧‧Distortion Estimation Circuit
S61~S67‧‧‧流程步驟 S61~S67‧‧‧ Process steps
S71~S74‧‧‧流程步驟 S71~S74‧‧‧ Process steps
圖一呈現一個目前廣泛使用的動態影像編碼系統之功能方塊圖。 Figure 1 presents a functional block diagram of a currently widely used motion picture coding system.
圖二為根據本發明之一實施例中的動態影像編碼系統之功能方塊圖。 2 is a functional block diagram of a motion picture coding system in accordance with an embodiment of the present invention.
圖三呈現一尺寸為4*4的資料矩陣範例。 Figure 3 presents an example of a data matrix of size 4*4.
圖四為根據本發明之另一實施例中的動態影像編碼系統之功能方塊圖。 4 is a functional block diagram of a motion picture coding system in accordance with another embodiment of the present invention.
圖五為根據本發明之又一實施例中的動態影像編碼系統之功能方塊圖。 Figure 5 is a functional block diagram of a motion picture coding system in accordance with still another embodiment of the present invention.
圖六為根據本發明之一實施例中的影像處理方法之流程圖。 6 is a flow chart of an image processing method in accordance with an embodiment of the present invention.
圖七為根據本發明之另一實施例中的影像處理方法之流程圖。 Figure 7 is a flow chart of an image processing method in accordance with another embodiment of the present invention.
須說明的是,本發明的圖式並非細部電路圖,且其中的連接線僅用以表示信號流。功能性元件及/或程序間的多種互動關係不一定要透過直接的電性連結始能達成。此外,個別元件的功能不一定要如圖式中繪示的方式分配,且分散式的區塊不一定要以分散式的電子元件實現。 It should be noted that the drawings of the present invention are not detailed circuit diagrams, and the connecting lines therein are only used to indicate signal flows. Multiple interactions between functional components and/or procedures do not have to be achieved through direct electrical connections. In addition, the functions of the individual components are not necessarily allotted in the manner illustrated in the drawings, and the decentralized blocks are not necessarily implemented in the form of decentralized electronic components.
根據本發明之一具體實施例為一動態影像編碼系統。請參閱圖二所示之功能方塊圖。動態影像編碼系統200包含框內預測/移動補償電路201、殘差產生電路202、轉換電路203A、量化電路203B、熵編碼電路204、反量化電路206A、反轉換電路206B、加法電路207、緩衝器208、暫存記憶體209以及控制器210。並且,控制器210中包含有一控制電路210A、一資料量估計電路210B、一失真量計算電路210C、一評估電路210D與一加總電路210E。 A dynamic image encoding system in accordance with an embodiment of the present invention. Please refer to the function block diagram shown in Figure 2. The motion picture coding system 200 includes an in-frame prediction/motion compensation circuit 201, a residual generation circuit 202, a conversion circuit 203A, a quantization circuit 203B, an entropy coding circuit 204, an inverse quantization circuit 206A, an inverse conversion circuit 206B, an addition circuit 207, and a buffer. 208. The temporary storage memory 209 and the controller 210. Moreover, the controller 210 includes a control circuit 210A, a data amount estimation circuit 210B, a distortion amount calculation circuit 210C, an evaluation circuit 210D, and a summing circuit 210E.
於此實施例中,框內預測/移動補償電路201、殘差產生電路202、轉換電路203A、量化電路203B、反量化電路206A、反轉換電路206B、加法電路207,以及緩衝器208為先前技術,其運作方式可參考圖一中各相對應電路的說明。動態影像編碼系統200與動態影像編碼系統100的主要差別之一在於,控制器210並非根據編碼結果的準確資料量來選擇最佳模式,而是改為參考一個根據轉換量化後殘差資料產生的資料量估計值,詳述如下。 In this embodiment, the in-frame prediction/motion compensation circuit 201, the residual generation circuit 202, the conversion circuit 203A, the quantization circuit 203B, the inverse quantization circuit 206A, the inverse conversion circuit 206B, the addition circuit 207, and the buffer 208 are prior art. For the operation mode, refer to the description of each corresponding circuit in Figure 1. One of the main differences between the dynamic image encoding system 200 and the dynamic image encoding system 100 is that the controller 210 does not select the optimal mode based on the accurate data amount of the encoding result, but instead refers to a residual data generated based on the converted quantization. The estimated amount of data is detailed below.
針對每一種框內預測/移動補償模式,量化電路203B都會產生一組轉換量化後殘差資料。圖三所示的4*4資料矩陣的範例,係代表轉換量化後殘差資料的二維資料,其矩陣中每一個資料值各自具有一橫座標x與一縱座標y。加總電路210E會計算其中之非零元素的絕對值總和SUM ABS ,以及該等非零元素相對於一參考點的座標值總和SUM CRD 。若以圖三的資料矩陣為例,加總電路210E所計算出的絕對值總和SUM ABS 會是:54+25+16+4+32+11+10+6+2+8+1=169。 For each of the in-frame prediction/motion compensation modes, the quantization circuit 203B generates a set of converted quantized residual data. The example of the 4*4 data matrix shown in FIG. 3 represents two-dimensional data representing the residual data after quantization, and each data value in the matrix has a horizontal coordinate x and an ordinate y. The summing circuit 210E calculates the sum of absolute values SUM ABS of the non-zero elements therein, and the sum of the coordinate values SUM CRD of the non-zero elements with respect to a reference point. Taking the data matrix of FIG. 3 as an example, the sum of absolute values SUM ABS calculated by the summing circuit 210E will be: 54+25+16+4+32+11+10+6+2+8+1=169.
於一實施例中,加總電路210E係將所有非零元素所在座標的縱向座標值與橫向座標值相加,做為座標值總和SUM CRD 。若以圖三的資料矩陣為例,加總電路210E用這種方式計算出的座標值總和SUM CRD 會是:(0+0)+(1+0)+(2+0)+(3+0)+(0+1)+(1+1)+(0+2)+(1+2)+(2+2)+(0+3)+(3+3)=27。 In one embodiment, the summing circuit 210E adds the longitudinal coordinate values of the coordinates of all non-zero elements to the lateral coordinate values as the coordinate value sum SUM CRD . Taking the data matrix of FIG. 3 as an example, the total value of the coordinates SUM CRD calculated by the summing circuit 210E in this way would be: (0+0)+(1+0)+(2+0)+(3+ 0) + (0 + 1) + (1 + 1) + (0 + 2) + (1 + 2) + (2+2) + (0 + 3) + (3 + 3) = 27.
針對每一種框內預測/移動補償模式,資料量估計電路210B根
據其相對應資料矩陣的絕對值總和SUM ABS 與座標值總和SUM CRD ,產生一資料量估計值。於一實施例中,資料量估計電路210B分別賦予絕對值總和SUM ABS 與座標值總和SUM CRD 一特定權重,然後根據該加權後絕對值總和與該加權後座標值總和產生資料量估計值。舉例而言,資料量估計電路210B可採用下列預設演算式:
於另一實施例中,針對每一組表示轉換量化後殘差資料的二維資料,加總電路210E計算其中的非零元素之橫向座標值總和SUM CRD_X 與縱向座標值總和SUM CRD_Y 。資料量估計電路210B分別賦予絕對值總和SUM ABS 、橫向座標值總和SUM CRD_X 與縱向座標值總和SUM CRD_Y 一特定權重,然後根據該加權後絕對值總和、該加權後縱向座標值總和與該加權後橫向座標值總和,產生資料量估計值。舉例而言,資料量估計電路210B可採用下列
預設演算式:
如圖二所示,資料量估計電路210B產生的資料量估計值被提供至評估電路210D。針對同一待解碼影像區塊,控制電路210A可控制框內預測/移動補償電路201逐一進行各種框內預測/移動補償模式,資料量估計電路210B隨後根據各種模式相對應產生不同資料量估計值。 As shown in FIG. 2, the data amount estimation value generated by the data amount estimation circuit 210B is It is supplied to the evaluation circuit 210D. For the same image block to be decoded, the control circuit 210A can control the intra-frame prediction/motion compensation circuit 201 to perform various intra-frame prediction/motion compensation modes one by one, and the data quantity estimation circuit 210B subsequently generates different data quantity estimation values according to various modes. .
類似的,失真量計算模組207依據各種框內預測/移動補償模式對應產生不同的失真量D。更具體地說,反量化電路206A與反轉換電路206B會重建各個模式的轉換量化後殘差資料,以產生相對應的還原後殘差資料。失真量計算模組207係用以根據此還原後殘差資料與殘差產生電路202產生的殘差資料之間的差異值決定失真量D。評估電路210D可根據所有框內預測/移動補償模式的資料量估計值以及失真量D,利用拉格朗日法或類似的評估方式,自框內預測/移動補償電路201的複數種影像處理模式中,為目前的影像區塊選擇一種最佳模式(亦即最能兼顧低資料量與低失真量的模式)。 Similarly, the distortion amount calculation module 207 generates different distortion amounts D according to various in-frame prediction/motion compensation modes. More specifically, the inverse quantization circuit 206A and the inverse conversion circuit 206B reconstruct the converted quantized residual data of each mode to generate corresponding restored residual data. The distortion amount calculation module 207 is configured to determine the distortion amount D based on the difference value between the residual data after the restoration and the residual data generated by the residual generation circuit 202. The evaluation circuit 210D can estimate the data amount according to all the in-frame prediction/motion compensation modes. And the distortion amount D , using the Lagrangian method or the like, to select an optimal mode for the current image block from the plurality of image processing modes of the in-frame prediction/motion compensation circuit 201 (ie, the best mode) A mode of low data volume and low distortion.)
於一實施例中,在評估電路210D選出最佳模式前,轉換量化後殘差資料可被暫時存放在暫存記憶體209中。等到評估電路210D選出最佳模式後,暫存記憶體209便可將對應於最佳模式的轉換量化後殘差資料提供給熵編碼電路204,以對此轉換量化後殘差資料及其相對應的中介資 料施以熵編碼,以產生一編碼結果。 In one embodiment, the converted quantized residual data may be temporarily stored in the temporary memory 209 before the evaluation circuit 210D selects the best mode. After the evaluation circuit 210D selects the optimal mode, the temporary storage memory 209 can provide the converted quantized residual data corresponding to the optimal mode to the entropy encoding circuit 204 to convert the quantized residual data and corresponding thereto. Intermediary Entropy coding is applied to produce an encoded result.
於另一實施例中,暫存記憶體209中僅儲存目前已知的最佳模式之轉換量化後殘差資料。每當評估電路210D發現另一個框內預測/移動補償模式是更好的,便會以新的轉換量化後殘差資料取代暫存記憶體209中原本暫存的轉換量化後殘差資料。直到所有的框內預測/移動補償模式已被嘗試過,暫存記憶體209中所儲存的便是對應於最佳模式的轉換量化後殘差資料。這種做法的好處在於可節省暫存記憶體209的硬體空間。 In another embodiment, the temporary memory 209 stores only the converted quantized residual data of the best known mode. Whenever the evaluation circuit 210D finds that another in-frame prediction/motion compensation mode is better, the newly converted post-quantization residual data in the temporary storage memory 209 is replaced with the new converted quantized residual data. Until all of the in-frame prediction/motion compensation modes have been tried, the stored in the temporary memory 209 is the converted quantized residual data corresponding to the best mode. The advantage of this approach is that it saves the hardware space of the scratch memory 209.
於又一實施例中,在評估電路210D選出最佳模式前,暫存記憶體209不儲存任何的轉換量化後殘差資料,而是僅記錄(例如以索引的方式)目前的最佳模式是哪一種模式。直到所有的框內預測/移動補償模式皆被嘗試過,控制電路210A才會控制框內預測/移動補償電路201、殘差產生電路202、轉換電路203A、量化電路203B重新產生出對應於此最佳模式的轉換量化後殘差資料,供熵編碼電路204進行編碼。 In yet another embodiment, before the evaluation circuit 210D selects the best mode, the temporary memory 209 does not store any converted quantized residual data, but only records (eg, by index) that the current best mode is Which mode? Until all of the in-frame prediction/motion compensation modes have been tried, the control circuit 210A controls the in-frame prediction/motion compensation circuit 201, the residual generation circuit 202, the conversion circuit 203A, and the quantization circuit 203B to reproduce the most corresponding to this. The quantized residual residual data of the good mode is encoded by the entropy encoding circuit 204.
由以上說明可看出,在動態影像編碼系統200中,資料量估計電路210B係根據轉換量化後殘差資料產生資料量估計值。相較於圖一呈現的先前技術,熵編碼電路204只需要針對被選出的最佳模式所對應之轉換量化後殘差資料及中介資料進行編碼,而不需要對每一個模式所對應的轉換量化後殘差資料及中介資料進行編碼。動態影像編碼系統200可使用較短的時間與較少的運算資源即產生資料量估計值,做為評估電路210D選擇最佳模式的參考資料。 As can be seen from the above description, in the motion image encoding system 200, the data amount estimating circuit 210B generates an estimated amount of data based on the converted residual data. . Compared with the prior art presented in FIG. 1, the entropy encoding circuit 204 only needs to encode the converted quantized residual data and the intermediate data corresponding to the selected optimal mode, without the need to quantize the conversion corresponding to each mode. Post-residual data and intermediate data are encoded. The motion image encoding system 200 can generate data amount estimates using a shorter time and less computing resources. As a reference for the evaluation circuit 210D to select the best mode.
請參閱圖四。於另一實施例中,資料量估計電路210B亦對各種 框內預測/移動補償模式的中介資料進行資料量評估。以中介資料中某一參數以多個位元表示為例,此多個位元中若有一部份位元被分類為旁路(bypass)資料,即是指此部分位元無法藉由發生機率進行正確預測,所以熵編碼電路204不對此部分位元施以熵編碼程序。每一種模式之中介資料中各參數內容為旁路資料或非旁路(non-bypass)資料係為已知,因此資料量估計電路210B可依照這些資訊可算出相對應的中介資料之一旁路資料數量B P 與一非旁路資料數量B NP ,並據此產生一中介資料量估計值。 Please refer to Figure 4. In another embodiment, the data amount estimation circuit 210B also performs data volume evaluation on the mediation data of various in-frame prediction/motion compensation modes. Taking a parameter in an intermediary data as an example, if some of the multiple bits are classified as bypass data, it means that the bit cannot be generated by chance. The correct prediction is made, so the entropy encoding circuit 204 does not apply an entropy encoding procedure to this portion of the bits. The content of each parameter in the mediation data of each mode is known as bypass data or non-bypass data, so the data volume estimation circuit 210B can calculate one of the corresponding mediation materials according to the information. The quantity B P and the number of non-bypass data B NP , and an intervening data amount estimate is generated accordingly .
舉例而言,資料量估計電路210B可採用下列預設演算式:
除了各個模式的絕對值總和SUM ABS 與座標值總和SUM CRD ,圖四中的資料量估計電路210B在為每一種模式產生其資料量估計值時,亦將其中介資料量估計值納入考量。舉例而言,圖四中的資料量估計電路210B可將式一修改為:
圖五呈現動態影像編碼系統200的一種變化型。於此實施例中, 失真量計算模組210C被一失真量估計電路210F取代。失真量估計電路210F的輸入信號為轉換電路203A產生的轉換後矩陣,以及反量化電路206A產生的反量化結果。針對每一種框內預測/移動補償模式,失真量估計電路210F係計算該反量化結果與該轉換後矩陣之差異,做為一失真量估計值,供評估電路210D於選擇最佳模式時參考。相較於圖一呈現的先前技術,圖五所採用的做法在產生失真量估計值的過程中不需要進行反轉換程序,因而得以縮短產出失真量估計值所需要的時間,並且進一步節省運算資源。 FIG. 5 presents a variation of the dynamic image encoding system 200. In this embodiment, the distortion amount calculation module 210C is replaced by a distortion amount estimation circuit 210F. The input signal of the distortion amount estimating circuit 210F is the converted matrix generated by the converting circuit 203A, and the inverse quantization result generated by the inverse quantization circuit 206A. For each of the in-frame prediction/motion compensation modes, the distortion amount estimation circuit 210F calculates the difference between the inverse quantization result and the converted matrix as a distortion amount estimation value. For evaluation circuit 210D to refer to when selecting the best mode. Compared to the prior art presented in Figure 1, the approach taken in Figure 5 is to generate an estimate of the amount of distortion. There is no need to perform an inverse conversion procedure in the process, thus shortening the output distortion estimate The time required and further savings in computing resources.
此外,失真量估計電路210F可被設計為僅計算該轉換後矩陣與其反量化結果之一較高位元差異、忽略一較低位元差異。舉例而言,假設轉換後矩陣及反量化結果中的每一個元素係各自以長度十六位元的二進制資料表示,失真量估計電路210F可以僅計算兩個相對應元素的前八個較高位元的差異,忽略後八個較低位元的差異。這種做法也可以達到進一步節省運算時間與運算資源的效果。 Furthermore, the distortion amount estimation circuit 210F can be designed to calculate only a higher bit difference of the converted matrix and one of its inverse quantization results, ignoring a lower bit difference. For example, assuming that each element of the transformed matrix and the inverse quantization result is represented by binary data of length sixteen bits, the distortion amount estimation circuit 210F can calculate only the first eight higher bits of the two corresponding elements. The difference is ignored after the difference between the eight lower bits. This approach can also achieve the effect of further saving computing time and computing resources.
實務上,前述加總電路210E、資料量估計電路210B與失真量評估電路210F可各自被實現為但不限於固定式及/或可程式化的數位邏輯電路,包含可程式化邏輯閘陣列、特定應用積體電路、微控制器、微處理器、數位信號處理器,與其他必要電路。 In practice, the summing circuit 210E, the data amount estimating circuit 210B, and the distortion amount evaluating circuit 210F may each be implemented as, but not limited to, a fixed and/or programmable digital logic circuit, including a programmable logic gate array, and a specific Apply integrated circuits, microcontrollers, microprocessors, digital signal processors, and other necessary circuits.
根據本發明之另一具體實施例為一種動態影像編碼方法,其流程圖係繪示於圖六。首先,步驟S61為分別採用複數種框內預測/移動補償模式為一待編碼影像區塊找出複數種參考區塊。其次,步驟S62為根據 該待編碼影像區塊與該複數種參考區塊產生相對應的複數組殘差資料。隨後,步驟S63為針對每一組殘差資料進行一離散餘弦轉換程序,以產生一轉換後矩陣。步驟S64則是針對每一個轉換後矩陣進行一量化程序,以產生一組轉換量化後殘差資料。接著,步驟S65為針對每一組轉換量化後殘差資料,計算其中之非零元素的絕對值總和以及該等非零元素相對於一參考點的座標值總和。步驟S66是針對每一種框內預測/移動補償模式,根據其相對應轉換量化後殘差資料之該絕對值總和與該座標值總和,產生一資料量估計值。步驟S67則是根據該複數個資料量估計值,自該複數種框內預測/移動補償模式中選擇一最佳模式。 Another embodiment of the present invention is a dynamic image encoding method, and a flow chart thereof is shown in FIG. First, step S61 is to find a plurality of reference blocks for a to-be-encoded image block by using a plurality of in-frame prediction/motion compensation modes, respectively. Second, step S62 is based on The to-be-coded image block and the plurality of reference blocks generate corresponding complex array residual data. Subsequently, step S63 is to perform a discrete cosine transform procedure for each set of residual data to generate a transformed matrix. Step S64 is to perform a quantization process for each converted matrix to generate a set of converted quantized residual data. Next, in step S65, the quantized residual data is converted for each group, and the sum of the absolute values of the non-zero elements and the sum of the coordinate values of the non-zero elements with respect to a reference point are calculated. Step S66 is to generate a data amount estimation value according to the sum of the absolute values of the corresponding residual data and the coordinate value of the corresponding intra-frame prediction/motion compensation mode. Step S67 is to select an optimal mode from the plurality of in-frame prediction/motion compensation modes according to the plurality of data amount estimation values.
根據本發明之另一具體實施例為一種影像處理方法,其流程圖係繪示於圖七。首先,步驟S71為針對一影像資料進行一離散餘弦轉換程序,以產生一轉換後矩陣。其次,步驟S72為針對該轉換後矩陣進行一量化程序,以產生一轉換量化後資料。接著,步驟S73為針對該轉換量化後資料進行一反量化程序,以產生一反量化結果。隨後,步驟S74為根據該轉換後矩陣與該反量化結果的差異,決定一失真量估計值。 Another embodiment of the present invention is an image processing method, and a flow chart thereof is shown in FIG. First, step S71 is to perform a discrete cosine transform process for an image data to generate a converted matrix. Next, in step S72, a quantization process is performed on the converted matrix to generate a converted quantized data. Next, in step S73, an inverse quantization process is performed on the converted quantized data to generate an inverse quantization result. Subsequently, step S74 determines a distortion amount estimation value according to the difference between the converted matrix and the inverse quantization result.
藉由以上較佳具體實施例之詳述,係希望能更加清楚描述本發明之特徵與精神,而並非以上述所揭露的較佳具體實施例來對本發明之範疇加以限制。相反地,其目的是希望能涵蓋各種改變及具相等性的安排於本發明所欲申請之專利範圍的範疇內。 The features and spirit of the present invention will be more apparent from the detailed description of the preferred embodiments. On the contrary, the intention is to cover various modifications and equivalents within the scope of the invention as claimed.
Claims (14)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW106100619A TWI635742B (en) | 2017-01-09 | 2017-01-09 | Dynamic image encoding apparatus and dynamic image encoding method |
US15/794,253 US20180199031A1 (en) | 2017-01-09 | 2017-10-26 | Video encoding apparatus and video data amount encoding method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW106100619A TWI635742B (en) | 2017-01-09 | 2017-01-09 | Dynamic image encoding apparatus and dynamic image encoding method |
Publications (2)
Publication Number | Publication Date |
---|---|
TW201826788A TW201826788A (en) | 2018-07-16 |
TWI635742B true TWI635742B (en) | 2018-09-11 |
Family
ID=62783859
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW106100619A TWI635742B (en) | 2017-01-09 | 2017-01-09 | Dynamic image encoding apparatus and dynamic image encoding method |
Country Status (2)
Country | Link |
---|---|
US (1) | US20180199031A1 (en) |
TW (1) | TWI635742B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
FR3044507A1 (en) * | 2015-11-30 | 2017-06-02 | Orange | IMAGE ENCODING AND DECODING METHOD, IMAGE ENCODING AND DECODING DEVICE AND CORRESPONDING COMPUTER PROGRAMS |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070140345A1 (en) * | 2005-12-16 | 2007-06-21 | Akira Osamoto | Motion estimation with motion vector penalty |
TW201336317A (en) * | 2012-01-13 | 2013-09-01 | Qualcomm Inc | Determining contexts for coding transform coefficient data in video coding |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8045614B2 (en) * | 2005-05-11 | 2011-10-25 | Dolby Laboratories Licensing Corporation | Quantization control for variable bit depth |
KR100772391B1 (en) * | 2006-01-23 | 2007-11-01 | 삼성전자주식회사 | Method for video encoding or decoding based on orthogonal transform and vector quantization, and apparatus thereof |
US9883187B2 (en) * | 2015-03-06 | 2018-01-30 | Qualcomm Incorporated | Fast video encoding method with block partitioning |
US11146788B2 (en) * | 2015-06-12 | 2021-10-12 | Qualcomm Incorporated | Grouping palette bypass bins for video coding |
-
2017
- 2017-01-09 TW TW106100619A patent/TWI635742B/en not_active IP Right Cessation
- 2017-10-26 US US15/794,253 patent/US20180199031A1/en not_active Abandoned
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070140345A1 (en) * | 2005-12-16 | 2007-06-21 | Akira Osamoto | Motion estimation with motion vector penalty |
TW201336317A (en) * | 2012-01-13 | 2013-09-01 | Qualcomm Inc | Determining contexts for coding transform coefficient data in video coding |
Also Published As
Publication number | Publication date |
---|---|
US20180199031A1 (en) | 2018-07-12 |
TW201826788A (en) | 2018-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6928041B2 (en) | Methods and equipment for processing video | |
US8670488B2 (en) | Adaptive intra mode selection | |
CN106961603B (en) | Intracoded frame code rate allocation method and device | |
CN101584215B (en) | Integrated spatial-temporal prediction | |
KR20110106423A (en) | Video encoding using previously calculated motion information | |
CN103096055A (en) | Image signal intra-frame prediction and decoding method and device | |
KR20130018413A (en) | An image compression method with random access capability | |
JP2007529175A5 (en) | ||
TWI551124B (en) | Encoding, decoding method and encoding, decoding apparatus for video system | |
WO2021129007A1 (en) | Method and device for determining video bitrate, computer apparatus, and storage medium | |
CN102857752B (en) | A kind of pixel prediction method and apparatus | |
KR20120049881A (en) | Vector embedded graphics coding | |
US20040146103A1 (en) | Bit rate control method and apparatus for MPEG-4 video coding | |
WO2022095871A1 (en) | Video processing method, video processing apparatus, smart device, and storage medium | |
TWI635742B (en) | Dynamic image encoding apparatus and dynamic image encoding method | |
US11303916B2 (en) | Motion compensation techniques for video | |
JPH09327019A (en) | Object area encoding device | |
Yang et al. | Sur-driven video coding rate control for jointly optimizing perceptual quality and buffer control | |
JP2013506379A (en) | Combined scalar embedded graphics coding for color images | |
CN115442617A (en) | Video processing method and device based on video coding | |
US6141449A (en) | Coding mode determination system | |
CN108347603B (en) | Moving image encoding device and moving image encoding method | |
Jubran et al. | Sequence-level reference frames in video coding | |
KR100911098B1 (en) | Apparatus and method for prediction of distortion in H.263 video coding | |
US11985341B2 (en) | Assigning bit budgets to parallel encoded video data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | Annulment or lapse of patent due to non-payment of fees | ||
MM4A | Annulment or lapse of patent due to non-payment of fees |