[go: up one dir, main page]

TWI862229B - Video decoding method and decoder device - Google Patents

Video decoding method and decoder device Download PDF

Info

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
Application number
TW112140039A
Other languages
Chinese (zh)
Other versions
TW202518901A (en
Inventor
金濤
Original Assignee
大陸商星宸科技股份有限公司
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 大陸商星宸科技股份有限公司 filed Critical 大陸商星宸科技股份有限公司
Priority to TW112140039A priority Critical patent/TWI862229B/en
Application granted granted Critical
Publication of TWI862229B publication Critical patent/TWI862229B/en
Publication of TW202518901A publication Critical patent/TW202518901A/en

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

A video decoding method is applied to a decoder device to decode an encoded stream stored in a memory. The decoder device includes a video decoder, a memory controller, and a processor, and the video decoding method includes: setting, by the memory controller, a decoded picture buffer in the memory based on a maximum number X of reference frames in the encoded stream, in which the decoded picture buffer includes X+1 picture buffers, each picture buffer is configured to store a decoded image, and X is a positive integer; determining an idle picture buffer in the decoded picture buffer based on state information of the decoded picture buffer; and controlling the video decoder to decode a current frame in the encoded stream to obtain a decoded image of the current frame and store the decoded image of the current frame to the idle picture buffer.

Description

視訊解碼方法及解碼裝置Video decoding method and decoding device

本申請涉及視訊編解碼技術領域,具體涉及一種視訊解碼方法及解碼裝置。 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 decoding device 101 includes a video decoder (VD) 102, a memory controller 103 and a processor 104. The decoding device 101 may be a decoding chip, which may decode the encoded stream (ES) data stored in the memory 111. The memory controller 103 may be a memory controller (Memory Controller), which may be implemented by a memory interface unit (MIU) circuit and/or a direct memory access (DMA) circuit. The memory 111 stores a video decoder driver (VDD) program 115. The processor 104 reads and executes the VDD program 115 from the memory 111 through the memory controller 103 to control the video decoder 102 to decode the encoded stream 112.

下面將結合圖2與圖3對解碼裝置101對編碼串流112的解碼過程加以詳述。 The decoding process of the coded stream 112 by the decoding device 101 will be described in detail below with reference to FIG. 2 and FIG. 3.

圖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 step 201, the processor 104 sets a decoded image buffer in the memory 111 through the memory controller 103 based on the maximum reference frame number X of the encoded stream.

具體的,處理器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 processor 104 reads the sequence parameter set (SPS) data of the coded stream 112 from the memory (e.g., dynamic random access memory (DRAM) 111) through the memory controller 103, parses the SPS data to obtain the maximum number of reference frames (denoted as X) of the coded stream 112, and allocates a decoded picture buffer (denoted as Decoded Picture Buffer) for the decoded picture in the memory 111 through the memory controller 103 according to the maximum number of reference frames. Buffer (DPB) area 113. In one embodiment, the DPB area includes at least X+1 image buffers, each of which is used to store a decoded image. The SPS data includes reference frame information of each frame in the coded stream and display order information of each decoded image.

步驟202,處理器104基於所述解碼圖像緩衝區的狀態資訊確定解碼圖像緩衝區是否存在空閒的圖像緩衝區。若是,則執行步驟203;若否,則執行步驟204。 In step 202, the processor 104 determines whether there is an idle image buffer in the decoded image buffer based on the status information of the decoded image buffer. If yes, step 203 is executed; if not, step 204 is executed.

處理器104基於儲存的每一圖像緩衝區的標記資訊獲知該解碼圖像緩衝區的狀態資訊,標記資訊包括解碼圖像的顯示順序(Picture Order Count,POC)標記和參考幀標記,顯示順序標記用於指示解碼圖像作為待顯示幀以及其顯示順序。當一解碼圖像待顯示時,新增該解碼圖像的顯示順序標記;當解碼圖像顯示時,該顯示順序標記被清除或更改為空值。當一解碼圖像需用作解碼其它圖像的參考圖像時,該解碼圖像包括一參考幀標記;當該解碼圖像無需用作解碼其它圖像的參考圖像時,該參考幀標記被清除或更改為空值。該解碼圖像緩衝區的狀態資訊包括每一圖像緩衝區的標記資訊,標記資訊包括圖像緩衝區中的解碼圖像的顯示順序標記和參考幀標記。當圖像緩衝區中的解碼圖像的顯示順序標記和參考幀標記均被清除(例如標記值均為空值),處理器104判斷儲存該解碼圖像的圖像緩衝區處於空閒狀態;當解碼圖像的顯示 順序標記和參考幀標記存在其中之一(例如其中一標記值為非空值),處理器104判斷儲存該解碼圖像的圖像緩衝區(其標記資訊為非空)處於非空閒狀態。 The processor 104 obtains the status information of the decoded image buffer based on the mark information of each stored image buffer. The mark information includes the display order (Picture Order Count, POC) mark and the reference frame mark of the decoded image. The display order mark is used to indicate that the decoded image is a frame to be displayed and its display order. When a decoded image is to be displayed, the display order mark of the decoded image is added; when the decoded image is displayed, the display order mark is cleared or changed to a null value. When a decoded image needs to be used as a reference image for decoding other images, the decoded image includes a reference frame mark; when the decoded image does not need to be used as a reference image for decoding other images, the reference frame mark is cleared or changed to a null value. The status information of the decoded image buffer includes marking information of each image buffer, and the marking information includes a display order mark and a reference frame mark of the decoded image in the image buffer. When the display order mark and reference frame mark of the decoded image in the image buffer are both cleared (for example, the mark values are all null values), the processor 104 determines that the image buffer storing the decoded image is in an idle state; when one of the display order mark and reference frame mark of the decoded image exists (for example, one of the mark values is a non-null value), the processor 104 determines that the image buffer storing the decoded image (whose mark information is non-null) is in a non-idle state.

在對編碼串流中一圖幀進行解碼之前,處理器104基於所述解碼圖像緩衝區的狀態資訊(即每一圖像緩衝區的標記資訊)確定所述解碼圖像緩衝區是否存在空閒的圖像緩衝區以確定用於儲存該圖幀的解碼圖像的目標圖像緩衝區。目標圖像緩衝區可以是DPB區的一空閒圖像緩衝區(即DPB區中已有空閒的圖像緩衝區),或可以是在DPB區基礎上新增的一圖像緩衝區(即DPB區中已無空閒的圖像緩衝區,則新增一圖像緩衝區以擴大該DPB區,使解碼圖像可存入DPB區新增的圖像緩衝區中)。 Before decoding a frame in the coded stream, the processor 104 determines whether there is an empty image buffer in the decoded image buffer based on the status information of the decoded image buffer (ie, the marking information of each image buffer) to determine a target image buffer for storing the decoded image of the frame. The target image buffer can be an empty image buffer in the DPB area (i.e., there is an empty image buffer in the DPB area), or it can be an image buffer newly added on the basis of the DPB area (i.e., if there is no empty image buffer in the DPB area, then an image buffer is newly added to expand the DPB area so that the decoded image can be stored in the newly added image buffer in the DPB area).

具體實施例中,編碼串流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 stream 112 includes the reference picture control information (RPCI) of each frame (Encoded Frame, EF) and the display order of the decoded image (Picture Order Count, POC). The RPCI and POC of each frame are preset in the SPS data of the encoded stream 112. The processor 104 obtains the RPCI of the current frame from the coded stream 112 (i.e., which decoded images in the decoded image buffer are needed to decode the current frame) and updates the RPCI mark of the decoded images in the decoded image buffer according to the RPCI (e.g., clears the RPCI mark of one or more decoded images) to identify the free image buffer in the decoded image buffer according to the updated RPCI mark and POC mark. The processor 104 also obtains the POC of the current frame from the coded stream 112 to add a POC mark to the target image buffer. The processor 104 updates its POC mark in time according to the display status of the decoded image in the DPB area.

步驟203,處理器104自解碼圖像緩衝區選取一空閒的圖像緩衝區作為目標圖像緩衝區。 In step 203, the processor 104 selects an idle image buffer from the decoded image buffer as the target image buffer.

步驟204,處理器104新增一圖像緩衝區作為目標圖像緩衝區以擴大解碼圖像緩衝區。 In step 204, the processor 104 adds a new image buffer as a target image buffer to expand the decoded image buffer.

步驟205,處理器104控制視訊解碼器102解碼所述編碼串流中當前幀以獲得解碼圖像,並藉由記憶體控制器103將解碼圖像儲存到目標圖像緩衝區。 In step 205, the processor 104 controls the video decoder 102 to decode the current frame in the encoded stream to obtain a decoded image, and stores the decoded image in the target image buffer via the memory controller 103.

目標圖像緩衝區確定之後,視訊解碼器102對當前幀進行解碼以得到當前幀的解碼圖像,並藉由記憶體控制器103將當前幀的解碼圖像儲存到目標圖像緩衝區。 After the target image buffer is determined, the video decoder 102 decodes the current frame to obtain the decoded image of the current frame, and stores the decoded image of the current frame in the target image buffer through the memory controller 103.

在一些實施方式中,處理器104可以是中央處理器(Central Processing Unit,CPU)或微控制器(Microcontroller Unit,MCU),本申請不做限定。 In some implementations, the processor 104 may be a central processing unit (CPU) or a microcontroller unit (MCU), which is not limited in this application.

在一些實施方式中,該解碼裝置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 decoding device 101 further includes a post-processing circuit (PPC) 105. The post-processing circuit 105 is controlled by the processor 104 and is used to perform further post-processing on the decoded image decoded by the video decoder 102, such as adjusting the resolution, rotating, scaling, etc., and storing the decoded image in the memory 111 through the memory controller 103 after the processing is completed. Correspondingly, the memory 111 also includes a post-processing circuit buffer (PPCB) area 114, and the PPCB area 114 is used to store the image to be displayed. The image to be displayed is the image obtained by the post-processing circuit 105 performing post-processing on the decoded image. The memory 111 also stores a post-processing circuit driver (PPC Driver, PPCD) program 116. The processor 104 reads and executes the PPCD program 116 from the memory 111 through the memory controller 103 to control the post-processing circuit 105 to read the decoded image from the DPB area 113 of the memory 111 through the memory controller 103, and perform post-processing on the decoded image, and then the memory controller 103 stores the image obtained by the post-processing in the PPCB area 114.

具體的,處理器104藉由解析SPS資料,還可以獲取編碼串流112的最大延遲顯示張數(計為Y),在解碼過程中,處理器104藉由記憶體控制器103獲取記憶體111的DPB區中帶有顯示順序標記(或其值不為空值)的圖像緩衝區的數量,當該數量大於最大延遲顯示張數Y時,確定出DPB區中顯示順序標記指示的顯示順序最小(例如標記值最小)的圖像緩衝區,控制後處理電路105從該圖像緩衝區中讀取解碼圖像,並對該解碼圖像進行後級處理,再藉由記憶體控制器103將後級處理得到的圖像儲存到PPCB區114中。 Specifically, the processor 104 can also obtain the maximum delayed display number (denoted as Y) of the coded stream 112 by parsing the SPS data. During the decoding process, the processor 104 obtains the number of image buffers with display order marks (or whose values are not null) in the DPB area of the memory 111 through the memory controller 103. When the number is greater than the maximum delayed display number, the processor 104 will display the image buffers with display order marks (or whose values are not null). When the number of images displayed is Y, the image buffer with the smallest display order (e.g., the smallest mark value) indicated by the display order mark in the DPB area is determined, and the post-processing circuit 105 is controlled to read the decoded image from the image buffer, and the decoded image is post-processed, and the image obtained by the post-processing is then stored in the PPCB area 114 through the memory controller 103.

在一些可行的實施方式中,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 decoding device 101 provided in the embodiment of the present application dynamically manages the buffer space size of the decoded image buffer according to the status information of the decoded image buffer. The present application can achieve more efficient buffer allocation while ensuring normal decoding, reduce buffer waste, and reduce the hardware cost of the decoding device.

圖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 processor 104 reads and executes the VDD program 115 in the memory 111 to send a decoding control instruction to the video decoder 102. The video decoder 102 decodes the frame in the coded stream in response to the instruction and stores the decoded image in the DPB area of the memory 111. The microcontroller MCU 104 reads and executes the PPCD program 116 in the memory 111 to send a display processing instruction to the post-processing circuit 105. The post-processing circuit 105 responds to the instruction to perform post-processing on the decoded image stored in the DPB area, such as adjusting the resolution, rotating, scaling, etc. of the decoded image. The microcontroller MCU 104, the video decoder 102, and the post-processing circuit 105 can read/write the data of the memory 111 through the memory controller 103.

其中,記憶體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 DPB area 113 of the memory 111 is set to (X+1) image buffers, X is the maximum number of reference frames, and the image buffers in the DPB area 113 are used to store the decoded images of each frame in the coded stream. During the decoding process, it can be determined whether to increase the image buffer according to the status information of the DPB area 113. For example, the DPB area 113 can be increased to (X+Y) image buffers, and Y is the maximum number of delayed display frames. During the decoding process, the marking information of each image buffer in the DPB area 113 can be updated in time according to the reference frame information of each frame in the coded stream and whether the decoded image in the DPB area 113 has been processed by the later stage.

圖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 POC 0, POC 2, POC 1, ..., POC 8 represent the display order of the decoded images. For example, (N, POC 0) in DPB indicates that the decoded image is decoded from the Nth frame in the coded stream, and the display order of the decoded image is 1, and (N+16, POC 8) indicates that the decoded image is decoded from the (N+16)th frame, and the display order of the decoded image is 9. In addition, before decoding the (N+16)th frame, it is determined that there is no free image buffer in the DPB area 113, so an additional image buffer is added to expand the DPB area 113 (such as the rightmost image buffer in the DPB area 113 in FIG. 3), and the newly added image buffer is used to store the decoded image of the (N+16)th frame, and a display order mark is added according to the display order of the decoded image, and a reference frame mark is added according to whether the decoded image is used as a reference frame for decoding other frames.

在另一實施例中,處理器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 processor 104 obtains the maximum delayed display number of the coded stream 112 (counted as Y) by parsing the SPS data, and sets the DPB area according to the maximum reference frame number X of the coded stream and the maximum delayed display number Y. The DPB area may include X+1 to X+Y image buffers, that is, the number of image buffers included in the initially allocated DPB area is greater than or equal to X+1, and less than or equal to X+Y, 1<Y<=X. During the decoding process, the processor 104 makes full use of the buffer of the DPB area according to the status information of the DPB, and improves the utilization rate of the buffer space in the DPB area while ensuring that the decoding is carried out normally.

在另一實施例中,如果後處理電路105需同時處理多張待顯示的解碼圖像,待視訊解碼器102在解碼出多張圖像,後處理電路105才對該多張解碼圖像進行後級處理。如此,DPB區中需儲存可供後處理電路PPC105同時處理的V張解碼圖像。此情況下,處理器104將DPB區的圖像緩衝區的個數初設為最大參考幀張數X、需同時處理解碼圖像數V與1之和,也即是DPB區包括(X+V+1)個圖像緩衝區,並且在解碼過程中,可以根據解碼圖像緩衝區的狀態資訊動態管理DPB區的緩衝空間大小,在保證解碼正常進行的情況下,實現更加高效地分配緩衝區。 In another embodiment, if the post-processing circuit 105 needs to process multiple decoded images to be displayed at the same time, the post-processing circuit 105 will perform post-processing on the multiple decoded images after the video decoder 102 decodes the multiple images. In this way, the DPB area needs to store V decoded images that can be processed by the post-processing circuit PPC105 at the same time. In this case, the processor 104 initially sets the number of image buffers in the DPB area to the sum of the maximum number of reference frames X, the number of decoded images to be processed simultaneously V and 1, that is, the DPB area includes (X+V+1) image buffers, and during the decoding process, the buffer space size of the DPB area can be dynamically managed according to the status information of the decoded image buffer, so as to achieve more efficient buffer allocation while ensuring normal decoding.

在另一實施例中,如果後處理電路105需要同時處理多張待顯示的解碼圖像,導致無法在解碼器輸出解碼圖像的同時就可以完成對之前的解碼圖像的後級處理,假設後處理電路105需要額外緩衝V張解碼圖像,也即是待顯示幀的緩衝數量為V,則處理器104可以將DPB區的初始大小設置為最大參考幀張數X、最大延遲顯示張數Y與需同時處理解碼圖像數V之和,也即是DPB區包括(X+Y+V)個圖像緩衝區,並且在解碼過程中,可以根據解碼圖像緩衝區的狀態資訊動態管理DPB區的緩衝區的空間大小,在保證解碼正常進行的情況下,實現更加高效地分配緩衝區。 In another embodiment, if the post-processing circuit 105 needs to process multiple decoded images to be displayed at the same time, so that the post-processing of the previous decoded images cannot be completed at the same time as the decoder outputs the decoded images, assuming that the post-processing circuit 105 needs to buffer V decoded images additionally, that is, the buffer number of frames to be displayed is V, then the processor 104 can set the initial size of the DPB area to Set to the sum of the maximum number of reference frames X, the maximum number of delayed display frames Y, and the number of decoded images to be processed simultaneously V, that is, the DPB area includes (X+Y+V) image buffers, and during the decoding process, the buffer space size of the DPB area can be dynamically managed according to the status information of the decoded image buffer, while ensuring that the decoding is carried out normally, to achieve more efficient buffer allocation.

以下藉由舉例說明本申請在解碼過程中動態管理解碼圖像緩衝區的過程。圖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 POC 0 and the I frame with POC 16, indicating that the decoded images of the two frames with POC 0 and POC 16 need to be referred to when decoding the frame; the B frame with a POC of 4 includes directed arrows pointing to the I frame with POC 0 and the B frame with POC 8. At the same time, since the B frame with POC 8 includes directed arrows pointing to the I frame with POC 0 and the I frame with POC 16, the decoded images of the three frames with POC 0, 16 and 8 need to be referred to when decoding the frame. The display order and reference frames of other frames will not be described one by one.

就圖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 processor 104 initially sets the buffer space of the DPB area to 5 (i.e., 4+1) image buffers based on the maximum number of reference frames 4. Since the maximum number of delayed display frames is 4, the coded stream needs to decode at least 4 decoded images before displaying its decoded images, and the decoded images with POC of 0 are not displayed until the 5th frame in the coded stream is decoded. That is, the decoding process of the 5th frame and the display processing of the decoded images with POC of 0 are performed simultaneously, and FIG. 4c uses this as the starting point for illustrating the decoding process. FIG. 4c to FIG. 4e are schematic diagrams showing the management process of the decoded image buffer when decoding the coded stream.

解碼第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 display order POC 2 of the decoded image of the 5th frame and the 5th image buffer in the status information of the DPB area.

在第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 POC 0. The post-processing circuit 105 obtains the decoded image from the image buffer corresponding to POC 0, processes the decoded image and stores the processed decoded image in the PPC buffer for display. When the post-processing circuit 105 completes reading the decoded image, it sends information (such as interruption) to the processor 104, and the processor 104 responds to the message to clear the display order mark in the mark information of the first image buffer.

這時,第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 POC 0, 16, 8 and 4 respectively), decoded image POC, reference frame information, etc. from the encoded stream (or obtain the reference frame, decoded image POC, reference frame information, etc. from the compressed data), and determine based on the reference frame information that D does not need to be updated The reference frame mark of each image buffer in the PB area. At this time, the marking information of the 5 image buffers in the DPB is not empty, that is, there is no idle image buffer in the DPB, and one new image buffer (i.e., the 6th image buffer) is required to expand the DPB area, and the decoded image of the 6th frame is stored in the newly added image buffer (i.e., the 6th image buffer). Next, the 6th frame is decoded, and the decoded image of the 6th frame is stored in the 6th image buffer. Based on the display order of the decoded image and the fact that it is not used as a reference frame, the marking information of the 6th buffer is set to include a display order mark, and the association between the decoded image display order POC 1 and the 6th image buffer is added to the status information of the DPB area. At this time, the status information of the DPB area includes 5 display order marks, and the decoded image with the smallest POC among the marked decoded images is determined, that is, the decoded image marked by POC 1. The post-processing circuit 105 obtains the decoded image from the 6th image buffer corresponding to POC 1 for processing, and stores the processed decoded image in the PPC buffer for display. When the post-processing circuit 105 completes reading the decoded image, it sends information to the processor 104, and the processor 104 responds to the message to clear the display order mark in the mark information of the 6th image buffer. In this way, the mark information of the 6th image buffer is empty, that is, the 6th image buffer is in an idle state.

