TW202005371A - Video coding and decoding - Google Patents

Video coding and decoding Download PDF

Info

Publication number
TW202005371A
TW202005371A TW108118391A TW108118391A TW202005371A TW 202005371 A TW202005371 A TW 202005371A TW 108118391 A TW108118391 A TW 108118391A TW 108118391 A TW108118391 A TW 108118391A TW 202005371 A TW202005371 A TW 202005371A
Authority
TW
Taiwan
Prior art keywords
sao
image
derivation
ctu
time
Prior art date
Application number
TW108118391A
Other languages
Chinese (zh)
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 日商佳能股份有限公司
Publication of TW202005371A publication Critical patent/TW202005371A/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • H04N19/86Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression involving reduction of coding artifacts, e.g. of blockiness
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/10Processing, recording or transmission of stereoscopic or multi-view image signals
    • H04N13/106Processing image signals
    • H04N13/161Encoding, multiplexing or demultiplexing different image signal components
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/117Filters, e.g. for pre-processing or post-processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/147Data rate or code amount at the encoder output according to rate distortion criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/154Measured or subjectively estimated visual quality after decoding, e.g. measurement of distortion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • H04N19/463Embedding additional information in the video signal during the compression process by compressing encoding parameters before transmission
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/80Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
    • H04N19/82Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation involving filtering within a prediction loop

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

An image comprising a plurality of image parts is subjected to sample adaptive offset (SAO) filtering. The SAO filtering comprises selecting, from among two or more available temporal derivations of SAO parameters, a temporal derivation of SAO parameters to apply to an image part, the available temporal derivations comprising different ways of deriving at least one SAO parameter of said image part from an SAO parameter of a collocated image part of a reference image. SAO filtering is performed on the image part using the derived SAO parameters. The two temporal derivations may be a temporal copy (merge) derivation and a temporal derivation involving modifying at least one SAO parameter of the collocated image part, for example a direction-changing or rotation modification.

Description

視訊編碼及解碼Video encoding and decoding

本發明關於視訊編碼及解碼。The invention relates to video encoding and decoding.

近來,聯合視訊專家小組(JVET),由MPEG及ITU-T第16研究群組的VCEG所組成的協作團隊,開始研究一種稱為通用視訊編碼(Versatile Video Coding, VVC)的新視訊編碼標準。VVC的目標是提供較現有的HEVC標準更顯著提高的壓縮效能(即,通常是之前的兩倍),並且將在2020年完成。主要的目標應用和服務包括,但不限於,360度和高動態範圍(high-dynamic-range, HDR)視訊。整體來說,JVET使用由獨立測試實驗室進行的正式的主觀測試來評估來自32個組織的回應。某些提案展示了相較於使用HEVC通常為40%或更高的壓縮效率增益。對超高畫質(ultra-high definition, UHD)視訊測試材料顯示出特別有效。因此,我們可預期最終標準的壓縮效率增益將遠遠超出目標50%。 JVET探索模型(JEM)使用所有的HEVC工具。這些工具之一是取樣自適應偏移(SAO)濾波。然而,比起在HEVC參考軟體中,在JEM參考軟體中SAO效率較低。這起因於相較於其他迴圈濾波器較少的評估以及信號發送低效率。 US 9769450揭示了一種SAO濾波器,用於諸如由HEVC標準所實現的三維或3D視訊編碼(3D Video Coding)或3DVC。該濾波器直接重複使用獨立視圖或經編碼的相依視圖的SAO濾波器參數來編碼另一相依視圖,或者僅重複使用獨立視圖或經編碼的相依視圖的SAO濾波器參數的一部分來編碼另一相依視圖。透過從獨立視圖或經編碼的相依視圖複製SAO參數來重複使用SAO參數。 US 2014/0192860 Al是關於HEVC的可適性擴展。HEVC可適性擴展旨在允許編碼/解碼具有多個可適性層的視訊,每一層是由一系列的幀所組成。透過從實際在下(例如,基礎)層使用的SAO參數推測、或推導出將在上層(例如,增強層)使用的SAO參數來提高編碼效率。這是因為推測某些SAO參數能夠避免傳輸該些參數。 期望提高受到SAO濾波的影像的編碼效率。Recently, the Joint Video Experts Group (JVET), a collaborative team of MPEG and VCEG from the ITU-T Study Group 16 began to study a new video coding standard called Versatile Video Coding (VVC). The goal of VVC is to provide significantly higher compression performance than the existing HEVC standard (ie, generally double the previous), and it will be completed in 2020. The main target applications and services include, but are not limited to, 360-degree and high-dynamic-range (HDR) video. Overall, JVET uses formal subjective tests conducted by independent test laboratories to evaluate responses from 32 organizations. Some proposals show a compression efficiency gain of typically 40% or higher compared to using HEVC. It is particularly effective for ultra-high definition (UHD) video test materials. Therefore, we can expect that the compression efficiency gain of the final standard will far exceed the target by 50%. The JVET exploration model (JEM) uses all HEVC tools. One of these tools is sample adaptive offset (SAO) filtering. However, compared to the HEVC reference software, the SAO is less efficient in the JEM reference software. This is due to less evaluation and lower signal transmission efficiency than other loop filters. US 9769450 discloses an SAO filter for three-dimensional or 3D video coding (3D Video Coding) or 3DVC, such as implemented by the HEVC standard. The filter directly reuses the SAO filter parameters of the independent view or the encoded dependent view to encode another dependent view, or only reuses a portion of the SAO filter parameters of the independent view or the encoded dependent view to encode another dependent view. Reuse SAO parameters by copying them from independent views or coded dependent views. US 2014/0192860 Al is about adaptability expansion of HEVC. The HEVC adaptability extension is designed to allow encoding/decoding of video with multiple adaptability layers, each layer consisting of a series of frames. The coding efficiency is improved by inferring from the SAO parameters actually used in the lower (eg, base) layer, or deriving the SAO parameters that will be used in the upper layer (eg, enhancement layer). This is because it is speculated that certain SAO parameters can avoid transmitting these parameters. It is expected to improve the coding efficiency of the video subjected to SAO filtering.

依據本發明的第一態樣,提供了一種取樣自適應偏移(sample adaptive offset, SAO)濾波的方法,如申請專利範圍第1至20項中任一項所述。 依據本發明的第二態樣,提供了一種編碼影像的方法,如申請專利範圍第21至23項中任一項所述。 依據本發明的第三態樣,提供了一種解碼影像的方法,如申請專利範圍第24項所述。 依據本發明的第四態樣,提供了一種執行取樣自適應偏移(SAO)濾波的裝置,如申請專利範圍第25項所述。 依據本發明的第五態樣,提供了一種編碼器,如申請專利範圍第26項所述。 依據本發明的第五態樣,提供了一種解碼器,如申請專利範圍第27項所述。 依據本發明的第六至第八態樣,提供了一種程式,當由電腦或處理器執行時,使電腦或處理器分別執行第一至第三態樣的方法。 該程式可被單獨提供,或者可由載體媒體執行或者在載體媒體中執行。該載體媒體可以是非暫時性的,例如,儲存媒體,特別是電腦可讀取儲存媒體。該載體媒體也可以是暫時性的,例如,信號或其他傳輸媒體。該信號可以透過任何合適的網路,包括網際網路來傳輸。 依據本發明的第九態樣,提供了一種信號,如申請專利範圍第29項所述。 這種信號可以是暫時形式或者是非暫時形式。例如,信號可被儲存在諸如藍光光碟的媒體儲存裝置中。然後,可透過從媒體儲存裝置重現信號而將信號從非暫時形式轉換成暫時形式。According to the first aspect of the present invention, a method for sampling adaptive offset (SAO) filtering is provided, as described in any of items 1 to 20 of the patent application. According to the second aspect of the present invention, a method for encoding an image is provided, as described in any one of items 21 to 23 of the patent application range. According to the third aspect of the present invention, a method for decoding an image is provided, as described in item 24 of the patent application scope. According to the fourth aspect of the present invention, there is provided an apparatus for performing sample adaptive offset (SAO) filtering, as described in item 25 of the patent application scope. According to the fifth aspect of the present invention, an encoder is provided, as described in item 26 of the patent application scope. According to the fifth aspect of the present invention, a decoder is provided, as described in item 27 of the patent application scope. According to the sixth to eighth aspects of the present invention, a program is provided, which, when executed by a computer or processor, causes the computer or processor to execute the first to third aspects, respectively. The program may be provided separately, or may be executed by or in a carrier medium. The carrier medium may be non-transitory, for example, a storage medium, especially a computer-readable storage medium. The carrier medium may also be temporary, for example, a signal or other transmission medium. The signal can be transmitted through any suitable network, including the Internet. According to the ninth aspect of the invention, a signal is provided, as described in item 29 of the patent application scope. This signal may be temporary or non-transient. For example, the signal may be stored in a media storage device such as a Blu-ray disc. The signal can then be converted from a non-transitory form to a temporary form by reproducing the signal from the media storage device.

圖1是關於高效率視訊編碼(High Efficiency Video Coding, HEVC)視訊標準中使用的編碼結構。視訊序列1是由一連串的數位影像i組成。每個這樣的數位影像由一或多個矩陣表示。矩陣係數表示像素。 序列的影像2可被分成多個切片3。切片可在某些情況下構成整個影像。這些切片被分成不重疊的多個編碼樹單元(Coding Tree Unit, CTU)。編碼樹單元(CTU)是高效率視訊編碼(HEVC)視訊標準的基本處理單元,並且概念上,在結構上對應於在數個先前的視訊標準中使用的大區塊(macroblock)單元。CTU有時也被稱為最大編碼單元(Largest Coding Unit, LCU)。CTU具有亮度及色度分量部分,每個分量部分被稱為編碼樹塊(Coding Tree Block, CTB)。圖1中未示出這些不同的顏色分量。 CTU的尺寸通常為64×64個像素。可使用四分樹分解將每個CTU迭代地分成更小的可變尺寸編碼單元(Coding Unit, CU) 5。 編碼單元是基本的編碼元素,並且由稱為預測單元(Prediction Unit, PU)和轉換單元(Transform Unit, TU)的兩種子單元構成。PU或TU的最大尺寸等於CU的尺寸。預測單元對應於用於預測像素值的CU的分割。如6所示,CU分成PU的各種不同的分割是可能的,包括分成4個方形PU的分割以及分成2個矩形PU的兩種不同的分割。轉換單元是使用DCT進行空間轉換的基本單元。可基於四分樹表示7將CU分割成多個TU。 每個切片被嵌入一個網路抽象層(Network Abstraction Layer, NAL)單元中。此外,將視訊序列的編碼參數儲存在稱為參數集的專用NAL單元中。在HEVC和H.264/AVC中,採用兩種參數集NAL單元:第一、序列參數集(Sequence Parameter Set, SPS) NAL單元,其收集在整個視訊序列期間未改變的所有參數。通常,其處理編碼組態(coding profile)、視訊幀的尺寸和其他的參數。第二、圖像參數集(Picture Parameter Set, PPS) NAL單元包括可能在序列中各影像(或幀)中不同的參數。HEVC還包括視訊參數集(Video Parameter Set, VPS) NAL單元,其包含描述位元流之整體結構的參數。VPS是HEVC中定義的一種新型參數集,適用於位元流的所有層。一層可包含多個時間子層,並且所有的版本1位元流都限於單層。HEVC具有某些針對可調性和多視圖的分層擴充,並且這些擴充將支持多層,具有向後兼容版本1基礎層。 圖2示出了可於其中實現本發明之一或多個實施例的資料通訊系統。資料通訊系統包含發送裝置,在此情況中該發送裝置是伺服器201,其可被操作以經由資料通訊網路200將資料流的資料封包傳輸到接收裝置,在此情況中該接收裝置是客戶終端202。資料通訊網路200可以是廣域網路(WAN)或區域網路(LAN)。此種網路可以是例如無線網路(Wifi/802.11a或b或g)、乙太網路、網際網路或由數種不同網路組成的混合型網路。在本發明的特定實施例中,資料通訊系統可以是數位電視廣播系統,其中伺服器201將相同的資料內容傳送到多個客戶端。 由伺服器201提供的資料流204可以由表示視訊和音訊資料的多媒體資料組成。在本發明的一些實施例中,伺服器201可分別使用麥克風和相機來提取音訊和視訊資料流。在一些實施例中,資料流可被儲存在伺服器201上,或者由伺服器201從另一資料提供者處接收,或者在伺服器201處產生。伺服器201被設置有編碼器,用於編碼視訊和音訊流,特別是提供用於傳輸的經壓縮的位元流,該經壓縮的位元流是作為提供給編碼器之輸入的資料的更緊密的表示。 為了獲得傳輸資料品質與傳輸資料數量的更好的比例,視訊資料的壓縮可以例如依據HEVC格式或H.264/AVC格式。 客戶端202接收傳輸的位元流,並且解碼重建的位元流以在顯示裝置上重現視訊影像以及透過揚聲器重現音訊資料。 僅管在圖2的範例中考量了串流場景,但應當理解的是,在本發明的一些實施例中,編碼器和解碼器之間的資料通訊可以使用舉例來說諸如光碟的媒體儲存裝置來執行。 在本發明的一或多個實施例中,以表示補償位移的資料傳送視訊影像,以便應用於影像的重建像素,在最終影像中提供濾波後的像素。 圖3示意性地示出處理裝置300,其被配置成實現本發明的至少一個實施例。處理裝置300可以是諸如微電腦、工作站或輕便可攜式裝置的裝置。裝置300包含通訊匯流排313,其被連接至: -中央處理單元311,諸如微處理器,表示為CPU; -唯讀記憶體307,表示為ROM,用於儲存用於實現本發明的電腦程式; -隨機存取記憶體312,表示為RAM,用於儲存本發明之實施例之方法的可執行碼以及暫存器,其適於記錄實現根據本發明之實施例的編碼數位影像之序列的方法及/或解碼位元流的方法所需的變數及參數;以及 -通訊介面302,連接到通訊網路303,在通訊網路上傳輸或接收待處理的數位資料。 可選地,裝置300還可包括下面的元件: -資料儲存機構304,例如硬碟,用於儲存用於實現本發明之一或多個實施例的方法的電腦程式以及在實現本發明之一或多個實施例期間使用或產生的資料; -用於磁碟306的磁碟驅動器305,磁碟驅動器適於從磁碟306讀取資料或將資料寫入該磁碟; -螢幕309,用於透過鍵盤310或任何其他的指示機構顯示資料及/或用作使用者圖形介面。 裝置300可以連接到各種周邊設備,諸如舉例來說數位相機320或麥克風308,各周邊設備連接到輸入/輸出卡(未示出),以便將多媒體資料提供給裝置300。 通訊匯流排提供裝置300中包括的或者連接至其的各種元件之間的通訊和互動能力。匯流排的表示不是限制性的,特別是中央處理單元可操作以直接或透過裝置300的另一元件將指令傳送給裝置300的任何元件。 磁碟306可以由任何資訊媒體代替,諸如舉例來說可重寫或者不可重寫的光碟(CD-ROM),ZIP磁碟或記憶卡,一般來說,可以由資訊儲存機構代替,該資訊儲存機構可以由微電腦或微處理器讀取、集成或者不集成至裝置,可能是可移除的並且適於儲存一或多個程式,該些程式的執行使得依據本發明的編碼數位影像之序列的方法及/或解碼位元流的方法能夠實現。 可執行碼可被儲存在唯讀記憶體307中、硬碟304上或者在可移除的數位媒體上,諸如舉例來說如前所述的磁碟306。依據一種變型,可以透過通訊網路303、經由介面302接收程式的可執行碼,以便在被執行之前儲存在裝置300的一個儲存機構中,諸如硬碟304。 中央處理單元311適於控制及引導依據本發明的程式或程式之軟體碼的指令或部分的執行、儲存在前述儲存機構之一的指令。在電力開啟時,儲存在非揮發性記憶體中,例如儲存在硬碟304上或者在唯讀記憶體307中的一或多個程式被傳送到隨機存取記憶體312以及暫存器,該隨機存取記憶體隨後包含該一或多個程式的可執行碼,該暫存器用於儲存用於實現本發明所需的變數及參數。 在此實施例中,裝置是可編程裝置,其使用軟體來實現本發明。然而,可選地,本發明可以硬體實現(例如,以特定應用積體電路或ASIC的形式)。 圖4示出依據本發明之至少一個實施例的編碼器的方塊圖。編碼器由連接的模組表示,每個模組適於例如以待由裝置300之CPU 311執行的程式指令的形式,實現依據本發明之一或多個實施例的實現編碼影像序列之一影像的至少一個實施例的方法的至少一個相應步驟。 由編碼器400接收數位影像i0至in的原始序列401作為輸入。每個數位影像由一組稱為像素的樣本表示。 在執行編碼處理之後,由編碼器400輸出位元流410。位元流410包含複數個編碼單元或切片(slice),每個切片包含切片標頭以及切片主體,切片標頭用於發送用以編碼切片的編碼參數的編碼值,切片主體包含經編碼的視訊資料。 透過模組402將輸入數位影像i0至in 401分成多個像素塊。該些塊對應於影像部分,並且可具有可變尺寸(例如,4×4、8×8、16×16、32×32、64×64、128×128個像素,並且還可以考慮數個矩形塊尺寸)。為每個輸入塊選擇一編碼模式。提供兩種系列的編碼模式:基於空間預測編碼的編碼模式(幀內(Intra)預測),及基於時間預測的編碼模式(幀間(Inter)編碼、合併(Merge)、SKIP)。可能的編碼模式是經過測試的。 模組403實現幀內預測處理,其中待編碼的給定區塊是由從待編碼的該區塊的鄰近區塊的像素計算來的預測子預測的。若選擇幀內編碼,則將所選的幀內預測子的指示以及給定區塊和其預測子之間的差異編碼以提供殘差。 時間預測是由運動估計模組404及運動補償模組405實現。首先,由運動估計模組404從一組參考影像416之中選擇一參考影像,並且選擇該參考影像的一部分,也稱為參考區域或影像部分,其是最靠近待編碼之給定區塊的區域。運動補償模組405接著使用所選擇的區域來預測待編碼的區塊。由運動補償模組405計算所選擇的參考區域和給定的區塊之間的差異,亦稱為殘差區塊。由運動向量指示所選擇的參考區域。 因此,在兩種情況下(空間和時間預測),透過從原始區塊減去預測來計算殘差。 在由模組403實現的INTRA預測中,編碼預測方向。在時間預測中,編碼至少一個運動向量。 若選擇幀間預測,則編碼關於運動向量及殘差區塊的資訊。為了進一步降低位元率,假設運動是均勻的,由關於運動向量預測子的差來編碼運動向量。由運動向量預測及編碼模組417從運動向量場418獲得一組運動資訊預測子的運動向量預測子。 編碼器400還包括選擇模組406,用於透過應用編碼成本標準,諸如碼率-失真(rate-distortion)標準來選擇編碼模式。為了進一步減少冗餘,轉換模組407將轉換(諸如DCT)施加至殘差區塊,然後將獲得的經轉換的資料透過量化模組408進行量化,並且透過熵編碼模組409進行熵編碼。最後,將正被編碼的當前區塊的經編碼的殘差區塊插入位元流410中。 編碼器400還執行經編碼的影像的解碼,以便產生用於後續影像之運動估計的參考影像。這使得接收位元流的編碼器和解碼器能夠具有相同的參考幀。反向量化模組411執行經量化之資料的反向量化,接著透過逆轉換模組412進行反向轉換。幀內預測模組413使用預測資訊來決定將哪個預測子用於給定區塊,並且運動補償模組414實際上將透過模組412獲得的殘差加到從該組參考影像416獲得的參考區域。 然後由模組415施加後濾波,以過濾重建的像素的幀。在本發明的實施例中,使用SAO迴圈濾波器,其中補償偏移被添加到重建影像之重建像素的像素值。 圖5是說明依據本發明之至少一個實施例的迴圈濾波處理的步驟的流程圖。在初始的步驟51中,編碼器產生全幀的重建。接著,在步驟52中,對此第一重建施加去區塊濾波器,以便產生去區塊的重建53。去區塊濾波器的目的是為了去除殘差量化及區塊運動補償或區塊幀內預測所產生的區塊偽像。在低位元率時這些偽像視覺上是重要的。去區塊濾波器操作以依據兩個相鄰區塊的特性來平滑區塊界線。考慮每個區塊的編碼模式、用於殘差編碼的量化參數、及界線的相鄰像素差。對所有的幀施用相同的標準/分類,並且不傳送額外的資料。去區塊濾波器透過移除區塊偽像來改善當前幀的視覺品質,並且還改善了用於後續幀的運動估計和運動補償。事實上,區塊偽像的高頻被去除了,因此這些高頻不需要以後續幀的紋理殘差來補償。 在去區塊濾波器之後,在步驟54中使用依據本發明之實施例所確定的SAO參數,透過取樣自適應偏移(SAO)迴圈濾波器過濾去區塊的重建。接著在步驟56中,可以自適應迴圈濾波器(ALF)對得到的幀55進行過濾,以產生重建的幀57,其將被顯示並用作後續幀間(Inter)幀的參考幀。 在步驟54中,將幀區域的每個像素分類成一類(class)或一組(group)。相同的偏移值被添加到屬於某類或某組的每一個像素值。 下面將參考圖12至38更詳細地解釋在本發明之不同實施例中的取樣自適應偏移濾波之SAO參數的推導。 圖6示出依據本發明之實施例的解碼器60的方塊圖,該解碼器可被用來從編碼器接收資料。解碼器由連接的模組表示,每個模組適於例如以待由裝置300的CPU 311執行的程式指令的形式實現由解碼器60執行的方法的相應步驟。 解碼器60接收包含編碼單元的位元流61,每個編碼單元由包含編碼參數之資訊的標頭以及包含經編碼的視訊資料的主體組成。如關於圖4所解釋的,經編碼的視訊資料是經過熵編碼的,並且針對給定區塊,將運動向量預測子的索引在預定數量的位元上編碼。接收到的經編碼的視訊資料是由模組62進行熵解碼。殘差資料接著由模組63進行去量化,然後由模組64施加逆轉換以獲得像素值。 亦將指示編碼模式的模式資料熵解碼,並且基於該模式,對經編碼的影像資料之區塊執行INTRA類型解碼或INTER類型解碼。 在INTRA模式的情況下,由幀內預測模組65依據位元流中指定的幀內預測模式來確定INTRA預測子。 若模式是INTER,從位元流提取運動預測資訊,以便找到編碼器所使用的參考區域。運動預測資訊由參考幀索引及運動向量殘差組成。由運動向量解碼模組70將運動向量預測子加到運動向量殘差,以獲得運動向量。 運動向量解碼模組70對由運動預測編碼的每個當前區塊應用運動向量解碼。一旦獲得了針對當前區塊的運動向量預測子的索引,則與當前區塊相關聯的運動向量的實際值可以被解碼,並且被用來由模組66施加反向運動補償。從參考影像68提取由經解碼的運動向量指示的參考影像部分,以施加反向運動補償66。以經解碼的運動向量來更新運動向量場資料71,以便用於後續經解碼的運動向量的逆預測。 最後,獲得經解碼的區塊。由後濾波模組67施加後濾波,其類似於如參考圖5所述之應用在編碼器的後濾波模組815。最後,由解碼器60提供經解碼的視訊信號69。 SAO濾波的目的是,與不傳送資訊的去區塊濾波器相反,透過在位元流中發送額外的資料來提高重建幀的品質。如上所述,將每個像素分類到預定的類或組,並且將相同的偏移值加到相同類/組的每一個像素樣本。針對每一類,在位元流中編碼一個偏移。SAO迴圈濾波有兩種SAO類型:邊緣偏移(Edge Offset, EO)類型及帶偏移(Band Offset, BO)類型。圖7A及7B中示意性地示出邊緣偏移類型的範例,以及圖8中示意性地示出帶偏移類型的範例。 在HEVC中,逐CTU應用SAO濾波。在此情況下,在編碼器側,針對每個CTU選擇需要執行SAO濾波的參數(SAO參數組),並且在解碼器側,針對每個CTU解碼及/或推導出必要的參數。此透過同時處理每個CTU而不會在處理整個幀時引入延遲,提供了容易編碼及解碼視訊序列的可能性。此外,當啟用SAO濾波時,僅使用一種SAO類型:依據針對每個分類在位元流中傳送的相關參數,使用邊緣偏移類型濾波器或者帶偏移類型濾波器。在HEVC中,SAO參數之其中一個是SAO類型參數sao_type_idx,其指示對CTU而言,是否為有關的CTU選擇EO類型、BO類型或無SAO濾波。 例如,針對給定的CTU,可以從上面或左邊的CTU複製SAO參數,而不是傳送所有的SAO資料。HEVC中的SAO參數的其中一個是sao_merge_up旗標,當設定該旗標時,指示目標CTU的SAO參數應複製自上面的CTU。HEVC中的SAO參數的其中另一個是sao_merge_left旗標,當設置該旗標時,指示目標CTU的SAO參數應複製自左邊的CTU。 針對幀的不同顏色分量(例如,YUV)可獨立地施用SAO濾波。舉例來說,可以為亮度分量Y提供一組SAO參數,並且可為兩個色度分量U及V共同提供另一組SAO參數。並且,在該組SAO參數內,一或多個SAO參數可被用作針對兩個或多個顏色分量的共同濾波參數,而其他的SAO參數是針對顏色分量的專用(每個分量)濾波參數。舉例來說,在HEVC中,SAO類型參數sao_type_idx對於U和V是共同的,並且指示用於EO濾波的一類(class)的EO類參數也是(見下面),而指示用於BO濾波的一組類的BO類參數具有針對U和V的專用(每個分量)SAO參數。 現在參考圖7A及7B提供HEVC中邊緣偏移類型的描述。 邊緣偏移類型涉及透過將像素的像素值與兩個相鄰像素的值進行比較來確定每個像素的邊緣索引。此外,這兩個相鄰像素取決於指示這兩個相鄰像素相對於當前像素的方向的參數。這些方向是0度(水平方向)、45度(對角線方向)、90度(垂直方向)及135度(第二對角線方向)。圖7A中示意性地示出這四個方向。 圖7B的表格給出了在解碼器側,根據兩個相鄰像素Cn1和Cn2的值要施用於特定像素“C”的像素值的偏移值。 當C的值小於相鄰像素Cn1和Cn2的兩個值時,要被加到像素C之像素值的偏移值是“+ O1”。當C的像素值小於其相鄰像素的其中一個像素值(Cn1或Cn2)並且C等於其相鄰者的一個值時,要被加到此像素樣本值的偏移是“+ O2”。 當C的像素值小於其相鄰者之其中一個像素值(Cn1或Cn2)並且C的像素值等於其相鄰者的一個值時,要被加到此像素樣本的偏移是“- O3”。當C的值大於Cn1或Cn2的兩個值時,要被加到此像素樣本的偏移是“- O4”。 當當前樣本及其相鄰者沒有滿足上述任何條件時,沒有偏移值被加到當前像素C,如表格中邊緣索引值“2”所述。 值得注意的是,對於邊緣偏移類型的特定情況,每個偏移(O1、O2、O3、O4)的絕對值被編碼在位元流中。待被施用於每個偏移的符號(sign)取決於當前像素所屬的邊緣索引(或HEVC規範中的邊緣索引(Edge Index))。依據圖7B中表示的表格,針對邊緣索引0和針對邊緣索引1(O1、O2),施用正偏移。針對邊緣索引3和邊緣索引4(O3、O4),將負偏移施用於當前像素。 在HEVC規範中,圖7A的四個方向中,邊緣偏移的方向在位元流中由亮度分量的“sao_eo_class_luma”欄位及兩個色度分量U和V的“sao_eo_class_chroma”欄位指定。 對應於索引值的SAO邊緣索引透過下列公式獲得: EdgeIndex(邊緣索引) = sign (C - Cn2) - sign (Cn1- C) +2 其中,函數sign (.)的定義係由下列關係給出 sign(x) = 1,當x>0 sign(x) = -1,當x<0 sign(x) = 0,當x=0。 為了簡化針對每個像素的邊緣偏移確定,C的像素值及其兩個相鄰像素Cn1和Cn2之像素值的差值可以為當前像素C及其相鄰者共用。實際上,當使用當前CTU或幀的像素的循序掃描(raster scan)順序來施用SAO邊緣偏移濾波時,術語sign (Cn1- C)已經針對先前像素被計算了(確切的說,當在某一時間的當前像素C’是現在的相鄰像素Cn1並且相鄰像素Cn2’是現在的當前像素C時,其在該時間被計算為C’-Cn2’)。因此,不需要再次計算sign (cn 1- c)。 現在參考圖8提供帶偏移類型的描述。 SAO中的帶偏移類型亦取決於待處理的樣本的像素值。SAO帶偏移中的類(class)被定義為像素值的範圍。傳統上,對於範圍內的所有像素,將相同的偏移加到像素值。在HEVC規範中,針對像素的每個重建區塊或幀區域(CTU),帶偏移濾波器的偏移數量是四個,如圖8中示意性示出的。 SAO帶偏移的一個實現方式將整個像素值的範圍分成32個相同大小的範圍。這32個範圍是SAO帶偏移的帶(band)(或類(class))。像素值範圍的最小值系統地為0,並且最大值取決於依據以下關係之像素值的位元深度Max = 2 Bitdepth -1。將像素分類成全間隔的32個範圍包括分類像素值以快速實現所需的5位元檢驗,即,僅檢驗前5個位元(5個最高有效位元)以將像素分類到全範圍之32個類/範圍的其中一個。 舉例來說,當位元深度是每像素8位元時,像素的最大值可以是255。因此,像素值的範圍是介於0到255。對於此8位元的位元深度而言,每個帶或類包含8個像素值。 依據HEVC規範,使用由灰色區域(40)表示的一組帶40,該組具有四個連續的帶41、42、43及44,並且在位元流中發訊資訊以識別該組的位置,例如4個帶中的第一個帶的位置。表示此位置的語法元素是HEVC規範中的“sao_band_position”欄位。這對應於圖8中的帶的起始41。依據HEVC規範,在位元流中發訊分別對應於4個帶的4個偏移。 圖9是說明依據HEVC規範解碼SAO參數之過程的步驟的流程圖。將圖9的過程應用於每個CTU,以產生一組SAO參數用於所有元件。為了避免每個CTU編碼一組SAO參數(這是非常昂貴的),針對CTU模式使用預測方案。此預測模式涉及檢驗在當前CTU左邊的CTU是否使用相同的SAO參數(這透過名為“sao_merge_left_flag”的旗標在位元流中指定)。若否,則針對在當前CTU之上的CTU執行第二檢驗(這透過名為“sao_merge_up_flag”旗標在位元流中指定)。此預測技術使得表示用於CTU模式的SAO參數的資料量能夠減少。下面說明過程的步驟。 在步驟503中,從位元流502讀取“sao_merge_left_flag”並解碼。若其值為真,則過程前進到步驟504,該步驟中將左邊CTU的SAO參數複製用於當前CTU。這使得在步驟508中能夠確定用於當前CTU的SAO濾波器之針對YUV的類型。 若在步驟503中結果為負,則從位元流讀取“sao_merge_up_flag”並解碼。若其值為真,則過程前進到步驟505,該步驟中將上面CTU的SAO參數複製用於當前CTU。這使得在步驟508中能夠確定用於當前CTU的SAO濾波器的類型。 若在步驟505中結果為負,則在步驟507中從位元流讀取並解碼用於當前CTU的SAO參數,用於該類型的亮度Y分量和兩個U及V分量(501)(551)。色度的偏移是獨立的。 稍後將參考圖10描述此步驟的細節。在此步驟之後,在步驟508獲取參數並確定SAO濾波器的類型。 在隨後的步驟511中,執行檢驗以確定針對當前CTU的三個顏色分量(Y及U&V)是否已被處理。若結果為是,則用於三個分量的SAO參數的確定已經完成,並且可以在步驟510中處理下一個CTU。否則,(僅Y被處理)U和V被一起處理,並且過程從先前說明的初始步驟512重新開始。 圖10是說明在解碼器側剖析位元流601中之SAO參數之過程的步驟的流程圖。在初始步驟602中,讀取並解碼”sao_type_idx_X”語法元素。表示此語法元素的碼字可以使用固定長度碼,或者可使用任何算術編碼的方法。語法元素sao_type_idx_X能夠確定應用於要針對顏色分量Y或針對兩個色度分量U和V處理的幀區域的SAO的類型。舉例來說,針對YUV 4:2:0序列,考量兩個分量:一個用於Y,及一個用於U和V。“sao_type_idx_X”可以依據位元流中編碼的SAO類型採用如下的3個值。‘0’對應於無SAO、‘1’對應於圖8中所示的帶偏移情況以及‘2’對應於圖3A及3B中所示的邊緣偏移濾波器。 附帶一提,僅管在HEVC中使用YUV顏色分量(有時稱為Y、Cr及Cb分量),但應當理解的是,在其他的視訊編碼方案中,可能使用其他的顏色分量,例如RGB顏色分量。本發明的技術不限於使用YUV顏色分量,並且可以使用RGB顏色分量或任何其他的顏色分量。 在相同步驟602中,執行測試以確定“sao_type_idx_X”是否嚴格地為正。若“sao_type_idx_X”等於“0”,表示無SAO用於此幀區域(CTU)的Y,若X被設定等於Y;並且無SAO用於此幀區域的U和V,若X被設定等於U和V。SAO參數的確定完成,並且過程前進到步驟608。除此之外,若“sao_type_idx”嚴格地為正,則表示在位元流中存在針對此CTU的SAO參數。 然後過程前進到步驟606,該步驟中將迴圈執行四次迭代。在步驟607中進行該四次迭代,其中從位元流讀取並解碼偏移j的絕對值。這四個偏移對應於SAO邊緣偏移(見圖7B)的四個邊緣索引的四個偏移(O1、O2、O3、O4)的絕對值,或者對應於與SAO帶偏移(見圖8)的四個範圍相關的四個偏移的絕對值。 應注意的是,對於編碼SAO偏移,在位元流中傳送第一部分,其對應於偏移的絕對值。以一元碼來編碼此絕對值。絕對值的最大值由下面的公式給出: MAX_abs_SAO_offset_value = (1 << (Min(bitDepth, 10)-5))-1 其中<<是左(位元)移位運算子。 此公式意味著對於8位元像素值位元深度,偏移的最大絕對值是7,並且對於10位元以上的像素值位元深度,偏移的最大絕對值是31。 當前解決擴增的位元深度視訊序列的HEVC標準修正案為具有12位元以上的位元深度的像素值提供了類似的公式。解碼的絕對值可以是量化值,其在解碼器處被應用於像素值以進行SAO濾波之前被去量化。在切片標頭中傳送使用或不使用此量化的指示。 對於邊緣偏移類型,僅傳送絕對值,因為可以如前所解釋般地推論出符號。 對於帶偏移類型,若偏移的絕對值不等於0,則在位元流中發訊符號作為偏移的第二部分。當使用CABAC時,略過符號的位元。 在步驟607之後,過程前進到步驟603,該步驟中執行測試以確定SAO的類型是否對應於帶偏移類型(sao_type_idx_X == 1)。 若結果為正,在步驟609及610中解碼用於帶偏移模式的偏移的符號,除了具有零值的每個偏移之外,之後執行下面的步驟604以便讀取位元流並且解碼SAO帶的位置“sao_band_position_X”,如圖8中所示。 若在步驟603中結果為負(“sao_type_idx_X”被設定等於2),此表示使用邊緣偏移類型。因此,在步驟605中從位元流601提取邊緣偏移類(對應於0、45、90及135度的方向)。若X等於Y,讀取語法元素為“sao_eo_class_luma”,並且若X被設定等於U和V,讀取語法元素為“sao_eo_class_chroma”。 當四個偏移已經被解碼時,讀取SAO參數完成,並且過程前進到步驟608。 圖11是說明依據HEVC規範如何對影像部分執行SAO濾波的流程圖,例如在圖6中步驟67的期間。在HEVC中,此影像部分是CTU。此相同的過程700也應用在編碼器處的解碼迴圈中(圖4中的步驟415),以便產生用於後續幀的運動估計和補償的參考幀。此過程與針對一個顏色分量的SAO濾波相關(因此下面已省略語法元素中的後綴“_X”)。 初始步驟701包含依據圖9及10中描繪的過程,確定SAO濾波參數。由編碼器確定SAO濾波參數,並將已編碼的SAO參數包括在位元流中。因此,在步驟701中、在解碼器側,解碼器從位元流讀取並解碼參數。步驟701獲得sao_type_idx,並且若其等於1,還獲得sao_band_position 702,及若其等於2,還獲得sao_eo_class_luma或sao_eo_class_chroma(依據被處理的顏色分量)。若元素sao_type_idx等於0,不施用SAO濾波。步驟701還獲取4個偏移的偏移表703。 在步驟704中,用於連續地考慮當前區塊或幀區域(CTU)的每個像素Pi的變數i被設定為0。附帶一提,在本說明書中「幀區域」及「影像區域」可互換使用。在此範例中的幀區域是HEVC標準中的CTU。在步驟706中,從包含N個像素的幀區域705提取像素Pi 。在步驟707中依據參考圖7A及7B所描述的邊緣偏移分類,或如參考圖8所描述的帶偏移分類來分類像素Pi 。決策模組708測試Pi 是否在要使用傳統的SAO濾波來過濾的類中。 若Pi 是在已過濾的類中,識別相關的類編號j,並且在步驟710中從偏移表703提取相關的偏移值Offsetj 。在傳統的SAO濾波的情況中,在步驟711中,此Offsetj 接著被添加到像素值Pi ,以便產生經過濾的像素值

