TWI862229B - Video decoding method and decoder device - Google Patents
Video decoding method and decoder device Download PDFInfo
- Publication number
- TWI862229B TWI862229B TW112140039A TW112140039A TWI862229B TW I862229 B TWI862229 B TW I862229B TW 112140039 A TW112140039 A TW 112140039A TW 112140039 A TW112140039 A TW 112140039A TW I862229 B TWI862229 B TW I862229B
- Authority
- TW
- Taiwan
- Prior art keywords
- decoded image
- image buffer
- decoded
- buffer
- information
- Prior art date
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Description
本申請涉及視訊編解碼技術領域,具體涉及一種視訊解碼方法及解碼裝置。 This application relates to the field of video encoding and decoding technology, and specifically to a video decoding method and decoding device.
解碼圖像緩衝區(decoded picture buffer,DPB)是在視訊解碼時用於存放多張已完成解碼並供後續圖像用作參考幀的儲存區。基於後向參考圖幀的解碼順序和顯示順序不同,如在設置DPB時不充分考慮該類參考圖幀的特性,DPB會佔用大量儲存空間,增加解碼裝置的成本。 The decoded picture buffer (DPB) is a storage area used to store multiple decoded frames during video decoding and used as reference frames for subsequent images. Since the decoding order and display order of backward reference frames are different, if the characteristics of such reference frames are not fully considered when setting the DPB, the DPB will occupy a large amount of storage space and increase the cost of the decoding device.
鑒於先前技術之不足,本申請提供一種視訊解碼方法及解碼裝置,以改善先前技術的不足。 In view of the shortcomings of the prior art, this application provides a video decoding method and decoding device to improve the shortcomings of the prior art.
本申請的一實施例提供一種視訊解碼方法,應用於解碼裝置以解碼儲存在記憶體的編碼串流,所述解碼裝置包括視訊解碼器、記憶體控制器以及處理器,所述視訊解碼方法包括:基於所述編碼串流的最大參考幀張數X藉由記憶體控制器在所述記憶體中設置解碼圖像緩衝區,所述解碼圖像緩衝區包括X+1個圖像緩衝區,每一圖像緩衝區用於儲存一張解碼圖像,X為正整數; 基於所述解碼圖像緩衝區的狀態資訊確定所述解碼圖像緩衝區空閒的圖像緩衝區;控制所述視訊解碼器解碼所述編碼串流中當前幀以獲得解碼圖像,並將所述當前幀的解碼圖像存入所述圖像緩衝區中。 An embodiment of the present application provides a video decoding method, which is applied to a decoding device to decode a coded stream stored in a memory. The decoding device includes a video decoder, a memory controller, and a processor. The video decoding method includes: based on the maximum reference frame number X of the coded stream, the memory controller sets a decoded image buffer in the memory, and the decoded image buffer The buffer includes X+1 image buffers, each image buffer is used to store a decoded image, and X is a positive integer; Based on the status information of the decoded image buffer, determine the free image buffer of the decoded image buffer; control the video decoder to decode the current frame in the coded stream to obtain a decoded image, and store the decoded image of the current frame in the image buffer.
本申請的另一實施例提供一種解碼裝置,所述解碼裝置包括視訊解碼器、記憶體控制器以及處理器,所述解碼裝置用於解碼儲存在記憶體的編碼串流,其中:所述處理器,用於基於所述編碼串流的最大參考幀張數X藉由記憶體控制器在所述記憶體中設置解碼圖像緩衝區,所述解碼圖像緩衝區包括X+1個圖像緩衝區,每一圖像緩衝區用於儲存一張解碼圖像,X為正整數;所述處理器,還用於基於所述解碼圖像緩衝區的狀態資訊確定所述解碼圖像緩衝區空閒的圖像緩衝區;所述處理器,還用於控制所述視訊解碼器解碼所述編碼串流中當前幀以獲得解碼圖像,並將所述當前幀的解碼圖像存入所述圖像緩衝區中。 Another embodiment of the present application provides a decoding device, the decoding device includes a video decoder, a memory controller and a processor, the decoding device is used to decode a coded stream stored in a memory, wherein: the processor is used to set a decoded image buffer in the memory through the memory controller based on the maximum number of reference frames X of the coded stream, the decoded image buffer includes X+1 images Image buffer, each image buffer is used to store a decoded image, X is a positive integer; the processor is also used to determine the free image buffer of the decoded image buffer based on the status information of the decoded image buffer; the processor is also used to control the video decoder to decode the current frame in the coded stream to obtain a decoded image, and store the decoded image of the current frame in the image buffer.
本申請的視訊解碼方法及解碼裝置能夠在解碼過程中高效地分配緩衝區。相較於先前技術,本申請的視訊解碼方法及解碼裝置可以在解碼過程中更加高效地分配緩衝區,有效提升緩衝區利用率。 The video decoding method and decoding device of this application can efficiently allocate buffers during the decoding process. Compared with the previous technology, the video decoding method and decoding device of this application can more efficiently allocate buffers during the decoding process, effectively improving the buffer utilization rate.
有關本申請的特徵、實作與功效,茲配合圖式作實施例詳細說明如下。 The features, implementation and effects of this application are described in detail below with reference to the accompanying drawings.
以下說明內容的技術用語系參照本技術領域的習慣用語,如本說明書對部分用語有加以說明或定義,該部分用語的解釋系以本說明書的說明或定義為準。 The technical terms used in the following descriptions refer to the customary terms in this technical field. If this manual explains or defines some of the terms, the interpretation of these terms shall be based on the explanation or definition in this manual.
本申請的公開內容包括視訊解碼方法及解碼裝置。由於本申請的解碼裝置所包括的部分元件單獨而言可能為已知元件,因此在不影響該裝置申請的充分公開及可實施性的前提下,以下說明對於已知元件的細節將予以節略。此外,本申請的視訊解碼方法的部分或全部流程可以是軟體和/或韌體的形式,並且可借由本申請的解碼裝置或其等效裝置來執行,在不影響該方法申請的充分公開及可實施性的前提下,以下方法申請的說明將著重於步驟內容而非硬體。 The disclosure of this application includes a video decoding method and a decoding device. Since some of the components included in the decoding device of this application may be known components individually, the following description will omit the details of the known components without affecting the full disclosure and feasibility of the device application. In addition, part or all of the process of the video decoding method of this application may be in the form of software and/or firmware, and can be executed by the decoding device of this application or its equivalent device. Without affecting the full disclosure and feasibility of the method application, the following description of the method application will focus on the steps rather than the hardware.
圖1是本申請實施例提供的一種解碼裝置的結構示意圖。該解碼裝置101包括視訊解碼器(video decoder,VD)102、記憶體控制器103以及處理器104。該解碼裝置101可為解碼晶片,可解碼儲存在記憶體111中的編碼串流(Encoded Stream,ES)資料。記憶體控制器103具體可以是記憶體控制器(Memory Controller),可藉由記憶體介面單元(Memory Interface Unit,MIU)電路和/或直接記憶體訪問(Direct Memory Access,DMA)電路具體實現。記憶體111中儲存有視訊解碼器驅動(Video Decoder Driver,VDD)程式115,處理器104藉由記憶體控制器103從記憶體111中讀取VDD程式115並執行,以控制視訊解碼器102對編碼串流112的解碼。
FIG1 is a schematic diagram of the structure of a decoding device provided in an embodiment of the present application. The
下面將結合圖2與圖3對解碼裝置101對編碼串流112的解碼過程加以詳述。
The decoding process of the coded
圖2所示為一實施例提供的視訊解碼方法的流程圖,包括下述步驟。 FIG2 is a flow chart of a video decoding method provided by an embodiment, including the following steps.
步驟201,處理器104基於編碼串流的最大參考幀張數X藉由記憶體控制器103在記憶體111中設置解碼圖像緩衝區。
In
具體的,處理器104藉由記憶體控制器103從記憶體(如動態隨機記憶體(Dynamic Random Access Memory,DRAM)111中讀取編碼串流112的序列參數集(Sequence Parameter Set,SPS)資料,解析SPS資料以獲取編碼串流112的最大參考幀張數(計為X),並根據最大參考幀張數藉由記憶體控制器103在記憶體111中為解碼圖像分配解碼圖像緩衝(記為Decoded Picture Buffer,DPB)區113。在一實施例中,DPB區至少包括X+1個圖像緩衝區,每一圖像緩衝區用於儲存一張已解碼圖像。該SPS資料包括該編碼串流中每一圖幀的參考幀資訊和每一解碼圖像的顯示順序資訊。
Specifically, the
步驟202,處理器104基於所述解碼圖像緩衝區的狀態資訊確定解碼圖像緩衝區是否存在空閒的圖像緩衝區。若是,則執行步驟203;若否,則執行步驟204。
In
處理器104基於儲存的每一圖像緩衝區的標記資訊獲知該解碼圖像緩衝區的狀態資訊,標記資訊包括解碼圖像的顯示順序(Picture Order Count,POC)標記和參考幀標記,顯示順序標記用於指示解碼圖像作為待顯示幀以及其顯示順序。當一解碼圖像待顯示時,新增該解碼圖像的顯示順序標記;當解碼圖像顯示時,該顯示順序標記被清除或更改為空值。當一解碼圖像需用作解碼其它圖像的參考圖像時,該解碼圖像包括一參考幀標記;當該解碼圖像無需用作解碼其它圖像的參考圖像時,該參考幀標記被清除或更改為空值。該解碼圖像緩衝區的狀態資訊包括每一圖像緩衝區的標記資訊,標記資訊包括圖像緩衝區中的解碼圖像的顯示順序標記和參考幀標記。當圖像緩衝區中的解碼圖像的顯示順序標記和參考幀標記均被清除(例如標記值均為空值),處理器104判斷儲存該解碼圖像的圖像緩衝區處於空閒狀態;當解碼圖像的顯示
順序標記和參考幀標記存在其中之一(例如其中一標記值為非空值),處理器104判斷儲存該解碼圖像的圖像緩衝區(其標記資訊為非空)處於非空閒狀態。
The
在對編碼串流中一圖幀進行解碼之前,處理器104基於所述解碼圖像緩衝區的狀態資訊(即每一圖像緩衝區的標記資訊)確定所述解碼圖像緩衝區是否存在空閒的圖像緩衝區以確定用於儲存該圖幀的解碼圖像的目標圖像緩衝區。目標圖像緩衝區可以是DPB區的一空閒圖像緩衝區(即DPB區中已有空閒的圖像緩衝區),或可以是在DPB區基礎上新增的一圖像緩衝區(即DPB區中已無空閒的圖像緩衝區,則新增一圖像緩衝區以擴大該DPB區,使解碼圖像可存入DPB區新增的圖像緩衝區中)。
Before decoding a frame in the coded stream, the
具體實施例中,編碼串流112包括每一圖幀(Encoded Frame,EF)的參考幀資訊(Reference Picture Control Information,RPCI)及其解碼圖像的顯示順序(Picture Order Count,POC)。每一圖幀的RPCI和POC預設在編碼串流112的SPS資料中。處理器104從編碼串流112中獲取當前幀的RPCI(即需用到解碼圖像緩衝區中哪些已解碼圖像來解碼該當前幀)並根據該RPCI更新解碼圖像緩衝區中的已解碼圖像的RPCI標記(例如清除一張或多張已解碼圖像的RPCI標記)以根據更新後的RPCI標記和POC標記識別出解碼圖像緩衝區中空閒的圖像緩衝區。處理器104還從編碼串流112中獲取當前幀的POC以對該目標圖像緩衝區添加一POC標記。處理器104根據DPB區中解碼圖像的顯示情況及時更新其POC標記。
In a specific embodiment, the encoded
步驟203,處理器104自解碼圖像緩衝區選取一空閒的圖像緩衝區作為目標圖像緩衝區。
In
步驟204,處理器104新增一圖像緩衝區作為目標圖像緩衝區以擴大解碼圖像緩衝區。
In
步驟205,處理器104控制視訊解碼器102解碼所述編碼串流中當前幀以獲得解碼圖像,並藉由記憶體控制器103將解碼圖像儲存到目標圖像緩衝區。
In
目標圖像緩衝區確定之後,視訊解碼器102對當前幀進行解碼以得到當前幀的解碼圖像,並藉由記憶體控制器103將當前幀的解碼圖像儲存到目標圖像緩衝區。
After the target image buffer is determined, the
在一些實施方式中,處理器104可以是中央處理器(Central Processing Unit,CPU)或微控制器(Microcontroller Unit,MCU),本申請不做限定。
In some implementations, the
在一些實施方式中,該解碼裝置101還包括後處理電路(Post Processing Circuit,PPC)105。後處理電路105受處理器104的控制,用於對經視訊解碼器102解碼的解碼圖像做進一步的後級處理,例如對解碼圖像進行解析度調整、旋轉、縮放等處理,並在處理完成後藉由記憶體控制器103存入到記憶體111中。相對應的,記憶體111還包括後處理電路緩衝(Post Processing Circuit Buffer,PPCB)區114,PPCB區114用於儲存待顯示的圖像,待顯示的圖像為後處理電路105對解碼圖像進行後級處理得到的圖像。記憶體111中還儲存有後處理電路驅動(PPC Driver,PPCD)程式116,處理器104藉由記憶體控制器103從記憶體111中讀取PPCD程式116並執行,以控制後處理電路105藉由記憶體控制器103從記憶體111的DPB區113中讀取解碼圖像,並對解碼圖像進行後級處理,然後藉由記憶體控制器103將後級處理得到的圖像儲存到PPCB區114中。
In some implementations, the
具體的,處理器104藉由解析SPS資料,還可以獲取編碼串流112的最大延遲顯示張數(計為Y),在解碼過程中,處理器104藉由記憶體控制器103獲取記憶體111的DPB區中帶有顯示順序標記(或其值不為空值)的圖像緩衝區的數量,當該數量大於最大延遲顯示張數Y時,確定出DPB區中顯示順序標記指示的顯示順序最小(例如標記值最小)的圖像緩衝區,控制後處理電路105從該圖像緩衝區中讀取解碼圖像,並對該解碼圖像進行後級處理,再藉由記憶體控制器103將後級處理得到的圖像儲存到PPCB區114中。
Specifically, the
在一些可行的實施方式中,SPS資料通常是一個編碼串流的第一筆資料,或者同一個編碼串流也可以包含多個序列(sequence),每個序列的SPS資料記錄在編碼串流的第一筆資料中。每個SPS資料包括適用於所在sequence下所有幀(frame)的語法,主要包括:SPS的標識(ID),解析度,最大參考幀張數,最大延遲顯示(max reorder delay)幀張數。 In some feasible implementations, SPS data is usually the first data of a coding stream, or the same coding stream may also contain multiple sequences, and the SPS data of each sequence is recorded in the first data of the coding stream. Each SPS data includes syntax applicable to all frames under the sequence, mainly including: SPS identification (ID), resolution, maximum number of reference frames, and maximum number of delayed display (max reorder delay) frames.
可以看出,本申請實施例提供的解碼裝置101根據解碼圖像緩衝區的狀態資訊動態管理解碼圖像緩衝區的緩衝空間大小。本申請可以在保證解碼正常進行的情況下,實現更加高效地分配緩衝區,減少了緩衝區的浪費,降低了解碼裝置的硬體成本。
It can be seen that the
圖3是本申請實施例提供的一種視訊解碼系統的架構示意圖。該視訊解碼系統中,處理器104藉由讀取記憶體111中的VDD程式115並執行,以向視訊解碼器102發送解碼控制指令,視訊解碼器102回應該指令對編碼串流中的圖幀進行解碼,並將解碼圖像儲存到記憶體111的DPB區。微控制器MCU 104藉由讀取記憶體111中的PPCD程式116並執行,以向後處理電路105發送顯示處理指示,後處理電路105回應該指令對DPB區儲存的解碼圖像進行後級處理,例
如對解碼圖像進行解析度調整、旋轉、縮放等。微控制器MCU 104、視訊解碼器102、後處理電路105可以藉由記憶體控制器103對記憶體111的資料進行讀/寫操作。
FIG3 is a schematic diagram of the architecture of a video decoding system provided by an embodiment of the present application. In the video decoding system, the
其中,記憶體111的DPB區113的初始空間大小設置為(X+1)個圖像緩衝區,X為最大參考幀張數,DPB區113中的圖像緩衝區用於儲存編碼串流中各圖幀的解碼圖像。在解碼過程中,可以根據DPB區113的狀態資訊決定是否需增加圖像緩衝區,例如可以將DPB區113增加到(X+Y)個圖像緩衝區,Y為最大延遲顯示張數。在解碼過程中,可以根據編碼串流中每個圖幀的參考幀資訊以及DPB區113中解碼圖像是否已後級處理及時更新DPB區113中各個圖像緩衝區的標記資訊。
Among them, the initial space size of the
圖3中N、N+1、N+2、......、N+16表示依照一解碼順序解碼編碼串流中一圖幀而得的解碼圖像,POC 0、POC 2、POC 1、......、POC 8表示解碼圖像的顯示順序,例如DPB中(N,POC 0)表示解碼圖像是由編碼串流中第N幀圖幀解碼而得,且該解碼圖像的顯示順序為1,(N+16,POC 8)表示解碼圖像是由第(N+16)的圖幀解碼而得,且該解碼圖像的顯示順序為9。另外,在解碼第(N+16)幀之前,DPB區113中已確定無空閒的圖像緩衝區,故新增1個圖像緩衝區以擴大DPB區113(如圖3的DPB區113中排在最右的圖像緩衝區),利用新增的圖像緩衝區儲存第(N+16)幀的解碼圖像,並根據該解碼圖像的顯示順序新增顯示順序標記以及根據該解碼圖像是否用作解碼其它圖幀的參考幀新增參考幀標記。
In Figure 3, N, N+1, N+2, ..., N+16 represent decoded images obtained by decoding a frame in the coded stream according to a decoding order, and
在另一實施例中,處理器104藉由解析SPS資料,獲取編碼串流112的最大延遲顯示張數(計為Y),並根據編碼串流的最大參考幀張數X以及
最大延遲顯示張數Y設置DPB區,DPB區可以包括X+1至X+Y個圖像緩衝區,即最初分配的DPB區包括的圖像緩衝區的個數大於或等於X+1,且小於或等於X+Y,1<Y<=X。在解碼過程中,處理器104根據DPB的狀態資訊充分利用DPB區的緩衝區,在保證解碼正常進行的情況下,提高DPB區中緩衝空間的利用率。
In another embodiment, the
在另一實施例中,如果後處理電路105需同時處理多張待顯示的解碼圖像,待視訊解碼器102在解碼出多張圖像,後處理電路105才對該多張解碼圖像進行後級處理。如此,DPB區中需儲存可供後處理電路PPC105同時處理的V張解碼圖像。此情況下,處理器104將DPB區的圖像緩衝區的個數初設為最大參考幀張數X、需同時處理解碼圖像數V與1之和,也即是DPB區包括(X+V+1)個圖像緩衝區,並且在解碼過程中,可以根據解碼圖像緩衝區的狀態資訊動態管理DPB區的緩衝空間大小,在保證解碼正常進行的情況下,實現更加高效地分配緩衝區。
In another embodiment, if the
在另一實施例中,如果後處理電路105需要同時處理多張待顯示的解碼圖像,導致無法在解碼器輸出解碼圖像的同時就可以完成對之前的解碼圖像的後級處理,假設後處理電路105需要額外緩衝V張解碼圖像,也即是待顯示幀的緩衝數量為V,則處理器104可以將DPB區的初始大小設置為最大參考幀張數X、最大延遲顯示張數Y與需同時處理解碼圖像數V之和,也即是DPB區包括(X+Y+V)個圖像緩衝區,並且在解碼過程中,可以根據解碼圖像緩衝區的狀態資訊動態管理DPB區的緩衝區的空間大小,在保證解碼正常進行的情況下,實現更加高效地分配緩衝區。
In another embodiment, if the
以下藉由舉例說明本申請在解碼過程中動態管理解碼圖像緩衝區的過程。圖4a是本申請實施例提供的一種編碼串流序列的示意圖,該編碼串流序列包括21個幀,其SPS中記載有該編碼串流序列的最大參考幀張數(如圖中max_ref_num)為4,最大延遲顯示張數(如圖中reorder delay)為4。圖4a中示出了每一幀的解碼順序(如圖中decode order)、圖像顯示順序(如圖中POC)以及參考幀資訊(如圖中reference POC,即基於解碼圖像的顯示順序表明參考關係),例如編碼串流中的第1幀,其decode order為1,POC為0(表示其解碼圖像第1個顯示),reference POC為NA(無參考幀,即該幀解碼時不需參考其他幀);編碼串流中的第5幀,其decode order為5,POC為2(表示其解碼圖像第3個顯示),reference POC為0,16,8,4(即該幀解碼時需參考顯示順序分別為0、16、8和4的這四個解碼圖像),其他各幀不再一一贅述。 The following is an example to illustrate the process of dynamically managing the decoded image buffer during the decoding process of the present application. FIG4a is a schematic diagram of a coding stream sequence provided by an embodiment of the present application. The coding stream sequence includes 21 frames, and its SPS records the maximum number of reference frames of the coding stream sequence (such as max_ref_num in the figure) as 4, and the maximum number of delayed display frames (such as reorder delay in the figure) as 4. Figure 4a shows the decoding order (decode order), image display order (POC) and reference frame information (reference POC, i.e., the reference relationship based on the display order of the decoded image) of each frame. For example, the first frame in the coded stream has a decoding order of 1, a POC of 0 (indicating that the decoded image is displayed first), and a reference POC of NA (no reference frame, i.e., no reference to other frames when decoding this frame); the fifth frame in the coded stream has a decoding order of 5, a POC of 2 (indicating that the decoded image is displayed third), and a reference POC of 0, 16, 8, 4 (i.e., the four decoded images with display orders of 0, 16, 8 and 4 need to be referenced when decoding this frame). Other frames will not be described one by one.
相較於圖4a,圖4b是根據解碼圖像POC顯示的幀與幀之間的參考關係。例如圖4b中,POC為8的B幀,包括指向POC 0的I幀和POC 16的I幀的有向箭頭,表示該幀解碼時需要參考POC為0和POC為16這兩個幀的解碼圖像;POC為4的B幀,包括指向POC 0的I幀和POC 8的B幀的有向箭頭,同時由於POC 8的B幀包括指向POC 0的I幀以及POC 16的I幀的有向箭頭,故該幀解碼時需要參考POC為0、16和8這三個幀的解碼圖像。其他各幀的顯示順序和參考幀不再一一贅述。
Compared with FIG4a, FIG4b shows the reference relationship between frames according to the POC of the decoded image. For example, in FIG4b, the B frame with a POC of 8 includes directed arrows pointing to the I frame with
就圖4a與圖4b所示的實例,處理器104基於最大參考幀張數4將DPB區的緩衝空間初設為5(即4+1)個圖像緩衝區。由於最大延遲顯示張數為4,即該編碼串流至少需解碼出其4個解碼圖像之後才會對其解碼圖像進行顯示,如此直至解碼編碼串流中的第5幀時才顯示解碼圖像中POC為0的解碼圖像
即第5幀的解碼過程與POC為0的解碼圖像的顯示處理同時進行,圖4c便以此作為解碼過程示意的起點。圖4c至圖4e,所示是編碼串流解碼時解碼圖像緩衝區的管理過程的示意圖。
In the example shown in FIG. 4a and FIG. 4b, the
解碼第5幀:將第5幀作為當前幀,在解碼第5幀之前,前4幀解碼圖像已佔用DPB中的4個圖像緩衝區,根據圖4a或者圖4b示出的參考關係,前4張圖像緩衝區的標記資訊均包括顯示順序標記以及參考幀標記。從編碼串流中獲取第5幀的壓縮圖像和參考幀資訊(第5幀的參考幀包括POC為0、16、8和4這四個解碼圖像)、其解碼圖像的POC及用作參考幀等資訊(第5幀的參考幀資訊、解碼圖像的POC和用作參考幀資訊可包含在其壓縮圖像資料中),解碼第5幀不需更新前4個圖像緩衝區的標記資訊中的參考幀標記,圖像緩衝區的標記資訊保持不變,由於此時DPB中還存在空閒的圖像緩衝區(即第5個圖像緩衝區,其標記資訊為空),可以將第5個圖像緩衝區用於儲存第5幀的解碼圖像。接著,解碼第5幀,將第5幀的解碼圖像儲存到第5個圖像緩衝區中,並根據第5幀的解碼圖像的顯示順序將第5個圖像緩衝區的標記資訊設置為包括顯示順序標記,以及在DPB區的狀態資訊中添加第5幀的解碼圖像的顯示順序POC 2與第5個圖像緩衝區之間的關聯關係。
Decode the 5th frame: Take the 5th frame as the current frame. Before decoding the 5th frame, the first 4 frames of decoded images have occupied 4 image buffers in the DPB. According to the reference relationship shown in Figure 4a or 4b, the marking information of the first 4 image buffers includes the display order mark and the reference frame mark. Obtain the compressed image and reference frame information of the 5th frame from the encoded stream (the reference frame of the 5th frame includes four decoded images with POCs of 0, 16, 8 and 4), the POC of the decoded image and the information used as a reference frame (the reference frame information of the 5th frame, the POC of the decoded image and the information used as a reference frame can be included in its compressed image data ), there is no need to update the reference frame marker in the marker information of the first four picture buffers when decoding the 5th frame, and the marker information of the picture buffer remains unchanged. Since there is still an empty picture buffer in the DPB at this time (that is, the 5th picture buffer, whose marker information is empty), the 5th picture buffer can be used to store the decoded picture of the 5th frame. Next, decode the 5th frame, store the decoded image of the 5th frame in the 5th image buffer, and set the mark information of the 5th image buffer to include the display order mark according to the display order of the decoded image of the 5th frame, and add the association between the
在第5幀完成解碼時,DPB區的狀態資訊中包括有顯示順序標記的圖像緩衝區數為5(5大於Y(Y=4)),此時確定DPB區中解碼圖像的POC最小的解碼圖像,即POC 0所標記的解碼圖像,後處理電路105從POC 0對應的圖像緩衝區中獲取解碼圖像,對該解碼圖像進行處理並將處理後的解碼圖像儲存到PPC buffer中以顯示。後處理電路105在對該解碼圖像完成讀取時發送資訊
(例如中斷)給處理器104,處理器104回應訊息清除第1個圖像緩衝區的標記資訊中的顯示順序標記。
When the 5th frame is decoded, the state information of the DPB area includes the number of image buffers with display order marks, which is 5 (5 is greater than Y (Y=4)). At this time, the decoded image with the smallest POC of the decoded image in the DPB area is determined, that is, the decoded image marked by
這時,第1個圖像緩衝區的標記資訊只包括參考幀標記,第2~4圖像緩衝區的標記資訊不變。 At this time, the marker information of the first image buffer only includes the reference frame marker, and the marker information of the second to fourth image buffers remains unchanged.
解碼第6幀:從編碼串流中獲取第6幀的壓縮資料、參考幀資訊(第6幀的參考幀為POC分別為0、16、8和4的解碼圖像)、解碼圖像POC、用作參考幀等資訊(或者自壓縮資料中獲取參考幀、解碼圖像POC、用作參考幀等資訊),並依參考幀資訊確定無需更新DPB區中各圖像緩衝區的參考幀標記,此時DPB中5個圖像緩衝區的標記資訊均不為空,即DPB中不存在空閒的圖像緩衝區,需新增1個圖像緩衝區(即第6個圖像緩衝區)以擴大該DPB區,並將第6幀的解碼圖像儲存到該新增的圖像緩衝區(即第6個圖像緩衝區)。接著,解碼第6幀,將第6幀的解碼圖像儲存到第6個圖像緩衝區中,基於該解碼圖像的顯示順序和不用作參考幀以將第6個緩衝區的標記資訊設置為包括顯示順序標記,並在DPB區的狀態資訊中添加解碼圖像顯示順序POC 1與第6個圖像緩衝區的關聯關係。這時,DPB區的狀態資訊中包括5個顯示順序標記,確定其標記的解碼圖像中POC最小的解碼圖像,即POC 1所標記的解碼圖像。後處理電路105從POC 1對應的第6個圖像緩衝區中獲取解碼圖像以進行處理,將處理後的解碼圖像儲存到PPC buffer中以顯示。後處理電路105在對該解碼圖像完成讀取時發送資訊給處理器104,處理器104回應訊息清清除第6個圖像緩衝區的標記資訊中的顯示順序標記。如此,第6個圖像緩衝區的標記資訊為空,即第6個圖像緩衝區處於空閒狀態。
Decode the 6th frame: Obtain the compressed data of the 6th frame, reference frame information (the reference frame of the 6th frame is the decoded image with
解碼第7幀:從編碼串流中獲取第7幀的壓縮資料、參考幀資訊、解碼圖像POC和不用做參考幀資訊,並根據第7幀的參考幀資訊(第7幀的參考幀包括POC為0、16、8和4的解碼圖像)確定無需更新DPB區中各圖像緩衝區的參考幀標記,並確定此時DPB中的1個(即第6個)圖像緩衝區的標記資訊為空即第6個圖像緩衝區空閒。接著,解碼第7幀,將第7幀的解碼圖像儲存到第6個圖像緩衝區中,基於該解碼圖像的顯示順序和不用作參考幀將第6個圖像緩衝區的標記資訊設置為只包括顯示順序標記,並在DPB區的狀態資訊中添加解碼圖像顯示順序POC 3與第6個圖像緩衝區的關聯關係。
Decode the 7th frame: obtain the compressed data, reference frame information, decoded image POC and non-reference frame information of the 7th frame from the encoded stream, and determine that there is no need to update the reference frame mark of each image buffer in the DPB area based on the reference frame information of the 7th frame (the reference frame of the 7th frame includes decoded images with POC of 0, 16, 8 and 4), and determine that the mark information of one (i.e., the 6th) image buffer in the DPB is empty at this time, that is, the 6th image buffer is free. Next, decode the 7th frame, store the decoded image of the 7th frame in the 6th image buffer, set the marking information of the 6th image buffer to include only the display order mark based on the display order of the decoded image and not used as a reference frame, and add the association between the decoded image
在第7幀完成解碼時,DPB區的狀態資訊中包括有顯示順序標記的圖像緩衝區數為5,確定的POC最小的解碼圖像(POC 2標記的解碼圖像),後處理電路105從POC 2對應的第5個圖像緩衝區中獲取的解碼圖像以進行處理,將處理後的解碼圖像儲存到PPC buffer中以顯示。處理器104回應後處理電路105發送的對解碼圖像完成讀取的消息後清除第5個圖像緩衝區的標記資訊中的顯示順序標記。如此,第5個圖像緩衝區的標記資訊為空,即第5個圖像緩衝區處於空閒狀態。
When the decoding of the 7th frame is completed, the status information of the DPB area includes the number of image buffers with display order marks of 5, the decoded image with the smallest POC determined (decoded image marked with POC 2), and the
解碼第8幀:其解碼的具體過程可參見幀7。區別在於,將第8幀的解碼圖像儲存到第5個圖像緩衝區中,基於該解碼圖像的顯示順序和用作參考幀將第5個圖像緩衝區的標記資訊設置為包括顯示順序標記和參考幀標記,並在DPB區的狀態資訊中添加解碼圖像顯示順序POC 6、參考幀標記與第5個圖像緩衝區的關聯關係。
Decode the 8th frame: The specific decoding process can be found in
在解碼幀8時,後處理電路105依序對從DPB中的圖像緩衝區中讀取POC3標記的解碼圖像進行處理以顯示。待後處理電路105完成讀取後,處理器104該圖像緩衝區的標記資訊中的顯示順序標記。
When decoding
對於編碼串流的後續9幀可依照前述第5幀至第8幀的解碼過程進行理解,此處不再一一贅述。 The subsequent 9 frames of the coded stream can be understood according to the decoding process of the 5th to 8th frames mentioned above, and will not be elaborated here.
可以看出,結合圖4c、圖4d以及圖4e可知,對編碼串流的第1幀至第21幀的解碼已滿足最大參考幀張數為4,最大延遲顯示張數為4的編碼串流序列要求,並且,DPB的最大圖像緩衝區使用數為7,在於解碼第14幀至第17幀時;相較於DPB初始的5個圖像緩衝區增加了2個,分別在於解碼第6幀和第14幀時。相較於現有技術中給DPB最初分配9(即X+Y+1)個圖像緩衝區,可節約DBP佔用的圖像緩衝區。 It can be seen that, combined with Figure 4c, Figure 4d and Figure 4e, the decoding of the coded stream from the 1st frame to the 21st frame has met the coded stream sequence requirements of the maximum number of reference frames of 4 and the maximum number of delayed display frames of 4. In addition, the maximum number of image buffers used by the DPB is 7, which is when decoding the 14th to 17th frames; compared with the initial 5 image buffers of the DPB, 2 more are added, which are when decoding the 6th and 14th frames respectively. Compared with the prior art in which 9 (i.e. X+Y+1) image buffers are initially allocated to the DPB, the image buffer occupied by the DBP can be saved.
圖5a是本申請實施例提供的又一種編碼串流序列的示意圖,該編碼串流序列包括12個幀,其SPS中包括有最大參考幀張數為4,最大延遲顯示張數為2。圖5a中示出了每一幀的解碼順序、圖像顯示順序以及參考幀資訊reference POC(即參考關係)。本領域具有通常知識者可由圖4a的上述說明瞭解圖5中編碼串流中每一幀的詳細資訊,故不再一一贅述。 FIG5a is a schematic diagram of another coded stream sequence provided by the embodiment of the present application. The coded stream sequence includes 12 frames, and its SPS includes a maximum reference frame number of 4 and a maximum delayed display frame number of 2. FIG5a shows the decoding order, image display order, and reference frame information reference POC (i.e., reference relationship) of each frame. A person with ordinary knowledge in the field can understand the detailed information of each frame in the coded stream in FIG5 from the above description of FIG4a, so it will not be repeated one by one.
圖5b是根據解碼圖像POC顯示的幀與幀之間的參考關係。本領域具有通常知識者可由圖4b的上述內容可知圖5b中每一圖幀的詳細內容,故不再一一贅述。 Figure 5b shows the reference relationship between frames according to the decoded image POC. A person with ordinary knowledge in the field can know the detailed content of each frame in Figure 5b from the above content of Figure 4b, so it will not be described one by one.
在該實施例中,處理器104基最大參考幀張數4將DPB區的初始圖像緩衝空間設置為5個圖像緩衝區。由於最大延遲顯示張數為2,即至少需解碼出編碼串流的2個解碼圖像後才顯示解碼圖像,因此在解碼編碼串流中的第3
幀時才顯示顯示解碼圖像中POC為0的解碼圖像,圖5c以此作為解碼過程示意的起點。
In this embodiment, the
在一些實施例中(例如對於HEVC或AVC標準的解碼),1X16,1YX。
In some embodiments (e.g., for decoding of the HEVC or AVC standards), 1
本領域具有通常知識者由圖4c至圖4e的上述內容可知圖5c至圖5d中每一圖幀的解碼過程,故該編碼串流中圖幀的解碼過程不在一一贅述。 A person with ordinary knowledge in the field can know the decoding process of each frame in Figures 5c to 5d from the above contents of Figures 4c to 4e, so the decoding process of the frames in the coded stream will not be described one by one.
相較於圖4a中的實施例,圖5a所示的實施例的編碼串流的最大參考幀張數同為4,但最大延遲顯示張數為2,解碼時DPB的圖像緩衝區最多儲存6張,發生在解碼第9幀時,即DPB最大只需要(X+2)個圖像緩衝區,相較於現有技術中將DPB最初設置為7(X+Y+1)個圖像緩衝區節約了1個圖像緩衝區。 Compared with the embodiment in FIG4a, the maximum number of reference frames of the coded stream in the embodiment shown in FIG5a is also 4, but the maximum number of delayed display frames is 2. During decoding, the DPB image buffer stores a maximum of 6 frames, which occurs when decoding the 9th frame, that is, the DPB only needs a maximum of (X+2) image buffers, which saves 1 image buffer compared to the prior art in which the DPB is initially set to 7 (X+Y+1) image buffers.
雖然本申請的實施例如上所述,然而該複數個實施例並非用於限定本申請,本技術領域具有通常知識者可依據本申請的明示或隱含的內容對本申請的技術特徵施以變化,凡此種種變化均可能屬於本申請所尋求的專利保護範疇,換言之,本申請的專利保護範圍須視本說明書的申請專利範圍所界定者為準。 Although the embodiments of this application are described above, the multiple embodiments are not used to limit this application. People with ordinary knowledge in this technical field may change the technical features of this application according to the explicit or implicit content of this application. All these changes may fall within the scope of patent protection sought by this application. In other words, the scope of patent protection of this application shall be subject to the scope of patent application defined in this specification.
101:解碼裝置 101:Decoding device
102:視訊解碼器 102: Video decoder
103:記憶體控制器 103:Memory controller
104:處理器 104: Processor
105:後處理電路 105: Post-processing circuit
111:記憶體 111:Memory
112:編碼串流 112: Encoded stream
113:解碼圖像緩衝區 113: Decoded image buffer
114:後處理電路緩衝區 114: Post-processing circuit buffer
115:視訊解碼器驅動程式 115: Video decoder driver
116:後處理電路驅動程式 116: Post-processing circuit driver
X,max_ref_num:最大參考幀張數 X,max_ref_num: Maximum number of reference frames
Y,reorder delay:最大延遲顯示張數 Y, reorder delay: maximum number of delayed display sheets
V:需同時處理解碼圖像數 V: The number of decoded images that need to be processed simultaneously
decode order:解碼順序 decode order:decoding order
reference POC:參考幀的圖像顯示順序 reference POC: the image display order of the reference frame
NA:無參考幀 NA: No reference frame
I:幀內編碼幀 I: Intra-frame coded frame
B:後向參考幀 B: Backward reference frame
P:前向參考幀 P: Forward reference frame
201,202,203,204,205:步驟 201,202,203,204,205: Steps
〔圖1〕是本申請實施例提供的一種解碼裝置的結構示意圖; 〔圖2〕是本申請實施例提供的一種視訊解碼方法的流程示意圖;〔圖3〕是本申請實施例提供的一種視訊解碼系統的架構示意圖;〔圖4a〕是本申請實施例提供的一種編碼串流序列的參考關係的示意圖;〔圖4b〕是本申請實施例提供的另一種編碼串流序列的參考關係的示意圖;〔圖4c〕是本申請實施例提供的一種編碼串流序列第5幀至第11幀的解碼過程中緩衝管理的示意圖;〔圖4d〕是本申請實施例提供的一種編碼串流序列第12幀至第16幀的解碼過程中緩衝管理的示意圖;〔圖4e〕是本申請實施例提供的一種編碼串流序列第17幀至第21幀的解碼過程中緩衝管理的示意圖;〔圖5a〕是本申請實施例提供的又一種編碼串流序列的參考關係的示意圖;〔圖5b〕是本申請實施例提供的又一種編碼串流序列的參考關係的示意圖;〔圖5c〕是本申請實施例提供的一種編碼串流序列第3幀至第7幀的解碼過程中緩衝管理的示意圖;以及〔圖5d〕是本申請實施例提供的一種編碼串流序列第8幀至第12幀的解碼過程中緩衝管理的示意圖。 [Figure 1] is a schematic diagram of the structure of a decoding device provided by an embodiment of the present application; [Figure 2] is a schematic diagram of the process of a video decoding method provided by an embodiment of the present application; [Figure 3] is a schematic diagram of the architecture of a video decoding system provided by an embodiment of the present application; [Figure 4a] is a schematic diagram of the reference relationship of a coded stream sequence provided by an embodiment of the present application; [Figure 4b] is a schematic diagram of the reference relationship of another coded stream sequence provided by an embodiment of the present application; [Figure 4c] is a schematic diagram of buffer management in the decoding process of the 5th to 11th frames of a coded stream sequence provided by an embodiment of the present application; [Figure 4d] is a schematic diagram of the buffer management in the decoding process of the 12th to 11th frames of a coded stream sequence provided by an embodiment of the present application 4e is a schematic diagram of buffer management during the decoding process of the 17th to 21st frames of a coded stream sequence provided by an embodiment of the present application; 5a is a schematic diagram of another reference relationship of a coded stream sequence provided by an embodiment of the present application; 5b is a schematic diagram of another reference relationship of a coded stream sequence provided by an embodiment of the present application; 5c is a schematic diagram of buffer management during the decoding process of the 3rd to 7th frames of a coded stream sequence provided by an embodiment of the present application; and 5d is a schematic diagram of buffer management during the decoding process of the 8th to 12th frames of a coded stream sequence provided by an embodiment of the present application.
201,202,203,204,205:步驟 201,202,203,204,205: Steps
Claims (16)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW112140039A TWI862229B (en) | 2023-10-19 | 2023-10-19 | Video decoding method and decoder device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW112140039A TWI862229B (en) | 2023-10-19 | 2023-10-19 | Video decoding method and decoder device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TWI862229B true TWI862229B (en) | 2024-11-11 |
| TW202518901A TW202518901A (en) | 2025-05-01 |
Family
ID=94379939
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW112140039A TWI862229B (en) | 2023-10-19 | 2023-10-19 | Video decoding method and decoder device |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI862229B (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1589018A (en) * | 2004-08-05 | 2005-03-02 | 联合信源数字音视频技术(北京)有限公司 | Control device and method for video frequency decoding buffer zone |
| CN108513128A (en) * | 2011-09-23 | 2018-09-07 | 维洛媒体国际有限公司 | Decoded picture buffer management |
| CN114586365A (en) * | 2019-10-07 | 2022-06-03 | 华为技术有限公司 | Reference Image Entry Constraints Based on DPB Size |
-
2023
- 2023-10-19 TW TW112140039A patent/TWI862229B/en active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1589018A (en) * | 2004-08-05 | 2005-03-02 | 联合信源数字音视频技术(北京)有限公司 | Control device and method for video frequency decoding buffer zone |
| CN108513128A (en) * | 2011-09-23 | 2018-09-07 | 维洛媒体国际有限公司 | Decoded picture buffer management |
| CN114586365A (en) * | 2019-10-07 | 2022-06-03 | 华为技术有限公司 | Reference Image Entry Constraints Based on DPB Size |
Also Published As
| Publication number | Publication date |
|---|---|
| TW202518901A (en) | 2025-05-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP2093766B1 (en) | Information processing apparatus, method, recording medium and program | |
| AU2021203875A1 (en) | Image prediction method and device | |
| KR101240450B1 (en) | Methods for determining block averages for film grain simulation | |
| JP3120773B2 (en) | Image processing device | |
| CN101364403B (en) | Image processing apparatus and method for controlling the same | |
| TW201404181A (en) | Image decoding method and image decoding apparatus | |
| CN110708609A (en) | Video playing method and device | |
| US9319682B2 (en) | Moving image encoding apparatus, control method therefor, and non-transitory computer readable storage medium | |
| US20250126282A1 (en) | Video decoding method and decoder device | |
| CN114286098A (en) | A video encoding and decoding method, system, device and storage medium | |
| TWI862229B (en) | Video decoding method and decoder device | |
| CN116132719A (en) | Video processing method, device, electronic equipment and readable storage medium | |
| CN115866350B (en) | Video reverse playing method and device, electronic equipment and storage medium | |
| US8300701B2 (en) | Offspeed playback in a video editing system of video data compressed using long groups of pictures | |
| US6848013B2 (en) | Decoding method for reducing delay time | |
| US10582207B2 (en) | Video processing systems | |
| CN115665481A (en) | Video processing apparatus, method, device, and storage medium | |
| TWI316812B (en) | ||
| CN100428799C (en) | Video decoding image storage space management method | |
| US20200137134A1 (en) | Multi-session low latency encoding | |
| JPH10191257A (en) | Digital video decoding apparatus and digital video decoding method | |
| CN114780450B (en) | A buffer unit and method for intra-block copying | |
| CN114339338B (en) | Image custom rendering method based on vehicle-mounted video and storage medium | |
| JP2000324492A (en) | Image decoding device | |
| CN101163237A (en) | Image processing method and device |