解碼第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 display order POC 3 and the 6th image buffer in the status information of the DPB area.

在第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 post-processing circuit 105 obtains the decoded image from the 5th image buffer corresponding to POC 2 for processing, and stores the processed decoded image in the PPC buffer for display. The processor 104 clears the display order mark in the mark information of the 5th image buffer in response to the message sent by the post-processing circuit 105 that the decoded image has been read. In this way, the mark information of the 5th image buffer is empty, that is, the 5th image buffer is in an idle state.

解碼第8幀:其解碼的具體過程可參見幀7。區別在於,將第8幀的解碼圖像儲存到第5個圖像緩衝區中,基於該解碼圖像的顯示順序和用作參考幀將第5個圖像緩衝區的標記資訊設置為包括顯示順序標記和參考幀標記,並在DPB區的狀態資訊中添加解碼圖像顯示順序POC 6、參考幀標記與第5個圖像緩衝區的關聯關係。 Decode the 8th frame: The specific decoding process can be found in frame 7. The difference is that the decoded image of the 8th frame is stored in the 5th image buffer, and the marking information of the 5th image buffer is set to include the display order mark and the reference frame mark based on the display order of the decoded image and the use as a reference frame, and the association between the decoded image display order POC 6, the reference frame mark and the 5th image buffer is added to the status information of the DPB area.