Figure 02_image001
712。此經過濾的像素
Figure 02_image001
在步驟713中被插入經過濾的幀區域716。 若Pi 不在要進行SAO濾波的類中,則在步驟713中將Pi (709)插入經過濾的幀區域716而不進行過濾。 在步驟713之後,在步驟714中遞增變數i,以便過濾當前幀區域705的後續像素(若有的話-測試715)。當步驟715中已處理了所有的像素(i>=N)時,經過濾的幀區域716被重建,並且可被添加到SAO重建的幀(見圖6的幀68或圖4的416)。 如上所述,用於未來VVC標準的JVET探索模型(JEM)使用所有的HEVC工具。這些工具之一是取樣自適應偏移(SAO)濾波。然而,SAO在JEM參考軟體中較在HEVC參考軟體中效率低。這是源於相較於其他的迴圈濾波器有較少的評估和低效率的發訊。 下面描述的本發明之實施例旨在透過使用各種技術,從參考影像中與當前影像中之影像部分同位的(collocated)影像部分的一或多個SAO參數,推導出當前影像中該影像部分的一或多個SAO參數,提高SAO的編碼效率。這些技術可被稱為SAO參數的時間推導(temporal derivation)技術。下面描述的其他實施例旨在透過使用各種技術,從相同影像的另一影像部分的一或多個SAO參數,推導出該影像中的一影像部分的一或多個SAO參數,提高SAO的編碼效率。這些技術可被稱為SAO參數的空間推導(spatial derivation)技術。 第一組實施例 第一組實施例著重在提高發訊(signalling)效率。在HEVC中,逐CTU執行SAO濾波。在HEVC中不使用SAO參數的時間推導。在第一組實施例中,引入時間推導。然而,為了提高發訊效率,形成一組影像部分,並且針對該組影像部分而非個別地針對每個影像部分,發出使用時間預測的信令。針對該組的每個影像部分,使用時間推導從參考影像中同位的影像部分的至少一個SAO參數,推導出該影像部分的SAO參數中的至少一個。在該參考影像中的該同位的影像部分因此作為要推導出的該影像部分的來源影像部分。從而,該組的不同影像部分可以具有不同的SAO參數,取決於個別的同位影像部分的SAO參數。因此,以非常輕的發訊,屬於一給定組影像部分的影像部分可以使用時間推導並且受益於不同的(且有效率的)SAO參數。 此處,一組可以是任何兩個或多個CTU,舉例來說是整個影像、切片、一行CTU、一列CTU、N行CTU、N列CTU,其中N為大於1的整數。一組也可以是N×N個CTU,其中N為大於1的整數,或M×N個CTU或N×M個CTU,其中M ≥ 1且N > 1。 或者,一組影像部分可以是一CTU,並且該CTU的每個組成塊(block)可以是一影像部分。在這種情況下,CTU的每個塊可具有其自己的SAO參數,但使用SAO參數之時間推導的發訊可以針對該CTU作為整體來進行。 在最簡單的只有一種時間推導類型的情況下,可以使用旗標temporal_merge來發訊針對該組的所有影像部分使用時間推導。 除了屬於該組的影像部分的至少一個SAO參數是從參考影像中的同位影像部分的SAO參數推導而來的之外,在時間推導中導出SAO參數的方式不受特別限制。在最簡單的情況下,屬於該組的影像部分的至少一個SAO參數是透過複製同位影像部分的SAO參數而從同位影像部分的SAO參數推導而來。可以複製一個、多於一個、或所有的SAO參數。或者,可以只在SAO濾波是特定類型(邊緣或帶)時才複製一個、多於一個、或所有的SAO參數。 取代複製,也可以使用涉及修改同位影像部分(來源影像部分)的一個、多於一個、或所有的SAO參數的SAO參數的時間推導,如稍後所描述的。 第一實施例 在第一實施例中,該組影像部分是整個影像。現在參考圖12,當前影像2001的每個CTU在時間上從參考影像2002中的同位CTU導出其SAO參數。例如,當前影像2001中的CTU 2003的SAO參數是透過複製參考影像2002中與CTU 2003同位的CTU 2005的SAO參數而獲得。類似地,當前影像2001中的CTU 2004的SAO參數是透過複製參考影像2002中與CTU 2004同位的CTU 2006的SAO參數而獲得。在此範例中,CTU 2005使用0度方向的EO濾波,並且CTU 2006使用BO濾波。作為從CTU 2005複製SAO參數的結果,CTU 2003亦使用0度方向的EO濾波。作為從CTU 2006複製SAO參數的結果,CTU 2004亦使用BO濾波。雖然圖12中未示出,但在此實施例中複製了所有的SAO參數,包括SAO類型參數sao_type_idx、諸如EO_class(指定EO濾波的方向)及BO組sao_band_position(指定一組類別中的第一類)的參數、以及偏移。 可以看出,在相同CTU組內的不同CTU,例如CTU 2003和CTU 2004,可以具有不同的SAO參數,雖然時間推導的使用僅針對整個CTU組(在此實施例中是整個影像)發訊一次。 附帶一提,在一些視訊編碼系統中,包括HEVC,不同的影像可能遭受不同的分割而被劃分成多個影像部分(多個LCU、多個CTU、多個CTB等)。因此,當前影像2001及其參考影像2002可具有不同的分割。在這種情況下,舉例來說,在當前影像2001中的CTU 2003和其在參考影像2002中“同位的”CTU 2005之間,大小及/或位置可能不完全匹配。然而,這不是問題,只要存在合適的機制(編碼器和解碼器已知的),將當前影像2001中的CTU與參考影像中“同位的”CTU相關聯。例如,映射可以識別參考影像中最接近當前影像中之CTU的位置的CTU。最接近的位置可以基於相關CTU中的任何合適的參考位置,例如每個CTU的左上位置。 圖13是用於說明在第一實施例中之解碼影像的方法的流程圖。 在步驟2101中,從位元流2103讀取第一語法元素並解碼。在此範例中的這個第一語法元素是簡單temporal_merge旗標,其指示針對整個影像是否要使用SAO參數的時間推導。在步驟2102中,檢驗語法元素是否指示要使用時間推導。若結果為“是”,則從位元流提取至少第二語法元素。此第二語法元素是參考幀索引refidx,其識別要用於時間推導的參考影像。若使用雙向時間預測,則從位元流2103提取第三語法元素。此為列表索引Ly,其指示參考幀索引是來自列表0 (L0)還是來自列表1 (L1)。在此實施例中,將相同的參考幀用於該組(整個影像)的所有CTU中的SAO參數的時間推導。 在時間預測的情境中,參考影像表示影像序列中用來針對要編碼的影像執行時間預測的另一影像(先前或未來的影像)。在SAO參數推導的情境中,參考影像表示該序列中用來執行SAO參數的時間推導的另一影像(先前或未來的影像)。用於SAO參數之時間推導的參考影像可以與用於時間預測的參考影像相同,或者可以不同。 附帶一提,HEVC規格書使用術語「參考幀」而非「參考影像」,並且refidx通常相應地被稱為參考幀索引。在本說明書中,術語「參考影像」及「參考幀」可互換使用。 然後在步驟2105中開始遍歷影像中所有CTU的迴圈。在此實施例中,解碼器具有可被稱為解碼圖像緩衝區(Decoded Picture Buffer, DPB)的儲存單元2106,其儲存參考影像中每個CTU的SAO參數。較佳地,DPB 2106顯性儲存每個CTU的SAO參數,而不依賴諸如merge_up及merge_left的合併旗標,因為讀取合併旗標作為SAO參數的一部分,時間推導會增加複雜度並且減緩推導。 在步驟2107中,獲取儲存在DPB 2106中由refidx或由Ly及refidx所識別的參考影像中的同位CTU的SAO參數。然後將這些設為當前CTU的SAO參數2108。在此實施例中,假設SAO參數包含每個顏色分量X (Y、U、V)的專用SAO參數,並且在步驟2109-2111中使用相關顏色分量的專用SAO參數,依序針對每個顏色分量執行SAO濾波。如上所述,在其他實施例中,SAO參數可以是兩個或更多分量,例如U和V,共用的,或者可以使用共用的及專用的(每個分量)SAO參數的混合。在完成當前CTU的處理之後,處理移動到下一個CTU,或者若當前CTU是影像的最後一個CTU時,結束處理。 應當理解的是,在步驟2107中,若同位CTU沒有使用SAO濾波(sao_type_idx = 0),則無法從參考影像中的同位CTU獲得SAO參數。將在隨後的實施例中處理此種情況。這表示,即使在本發明中將SAO參數的時間推導應用於一組影像部分,也可能存在該組中的某些影像部分不從各自的同位影像部分的SAO參數推導出SAO參數。例如,在最簡單的情況下,對使用時間推導無法獲得SAO參數的影像部分,可不執行SAO濾波。 雖然圖13中未示出,若在步驟2012中的檢驗結果為SAO參數推導不是時間推導,則從位元流讀取該組(在此情況中為整個影像)的CTU的SAO參數,例如使用圖5的過程。 圖13關於在解碼器側進行的步驟。該些步驟涉及從位元流讀取及解碼該組影像部分(在此情況中為整個影像)的語法元素,然後對該組的影像部分執行SAO濾波。在編碼器側,對該組的影像部分執行與在解碼器側相同的SAO濾波,以確保編碼器具有與解碼器相同的參考影像。這表示使用與解碼器相同的SAO參數的推導,以及使用與解碼器相同的參考影像用於時間推導。然而,在編碼器側,不需要從位元流讀取及解碼語法元素,因為在編碼器中已經有相關資訊可用。在此實施例中,在編碼器側確定是否針對該組(在此情況中為整個影像)使用SAO參數的時間推導。類似地,在編碼器側選擇用於時間推導的參考影像。 在第一實施例的變型中,參考影像僅是第一列表L0的第一參考影像。在該情況下,不需要語法元素來識別refidx及Ly,並且可以省略步驟2104。這移除了某些發訊,並且簡化了解碼器設計。 第二實施例 在第一實施例中,該組影像部分是整個影像。在第二實施例中,該組影像部分是切片(slice)。因此,在影像的一個切片中使用SAO參數的時間推導,但在相同影像的另一切片中不使用SAO參數的時間推導是可能的。這可以導致SAO參數更好地適應影像的不同部分中的影像特徵,代價是小幅增加發訊。 解碼與結合第一實施例所述的相同,除了第一語法元素指示針對切片(相對於針對整個影像)是否要使用SAO參數的時間推導,以及第二語法元素(或組合第二及第三語法元素)識別一個參考影像,用於該切片之CTU的SAO參數的時間推導。 第三實施例 在第一及第二實施例中,針對幀或切片發訊單一參考幀(或者,在變型中,在沒有發訊的情況下推測),並且該幀或切片的CTU的SAO參數必須來自該參考幀。由於僅使用一個參考幀,因此可能限制了在該一個參考幀中的同位CTU使用SAO的CTU的數量,造成限制了接受SAO濾波的CTU的數量。 在第三實施例中,該組是切片。在切片標頭中沒有發訊參考幀,但該幀的CTU的SAO參數可能來自不同的參考幀。 圖14是用於說明第三實施例中解碼影像之方法的流程圖。 在步驟2201中,從位元流2103讀取第一語法元素並解碼。此第一語法元素指示針對切片或針對整個影像是否要使用SAO參數的時間推導。在步驟2202中,檢驗該語法元素是否指示要使用時間推導。 雖然圖14中未示出,若在步驟2202中的檢驗結果為SAO參數推導不是時間推導,則從位元流讀取該組(在此情況中為切片)的CTU的SAO參數,例如使用圖5的過程。 不同於第一實施例,若結果為“是”,不從位元流中提取語法元素(參考幀索引refidx)。也不提取列表索引Ly。然後,在步驟2205開始遍歷當前影像之所有CTU的第一、外迴圈。亦在步驟2203開始遍歷從0到MAXrefidx之所有可能的參考幀的第二、內迴圈。解碼圖像緩衝區(DPB)儲存所有參考幀的每個CTU的SAO參數。 在步驟2207中,為由refidx或由Ly及refidx所識別的考慮中的參考影像中的同位CTU,獲取儲存在DPB 2106中的SAO參數。在考慮的參考幀中,同位CTU可能未使用SAO(sao_type_idx是“無SAO”),在這種情況下,在步驟2207中無法獲得SAO參數。步驟2204檢驗該結果(“是”),並且若是的話,則第二迴圈移動到下一個參考幀。若在步驟2207中獲得SAO參數(結果為“否”),則第二迴圈結束,並且使用獲得的SAO參數來對三個顏色分量執行SAO濾波(在此實施例中是獨立濾波,但如結合第一實施例所述的,其他變型是可能的)。 步驟2204中的檢驗可以僅基於亮度分量(即,僅針對亮度顏色分量,sao_type_idx是否為“無SAO”),在該情況下,若無法獲得亮度分量SAO參數,則認為無法從考慮的參考幀獲得針對所有三個顏色分量的SAO參數。可選地,在步驟2204中,可以分別處理每個顏色分量,或者可將亮度與兩個色度分量分開處理。 第一迴圈一個CTU接著一個CTU地繼續,遍歷該切片或幀的所有CTU。 相較於第一及第二實施例,此實施例透過增加接受SAO濾波的CTU的數量來提高編碼效率。 在一變型中,在各個列表L0及L1中的參考幀是有序的。在每個有序的列表中,比第二參考幀更可能具有有用的SAO參數的第一參考幀被放在該第二參考幀之前。 在此變型中,例如,第一參考幀可以是最靠近當前幀的參考幀。或者,第一參考幀可以是參考幀列表中具有最佳品質的幀。可以使用任何合適的品質測量,例如,可以使用量化參數(quantisation parameter, QP)作為品質的測量。在此情況下,可以選擇具有最低QP的幀作為第一參考幀。第一參考幀也可以基於其在當前切片或幀中被用於時間預測的頻率而被選擇。這在編碼器側可能是良好的標準,但對於解碼器而言則不是,因為其涉及在應用SAO之前建立整個幀的統計資料。附帶一提,通常在第一參考幀列表中的第一參考是被選擇最多的參考。這表示在每個列表中的第一參考幀在第二參考幀之前被處理,並且相較於第二參考幀,優先從第一參考幀拾取SAO參數。較佳地,在每個列表中,參考幀依據編碼效率從最佳排序到最差。 如上所述,在第三實施例中,不同的參考影像可被用於針對該組的不同影像部分的SAO參數的時間推導。透過搜尋複數個可用的參考影像,並且選擇其同位影像部分滿足至少一個搜尋條件的參考影像來識別特定參考影像。搜尋條件可以是所述同位影像部分使用SAO濾波。可以依照最高編碼效率至最低編碼效率的順序搜尋參考影像。 在此實施例中,位元流中不包括識別特定參考影像的資訊項目。這節省了發訊,並且簡化了設計。編碼器和解碼器二者都可以透過遍歷所有可用參考影像執行相同的搜尋來識別相同的特定參考影像。 第四實施例 在第三實施例中,無論SAO類型是BO或EO,在時間上推導SAO參數。在第四實施例中,僅在SAO類型是EO時,才在時間上推導SAO參數。這是因為EO類型通常比BO類型有效率。這可以透過修改圖14中的步驟2204以檢驗“無SAO”或“BO”而非只是“無SAO”來實現。第四實施例中的搜尋條件是同位影像部分使用邊緣類型SAO濾波。 在一變型中,若針對目標CTU,發現到作為在步驟2203開始的第二迴圈中的搜尋結果,沒有一個參考幀在同位CTU使用EO,則可以執行第二次搜尋遍歷參考幀以找出在那些參考幀之一中是否存在使用BO的同位CTU,在這種情況下,BO仍可被用於目標CTU的時間推導。 此變型導致使用第一搜尋條件執行遍歷可用的參考影像的第一搜尋,並且若沒有一個可用的參考影像滿足該第一搜尋條件,使用與該第一搜尋條件不同的第二搜尋條件執行遍歷可用的參考影像的第二搜尋。第一搜尋條件可以是同位影像部分使用邊緣類型SAO濾波,以及第二搜尋條件可以是所述同位影像部分使用帶類型SAO濾波。 第五實施例 在前面的實施例中,若在參考幀中的同位CTU具有“無SAO”,或者在多個參考幀中的任一個參考幀中沒有一個同位CTU使用SAO,則沒有SAO參數可被獲得。在第五實施例中,在此情況下,使用一預設組的SAO參數。此預設組可以,例如在序列參數組中或者每切片,由編碼器確定並被傳送給解碼器。這是有效率的,因為可針對序列或針對切片,由編碼器最佳化預設組。 第六實施例 在第二實施例中,針對切片確定時間推導,並且第二語法元素識別單一參考幀,用於在該切片的CTU中的SAO參數推導。第二語法元素是處於切片級(slice level)。然而,當針對切片確定時間推導時,可以改為使用在CTU級(CTU level)的語法元素來識別用於相關CTU之SAO參數推導的參考幀。在第六實施例中採取此方案。 圖15是用於說明第六實施例中解碼影像之方法的流程圖。 在步驟2401中,從位元流2403讀取第一語法元素並解碼。此第一語法元素指示針對切片是否要使用SAO參數的時間推導。在步驟2402中,檢驗語法元素是否指示要使用時間推導。若結果是“否”,則可使用圖5的過程,如結合第一實施例已描述的。若結果是“是”,則在步驟2405中開始遍歷當前切片之所有CTU的迴圈。針對當前的CTU,在步驟2404中從位元流提取至少第二語法元素。此第二語法元素是參考幀索引refidx,其識別要用於時間推導的參考影像。若使用雙向時間預測,亦在步驟2404中從位元流2403提取第三語法元素。此為列表索引Ly,其指示參考索引是來自列表0 (L0)或是來自列表1 (L1)。 在步驟2407中,獲取儲存在DPB 2406中由refidx或由Ly及refidx所識別的參考影像中的同位CTU的SAO參數。然後將這些設為當前CTU的SAO參數2408。在此實施例中,假設SAO參數包含每個顏色分量X (Y、U、V)的專用SAO參數,並且在步驟2409-2411中使用相關顏色分量的專用SAO參數,依序針對每個顏色分量執行SAO濾波。如上所述,在其他實施例中,SAO參數可以是兩個或更多分量,例如U和V,共用的,或者可以使用共用的及專用的(每個分量)SAO參數的混合。在完成當前CTU的處理之後,在步驟2412中,處理移動到下一個CTU,或者若當前的CTU是影像的最後一個CTU時,結束處理。 在第六實施例中,不同參考影像可被用於該組中的不同影像部分的SAO參數的時間推導,如在第三實施例中那樣。不同於第三實施例,解碼器不必搜尋特定的參考影像,並且特定的參考影像由位元流中包含的資訊項目來識別。這簡化了解碼器設計。 第七實施例 在第六實施例中,使用refidx或使用Ly及refidx來發訊用於SAO時間推導的每個CTU之參考幀。這具有以下優點:發訊與用於時間預測之參考幀的傳統發訊相同。然而,這種發訊SAO-時間-推導參考幀的方式非常昂貴,因為通常用於時間預測的列表包含冗餘幀。實際上,參考幀可以在列表L0及L1二者中。此外,當使用加權參考工具時,列表可以包含相同的參考幀多次。不需要發訊相同參考幀的每次出現,並且移除冗餘幀可以節省與它們相關聯的發訊率。這些冗餘可以透過檢查列表中的每個參考幀具有不同於所有其他參考幀的POC(圖像順序計數(Picture Order Count))來移除。 在第七實施例中,創建用於SAO時間推導的參考幀的特定列表,其不同於用於時間預測的列表L0和L1,並且基於此特定列表,例如,使用表示參考幀的語法元素SAO reference frame index,來發訊針對每個CTU的用於SAO時間推導的參考幀。 較佳地,特定列表包含非冗餘參考幀。這是為了降低專用於在圖15之步驟2404中獲得的語法元素的碼率。其相應於兩個列表L0和L1之間的合併。圖16是說明建立用於SAO時間推導之參考幀的非冗餘列表SAO_Ref_List之過程的流程圖。在第一變型中,僅在編碼器中執行此過程。在第二變型中,編碼器和解碼器皆執行該過程。參考幀的列表(列表L0 2501以及列表L1 2502)是此過程的輸入。在過程的一開始,SAO_Ref_List是空的。針對在兩個列表中從0到最大數的每個參考幀號i (2503),步驟2504檢驗列表L0的參考幀號i Ref_i_L0是否已經在SAO的參考幀列表中(SAO_Ref_List) (2508)。若Ref_i_L0不在SAO_Ref_List中,則在SAO_Ref_List中加入Ref_i_L0 (2505)。以相同的方式,如果列表L1的參考幀號i Ref_i_L1尚未存在(2506),則將其加入SAO_Ref_List (2507)。 在第一變型中,在位元流中顯性發訊SAO_Ref_List,例如在切片標頭中。在第二變型中,不由編碼器發訊SAO_Ref_List,而是由解碼器透過依循與編碼器相同的列表創建過程來創建相同的列表。使用第二變型的優點是避免在切片級顯性發訊用於SAO的參考幀列表,以便降低切片標頭的碼率。然而,對於某些應用而言,較佳的是顯性發訊此列表。這可以在針對給定切片的某些參考幀禁用SAO時特別有效。 兩種變型具有以下優點:當每個CTU發訊參考幀時(如圖15中的步驟2404),表示參考幀的語法元素可以更緊縮且更有效,因為在SAO_Ref_List中的幀比在L0和L1合併中的幀還少。 在變型中,在切片標頭中顯性發訊列表SAO_Ref_List中的參考幀的最大數量。此變型的優點是降低專用於步驟2404中表示參考幀之語法元素的碼率。 圖16的過程中,在步驟2504中或在步驟2506中,將來自L0或L1的參考幀添加到列表SAO_Ref_List,若其是新的(尚未在列表中)。在另一變型中,只有當SAO被啟用用於至少一個顏色分量時,才將新的參考幀添加到SAO_Ref_List,即,修改步驟2504或2506中的條件。例如,可以獨立地針對每個切片禁用SAO。實際上,可能存在用於針對亮度分量在切片級禁用SAO的第一旗標,以及用於針對兩個色度分量在切片級禁用SAO的第二旗標(共用旗標)或針對所有三個分量的單獨旗標。優點是SAO_Ref_List中省略了一些不需要的參考幀,使得能夠減少在步驟2404中獲得的表示用於SAO之參考幀的語法元素的發訊。 有幾種用於對表示在SAO_Ref_List中用於SAO推導的參考幀索引的語法元素進行編碼的選擇。 第一種選擇是以固定長度碼編碼語法元素。 第二種選擇是以一元最大(max)碼編碼語法元素,其中“最大”是SAO_Ref_List中的參考幀數量。 在第三種選擇中,可以使用算術編碼。可將算術編碼應用於固定長度碼的最頂一元最大碼。 針對一元碼或算術編碼選項,在SAO_Ref_List的先前參考幀中之與當前CTU同位的可能的SAO參數集的列表,透過檢查是否針對每個同位CTU啟用SAO或者SAO參數集是否是冗餘的,而被縮減。可以透過比較不同SAO參數集中的SAO參數,其包括分類結果(例如,邊緣方向sao_eo_class)及相關偏移,而實現此縮減。在該情況下,表示用於SAO推導之參考幀的語法元素是表示在縮減的列表中之SAO參數集的位置的語法元素。此實施例的優點是縮減了可能的SAO參數集的集合,並且當使用一元最大碼時,減少了專用於其發訊之碼率的數量。 另一種方式是使用確切所需的位元數來發訊在可能的時間SAO參數集之中,在編碼器側選擇了哪個SAO參數集。但在該情況下,若沒有此SAO檢查,位元流是不可能剖析的,因而對於許多使用網路的視訊應用是不建議的。SAO_Ref_List的尺寸在一個切片到下個切片將會改變。若亦允許索引的位元數改變,則其可以是有效率的(當尺寸低於最大值時節省一些位元),但在解碼器中的剖析則需要解碼器重建SAO_Ref_List。為了在使用列表縮減時簡化位元流的剖析,編碼器可以在位元流中發訊在縮減的SAO_Ref_List中的元素數量(即可能的時間SAO參數集的數量)。這使得解碼器能夠知道專用於索引之發訊的位元量,而無需在剖析之前進行任何列表縮減。 當如同在第二實施例中針對切片的所有CTU使用相同的參考影像時(圖13中的步驟2104),結合此實施例所述的可能性也是適用的。在此情況下,由於用於SAO時間推導的參考影像的列表(SAO_Ref_List)包含比結合L0和L1還少的參考影像,發訊來自更簡潔的列表SAO_Ref_List的參考影像比發訊來自L0和L1的參考影像還簡潔。 如上所述,第七實施例基於用於該組的影像部分的時間預測的一或多個參考影像列表,創建用於SAO參數之時間推導的參考影像的列表,其中從用於SAO參數之時間推導的參考影像的列表排除在一或多個時間預測列表之中的一或多個參考影像。然後,從該用於SAO參數之時間推導的參考影像的列表選擇用於SAO參數之時間推導的一參考影像。可從該用於SAO參數之時間推導的參考影像的列表排除該一或多個時間預測列表之中的冗餘參考影像。替代地或另外地,可從該用於SAO參數之時間推導的參考影像的列表排除其個別的同位影像部分不使用SAO濾波或是其個別的同位部分不使用邊緣類型SAO濾波地參考影像。將一最大值強加於可包含在該用於SAO參數之時間推導的參考影像的列表中的參考影像的數量可能是有效率的。 解碼器可創建與編碼器相同的用於SAO參數之時間推導的參考幀的列表。在此情況下,不需要在位元流中發訊該列表,其可以降低切片標頭的碼率。然而,只有編碼器才能基於用於該組的影像部分的時間預測的參考影像的一或多個列表來創建用於SAO參數之時間推導的參考影像的列表,顯性地發訊該用於SAO參數之時間推導的參考影像的列表。當針對某些用於時間預測的參考幀禁用SAO時,這仍然可以是有效率的,因為可以適當地緊縮該用於SAO參數之時間推導的參考影像的列表。 第八實施例 第八實施例關於編碼過程。在前面的實施例中,將SAO參數的時間推導應用於一組影像部分。例如,在第一實施例中,將時間推導應用於整個影像。在第二實施例中,將時間推導應用於切片。 在第八實施例中,當不施用時間推導時,使用SAO參數的非時間推導,其中由編碼器針對每個影像部分(CTU)確定SAO參數,並且在位元流中發訊。這可被稱為SAO參數的CTU級非時間推導。解碼器從位元流讀取第一語法元素(例如,temporal_merge旗標),並且當其指示時間推導未施用於該組時,解碼器從位元流讀取每個CTU的SAO參數並且依據相關CTU的SAO參數來過濾每個CTU,例如使用圖5的解碼過程。 在第八實施例中,時間推導和CTU級非時間推導是可用的推導,並且編碼器選擇它們之中的一個來施加到該組(例如,幀或切片)。 圖17是說明執行編碼器以在SAO參數的CTU級非時間推導中確定一組(幀或切片)之CTU的SAO參數的步驟的流程圖。過程從當前的CTU開始(1101)。首先,將針對所有可能的SAO類型和類別的統計資料累積在變數CTUStats中(1102)。下面參考圖18描述步驟1102的過程。依據變數CTUStats中的數值集合,若左邊的CTU在當前的切片中,則評估SAO合併左邊(Merge Left)的RD成本(1103),和SAO合併上面(Merge UP)的RD成本一樣(1104)。由於CTUStats中的統計資料(1102),針對亮度(1105)和針對兩個色度分量(1109)評估的新的SAO參數。(兩個色度量度,因為在HEVC標準中,該些色度分量共享相同的SAO類型)。針對每個SAO類型(1006),獲取用於帶偏移分類的最佳RD偏移及其他參數(1107)。下面分別參考圖19及圖20解釋步驟1107及1110的邊緣及帶分類。由於它們個別的SAO參數,所有的RD成本被計算(1108)。對於兩個色度分量以相同的方式,選擇最佳RD偏移和參數(1111)。比較所有這些RD成本,以便選擇最佳的SAO參數集(1115)。亦將這些RD成本進行比較,以針對亮度和色度分量獨立地禁用SAO(1113、1114)。將新的SAO參數集的使用(1115)與從左邊和上面的CTU“合併”或共享的SAO參數集(1116)進行比較。 圖18是說明在傳統SAO濾波的情況下,可被應用於邊緣偏移類型濾波器的在編碼器側計算的統計資料之範例的步驟的流程圖。類似的方案也可被用於帶偏移類型濾波器。 圖18說明變數CTUStats的設定,該變數CTUStats包含導出每個類的每個最佳碼率失真偏移所需的所有資訊。此外,其說明了針對當前CTU之最佳SAO參數集的選擇。對於每個顏色分量Y、U、V(或RGB) (811),評估每個SAO類型。針對每個SAO類型(812),在初始步驟801中將變數Sumj SumNbPixj 設為零。當前幀區域803包含N個像素。j 是當前範圍編號,用以確定四個偏移(與針對邊緣偏移類型之圖7B中所示的四個邊緣索引相關,或者與針對帶偏移類型之圖8中所示的32個像素值範圍相關)。Sumj 是範圍j 中的像素與其原始像素之間的差值的和。SumNbPixj 是幀區域中的像素數量,其之像素值屬於範圍j 。 在步驟802中,將用於連續考慮當前幀區域的每個像素Pi的變數i設為零。然後,在步驟804中提取幀區域803的第一像素Pi 。在步驟805中,透過檢查圖7B中定義的條件來確定當前像素的類。然後在步驟806中執行檢驗。在步驟806期間,執行檢驗以確定像素值Pi 的類是否對應於圖7B的值“以上皆非”。 若結果為是,則在步驟808中遞增值“i”,以便考慮幀區域803的下一個像素。 否則,若在步驟806中結果為否,則下一步驟為807,在該步驟中遞增相關的SumNbPixj (即,在步驟805中確定的類的像素數量的總和),並且將Pi 及其原始值
Figure 02_image003
之間的差值加到Sumj 。在下一步驟808中,遞增變數i,以便考慮幀區域803的下一個像素。 然後執行測試以確定是否已考慮並分類了所有像素。若結果為否,過程循環回到上述步驟804。另一方面,若結果為是,過程前進到步驟810,在該步驟中將針對當前顏色分量X及SAO類型SAO_type及當前類j 的變數CTUStats設定成等於Sumj 用於第一值以及SumNbPixj 用於第二值。可以使用這些變數來計算例如每個類j的最佳偏移參數Offsetj 。此偏移Offsetj 可以是類j的像素與其原始值之間的差值的平均。因此,Offsetj 由下面公式給出:
Figure 02_image005
應注意的是,偏移Offsetj 是整數值。因此,可以將本公式中定義的比例捨入至最接近的值或者使用頂函數或地板函數來進行捨入。 就失真而言,每個偏移Offsetj 是最佳偏移Ooptj。 為了評估合併SAO參數的RD成本,編碼器將使用表CTUStats中設置的統計資料。依據下面SAO Merge Left的範例以及考量Luma Left_Type_Y的類型和四個相關的偏移O_Left_0、O_Left_1、O_Left_2、O_Left_3,可以透過下面公式獲得失真: Distortion_Left_Y = (CTUStats[Y][ Left_Type_Y][0][1] x O_Left_0 x O_Left_0 - CTUStats[Y][ Left_Type_Y][0][0] x O_Left_0 x 2)>> Shift + (CTUStats[Y][ Left_Type_Y][1][1] x O_Left_1 x O_Left_1 - CTUStats[Y][ Left_Type_Y][1][0] x O_Left_1 x 2)>> Shift + (CTUStats[Y][ Left_Type_Y][2][1] x O_Left_2 x O_Left_2 - CTUStats[Y][ Left_Type_Y][2][0] x O_Left_2 x 2)>> Shift + (CTUStats[Y][ Left_Type_Y][3][1] x O_Left_3 x O_Left_3 - CTUStats[Y][ Left_Type_Y][3][0] x O_Left_3 x 2)>> Shift 變數Shift專為失真調整而設計。由於SAO是後濾波,該失真應為負。 針對色度分量施用相同的計算。對三個分量而言,碼率失真成本的Lambda(λ)是固定的。針對與左CTU合併的SAO參數,碼率(rate)僅是1個旗標,其為CABAC編碼的。 為了在碼率失真標準方面找到最佳偏移,稱為ORDj的偏移,應用圖19中示出的編碼過程。此過程應用於步驟1109至1112中。 在圖19之編碼過程的初始步驟901中,將碼率失真值Jj初始化為最大可能值。然後在步驟902中,施用從Ooptj至0的Oj迴圈。注意,在迴圈的每次新迭代,以1改動Oj。若Ooptj為負,則值Oj遞增,並且若Ooptj為正,則值Oj遞減。在步驟903中依據下面公式計算與Oj相關的碼率失真成本: J(Oj)=SumNbPixj × Oj × Oj - Sumj × Oj × 2 + λ R(Oj) 其中λ是拉格朗日(Lagrange)參數,及R(Oj)是提供與Oj相關聯的碼字所需的位元數的函數。 公式‘SumNbPixj × Oj × Oj - Sumj × Oj × 2’給出了在透過使用偏移Oj所提供的失真方面的改進。在步驟904中,若J(Oj)低於Jj,則Jj = J(Oj)及ORDj等於Oj。在步驟905中,若Oj等於0,則迴圈結束,並且選擇類j的最佳ORDj。 圖18及19的這個演算法為每個類j提供了最佳ORDj。對圖7A的四個方向中的每個方向重複此演算法。然後,選擇提供最佳碼率失真成本的方向(每個方向的Jj之和)作為用於當前CTU的方向。 用於在邊緣偏移工具的編碼器側選擇偏移值的此演算法(圖18及19)可被輕易地應用於帶偏移濾波器以選擇最佳位置(SAO_band_position),其中j在區間[0,32]中,而非在圖18的區間[1,4]中。其涉及將模組801、810、811中的值4更改為32。更具體的,針對圖8的32個類,計算參數Sumj (j=[0,32])。這對應於針對每個範圍j的計算、當前像素值(Pi )及其原始值(Porgi )之間的差、影像中屬於單一範圍j的每個像素。然後,使用如圖19中所述的相同過程,針對32個類計算就碼率失真ORDj而言的最佳偏移。 下個步驟涉及找到圖8的SAO帶位置的最佳位置。這是透過圖20中所示的編碼過程確定的。已使用圖19的編碼過程,其具有就碼率失真而言的最佳偏移ORDj,來計算每個範圍的RD成本Jj。在圖20中,在初始步驟1001中,將碼率失真值J初始化為最大可能值。然後,在步驟1002中運行對4個連續類的28個位置j的迴圈。接著,在步驟1003中將對應於(4個連續類的)帶的RD成本的變數Jj初始化為0。然後,在步驟1004中運行對四個連續偏移j的迴圈。在步驟1005中,Ji增加四個類Jj的RD成本(j=i至i+4)。 若此成本Ji低於最佳RD成本J,則在步驟1007中將J設為Ji,及sao_band_position = i,並且下一個步驟為步驟1008。 否則,下一個步驟是步驟1008。 測試1008檢查對28個位置的迴圈是否已結束。若是否,則過程繼續步驟1002,否則編碼過程返回最佳帶位置作為sao_band_position 1009的當前值。 因此,透過圖17的過程創建在CTU級確定SAO參數的情況下的CTUStats表。這對應於依據碼率-失真折衷來評估CTU級。可以針對整個影像或僅針對當前切片執行該評估。 針對時間推導執行進一步的評估。同樣,此時間推導可應用於整個影像或僅應用於當前切片。圖21示出在切片(Slice)級的時間推導的RD成本評估。首先,將當前顏色分量X的失真設為等於0 (1601)。針對從0到LastCTU的每個CTU號nbCTU (1602),從DPB (1603)提取(1604)參考幀(Ly, refidx)中的同位CTU的時間SAO參數集(1605)。若SAO參數集(1605)等於OFF(無SAO),則處理下一個CTU(1610)。否則,針對四個偏移中依序的每個偏移(1607),失真Distortion_TEMPORAL_X增加等於偏移Oi之相關聯失真的量(1609)。這過程與如先前所述之針對合併SAO參數的RD成本評估相同。請注意,當SAO類型等於邊緣類型時,將sao_band_position設為等於0。當所有偏移的失真已被加到Distortion_TEMPORAL_X(1608)時,處理下一個CTU(1610)。當CTU nbCTU的數量等於lastCTU(1610)時,將針對分量X在切片級的時間模式的RDCost設為等於該計算的失真Distortion_TEMPORAL_X與λ乘以在切片級之此時間模式之碼率的總和(1611)。該碼率等於時間模式之發訊的碼率加上(若需要的話)參考幀索引refIdx的碼率以及若需要的話加上列表Ly的碼率。 然後比較兩種評估,並且選擇具有最佳效能的評估。接著,在位元流中,例如,使用結合第二實施例所述的第一語法元素,將選擇的推導(時間或CTU級)發訊到解碼器。 圖22示出在編碼器側用於SAO以及用於時間推導之CTU級之間的競爭。當前切片/幀1901被用來為每個CTU(1902)設定CTUStats表(1903)。此表(1903)被用來評估CTU級推導(1904)以及針對整個切片的時間推導(1915),如先前圖21中所述。此表(1903)還被用來評估用於時間推導的數個參考幀。依據針對每個可用推導計算的碼率失真標準來選擇切片的最佳推導(1910)。依據步驟1910中選擇的推導來設定每個CTU的SAO參數集(1911)。然後將這些SAO參數用來施用SAO濾波(1913),以便獲得經過濾的幀/切片。 可以在切片標頭中,例如,使用指示時間推導的語法元素(解碼器讀取,見圖13及14中的2101及2201)來發訊選擇的推導。 第九實施例 在第八實施例中,時間推導與一種導出SAO參數的替代的非時間方法競爭。在第九實施例中,兩種替代的方法與時間推導競爭。 圖23示出在切片中,CTU之各種不同的分組1201-1206。 第一分組1201具有個別的CTU。此第一分組需要每個CTU一組SAO參數。其對應於第八實施例中的CTU級推導。 第二分組1202使整個影像的所有CTU成為一組。因此,與CTU級推導相反,幀的所有CTU(以及因此係整個幀或其一部分的切片)共享相同的SAO參數。 為了使影像的所有CTU共享相同的SAO參數,可以使用兩種方法中的一種。在兩種方法中,編碼器首先計算要被影像之所有CTU共享的一組SAO參數。然後,在第一種方法中,針對切片的第一個CTU設置這些SAO參數。針對切片之第二個CTU到最後一個CTU之每個剩餘的CTU,若存在旗標(亦即,若當前CTU具有左邊的CTU),則將sao_merge_left旗標設為等於1。否則,將sao_merge_up旗標設為等於1。圖24示出根據第一種方法之具有SAO參數組的CTU的範例。此方法具有不需要向解碼器發送分組之信令的優點。此外,不需要改變解碼器來引入分組,並且僅改變編碼器。因此,可在基於HEVC的編碼器中引入分組而無須修改HEVC解碼器。令人驚訝的是,分組不會增加太多的碼率。這是因為合併旗標通常在相同的情境中進行CABAC編碼。由於對於第二分組(整個影像),這些旗標均具有相同的值(1),因此這些旗標消耗的碼率非常低。這是因為它們總是具有相同的值且機率為1。 在使影像的所有CTU共享相同的SAO參數的第二種方法中,在位元流中將分組發訊給解碼器。例如,亦在切片標頭中,將SAO參數發訊作為針對分組(整個影像)的SAO參數。在此情況下,分組的發訊會消耗頻寬。然而,可以省去合併旗標,節省與合併旗標相關的碼率,以便整體降低碼率。 第一及第二分組1201及1202提供非常不同的碼率-失真折衷。第一分組1201位在一個極端,對SAO參數(逐CTU)進行非常精細的控制,其應會降低失真,但是以大量的信令為代價。第二分組則是位在另一個極端,對SAO參數(整個影像一組)進行非常粗略的控制,其會引起失真但具有非常輕的信令。 接著,將說明如何在編碼器中確定第二分組1202的SAO參數。在第二分組1202中,針對整個影像進行確定,並且切片/幀的所有CTU共享相同的SAO參數。 圖25是使用共享SAO參數的第一種方法(即,在編碼器側沒有新的SAO分類),針對幀/切片級設定SAO參數的範例。此圖式是基於圖17。在過程的一開始,針對每個CTU設定CTUStats表(與CTU級編碼選擇的方式相同)。此CTUStats可被用於傳統的CTU級(1302)。然後透過為表CTUStats的所有CTU添加每個值來設定表FrameStats(1303)。接著,施用與CTU級相同的處理來尋找最佳SAO參數(1305至1315)。為了設定用於幀之所有CTU的SAO參數,在步驟1315所選擇的SAO參數集被設定用於切片/幀的第一個CTU。然後,針對切片/幀的第二個CTU至最後一個CTU的每個CTU,若sao_merge_left_flag存在的話將其設為等於1,否則將sao_merge_up_flag設為等於1(實際上針對第二個CTU至最後一個CTU,存在合併左或合併上或兩者都存在)(1317)。SAO參數集的語法與圖9中所示的語法相同。在處理結束時,針對整體切片/幀設定SAO參數。 因此,在針對整個影像(幀級)確定SAO參數的情況下的CTUStats表是透過圖25的過程創建的。這對應於根據碼率-失真折衷評估幀級。 如先前結合第八實施例所述,編碼器還根據它們個別的碼率-失真折衷評估CTU級非時間推導和時間推導。在這種情況下,針對整個影像執行每個評估。 然後比較三個評估並且選擇具有最佳效能的評估。在位元流中將選擇的推導(時間或CTU級或幀級)發訊給解碼器。 可以用許多不同的方式進行所選擇之推導的發訊。例如,可以發訊分組索引。然後,仍可使用第一語法元素來發信令通知切片之所有CTU的SAO參數是否在時間上被推導出(例如,temporal_merge旗標),在不使用時間推導的情況下由分組索引補充。例如,CTU級可具有分組索引0,以及幀級可具有分組索引1。替代的,第一語法元素可以適於發信令通知所有內容,例如CTU級和幀級可分別具有索引0和索引1,並且時間推導可具有另一個索引,例如2。在這種情況下,在圖21、22及24中,相應地改變第一語法元素。 圖25中確定SAO參數的範例對應於共享SAO參數的第一種方法,因為其使用合併旗標來共享影像的所有CTU之中的SAO參數(見步驟1316和1317)。若使用分享SAO參數的第二種方法,則可以省略這些步驟。 附帶一提,若使用第二種方法,並且在組(影像)內不使用合併旗標,則應適當地修改圖17的過程,特別是不評估1103和1104中的RD成本。 第十實施例 在第八實施例中,CTU級非時間推導與時間推導競爭。在第十實施例中,CTU級非時間推導不可用,取而代之的是幀級非時間推導與時間推導競爭。 第十一實施例 在第九實施例中使用的CTU級和幀級提供極端的碼率-失真折衷。還可能包括在CTU級和幀級之間的其他中間分組,其可以提供其他的碼率-失真折衷。再度參考圖12,第三分組1203使一列CTU成為一組。 圖26是在編碼器側為第三分組1203設定SAO參數集的範例。此圖式是基於圖17。為了減少圖中的步驟量,已將模組1105至1115合併成圖26中的一個步驟1405。在過程的一開始,針對每個CTU設定CTUStats表。此CTUStats可以被用於傳統的CTU級(1302)編碼選擇。對於當前切片/幀的每一列(1403),針對當前列的每個CTU(1404),透過添加來自CTUStats(1402)的每個值(1405)來設定表ColumnStats。然後,關於CTU級(1406)編碼選擇(參照圖17),確定新的SAO參數。若非第一列,則亦評估與先前左邊列共享SAO參數的RD成本(1407),與評估左邊和上面CTU(1103、1104)之間共享SAO參數集的方式相同。若共享SAO參數給出了比新的SAO參數集之RD成本更佳的RD成本(1408),則針對該列第一個CTU,設定sao_merge_left_flag等於1。此CTU的地址號等於值“Column”。否則,將該列第一個CTU的SAO參數集設為等於(1409)在步驟1406中獲得的新的SAO參數。 對於該列的所有其他CTU(1411),將它們的SAO合併左邊sao_merge_left_flag設為等於0(若其存在的話),以及將SAO合併上面sao_merge_up_flag設為等於1。然後,可以處理下一列的SAO參數集(1403)。請注意,除了第一行的CTU之外,幀的所有其他CTU具有sao_merge_left_flag等於0(若其存在的話),以及sao_merge_up_flag等於1。因此,步驟1412可以每幀執行一次。 此種CTU分組的優點是CTU級編碼選擇和幀級之間的另一種RD折衷,其對於某些條件可能是有用的。此外,在此範例中,在組內使用合併旗標,這意味著可以引入第三分組而不需要修改解碼器(即,該分組可以是HEVC相容的)。當然,也可以替代的使用在第三實施例中所述的共享SAO參數的第二種方法。在這種情況下,在組(CTU列)中不使用合併旗標,並且省略步驟1411及1412。 在一個變型中,不需要檢查列之間的合併。這表示從圖26的過程中移除了步驟1407、1408、1410。移除這種可能性的優點是簡化實現以及能夠平行化過程。這對編碼效率影響很小。 CTU級和幀級之間的另一種可能的中間折衷可以由圖23中的第四種分組1204提供,其使一行CTU成為一組。為了確定此第四分組的SAO參數,可以施用與圖25類似的過程。在這種情況下,變數ColumnStats由LineStats取代。步驟1403由“針對Line = 0至Num_CTU_in_Height”取代。步驟1404由“針對CTU_in_line = 0至Num_CTU_in_Width”取代。步驟1405由ColumnStats[][][][] += CTUStats[Line* Num_CTU_in_Width + CTU_in_line][][][][]取代。基於此LineStats表來評估新的SAO參數和與上面CTU的合併(步驟1406、1407)。步驟1410由針對該行第一個CTU將sao_merge_up_flag設為1來取代。並且,對於切片/幀的所有CTU(除了每行的每個第一CTU之外),將sao_merge_left_flag設為等於1。 該行的優點是CTU級和幀級之間的另一種RD折衷。請注意,幀或切片在大多數情況下是矩形,它們的寬度大於它們的高度。因此,預期行CTU分組1204是比列CTU分組1203更靠近幀CTU分組1202的RD折衷。 至於其他的CTU分組1202和1203,若在組內使用合併旗標的話,行CTU分組可以是HEVC相容的。 至於列CTU分組1203,可以移除合併2行的評估。 透過將兩列或更多列的CTU或者將兩行或更多行的CTU放在一起成為一組,可以提供其他的RD折衷。圖25的過程可以適用於確定這些組的SAO參數。 在一個實施例中,一組中的列或行的數量N可取決於目標的分組數量。 當切片或幀很大(針對HD、4K或更高)時,CTU分組使用數列或數行可能是特別有利的。 如前所述,在一個變型中,不需要評估包含兩列或更多列或者包含兩行或更多行的這些分組之間的合併。 另一種可能的分組包括拆分(split)列或拆分行,其中該拆分是適合當前切片/幀的。 CTU級和幀級之間的另一種可能的折衷可以由圖23中所示之方形CTU分組1205和1206提供。分組1205使2x2個CTU成為一組。分組1206使3x3個CTU成為一組。 圖27示出如何確定用於這種分組的SAO參數的範例。針對每個NxN組(1503),基於CTUstats來設定(1504、1505、1506)表NxNStats(1507)。除了左邊(1510)共享或者上面(1509)共享SAO參數之RD成本之外,使用此表來確定新的SAO參數(1508)及其RD成本。若最佳RD成本是新的SAO參數(1511),則將NxN組的第一個CTU(左上CTU)的SAO參數設為等於這個新的SAO參數(1514)。若最佳RD成本是與上面NxN組(1512)共享SAO參數,則將NxN組的第一個CTU(左上CTU)的sao_merge_up_flag設為等於1以及將sao_merge_left_flag設為0(1515)。若最佳RD成本是與左邊NxN組(1513)共享SAO參數,則將NxN組的第一個CTU(左上CTU)的sao_merge_left_flag設為等於1(1516)。然後,為NxN組的其他CTU正確地設定sao_merge_left_flag及sao_merge_up_flag,以便形成用於當前NxN組的SAO參數(1517)。圖28示出3x3 SAO組的設定。將左上CTU設為等於在步驟1508至1516中確定的SAO參數。對於其他2個上面的CTU,將sao_merge_left_flag設為等於1。由於sao_merge_left_flag是第一個經編碼或解碼的旗標,並且其被設為1,因此不需要將sao_merge_up_flag設為0。對於第一行中的其他2個CTU,將sao_merge_left_flag設為等於0並且將sao_merge_up_flag設為等於1。對於其他的CTU,將sao_merge_left_flag設為等於1。 NxN CTU分組的優點是為SAO創建數個RD折衷。至於其他的分組,若使用在該些組內的合併旗標,則這些分組可以是HEVC相容的。至於其他的分組,在圖27中可以省略組之間的合併左邊(Merge left)及合併上面(Merge up)的測試。因此,可以移除步驟1509、1510、1512、1513、1515和1516,尤其當N為高時。 在一個變型中,值N取決於幀/切片的大小。此實施例的優點是獲得有效的RD折衷。 在一較佳的變型中,僅評估N等於2和3。這提供了有效的折衷。 可能的分組彼此競爭,並且使用時間推導作為待被選擇用於當前切片的SAO參數推導。圖29示出如何使用碼率-失真折衷比較來選擇SAO參數推導的範例。 在此範例中,使用在一組CTU之中共享SAO參數的第一種方法。因此,在組內使用合併旗標。若應用於HEVC,可透過HEVC相容的解碼器對得到的位元流進行解碼。 使用當前切片/幀1701來針對每個CTU(1702)設定CTUStats表(1703)。使用此表(1703)來評估CTU級(1704)、時間推導(1715)、幀/切片分組(1705)、列分組(1706)、行分組(1707)、2×2 CTU分組(1708)或3×3 CTU分組(1709)或如前所述之所有其他說明過的CTU分組。依據針對每個可用的推導(1710)所計算的碼率失真標準來選擇最佳推導(使用CTU分組的非時間推導或時間推導)。依據在步驟1710中選擇的推導來設定(1711)每個CTU的SAO參數集。然後使用這些SAO參數來應用SAO濾波(1713),以便獲得經過濾的幀/切片。 可以使用在CTU分組的CTU之中共享SAO參數的第二種方法來代替第一種方法。兩種方法都具有提高編碼效率的優點。當使用第一種方法而不是使用第二種方法時獲得的第二個優點是,該競爭方法不需要任何額外的SAO濾波或分類。實際上,對編碼器複雜性的主要影響是步驟1702,需要針對所有可能的SAO類型的SAO分類、以及過濾樣本的步驟1713。所有其他的CTU分組評估僅是在CTU級編碼選擇(在表CTUStats中設置)期間已獲得的一些值的增加。 在編碼器側提高編碼效率的另一種可能性是,測試所有可能的SAO分組,但相較於圖29的範例,其中評估了分組的小子集,這應該會增加編碼時間。 正如剛才提到的,亦可能使用在一組CTU之中共享SAO參數的第二種方法。在這種情況下,編碼器在位元流中發信令通知選擇了哪一種SAO參數的推導(CTU級、幀級、列、行、2×2 CTU、3×3 CTU、時間推導)。可能的索引方案如下面表1所示:
Figure 108118391-A0304-0001
表1 因為大多數的推導索引值(值0到5)發訊通知分組,該推導索引在下文中也被稱為分組索引。 圖30是說明依據在一組CTU之中共享SAO參數的第二種方法,在切片標頭中發訊CTU分組時的解碼過程的流程圖。首先,從位元流提取旗標SaoEnabledFlag(1801)。若未啟用SAO,則解碼下一個切片標頭語法元素(1807),並且SAO將不會被應用於當前切片。反之,解碼器從切片標頭提取N個位元(1803)。N取決於可用的CTU分組數量。理想地,CTU分組數量應為等於N的2次冪。使用對應的CTU分組索引(1804)來選擇CTU分組方法(1805)。將此分組方法應用於提取SAO語法以及用於為每個CTU確定SAO參數集(1806)。然後,解碼下一個切片標頭語法元素。若CTU分組索引(1804)對應於時間推導,則可以從位元流提取其他的參數,諸如參考幀索引及/或時間推導所需的其他參數。 在CTU分組的切片標頭處發訊的優點是其對位元率影響很低。 但是當切片數量對於幀而言數量很大時,可能期望降低此發訊。因此,在一個變型中,CTU分組索引在切片標頭中使用一元最大碼。在此情況下,將CTU分組根據它們的發生機率排序(最高到最低)。 在第十一實施例中,至少一個非時間推導是中間級(intermediate level)推導(SAO參數不是在CTU級或在組級)。當應用於一組,其導致該組(例如,幀或切片)被細分為細分部分(subdivided parts)(CTU分組1203-1206,例如,多列的CTU、多行的CTU、N×N個CTU等),並且導出每個細分部分的SAO參數。每個細分部分由兩個或更多個所述影像部分(CTU)組成。中間級推導的優點是,引入一或多個有效的碼率-失真折衷。可以在沒有CTU級推導或沒有幀級推導或沒有這兩種推導中的任一種的情況下,使用中間級推導。 第十二實施例 在第九實施例中,時間推導與CTU級推導和幀級推導競爭。第十二實施例建立於此基礎上,並添加第六實施例中所述的一或多個中間分組,使得競爭包括CTU級、幀級、在CTU和幀級之間的一或多個中間分組、以及時間推導。 第十三實施例 在第八實施例中,時間推導與CTU級推導而非與幀級推導競爭。第十三實施例建立於此基礎上,並添加一或多個N×N CTU分組,使得競爭包括CTU級、一或多個N×N CTU組、以及時間推導。 第十四實施例 在第八實施例中,時間推導與CTU級推導而非與幀級推導競爭。第十四實施例建立於此基礎上,並添加第三分組1203(一列CTU)、或第四分組1204(一行CTU)、或第三和第四分組1203和1204二者。因此競爭包括CTU級、第三及/或第四分組、以及時間推導。 第九及第十一至第十四實施例各自透過使至少第一和第二所述非時間推導可用來促進要被應用於組的SAO參數推導的多樣性,該第一非時間推導被應用於組時導致該組具有在第一級的SAO參數,該第二非時間推導被應用於組時導致該組具有在不同於該第一級之第二級的SAO參數。該些級別可以是從幀級到CTU級的任何兩個級別。該些級別可對應於圖23中的分組1201-1206。 第十五實施例 在第八至第十四實施例中,最小的分組是第一分組1201,其中每個CTU是一組,並且每個CTU有一組SAO參數。然而,在第十五實施例中,可以將一組SAO參數應用於比CTU更小的區塊。在此情況下,非時間推導不是在CTU級、幀級或CTU和幀級之間的中間級,而是在子CTU(sub-CTU)級(比影像部分更小的級別)。 在此情況下,代替發訊分組,發訊表示SAO參數之深度的索引是有效的。下面表2示出了可能的索引方案的一個範例:
Figure 108118391-A0304-0002
表2 索引0表示將每個CTU分為16個區塊並且每個區塊可具有其自己的SAO參數。索引1表示將每個CTU分為4個區塊,同樣的每個區塊具有其自己的SAO參數。 將這些不同的SAO參數的深度與時間推導放在一起競爭,編碼器選擇一種推導(在可用深度之一處的時間推導或非時間推導其中一種)。該選擇可基於RD比較。 然後將選擇的推導在位元流中發訊給解碼器。該發訊可包含時間/非時間語法元素加上深度語法元素(例如,使用上面的索引方案)。替代的,可以使用組合的語法元素來發訊通知時間/非時間以及深度。可以將索引6分配給時間推導,例如,非時間推導具有索引0-5。 在第十五實施例中,至少一種非時間推導被應用於組時導致該組被細分成細分部分,並且為每個細分部分導出SAO參數,以及每個影像部分是由兩個或更多個所述細分部分組成的。 在第十五實施例中,如同在第九和第十一至第十四實施例中,至少第一和第二所述非時間推導是可用的,該第一非時間推導被應用於組時導致該組具有在第一級的SAO參數,以及該第二非時間推導被應用於組時導致該組具有在不同於該第一級之第二級的SAO參數。該些級別可以是從幀級到子CTU級的任何兩個級別。該些級別可對應於圖23中的分組1201-1206。 第十六實施例 在第二實施例中,針對切片發訊所選擇的SAO參數的推導,其表示時間推導(當被選擇時)被用於切片的所有CTU。不可能在CTU級確定是否使用時間推導。在第十五實施例中也是如此,其中即使可用的非時間推導包括具有在低於切片或幀級的不同級別(深度)的SAO參數的推導,也不可能在所選擇的SAO參數的級別確定是否使用時間預測。 在第十六實施例中,修改SAO參數推導,使得在CTU級的時間推導是可用的,而非僅有在組級的時間推導。如在先前的實施例中,不將在CTU級的時間推導應用於一組影像部分。然而,此時間推導與應用於一組影像部分的時間推導競爭。 例如,在一個實施方案中,首先為切片或幀選擇SAO參數的級別,其可包括CTU級。然後,當選擇CTU級時,針對切片或幀的每個CTU選擇使用時間推導或非時間推導。 此外,當針對切片所選擇的SAO參數的級別是切片級和CTU級之間的中間級時,可以針對切片或幀的每個CTU組(例如,各列CTU)選擇時間推導或非時間推導。在此情況下,時間推導仍然適用於一組兩個或更多個CTU(影像部分)。然後,切片內的一或多個CTU組可使用時間推導(每個CTU從參考影像的同位CTU導出SAO參數),而其他的CTU組使用非時間推導。在此情況下,除了在一組的基礎上應用時間推導的益處之外,還能達到在每個CTU組的時間或非時間SAO參數推導之間進行選擇的益處。針對2x2 CTU分組(圖23中的分組1205),這示於圖31中。 在圖31中,可以在CTU分組的組之間使用SAO合併旗標。如圖31中所描繪的,對於2x2 CTU分組,為每組2x2個CTU保留SAO merge Left和SAO merge up。但對於在該組內的CTU,則將它們移除。請注意,僅將sao_merge_left_flag用於一列CTU的分組1203,並且僅將sao_merge_up_flag用於一行CTU的分組1204。 在一變型中,旗標發訊通知當前CTU組是否共享其SAO參數。若其為真,則發訊通知表示先前組之一的語法元素。因此,切片的每一組可以透過先前組來預測,除了第一組之外。此透過增加數個新的可能的預測子來提高編碼效率。 第十七實施例 在第十六實施例中,針對切片選擇了SAO參數的深度,包括小於CTU的深度,使得在CTU中每個區塊有一組SAO參數是可能的。然而,當選擇使用時間推導時,不能選擇深度,並且切片的所有CTU都必須使用時間推導。 在第十七實施例中,修改SAO參數推導,使得針對切片選擇深度,並且接著針對在所選擇深度的影像部分選擇是否使用時間推導。深度可以是表2中的深度。 在第十六實施例中,修改SAO參數,使得在子CTU級的時間推導是可用的,而非僅有在組級的時間推導。如在先前的實施例中,不將在子CTU級的時間推導應用於一組影像部分。然而,此時間推導與應用於一組影像部分的時間推導競爭。 例如,在一個實現方案中,首先為切片或幀選擇SAO參數的級別,其可包括子CTU級。然後,當選擇子CTU級時,針對切片或幀的每個區塊選擇使用時間推導或非時間推導。 此外,當針對切片所選擇的SAO參數的級別是切片級和區塊級之間的中間級時,可以針對切片或幀的每個CTU或每個CTU組(例如,各列CTU)選擇時間推導或非時間推導。在此情況下,時間推導仍然適用於一組兩個或更多個區塊(影像部分)。然後,切片內的一或多個CTU或CTU組可使用時間推導(每個區塊從參考影像的同位區塊導出SAO參數),而其他的CTU或CTU組使用非時間推導。在此情況下,除了在一CTU或CTU組的基礎上應用時間推導的益處之外,還能達到在每個CTU或CTU組的時間或非時間SAO參數推導之間進行選擇的益處。 在第十七實施例中以及在第十六實施例中,一種可能性是移除所有級別的SAO合併旗標。這表示移除了圖9的步驟503、504、505、506。優點是其顯著地降低了SAO的發訊,其因此降低了位元率。此外,透過移除在CTU級的2個語法元素而簡化了設計。 在一個變型中,針對CTU級保留了合併旗標,但針對所有其他的CTU分組移除了合併旗標。優點是CTU級的靈活性。 在另一變型中,當SAO發訊低於或等於CTU級(1/16 CTU或1/4 CTU)時,針對CTU使用合併旗標,並且針對具有較大組的其他CTU分組移除合併旗標。 合併旗標對於小區塊尺寸而言是重要的,因為SAO參數集相較於其可以改進的樣本數量是昂貴的。在此情況下,這些語法元素降低了SAO參數發訊的成本。對於大組而言,SAO參數集成本較低,因此使用合併旗標沒有效率。因此,這些實施例的優點是編碼效率提高。 在另一變型中,在位元流中明確地發訊啟用SAO合併旗標的級別。例如,一旗標指示是否使用SAO合併旗標。可以將該旗標包括在切片標頭中的CTU分組(或深度)的索引之後。這為編碼器提供了有效地選擇使用SAO Merge旗標與否。 第十八實施例 在第八至第十五實施例中,時間推導和不使用時間推導的至少一種替代推導方法之間存在競爭。類似的,在第十六及第十七實施例中,分組或深度之間存在競爭,時間推導對於每個分組或深度是可能的。雖然這種競爭對於識別切片或幀的有效SAO參數推導是有用的,但是它可能為必須針對每個候選推導執行評估的編碼器帶來相當大的負擔。這種負擔可能是不希望的,尤其是對於硬體編碼器而言。 因此,在第十八實施例中,不同的允許的推導之間的競爭(例如,在第八實施例中,CTU級的非時間推導與時間推導之間的競爭)被修改,使得僅有一種推導在編碼器中被允許用於任何切片或幀。該允許的推導可依據切片或幀的一或多個特徵來確定。例如,可依據切片類型(Intra、Inter_P、Inter_B)、切片的量化級別(QP)、或圖片組(Group of Pictures, GOP)之層級中的位置來選擇該允許的推導。因此,對於某些切片或幀,僅允許時間推導,而對於其他切片或幀,僅允許非時間推導,例如在CTU級的非時間推導。例如,可以允許在GOP結構之層級中的最高位置或具有低QP的Intra幀和Inter幀僅使用CTU級別。並且可允許具有在GOP層級中較低位置或高QP的其他幀僅使用時間推導。可以依據碼率失真折衷來設定不同的參數。此實施例的優點是降低了複雜性。僅選擇一種推導而非評估兩種或更多種競爭的推導,這對於硬體編碼器來說是有用的。 因此,在第十八實施例中,第一種推導與第一組影像(例如,Intra切片)相關聯,而第二種推導與第二組影像(例如,Inter_P切片)相關聯。確定要被過濾的組是第一組還是第二組。若確定要被過濾的組是第一組,則使用第一種推導來過濾該組的影像部分,並且若確定要被過濾的組是第二組,則使用第二種推導來過濾該組的影像部分。不需要評估兩種推導。 確定要被過濾的組是第一組或是第二組可依據下面之一或多者: 切片類型; 要被過濾的組所屬之影像的幀類型; 要被過濾的組所屬之影像的圖片組之品質層級中的位置; 要被過濾的組所屬之影像的品質;以及 可應用於要被過濾的組的量化參數。 例如,當第一組比第二組具有更高品質或在品質層級中的更高位置時,第一種推導在每組中可具有比第二種推導更少的影像部分。 第十九實施例 在第十八實施例中,針對給定的切片或幀選擇了特定的SAO參數的推導。然而,若編碼器有能力評估有限數量的競爭推導,則不必完全消除競爭。在第十四實施例中,仍然允許針對給定切片或幀的競爭,但是將競爭推導的集合適應於切片或幀。例如,競爭推導的集合可取決於切片類型(Intra、Inter_P、Inter_B)、切片的量化級別(QP)、或圖片組(GOP)之層級中的位置。 競爭推導的集合可取決於切片類型。 對於Intra切片,集合較佳地包含其中組具有包含小數量CTU(例如,CTU級、2×2 CTU、3×3 CTU以及列)的分組。並且,若低於CTU的深度是可用的(如在第十實施例中),則較佳地還包括這些深度。當然,不使用時間推導。 對於Inter切片,推導的集合較佳地包含其中組具有包含諸如行、幀級和時間推導之大數量CTU的分組。然而,還可以考慮小至CTU級的更小的分組。 此實施例的優點是編碼效率提高,因為使用適應於切片或幀的推導。 在一個變型中,用於Inter B切片的推導的集合可以不同於用於Inter P切片的推導的集合。 在另一變型中,競爭推導的集合取決於GOP中的幀的特徵。這對於基於品質層級而品質(QP)不一的幀是特別有益的。對於具有最高品質或層級中最高位置的幀,競爭推導的集合應包括包含較少CTU或甚至子CTU深度的組(與上述針對Intra切片相同)。對於具有較低品質或層級中較低位置的幀,競爭推導的集合應包括具有更多CTU的組。 競爭推導的集合可被定義在序列參數集中。 因此,在第十九實施例中,第一推導集合與第一組影像(例如,Intra切片)相關聯,並且第二推導集合與第二組影像(例如,Inter_P切片)相關聯。確定要被過濾的組是第一組還是第二組。若確定要被過濾的組是第一組,則從第一推導集合選擇一推導並用於過濾該組的影像部分,並且若確定要被過濾的組是第二組,則從第二推導集合選擇一推導並用於過濾該組的影像部分。不需要評估不在相關聯的推導集合中的推導。 在先前的實施例中可以確定要被過濾的組是第一組還是第二組。例如,當第一組比第二組具有較高品質或品質層級中的較高位置時,第一推導集合可以具有至少一種推導,其每組具有比第二推導集合更少的影像部分。 第二十實施例 在前面的實施例中,時間推導涉及簡單地從同位的CTU(或者若使用在區塊級的SAO參數,則從CTU內的同位區塊)複製SAO參數。在視頻中,通常有背景和移動的物體。將一幀和其後續的幀進行比較時,很大部分可能是靜態的。當對數個連續幀的這種靜態部分應用SAO時間推導時,SAO濾波應該甚麼都不過濾,尤其是針對邊緣偏移。因此,將不選擇時間推導。 為了解決此問題及提高時間推導的編碼效率,在第二十實施例中,依據一些定義好的規則,修改來自先前幀的該組SAO參數。圖32是產生該組SAO參數之此種修改的演算法的範例。在此範例中,將90°旋轉應用於邊緣分類。若來自同位CTU的sao_eo_class_Luma或sao_eo_class_Chroma(2301)等於0(其對應於邊緣類型0°(2302)),則將當前幀的邊緣類型(2310)設為等於1(2303),其對應於SAO邊緣類型90°。並且,若sao_eo_class_X等於1(2304),則將sao_eo_class_X(2305)設為等於0。以相同的方式,將邊緣偏移類型135°(sao_eo_class_X等於2(2306))旋轉到邊緣偏移類型45°(2307)。並且將邊緣偏移類型45°(sao_eo_class_X等於3(2308))旋轉到邊緣偏移類型45°(2309)。偏移值未改變。 應當理解的是,儘管圖32之演算法的效果是應用旋轉,但是實際上可以透過使用映射表來實現對邊緣分類參數(sao_eo_class_Luma或sao_eo_class_Chroma)的改變。在映射表中,每個現有的邊緣索引都有一條目,其映射到對應的“新的”邊緣索引。因此,映射表實現了所需的旋轉。 圖33示出此種時間旋轉90°。在此範例中,假設將具有90°旋轉的時間推導應用到整個幀或切片,如在第一及第二實施例中那樣。 當然,作為一變型,可以考慮45°及135°旋轉而不是90°。然而,在較佳的實施例中,時間SAO參數集的旋轉是90°旋轉。這提供了最佳的編碼效率。 在一個變型中,當應用時間旋轉時,不會複製帶偏移並且不會對此CTU應用SAO。 在另一變型中,就基本的“複製”時間推導而言,針對無法獲得SAO參數集的所有CTU(這意味著其之同位CTU使用“無SAO”的CTU或者其之同位CTU使用“無SAO”的所有CTU),可以將預設的SAO參數集用於相關CTU,如結合第五實施例所述。 第二十一實施例 在第二十實施例中,引入“旋轉”時間推導。在第二十一實施例中,將“旋轉”時間推導與“複製”時間推導進行競爭,如圖34中所示。在此範例中,將該競爭應用於每個切片或每個幀。可基於碼率-失真標準來選擇最佳時間推導。 第二十二實施例 在前面的數個實施例中,“複製”時間推導與一或多種非時間推導(不同的分組或不同的深度)競爭。在第二十二實施例中,將“旋轉”時間推導與相同的(一或多種)非時間推導競爭,而非與“複製”時間推導競爭。 第二十三實施例 在前面的數個實施例中,“複製”時間推導與一或多種非時間推導(不同的分組或不同的深度)競爭。在第二十三實施例中,將“複製”及“旋轉”時間推導二者皆與相同的(一或多種)非時間推導競爭,而非僅是“複製”時間推導參與競爭。例如,下面的表3示出當以此種方式修改第十一實施例時的競爭推導:
Figure 108118391-A0304-0003
表3 作為一變型,分別具有135°及45°旋轉或者具有其他旋轉角度的進一步時間推導是可能的。 第二十四實施例 在第二十一實施例中,將“複製”及“旋轉”時間推導彼此競爭。在第二十四實施例中,循環地使用這兩種時間推導以及進一步的“旋轉”時間推導。 在一個示例性的循環中,第一幀F0之後接著第二、第三、第四及第五幀F1-F4。第一幀F0不使用SAO參數的時間推導。對於F1,應用“複製”時間推導(即,從F0複製SAO參數)。對於F2,時間推導是F0的SAO參數的90°旋轉。對於F3,時間推導是F0的SAO參數的135°旋轉。對於F4,時間推導是F0的SAO參數的45°旋轉。在此情況下,F0是F1至F4之各者的參考影像。 可以透過僅使用先前幀作為參考幀來達到相同的效果: 幀F0:(SAO參數非時間導出的) 幀F1:(時間‘copy’幀0) 幀F2:(時間‘90°’ 幀1) 幀F3:(時間‘45°’ 幀2) 幀F4:(時間‘90°’ 幀3) 透過使用旋轉複製推導來過濾第一影像中的一影像部分,並且使用以預定序列使用兩種或更多種時間旋轉推導中的不同時間旋轉推導來過濾在該第一影像之後的兩個或更多個其他影像中的相同影像部分,影像部分之邊緣濾波的方向可以通過所有可能的邊緣濾波方向被連續地切換。 第二組實施例 在HEVC中,逐CTU執行SAO濾波。在第一組實施例中,引入時間推導,並且為了提高發訊效率,形成一組影像部分,並且針對此組影像部分,而非單獨針對每個影像部分來發訊通知時間推導的使用。 在第二組實施例中,任何的推導都不必是分組方式(group-wise)的推導。 第二十五實施例 在第二十實施例中,“旋轉”時間推導被應用於切片或幀的所有CTU。換句話說,旋轉時間推導是針對由兩個或更多個影像部分(CTU)組成的一組(切片、幀、列、行、NxN個CTU等)發訊的。該些影像部分(CTU)仍然可以具有不同的SAO參數,其取決於個別的同位影像部分的SAO參數。 在切片或幀級發訊時間推導對於與先前描述的實施例的相容性是有用的,可以多從個分組(例如,圖23中的分組1201-1206)中為切片或幀選擇CTU的分組,亦在切片或幀級發訊所選的分組。然而,在切片或幀級發訊使用時間推導並不重要。這應用於是否僅有一種類型的時間推導,例如“複製”或“旋轉”,或者可以從多個不同類型中選擇類型。相反的,可以在CTU級或在區塊級(即,子CTU)發訊時間推導的使用。在此情況下,可以為每個CTU提供語法元素,以指示是否針對相關CTU使用旋轉時間推導。同樣的,可以為每個區塊(即,子CTU)提供語法元素,以指示是否針對相關區塊使用旋轉時間推導。 在第二十五實施例中,在切片級既不發訊時間推導也不發訊分組,並且所有的SAO發訊都是在CTU級。圖35示出在此實施例中之解碼過程的範例。在此範例中,在CTU級使用一或多個合併旗標來發訊通知SAO推導包括時間推導的使用。與圖9相比,引入了新的SAO temporal merge flag。 圖35的過程是逐CTU執行的。針對當前CTU,從位元流提取sao_merge_temporal_flag_X,若其他的合併旗標關閉(off)的話(2613)。若sao_merge_temporal_flag_X等於1,則從位元流提取表示參考幀的語法元素(2614)。請注意,若僅有一個參考幀被用於推導的話,不需要此步驟。接著,解碼表示參數之旋轉的語法元素(2615)。請注意,若沒有“旋轉”選項可用的話,則不需要此步驟。若時間推導的唯一類型是基本的“複製”類型的話,則會是這種情形。並且,即使有旋轉選項,若在參考幀中的同位CTU不是EO類型的話,也不執行步驟2615。接著,將3個顏色分量的各組SAO參數從同位的CTU複製到當前的CTU。然後,處理在步驟2610中前進到下一個CTU。 相較於在切片級的時間/CTU分組發訊,時間合併旗標發訊的優點是對於一些實施方案能簡化編碼器設計。實際上,不像在切片級的方案那樣,在開始SAO選擇之前不需要等待整個幀的編碼。但是,在CTU級的額外發訊會對編碼效率產生重大影響,這是不容忽視的。 當兩種或更多種時間推導彼此競爭時,例如,“無時間”、“複製”、“旋轉90°”、“旋轉135°”、“旋轉45°”,在步驟2615中提取的每個CTU的語法元素可以指示所選的時間推導,例如,使用索引。語法元素還可以指定旋轉的角度。以此方式,在相同的切片或幀中,某些CTU可能沒有時間推導,其他的CTU可使用“複製”,還有一些其他的CTU可使用“旋轉90°”等等。這些解決方案導致SAO參數推導極度精細地適應切片或幀的CTU。 發訊切片或幀的分組,然後針對兩個或更多個CTU之各組發訊是否使用時間推導(若兩種或更多種時間推導彼此競爭,其中一種被選擇),是在沒有每個CTU語法元素的情況下實現適應性的有效方法。例如,若所選擇的切片分組是3x3個CTU,則一些組可能沒有時間推導,其他組可使用“複製”,還有一些其他組可使用“旋轉90°”等等。由於組的數量僅是CTU數量的1/9,因此相較於每CTU發訊,語法元素的數量也相應地比較少,然而,在各組中的不同CTU仍可能依據同位的CTU而有不同的SAO參數。 第二十六實施例 在第二十至第二十五實施例中,引入旋轉時間推導。這些旋轉時間推導是來自更廣泛的變換的較佳範例,其可以應用於與參考幀的同位CTU中的EO濾波的方向相比,更改當前幀的CTU中的EO濾波的方向。例如,方向更改變換可以是關於x軸或y軸的反射。此種反射具有交換兩個方向並且保持另外兩個方向不變的效果。其也可以是關於45°或135°對角線的反射。 如在第二十實施例中,應當理解的是,儘管圖32之演算法的效果是應用變換,但實際上可以透過使用映射表來實現對邊緣分類參數(sao_eo_class_Luma或sao_eo_class_Chroma)的改變。在映射表中,每個現有的邊緣索引都有一個條目,其映射到對應的“新的”邊緣索引。因此,映射表實現了所需的變換。 此實施例適用於第一組實施例(其使用分組推導)或適用於第二組實施例(其不使用分組推導)。 第三組實施例 在第一組和第二組實施例中,引入了SAO參數的時間推導,作為分組推導(應用於一組兩個或更多個影像部分)或者用於個別的影像部分。 在第三組實施例中,引入了新的SAO參數的空間推導。這些可以是分組推導,或者用於個別的影像部分。 在分組空間推導的情況下,如在第一組實施例中那樣,一組可以是任何兩個或更多個CTU,例如,整個影像、切片、一行CTU、一列CTU、N行CTU、N列CTU,其中N是大於1的整數。一組還可以是N×N個CTU,其中N是大於1的整數,或者是M×N個CTU或N×M個CTU,其中M ≥ 1及N > 1。 替代的,一組影像部分可以是一CTU,並且該CTU的各個組成區塊可以是影像部分。在此情況下,CTU的每個區塊可以有其自己的SAO參數,但是可以針對該CTU作為整體,發訊通知使用SAO參數的空間推導。 在僅有一種類型的空間推導的最簡單的情況下,可以使用旗標temporal_merge來發訊通知針對該組的所有影像部分使用時間推導。 在分組空間推導的情況下,在空間推導中導出SAO參數的方式不受到特別限制,除了來源影像部分屬於與主題組相同的影像中的另一組影像部分之外。來源影像部分與待推導的影像部分在它們各自的組中位於相同的位置。例如,在3x3 CTU分組中,從左上到右下有9個位置。若另一組是,例如,主題組的左邊組,則位在主題組中的位置1(例如,左上位置)的影像部分的至少一個SAO參數是從位在左邊組中的相同位置(位置1或左上位置)的影像部分的SAO參數導出的。在左邊組中的這個影像部分作為在主題組中待推導的影像部分的來源影像部分。對於主題組中的每個其他位置也是如此。 在最簡單的情況下,屬於該組的影像部分的至少一個SAO參數是從來源影像部分的SAO參數導出的,其透過複製來源影像部分的SAO參數。可以複製一個、多於一個、或所有的SAO參數。替代的,可以只在SAO濾波是特定類型(邊緣或帶)時才複製一個、多於一個、或所有的SAO參數。 舉例來說,在圖31中,繪示了數個2x2 CTU組。當在當前2x2組中設定了sao_merge_left_flag時,將左邊2x2組的左上位置中的CTU的一或多個SAO參數複製到當前2x2組的左上位置中的CTU;將左邊2x2組的右上位置中的CTU的一或多個SAO參數複製到當前2x2組的右上位置中的CTU;將左邊2x2組的左下位置中的CTU的一或多個SAO參數複製到當前2x2組的左下位置中的CTU;以及將左邊2x2組的右下位置中的CTU的一或多個SAO參數複製到當前2x2組的右下位置中的CTU。sao_merge_up_flag對2x2組執行上面當前2x2組相同的操作。當兩個旗標都未設定時,每個CTU都有其自己的“新的”SAO參數,這些參數可以是在組級(每個分組一參數集)或在CTU級。 代替涉及了修改的複製SAO參數的空間推導,可以使用來源影像部分的一個、多於一個、或所有的SAO參數。 應當理解的是,空間和時間分組推導皆是“分組的來源推導”。每個涉及將SAO參數的分組的來源推導應用到一組兩個或多個影像部分,該分組來源推導允許屬於該組的不同影像部分具有不同的SAO參數,並且包含從作為要導出之影像部分的來源影像部分的另一個影像部分的SAO參數,導出屬於該組的影像部分的至少一個所述SAO參數。在時間推導的情況下,該來源影像部分是參考影像中的同位的影像部分,其在參考影像中的位置與在其影像中要導出的影像部分的位置相同。在空間推導的情況下,該來源影像部分屬於在與要導出的影像部分相同的影像中的另一組影像部分,所述來源影像部分與所述要導出的影像部分在它們各自分組中的位置相同。 第二十七實施例 在第二十五實施例中,旋轉推導是非分組時間推導。然而,在第二十七實施例中,使用空間旋轉推導作為推導,即,當前幀中之CTU的SAO參數是透過從相同影像的另一個CTU的SAO參數旋轉來導出的(而不是透過從參考影像的同位CTU的SAO參數旋轉來導出)。 類似於“複製”空間推導,在“旋轉”空間推導中的另一CTU可以是左邊的CTU或上面的CTU,在該情況下,當選擇了旋轉空間推導時,可以使用sao_merge_rotation_left旗標或sao_merge_rotation_up旗標來發訊。圖36示出了另一CTU是左邊CTU並且從左邊CTU到當前CTU的旋轉是90度的兩個範例。 在一個變型中,旋轉空間推導可以與時間複製推導及/或旋轉時間推導競爭。 在另一變型中,沒有時間推導,並且旋轉空間推導與複製空間推導(當然其可以是複製左邊及/或複製上面)競爭。 在這些情況下,在空間基礎上應用“旋轉”推導來產生額外的SAO合併參數集候選,用以預測當前CTU的SAO參數集。因此,可以應用“旋轉”來增加SAO Merge候選者的列表或者為空的位置尋找新的SAO Merge候選者。 使用第二十七實施例代替使用來自先前解碼的SAO參數集的數個SAO參數集的優點是編碼效率性能的提高。此外,透過存取有限數量的已編碼SAO參數集,為編碼器實現方案提供了額外的靈活性。 圖37是表示SAO參數之旋轉推導的可能使用的範例的流程圖。 在用於解碼當前CTU的一組SAO參數的過程中,若其他的合併旗標關閉,則從位元流提取sao_merge_rotation_Left_X旗標(3613)。若sao_merge_ rotation_Left_X等於1,針對當前CTU的每個顏色分量YUV,透過將旋轉應用到如第二十五實施例中所述的邊緣分類,從左邊CTU的相同顏色分量YUV的SAO參數集推導得到SAO參數集。可以簡單地複製除了方向之外的SAO參數。 第二十八實施例 在第二十七實施例中,旋轉空間推導被應用於一個CTU。在第二十八實施例中,應用基於分組的旋轉空間推導。然後,當前組的每個CTU透過從在相同影像的另一組中的相同位置處的CTU旋轉來導出其SAO參數。例如,分組可以是3x3個CTU。另一組可以是上面的組或是在左邊的組。 同樣的,基於分組的空間推導可以與基於分組的時間推導(複製或是旋轉任一者或二者)競爭。 類似的,基於分組的空間推導可以與基於分組的“複製”空間推導(其可以是複製左邊及/或複製上面)競爭。 第二十九實施例 在第二十七及二十八實施例中,引入旋轉空間推導。正如旋轉時間推導是更廣泛的可能的方向變換時間推導類型之一,因此,旋轉空間推導是更廣泛的可能的方向變換空間推導類型之一。方向變換空間推導可被應用於單獨的CTU或被應用於一組CTU。其可以與其他空間及/或時間推導競爭。 第三十實施例 圖38示出依據本發明之實施例的系統191、195,其包含編碼器150或解碼器100及通訊網路199中的至少一者。依據實施例,系統195用於處理及提供內容(例如,用於顯示/輸出的視訊及音訊內容或串流視訊/音訊內容)給使用者,其例如透過包含解碼器100的使用者終端或可以與解碼器100通訊的使用者終端的使用者介面存取解碼器100。這種使用者終端可以是電腦、行動電話、平板或能夠提供/顯示(供應的/串流的)內容給使用者的任何其他類型的裝置。系統195透過通訊網路199獲取/接收位元流101(以連續串流或信號的形式–例如,當顯示/輸出早期視訊/音訊時)。依據實施例,系統191係用於處理內容及儲存處理後的內容,例如,為了在稍後顯示/輸出/串流而處理的視訊及音訊內容。系統191獲得/接收包含原始影像序列151的內容,其由編碼器150接收及處理(包括依據本發明之使用去區塊濾波器的濾波),並且編碼器150產生位元流101,其經過通訊網路199被傳輸到解碼器100。然後將位元流101以多種方式傳輸到解碼器100,例如,其可以由編碼器150預先產生,並且作為資料被儲存在通訊網路199中的儲存裝置中(例如,在伺服器或雲端儲存器上),直到使用者從該儲存裝置請求內容(即,位元流資料),此時從該儲存裝置將該資料傳輸/串流到解碼器100。系統191還可以包含內容提供裝置,用於向使用者提供/串流傳輸(例如,透過傳送要顯示在使用者終端上之用於使用者介面的資料)儲存在儲存裝置中的內容的內容資訊(例如,內容的標題以及其他的元/儲存位置資料,用於識別、選擇和請求內容),以及用於接收和處理使用者對內容的請求,使得可以將所請求的內容從儲存裝置發送/串流到使用者終端。替代的,編碼器150產生位元流101並且當使用者請求內容時將該位元流直接傳送/串流到解碼器100。然後,解碼器100接收位元流101(或信號)並且依據本發明使用去區塊濾波器執行濾波,以獲得/產生視訊信號109及/或音訊信號,其接著被使用者終端使用以將請求的內容提供給使用者。 在前面的實施例中,可以用硬體、軟體、韌體或其任何組合來實現所描述的功能。若以軟體實現,則功能可作為一或多個指令、碼而被儲存在電腦可讀取媒體上或是經由電腦可讀取媒體傳輸,並且由基於硬體的處理單元執行。 電腦可讀取媒體可包括電腦可讀取儲存媒體,其對應於諸如資料儲存媒體之有形的媒體,或通訊媒體,其包括有助於例如依據通訊協定,將電腦程式從一地傳送到另一地的任何媒體。以此方式,電腦可讀取媒體通常可對應於(1)非暫時性的有形電腦可讀取儲存媒體或(2)通訊媒體,諸如信號或載波。資料儲存媒體可以是任何可用的媒體,其可以由一或多個電腦或一或多個處理器存取,以提取用於實現本公開中所述之技術的指令、碼及/或資料結構。電腦程式產品可包括電腦可讀取媒體。 作為示例而非限制,這種電腦可讀取儲存媒體可以包括RAM、ROM、EEPROM、CD-ROM或其他光碟儲存、磁碟儲存或其他磁性儲存裝置、快閃記憶體、或可被用於以指令或資料結構的形式儲存所需之程式碼並且可以被電腦存取的任何其他媒體。並且,把任何連接都適當地稱為電腦可讀取媒體。例如,若使用同軸電纜、光纖電纜、雙絞線、數位用戶線(DSL)或諸如紅外線、無線電和微波的無線技術從網站、伺服器或其他遠端來源傳輸指令,則同軸電纜、光纖電纜、雙絞線、DSL或諸如紅外線、無線電和微波的無線技術都包含在媒體的定義中。然而,應理解的是,電腦可讀取儲存媒體及資料儲存媒體不包括連接、載波、信號、或其他暫態媒體,而是針對非暫態、有形的儲存媒體。本文使用的磁碟和光碟包括光碟(CD)、雷射光碟、光碟(optical disc)、數位多功能光碟(DVD)、軟碟和藍光光碟,其中磁碟通常磁性地再現資料,而光碟使用雷射光學地再現資料。上述的組合也應包括在電腦可讀媒體的範圍內。 指令可由一或多個處理器執行,例如一或多個數位信號處理器(DSP)、通用微處理器、特定應用積體電路(ASIC)、現場可編程邏輯陣列(FPGA)、或其他等效的整合或離散邏輯電路。因此,如本文所使用的術語「處理器」可以指的是任何前述的結構或者適合於實現本文所述之技術的任何其他結構。此外,在一些態樣中,本文所述的功能可在被配置用於編碼及解碼的專用硬體及/或軟體模組內提供,或者被併入組合的編解碼器中。並且,這些技術可在一或多個電路或邏輯元件中被完全實現。 本公開的技術可在各種裝置或設備中實現,包括無線手機、積體電路(IC)或一組IC(例如,晶片組)。在本公開中描述了各種元件、模組、或單元,用以強調被配置成執行所公開之技術的裝置的功能態樣,但不一定需要由不同的硬體單元實現。而是,如上所述,可在編解碼器硬體單元中組合各種單元,或由一組互操作硬體單元提供,其包括如上所述的一或多個處理器,連同合適的軟體及/或韌體。Figure 1 is about the coding structure used in the High Efficiency Video Coding (HEVC) video standard. The video sequence 1 is composed of a series of digital images i. Each such digital image is represented by one or more matrices. The matrix coefficients represent pixels. The sequence of images 2 can be divided into multiple slices 3. Slices can constitute the entire image in some cases. These slices are divided into multiple Coding Tree Units (CTUs) that do not overlap. Coding Tree Unit (CTU) is the basic processing unit of the High Efficiency Video Coding (HEVC) video standard, and conceptually corresponds in structure to the macroblock units used in several previous video standards. The CTU is sometimes called the largest coding unit (Largest Coding Unit, LCU). The CTU has luma and chroma component parts, and each component part is called a coding tree block (Coding Tree Block, CTB). These different color components are not shown in FIG. The size of the CTU is usually 64×64 pixels. A quadtree decomposition can be used to iteratively divide each CTU into smaller variable size coding units (CU) 5. The coding unit is a basic coding element, and is composed of two subunits called a prediction unit (Prediction Unit, PU) and a transformation unit (Transform Unit, TU). The maximum size of PU or TU is equal to the size of CU. The prediction unit corresponds to the division of the CU used to predict the pixel value. As shown in 6, various divisions of the CU into PUs are possible, including a division into 4 square PUs and two different divisions into 2 rectangular PUs. The conversion unit is the basic unit for spatial conversion using DCT. The CU can be divided into multiple TUs based on the quadtree representation 7. Each slice is embedded in a Network Abstraction Layer (NAL) unit. In addition, the encoding parameters of the video sequence are stored in dedicated NAL units called parameter sets. In HEVC and H.264/AVC, two parameter set NAL units are used: first, Sequence Parameter Set (SPS) NAL unit, which collects all parameters that have not changed during the entire video sequence. Usually, it deals with coding profile, video frame size and other parameters. Second, the picture parameter set (Picture Parameter Set, PPS) NAL unit includes parameters that may be different in each image (or frame) in the sequence. HEVC also includes a Video Parameter Set (VPS) NAL unit, which contains parameters that describe the overall structure of the bitstream. VPS is a new type of parameter set defined in HEVC and is applicable to all layers of the bitstream. One layer can contain multiple temporal sublayers, and all version 1 bit streams are limited to a single layer. HEVC has certain layered extensions for tunability and multi-view, and these extensions will support multiple layers, with a backward compatible version 1 base layer. Figure 2 shows a data communication system in which one or more embodiments of the invention can be implemented. The data communication system includes a sending device, in which case the sending device is a server 201, which can be operated to transmit data packets of the data stream to the receiving device via the data communication network 200, in which case the receiving device is a client terminal 202. The data communication network 200 may be a wide area network (WAN) or a local area network (LAN). Such a network may be, for example, a wireless network (Wifi/802.11a or b or g), Ethernet, Internet or a hybrid network composed of several different networks. In a specific embodiment of the present invention, the data communication system may be a digital television broadcasting system, in which the server 201 transmits the same data content to multiple clients. The data stream 204 provided by the server 201 may be composed of multimedia data representing video and audio data. In some embodiments of the present invention, the server 201 may use a microphone and a camera to extract audio and video data streams, respectively. In some embodiments, the data stream may be stored on the server 201, or received by the server 201 from another data provider, or generated at the server 201. The server 201 is provided with an encoder for encoding video and audio streams, in particular to provide a compressed bit stream for transmission, the compressed bit stream is used as input data provided to the encoder. Closely expressed. In order to obtain a better ratio between the quality of the transmitted data and the number of transmitted data, the compression of the video data may be based on the HEVC format or the H.264/AVC format, for example. The client 202 receives the transmitted bit stream, and decodes the reconstructed bit stream to reproduce the video image on the display device and the audio data through the speaker. Although the streaming scenario is considered in the example of FIG. 2, it should be understood that, in some embodiments of the present invention, the data communication between the encoder and the decoder may use, for example, a media storage device such as an optical disc To execute. In one or more embodiments of the present invention, the video image is transmitted with data representing displacement compensation to be applied to the reconstructed pixels of the image, and filtered pixels are provided in the final image. FIG. 3 schematically shows a processing device 300 configured to implement at least one embodiment of the present invention. The processing device 300 may be a device such as a microcomputer, a workstation, or a portable device. The device 300 includes a communication bus 313, which is connected to: -A central processing unit 311, such as a microprocessor, represented as a CPU; -Read-only memory 307, expressed as ROM, used to store computer programs for implementing the present invention; -Random access memory 312, represented as RAM, is used to store executable code and temporary memory of the method of the embodiment of the present invention, which is suitable for recording the method of realizing the sequence of encoding digital images according to the embodiment of the present invention And/or variables and parameters required for the method of decoding the bitstream; and -Communication interface 302, connected to communication network 303, transmitting or receiving digital data to be processed on the communication network. Optionally, the device 300 may further include the following elements: -A data storage mechanism 304, such as a hard disk, for storing computer programs for implementing the method of one or more embodiments of the invention and data used or generated during the implementation of one or more embodiments of the invention; -A disk drive 305 for the disk 306, the disk drive is suitable for reading data from the disk 306 or writing data to the disk; -A screen 309 for displaying data through the keyboard 310 or any other pointing mechanism and/or as a graphical user interface. The device 300 may be connected to various peripheral devices, such as, for example, a digital camera 320 or a microphone 308, and each peripheral device is connected to an input/output card (not shown) in order to provide multimedia materials to the device 300. The communication bus provides communication and interaction capabilities between various components included in the device 300 or connected thereto. The representation of the bus is not limitative, in particular the central processing unit is operable to transmit instructions to any element of the device 300 directly or through another element of the device 300. The magnetic disk 306 can be replaced by any information medium, such as, for example, a rewritable or non-rewritable optical disk (CD-ROM), a ZIP disk, or a memory card. Generally speaking, it can be replaced by an information storage mechanism. The mechanism can be read by a microcomputer or microprocessor, integrated or not integrated into the device, may be removable and suitable for storing one or more programs, the execution of these programs makes the sequence of encoded digital images according to the invention The method and/or the method of decoding the bit stream can be implemented. The executable code may be stored in read-only memory 307, on hard disk 304, or on removable digital media, such as, for example, disk 306 as previously described. According to a variant, the executable code of the program can be received via the communication network 303 and the interface 302 to be stored in a storage mechanism of the device 300, such as the hard disk 304, before being executed. The central processing unit 311 is adapted to control and guide the execution of instructions or parts of the program or software code of the program according to the present invention, and instructions stored in one of the aforementioned storage mechanisms. When the power is turned on, one or more programs stored in non-volatile memory, such as the hard disk 304 or the read-only memory 307, are transferred to the random access memory 312 and the temporary memory. The random access memory then contains the executable code of the one or more programs, and the register is used to store variables and parameters needed to implement the present invention. In this embodiment, the device is a programmable device that uses software to implement the present invention. However, optionally, the present invention may be implemented in hardware (for example, in the form of an application specific integrated circuit or ASIC). Fig. 4 shows a block diagram of an encoder according to at least one embodiment of the invention. The encoder is represented by connected modules, and each module is suitable for, for example, in the form of program instructions to be executed by the CPU 311 of the device 300 to implement an image encoding sequence of images according to one or more embodiments of the present invention At least one corresponding step of the method of at least one embodiment. The encoder 400 receives as input the original sequence 401 of digital images i0 to in. Each digital image is represented by a set of samples called pixels. After performing the encoding process, the encoder 400 outputs the bit stream 410. The bit stream 410 includes a plurality of coding units or slices. Each slice includes a slice header and a slice body. The slice header is used to send coded values used to encode the coding parameters of the slice. The slice body includes the encoded video. data. The module 402 divides the input digital images i0 to in 401 into a plurality of pixel blocks. The blocks correspond to the image part, and may have variable sizes (for example, 4×4, 8×8, 16×16, 32×32, 64×64, 128×128 pixels, and several rectangles may also be considered Block size). Select an encoding mode for each input block. Two series of coding modes are provided: coding mode based on spatial prediction coding (Intra prediction), and coding mode based on temporal prediction (Inter coding, Merge, SKIP). The possible coding modes are tested. The module 403 implements intra prediction processing in which a given block to be encoded is predicted by a predictor calculated from pixels of neighboring blocks of the block to be encoded. If intra coding is selected, the indication of the selected intra predictor and the difference between the given block and its predictor are coded to provide a residual. Time prediction is realized by the motion estimation module 404 and the motion compensation module 405. First, the motion estimation module 404 selects a reference image from a set of reference images 416, and selects a part of the reference image, also referred to as a reference area or image portion, which is closest to a given block to be encoded area. The motion compensation module 405 then uses the selected region to predict the block to be encoded. The motion compensation module 405 calculates the difference between the selected reference area and a given block, also called a residual block. The selected reference area is indicated by the motion vector. Therefore, in both cases (spatial and temporal prediction), the residual is calculated by subtracting the prediction from the original block. In the INTRA prediction realized by the module 403, the prediction direction is coded. In temporal prediction, at least one motion vector is encoded. If inter prediction is selected, information about motion vectors and residual blocks is encoded. To further reduce the bit rate, assuming that the motion is uniform, the motion vector is encoded by the difference with respect to the motion vector predictor. The motion vector predictor and encoding module 417 obtains a set of motion vector predictors from the motion vector field 418. The encoder 400 further includes a selection module 406 for selecting an encoding mode by applying encoding cost standards, such as rate-distortion standards. To further reduce redundancy, the conversion module 407 applies conversion (such as DCT) to the residual block, and then quantizes the obtained converted data through the quantization module 408, and entropy encodes through the entropy encoding module 409. Finally, the encoded residual block of the current block being encoded is inserted into the bitstream 410. The encoder 400 also performs decoding of the encoded image in order to generate a reference image for motion estimation of subsequent images. This enables the encoder and decoder receiving the bitstream to have the same reference frame. The inverse quantization module 411 performs inverse quantization of the quantized data, and then performs inverse conversion through the inverse conversion module 412. The intra prediction module 413 uses prediction information to decide which predictor to use for a given block, and the motion compensation module 414 actually adds the residual obtained through the module 412 to the reference obtained from the set of reference images 416 area. Then post-filtering is applied by module 415 to filter the frame of reconstructed pixels. In an embodiment of the present invention, an SAO loop filter is used, in which a compensation offset is added to the pixel values of reconstructed pixels of the reconstructed image. 5 is a flowchart illustrating the steps of the loop filter process according to at least one embodiment of the present invention. In the initial step 51, the encoder generates a full frame reconstruction. Next, in step 52, a deblocking filter is applied to this first reconstruction, so as to generate a deblocked reconstruction 53. The purpose of the deblocking filter is to remove block artifacts generated by residual quantization and block motion compensation or block intra prediction. These artifacts are visually important at low bit rates. The deblocking filter operates to smooth the block boundary according to the characteristics of two adjacent blocks. Consider the encoding mode of each block, the quantization parameter used for residual encoding, and the neighboring pixel difference of the boundary. The same criteria/classification is applied to all frames, and no additional data is transmitted. The deblocking filter improves the visual quality of the current frame by removing block artifacts, and also improves motion estimation and motion compensation for subsequent frames. In fact, the high frequencies of block artifacts are removed, so these high frequencies do not need to be compensated by the texture residuals of subsequent frames. After the deblocking filter, in step 54 the SAO parameters determined according to the embodiment of the invention are used to filter the deblocking reconstruction through a sample adaptive offset (SAO) loop filter. Then in step 56, the obtained frame 55 may be filtered by an adaptive loop filter (ALF) to generate a reconstructed frame 57 which will be displayed and used as a reference frame for subsequent Inter frames. In step 54, each pixel of the frame area is classified into a class or group. The same offset value is added to each pixel value belonging to a certain class or group. The derivation of the SAO parameters of the sample adaptive offset filtering in different embodiments of the present invention will be explained in more detail with reference to FIGS. 12 to 38. 6 shows a block diagram of a decoder 60 according to an embodiment of the present invention, which can be used to receive data from an encoder. The decoder is represented by connected modules, each module being adapted to implement the corresponding steps of the method executed by the decoder 60 in the form of program instructions to be executed by the CPU 311 of the device 300, for example. The decoder 60 receives a bit stream 61 containing coding units, each coding unit consisting of a header containing information of coding parameters and a body containing coded video data. As explained with respect to FIG. 4, the encoded video data is entropy encoded, and for a given block, the index of the motion vector predictor is encoded on a predetermined number of bits. The encoded video data received is entropy decoded by the module 62. The residual data is then dequantized by module 63, and then inverse conversion is applied by module 64 to obtain pixel values. Entropy decoding of mode data indicating the coding mode will also be performed, and based on the mode, INTRA type decoding or INTER type decoding is performed on the blocks of the encoded image data. In the case of INTRA mode, the intra prediction module 65 determines the INTRA predictor according to the intra prediction mode specified in the bit stream. If the mode is INTER, the motion prediction information is extracted from the bit stream in order to find the reference area used by the encoder. The motion prediction information consists of the reference frame index and the motion vector residual. The motion vector predictor is added to the motion vector residual by the motion vector decoding module 70 to obtain a motion vector. The motion vector decoding module 70 applies motion vector decoding to each current block encoded by motion prediction. Once the index of the motion vector predictor for the current block is obtained, the actual value of the motion vector associated with the current block can be decoded and used to apply reverse motion compensation by the module 66. The reference image portion indicated by the decoded motion vector is extracted from the reference image 68 to apply reverse motion compensation 66. The motion vector field data 71 is updated with the decoded motion vector for use in the inverse prediction of the subsequent decoded motion vector. Finally, the decoded block is obtained. The post filtering is applied by the post filtering module 67, which is similar to the post filtering module 815 applied to the encoder as described with reference to FIG. Finally, the decoder 60 provides the decoded video signal 69. The purpose of SAO filtering is to increase the quality of reconstructed frames by sending additional data in the bit stream, as opposed to deblocking filters that do not transmit information. As described above, each pixel is classified into a predetermined class or group, and the same offset value is added to each pixel sample of the same class/group. For each category, an offset is encoded in the bitstream. There are two SAO types for SAO loop filtering: Edge Offset (EO) type and Band Offset (BO) type. Examples of edge offset types are shown schematically in FIGS. 7A and 7B, and examples of band offset types are shown schematically in FIG. 8. In HEVC, SAO filtering is applied per CTU. In this case, on the encoder side, parameters for which SAO filtering needs to be performed (SAO parameter group) are selected for each CTU, and on the decoder side, necessary parameters are decoded and/or derived for each CTU. This provides the possibility to easily encode and decode video sequences by processing each CTU simultaneously without introducing delays when processing the entire frame. In addition, when SAO filtering is enabled, only one SAO type is used: an edge offset type filter or a band offset type filter is used depending on the relevant parameters transmitted in the bitstream for each classification. In HEVC, one of the SAO parameters is the SAO type parameter sao_type_idx, which indicates to the CTU whether the EO type, BO type, or no SAO filtering is selected for the relevant CTU. For example, for a given CTU, you can copy the SAO parameters from the top or left CTU instead of transmitting all SAO data. One of the SAO parameters in HEVC is the sao_merge_up flag. When this flag is set, the SAO parameter indicating the target CTU should be copied from the above CTU. The other one of the SAO parameters in HEVC is the sao_merge_left flag. When this flag is set, the SAO parameter indicating the target CTU should be copied from the left CTU. SAO filtering can be applied independently for different color components of the frame (eg, YUV). For example, a set of SAO parameters can be provided for the luma component Y, and another set of SAO parameters can be provided for the two chroma components U and V together. Also, within the set of SAO parameters, one or more SAO parameters can be used as common filtering parameters for two or more color components, while the other SAO parameters are dedicated (per component) filtering parameters for color components . For example, in HEVC, the SAO type parameter sao_type_idx is common to U and V, and the EO class parameter indicating a class used for EO filtering is also (see below), while indicating a group used for BO filtering The BO class parameters of the class have dedicated (per component) SAO parameters for U and V. A description of the type of edge offset in HEVC is now provided with reference to FIGS. 7A and 7B. The edge offset type involves determining the edge index of each pixel by comparing the pixel value of the pixel with the values of two adjacent pixels. In addition, the two adjacent pixels depend on a parameter indicating the direction of the two adjacent pixels with respect to the current pixel. These directions are 0 degrees (horizontal direction), 45 degrees (diagonal direction), 90 degrees (vertical direction), and 135 degrees (second diagonal direction). These four directions are shown schematically in FIG. 7A. The table of FIG. 7B shows the offset value to be applied to the pixel value of a specific pixel "C" according to the values of two adjacent pixels Cn1 and Cn2 on the decoder side. When the value of C is smaller than the two values of the adjacent pixels Cn1 and Cn2, the offset value to be added to the pixel value of the pixel C is "+O1". When the pixel value of C is less than one of its neighbors (Cn1 or Cn2) and C is equal to a value of its neighbor, the offset to be added to the sample value of this pixel is "+O2". When the pixel value of C is less than one of its neighbors (Cn1 or Cn2) and the pixel value of C is equal to one of its neighbors, the offset to be added to this pixel sample is "-O3" . When the value of C is greater than the two values of Cn1 or Cn2, the offset to be added to this pixel sample is "-O4". When the current sample and its neighbors do not satisfy any of the above conditions, no offset value is added to the current pixel C, as described by the edge index value "2" in the table. It is worth noting that for the specific case of the edge offset type, the absolute value of each offset (O1, O2, O3, O4) is encoded in the bitstream. The sign to be applied to each offset depends on the edge index (or Edge Index in the HEVC specification) to which the current pixel belongs. According to the table represented in FIG. 7B, for edge index 0 and for edge index 1 (O1, O2), a positive offset is applied. For edge index 3 and edge index 4 (O3, O4), a negative offset is applied to the current pixel. In the HEVC specification, in the four directions of FIG. 7A, the direction of the edge shift is specified in the bitstream by the "sao_eo_class_luma" field of the luma component and the "sao_eo_class_chroma" fields of the two chroma components U and V. The SAO edge index corresponding to the index value is obtained by the following formula: EdgeIndex = sign (C-Cn2)-sign (Cn1- C) +2 Among them, the definition of the function sign (.) is given by the following relationship sign(x) = 1, when x>0 sign(x) = -1, when x<0 sign(x) = 0, when x=0. To simplify the determination of the edge offset for each pixel, the difference between the pixel value of C and the pixel values of its two neighboring pixels Cn1 and Cn2 can be shared by the current pixel C and its neighbors. In fact, when applying the SAO edge offset filtering using the raster scan sequence of pixels of the current CTU or frame, the term sign (Cn1-C) has been calculated for the previous pixels (to be precise, when When the current pixel C'at a time is the current neighboring pixel Cn1 and the neighboring pixel Cn2' is the current current pixel C, it is calculated as C'-Cn2' at that time). Therefore, it is not necessary to calculate sign (cn 1- c). A description of the type of offset is now provided with reference to FIG. 8. The type of band offset in SAO also depends on the pixel value of the sample to be processed. The class in the SAO band offset is defined as the range of pixel values. Traditionally, for all pixels in the range, the same offset is added to the pixel value. In the HEVC specification, for each reconstructed block or frame region (CTU) of a pixel, the number of offsets with an offset filter is four, as shown schematically in FIG. 8. An implementation of SAO with offset divides the entire range of pixel values into 32 equal-sized ranges. These 32 ranges are SAO band offset bands (or classes). The minimum value of the pixel value range is systematically 0, and the maximum value depends on the bit depth of the pixel value according to the following relationship Max = 2 Bitdepth -1. Classify pixels into 32 ranges at full intervals including classifying pixel values to quickly achieve the required 5-bit check, ie, only the first 5 bits (5 most significant bits) are checked to classify pixels to 32 of the full range One of the categories/ranges. For example, when the bit depth is 8 bits per pixel, the maximum value of the pixel may be 255. Therefore, the range of pixel values is between 0 and 255. For this 8-bit bit depth, each band or class contains 8 pixel values. According to the HEVC specification, a group of bands 40 represented by a gray area (40) is used, the group has four consecutive bands 41, 42, 43 and 44, and information is sent in the bit stream to identify the position of the group, For example, the position of the first band of the four bands. The syntax element indicating this position is the "sao_band_position" field in the HEVC specification. This corresponds to the start 41 of the band in FIG. 8. According to the HEVC specification, signaling in the bit stream corresponds to 4 offsets of 4 bands. 9 is a flowchart illustrating the steps of the process of decoding SAO parameters according to the HEVC specification. The process of FIG. 9 is applied to each CTU to generate a set of SAO parameters for all elements. To avoid coding a set of SAO parameters per CTU (which is very expensive), a prediction scheme is used for CTU mode. This prediction mode involves checking whether the CTU to the left of the current CTU uses the same SAO parameters (this is specified in the bitstream through a flag called "sao_merge_left_flag"). If not, a second check is performed on the CTU above the current CTU (this is specified in the bitstream through the flag named "sao_merge_up_flag"). This prediction technique enables the amount of data representing SAO parameters used in the CTU mode to be reduced. The steps of the process are explained below. In step 503, "sao_merge_left_flag" is read from the bit stream 502 and decoded. If its value is true, the process proceeds to step 504, where the SAO parameters of the left CTU are copied for the current CTU. This enables in step 508 to determine the type of SAO filter used for the current CTU for YUV. If the result is negative in step 503, "sao_merge_up_flag" is read from the bit stream and decoded. If its value is true, the process proceeds to step 505, where the SAO parameters of the above CTU are copied for the current CTU. This enables the type of SAO filter used for the current CTU to be determined in step 508. If the result in step 505 is negative, then in step 507, the SAO parameter for the current CTU is read and decoded from the bit stream for the luminance Y component of this type and the two U and V components (501) (551) ). Chromaticity shift is independent. The details of this step will be described later with reference to FIG. 10. After this step, in step 508 parameters are acquired and the type of SAO filter is determined. In the subsequent step 511, a check is performed to determine whether the three color components (Y and U&V) for the current CTU have been processed. If the result is yes, the determination of the SAO parameters for the three components has been completed and the next CTU can be processed in step 510. Otherwise, (only Y is processed) U and V are processed together, and the process restarts from the initial step 512 previously described. FIG. 10 is a flowchart illustrating the steps of the process of parsing the SAO parameters in the bit stream 601 on the decoder side. In the initial step 602, the "sao_type_idx_X" syntax element is read and decoded. The codeword representing this syntax element can use a fixed-length code, or any arithmetic coding method can be used. The syntax element sao_type_idx_X can determine the type of SAO applied to the frame area to be processed for the color component Y or for the two chroma components U and V. For example, for the YUV 4:2:0 sequence, two components are considered: one for Y, and one for U and V. "Sao_type_idx_X" can take the following three values according to the type of SAO encoded in the bit stream. '0' corresponds to no SAO, '1' corresponds to the band offset case shown in Fig. 8 and '2' corresponds to the edge offset filter shown in Figs. 3A and 3B. Incidentally, only the YUV color components (sometimes called Y, Cr, and Cb components) are used in HEVC, but it should be understood that in other video encoding schemes, other color components may be used, such as RGB colors Weight. The technique of the present invention is not limited to using YUV color components, and RGB color components or any other color components may be used. In the same step 602, a test is performed to determine whether "sao_type_idx_X" is strictly positive. If "sao_type_idx_X" is equal to "0", it means that no SAO is used for Y of this frame area (CTU), if X is set equal to Y; and no SAO is used for U and V of this frame area, if X is set equal to U and V. The determination of the SAO parameters is completed, and the process proceeds to step 608. In addition, if "sao_type_idx" is strictly positive, it means that there is a SAO parameter for this CTU in the bitstream. The process then proceeds to step 606, where four iterations of the loop will be performed. The four iterations are performed in step 607, where the absolute value of offset j is read and decoded from the bit stream. These four offsets correspond to the absolute values of the four offsets (O1, O2, O3, O4) of the four edge indexes of the SAO edge offset (see Figure 7B), or to the offset from the SAO band (see Figure 8) The absolute values of the four offsets related to the four ranges. It should be noted that for the encoded SAO offset, the first part is transmitted in the bit stream, which corresponds to the absolute value of the offset. The absolute value is encoded with a unary code. The maximum value of the absolute value is given by the following formula: MAX_abs_SAO_offset_value = (1 << (Min(bitDepth, 10)-5))-1 Where << is the left (bit) shift operator. This formula means that for an 8-bit pixel value bit depth, the maximum absolute value of the offset is 7, and for a pixel value bit depth of 10 bits or more, the maximum absolute value of the offset is 31. The current amendments to the HEVC standard that address augmented bit depth video sequences provide similar formulas for pixel values with bit depths above 12 bits. The decoded absolute value may be a quantized value, which is dequantized before being applied to the pixel value at the decoder for SAO filtering. An indication to use or not to use this quantization is transmitted in the slice header. For the edge offset type, only the absolute value is transmitted because the sign can be inferred as explained before. For the offset type, if the absolute value of the offset is not equal to 0, the symbol is sent in the bit stream as the second part of the offset. When using CABAC, the sign bit is skipped. After step 607, the process proceeds to step 603, where a test is performed to determine whether the type of SAO corresponds to the band offset type (sao_type_idx_X == 1). If the result is positive, the symbols used for offset with offset mode are decoded in steps 609 and 610, except for each offset with a value of zero, then the following step 604 is performed to read the bit stream and decode The position of the SAO band "sao_band_position_X" is shown in FIG. 8. If the result is negative in step 603 ("sao_type_idx_X" is set equal to 2), this indicates that the edge offset type is used. Therefore, an edge offset class (corresponding to directions of 0, 45, 90, and 135 degrees) is extracted from the bit stream 601 in step 605. If X is equal to Y, the syntax element is read as "sao_eo_class_luma", and if X is set equal to U and V, the syntax element is read as "sao_eo_class_chroma". When the four offsets have been decoded, reading the SAO parameters is complete, and the process proceeds to step 608. FIG. 11 is a flowchart illustrating how to perform SAO filtering on the video portion according to the HEVC specification, for example, during step 67 in FIG. 6. In HEVC, this video part is CTU. This same process 700 is also applied in the decoding loop at the encoder (step 415 in FIG. 4) in order to generate reference frames for motion estimation and compensation of subsequent frames. This process is related to SAO filtering for one color component (hence the suffix "_X" in the syntax element has been omitted below). The initial step 701 includes determining the SAO filtering parameters according to the processes depicted in FIGS. 9 and 10. The encoder determines the SAO filtering parameters and includes the encoded SAO parameters in the bitstream. Therefore, in step 701, on the decoder side, the decoder reads and decodes the parameters from the bit stream. Step 701 obtains sao_type_idx, and if it is equal to 1, it also obtains sao_band_position 702, and if it is equal to 2, it also obtains sao_eo_class_luma or sao_eo_class_chroma (depending on the color component being processed). If the element sao_type_idx is equal to 0, SAO filtering is not applied. Step 701 also obtains an offset table 703 for 4 offsets. In step 704, the variable i for each pixel Pi that continuously considers the current block or frame region (CTU) is set to 0. Incidentally, in this manual, "frame area" and "image area" can be used interchangeably. The frame area in this example is the CTU in the HEVC standard. In step 706, pixels are extracted from the frame area 705 containing N pixelsP i . In step 707, pixels are classified according to the edge offset classification described with reference to FIGS. 7A and 7B or the band offset classification as described with reference to FIG. 8P i . Decision module 708 testP i Whether it is in the class to be filtered using traditional SAO filtering. IfP i Yes, in the filtered class, the relevant class number j is identified, and the relevant offset value is extracted from the offset table 703 in step 710Offset j . In the case of conventional SAO filtering, in step 711, thisOffset j Is then added to the pixel valueP i To generate filtered pixel values
Figure 02_image001
712. This filtered pixel
Figure 02_image001
In step 713, the filtered frame area 716 is inserted. IfP i Is not in the class to be SAO filtered, then in step 713 will beP i (709) The filtered frame area 716 is inserted without filtering. After step 713, the variable i is incremented in step 714 in order to filter the subsequent pixels of the current frame area 705 (if any-test 715). When all pixels have been processed in step 715 (i>=N), the filtered frame area 716 is reconstructed and can be added to the SAO reconstructed frame (see frame 68 of FIG. 6 or 416 of FIG. 4). As mentioned above, the JVET exploration model (JEM) for the future VVC standard uses all HEVC tools. One of these tools is sample adaptive offset (SAO) filtering. However, SAO is less efficient in JEM reference software than in HEVC reference software. This is due to the fact that it has less evaluation and lower efficiency than other loop filters. The embodiments of the present invention described below aim to derive the one or more SAO parameters of the collocated image part in the reference image and the image part in the current image by using various techniques to derive the image part of the image part in the current image One or more SAO parameters to improve the coding efficiency of SAO. These techniques may be referred to as temporal derivation techniques for SAO parameters. The other embodiments described below aim to use one or more SAO parameters of another image part of the same image to derive one or more SAO parameters of one image part in the same image by using various techniques to improve SAO encoding effectiveness. These techniques may be referred to as spatial derivation techniques for SAO parameters. The first group of examples The first group of embodiments focuses on improving the signaling efficiency. In HEVC, SAO filtering is performed per CTU. Time derivation of SAO parameters is not used in HEVC. In the first set of embodiments, time derivation is introduced. However, in order to improve the transmission efficiency, a group of image parts is formed, and signaling using time prediction is issued for the group of image parts instead of individually for each image part. For each image part of the group, at least one SAO parameter of the co-located image part in the reference image is derived using time to derive at least one of the SAO parameters of the image part. The co-located video part in the reference video is therefore the source video part of the video part to be derived. Thus, different image parts of the group may have different SAO parameters, depending on the SAO parameters of the individual co-located image parts. Therefore, with very light signaling, image parts belonging to a given set of image parts can be derived using time and benefit from different (and efficient) SAO parameters. Here, a group may be any two or more CTUs, for example, an entire image, a slice, a row of CTUs, a column of CTUs, N rows of CTUs, and N columns of CTUs, where N is an integer greater than 1. A group may also be N×N CTUs, where N is an integer greater than 1, or M×N CTUs or N×M CTUs, where M ≥ 1 and N> 1. Alternatively, a group of video parts may be a CTU, and each block of the CTU may be a video part. In this case, each block of the CTU may have its own SAO parameters, but the time-derived signaling using the SAO parameters can be performed for the CTU as a whole. In the simplest case where there is only one type of time derivation, the flag temporal_merge can be used to signal the use of time derivation for all image parts of the group. Except that at least one SAO parameter of the image part belonging to the group is derived from the SAO parameter of the co-located image part in the reference image, the manner of deriving the SAO parameter in the time derivation is not particularly limited. In the simplest case, at least one SAO parameter of the image part belonging to the group is derived from the SAO parameter of the co-located image part by copying the SAO parameter of the co-located image part. You can copy one, more than one, or all SAO parameters. Alternatively, one, more than one, or all SAO parameters can be copied only if the SAO filtering is of a specific type (edge or band). Instead of copying, time derivation of SAO parameters involving modification of one, more than one, or all SAO parameters of the co-located image part (source image part) may also be used, as described later. First embodiment In the first embodiment, the part of the image group is the entire image. Referring now to FIG. 12, each CTU of the current image 2001 temporally derives its SAO parameters from the co-located CTUs in the reference image 2002. For example, the SAO parameters of CTU 2003 in the current image 2001 are obtained by copying the SAO parameters of CTU 2005 in the reference image 2002 that are co-located with CTU 2003. Similarly, the SAO parameters of CTU 2004 in the current image 2001 are obtained by copying the SAO parameters of CTU 2006 in the reference image 2002 that are co-located with CTU 2004. In this example, CTU 2005 uses 0 degree EO filtering and CTU 2006 uses BO filtering. As a result of copying SAO parameters from CTU 2005, CTU 2003 also uses EO filtering in the 0 degree direction. As a result of copying SAO parameters from CTU 2006, CTU 2004 also uses BO filtering. Although not shown in FIG. 12, in this embodiment, all SAO parameters are copied, including the SAO type parameter sao_type_idx, such as EO_class (specifying the direction of EO filtering) and the BO group sao_band_position (specifying the first class in a set of categories ) Parameters and offsets. It can be seen that different CTUs within the same CTU group, such as CTU 2003 and CTU 2004, can have different SAO parameters, although the use of time derivation is only sent once for the entire CTU group (in this embodiment, the entire image) . Incidentally, in some video coding systems, including HEVC, different images may be subject to different partitions and be divided into multiple image parts (multiple LCUs, multiple CTUs, multiple CTBs, etc.). Therefore, the current image 2001 and its reference image 2002 may have different divisions. In this case, for example, between the CTU 2003 in the current image 2001 and its "co-located" CTU 2005 in the reference image 2002, the size and/or location may not match exactly. However, this is not a problem, as long as there is a suitable mechanism (known to the encoder and decoder) to associate the CTU in the current image 2001 with the "co-located" CTU in the reference image. For example, the mapping can identify the CTU in the reference image that is closest to the position of the CTU in the current image. The closest position may be based on any suitable reference position in the relevant CTU, such as the upper left position of each CTU. FIG. 13 is a flowchart for explaining the method of decoding video in the first embodiment. In step 2101, the first syntax element is read from the bit stream 2103 and decoded. The first syntax element in this example is a simple temporal_merge flag, which indicates whether temporal derivation of SAO parameters is to be used for the entire image. In step 2102, it is checked whether the syntax element indicates that time derivation is to be used. If the result is "yes", at least a second syntax element is extracted from the bit stream. This second syntax element is the reference frame index refidx, which identifies the reference image to be used for temporal derivation. If bidirectional temporal prediction is used, the third syntax element is extracted from the bitstream 2103. This is the list index Ly, which indicates whether the reference frame index is from list 0 (L0) or from list 1 (L1). In this embodiment, the same reference frame is used for the time derivation of SAO parameters in all CTUs of the group (entire image). In the context of temporal prediction, the reference image represents another image (previous or future image) used in the image sequence to perform temporal prediction for the image to be encoded. In the context of SAO parameter derivation, the reference image represents another image (previous or future image) used to perform the time derivation of the SAO parameter in the sequence. The reference image used for temporal derivation of SAO parameters may be the same as the reference image used for temporal prediction, or may be different. Incidentally, the HEVC specification uses the term "reference frame" instead of "reference image", and refidx is often referred to as the reference frame index accordingly. In this specification, the terms "reference image" and "reference frame" are used interchangeably. Then in step 2105, the loops of all the CTUs in the video are traversed. In this embodiment, the decoder has a storage unit 2106, which can be called a decoded picture buffer (DPB), which stores the SAO parameters of each CTU in the reference image. Preferably, DPB 2106 explicitly stores the SAO parameters of each CTU without relying on merge flags such as merge_up and merge_left, because reading merge flags as part of the SAO parameters, time derivation increases complexity and slows derivation. In step 2107, the SAO parameters of the co-located CTU stored in the reference image identified by refidx or Ly and refidx in the DPB 2106 are obtained. Then set these to the SAO parameter 2108 of the current CTU. In this embodiment, it is assumed that the SAO parameters include specific SAO parameters for each color component X (Y, U, V), and the specific SAO parameters for the relevant color components are used in steps 2109-2111, for each color component in order Perform SAO filtering. As mentioned above, in other embodiments, the SAO parameters may be two or more components, such as U and V, shared, or a mixture of shared and dedicated (per component) SAO parameters may be used. After the processing of the current CTU is completed, the processing moves to the next CTU, or if the current CTU is the last CTU of the image, the processing is ended. It should be understood that, in step 2107, if the co-located CTU does not use SAO filtering (sao_type_idx = 0), the SAO parameter cannot be obtained from the co-located CTU in the reference image. This case will be dealt with in the subsequent embodiments. This means that even if the time derivation of SAO parameters is applied to a group of image parts in the present invention, there may be some image parts in the group that do not derive SAO parameters from the SAO parameters of the respective co-located image parts. For example, in the simplest case, SAO filtering may not be performed on the image part where SAO parameters cannot be obtained using time derivation. Although not shown in FIG. 13, if the test result in step 2012 is that the SAO parameter derivation is not a time derivation, the STU parameters of the CTU of the group (in this case, the entire image) are read from the bit stream, for example, using Figure 5 process. Figure 13 is about the steps performed on the decoder side. These steps involve reading and decoding the syntax elements of the set of image parts (in this case the entire image) from the bitstream, and then performing SAO filtering on the set of image parts. On the encoder side, the same SAO filtering as the decoder side is performed on the video part of the group to ensure that the encoder has the same reference video as the decoder. This means using the same SAO parameter derivation as the decoder, and using the same reference image as the decoder for time derivation. However, on the encoder side, there is no need to read and decode syntax elements from the bitstream, because relevant information is already available in the encoder. In this embodiment, it is determined on the encoder side whether to use temporal derivation of SAO parameters for the group (in this case the entire image). Similarly, the reference image for time derivation is selected on the encoder side. In a modification of the first embodiment, the reference image is only the first reference image of the first list L0. In this case, no syntax element is required to identify refidx and Ly, and step 2104 may be omitted. This removes some signaling and simplifies the decoder design. Second embodiment In the first embodiment, the part of the image group is the entire image. In the second embodiment, the group of video parts are slices. Therefore, it is possible to use the time derivation of SAO parameters in one slice of an image, but not in another slice of the same image. This can lead to SAO parameters better adapting to the image characteristics in different parts of the image, at the cost of a slight increase in signaling. The decoding is the same as described in connection with the first embodiment, except that the first syntax element indicates whether temporal derivation of SAO parameters is to be used for the slice (relative to the entire image), and the second syntax element (or a combination of the second and third syntax Element) Identify a reference image for temporal derivation of the SAO parameters of the CTU of the slice. Third embodiment In the first and second embodiments, a single reference frame is transmitted for a frame or slice (or, in a variant, it is inferred without signaling), and the SAO parameter of the CTU of the frame or slice must come from the reference frame. Since only one reference frame is used, the number of CTUs using SAO for the co-located CTUs in the one reference frame may be limited, resulting in limiting the number of CTUs that receive SAO filtering. In the third embodiment, the group is a slice. There is no reference frame sent in the slice header, but the SAO parameters of the CTU of the frame may come from different reference frames. 14 is a flowchart for explaining a method of decoding video in the third embodiment. In step 2201, the first syntax element is read from the bit stream 2103 and decoded. This first syntax element indicates whether temporal derivation of SAO parameters is to be used for slices or for the entire image. In step 2202, it is checked whether the syntax element indicates that time derivation is to be used. Although not shown in FIG. 14, if the result of the check in step 2202 is that the SAO parameter derivation is not a time derivation, the SAO parameters of the CTUs of the group (in this case, slices) are read from the bit stream, for example, using the figure 5 process. Unlike the first embodiment, if the result is "Yes", no syntax elements are extracted from the bit stream (refer to frame index refidx). The list index Ly is also not extracted. Then, in step 2205, the first and outer loops of all CTUs of the current image are traversed. It also starts to traverse the second and inner loops of all possible reference frames from 0 to MAXrefidx in step 2203. The decoded image buffer (DPB) stores the SAO parameters for each CTU of all reference frames. In step 2207, for the co-located CTU in the reference image under consideration identified by refidx or Ly and refidx, the SAO parameters stored in the DPB 2106 are obtained. In the considered reference frame, the co-located CTU may not use SAO (sao_type_idx is "no SAO"). In this case, the SAO parameter cannot be obtained in step 2207. Step 2204 checks the result ("Yes"), and if it is, the second loop moves to the next reference frame. If the SAO parameters are obtained in step 2207 (the result is "No"), the second loop ends, and the obtained SAO parameters are used to perform SAO filtering on the three color components (in this embodiment, independent filtering, but such as Other variants are possible, as described in connection with the first embodiment). The test in step 2204 can be based on the luminance component only (ie, only for the luminance color component, is sao_type_idx "no SAO"), in which case, if the luminance component SAO parameter cannot be obtained, it is considered that it cannot be obtained from the reference frame under consideration SAO parameters for all three color components. Alternatively, in step 2204, each color component may be processed separately, or the luminance and the two chrominance components may be processed separately. The first loop continues one CTU after another, traversing all CTUs of the slice or frame. Compared with the first and second embodiments, this embodiment improves coding efficiency by increasing the number of CTUs subject to SAO filtering. In a variant, the reference frames in the respective lists L0 and L1 are ordered. In each ordered list, the first reference frame that is more likely to have useful SAO parameters than the second reference frame is placed before the second reference frame. In this variation, for example, the first reference frame may be the reference frame closest to the current frame. Alternatively, the first reference frame may be the frame with the best quality in the reference frame list. Any suitable quality measure can be used, for example, a quantisation parameter (QP) can be used as a measure of quality. In this case, the frame with the lowest QP can be selected as the first reference frame. The first reference frame may also be selected based on how often it is used for temporal prediction in the current slice or frame. This may be a good standard on the encoder side, but not for the decoder because it involves building statistics for the entire frame before applying SAO. Incidentally, usually the first reference in the first reference frame list is the most selected reference. This means that the first reference frame in each list is processed before the second reference frame, and the SAO parameters are preferentially picked from the first reference frame compared to the second reference frame. Preferably, in each list, the reference frames are sorted from best to worst according to coding efficiency. As mentioned above, in the third embodiment, different reference images can be used for the temporal derivation of SAO parameters for different image parts of the group. A specific reference image is identified by searching for a plurality of available reference images, and selecting reference images whose co-located image part satisfies at least one search condition. The search condition may be that the co-located image part uses SAO filtering. You can search for reference images in the order of highest encoding efficiency to lowest encoding efficiency. In this embodiment, the bitstream does not include information items that identify specific reference images. This saves messaging and simplifies the design. Both the encoder and the decoder can identify the same specific reference image by traversing all available reference images to perform the same search. Fourth embodiment In the third embodiment, regardless of whether the SAO type is BO or EO, the SAO parameters are derived in time. In the fourth embodiment, the SAO parameters are derived in time only when the SAO type is EO. This is because the EO type is usually more efficient than the BO type. This can be achieved by modifying step 2204 in FIG. 14 to check for "no SAO" or "BO" instead of just "no SAO". The search condition in the fourth embodiment is that the co-located image part uses edge type SAO filtering. In a variant, if for the target CTU, it is found that as a search result in the second loop starting at step 2203, no reference frame uses EO in the co-located CTU, a second search can be performed to traverse the reference frame to find Is there a co-located CTU using BO in one of those reference frames, in this case, BO can still be used for the time derivation of the target CTU. This variation results in using the first search condition to perform a first search for traversing available reference images, and if no available reference image satisfies the first search condition, using a second search condition different from the first search condition for performing traversal is available The second search of the reference image. The first search condition may be that the co-located image portion uses edge type SAO filtering, and the second search condition may be that the co-located image portion uses band type SAO filtering. Fifth embodiment In the foregoing embodiment, if the co-located CTU in the reference frame has "no SAO", or if no co-located CTU uses SAO in any reference frame among multiple reference frames, no SAO parameter can be obtained. In the fifth embodiment, in this case, a preset set of SAO parameters is used. This preset group may be determined by the encoder and transmitted to the decoder, for example, in a sequence parameter group or per slice. This is efficient because the preset group can be optimized by the encoder for sequences or for slices. Sixth embodiment In the second embodiment, the temporal derivation is determined for the slice, and the second syntax element identifies a single reference frame for SAO parameter derivation in the CTU of the slice. The second syntax element is at the slice level. However, when determining the time derivation for the slice, the syntax elements at the CTU level can be used instead to identify the reference frame for the SAO parameter derivation of the relevant CTU. This solution is adopted in the sixth embodiment. 15 is a flowchart for explaining a method of decoding video in the sixth embodiment. In step 2401, the first syntax element is read from the bit stream 2403 and decoded. This first syntax element indicates whether temporal derivation of SAO parameters is to be used for the slice. In step 2402, it is checked whether the syntax element indicates that time inference is to be used. If the result is "No", the process of FIG. 5 may be used, as has been described in conjunction with the first embodiment. If the result is "Yes", then in step 2405, traversal of all CTU loops of the current slice is started. For the current CTU, at least a second syntax element is extracted from the bitstream in step 2404. This second syntax element is the reference frame index refidx, which identifies the reference image to be used for temporal derivation. If bidirectional time prediction is used, the third syntax element is also extracted from the bitstream 2403 in step 2404. This is the list index Ly, which indicates whether the reference index is from list 0 (L0) or from list 1 (L1). In step 2407, the SAO parameters of the co-located CTU stored in the reference image identified by refidx or Ly and refidx in the DPB 2406 are obtained. Then set these to the SAO parameter 2408 of the current CTU. In this embodiment, it is assumed that the SAO parameters include specific SAO parameters for each color component X (Y, U, V), and the specific SAO parameters for the relevant color components are used in steps 2409-2411, for each color component in order Perform SAO filtering. As mentioned above, in other embodiments, the SAO parameters may be two or more components, such as U and V, shared, or a mixture of shared and dedicated (per component) SAO parameters may be used. After the processing of the current CTU is completed, in step 2412, the processing moves to the next CTU, or if the current CTU is the last CTU of the image, the processing ends. In the sixth embodiment, different reference images can be used for the temporal derivation of SAO parameters of different image parts in the group, as in the third embodiment. Unlike the third embodiment, the decoder does not have to search for a specific reference image, and the specific reference image is identified by the information items contained in the bit stream. This simplifies the decoder design. Seventh embodiment In the sixth embodiment, refidx or Ly and refidx are used to signal the reference frame of each CTU for SAO time derivation. This has the advantage that the transmission is the same as the traditional transmission of the reference frame used for temporal prediction. However, this way of sending SAO-time-derived reference frames is very expensive, because the list usually used for temporal prediction contains redundant frames. In fact, the reference frame can be in both lists L0 and L1. In addition, when using a weighted reference tool, the list can contain the same reference frame multiple times. There is no need to signal every occurrence of the same reference frame, and removing redundant frames can save the transmission rate associated with them. These redundancy can be removed by checking that each reference frame in the list has a POC (Picture Order Count) that is different from all other reference frames. In the seventh embodiment, a specific list of reference frames for SAO temporal derivation is created, which is different from the lists L0 and L1 for temporal prediction, and based on this specific list, for example, a syntax element SAO reference representing a reference frame is used frame index to send the reference frame for SAO time derivation for each CTU. Preferably, the specific list contains non-redundant reference frames. This is to reduce the code rate dedicated to the syntax element obtained in step 2404 of FIG. 15. It corresponds to the merge between the two lists L0 and L1. FIG. 16 is a flowchart illustrating a process of establishing a non-redundant list SAO_Ref_List of reference frames for SAO time derivation. In the first variant, this process is performed only in the encoder. In the second variant, both the encoder and the decoder perform this process. The list of reference frames (List L0 2501 and List L1 2502) is the input to this process. At the beginning of the process, SAO_Ref_List is empty. For each reference frame number i from 0 to the maximum number in the two lists (2503), step 2504 checks whether the reference frame number i Ref_i_L0 of list L0 is already in the reference frame list of SAO (SAO_Ref_List) (2508). If Ref_i_L0 is not in SAO_Ref_List, add Ref_i_L0 (2505) to SAO_Ref_List. In the same way, if the reference frame number i Ref_i_L1 of the list L1 does not already exist (2506), it is added to SAO_Ref_List (2507). In a first variant, SAO_Ref_List is explicitly signaled in the bitstream, for example in the slice header. In the second variant, the encoder does not send the SAO_Ref_List, but the decoder creates the same list by following the same list creation process as the encoder. The advantage of using the second variant is to avoid explicit signaling of the reference frame list for SAO at the slice level in order to reduce the bit rate of the slice header. However, for some applications, it is better to send this list explicitly. This can be particularly effective when SAO is disabled for certain reference frames of a given slice. The two variants have the following advantages: When each CTU sends a reference frame (as in step 2404 in FIG. 15), the syntax elements that represent the reference frame can be more compact and more effective, because the frames in SAO_Ref_List are higher than those in L0 and L1 There are fewer frames in the merge. In a variant, the maximum number of reference frames in the explicit signaling list SAO_Ref_List in the slice header. The advantage of this variant is to reduce the code rate of the syntax element dedicated to the reference frame in step 2404. In the process of FIG. 16, in step 2504 or in step 2506, the reference frame from L0 or L1 is added to the list SAO_Ref_List if it is new (not yet in the list). In another variation, only when SAO is enabled for at least one color component, a new reference frame is added to SAO_Ref_List, ie, the condition in step 2504 or 2506 is modified. For example, SAO can be independently disabled for each slice. In fact, there may be a first flag for disabling SAO at the slice level for luma components, and a second flag (common flag) for disabling SAO at the slice level for two chroma components or for all three The individual flag of the component. The advantage is that some unnecessary reference frames are omitted from the SAO_Ref_List, so that it is possible to reduce the transmission of the syntax elements representing the reference frames used for SAO obtained in step 2404. There are several options for encoding the syntax elements that represent the reference frame index used for SAO derivation in SAO_Ref_List. The first option is to encode syntax elements with fixed-length codes. The second option is to encode syntax elements with a unary maximum (max) code, where "maximum" is the number of reference frames in SAO_Ref_List. In the third option, arithmetic coding can be used. Arithmetic coding can be applied to the top-most unary maximum code of fixed-length codes. For the unary code or arithmetic coding options, the list of possible SAO parameter sets co-located with the current CTU in the previous reference frame of SAO_Ref_List, by checking whether SAO is enabled for each co-located CTU or whether the SAO parameter set is redundant, and Was reduced. This reduction can be achieved by comparing the SAO parameters in different SAO parameter sets, including the classification results (eg, edge direction sao_eo_class) and related offsets. In this case, the syntax element representing the reference frame for SAO derivation is the syntax element representing the position of the SAO parameter set in the reduced list. The advantage of this embodiment is that the set of possible SAO parameter sets is reduced, and when the unary maximum code is used, the number of code rates dedicated to its transmission is reduced. Another way is to use the exact number of bits required to signal which SAO parameter set was selected on the encoder side among the possible time SAO parameter sets. But in this case, without this SAO check, the bit stream is impossible to analyze, so it is not recommended for many video applications that use the Internet. The size of SAO_Ref_List will change from one slice to the next. If the number of bits of the index is also allowed to change, it can be efficient (some bits are saved when the size is below the maximum value), but the analysis in the decoder requires the decoder to reconstruct the SAO_Ref_List. In order to simplify the analysis of the bit stream when using list reduction, the encoder can signal the number of elements in the reduced SAO_Ref_List (ie the number of possible time SAO parameter sets) in the bit stream. This allows the decoder to know the amount of bits dedicated to indexed signaling without any list reduction before profiling. When the same reference image is used for all CTUs of a slice as in the second embodiment (step 2104 in FIG. 13), the possibilities described in connection with this embodiment are also applicable. In this case, since the list of reference images used for SAO time derivation (SAO_Ref_List) contains fewer reference images than the combination of L0 and L1, the reference image sent from the more concise list SAO_Ref_List is sent than the signal from L0 and L1. The reference image is also concise. As described above, the seventh embodiment creates a list of reference images for time derivation of SAO parameters based on one or more reference image lists used for temporal prediction of the image portion of the group, wherein the time from the time used for SAO parameters The derived list of reference images excludes one or more reference images from one or more temporal prediction lists. Then, a reference image for time derivation of SAO parameters is selected from the list of reference images for time derivation of SAO parameters. The redundant reference images in the one or more temporal prediction lists can be excluded from the list of reference images for temporal derivation of SAO parameters. Alternatively or additionally, the reference image whose individual parity portion does not use SAO filtering or whose individual parity portion does not use edge-type SAO filtering can be excluded from the list of reference images used for the temporal derivation of SAO parameters. It may be efficient to impose a maximum value on the number of reference images that can be included in the list of reference images for time derivation of SAO parameters. The decoder can create the same list of reference frames used for temporal derivation of SAO parameters as the encoder. In this case, there is no need to send the list in the bitstream, which can reduce the bit rate of the slice header. However, only the encoder can create a list of reference pictures for temporal derivation of SAO parameters based on one or more lists of reference pictures used for temporal prediction of the set of picture parts, and explicitly send the list of reference pictures for SAO List of reference images derived from the time of the parameter. When SAO is disabled for certain reference frames used for temporal prediction, this can still be efficient because the list of reference images used for temporal derivation of SAO parameters can be properly narrowed. Eighth embodiment The eighth embodiment relates to the encoding process. In the previous embodiment, the temporal derivation of SAO parameters is applied to a set of image parts. For example, in the first embodiment, time derivation is applied to the entire image. In the second embodiment, time derivation is applied to slices. In the eighth embodiment, when temporal derivation is not applied, non-temporal derivation of SAO parameters is used, where the SAO parameters are determined by the encoder for each image part (CTU) and signaled in the bitstream. This can be called CTU-level non-time derivation of SAO parameters. The decoder reads the first syntax element (for example, the temporal_merge flag) from the bit stream, and when it indicates that time derivation is not applied to the group, the decoder reads the SAO parameters of each CTU from the bit stream and according to the relevant CTU SAO parameters to filter each CTU, for example using the decoding process of FIG. 5. In the eighth embodiment, temporal derivation and CTU-level non-temporal derivation are available derivations, and the encoder selects one of them to apply to the group (eg, frame or slice). FIG. 17 is a flowchart illustrating a step of executing an encoder to determine the SAO parameters of a group (frame or slice) of CTUs in the CTU-level non-temporal derivation of SAO parameters. The process starts from the current CTU (1101). First, the statistics for all possible SAO types and categories are accumulated in the variable CTUStats (1102). The process of step 1102 is described below with reference to FIG. 18. According to the set of values in the variable CTUStats, if the CTU on the left is in the current slice, the RD cost of the SAO merge left (Merge Left) (1103) is evaluated, the same as the RD cost of the SAO merge (Merge UP) above (1104). Due to the statistics in CTUStats (1102), new SAO parameters evaluated for luminance (1105) and for two chroma components (1109). (Two chroma metrics, because in the HEVC standard, these chroma components share the same SAO type). For each SAO type (1006), the best RD offset and other parameters for the offset classification are obtained (1107). The edge and band classification of steps 1107 and 1110 are explained below with reference to FIGS. 19 and 20, respectively. Due to their individual SAO parameters, all RD costs are calculated (1108). In the same way for the two chroma components, the best RD offset and parameters are selected (1111). Compare all these RD costs in order to select the best SAO parameter set (1115). These RD costs are also compared to independently disable SAO for luminance and chrominance components (1113, 1114). Compare the use of the new SAO parameter set (1115) with the STU parameter set (1116) "merged" or shared from the CTU from the left and above. FIG. 18 is a flowchart illustrating an example of statistical data calculated on the encoder side that can be applied to an edge offset type filter in the case of conventional SAO filtering. A similar scheme can also be used for filters with offset type. Figure 18 illustrates the setting of the variable CTUStats, which contains all the information needed to derive each optimal rate distortion offset for each class. In addition, it illustrates the selection of the best SAO parameter set for the current CTU. For each color component Y, U, V (or RGB) (811), each SAO type is evaluated. For each SAO type (812), in the initial step 801, the variableSum j andSumNbPix j Set to zero. The current frame area 803 contains N pixels.j Is the current range number to determine the four offsets (related to the four edge indexes shown in Figure 7B for the edge offset type, or the 32 pixel values shown in Figure 8 for the offset type Scope related).Sum j Is the scopej The sum of the difference between the pixel in and its original pixel.SumNbPix j Is the number of pixels in the frame area, and its pixel value belongs to the rangej . In step 802, the variable i for continuously considering each pixel Pi of the current frame area is set to zero. Then, in step 804, the first pixel of the frame area 803 is extractedP i . In step 805, the class of the current pixel is determined by checking the conditions defined in FIG. 7B. Then in step 806 a check is performed. During step 806, a check is performed to determine the pixel valueP i Whether the class of corresponds to the value "None of the above" in FIG. 7B. If the result is yes, the value "i" is incremented in step 808 to consider the next pixel of the frame area 803. Otherwise, if the result is no in step 806, the next step is 807, in which the relevantSumNbPix j (Ie, the sum of the number of pixels of the class determined in step 805), and willP i Original value
Figure 02_image003
The difference betweenSum j . In the next step 808, the variable i is incremented so as to consider the next pixel of the frame area 803. Then perform a test to determine whether all pixels have been considered and classified. If the result is no, the process loops back to step 804 above. On the other hand, if the result is yes, the process proceeds to step 810, in which the current color component X and SAO type SAO_type and current classj The variable CTUStats is set equal toSum j For the first value andSumNbPix j Used for the second value. You can use these variables to calculate, for example, the best offset parameter for each class jOffset j . This offsetOffset j It may be the average of the difference between pixels of class j and their original values. therefore,Offset j It is given by the following formula:
Figure 02_image005
It should be noted that the offsetOffset j Is an integer value. Therefore, the ratio defined in this formula can be rounded to the nearest value or the top function or the floor function can be used for rounding. In terms of distortion, each offsetOffset j Ooptj is the best offset. To evaluate the RD cost of combining SAO parameters, the encoder will use the statistics set in the table CTUStats. According to the following SAO Merge Left example and considering the type of Luma Left_Type_Y and the four related offsets O_Left_0, O_Left_1, O_Left_2, O_Left_3, the distortion can be obtained by the following formula: Distortion_Left_Y = (CTUStats[Y][ Left_Type_Y][0][1] x O_Left_0 x O_Left_0-CTUStats[Y][ Left_Type_Y][0][0] x O_Left_0 x 2)>> Shift + (CTUStats[Y][ Left_Type_Y][1][1] x O_Left_1 x O_Left_1-CTUStats[Y][ Left_Type_Y][1][0] x O_Left_1 x 2)>> Shift + (CTUStats[Y][ Left_Type_Y][2][1] x O_Left_2 x O_Left_2-CTUStats[Y][ Left_Type_Y][2][0] x O_Left_2 x 2)>> Shift + (CTUStats[Y][ Left_Type_Y][3][1] x O_Left_3 x O_Left_3-CTUStats[Y][ Left_Type_Y][3][0] x O_Left_3 x 2)>> Shift Variable Shift is designed for distortion adjustment. Since SAO is post-filtering, the distortion should be negative. The same calculation is applied for the chroma component. For the three components, the Lambda (λ) of the rate distortion cost is fixed. For the SAO parameter combined with the left CTU, the rate is only one flag, which is CABAC encoded. In order to find the best offset in terms of rate distortion criteria, the offset called ORDj, the encoding process shown in FIG. 19 is applied. This process is applied in steps 1109 to 1112. In the initial step 901 of the encoding process of FIG. 19, the rate distortion value Jj is initialized to the maximum possible value. Then in step 902, an Oj loop from Ooptj to 0 is applied. Note that at each new iteration of the loop, Oj is changed by 1. If Ooptj is negative, the value Oj increases, and if Ooptj is positive, the value Oj decreases. In step 903, the rate distortion cost related to Oj is calculated according to the following formula: J(Oj)=SumNbPix j × Oj × Oj-Sumj × Oj × 2 + λ R(Oj) Where λ is the Lagrange parameter, and R(Oj) is a function of the number of bits required to provide the codeword associated with Oj. formula'SumNbPix j × Oj × Oj-Sumj × Oj × 2'gives an improvement in the distortion provided by using offset Oj. In step 904, if J(Oj) is lower than Jj, then Jj = J(Oj) and ORDj is equal to Oj. In step 905, if Oj is equal to 0, the loop ends and the best ORDj of class j is selected. The algorithms in Figures 18 and 19 provide the best ORDj for each class j. This algorithm is repeated for each of the four directions of FIG. 7A. Then, the direction (sum of Jj in each direction) that provides the best rate distortion cost is selected as the direction for the current CTU. This algorithm (Figures 18 and 19) for selecting the offset value on the encoder side of the edge offset tool can be easily applied to the band offset filter to select the best position (SAO_band_position), where j is in the interval [ 0,32], not in the interval [1,4] of FIG. 18. It involves changing the value 4 in modules 801, 810, 811 to 32. More specifically, for the 32 classes in Figure 8, calculate the parameter Sumj (j=[0,32]). This corresponds to the calculation for each range j, the current pixel value (Pi ) And its original value (Porgi ), each pixel in the image that belongs to a single range j. Then, using the same process as described in FIG. 19, the optimal offset in terms of rate distortion ORDj is calculated for 32 classes. The next step involves finding the optimal position of the SAO band position of Figure 8. This is determined through the encoding process shown in FIG. The encoding process of FIG. 19 has been used with the best offset ORDj in terms of rate distortion to calculate the RD cost Jj for each range. In FIG. 20, in the initial step 1001, the rate distortion value J is initialized to the maximum possible value. Then, in step 1002, a loop to 28 positions j of 4 consecutive classes is run. Next, in step 1003, the variable Jj corresponding to the RD cost of the (4 consecutive classes) band is initialized to 0. Then, in step 1004, a loop for four consecutive offsets j is run. In step 1005, Ji increases the RD cost of four classes Jj (j=i to i+4). If this cost Ji is lower than the optimal RD cost J, then in step 1007, J is set to Ji, and sao_band_position = i, and the next step is step 1008. Otherwise, the next step is step 1008. Test 1008 checks whether the loop to 28 positions has ended. If not, the process continues to step 1002, otherwise the encoding process returns the optimal band position as the current value of sao_band_position 1009. Therefore, the CTUStats table in the case where SAO parameters are determined at the CTU level is created through the process of FIG. 17. This corresponds to evaluating the CTU level in terms of the rate-distortion trade-off. This evaluation can be performed for the entire image or only for the current slice. Perform a further evaluation for time derivation. Again, this time derivation can be applied to the entire image or only to the current slice. FIG. 21 shows the time-derived RD cost evaluation at the slice level. First, the distortion of the current color component X is set equal to 0 (1601). For each CTU number nbCTU (1602) from 0 to LastCTU, the time SAO parameter set (1605) of the co-located CTU in the reference frame (Ly, refidx) is extracted (1604) from the DPB (1603). If the SAO parameter set (1605) is equal to OFF (no SAO), the next CTU is processed (1610). Otherwise, for each of the four offsets in sequence (1607), the distortion Distortion_TEMPORAL_X increases by an amount equal to the associated distortion of offset Oi (1609). This process is the same as the RD cost evaluation for merged SAO parameters as previously described. Please note that when the SAO type is equal to the edge type, set sao_band_position equal to 0. When all offset distortions have been added to Distortion_TEMPORAL_X (1608), the next CTU is processed (1610). When the number of CTU nbCTU is equal to lastCTU (1610), set the RDCost for the time pattern of component X at the slice level equal to the sum of the calculated distortion Distortion_TEMPORAL_X and λ multiplied by the code rate of this time pattern at the slice level (1611 ). The code rate is equal to the code rate of the time mode transmission plus (if necessary) the code rate of the reference frame index refIdx and if necessary the code rate of the list Ly. Then compare the two assessments and choose the one with the best effectiveness. Then, in the bit stream, for example, using the first syntax element described in connection with the second embodiment, the selected derivation (time or CTU level) is signaled to the decoder. Fig. 22 shows the competition between CTU stages for SAO and for time derivation on the encoder side. The current slice/frame 1901 is used to set the CTUStats table (1903) for each CTU (1902). This table (1903) is used to evaluate CTU-level derivation (1904) and time derivation (1915) for the entire slice, as described previously in FIG. 21. This table (1903) is also used to evaluate several reference frames for temporal derivation. The best derivation of the slice is selected according to the rate distortion criterion calculated for each available derivation (1910). The SAO parameter set for each CTU is set according to the derivation selected in step 1910 (1911). These SAO parameters are then used to apply SAO filtering (1913) in order to obtain filtered frames/slices. The selected derivation may be signaled in the slice header, for example, using a syntax element indicating time derivation (decoder read, see 2101 and 2201 in FIGS. 13 and 14). Ninth embodiment In the eighth embodiment, time derivation competes with an alternative non-time method of deriving SAO parameters. In the ninth embodiment, two alternative methods compete with time derivation. Fig. 23 shows various packets 1201-1206 of the CTU in the slice. The first packet 1201 has individual CTUs. This first packet requires a set of SAO parameters per CTU. It corresponds to the CTU-level derivation in the eighth embodiment. The second group 1202 makes all the CTUs of the entire video into a group. Therefore, contrary to the CTU-level derivation, all CTUs of a frame (and therefore slices of the entire frame or a portion thereof) share the same SAO parameters. In order for all CTUs of an image to share the same SAO parameters, one of two methods can be used. In both methods, the encoder first calculates a set of SAO parameters to be shared by all CTUs of the image. Then, in the first method, these SAO parameters are set for the first CTU of the slice. For each remaining CTU from the second CTU to the last CTU of the slice, if there is a flag (that is, if the current CTU has a left CTU), the sao_merge_left flag is set equal to 1. Otherwise, set the sao_merge_up flag equal to 1. 24 shows an example of a CTU with SAO parameter set according to the first method. This method has the advantage of not requiring signaling of packets to the decoder. Furthermore, there is no need to change the decoder to introduce packets, and only the encoder. Therefore, packets can be introduced in HEVC-based encoders without modifying the HEVC decoder. Surprisingly, the packet does not increase the code rate too much. This is because merge flags are usually CABAC encoded in the same context. Since these flags have the same value (1) for the second group (the entire image), the code rate consumed by these flags is very low. This is because they always have the same value and the probability is 1. In the second method of making all CTUs of the image share the same SAO parameters, the packet is sent to the decoder in the bit stream. For example, also in the slice header, the SAO parameter is sent as the SAO parameter for the packet (whole image). In this case, the packet transmission consumes bandwidth. However, the merge flag can be omitted, and the code rate associated with the merge flag can be saved in order to reduce the code rate overall. The first and second packets 1201 and 1202 provide very different rate-distortion trade-offs. The first packet 1201 is at an extreme. It controls the SAO parameters (CTU-by-CTU) very finely, which should reduce distortion, but at the cost of a lot of signaling. The second group is at the other extreme. It controls the SAO parameters (a group of the entire image) very roughly, which causes distortion but has very light signaling. Next, how to determine the SAO parameters of the second packet 1202 in the encoder will be explained. In the second grouping 1202, the determination is made for the entire image, and all CTUs of the slice/frame share the same SAO parameters. FIG. 25 is an example of setting the SAO parameters for the frame/slice level using the first method of sharing SAO parameters (ie, there is no new SAO classification on the encoder side). This diagram is based on Figure 17. At the beginning of the process, a CTUStats table is set for each CTU (in the same way as CTU-level coding selection). This CTUStats can be used for traditional CTU level (1302). Then set the table FrameStats (1303) by adding each value to all CTUs of the table CTUStats. Next, the same treatment as the CTU level is applied to find the best SAO parameters (1305 to 1315). In order to set the SAO parameters for all CTUs of the frame, the SAO parameter set selected in step 1315 is set for the first CTU of the slice/frame. Then, for each CTU from the second CTU to the last CTU of the slice/frame, if sao_merge_left_flag exists, set it equal to 1, otherwise set sao_merge_up_flag equal to 1 (actually for the second CTU to the last CTU , There is merge left or merge on or both) (1317). The syntax of the SAO parameter set is the same as the syntax shown in FIG. 9. At the end of the process, SAO parameters are set for the entire slice/frame. Therefore, the CTUStats table in the case where SAO parameters are determined for the entire image (frame level) is created through the process of FIG. 25. This corresponds to evaluating the frame level based on the rate-distortion trade-off. As previously described in conjunction with the eighth embodiment, the encoders also evaluate CTU-level non-temporal derivation and temporal derivation based on their individual rate-distortion tradeoffs. In this case, each evaluation is performed for the entire image. Then compare the three assessments and choose the one with the best effectiveness. The selected derivation (time or CTU level or frame level) is signaled to the decoder in the bit stream. The selected derivation can be signaled in many different ways. For example, the group index can be sent. Then, the first syntax element can still be used to signal whether the SAO parameters of all CTUs of the slice are derived in time (eg, the temporal_merge flag), supplemented by the packet index without using time derivation. For example, the CTU level may have a packet index of 0, and the frame level may have a packet index of 1. Alternatively, the first syntax element may be adapted to signal all content, for example, the CTU level and the frame level may have index 0 and index 1, respectively, and the time derivation may have another index, such as 2. In this case, in FIGS. 21, 22 and 24, the first syntax element is changed accordingly. The example of determining SAO parameters in FIG. 25 corresponds to the first method of sharing SAO parameters because it uses a merge flag to share the SAO parameters among all CTUs of the image (see steps 1316 and 1317). If the second method of sharing SAO parameters is used, these steps can be omitted. Incidentally, if the second method is used, and the merge flag is not used in the group (image), the process of FIG. 17 should be appropriately modified, in particular, the RD costs in 1103 and 1104 are not evaluated. Tenth embodiment In the eighth embodiment, CTU-level non-time derivation competes with time derivation. In the tenth embodiment, CTU-level non-time derivation is not available, and instead frame-level non-time derivation competes with time derivation. Eleventh embodiment The CTU level and frame level used in the ninth embodiment provide extreme rate-distortion trade-offs. It may also include other intermediate packets between the CTU level and the frame level, which may provide other rate-distortion trade-offs. Referring again to FIG. 12, the third group 1203 makes a list of CTUs into a group. FIG. 26 is an example of setting the SAO parameter set for the third packet 1203 on the encoder side. This diagram is based on Figure 17. In order to reduce the number of steps in the figure, the modules 1105 to 1115 have been merged into one step 1405 in FIG. 26. At the beginning of the process, the CTUStats table is set for each CTU. This CTUStats can be used for traditional CTU level (1302) encoding selection. For each column (1403) of the current slice/frame, for each CTU (1404) of the current column, the table ColumnStats is set by adding each value (1405) from CTUStats (1402). Then, regarding the CTU level (1406) coding selection (refer to FIG. 17), new SAO parameters are determined. If it is not the first column, the RD cost of sharing the SAO parameters with the previous left column (1407) is also evaluated in the same way as the SAO parameter set is shared between the left and upper CTUs (1103, 1104). If the shared SAO parameter gives a better RD cost than the RD cost of the new SAO parameter set (1408), set sao_merge_left_flag equal to 1 for the first CTU in the column. The address number of this CTU is equal to the value "Column". Otherwise, the SAO parameter set of the first CTU in this column is set equal to (1409) the new SAO parameter obtained in step 1406. For all other CTUs in this column (1411), set their SAO merge left sao_merge_left_flag equal to 0 (if it exists), and set SAO merge sao_merge_up_flag equal to 1. Then, the SAO parameter set of the next column can be processed (1403). Please note that all the CTUs of the frame have sao_merge_left_flag equal to 0 (if it exists) and sao_merge_up_flag equal to 1 except for the CTU in the first row. Therefore, step 1412 may be performed once per frame. The advantage of such CTU grouping is another RD trade-off between CTU-level coding choice and frame level, which may be useful for certain conditions. Furthermore, in this example, a merge flag is used within the group, which means that a third packet can be introduced without modifying the decoder (ie, the packet can be HEVC compatible). Of course, the second method of sharing SAO parameters described in the third embodiment may be used instead. In this case, the merge flag is not used in the group (CTU column), and steps 1411 and 1412 are omitted. In a variant, there is no need to check the merge between columns. This means that steps 1407, 1408, 1410 have been removed from the process of FIG. The advantages of removing this possibility are simplified implementation and the ability to parallelize the process. This has little effect on coding efficiency. Another possible intermediate compromise between the CTU level and the frame level can be provided by the fourth packet 1204 in FIG. 23, which makes a row of CTUs into a group. In order to determine the SAO parameters of this fourth group, a process similar to FIG. 25 can be applied. In this case, the variable ColumnStats is replaced by LineStats. Step 1403 is replaced by "For Line=0 to Num_CTU_in_Height". Step 1404 is replaced by "for CTU_in_line=0 to Num_CTU_in_Width". Step 1405 is replaced by ColumnStats[][][][] += CTUStats[Line* Num_CTU_in_Width + CTU_in_line][][][][]. Based on this LineStats table, the new SAO parameters and the merge with the above CTU are evaluated (steps 1406, 1407). Step 1410 is replaced by setting sao_merge_up_flag to 1 for the first CTU of the row. And, for all CTUs of the slice/frame (except for each first CTU of each line), sao_merge_left_flag is set equal to 1. The advantage of this line is another RD trade-off between CTU level and frame level. Note that frames or slices are rectangular in most cases, and their width is greater than their height. Therefore, it is expected that the row CTU packet 1204 is an RD compromise closer to the frame CTU packet 1202 than the column CTU packet 1203. As for the other CTU groups 1202 and 1203, if the merge flag is used in the group, the row CTU group may be HEVC compatible. As for the column CTU group 1203, the evaluation of combining 2 rows can be removed. By putting two or more columns of CTUs or two or more rows of CTUs together into a group, other RD trade-offs can be provided. The process of FIG. 25 can be applied to determine the SAO parameters of these groups. In one embodiment, the number N of columns or rows in a group may depend on the target grouping number. When a slice or frame is large (for HD, 4K, or higher), it may be particularly advantageous to use a number of rows or rows for CTU grouping. As mentioned earlier, in a variant, there is no need to evaluate the merge between these groups containing two or more columns or two or more rows. Another possible grouping includes split columns or split rows, where the split is suitable for the current slice/frame. Another possible compromise between the CTU level and the frame level can be provided by the square CTU packets 1205 and 1206 shown in FIG. Group 1205 groups 2x2 CTUs. Group 1206 groups 3x3 CTUs. FIG. 27 shows an example of how to determine SAO parameters for such grouping. For each NxN group (1503), the table NxNStats (1507) is set (1504, 1505, 1506) based on CTUstats. In addition to the RD cost of the SAO parameters shared on the left (1510) or shared above (1509), use this table to determine the new SAO parameters (1508) and their RD cost. If the best RD cost is the new SAO parameter (1511), the SAO parameter of the first CTU (upper left CTU) of the NxN group is set equal to this new SAO parameter (1514). If the best RD cost is to share SAO parameters with the above NxN group (1512), then set the sao_merge_up_flag of the first CTU (upper left CTU) of the NxN group equal to 1 and set sao_merge_left_flag to 0 (1515). If the best RD cost is to share SAO parameters with the left NxN group (1513), then set the sao_merge_left_flag of the first CTU (upper left CTU) of the NxN group equal to 1 (1516). Then, correctly set sao_merge_left_flag and sao_merge_up_flag for the other CTUs of the NxN group to form SAO parameters for the current NxN group (1517). Fig. 28 shows the settings of the 3x3 SAO group. The upper left CTU is set equal to the SAO parameters determined in steps 1508 to 1516. For the other 2 above CTUs, set sao_merge_left_flag equal to 1. Since sao_merge_left_flag is the first encoded or decoded flag and it is set to 1, there is no need to set sao_merge_up_flag to 0. For the other 2 CTUs in the first row, set sao_merge_left_flag equal to 0 and set sao_merge_up_flag equal to 1. For other CTUs, set sao_merge_left_flag equal to 1. The advantage of NxN CTU grouping is to create several RD tradeoffs for SAO. As for other groupings, if the merge flags within these groups are used, these groupings may be HEVC compatible. As for other groupings, in FIG. 27, the test of the merge left (Merge left) and merge above (Merge up) between the groups can be omitted. Therefore, steps 1509, 1510, 1512, 1513, 1515, and 1516 can be removed, especially when N is high. In a variant, the value N depends on the size of the frame/slice. The advantage of this embodiment is to obtain an effective RD trade-off. In a preferred variant, only N equals 2 and 3 are evaluated. This provides an effective compromise. The possible packets compete with each other and use time derivation as the SAO parameter derivation to be selected for the current slice. FIG. 29 shows an example of how to use rate-distortion trade-off comparison to select SAO parameter derivation. In this example, the first method of sharing SAO parameters among a set of CTUs is used. Therefore, merge flags are used within the group. If applied to HEVC, the resulting bitstream can be decoded through a HEVC compatible decoder. The current slice/frame 1701 is used to set the CTUStats table (1703) for each CTU (1702). Use this table (1703) to evaluate CTU level (1704), time derivation (1715), frame/slice grouping (1705), column grouping (1706), row grouping (1707), 2×2 CTU grouping (1708) or 3 ×3 CTU packet (1709) or all other CTU packets described above. The best derivation (non-time derivation or time derivation using CTU packets) is selected according to the rate distortion criterion calculated for each available derivation (1710). The SAO parameter set for each CTU is set (1711) according to the derivation selected in step 1710. These SAO parameters are then used to apply SAO filtering (1713) in order to obtain filtered frames/slices. The second method of sharing SAO parameters among the CTUs of the CTU group can be used instead of the first method. Both methods have the advantage of improving coding efficiency. The second advantage obtained when using the first method instead of the second method is that this competitive method does not require any additional SAO filtering or classification. In fact, the main impact on the complexity of the encoder is step 1702, which requires SAO classification for all possible SAO types and step 1713 of filtering samples. All other CTU packet evaluations are only an increase in some values that have been obtained during CTU-level coding selection (set in the table CTUStats). Another possibility to increase the coding efficiency on the encoder side is to test all possible SAO packets, but compared to the example of FIG. 29, where a small subset of packets is evaluated, this should increase the coding time. As just mentioned, it is also possible to use the second method of sharing SAO parameters among a group of CTUs. In this case, the encoder signals in the bit stream which derivation of the selected SAO parameter (CTU level, frame level, column, row, 2×2 CTU, 3×3 CTU, time derivation). The possible indexing scheme is shown in Table 1 below:
Figure 108118391-A0304-0001
Table 1 Since most of the derivation index values (values 0 to 5) signal the packet, the derivation index is also referred to as a packet index in the following. 30 is a flowchart illustrating a decoding process when a CTU packet is transmitted in a slice header according to the second method of sharing SAO parameters among a group of CTUs. First, the flag SaoEnabledFlag (1801) is extracted from the bit stream. If SAO is not enabled, the next slice header syntax element is decoded (1807), and SAO will not be applied to the current slice. Conversely, the decoder extracts N bits from the slice header (1803). N depends on the number of available CTU packets. Ideally, the number of CTU packets should be equal to N to the power of two. The corresponding CTU group index (1804) is used to select the CTU group method (1805). This grouping method is applied to extract SAO syntax and to determine the SAO parameter set for each CTU (1806). Then, the next slice header syntax element is decoded. If the CTU packet index (1804) corresponds to time derivation, other parameters may be extracted from the bitstream, such as reference frame index and/or other parameters required for time derivation. The advantage of sending at the slice header of a CTU packet is that it has a very low impact on the bit rate. But when the number of slices is large for frames, it may be desirable to reduce this signaling. Therefore, in a variant, the CTU packet index uses the unary maximum code in the slice header. In this case, CTU packets are ordered according to their probability of occurrence (highest to lowest). In the eleventh embodiment, at least one non-time derivation is an intermediate level derivation (SAO parameters are not at the CTU level or at the group level). When applied to a group, it causes the group (eg, frame or slice) to be subdivided into subdivided parts (CTU grouping 1203-1206, eg, multi-column CTUs, multi-row CTUs, N×N CTUs) Etc.) and derive the SAO parameters for each subdivision. Each subdivision part is composed of two or more of the image parts (CTU). The advantage of the intermediate stage derivation is that one or more effective rate-distortion tradeoffs are introduced. Intermediate-level derivation can be used without CTU-level derivation, frame-level derivation, or neither of these two types of derivation. Twelfth embodiment In the ninth embodiment, time derivation competes with CTU-level derivation and frame-level derivation. The twelfth embodiment builds on this and adds one or more intermediate packets as described in the sixth embodiment, so that the contention includes CTU level, frame level, and one or more intermediate between CTU and frame level Grouping and time derivation. Thirteenth embodiment In the eighth embodiment, time derivation competes with CTU-level derivation instead of frame-level derivation. The thirteenth embodiment is built on this basis and adds one or more N×N CTU groups so that the competition includes the CTU level, one or more N×N CTU groups, and time derivation. Fourteenth embodiment In the eighth embodiment, time derivation competes with CTU-level derivation instead of frame-level derivation. The fourteenth embodiment builds on this, and adds a third packet 1203 (one column of CTU), or a fourth packet 1204 (one row of CTU), or both third and fourth packets 1203 and 1204. Therefore, the competition includes the CTU level, the third and/or fourth group, and the time derivation. The ninth and eleventh to fourteenth embodiments each promote the diversity of SAO parameter derivation to be applied to the group by making at least the first and second non-temporal derivations available, the first non-temporal derivation being applied When grouping results in the group having SAO parameters at the first level, the second non-time derivation is applied to the group causing the group to have SAO parameters at a second level different from the first level. These levels can be any two levels from the frame level to the CTU level. These levels may correspond to the groups 1201-1206 in FIG. Fifteenth embodiment In the eighth to fourteenth embodiments, the smallest packet is the first packet 1201, where each CTU is a set, and each CTU has a set of SAO parameters. However, in the fifteenth embodiment, a set of SAO parameters can be applied to blocks smaller than the CTU. In this case, the non-temporal derivation is not at the CTU level, frame level, or intermediate level between the CTU and frame level, but at the sub-CTU (sub-CTU) level (a smaller level than the video part). In this case, instead of sending the packet, the index indicating the depth of the SAO parameter is valid. Table 2 below shows an example of possible indexing schemes:
Figure 108118391-A0304-0002
Table 2 Index 0 means that each CTU is divided into 16 blocks and each block may have its own SAO parameters. Index 1 indicates that each CTU is divided into 4 blocks, and each block has its own SAO parameters. Putting the depth and time derivation of these different SAO parameters together to compete, the encoder chooses a derivation (one of time derivation or non-time derivation at one of the available depths). This selection can be based on RD comparison. The selected derivation is then sent to the decoder in the bit stream. The signaling may include time/non-time syntax elements plus deep syntax elements (eg, using the indexing scheme above). Alternatively, a combined syntax element can be used to signal the notification time/non-time and depth. Index 6 can be assigned to time derivation, for example, non-time derivation has indexes 0-5. In the fifteenth embodiment, when at least one non-temporal derivation is applied to a group, the group is subdivided into subdivided parts, and SAO parameters are derived for each subdivided part, and each image part is composed of two or more The subdivision is composed. In the fifteenth embodiment, as in the ninth and eleventh to fourteenth embodiments, at least the first and second non-time derivations are available, and the first non-time derivation is applied to the group Causes the group to have SAO parameters at the first level, and the second non-time derivation is applied to the group causes the group to have SAO parameters at a second level different from the first level. These levels may be any two levels from the frame level to the sub-CTU level. These levels may correspond to the groups 1201-1206 in FIG. Sixteenth embodiment In the second embodiment, the derivation of the selected SAO parameters for the slice signaling indicates that the time derivation (when selected) is used for all CTUs of the slice. It is not possible to determine whether to use time derivation at the CTU level. The same is true in the fifteenth embodiment, where even if the available non-temporal derivation includes derivation with SAO parameters at different levels (depths) below the slice or frame level, it is impossible to determine at the level of the selected SAO parameter Whether to use time prediction. In the sixteenth embodiment, the SAO parameter derivation is modified so that time derivation at the CTU level is available, rather than only time derivation at the group level. As in the previous embodiment, the time derivation at the CTU level is not applied to a set of image parts. However, this time derivation competes with the time derivation applied to a set of image parts. For example, in one embodiment, the level of SAO parameters is first selected for the slice or frame, which may include the CTU level. Then, when the CTU level is selected, time derivation or non-time derivation is selected for each CTU of the slice or frame. In addition, when the level of the SAO parameter selected for the slice is an intermediate level between the slice level and the CTU level, time derivation or non-time derivation may be selected for each CTU group (eg, columns of CTUs) of the slice or frame. In this case, time derivation still applies to a set of two or more CTUs (image parts). Then, one or more CTU groups within a slice can use time derivation (each CTU derives SAO parameters from the co-located CTU of the reference image), while other CTU groups use non-time derivation. In this case, in addition to the benefit of applying time derivation on a group basis, the benefit of choosing between time or non-time SAO parameter derivation for each CTU group can also be achieved. For a 2x2 CTU packet (packet 1205 in FIG. 23), this is shown in FIG. 31. In FIG. 31, the SAO merge flag can be used between groups of CTU groups. As depicted in FIG. 31, for 2x2 CTU grouping, SAO merge Left and SAO merge up are reserved for each group of 2x2 CTUs. But for the CTUs in this group, they are removed. Note that only sao_merge_left_flag is used for one-column CTU group 1203, and only sao_merge_up_flag is used for one-row CTU group 1204. In a variant, the flag signals whether the current CTU group shares its SAO parameters. If it is true, a notification is sent to indicate the syntax element of one of the previous groups. Therefore, each group of slices can be predicted through the previous group, except for the first group. This increases coding efficiency by adding several new possible predictors. Seventeenth embodiment In the sixteenth embodiment, the depth of SAO parameters is selected for the slice, including the depth smaller than the CTU, so that it is possible to have a set of SAO parameters per block in the CTU. However, when choosing to use time derivation, depth cannot be selected, and all CTUs of a slice must use time derivation. In the seventeenth embodiment, the SAO parameter derivation is modified so that the depth is selected for the slice, and then whether to use time derivation is selected for the image portion at the selected depth. The depth may be the depth in Table 2. In the sixteenth embodiment, the SAO parameters are modified so that time derivation at the sub-CTU level is available, rather than only time derivation at the group level. As in the previous embodiment, the time derivation at the sub-CTU level is not applied to a set of image parts. However, this time derivation competes with the time derivation applied to a set of image parts. For example, in one implementation, the level of SAO parameters is first selected for slices or frames, which may include sub-CTU levels. Then, when the sub-CTU level is selected, time derivation or non-time derivation is selected for each block of the slice or frame. In addition, when the level of the SAO parameter selected for the slice is an intermediate level between the slice level and the block level, the time derivation can be selected for each CTU or each CTU group (eg, each column of CTUs) of the slice or frame Or non-time derivation. In this case, time derivation still applies to a group of two or more blocks (image parts). Then, one or more CTUs or CTU groups within a slice can use temporal derivation (each block derives SAO parameters from the co-located blocks of the reference image), while other CTUs or CTU groups use non-temporal derivation. In this case, in addition to the benefit of applying time derivation on the basis of a CTU or CTU group, the benefit of choosing between time or non-time SAO parameter derivation for each CTU or CTU group can also be achieved. In the seventeenth embodiment and in the sixteenth embodiment, one possibility is to remove all levels of SAO merge flags. This means that steps 503, 504, 505, 506 of FIG. 9 have been removed. The advantage is that it significantly reduces the transmission of SAO, which in turn reduces the bit rate. In addition, the design is simplified by removing 2 syntax elements at the CTU level. In a variant, the merge flag is reserved for the CTU level, but the merge flag is removed for all other CTU packets. The advantage is the flexibility of the CTU level. In another variation, when the SAO signal is lower than or equal to the CTU level (1/16 CTU or 1/4 CTU), the merge flag is used for the CTU, and the merge flag is removed for other CTU groups with larger groups Mark. The merge flag is important for small block sizes because the SAO parameter set is expensive compared to the number of samples it can improve. In this case, these syntax elements reduce the cost of SAO parameter signaling. For large groups, the SAO parameter integration cost is low, so the use of merge flags is inefficient. Therefore, the advantage of these embodiments is improved coding efficiency. In another variant, the level that enables the SAO merge flag is explicitly signaled in the bitstream. For example, a flag indicates whether to use the SAO merge flag. The flag may be included after the index of the CTU packet (or depth) in the slice header. This provides the encoder with an effective choice of whether to use the SAO Merge flag or not. Eighteenth embodiment In the eighth to fifteenth embodiments, there is competition between time derivation and at least one alternative derivation method that does not use time derivation. Similarly, in the sixteenth and seventeenth embodiments, there is contention between packets or depths, and time derivation is possible for each packet or depth. Although this competition is useful for identifying effective SAO parameter derivation of slices or frames, it may place a considerable burden on encoders that must perform evaluation for each candidate derivation. This burden may be undesirable, especially for hardware encoders. Therefore, in the eighteenth embodiment, the competition between different allowed derivations (for example, in the eighth embodiment, the competition between non-time derivation and time derivation at the CTU level) is modified so that there is only one The derivation is allowed for any slice or frame in the encoder. The allowed derivation may be determined based on one or more features of the slice or frame. For example, the allowed derivation can be selected according to the slice type (Intra, Inter_P, Inter_B), the slice quantization level (QP), or the position in the hierarchy of the group of pictures (GOP). Therefore, for some slices or frames, only temporal derivation is allowed, while for other slices or frames, only non-temporal derivation is allowed, for example at the CTU level. For example, it is possible to allow only the CTU level to be used for the highest position in the hierarchy of the GOP structure or Intra frames and Inter frames with low QP. And may allow other frames with lower positions or high QP in the GOP hierarchy to use only time derivation. Different parameters can be set according to the rate distortion trade-off. The advantage of this embodiment is that it reduces complexity. It is useful for hardware encoders to select only one derivation instead of evaluating two or more competing derivations. Therefore, in the eighteenth embodiment, the first type of derivation is associated with the first group of images (eg, Intra slices), and the second type of derivation is associated with the second group of images (eg, Inter_P slices). Determine whether the group to be filtered is the first group or the second group. If it is determined that the group to be filtered is the first group, the first derivation is used to filter the image part of the group, and if the group to be filtered is the second group, the second derivation is used to filter the group Image part. There is no need to evaluate both derivations. Determining whether the group to be filtered is the first group or the second group can be based on one or more of the following: Slice type The frame type of the image to which the group to be filtered belongs; The position in the quality level of the picture group of the image to which the group to be filtered belongs; The quality of the image to which the group to be filtered belongs; and Quantization parameters that can be applied to the group to be filtered. For example, when the first group has a higher quality or a higher position in the quality hierarchy than the second group, the first derivation may have fewer image parts in each group than the second derivation. Nineteenth embodiment In the eighteenth embodiment, the derivation of specific SAO parameters is selected for a given slice or frame. However, if the encoder is capable of evaluating a limited number of competition derivations, it is not necessary to eliminate competition completely. In the fourteenth embodiment, competition for a given slice or frame is still allowed, but the set derived from competition is adapted to the slice or frame. For example, the set of contention derivations may depend on the slice type (Intra, Inter_P, Inter_B), the slice quantization level (QP), or the position in the hierarchy of the group of pictures (GOP). The set of contention derivations may depend on the slice type. For Intra slicing, the set preferably contains packets in which the group has a small number of CTUs (eg, CTU level, 2×2 CTU, 3×3 CTU, and columns). And, if depths below CTU are available (as in the tenth embodiment), these depths are preferably also included. Of course, time derivation is not used. For Inter slices, the derived set preferably contains packets in which the group has a large number of CTUs including lines, frame levels, and time derivations. However, smaller packets down to the CTU level can also be considered. The advantage of this embodiment is that the coding efficiency is improved because the derivation adapted to slices or frames is used. In a variant, the set of derivations used for Inter B slices may be different from the set of derivations used for Inter P slices. In another variant, the set of contention derivations depends on the characteristics of the frames in the GOP. This is particularly beneficial for frames with different quality (QP) based on the quality level. For the frame with the highest quality or the highest position in the hierarchy, the set of contention derivations should include groups containing less CTU or even sub-CTU depth (same as above for Intra slices). For frames with lower quality or lower positions in the hierarchy, the set of contention derivations should include groups with more CTUs. The set of contention derivation can be defined in the sequence parameter set. Therefore, in the nineteenth embodiment, the first derivation set is associated with the first group of images (eg, Intra slices), and the second derivation set is associated with the second group of images (eg, Inter_P slices). Determine whether the group to be filtered is the first group or the second group. If it is determined that the group to be filtered is the first group, a derivation is selected from the first derivation set and used to filter the image part of the group, and if the group to be filtered is determined to be the second group, the second derivation set is selected One is derived and used to filter the image portion of the group. There is no need to evaluate derivations that are not in the associated set of derivations. In the previous embodiment, it can be determined whether the group to be filtered is the first group or the second group. For example, when the first group has a higher quality or a higher position in the quality hierarchy than the second group, the first derivation set may have at least one derivation, each of which has fewer image parts than the second derivation set. Twentieth embodiment In the previous embodiment, the time derivation involves simply copying the SAO parameters from the co-located CTU (or from the co-located block within the CTU if SAO parameters at the block level are used). In video, there are usually backgrounds and moving objects. When comparing a frame with its subsequent frames, a large part may be static. When applying SAO time derivation to this static portion of several consecutive frames, SAO filtering should filter nothing, especially for edge offsets. Therefore, time derivation will not be selected. In order to solve this problem and improve the time-derived coding efficiency, in the twentieth embodiment, the set of SAO parameters from the previous frame is modified according to some defined rules. Figure 32 is an example of an algorithm that generates such a modification of the set of SAO parameters. In this example, 90° rotation is applied to edge classification. If sao_eo_class_Luma or sao_eo_class_Chroma (2301) from the co-located CTU is equal to 0 (which corresponds to the edge type 0° (2302)), then the edge type (2310) of the current frame is set to be equal to 1 (2303), which corresponds to the SAO edge type 90°. Also, if sao_eo_class_X is equal to 1 (2304), then sao_eo_class_X (2305) is set to be equal to 0. In the same way, rotate the edge offset type 135° (sao_eo_class_X equals 2 (2306)) to the edge offset type 45° (2307). And rotate the edge offset type 45° (sao_eo_class_X equals 3 (2308)) to the edge offset type 45° (2309). The offset value has not changed. It should be understood that although the effect of the algorithm in FIG. 32 is to apply rotation, in practice, the change of the edge classification parameter (sao_eo_class_Luma or sao_eo_class_Chroma) can be achieved by using a mapping table. In the mapping table, each existing edge index has an entry that maps to the corresponding "new" edge index. Therefore, the mapping table achieves the required rotation. Figure 33 shows such a time rotation 90°. In this example, it is assumed that the time derivation with 90° rotation is applied to the entire frame or slice, as in the first and second embodiments. Of course, as a variant, 45° and 135° rotation can be considered instead of 90°. However, in the preferred embodiment, the rotation of the temporal SAO parameter set is a 90° rotation. This provides the best coding efficiency. In a variant, when time rotation is applied, the band offset is not copied and SAO is not applied to this CTU. In another variation, as far as the basic "duplication" time derivation is concerned, for all CTUs for which the SAO parameter set cannot be obtained (this means that their co-located CTUs use "no SAO" CTUs or their co-located CTUs use "no SAO" "For all CTUs), the preset SAO parameter set can be used for the relevant CTU, as described in conjunction with the fifth embodiment. Twenty-first embodiment In the twentieth embodiment, "rotation" time derivation is introduced. In the twenty-first embodiment, the "rotation" time derivation is competed with the "copy" time derivation, as shown in FIG. 34. In this example, the contention is applied to each slice or each frame. The best time derivation can be selected based on the rate-distortion criterion. The twenty-second embodiment In the previous embodiments, the "copy" time derivation competes with one or more non-time derivations (different groupings or different depths). In the twenty-second embodiment, the "rotation" time derivation competes with the same (one or more) non-time derivations rather than the "copy" time derivation. Twenty-third embodiment In the previous embodiments, the "copy" time derivation competes with one or more non-time derivations (different groupings or different depths). In the twenty-third embodiment, both "copy" and "rotation" time derivation compete with the same (one or more) non-time derivations, rather than just "copy" time derivation to participate in the competition. For example, Table 3 below shows the derivation of competition when the eleventh embodiment is modified in this way:
Figure 108118391-A0304-0003
table 3 As a variant, further time derivation with 135° and 45° rotation or other rotation angles is possible. Twenty-fourth embodiment In the twenty-first embodiment, the "copy" and "rotation" time derivations compete with each other. In the twenty-fourth embodiment, these two time derivations and further "rotation" time derivations are used cyclically. In an exemplary loop, the first frame F0 is followed by the second, third, fourth, and fifth frames F1-F4. The first frame F0 does not use the time derivation of SAO parameters. For F1, the "copy" time derivation is applied (ie, the SAO parameters are copied from F0). For F2, the time derivation is a 90° rotation of the SAO parameter of F0. For F3, the time derivation is a 135° rotation of the SAO parameter of F0. For F4, the time derivation is a 45° rotation of the SAO parameter of F0. In this case, F0 is the reference image of each of F1 to F4. The same effect can be achieved by using only the previous frame as a reference frame: Frame F0: (SAO parameters are not derived from time) Frame F1: (Time ‘copy’ frame 0) Frame F2: (Time ‘90°’ Frame 1) Frame F3: (Time ‘45°’ Frame 2) Frame F4: (Time ‘90°’ Frame 3) Filter one image part in the first image by using rotation copy derivation, and use two time rotation derivations in a predetermined sequence using two or more time rotation derivations to filter two or more after the first image For the same image part in multiple other images, the direction of the edge filtering of the image part can be continuously switched through all possible edge filtering directions. Second set of embodiments In HEVC, SAO filtering is performed per CTU. In the first group of embodiments, time derivation is introduced, and in order to improve the transmission efficiency, a group of image parts is formed, and the use of time derivation is notified for this group of image parts rather than individually for each image part. In the second group of embodiments, any derivation need not be group-wise derivation. Twenty-fifth embodiment In the twentieth embodiment, "rotation" time derivation is applied to all CTUs of a slice or frame. In other words, the rotation time derivation is sent for a group of two or more image parts (CTU) (slices, frames, columns, rows, NxN CTUs, etc.). The image parts (CTU) can still have different SAO parameters, which depend on the SAO parameters of the individual co-located image parts. Derivation at the slice or frame level signaling time is useful for compatibility with the previously described embodiments, and CTU packets can be selected for slices or frames from multiple packets (eg, packets 1201-1206 in FIG. 23) , Also sends the selected packet at the slice or frame level. However, the use of time derivation at the slice or frame level signaling is not important. This applies to whether there is only one type of temporal derivation, such as "copy" or "rotate", or the type can be selected from multiple different types. Conversely, it can be used at the CTU level or at the block level (ie, sub-CTU) signaling time derivation. In this case, a syntax element may be provided for each CTU to indicate whether to use rotation time derivation for the relevant CTU. Similarly, a syntax element can be provided for each block (ie, sub-CTU) to indicate whether to use rotation time derivation for the relevant block. In the twenty-fifth embodiment, neither the time derivation nor the packet is transmitted at the slice level, and all SAO transmissions are at the CTU level. FIG. 35 shows an example of the decoding process in this embodiment. In this example, one or more merge flags are used at the CTU level to signal SAO derivation including the use of time derivation. Compared with Figure 9, a new SAO temporal merge flag is introduced. The process of FIG. 35 is performed on a CTU-by-CTU basis. For the current CTU, extract sao_merge_temporal_flag_X from the bit stream if other merge flags are off (2613). If sao_merge_temporal_flag_X is equal to 1, the syntax element representing the reference frame is extracted from the bitstream (2614). Please note that if only one reference frame is used for derivation, this step is not required. Next, the syntax element representing the rotation of the parameter is decoded (2615). Please note that this step is not required if the "Rotate" option is not available. This is the case if the only type of time derivation is the basic "copy" type. Moreover, even if there is a rotation option, if the co-located CTU in the reference frame is not of the EO type, step 2615 is not performed. Next, each set of SAO parameters of the three color components is copied from the co-located CTU to the current CTU. Then, the process advances to the next CTU in step 2610. Compared to time/CTU packet transmission at the slice level, the advantage of time merge flag transmission is that it simplifies encoder design for some implementations. In fact, unlike the scheme at the slice level, there is no need to wait for the encoding of the entire frame before starting the SAO selection. However, the additional transmission at the CTU level will have a significant impact on the coding efficiency, which cannot be ignored. When two or more time derivations compete with each other, for example, "no time", "copy", "rotate 90°", "rotate 135°", "rotate 45°", each extracted in step 2615 The syntax element of the CTU may indicate the selected temporal derivation, for example, using an index. Syntax elements can also specify the angle of rotation. In this way, in the same slice or frame, some CTUs may not have time to deduce, other CTUs may use "copy", and some other CTUs may use "rotate 90°" and so on. These solutions result in SAO parameter derivation that adapts to the CTU of a slice or frame extremely finely. Transmit the grouping of slices or frames, and then use the time derivation for each group of two or more CTUs (if two or more time derivations compete with each other, one of which is selected). CTU syntax element is an effective way to achieve adaptability. For example, if the selected slice grouping is 3x3 CTUs, some groups may not have time to deduce, other groups may use "copy", and some other groups may use "rotate 90°" and so on. Since the number of groups is only 1/9 of the number of CTUs, the number of syntax elements is correspondingly smaller compared to each CTU. However, the different CTUs in each group may still be different according to the same CTU SAO parameters. Twenty-sixth embodiment In the twentieth to twenty-fifth embodiments, rotation time derivation is introduced. These rotation time derivations are preferred examples from a wider transformation, which can be applied to change the direction of EO filtering in the CTU of the current frame compared to the direction of EO filtering in the co-located CTU of the reference frame. For example, the direction change transformation may be a reflection about the x-axis or y-axis. This reflection has the effect of swapping the two directions and keeping the other two directions unchanged. It can also be about 45° or 135° diagonal reflections. As in the twentieth embodiment, it should be understood that although the effect of the algorithm of FIG. 32 is to apply transformation, it is actually possible to change the edge classification parameter (sao_eo_class_Luma or sao_eo_class_Chroma) by using a mapping table. In the mapping table, each existing edge index has an entry that maps to the corresponding "new" edge index. Therefore, the mapping table achieves the required transformation. This embodiment is applicable to the first group of embodiments (which uses group derivation) or to the second group of embodiments (which does not use group derivation). The third group of embodiments In the first and second sets of embodiments, temporal derivation of SAO parameters is introduced as a group derivation (applies to a set of two or more image parts) or for individual image parts. In the third set of embodiments, a new spatial derivation of SAO parameters is introduced. These can be deduced in groups or used for individual video parts. In the case of group space derivation, as in the first group of embodiments, a group may be any two or more CTUs, for example, the entire image, slice, one row of CTU, one column of CTU, N rows of CTU, N columns CTU, where N is an integer greater than 1. A group may also be N×N CTUs, where N is an integer greater than 1, or M×N CTUs or N×M CTUs, where M ≥ 1 and N> 1. Alternatively, a group of video parts may be a CTU, and each component block of the CTU may be a video part. In this case, each block of the CTU may have its own SAO parameters, but for the CTU as a whole, it can send a notification to use the spatial derivation of the SAO parameters. In the simplest case where there is only one type of spatial derivation, the flag temporal_merge can be used to signal the use of temporal derivation for all image parts of the group. In the case of grouped spatial derivation, the method of deriving SAO parameters in the spatial derivation is not particularly limited, except that the source image part belongs to another group of image parts in the same image as the subject group. The source image part and the image part to be derived are located in the same position in their respective groups. For example, in a 3x3 CTU packet, there are 9 positions from the upper left to the lower right. If the other group is, for example, the left group of the subject group, then at least one SAO parameter of the image part located at the position 1 (for example, the upper left position) in the subject group is from the same position in the left group (position 1 Or the upper left position) of the SAO parameters of the video part. This image part in the left group serves as the source image part of the image part to be derived in the theme group. The same is true for every other location in the theme group. In the simplest case, at least one SAO parameter of the image part belonging to the group is derived from the SAO parameter of the source image part by copying the SAO parameter of the source image part. You can copy one, more than one, or all SAO parameters. Alternatively, one, more than one, or all SAO parameters can be copied only when the SAO filtering is of a specific type (edge or band). For example, in FIG. 31, several 2x2 CTU groups are shown. When sao_merge_left_flag is set in the current 2x2 group, copy one or more SAO parameters of the CTU in the upper left position of the left 2x2 group to the CTU in the upper left position of the current 2x2 group; copy the CTU in the upper right position of the left 2x2 group Copy one or more SAO parameters of the CTU in the upper right position of the current 2x2 group; copy one or more SAO parameters of the CTU in the lower left position of the left 2x2 group to the CTU in the lower left position of the current 2x2 group; and copy One or more SAO parameters of the CTU in the lower right position of the 2x2 group on the left are copied to the CTU in the lower right position of the current 2x2 group. sao_merge_up_flag performs the same operations as the current 2x2 group above for the 2x2 group. When neither flag is set, each CTU has its own "new" SAO parameters, which can be at the group level (one parameter set per group) or at the CTU level. Instead of spatial derivation involving modified copy SAO parameters, one, more than one, or all SAO parameters of the source image portion can be used. It should be understood that both space and time group derivation are "source derivation of grouping". Each involves derivation of the grouped source of SAO parameters to a group of two or more image parts. The grouped source derivation allows different image parts belonging to the group to have different SAO parameters and contains the image parts to be derived from The SAO parameter of another image part of the source image part of the, derives at least one of the SAO parameters of the image part belonging to the group. In the case of time derivation, the source image part is the co-located image part in the reference image, and its position in the reference image is the same as the position of the image part to be derived in its image. In the case of spatial derivation, the source image part belongs to another group of image parts in the same image as the image part to be exported, and the position of the source image part and the image part to be exported in their respective groupings the same. Twenty-seventh embodiment In the twenty-fifth embodiment, the rotation derivation is a non-group time derivation. However, in the twenty-seventh embodiment, the spatial rotation derivation is used as the derivation, that is, the SAO parameter of the CTU in the current frame is derived from the rotation of the SAO parameter of another CTU in the same image (rather than through the reference The SAO parameters of the co-located CTU of the image are rotated to derive). Similar to the "copy" space derivation, another CTU in the "rotation" space derivation can be the left CTU or the upper CTU. In this case, when the rotation space derivation is selected, the sao_merge_rotation_left flag or the sao_merge_rotation_up flag can be used Sign to send the message. FIG. 36 shows two examples in which another CTU is the left CTU and the rotation from the left CTU to the current CTU is 90 degrees. In a variant, the rotation space derivation can compete with the time copy derivation and/or rotation time derivation. In another variant, there is no time derivation, and the rotation space derivation competes with the copy space derivation (of course it can be copy left and/or copy top). In these cases, "rotation" derivation is applied on a spatial basis to generate additional SAO merge parameter set candidates to predict the current CTU SAO parameter set. Therefore, "rotation" can be applied to increase the list of SAO Merge candidates or to find new SAO Merge candidates for empty positions. The advantage of using the twenty-seventh embodiment instead of using several SAO parameter sets from the previously decoded SAO parameter set is an improvement in coding efficiency performance. In addition, by accessing a limited number of coded SAO parameter sets, it provides additional flexibility for encoder implementations. FIG. 37 is a flowchart showing an example of possible use of rotation derivation of SAO parameters. In the process of decoding a set of SAO parameters for the current CTU, if the other merge flags are off, the sao_merge_rotation_Left_X flag is extracted from the bitstream (3613). If sao_merge_rotation_Left_X is equal to 1, for each color component YUV of the current CTU, by applying rotation to the edge classification as described in the twenty-fifth embodiment, the SAO is derived from the SAO parameter set of the same color component YUV of the left CTU Parameter set. You can simply copy the SAO parameters except the direction. Twenty-eighth embodiment In the twenty-seventh embodiment, the rotation space derivation is applied to one CTU. In the twenty-eighth embodiment, group-based rotation space derivation is applied. Then, each CTU of the current group derives its SAO parameters by rotating from the CTU at the same position in another group of the same image. For example, the packet may be 3x3 CTUs. The other group can be the upper group or the group on the left. Similarly, packet-based spatial derivation can compete with packet-based temporal derivation (either copy or rotate, or both). Similarly, packet-based spatial derivation can compete with packet-based "copy" spatial derivation (which can be copy left and/or copy top). Twenty-ninth embodiment In the twenty-seventh and twenty-eighth embodiments, rotational space derivation is introduced. Just as the rotation time derivation is one of the wider possible types of direction change time derivation, so the rotation space derivation is one of the more possible types of direction change space derivation. The direction transformation spatial derivation can be applied to a single CTU or to a group of CTUs. It can compete with other spatial and/or temporal derivations. Thirtieth embodiment 38 shows a system 191, 195 according to an embodiment of the present invention, which includes at least one of an encoder 150 or a decoder 100 and a communication network 199. According to an embodiment, the system 195 is used to process and provide content (for example, video and audio content for display/output or streaming video/audio content) to the user, for example, through a user terminal including the decoder 100 or The user interface of the user terminal communicating with the decoder 100 accesses the decoder 100. Such a user terminal may be a computer, mobile phone, tablet, or any other type of device capable of providing/displaying (supplied/streamed) content to the user. The system 195 acquires/receives the bit stream 101 (in the form of a continuous stream or signal-for example, when displaying/outputting early video/audio) through the communication network 199. According to an embodiment, the system 191 is used to process content and store processed content, for example, video and audio content processed for later display/output/streaming. The system 191 obtains/receives content containing the original image sequence 151, which is received and processed by the encoder 150 (including filtering using the deblocking filter according to the present invention), and the encoder 150 generates a bit stream 101, which passes through the communication network Way 199 is transmitted to the decoder 100. The bit stream 101 is then transmitted to the decoder 100 in various ways, for example, it can be pre-produced by the encoder 150 and stored as data in a storage device in the communication network 199 (for example, in a server or cloud storage Above) until the user requests content (ie, bit stream data) from the storage device, at which time the data is transmitted/streamed from the storage device to the decoder 100. The system 191 may also include a content providing device for providing/streaming to the user (for example, by transmitting data to be displayed on the user terminal for the user interface) content information of the content stored in the storage device (For example, the title of the content and other meta/storage location data for identifying, selecting, and requesting content), and for receiving and processing user requests for content so that the requested content can be sent from the storage device/ Stream to the user terminal. Alternatively, the encoder 150 generates a bit stream 101 and transmits/streams the bit stream directly to the decoder 100 when the user requests content. Then, the decoder 100 receives the bit stream 101 (or signal) and performs filtering according to the present invention using a deblocking filter to obtain/generate a video signal 109 and/or an audio signal, which is then used by the user terminal to request Content is provided to users. In the foregoing embodiments, the described functions can be implemented by hardware, software, firmware, or any combination thereof. If implemented in software, the functions can be stored as one or more instructions or codes on a computer-readable medium or transmitted via the computer-readable medium, and executed by a hardware-based processing unit. Computer readable media may include computer readable storage media, which correspond to tangible media such as data storage media, or communication media, which include aids in transferring computer programs from one place to another, for example, in accordance with communication protocols Local media. In this way, computer-readable media may generally correspond to (1) non-transitory tangible computer-readable storage media or (2) communication media, such as signals or carrier waves. The data storage media may be any available media that can be accessed by one or more computers or one or more processors to extract instructions, codes, and/or data structures used to implement the techniques described in this disclosure. The computer program product may include computer readable media. By way of example, and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, flash memory, or may be used to Any other media that stores the required code in the form of commands or data structures and can be accessed by a computer. Also, any connection is appropriately called a computer-readable medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technology such as infrared, radio, and microwave are used to transmit commands from a website, server, or other remote source, then the coaxial cable, fiber optic cable, Twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are all included in the definition of media. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transient media, but rather non-transient, tangible storage media. The discs and discs used in this article include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy discs, and Blu-ray discs, where discs usually reproduce data magnetically, while discs use lasers The data is reproduced optically. The above combination should also be included in the scope of computer-readable media. Instructions can be executed by one or more processors, such as one or more digital signal processors (DSPs), general-purpose microprocessors, application-specific integrated circuits (ASICs), field programmable logic arrays (FPGAs), or other equivalents Integrated or discrete logic circuits. Therefore, the term "processor" as used herein may refer to any of the foregoing structures or any other structure suitable for implementing the techniques described herein. In addition, in some aspects, the functions described herein may be provided within dedicated hardware and/or software modules configured for encoding and decoding, or incorporated into a combined codec. Moreover, these techniques can be fully implemented in one or more circuits or logic elements. The technology of the present disclosure may be implemented in various devices or equipment, including wireless handsets, integrated circuits (ICs), or a group of ICs (eg, chipsets). Various elements, modules, or units are described in this disclosure to emphasize the functional aspects of devices configured to perform the disclosed technology, but do not necessarily need to be implemented by different hardware units. Instead, as described above, various units can be combined in a codec hardware unit, or provided by a set of interoperable hardware units, which include one or more processors as described above, together with suitable software and/or Or firmware.

1‧‧‧視訊序列 2‧‧‧影像 3‧‧‧切片 4‧‧‧編碼樹單元(CTU) 5‧‧‧編碼單元 6‧‧‧預測單元(PU) 7‧‧‧轉換單元(TU) 200‧‧‧資料通訊網路 201‧‧‧伺服器 202‧‧‧客戶終端 204‧‧‧資料流 300‧‧‧處理裝置 302‧‧‧通訊介面 303‧‧‧通訊網路 304‧‧‧資料儲存機構 305‧‧‧磁碟驅動器 306‧‧‧磁碟 307‧‧‧唯讀記憶體 308‧‧‧麥克風 309‧‧‧螢幕 310‧‧‧鍵盤 311‧‧‧中央處理單元 312‧‧‧隨機存取記憶體 313‧‧‧通訊匯流排 320‧‧‧數位相機 400‧‧‧編碼器 401‧‧‧原始序列影像 402‧‧‧模組 403‧‧‧模組 404‧‧‧運動估計模組 405‧‧‧運動補償模組 406‧‧‧選擇模組 407‧‧‧轉換模組 408‧‧‧量化模組 409‧‧‧熵編碼模組 410‧‧‧位元流 411‧‧‧反向量化模組 412‧‧‧逆轉換模組 413‧‧‧幀內預測模組 414‧‧‧運動補償模組 415‧‧‧模組 416‧‧‧參考影像 417‧‧‧運動向量預測及編碼模組 418‧‧‧運動向量場 51~58‧‧‧步驟 60‧‧‧解碼器 61‧‧‧位元流 62‧‧‧模組 63‧‧‧模組 64‧‧‧模組 65‧‧‧幀內預測模組 66‧‧‧模組 67‧‧‧後濾波模組 68‧‧‧參考影像 69‧‧‧視訊信號 70‧‧‧運動向量解碼模組 71‧‧‧運動向量場資料 40‧‧‧一組帶 41~44‧‧‧連續的帶 501~512‧‧‧步驟 601~610‧‧‧步驟 700‧‧‧過程 701~716‧‧‧步驟 2001‧‧‧當前影像 2002‧‧‧參考影像 2003~2004‧‧‧CTU 2005~2006‧‧‧CTU 2101~2112‧‧‧步驟 2201~2213‧‧‧步驟 2401~2413‧‧‧步驟 2501~2508‧‧‧步驟 1101~1116‧‧‧步驟 801~814‧‧‧步驟 901~906‧‧‧步驟 1001~1009‧‧‧步驟 1601~1612‧‧‧步驟 1901~1915‧‧‧步驟 1201~1206‧‧‧分組 1301~1318‧‧‧步驟 1401~1413‧‧‧步驟 1501~1519‧‧‧步驟 1701~1715‧‧‧步驟 1801~1807‧‧‧步驟 2301~2310‧‧‧步驟 2601~2616‧‧‧步驟 3601~3614‧‧‧步驟 100‧‧‧解碼器 101‧‧‧位元流 109‧‧‧視訊信號 150‧‧‧編碼器 151‧‧‧原始影像序列 191‧‧‧系統 199‧‧‧通訊網路 195‧‧‧系統1‧‧‧Video sequence 2‧‧‧Image 3‧‧‧Slice 4‧‧‧ Coding Tree Unit (CTU) 5‧‧‧Coding unit 6‧‧‧Prediction Unit (PU) 7‧‧‧ Conversion Unit (TU) 200‧‧‧Data communication network 201‧‧‧Server 202‧‧‧Client terminal 204‧‧‧Data flow 300‧‧‧Processing device 302‧‧‧Communication interface 303‧‧‧Communication network 304‧‧‧ data storage organization 305‧‧‧disk drive 306‧‧‧disk 307‧‧‧Read-only memory 308‧‧‧Microphone 309‧‧‧ screen 310‧‧‧ keyboard 311‧‧‧Central Processing Unit 312‧‧‧random access memory 313‧‧‧Communication bus 320‧‧‧ digital camera 400‧‧‧Encoder 401‧‧‧ Original sequence image 402‧‧‧Module 403‧‧‧ module 404‧‧‧Motion estimation module 405‧‧‧Motion compensation module 406‧‧‧Select module 407‧‧‧ Conversion module 408‧‧‧Quantization module 409‧‧‧Entropy coding module 410‧‧‧ bit stream 411‧‧‧Inverse quantization module 412‧‧‧Inverse Conversion Module 413‧‧‧Intra prediction module 414‧‧‧Motion compensation module 415‧‧‧Module 416‧‧‧Reference image 417‧‧‧Motion vector prediction and coding module 418‧‧‧Motion vector field 51~58‧‧‧Step 60‧‧‧decoder 61‧‧‧ bit stream 62‧‧‧Module 63‧‧‧Module 64‧‧‧Module 65‧‧‧Intra prediction module 66‧‧‧Module 67‧‧‧Post filter module 68‧‧‧Reference image 69‧‧‧Video signal 70‧‧‧Motion vector decoding module 71‧‧‧ Motion vector field data 40‧‧‧ a set of belts 41~44‧‧‧Continuous belt 501~512‧‧‧Step 601~610‧‧‧Step 700‧‧‧Process 701~716‧‧‧Step 2001‧‧‧ Current image 2002‧‧‧Reference image 2003~2004‧‧‧CTU 2005~2006‧‧‧CTU 2101~2112‧‧‧Step 2201~2213‧‧‧Step 2401~2413‧‧‧Step 2501~2508‧‧‧Step 1101~1116‧‧‧Step 801~814‧‧‧Step 901~906‧‧‧Step 1001~1009‧‧‧Step 1601~1612‧‧‧Step 1901~1915‧‧‧Step 1201~1206‧‧‧Group 1301~1318‧‧‧Step 1401~1413‧‧‧Step 1501~1519‧‧‧Step 1701~1715‧‧‧Step 1801~1807‧‧‧Step 2301~2310‧‧‧Step 2601~2616‧‧‧Step 3601~3614‧‧‧Step 100‧‧‧decoder 101‧‧‧ bit stream 109‧‧‧Video signal 150‧‧‧Encoder 151‧‧‧ Original image sequence 191‧‧‧ system 199‧‧‧Communication network 195‧‧‧ system

現在將透過示例方式參考附圖,其中: 圖1是用於說明HEVC中使用的編碼結構的圖; 圖2是示意性地示出可於其中實現本發明之一或多個實施例的資料通訊系統的方塊圖; 圖3是示出可於其中實現本發明之一或多個實施例的處理裝置的元件的方塊圖; 圖4是說明依據本發明之實施例的編碼方法之步驟的流程圖; 圖5是說明依據本發明之一或多個實施例的迴圈濾波處理之步驟的流程圖; 圖6是說明依據本發明之實施例的解碼方法之步驟的流程圖; 圖7A及7B是用於說明HEVC中邊緣類型SAO濾波的圖; 圖8是用於說明HEVC中帶類型SAO濾波的圖; 圖9是說明依據HEVC規範解碼SAO參數之過程的步驟的流程圖; 圖10是更詳細地說明圖9過程中的步驟之一的流程圖; 圖11是說明依據HEVC規範如何對影像部分執行SAO濾波的流程圖; 圖12是用於說明本發明之第一實施例中SAO參數之時間推導的示意圖; 圖13是用於說明第一實施例中解碼影像之方法的流程圖; 圖14是用於說明本發明之第三實施例中解碼影像之方法的流程圖; 圖15是用於說明本發明之第六實施例中解碼影像之方法的流程圖; 圖16是說明在本發明之第七實施例中建立用於SAO時間推導之參考幀列表的過程的流程圖; 圖17是說明在本發明之第八實施例中執行編碼器,以在SAO參數之CTU級非時間推導中確定一組(幀或切片)之CTU的SAO參數的步驟的流程圖; 圖18更詳細地顯示圖17之步驟中的一個步驟; 圖19更詳細地顯示圖17之步驟中的另一步驟; 圖20更詳細地顯示圖17之步驟中的又另一步驟; 圖21是用於說明在第八實施例中如何評估時間推導之成本的流程圖; 圖22是用於說明在第八實施例中如何比較時間推導和進一步的、非時間推導之成本的流程圖; 圖23示出切片中各種不同的CTU的分組; 圖24是示出在SAO參數的非時間推導中的幀的影像部分的圖,其中使用共享SAO參數的第一種方法; 圖25是用於在圖24之非時間推導中設定SAO參數的過程之範例的流程圖; 圖26是使用第一共享方法在一列CTU之間共享SAO參數以在另一非時間推導中設定SAO參數之過程的範例的流程圖; 圖27是使用第一共享方法在一組NxN個CTU之間共享SAO參數以在又另一非時間推導中設定SAO參數之過程的範例的流程圖; 圖28是示出在圖27之非時間推導中一個NxN組的影像部分的圖; 圖29示出在本發明的第十一實施例中如何選擇SAO參數推導的範例; 圖30是說明適合於在一組影像部分之間共享SAO參數的第二種方法的解碼過程的流程圖; 圖31是示出在本發明之第十六實施例中的多個2x2組的影像部分的圖; 圖32是用於說明依據本發明之第二十實施例在SAO參數之時間旋轉推導中導出SAO參數的過程的示意圖; 圖33是圖32之時間旋轉推導的示意圖; 圖34是用於說明導出SAO參數之過程的示意圖,其中不同的時間推導是可用的; 圖35是用於說明在本發明之第二十五實施例中的解碼過程的流程圖; 圖36是用於說明依據本發明之第二十實施例在SAO參數的空間旋轉推導中導出SAO參數之過程的示意圖; 圖37是用於說明第二十七實施例中之解碼過程的流程圖;以及 圖38是示出依據本發明之實施例的包含編碼器或解碼器的系統以及通訊網路的圖。Reference will now be made to the drawings by way of example, where: FIG. 1 is a diagram for explaining the coding structure used in HEVC; 2 is a block diagram schematically showing a data communication system in which one or more embodiments of the present invention can be implemented; 3 is a block diagram illustrating elements of a processing device in which one or more embodiments of the present invention can be implemented; 4 is a flowchart illustrating the steps of the encoding method according to an embodiment of the present invention; 5 is a flowchart illustrating the steps of the loop filter process according to one or more embodiments of the present invention; 6 is a flowchart illustrating steps of a decoding method according to an embodiment of the present invention; 7A and 7B are diagrams for explaining edge type SAO filtering in HEVC; FIG. 8 is a diagram for explaining band-type SAO filtering in HEVC; 9 is a flowchart illustrating the steps of the process of decoding SAO parameters according to the HEVC specification; FIG. 10 is a flowchart illustrating one of the steps in the process of FIG. 9 in more detail; 11 is a flowchart illustrating how to perform SAO filtering on an image part according to the HEVC specification; 12 is a schematic diagram for explaining the time derivation of SAO parameters in the first embodiment of the present invention; 13 is a flowchart for explaining a method of decoding images in the first embodiment; 14 is a flowchart for explaining a method of decoding images in the third embodiment of the present invention; 15 is a flowchart for explaining a method of decoding images in the sixth embodiment of the present invention; 16 is a flowchart illustrating a process of establishing a reference frame list for SAO time derivation in the seventh embodiment of the present invention; FIG. 17 is a flowchart illustrating the steps of executing an encoder in the eighth embodiment of the present invention to determine the SAO parameters of a group (frame or slice) of CTU in the CTU-level non-time derivation of SAO parameters; Figure 18 shows one of the steps of Figure 17 in more detail; FIG. 19 shows another step among the steps of FIG. 17 in more detail; FIG. 20 shows yet another step of the steps of FIG. 17 in more detail; 21 is a flowchart for explaining how to estimate the cost of time derivation in the eighth embodiment; 22 is a flowchart for explaining how to compare the cost of time derivation and further, non-time derivation in the eighth embodiment; Figure 23 shows the grouping of various CTUs in a slice; 24 is a diagram showing the image portion of the frame in the non-temporal derivation of SAO parameters, in which the first method of sharing SAO parameters is used; 25 is a flowchart of an example of a process for setting SAO parameters in the non-time derivation of FIG. 24; 26 is a flowchart of an example of a process of sharing SAO parameters between a list of CTUs using a first sharing method to set SAO parameters in another non-time derivation; 27 is a flowchart of an example of a process of sharing SAO parameters among a group of NxN CTUs using the first sharing method to set SAO parameters in yet another non-time derivation; FIG. 28 is a diagram showing the image portion of an NxN group in the non-time derivation of FIG. 27; FIG. 29 shows an example of how to select SAO parameter derivation in the eleventh embodiment of the present invention; 30 is a flowchart illustrating a decoding process suitable for a second method of sharing SAO parameters between a group of video parts; 31 is a diagram showing a plurality of 2x2 groups of video parts in the sixteenth embodiment of the present invention; 32 is a schematic diagram for explaining a process of deriving SAO parameters in the time rotation derivation of SAO parameters according to the twentieth embodiment of the present invention; FIG. 33 is a schematic diagram of the time rotation derivation of FIG. 32; Fig. 34 is a schematic diagram for explaining the process of deriving SAO parameters, in which different time derivations are available; 35 is a flowchart for explaining the decoding process in the twenty-fifth embodiment of the present invention; 36 is a schematic diagram for explaining the process of deriving SAO parameters in the spatial rotation derivation of SAO parameters according to the twentieth embodiment of the present invention; 37 is a flowchart for explaining the decoding process in the twenty-seventh embodiment; and 38 is a diagram showing a system including an encoder or a decoder and a communication network according to an embodiment of the present invention.

Claims (29)

一種對包括複數個影像部分的影像執行取樣自適應偏移(SAO)濾波的方法,該方法包括: 從SAO參數的兩種或更多種可用的時間推導之中,選擇要施用於一影像部分的SAO參數的時間推導,該些可用的時間推導包括從參考影像中的同位(collocated)影像部分的SAO參數推導得到該影像部分的至少一個該SAO參數的不同方式;以及 使用所述推導得到的SAO參數對該影像部分執行SAO濾波。A method for performing sample adaptive offset (SAO) filtering on an image including a plurality of image parts, the method includes: From the two or more available time derivations of the SAO parameters, select the time derivation of the SAO parameters to be applied to an image part. These available time derivations include the collocated image part from the reference image. Different ways of deriving SAO parameters to obtain at least one of the SAO parameters of the image part; and SAO filtering is performed on the image part using the derived SAO parameters. 如申請專利範圍第1項所述之方法,其中一個所述可用的時間推導是時間複製推導,其從參考影像的同位影像部分的SAO參數,透過複製該同位影像部分的該SAO參數,推導得到目標影像部分的該至少一個所述SAO參數。As in the method described in item 1 of the patent application scope, one of the available time derivations is time duplication derivation, which is derived from the SAO parameters of the co-located image part of the reference image by copying the SAO parameters of the co-located image part. The at least one SAO parameter of the target image part. 如申請專利範圍第1或2項所述之方法,其中一個所述可用的時間推導是時間旋轉推導,其從表示該同位影像部分的邊緣濾波的方向的SAO參數推導得到表示目標影像部分的邊緣濾波的方向的SAO參數,使得該目標影像部分的邊緣濾波的該方向相對於該同位影像部分的邊緣濾波的該方向旋轉。The method as described in item 1 or 2 of the patent application scope, wherein one of the available time derivations is time rotation derivation, which derives the edge representing the target image part from the SAO parameter demonstrating the direction of edge filtering of the co-located image part The SAO parameter of the filtering direction causes the direction of the edge filtering of the target image portion to rotate relative to the direction of the edge filtering of the co-located image portion. 如申請專利範圍第3項所述之方法,其中該目標影像部分的邊緣濾波的該方向相對於該同位影像部分的邊緣濾波的該方向旋轉等於90度的角度。The method as described in item 3 of the patent application scope, wherein the direction of the edge filtering of the target image portion is rotated by an angle equal to 90 degrees relative to the direction of the edge filtering of the co-located image portion. 如申請專利範圍第3或4項所述之方法,具有兩種或更多種所述時間旋轉推導,其將目標影像部分的邊緣濾波的該方向相對於該同位影像部分的邊緣濾波的該方向旋轉不同角度。The method as described in item 3 or 4 of the patent application scope has two or more of said time rotation derivations, which compare the direction of the edge filtering of the target image portion with respect to the direction of the edge filtering of the co-located image portion Rotate at different angles. 如申請專利範圍第5項所述之方法,還包括按照預定序列使用兩種或更多種時間旋轉推導中的不同種時間旋轉推導來過濾兩個或更多個連續影像中的相同影像部分。The method as described in item 5 of the patent application scope also includes using different time rotation derivations in two or more time rotation derivations according to a predetermined sequence to filter the same image part in two or more consecutive images. 如申請專利範圍第6項所述之方法,當讀作為依附於申請專利範圍第2項時,還包括使用該旋轉複製推導來過濾第一影像中的一影像部分,並且按照預定序列使用兩種或更多種時間旋轉推導中的不同種時間旋轉推導來過濾在該第一影像之後的兩個或更多個其他影像中的相同影像部分。The method as described in item 6 of the patent application scope, when read as attached to item 2 of the patent application scope, also includes using the rotation copy derivation to filter one image part in the first image, and using two in a predetermined sequence Different kinds of time rotation derivation in one or more kinds of time rotation derivation to filter the same image part in two or more other images after the first image. 如申請專利範圍第7項所述之方法,其中透過使用該旋轉複製推導以及按照所述預定序列的該兩種或更多種時間旋轉推導,在所有可能的邊緣濾波方向中連續地切換影像部分的邊緣濾波的方向。The method as described in item 7 of the patent application scope, wherein by using the rotation copy derivation and the two or more time rotation derivations according to the predetermined sequence, the image part is continuously switched in all possible edge filtering directions The direction of the edge filter. 如申請專利範圍第1至8項中任一項所述之方法,其中所述或一個該時間推導是時間方向變換推導,其從表示該同位影像部分的邊緣濾波的方向的SAO參數推導得到表示影像部分的邊緣濾波的方向的SAO參數,使得屬於該組的該影像部分的邊緣濾波的該方向相對於該同位影像部分的邊緣濾波的該方向變換。The method according to any one of the items 1 to 8 of the patent application, wherein the or one of the time derivation is a time direction transformation derivation, which is derived from the SAO parameter derivation indicating the direction of edge filtering of the co-located image part The SAO parameter of the direction of the edge filtering of the image part is such that the direction of the edge filtering of the image part belonging to the group is transformed relative to the direction of the edge filtering of the co-located image part. 如申請專利範圍第1至9項所述之方法,其中不同的參考影像可以用於該目標影像部分的SAO參數的該時間推導。The method as described in items 1 to 9 of the patent application range, in which different reference images can be used for the time derivation of the SAO parameters of the target image part. 如申請專利範圍第10項所述之方法,包括搜尋遍歷複數個可用的參考影像,並且選擇其之該同位影像部分滿足至少一個搜尋條件的參考影像。The method as described in item 10 of the scope of the patent application includes searching and traversing a plurality of available reference images, and selecting the reference image whose part of the co-located image satisfies at least one search condition. 如申請專利範圍第11項所述之方法,其中所述或一個該搜尋條件是該同位影像部分使用SAO濾波。The method as described in item 11 of the patent application scope, wherein the or one of the search conditions is that the co-located image part uses SAO filtering. 如申請專利範圍第11項所述之方法,其中所述或一個該搜尋條件是該同位影像部分使用邊緣類型SAO濾波。The method as described in item 11 of the patent application scope, wherein the or one of the search conditions is that the co-located image part uses edge type SAO filtering. 如申請專利範圍第11、12或13項所述之方法,包括使用第一搜尋條件來執行遍歷該些可用的參考影像的第一搜尋,並且若沒有可用的參考影像滿足該第一搜尋條件,則使用不同於該第一搜尋條件的第二搜尋條件來執行遍歷該些可用的參考影像的第二搜尋。The method as described in item 11, 12, or 13 of the patent application scope includes using a first search condition to perform a first search through the available reference images, and if no available reference image satisfies the first search condition, Then, a second search condition different from the first search condition is used to perform a second search through the available reference images. 如申請專利範圍第14項所述之方法,其中該第一搜尋條件是該同位影像部分使用邊緣類型SAO濾波,並且該第二搜尋條件是該同位影像部分使用帶類型SAO濾波。The method as described in item 14 of the patent application range, wherein the first search condition is that the co-located image portion uses edge type SAO filtering, and the second search condition is that the co-located image portion uses band type SAO filtering. 如申請專利範圍第11至15項中任一項所述之方法,其中從最高編碼效率至最低編碼效率依序搜尋該些參考影像。The method according to any one of items 11 to 15 of the patent application range, wherein the reference images are searched in order from the highest encoding efficiency to the lowest encoding efficiency. 如申請專利範圍第10至16項中任一項所述之方法,包括基於用於該組的該些影像部分的時間預測的一或多個參考影像的列表,創建用於SAO參數之該時間推導的參考影像的列表,其中從用於SAO參數之該時間推導的該參考影像的列表排除在該一或多個時間預測列表之中的至少一個參考影像,並且從用於SAO參數之該時間推導的該參考影像的列表選擇用於SAO參數之該時間推導的參考影像。The method as described in any of items 10 to 16 of the patent application scope, including creating a time for SAO parameters based on a list of one or more reference images used for time prediction of the image parts of the group A list of derived reference images, where at least one reference image in the one or more temporal prediction lists is excluded from the list of reference images derived from the time for SAO parameters, and from the time for SAO parameters The derived list of reference images selects the reference image for SAO parameter derivation at that time. 如申請專利範圍第17項所述之方法,其中從用於SAO參數之該時間推導的該參考影像的列表排除在該一或多個時間預測列表之中的冗餘參考影像。The method as described in item 17 of the patent application scope, wherein redundant reference images in the one or more temporal prediction lists are excluded from the list of reference images derived from the time for SAO parameters. 如申請專利範圍第17或18項所述之方法,其中從用於SAO參數之該時間推導的該參考影像的列表排除其之各自的同位影像部分不使用SAO濾波、或者其之各自的同位部分不使用邊緣類型SAO濾波的參考影像。The method as described in item 17 or 18 of the patent application scope, in which the respective co-located image portions of the reference image that are derived from the time used for the SAO parameter are excluded from the use of SAO filtering, or their respective co-located portions Reference image without edge type SAO filtering. 如申請專利範圍第17項所述之方法,包括對可以包括在用於SAO參數之該時間推導的該參考影像的列表中的數個參考影像強加最大值。The method as described in item 17 of the patent application scope includes imposing a maximum value on several reference images that can be included in the list of reference images for the time derivation of SAO parameters. 一種編碼影像的方法,包括使用如申請專利範圍第1至20項中任一項所述之方法執行取樣自適應偏移(SAO)濾波。A method for encoding an image, which includes performing sampling adaptive offset (SAO) filtering using the method as described in any one of claims 1 to 20. 如申請專利範圍第21項所述之編碼影像的方法,包括: 評估用於影像部分的SAO參數的所述不同推導; 比較該些不同推導的評估結果;以及 基於該比較結果選擇要施用於該影像部分的所述推導之其中一者。The method of encoding images as described in item 21 of the patent application scope includes: Evaluate the different derivations of the SAO parameters used in the image part; Compare these differently derived assessment results; and Based on the comparison result, one of the derivations to be applied to the image part is selected. 如申請專利範圍第21或22項之方法,包括產生表示該選擇的推導的一或多條資訊項目,並且將該(些)項目包括在位元流中以供解碼器使用。For example, the method of claim 21 or 22 includes generating one or more information items representing the derivation of the selection, and including the item(s) in the bitstream for use by the decoder. 一種解碼影像的方法,包括使用如申請專利範圍第1至20項中任一項所述之方法執行取樣自適應偏移(SAO)濾波。A method for decoding an image, including performing sample adaptive offset (SAO) filtering using the method as described in any one of patent application items 1 to 20. 一種對包括複數個影像部分的影像執行取樣自適應偏移(SAO)濾波的裝置,該裝置包括: 選擇裝置,用於從SAO參數的兩種或更多種可用的時間推導之中,選擇要施用於一影像部分的SAO參數的時間推導,該些可用的時間推導包括從參考影像中的同位(collocated)影像部分的SAO參數推導得到該影像部分的至少一個該SAO參數的不同方式;以及 執行裝置,用於使用該推導得到的SAO參數對該影像部分執行SAO濾波。A device for performing sample adaptive offset (SAO) filtering on an image including a plurality of image parts, the device includes: The selection device is used to select the time derivation of the SAO parameters to be applied to an image part from the two or more available time derivations of the SAO parameters. The available time derivations include the parity from the reference image ( collocated) different ways of deriving the SAO parameters of the image part to obtain at least one of the SAO parameters of the image part; and The executing device is configured to perform SAO filtering on the image part using the derived SAO parameters. 一種編碼器,包含如申請專利範圍第25項所述之裝置。An encoder including the device described in item 25 of the patent application scope. 一種解碼器,包含如申請專利範圍第25項所述之裝置。A decoder including the device described in item 25 of the patent application scope. 一種程式,當由電腦或處理器執行時,使該電腦或處理器執行如申請專利範圍第1至24項中任一項所述之方法。A program, when executed by a computer or processor, causes the computer or processor to execute the method as described in any one of items 1 to 24 of the patent application. 一種攜帶由視訊位元流表示之影像的資訊資料集的信號,該影像包括一組可重建樣本,每個可重建樣本具有樣本值,該資訊資料集包括語法元素,該語法元素指示SAO參數的兩種或更多種可用的時間推導中的哪一種已被選擇來施用於一影像部分,該些可用的時間推導包括從參考影像中的同位影像部分的SAO參數推導得到該影像部分的至少一個該SAO參數的不同方式。A signal that carries an information data set of an image represented by a stream of video bits. The image includes a set of reconstructable samples, each of which has a sample value. The information data set includes a syntax element that indicates the SAO parameter’s Which one of two or more available time derivations has been selected for application to an image part, the available time derivations includes derivation of at least one of the image part from the SAO parameters of the co-located image part in the reference image The SAO parameters are different ways.
TW108118391A 2018-06-05 2019-05-28 Video coding and decoding TW202005371A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
GB1809233.8 2018-06-05
GB1809233.8A GB2574422A (en) 2018-06-05 2018-06-05 Video coding and decoding

Publications (1)

Publication Number Publication Date
TW202005371A true TW202005371A (en) 2020-01-16

Family

ID=62975623

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108118391A TW202005371A (en) 2018-06-05 2019-05-28 Video coding and decoding

Country Status (3)

Country Link
GB (1) GB2574422A (en)
TW (1) TW202005371A (en)
WO (1) WO2019233998A1 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10070152B2 (en) * 2011-08-24 2018-09-04 Texas Instruments Incorporated Sample adaptive offset (SAO) parameter signaling
US9560362B2 (en) * 2011-12-22 2017-01-31 Mediatek Inc. Method and apparatus of texture image compression in 3D video coding
US9769450B2 (en) * 2012-07-04 2017-09-19 Intel Corporation Inter-view filter parameters re-use for three dimensional video coding
GB2509563A (en) 2013-01-04 2014-07-09 Canon Kk Encoding or decoding a scalable video sequence using inferred SAO parameters
KR102166335B1 (en) * 2013-04-19 2020-10-15 삼성전자주식회사 Method and apparatus for video encoding with transmitting SAO parameters, method and apparatus for video decoding with receiving SAO parameters
US10382766B2 (en) * 2016-05-09 2019-08-13 Qualcomm Incorporated Signalling of filtering information

Also Published As

Publication number Publication date
WO2019233998A1 (en) 2019-12-12
GB201809233D0 (en) 2018-07-25
GB2574422A (en) 2019-12-11

Similar Documents

Publication Publication Date Title
US11601687B2 (en) Method and device for providing compensation offsets for a set of reconstructed samples of an image
TWI782904B (en) Merging filters for multiple classes of blocks for video coding
CN109716771B (en) Linear model chroma intra prediction for video coding
CN114710679B9 (en) Small chroma block size restriction in video coding
CN116418993A (en) Video coding method, device and medium
WO2020057516A1 (en) Partitioning with high level constraint
CN116783889A (en) Codec enhancement in cross-component sample adaptive offset
JP2024029063A (en) Position dependent spatial varying transform for video coding
US20230336785A1 (en) Coding enhancement in cross-component sample adaptive offset
TW202005398A (en) Video coding and decoding
TW202013963A (en) Video coding and decoding
TW202005369A (en) Video coding and decoding
TW202005371A (en) Video coding and decoding
TW202005370A (en) Video coding and decoding
TW202013964A (en) Video coding and decoding
CN117203962A (en) Codec enhancement in cross-component sample adaptive offset
CN116671105A (en) Chroma codec enhancement in cross-component sample adaptive offset with virtual boundaries
CN118160303A (en) Method and apparatus for decoder-side intra mode derivation