在解碼幀8時,後處理電路105依序對從DPB中的圖像緩衝區中讀取POC3標記的解碼圖像進行處理以顯示。待後處理電路105完成讀取後,處理器104該圖像緩衝區的標記資訊中的顯示順序標記。 When decoding frame 8, the post-processing circuit 105 sequentially processes the decoded image marked with POC3 from the image buffer in the DPB for display. After the post-processing circuit 105 completes the reading, the processor 104 marks the display order in the marking information of the image buffer.

對於編碼串流的後續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 processor 104 sets the initial image buffer space of the DPB area to 5 image buffers based on the maximum reference frame number 4. Since the maximum delayed display number is 2, that is, at least 2 decoded images of the coded stream must be decoded before the decoded image is displayed, the decoded image with a POC of 0 in the decoded image is displayed when the 3rd frame in the coded stream is decoded. Figure 5c uses this as the starting point for illustrating the decoding process.

在一些實施例中(例如對於HEVC或AVC標準的解碼),1

Figure 112140039-A0305-02-0018-1
X
Figure 112140039-A0305-02-0018-2
16,1
Figure 112140039-A0305-02-0018-3
Y
Figure 112140039-A0305-02-0018-4
X。 In some embodiments (e.g., for decoding of the HEVC or AVC standards), 1
Figure 112140039-A0305-02-0018-1
X
Figure 112140039-A0305-02-0018-2
16,1
Figure 112140039-A0305-02-0018-3
Y
Figure 112140039-A0305-02-0018-4
X.

本領域具有通常知識者由圖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)

一種視訊解碼方法,應用於解碼裝置以解碼儲存在記憶體的編碼串流,所述解碼裝置包括視訊解碼器、記憶體控制器以及處理器,所述視訊解碼方法包括: 基於所述編碼串流的最大參考幀張數X藉由記憶體控制器在所述記憶體中設置解碼圖像緩衝區,所述解碼圖像緩衝區包括X+1個圖像緩衝區,每一圖像緩衝區用於儲存一張解碼圖像,X為正整數; 基於所述解碼圖像緩衝區的狀態資訊確定所述解碼圖像緩衝區中的空閒的圖像緩衝區;以及 控制所述視訊解碼器解碼所述編碼串流中當前幀以獲得當前幀的解碼圖像,並將所述當前幀的解碼圖像存入所述圖像緩衝區中。 A video decoding method is applied to a decoding device to decode a coded stream stored in a memory, the decoding device comprising a video decoder, a memory controller and a processor, the video decoding method comprising: Based on the maximum reference frame number X of the coded stream, a decoded image buffer is set in the memory by the memory controller, the decoded image buffer comprises 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, an idle image buffer in the decoded image buffer is determined; and Control the video decoder to decode the current frame in the coded stream to obtain a decoded image of the current frame, and store the decoded image of the current frame in the image buffer. 如請求項1之視訊解碼方法,還包括: 基於所述解碼圖像緩衝區的狀態資訊確定所述解碼圖像緩衝區不存在空閒的圖像緩衝區,新增一圖像緩衝區以擴大所述解碼圖像緩衝區,所述新增圖像緩衝區用於儲存所述當前幀的解碼圖像。 The video decoding method of claim 1 further comprises: Based on the status information of the decoded image buffer, determining that there is no free image buffer in the decoded image buffer, adding an image buffer to expand the decoded image buffer, and the added image buffer is used to store the decoded image of the current frame. 如請求項1之視訊解碼方法,其中所述狀態資訊包括每一所述圖像緩衝區的標記資訊,所述標記資訊包括儲存在所述解碼圖像緩衝區中的所述解碼圖像的顯示順序標記和參考幀標記,且所述視訊解碼方法還包括: 從所述編碼串流中獲取參考幀資訊;以及 基於所述參考幀資訊更新儲存在所述解碼圖像緩衝區中的所述解碼圖像的參考幀標記,以對應更新所述解碼圖像緩衝區中每個圖像緩衝區的標記資訊。 The video decoding method of claim 1, wherein the status information includes marking information of each of the image buffers, the marking information includes a display order mark and a reference frame mark of the decoded image stored in the decoded image buffer, and the video decoding method further includes: Obtaining reference frame information from the encoded stream; and Updating the reference frame mark of the decoded image stored in the decoded image buffer based on the reference frame information to correspond to updating the marking information of each image buffer in the decoded image buffer. 如請求項3之視訊解碼方法,其中所述基於所述解碼圖像緩衝區的狀態資訊確定所述解碼圖像緩衝區空閒的圖像緩衝區包括: 當所述圖像緩衝區的標記資訊為空,則確定所述解碼圖像緩衝區存在空閒的圖像緩衝區。 As in the video decoding method of claim 3, the step of determining an empty image buffer of the decoded image buffer based on the status information of the decoded image buffer includes: When the marking information of the image buffer is empty, it is determined that an empty image buffer exists in the decoded image buffer. 如請求項3之視訊解碼方法,還包括: 基於所述當前幀的解碼圖像的顯示順序資訊和用作參考幀資訊其中至少之一對應生成顯示順序標記和參考幀標記其中至少之一,並據此更新儲存所述當前幀的解碼圖像的圖像緩衝區的標記資訊。 The video decoding method of claim 3 further includes: Based on at least one of the display order information of the decoded image of the current frame and the reference frame information, at least one of the display order mark and the reference frame mark is generated, and the mark information of the image buffer storing the decoded image of the current frame is updated accordingly. 如請求項5之視訊解碼方法,還包括: 顯示儲存於所述解碼圖像緩衝區中的所述解碼圖像,並據此更新儲存所述解碼圖像的所述圖像緩衝區的標記資訊中的顯示順序標記。 The video decoding method of claim 5 further includes: Displaying the decoded image stored in the decoded image buffer, and updating the display order mark in the mark information of the image buffer storing the decoded image accordingly. 如請求項1之視訊解碼方法,還包括: 基於所述編碼串流的最大延遲顯示張數Y以及每一所述圖像緩衝區的標記資訊包括的顯示順序標記,從所述解碼圖像緩衝區中讀取當前待顯示解碼圖像;以及 清除儲存所述當前待顯示解碼圖像的所述圖像緩衝區的顯示順序標記,Y為正整數。 The video decoding method of claim 1 further comprises: Based on the maximum delayed display number Y of the encoded stream and the display order mark included in the mark information of each image buffer, reading the current decoded image to be displayed from the decoded image buffer; and Clearing the display order mark of the image buffer storing the current decoded image to be displayed, Y is a positive integer. 如請求項1之視訊解碼方法,其中所述基於所述編碼串流的最大參考幀張數X設置解碼圖像緩衝區包括: 基於所述編碼串流的最大參考幀張數X以及最大延遲顯示張數Y設置解碼圖像緩衝區,所述解碼圖像緩衝區包括的圖像緩衝區的個數大於或等於X+1,且小於或等於X+Y,X>=Y>1,Y為正整數。 As in the video decoding method of claim 1, the setting of the decoded image buffer based on the maximum reference frame number X of the coded stream includes: The decoded image buffer is set based on the maximum reference frame number X of the coded stream and the maximum delayed display frame number Y, the number of image buffers included in the decoded image buffer is greater than or equal to X+1 and less than or equal to X+Y, X>=Y>1, and Y is a positive integer. 一種解碼裝置,用於解碼儲存在記憶體的編碼串流,其中所述解碼裝置包括視訊解碼器、記憶體控制器以及處理器,且所述處理器用於: 基於所述編碼串流的最大參考幀張數X藉由記憶體控制器在所述記憶體中設置解碼圖像緩衝區,所述解碼圖像緩衝區包括X+1個圖像緩衝區,每一圖像緩衝區用於儲存一張解碼圖像,X為正整數; 基於所述解碼圖像緩衝區的狀態資訊確定所述解碼圖像緩衝區中空閒的圖像緩衝區;以及 控制所述視訊解碼器解碼所述編碼串流中當前幀以獲得當前幀的解碼圖像,並將所述當前幀的解碼圖像存入所述圖像緩衝區中。 A decoding device for decoding a coded stream stored in a memory, wherein the decoding device comprises a video decoder, a memory controller and a processor, and the processor is used to: Based on the maximum number of reference frames X of the coded stream, a decoded image buffer is set in the memory by the memory controller, the decoded image buffer comprises 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, an empty image buffer in the decoded image buffer is determined; and Control the video decoder to decode the current frame in the coded stream to obtain a decoded image of the current frame, and store the decoded image of the current frame in the image buffer. 如請求項9之解碼裝置,其中當基於所述解碼圖像緩衝區的狀態資訊確定所述解碼圖像緩衝區不存在空閒的圖像緩衝區時,所述處理器新增一圖像緩衝區以擴大所述解碼圖像緩衝區,所述新增圖像緩衝區用於儲存所述當前幀的解碼圖像。A decoding device as claimed in claim 9, wherein when it is determined based on the status information of the decoded image buffer that there is no free image buffer in the decoded image buffer, the processor adds a new image buffer to expand the decoded image buffer, and the newly added image buffer is used to store the decoded image of the current frame. 如請求項9之解碼裝置,其中所述狀態資訊包括每一所述圖像緩衝區的標記資訊,所述標記資訊包括儲存在所述解碼圖像緩衝區中的所述解碼圖像的顯示順序標記和參考幀標記,且所述處理器用以: 從所述編碼串流中獲取參考幀資訊;以及 基於所述參考幀資訊更新儲存在所述解碼圖像緩衝區中的所述解碼圖像的參考幀標記,以對應更新所述解碼圖像緩衝區中每個圖像緩衝區的標記資訊。 A decoding device as claimed in claim 9, wherein the state information includes marking information of each of the image buffers, the marking information includes a display order mark and a reference frame mark of the decoded image stored in the decoded image buffer, and the processor is used to: obtain reference frame information from the encoded stream; and update the reference frame mark of the decoded image stored in the decoded image buffer based on the reference frame information to correspond to updating the marking information of each image buffer in the decoded image buffer. 如請求項11之解碼裝置,其中當所述圖像緩衝區的標記資訊為空,所述處理器確定所述解碼圖像緩衝區存在空閒的圖像緩衝區。A decoding device as claimed in claim 11, wherein when the marking information of the image buffer is empty, the processor determines that there is an empty image buffer in the decoded image buffer. 如請求項11之解碼裝置,其中所述處理器基於所述當前幀的解碼圖像的顯示順序資訊和用作參考幀資訊其中至少之一對應生成顯示順序標記和參考幀標記其中至少之一,並據此更新儲存所述當前幀的解碼圖像的圖像緩衝區的標記資訊。A decoding device as claimed in claim 11, wherein the processor generates at least one of a display order mark and a reference frame mark based on display order information of the decoded image of the current frame and at least one of the reference frame information, and updates the mark information of the image buffer storing the decoded image of the current frame accordingly. 如請求項13之解碼裝置,其中所述處理器用以: 顯示儲存在所述解碼圖像緩衝區中的所述解碼圖像,並據此更新儲存所述解碼圖像的所述圖像緩衝區的標記資訊中的顯示順序標記。 A decoding device as claimed in claim 13, wherein the processor is used to: Display the decoded image stored in the decoded image buffer, and update the display order mark in the mark information of the image buffer storing the decoded image accordingly. 如請求項9之解碼裝置,其中所述處理器用以: 基於所述編碼串流的最大延遲顯示張數Y以及每一所述圖像緩衝區的標記資訊包括的顯示順序標記,從所述解碼圖像緩衝區中讀取當前待顯示解碼圖像;以及 清除儲存所述當前待顯示解碼圖像的所述圖像緩衝區的顯示順序標記,Y為正整數。 The decoding device of claim 9, wherein the processor is used to: read the current decoded image to be displayed from the decoded image buffer based on the maximum delayed display number Y of the encoded stream and the display order mark included in the mark information of each image buffer; and clear the display order mark of the image buffer storing the current decoded image to be displayed, Y is a positive integer. 如請求項9之解碼裝置,其中所述處理器用以: 基於所述編碼串流的最大參考幀張數X以及最大延遲顯示張數Y設置解碼圖像緩衝區,所述解碼圖像緩衝區包括的圖像緩衝區的個數大於或等於X+1,且小於或等於X+Y,X>=Y>1,Y為正整數。 A decoding device as claimed in claim 9, wherein the processor is used to: Set a decoded image buffer based on the maximum number of reference frames X and the maximum number of delayed display frames Y of the coded stream, wherein the number of image buffers included in the decoded image buffer is greater than or equal to X+1 and less than or equal to X+Y, X>=Y>1, and Y is a positive integer.
TW112140039A 2023-10-19 2023-10-19 Video decoding method and decoder device TWI862229B (en)

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)

* Cited by examiner, † Cited by third party
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

Patent Citations (3)

* Cited by examiner, † Cited by third party
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