Method and device for filtering decoded blocks of video data and storage medium
By using adaptive loop filtering technology in the video encoding and decoding process, constructing multiple filter sets and applying geometric transformations, the problem of failing to fully utilize the correlation between video blocks in the existing technology is solved, and the quality of video decoding is improved. and compression efficiency.
Patent Information
- Application Number
- CN202111105421.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2017-02-14
- Filing Date
- 2017-02-15
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2037-02-15
AI Technical Summary
When existing video decoding technology deals with the correlation between video blocks, decoding based on pure transformation only reduces the correlation between pixels within a specific block and fails to fully consider the correlation between blocks, resulting in poor video decoding quality.
Adaptive loop filtering (ALF) technology is used to construct multiple filter sets during the video encoding and decoding process, select appropriate filters according to block categories and apply geometric transformations to filter video data to improve decoding quality.
Through filtering operations, the video decoder's ability to reconstruct video blocks is improved, the video decoding quality is improved, and the compression efficiency and decoding performance are optimized.
Smart Images

Figure CN113891076B_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application with application number 201780010918.6 filed on February 15, 2017 and invention name “Method and device for filtering decoded blocks of video data and storage medium”.
[0002] This application claims the benefit of U.S. Provisional Application No. 62 / 295,461, filed on February 15, 2016, and U.S. Provisional Application No. 62 / 324,776, filed on April 19, 2016, the entire contents of each of which are hereby incorporated by reference. Technical Field
[0003] The present invention relates to video decoding. Background Art
[0004] Digital video capabilities may be incorporated into a wide range of devices, including digital televisions, digital live broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, tablet computers, e-book readers, digital cameras, digital recording devices, digital media players, video game devices, video game consoles, cellular or satellite radio telephones, so-called "smart phones", video teleconferencing devices, video streaming devices, and the like. Digital video devices implement video compression techniques, such as those described in the standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4 Part 10 Advanced Video Coding (AVC), the recently finalized ITU-T H.265, High Efficiency Video Coding (HEVC) standards, and extensions of such standards. Video devices may transmit, receive, encode, decode, and / or store digital video information more efficiently by implementing such video compression techniques.
[0005] Video compression techniques perform spatial (intra-picture) prediction and / or temporal (inter-picture) prediction to reduce or remove redundancy inherent in video sequences. For block-based video coding, a video slice (i.e., a video frame or portion of a video frame) may be partitioned into video blocks, which may also be referred to as treeblocks, coding units (CUs), and / or coding nodes. Video blocks in an intra-coded (I) slice of a picture are encoded using spatial prediction with respect to reference samples in neighboring blocks in the same picture. Video blocks in an inter-coded (P or B) slice of a picture may use spatial prediction with respect to reference samples in neighboring blocks in the same picture or temporal prediction with respect to reference samples in other reference pictures. Pictures may be referred to as frames, and reference pictures may be referred to as reference frames.
[0006] Spatial or temporal prediction produces a predictive block for the block to be coded. The residual data represents the pixel difference between the original block to be coded and the predictive block. The inter-coded block is encoded according to the motion vector pointing to the reference sample block forming the predictive block and the residual data indicating the difference between the coded block and the predictive block. The intra-coded block is encoded according to the intra-coding mode and the residual data. For further compression, the residual data can be transformed from the pixel domain to the transform domain, thereby generating residual transform coefficients, which can then be quantized. The quantized transform coefficients, initially arranged in a two-dimensional array, can be scanned to generate a one-dimensional vector of transform coefficients, and entropy coding can be applied to achieve even more compression. Summary of the invention
[0007] In general, this disclosure describes techniques related to filtering, such as adaptive loop filtering (ALF). In particular, various techniques for generating filters for different block categories of video data may be performed by a video coder, such as a video encoder or a video decoder. In one example, the video coder may construct multiple sets of filter coefficients and code indexes into the sets of filter coefficients for various block categories, where each index identifies the set of filter coefficients for the corresponding block category. In another example, the video coder may generate filters for block categories by using a set of filter coefficients of a previously generated filter and applying a geometric transform, such as a rotation, vertical flip, or diagonal flip, to a filter support region or to the filter coefficients themselves. In yet another example, the video coder may predict filter coefficients for block categories from a fixed filter or a filter of a previously coded picture.
[0008] In one example, a method of filtering a decoded block of video data includes decoding a current block of a current picture of the video data; selecting a filter to be used to filter pixels of the current block (e.g., according to adaptive loop filtering (ALF)); selecting a geometric transform to be performed on one of a filter support area or coefficients of the selected filter; performing the geometric transform on the filter support area or the coefficients of the selected filter; and filtering the at least one pixel of the current block using the selected filter after performing the geometric transform.
[0009] In another example, a device for filtering a decoded block of video data includes a memory configured to store the video data, and one or more processors implemented in circuitry and configured to: decode a current block of a current picture of the video data; select a filter to be used to filter pixels of the current block (e.g., according to adaptive loop filtering (ALF)); select a geometric transform to be performed on one of a filter support region or coefficients of the selected filter; and filter the at least one pixel of the current block using the selected filter after performing the geometric transform.
[0010] In another example, a device for filtering a decoded block of video data includes: means for decoding a current block of a current picture of the video data; means for selecting a filter to be used to filter pixels of the current block (e.g., according to adaptive loop filtering (ALF)); means for selecting a geometric transform to be performed on one of a filter support area or coefficients of the selected filter; means for performing the geometric transform on the filter support area or the coefficients of the selected filter; and means for filtering the at least one pixel of the current block using the selected filter after performing the geometric transform.
[0011] In another example, a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium) has stored thereon instructions that, when executed, cause a processor to: decode a current block of a current picture of video data; select a filter to be used to filter pixels of the current block (e.g., according to adaptive loop filtering (ALF)); select a geometric transform to be performed on one of a filter support area or coefficients of the selected filter; perform the geometric transform on the filter support area or the coefficients of the selected filter; and filter the at least one pixel of the current block using the selected filter after performing the geometric transform.
[0012] In another example, a method of filtering a decoded block of video data includes: constructing a plurality of filters for block categories of a current picture of the video data, wherein constructing the plurality of filters comprises, for each of the categories, determining whether to use a fixed filter to predict a set of filter coefficients for the category, and in response to determining to use a fixed filter to predict the set of filter coefficients, determining an index value into a set of fixed filters for the category and predicting the set of filter coefficients for the category using a fixed filter in the set of fixed filters identified by the index value; decoding a current block of the current picture of the video data; determining a category for the current block; selecting a filter from the plurality of filters that corresponds to the category for the current block; and filtering at least one pixel of the current block using the selected filter.
[0013] In another example, a device for filtering a decoded block of video data includes: a memory configured to store the video data; and one or more processing units implemented in a circuit system configured to: construct a plurality of filters for a block category of a current picture of the video data, wherein to construct the plurality of filters for each of the categories, the one or more processing units are configured to: determine whether to use a fixed filter to predict a set of filter coefficients for the category, and in response to determining to use a fixed filter to predict the set of filter coefficients, determine an index value into a set of fixed filters for the category and use a fixed filter in the set of fixed filters identified by the index value to predict the set of filter coefficients for the category; decode a current block of the current picture of the video data; determine a category for the current block; select a filter from the plurality of filters that corresponds to the category for the current block; and filter at least one pixel of the current block using the selected filter.
[0014] In another example, a device for filtering a decoded block of video data includes a device for constructing a plurality of filters for a block category of a current picture of the video data, wherein the device for constructing the plurality of filters includes a device for determining whether to use a fixed filter to predict a filter coefficient set for each of the categories, and a device for determining an index value into a fixed filter set for the category in response to determining to use a fixed filter to predict the filter coefficient set, and a device for predicting the filter coefficient set for the category using a fixed filter in the fixed filter set identified by the index value in response to determining to use a fixed filter to predict the filter coefficient set. The device further includes: a device for decoding a current block of the current picture of the video data; a device for determining a category for the current block; a device for selecting a filter from the plurality of filters that corresponds to the category for the current block; and a device for filtering at least one pixel of the current block using the selected filter.
[0015] In another example, a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium) has instructions stored thereon that, when executed, cause a processor to perform the following operations: construct a plurality of filters for a block category of a current picture of video data, wherein the instructions that cause the processor to construct the plurality of filters include instructions that cause the processor to perform the following operations for each of the categories: determine whether to use a fixed filter to predict a filter coefficient set for the category, and in response to determining to use a fixed filter to predict the filter coefficient set, determine an index value into the fixed filter set for the category and use the fixed filter identified by the index value in the fixed filter set to predict the filter coefficient set for the category; decode a current block of the current picture of the video data; determine a category for the current block; select a filter from the plurality of filters that corresponds to the category for the current block; and filter at least one pixel of the current block using the selected filter.
[0016] In another example, a method of filtering a decoded block of video data includes constructing a plurality of filters for a block category of a current picture of the video data, wherein constructing the plurality of filters comprises determining a number of sets of filter coefficients to be generated, generating the number of sets of filter coefficients, and determining, for a subset of the plurality of filters, a respective index of the sets of filter coefficients that identifies one of the corresponding filters for the subset; decoding a current block of the current picture; determining a category for the current block; selecting a filter of the plurality of filters that corresponds to the category for the current block; and filtering at least one pixel of the current block using the selected filter.
[0017] In another example, a device for filtering a decoded block of video data includes: a memory configured to store video data; and one or more processing units implemented in a circuit system configured to: construct a plurality of filters for a block category of a current picture of the video data, wherein to construct the plurality of filters, the one or more processing units are configured to: determine a number of sets of filter coefficients to be generated, generate the plurality of sets of filter coefficients, and determine, for a subset of the plurality of filters, a respective index of one of the sets of filter coefficients identifying the corresponding filter for the subset; decode a current block of the current picture; determine a category for the current block; select a filter of the plurality of filters that corresponds to the category for the current block; and filter at least one pixel of the current block using the selected filter.
[0018] In another example, a device for filtering a decoded block of video data includes a device for constructing a plurality of filters for a block category of a current picture of the video data, wherein the device for constructing the plurality of filters comprises: a device for determining a number of sets of filter coefficients to be generated; a device for generating the number of sets of filter coefficients; and a device for determining, for a subset of the plurality of filters, a respective index of one of the sets of filter coefficients identifying the corresponding filter for the subset, and the device further comprises: a device for decoding a current block of the current picture; a device for determining a category for the current block; a device for selecting a filter of the plurality of filters that corresponds to the category for the current block; and a device for filtering at least one pixel of the current block using the selected filter.
[0019] In another example, a computer-readable storage medium has instructions stored thereon that, when executed, cause a processor to: construct a plurality of filters for a block category of a current picture of video data, wherein the instructions that cause the processor to construct the plurality of filters include instructions that cause the processor to: generate a plurality of sets of filter coefficients; and determine, for a subset of the plurality of filters, a respective index of one of the sets of filter coefficients that identifies the corresponding filter for the subset; decode a current block of the current picture; determine a category for the current block; select a filter from the plurality of filters that corresponds to the category for the current block; and filter at least one pixel of the current block using the selected filter.
[0020] The details of one or more examples are set forth in the accompanying drawings and description below. Other features, objects, and advantages will be apparent from the description and drawings, and from the claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a block diagram illustrating an example video encoding and decoding system that may utilize the techniques described in this disclosure.
[0022] Figure 2 A conceptual diagram illustrating the mapping of ranges to filters for activity and direction metrics.
[0023] Figure 3 A conceptual diagram illustrating an example mode for signaling filter coefficient differences.
[0024] Figure 4 is a block diagram illustrating an example video encoder that may implement the techniques described in this disclosure.
[0025] Figure 5 is a block diagram illustrating an example video decoder that may implement the techniques described in this disclosure.
[0026] Figure 6 SUMMARY OF THE INVENTION 1 is a flow diagram illustrating an example method for filtering, by a video encoder (eg, during a video encoding process), blocks of a decoded picture.
[0027] Figure 7 SUMMARY OF THE INVENTION 1 is a flow diagram illustrating an example method for filtering, by a video decoder (eg, during a video decoding process), blocks of a decoded picture.
[0028] Figure 8 SUMMARY OF THE INVENTION 1 is a flow diagram illustrating an example method for filtering, by a video encoder (eg, during a video encoding process), blocks of a decoded picture.
[0029] Fig. 9 SUMMARY OF THE INVENTION 1 is a flow diagram illustrating an example method for filtering, by a video decoder (eg, during a video decoding process), blocks of a decoded picture.
[0030] Fig.10 SUMMARY OF THE INVENTION 1 is a flow diagram illustrating an example method for filtering, by a video encoder (eg, during a video encoding process), blocks of a decoded picture.
[0031] Fig.11 SUMMARY OF THE INVENTION 1 is a flow diagram illustrating an example method for filtering, by a video decoder (eg, during a video decoding process), blocks of a decoded picture. DETAILED DESCRIPTION
[0032] In a typical video encoder, frames of an original video sequence are divided into rectangular regions or blocks, which are encoded in intra-mode (I-mode) or inter-mode (P-mode). Blocks are decoded using some transform coding such as DCT coding. However, pure transform-based coding only reduces the correlation between pixels within a particular block, without considering the correlation between blocks of pixels, and it still produces a high bit rate for transmission. Current digital image decoding standards also adopt certain methods of reducing the correlation of pixel values between blocks. It will be clear from the following description that the term "video coding" may be used in the present invention to generally refer to video encoding or video decoding.
[0033] In general, blocks encoded in P mode are predicted from one of the previously decoded frames and the previously transmitted frames. The prediction information for a block is represented by a two-dimensional (2D) motion vector. For blocks encoded in I mode, a predicted block is formed from already encoded neighboring blocks within the same frame using spatial prediction. The prediction error (i.e., the difference between the block being encoded and the predicted block) is represented as a set of weighted basis functions of a discrete transform. The transform is usually performed based on 8×8 or 4×4 blocks. The weighted transform coefficients are then quantized. Quantization introduces a loss of information, and therefore, the quantized coefficients have lower accuracy than the original coefficients.
[0034] The quantized transform coefficients, together with motion vectors and some control information, form a complete coded sequence representation and are referred to as syntax elements.Before transmission from the encoder to the decoder, the syntax elements are entropy encoded in order to further reduce the number of bits used to represent the syntax elements.
[0035] In the decoder, the block is obtained by first constructing a prediction of the block in the current frame in the same way as in the encoder and adding the compressed prediction error to the prediction. The compressed prediction error is found by weighting the transform basis function using the quantized coefficients. The difference between the reconstructed frame and the original frame is called the reconstructed error.
[0036] To further improve the quality of the decoded video, the video decoder may perform one or more filtering operations on the reconstructed video blocks. Examples of such filtering operations include deblocking filtering, sample adaptive offset (SAO) filtering, and adaptive loop filtering (ALF). Parameters for such filtering operations may be determined by the video encoder and explicitly signaled in the encoded video bitstream, or may be implicitly determined by the video decoder.
[0037] The present invention describes techniques associated with filtering reconstructed video data during video encoding and / or video decoding, and more particularly, the present invention describes techniques related to ALF. According to the present invention, filtering is applied at the encoder, and filter information is encoded in the bitstream to enable the decoder to identify the filtering applied at the encoder. The video encoder can test several different filtering scenarios and select a filter or filter set that produces a desired trade-off between reconstructed video quality and compression quality based on rate-distortion analysis. The video decoder receives the encoded video data including the filter information, decodes the video data, and applies filtering based on the filter information. In this way, the video decoder applies the same filtering applied at the video encoder.
[0038] In this disclosure, the term "filter" generally refers to a set of filter coefficients. For example, a 3×3 filter may be defined by a set of 9 filter coefficients, a 5×5 filter may be defined by a set of 25 filter coefficients, a 9×5 filter may be defined by a set of 45 filter coefficients, and so on. The term "filter set" generally refers to a group of more than one filter. For example, a set of two 3×3 filters may include a first set of 9 filter coefficients and a second set of 9 filter coefficients. The term "shape" (sometimes referred to as "filter support") generally refers to the number of rows of filter coefficients and the number of columns of filter coefficients used for a particular filter. For example, 9×9 is an example of a first shape, 7×5 is an example of a second shape, and 5×9 is an example of a third shape. In some cases, the filter may take a non-rectangular shape, including a diamond shape, a diamond-like shape, a circular shape, a circular-like shape, a hexagonal shape, an octagonal shape, a cross shape, an X-shape, a T-shape, other geometric shapes, or numerous other shapes or configurations. In this case, for non-rectangular filter support, the number of filter coefficients may be different. For example, for 9×9 diamond filter support, a 9×9 diamond filter may be defined by a set of (9×9 / 4+1) filter coefficients.
[0039] Figure 1 1 is a block diagram illustrating an example video encoding and decoding system 10 that may implement the techniques described in this disclosure. Figure 1 As shown, system 10 includes a source device 12 that generates encoded video data to be later decoded by a destination device 14. Source device 12 and destination device 14 may comprise any of a wide range of devices, including desktop computers, notebook (i.e., laptop) computers, tablet computers, set-top boxes, telephone handsets (e.g., so-called "smart" phones), so-called "smart" pads, televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, or the like. In some cases, source device 12 and destination device 14 may be equipped for wireless communication.
[0040] Destination device 14 may receive the encoded video data to be decoded via link 16. Link 16 may include any type of media or device capable of moving the encoded video data from source device 12 to destination device 14. In one example, link 16 may include a communication medium to enable source device 12 to transmit the encoded video data directly to destination device 14 in real-time. The encoded video data may be modulated according to a communication standard, such as a wireless communication protocol, and transmitted to destination device 14. The communication medium may include any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet-based network, such as a local area network, a wide area network, or a global network such as the Internet. The communication medium may include routers, switches, base stations, or any other equipment that can be used to facilitate communication from source device 12 to destination device 14.
[0041] Alternatively, the encoded data may be output from output interface 22 to storage device 26. Similarly, the encoded data may be accessed from storage device 26 by input interface. Storage device 26 may include any of a variety of distributed or locally accessible data storage media, such as a hard drive, a Blu-ray disc, a DVD, a CD-ROM, a flash memory, a volatile or non-volatile memory, or any other suitable digital storage medium for storing encoded video data. In another example, storage device 26 may correspond to a file server or another intermediate storage device that can hold the encoded video generated by source device 12. Destination device 14 may access the stored video data from storage device 26 via streaming or downloading. The file server may be any type of server capable of storing encoded video data and transmitting the encoded video data to destination device 14. Example file servers include a web server (e.g., for a website), an FTP server, a network attached storage (NAS) device, or a local disk drive. Destination device 14 may access the encoded video data via any standard data connection, including an Internet connection. This data connection may include a wireless channel (e.g., a Wi-Fi connection), a wired connection (e.g., DSL, cable modem, etc.), or a combination of both, suitable for accessing encoded video data stored on a file server. The transmission of the encoded video data from storage device 26 may be a streaming transmission, a download transmission, or a combination of both.
[0042] The techniques of this disclosure are not necessarily limited to wireless applications or settings. The techniques may be applied to video coding to support any of a variety of multimedia applications, such as over-the-air television broadcasts, cable television transmissions, satellite television transmissions, streaming video transmissions (e.g., via the Internet), encoding of digital video for storage on a data storage medium, decoding of digital video stored on a data storage medium, or other applications. In some examples, system 10 may be configured to support one-way or two-way video transmissions to support applications such as video streaming, video playback, video broadcasting, and / or video telephony.
[0043] exist Figure 1 In an example of , source device 12 includes a video source 18, a video encoder 20, and an output interface 22. In some cases, output interface 22 may include a modulator / demodulator (modem) and / or a transmitter. In source device 12, video source 18 may include a source such as a video capture device (e.g., a video camera), a video file library containing previously captured video, a video feed interface for receiving video from a video content provider, and / or a computer graphics system for generating computer graphics data as source video, or a combination of such sources. As an example, if video source 18 is a video camera, source device 12 and destination device 14 may form so-called camera phones or video phones. However, the techniques described in this disclosure may be applicable to video coding in general, and may be applied to wireless and / or wired applications.
[0044] The captured video, pre-captured video, or computer-generated video may be encoded by video encoder 20. The encoded video data may be transmitted directly to destination device 14 via output interface 22 of source device 12. Alternatively, the encoded video data may be stored on storage device 26 for later access by destination device 14 or other devices for decoding and / or playback.
[0045] Destination device 14 includes input interface 28, video decoder 30, and display device 32. In some cases, input interface 28 may include a receiver and / or a modem. Input interface 28 of destination device 14 receives encoded video data via link 16. The encoded video data communicated via link 16 or provided on storage device 26 may include a variety of syntax elements generated by video encoder 20 for use by a video decoder, such as video decoder 30, to decode the video data. Such syntax elements may be included with the encoded video data transmitted on a communication medium, stored on a storage medium, or stored on a file server.
[0046] Display device 32 may be integrated with destination device 14 or external to destination device 14. In some examples, destination device 14 may include an integrated display device and also be configured to interface with an external display device. In other examples, destination device 14 may be a display device. In general, display device 32 displays decoded video data to a user, and may include any of a variety of display devices such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or another type of display device.
[0047] Video encoder 20 and video decoder 30 may operate according to a video compression standard, such as the recently finalized High Efficiency Video Coding (HEVC) standard, and may conform to the HEVC Test Model (HM). Alternatively, video encoder 20 and video decoder 30 may operate according to other proprietary or industry standards, such as the ITU-T H.264 standard (alternatively referred to as MPEG-4) Part 10 Advanced Video Coding (AVC), or extensions of such standards. However, the techniques of this disclosure are not limited to any particular coding standard. Other examples of video compression standards include MPEG-2 and ITU-T H.263.
[0048] The techniques of this disclosure may utilize HEVC terminology for ease of explanation. However, it should not be assumed that the techniques of this disclosure are limited to HEVC, and in fact, it is expressly contemplated that the techniques of this disclosure may be implemented in subsequent standards of HEVC and extensions thereof.
[0049] although Figure 1 20 and video decoder 30 may each be integrated with an audio encoder and decoder, and may include appropriate MUX-DEMUX units or other hardware and software to handle the encoding of both audio and video in a common data stream or in separate data streams. Where applicable, in some examples, the MUX-DEMUX units may conform to the ITU H.223 multiplexer protocol, or other protocols such as the User Datagram Protocol (UDP).
[0050] Video encoder 20 and video decoder 30 may each be implemented as any of a variety of suitable encoder circuitry, such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic, software, hardware, firmware, or any combination thereof. When the techniques are implemented partially in software, a device may store instructions for the software in a suitable, non-transitory computer-readable medium and execute the instructions in hardware using one or more processors to perform the techniques of this disclosure. Each of video encoder 20 and video decoder 30 may be included in one or more encoders or decoders, either of which may be integrated as part of a combined encoder / decoder (CODEC) in a respective device.
[0051] As introduced above, JCT-VC has recently finalized the development of the HEVC standard. The HEVC standardization effort is based on an evolutionary model of a video coding device, referred to as the HEVC Test Model (HM). The HM infers several additional capabilities of a video coding device relative to existing devices according to, for example, ITU-T H.264 / AVC. For example, the HM may provide up to thirty-five intra-frame prediction coding modes, while H.264 provides nine intra-frame prediction coding modes.
[0052] In HEVC and other video coding specifications, a video sequence usually consists of a series of pictures. A picture can also be called a "frame". A picture can consist of three sample arrays, denoted as S L , S Cb and S Cr . S L is a two-dimensional array (i.e., block) of luma samples. Cb is a two-dimensional array of Cb chroma samples. Cr is a two-dimensional array of Cr chroma samples. Chroma samples may also be referred to herein as "chroma" samples. In other cases, a picture may be monochrome and may only include an array of luma samples.
[0053] To generate an encoded representation of a picture, video encoder 20 may generate a set of coding tree units (CTUs). Each of the CTUs may include a coding tree block of luma samples, two corresponding coding tree blocks of chroma samples, and a syntax structure used to code the samples of the coding tree block. In a monochrome picture or a picture with three separate color planes, a CTU may include a single coding tree block and a syntax structure used to code the samples of the coding tree block. A coding tree block may be an N×N block of samples. A CTU may also be referred to as a “tree block” or a “largest coding unit” (LCU). A CTU of HEVC may be substantially similar to a macroblock of other standards such as H.264 / AVC. However, a CTU is not necessarily limited to a particular size and may include one or more coding units (CUs). A slice may include an integer number of CTUs ordered consecutively in raster scan order.
[0054] To generate a coded CTU, video encoder 20 may recursively perform quadtree partitioning on the coding treeblock of the CTU to divide the coding treeblock into coding blocks, hence the name "coding tree unit". A coding block may be an NxN block of samples. A CU may include a coding block of luma samples and two corresponding coding blocks of chroma samples of a picture having a luma sample array, a Cb sample array, and a Cr sample array, and syntax structures used to code the samples of the coding blocks. In a monochrome picture or a picture with three separate color planes, a CU may include a single coding block, and syntax structures used to code the samples of the coding block.
[0055] Video encoder 20 may partition the coding blocks of a CU into one or more prediction blocks. A prediction block may be a rectangular (i.e., square or non-square) block of samples to which the same prediction is applied. A prediction unit (PU) of a CU may include a prediction block of luma samples, two corresponding prediction blocks of chroma samples, and syntax structures used to predict the prediction blocks. In monochrome pictures or pictures with three separate color planes, a PU may include a single prediction block and syntax structures used to predict the prediction blocks. Video encoder 20 may generate predictive luma, Cb, and Cr blocks for the luma, Cb, and Cr prediction blocks of each PU of a CU.
[0056] Video encoder 20 may use intra prediction or inter prediction to generate predictive blocks for a PU. If video encoder 20 uses intra prediction to generate predictive blocks for a PU, video encoder 20 may generate the predictive blocks for the PU based on decoded samples of a picture associated with the PU. If video encoder 20 uses inter prediction to generate predictive blocks for a PU, video encoder 20 may generate the predictive blocks for the PU based on decoded samples of one or more pictures other than the picture associated with the PU.
[0057] After video encoder 20 generates predictive luma blocks, predictive Cb blocks, and predictive Cr blocks for one or more PUs of a CU, video encoder 20 may generate a luma residual block for the CU. Each sample in the luma residual block of the CU indicates the difference between a luma sample in one of the predictive luma blocks of the CU and a corresponding sample in the original luma coding block of the CU. In addition, video encoder 20 may generate a Cb residual block for the CU. Each sample in the Cb residual block of the CU may indicate the difference between a Cb sample in one of the predictive Cb blocks of the CU and a corresponding sample in the original Cb coding block of the CU. Video encoder 20 may also generate a Cr residual block for the CU. Each sample in the Cr residual block of the CU may indicate the difference between a Cr sample in one of the predictive Cr blocks of the CU and a corresponding sample in the original Cr coding block of the CU.
[0058] In addition, video encoder 20 may use quadtree partitioning to decompose the luma residual block, Cb residual block, and Cr residual block of a CU into one or more luma transform blocks, Cb transform blocks, and Cr transform blocks. A transform block is a rectangular (i.e., square or non-square) block of samples to which the same transform is applied. A transform unit (TU) of a CU may include a transform block of luma samples, two corresponding transform blocks of chroma samples, and a syntax structure used to transform the transform block samples. Thus, each TU of a CU may be associated with a luma transform block, a Cb transform block, and a Cr transform block. The luma transform block associated with a TU may be a sub-block of the luma residual block of the CU. The Cb transform block may be a sub-block of the Cb residual block of the CU. The Cr transform block may be a sub-block of the Cr residual block of the CU. In a monochrome picture or a picture with three separate color planes, a TU may include a single transform block and a syntax structure used to transform the samples of the transform block.
[0059] Video encoder 20 may apply one or more transforms to a luma transform block of a TU to generate a luma coefficient block for the TU. A coefficient block may be a two-dimensional array of transform coefficients. The transform coefficients may be scalars. Video encoder 20 may apply one or more transforms to a Cb transform block of a TU to generate a Cb coefficient block for the TU. Video encoder 20 may apply one or more transforms to a Cr transform block of a TU to generate a Cr coefficient block for the TU.
[0060] After generating a coefficient block (e.g., a luma coefficient block, a Cb coefficient block, or a Cr coefficient block), video encoder 20 may quantize the coefficient block. Quantization generally refers to the process of quantizing transform coefficients to possibly reduce the amount of data used to represent the transform coefficients, providing further compression. After video encoder 20 quantizes the coefficient block, video encoder 20 may entropy encode syntax elements indicating the quantized transform coefficients. For example, video encoder 20 may perform context adaptive binary arithmetic coding (CABAC) on the syntax elements indicating the quantized transform coefficients.
[0061] Video encoder 20 may output a bitstream that includes a sequence of bits that form a representation of a coded picture and associated data. The bitstream may include a sequence of NAL units. A NAL unit is a syntax structure that contains an indication of the type of data in the NAL unit and a bit group containing the data, the bit group being in the form of an RBSP interspersed with analog prevention bits, if necessary. Each of the NAL units includes a NAL unit header and encapsulates an RBSP. The NAL unit header may include a syntax element indicating a NAL unit type code. The NAL unit type code specified by the NAL unit header of the NAL unit indicates the type of the NAL unit. The RBSP may be a syntax structure containing an integer number of bit groups encapsulated within the NAL unit. In some cases, the RBSP includes zero bits.
[0062] Different types of NAL units may encapsulate different types of RBSPs. For example, a first type of NAL unit may encapsulate RBSPs for PPS, a second type of NAL unit may encapsulate RBSPs for coded slices, a third type of NAL unit may encapsulate RBSPs for SEI messages, etc. NAL units that encapsulate RBSPs for video coding data (as opposed to RBSPs for parameter sets and SEI messages) may be referred to as VCL NAL units.
[0063] The video decoder 30 may receive a bitstream generated by the video encoder 20. In addition, the video decoder 30 may parse the bitstream to obtain syntax elements from the bitstream. The video decoder 30 may reconstruct a picture of the video data based at least in part on the syntax elements obtained from the bitstream. The process used to reconstruct the video data may be substantially reciprocal to the process performed by the video encoder 20. In addition, the video decoder 30 may inverse quantize the coefficient blocks associated with the TUs of the current CU. The video decoder 30 may perform an inverse transform on the coefficient blocks to reconstruct the transform blocks associated with the TUs of the current CU. The video decoder 30 may reconstruct the coding blocks of the current CU by adding samples of the predictive blocks for the PUs of the current CU to corresponding samples of the transform blocks of the TUs of the current CU. By reconstructing the coding blocks for each CU of the picture, the video decoder 30 may reconstruct the picture.
[0064] In the field of video coding, it is common to apply filtering in order to enhance the quality of the decoded video signal. The filter can be applied as a post-filter, where the filtered frame is not used to predict future frames; or the filter can be applied as an in-loop filter, where the filtered frame can be used to predict future frames. The filter can be designed by, for example, minimizing the error between the original signal and the decoded filtered signal. Similar to the transform coefficients, the coefficients of the filter h(k,l) (k=-K, ..., K, l=-K, ...K) can be quantized as
[0065] f(k,l)=round(normFactor·h(k,l))
[0066] is decoded and sent to the decoder. normFactor is usually equal to 2 n The larger the value of normFactor, the more precise the quantization, which generally produces quantized filter coefficients f(k,l) that provide better performance. On the other hand, larger values of normFactor generally produce coefficients f(k,l) that require more bits for transmission.
[0067] At the decoder, the decoded filter coefficients f(k,l) are applied to the reconstructed image R(i,j) as follows
[0068]
[0069] Where i and j are the coordinates of the pixels in the frame.
[0070] ALF was proposed in HEVC and included in various working drafts and test model software (i.e., HEVC Test Model (or "HM")), but ALF was not included in the final version of HEVC. Among the related arts, the filter design in HEVC Test Model version HM-3.0 is generally regarded as the most efficient design.
[0071] ALF in HM-3.0 is based on picture level optimization. That is, the filter coefficients are derived after decoding the entire frame. There are two modes for luma components: block-based adaptation (BA) and region-based adaptation (RA). These two modes share the same filter shape and filtering operation as well as syntax elements. The only difference between the modes is the classification method.
[0072] Adaptive loop filtering (ALF) with block-based adaptation in HM-3.0 is an example of an in-loop filter. In the ALF for luma components, 4×4 blocks in the entire picture are classified based on the directionality of the blocks (up to 3 directions) and the 2D Laplacian activity of the blocks (up to 5 activity values), under the assumption that different filters should exist for regions in the image with different characteristics. The calculation of the directionality D and the unquantized activity A is shown in equations (2) to (5):
[0073]
[0074]
[0075]
[0076]
[0077] Where R(i,j) indicates the reconstructed pixel with relative coordinates (i,j) at the top left of the 4×4 block. A is further quantized to a range of 0 to 4 (0 and 4 inclusive) as described in HM-3.0, and the quantized value of A will be represented as
[0078] In summary, each block can be classified into one of 15 (5×3) categories, and the D and Each 4×4 block is assigned an index based on the value of: Thus, up to 15 ALF parameter sets may be signaled for the luma component of a picture. To save signaling cost, the categories may be merged along the category index value. For each category (or merged categories), a filter coefficient set may be signaled. Additionally, in HM-3.0, a flag is signaled at the CU level to indicate whether ALF is applied to the CU.
[0079] According to the techniques of this disclosure, a video coding device (e.g., video encoder 20 or video decoder 30) may perform filtering of decoded video data. It should be noted that the unit for signaling filter coefficients may be a picture / frame, a slice, an image block, or other. For simplicity, the following description primarily treats the unit as a picture. However, the techniques of this disclosure are not limited to picture-level ALF signaling. As discussed in more detail below, after video encoder 20 encodes a picture of video data, video encoder 20 may subsequently decode the picture, e.g., for use as a reference picture. In this manner, video encoder 20 encodes and decodes video data. Video encoder 20 and video decoder 30 may perform filtering as an "in-loop" filtering process, thereby applying the ALF to a decoded picture, which is then used as a reference picture for a subsequently encoded picture and / or a subsequently decoded picture. The description of a "video decoder" in this disclosure should be understood as a description of a video encoder, such as video encoder 20, and a video decoder, such as video decoder 30.
[0080] According to the techniques of this disclosure, a video coder (e.g., video encoder 20 and / or video decoder 30) may construct filters for various block categories. The video coder may classify blocks based on, for example, the directionality of gradients calculated from pixels of the block. The video coder may calculate one or more of a horizontal gradient, a vertical gradient, a 45-degree diagonal gradient, or a 135-degree diagonal gradient. In general, the video coder may construct different filters for each block category. However, in some cases, the video coder may calculate a set of filter coefficients used by two or more block categories. For example, the video coder may calculate multiple sets of filter coefficients. The video coder may further code an index identifying one of the multiple sets of filter coefficients for each block category (or a subset of block categories). Therefore, in the case where the video coder codes the same index for two or more block categories, the block categories will use the same set of filter coefficients, i.e., the set of filter coefficients corresponding to the coded index value.
[0081] Additionally or alternatively, the video coder may indicate that, for at least one block category, the filter is to be generated by using the same filter, but where a geometric transform is applied to the filter support region or filter coefficients of the filter. Thus, even for blocks with the same category index, the filter support may be different due to the geometric transform. Functionally, applying a geometric transform to the filter support region results in the same mathematical result as applying a geometric transform to the filter coefficients, and therefore, the video coder may apply the geometric transform to the filter support region or filter coefficients. In this example, the video coder may code, for the current block category, identifying the type of geometric transform (e.g., rotation, diagonal flip, or vertical flip, or non-geometric transform) and data of a previously constructed filter whose filter coefficients are to be used for the generated filter of the current block category.
[0082] Additionally or alternatively, the video coder may code a value (e.g., a value of a flag) indicating whether at least one fixed filter is used to predict filter coefficients for a block class. That is, the flag may indicate, for example, whether filter coefficients of a filter for a block class are predicted from a fixed filter, or are instead predicted (or inherited) from a filter of a previously coded picture, or are predicted without being predicted from a fixed filter or from a filter of a previously coded picture. In some examples, the video coder may be configured to have multiple fixed filters for each block class. In such examples, when the value indicates that the filter coefficients are predicted from a fixed filter, the video coder may additionally code an index into the multiple fixed filters that identifies one of the multiple fixed filters to be used to predict the filter coefficients of the current filter for the block class.
[0083] In some examples, the video coder may further code information indicating the following situations: none of the filter coefficients for any category are predicted from any fixed filter, or all filter coefficients are predicted from fixed filters, or there are some filter coefficients predicted from fixed filters, while other filter coefficients are not predicted from fixed filters. When none of the filter coefficients are predicted from fixed filters, the video coder may avoid (e.g., omit or prevent) coding of data representing indexes into multiple fixed filters. On the other hand, when some or all of the filter coefficients are predicted from fixed filters, the video program code may further code a flag for each category indicating whether the filter for one category is predicted from a fixed filter. In addition, the video coder may code the index into a respective plurality of fixed filters for the filter coefficient set predicted from a fixed filter, wherein the index identifies the reference fixed filter for predicting the corresponding filter coefficient. In addition, the video coder may use the fixed filter identified by the index to predict the corresponding filter coefficient. After the prediction, the video coder may further code a residual value (e.g., an offset value) representing the difference between the predicted filter coefficient and the actual filter coefficient value.
[0084] The video coder may apply such techniques individually or in combination. For example, the video coder may explicitly code multiple sets of filter coefficients, code to an index for a first block category set in the multiple sets of filter coefficients, and predictively code filter coefficients for filters of a second block category set from a fixed filter or a filter of one or more reference pictures. Alternatively, the video coder may code each of the multiple sets of filter coefficients predicted from a fixed filter or from a filter of one or more previously coded pictures, and then code an index identifying one of the sets of filter coefficients for each block category. As yet another example, the video coder may use any of the above techniques to code filter coefficients for a first block category set, and code geometric transform information for a second block category set, including data identifying a geometric transform, and data identifying one category of filter coefficients in the first block category set for inheritance.
[0085] Figure 2 A conceptual diagram illustrating 15 groups (also called classes) for BA (Block-Based Adaptation) classification. Figure 2 In the example of , filters are mapped to a range of values for the activity metric (ie, range 0 to range 4) and the direction metric. Figure 2 The directional metric in is shown as having a non-directional value, a horizontal value, and a vertical value, which may correspond to the values 0, 1, and 2 from Equation 3 above. Figure 2The specific example of shows six different filters (ie, filter 1, filter 2, ... filter 6) as being mapped to 15 groups, but more or fewer filters may similarly be used. Figure 2 An example with 15 groups identified as group 221 through group 235 is shown, but more or fewer groups may be used. For example, instead of five ranges for the activity metric, more or fewer ranges may be used, resulting in more or fewer groups. Additionally or alternatively, instead of only three directions, additional directions (e.g., a 45 degree direction and a 135 degree direction) may also be used. If, for example, 5 ranges of the activity metric are used in conjunction with five directions (e.g., no direction, horizontal, vertical, 45 degree diagonal, and 135 degree diagonal), then 25 groups would be used for classification, with each of the 25 groups being mapped to a filter.
[0086] For both chroma components in a picture, a single set of filter coefficients may be applied. The filter coefficients of a reference picture may be stored and allowed to be reused as filter coefficients for the current picture. The current picture may choose to use the filter coefficients stored for the reference picture and skip filter coefficient signaling. In this case, only an index to one of the reference pictures needs to be signaled, and the stored filter coefficients of the indicated reference picture are inherited for the current picture.
[0087] According to the techniques of this disclosure, before filtering, a video coder (e.g., video encoder 20 or video decoder 30) may apply certain geometric transforms (e.g., rotations, diagonal flips, and vertical flips) to pixels in a filter support region (pixels multiplied by filtered coefficients in equation (1)), depending on the orientation of the gradients of the reconstructed pixels before performing the ALF. Such transforms may increase similarities between different regions within a picture, e.g., their directionality. This may reduce the number of filters that must be sent to a decoder, thus reducing the number of bits required to represent the filters, or alternatively reducing reconstruction errors. Applying the transform to the filter support region is equivalent to applying the transform directly to the filter coefficients. Thus, the video coder may instead apply the transform to the filter coefficients, rather than to the filter support region.
[0088] According to another technique of this disclosure (which can be used in conjunction with or independently of other techniques already introduced to reduce the number of bits required to represent filter coefficients), the video coder can merge different block categories. However, unlike in HM-3.0, any set of categories can be merged, even categories with non-continuous values of C. By sending an index i for each category (e.g., each of the 25 categories), the index i C to provide information about which categories are merged. CThe classes of i share the same filter f(k, l). Therefore, the video coder may generate multiple sets of filter coefficients and code a representative index value i for each of the multiple classes. C where C can be a value between 1 and the number of categories, and i C An index into the generated set of filter coefficients to identify the set of filter coefficients for category C.
[0089] According to another technique of this disclosure (which may be used in conjunction with or independently of other techniques already introduced), another modification relative to the ALF as described in HM-3.0 is that a video coder (e.g., video encoder 20 or video decoder 30) may use a set of n fixed filters obtained, for example, by offline training, which are assigned to each class to predictively code the filter coefficients. For each class whose filter coefficients are predicted from the fixed filters, the video coder may code data indicating which of the n fixed filters is used. In another example, some classes may have the same set of n fixed filters assigned, or even the same set of n fixed filters may be assigned to all classes. Even when a fixed filter is selected for a given class, the coefficients of the adaptive filter may still be signaled for this class. In this case, the coefficients of the filter that may be applied to the reconstructed image are the sum of the signaled coefficients f(k, l) and the fixed filter coefficients. Several classes may share the same signaled coefficients f(k, l), even if different fixed filters are selected for them.
[0090] An example implementation of the techniques introduced above will now be described. In one example, each N×N block is based on its directionality D and activity The quantified values of are classified into one of 25 categories:
[0091]
[0092] Use the 1-D Laplacian operator to calculate the values of the horizontal gradient, vertical gradient, and two diagonal gradients:
[0093]
[0094]
[0095]
[0096]
[0097] In these examples, g v represents the vertical gradient, g h represents the horizontal gradient, g d1 represents a 45-degree diagonal gradient, and g d2Represents a 135 degree diagonal gradient.
[0098] The indices i and j refer to the coordinates of the top left pixel in the N×N block. To assign the directionality D, the ratio of the maximum to the minimum of the horizontal and vertical gradients is
[0099]
[0100] and the ratio of the maximum to minimum values of the two diagonal gradients
[0101]
[0102] are compared with each other and with the threshold set t 1 and t 2 For comparison:
[0103] Step 1. If and Then D is set to 0 (classifying the block as "texture").
[0104] Step 2. If Then continue with step 3, otherwise continue with step 4.
[0105] Step 3. If Then D is set to 2, otherwise D is set to 1 (classifying the block as "strong horizontal / vertical" or "horizontal / vertical", respectively).
[0106] Step 4. If Then D is set to 4, otherwise D is set to 3 (classifying the block as "strong diagonal" or "diagonal", respectively).
[0107] The activity value A is calculated as:
[0108]
[0109] A is further quantized to a range of 0 to 4 (0 and 4 inclusive), and the quantized value is represented as
[0110]
[0111] Up to 25 filters can be signaled, one for each class. To reduce the number of bits needed to represent the filter coefficients, different classes can be merged. However, unlike in HM-3.0, any set of classes can be merged, even classes with non-continuous values of C. By decoding the index i for each of the 25 classes C to provide information about which categories are merged. C The classes of share the same filter f(k,l).
[0112] Before filtering each block, simple geometric transformations such as rotations or diagonal and vertical flipping may be applied to the filter coefficients f(k, l) depending on the gradient values calculated for the block. These are equivalent to applying such transformations to the pixels in the filter support region. The idea is to make different blocks to which the ALF is applied more similar by aligning their directionality.
[0113] The geometric transformation is defined as
[0114]
[0115] Where K is the size of the filter, and 0≤k,l≤K-1 are the coefficient coordinates, so that the position (0,0) is at the upper left corner and the position (K-1,K-1) is at the lower right corner. Table 1 gives the mapping between the gradient values calculated using equations (7) to (10) and the geometric transformation specified in equation (15).
[0116] Table 1: Mapping of gradients computed for N×N blocks to filters
[0117] Gradient Value Filter coefficients <![CDATA[g d2 <g d1 And g h <g v ]]> f(k,l) <![CDATA[g d2 <g d1 And g v <g h ]]> <![CDATA[f D (k,l)]]> <![CDATA[g d1 <g d2 And g h <g v ]]> <![CDATA[f V (k,l)]]> <![CDATA[g d1 <g d2 And g v <g h ]]> <![CDATA[f R (k,l)]]>
[0118] In some examples, filter coefficients may be predicted from fixed filters. Temporal prediction of filter coefficients may improve coding efficiency for inter-coded frames. In order to improve coding efficiency when temporal prediction is not available (intra-frames), a set of n fixed filters is assigned to each category. In some examples, for each of the 25 categories, a flag is signaled if a fixed filter is used, and the index of the selected filter is signaled if necessary. In some examples, the value of the flag may indicate whether a fixed filter is used. In some examples, an index representing the selected filter may be signaled if necessary. Alternatively, one of the following three examples may be used to define a situation. In the first situation, none of the filters of the 25 categories are predicted from fixed filters. In the second situation, all filters of the categories are predicted from fixed filters. In the third situation, filters associated with some categories are predicted from fixed filters, and filters associated with the remaining categories are not predicted from fixed filters.
[0119] A variable may be coded to indicate which of the three example situations above applies. In addition, the following may apply:
[0120] If the variable indicates condition 1, no further signaling of the index of the fixed filter is required.
[0121] • Otherwise, if the variable indicates condition 2, the index of the selected fixed filter for each class is coded.
[0122] • Otherwise, if the variable indicates case 3, one bit for each category may be signaled first, and if a fixed filter is used, an index may be further signaled.
[0123] Even when a fixed filter is selected for a given class, the coefficients of the adaptive filter may still be sent for this class. In this case, the coefficients of the filter to be applied to the reconstructed image are the sum of the signaled coefficients f(k, l) and the fixed filter coefficients. Several classes may share the same coefficients f(k, l), even if different fixed filters are selected for them. In an alternative, the fixed filter applied to intra frames may also be applied to inter-coded frames, such as P or B slices.
[0124] Figure 3 1 is a conceptual diagram illustrating an example pattern for signaling filter coefficient differences. The following techniques may be used to define one or more fixed filters, e.g., coefficient values for the fixed filters. In one example, the fixed filters are derived from offline training, and only the filter coefficients for the largest filter taps (e.g., a 9×9 diamond filter shape) are defined. Before coding the differences between the derived filter coefficients and the selected fixed filters, the video coder may first code an index indicating the pattern of signaling filter coefficient differences. For example, Figure 3 The fixed filter for a 9×9 symmetric diamond filter shape is depicted in FIG, where the filter coefficients are given by F i Indicates (i is in the range of 0 to 20, inclusive). In the signaled mode index indicates a 5×5 diamond filter shape (e.g. Figure 3 ), and the filter coefficients are predicted from a fixed filter, at Figure 3 The values of the derived filter coefficients at the gray regions of 0 remain unchanged, and the differences for such positions do not need to be signaled (i.e., the differences for such gray positions are equal to 0). In this case, the video coder codes data defining the differences between the derived coefficients and the fixed filter coefficients (F0 to F6). Alternatively, the video coder does not need to code data defining the differences for the DC coefficient (i.e., F6), but instead derives the differences for the DC coefficient in accordance with other coded difference values. It should be noted that in this case, the 9×9 diamond filtering process is always applied when predicting the filter coefficients from the fixed filter.
[0125] In another example, M versions of a fixed filter may be predefined, where M indicates the total number of supported filter shapes. The video coder may first code the index of the selected filter shape, and then code the data representing the index of the selected fixed filter associated with the filter shape. It should be noted that in this case, multiple different filtering processes are supported (depending on the value of M).
[0126] Figure 41 is a block diagram illustrating an example video encoder 20 that may implement the techniques described in this disclosure. Video encoder 20 may perform intra-coding and inter-coding on video blocks within a video slice. Intra-coding relies on spatial prediction to reduce or remove spatial redundancy in video within a given video frame or picture. Inter-coding relies on temporal prediction to reduce or remove temporal redundancy in video within adjacent frames or pictures of a video sequence. Intra-mode (I-mode) may refer to any of several spatial-based compression modes. Inter-mode, such as unidirectional prediction (P-mode) or bidirectional prediction (B-mode), may refer to any of several temporal-based compression modes.
[0127] exist Figure 4 In the example of , video encoder 20 includes video data memory 33, partition unit 35, prediction processing unit 41, summer 50, transform processing unit 52, quantization unit 54, entropy encoding unit 56. Prediction processing unit 41 includes motion estimation unit (MEU) 42, motion compensation unit (MCU) 44, and intra prediction unit 46. For the purpose of video block reconstruction, video encoder 20 also includes inverse quantization unit 58, inverse transform processing unit 60, summer 62, ALF unit 64, and decoded picture buffer (DPB) 66.
[0128] like Figure 4 As shown, video encoder 20 receives video data and stores the received video data in video data memory 33. Video data memory 33 may store video data to be encoded by components of video encoder 20. Video data stored in video data memory 33 may be obtained, for example, from video source 18. DPB 66 may be a reference picture memory that stores reference video data used, for example, in intra-frame or inter-frame decoding modes for encoding video data by video encoder 20. Video data memory 33 and DPB 66 may be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM), including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. Video data memory 33 and DPB 66 may be provided by the same memory device or separate memory devices. In various examples, video data memory 33 may be on-chip with other components of video encoder 20, or off-chip relative to the components.
[0129] Partition unit 35 retrieves video data from video data memory 33 and partitions the video data into video blocks. This partitioning may also include partitioning into slices, tiles, or other larger units, as well as video block partitioning, e.g., according to a quadtree structure of LCUs and CUs. Video encoder 20 generally illustrates components that encode video blocks within a video slice to be encoded. A slice may be divided into multiple video blocks (and possibly into sets of video blocks referred to as tiles). Prediction processing unit 41 may select one of multiple possible coding modes, such as one of multiple intra-coding modes or one of multiple inter-coding modes, for a current video block based on error results (e.g., coding rate and distortion level). Prediction processing unit 41 may provide the resulting intra- or inter-coded block to summer 50 to generate residual block data, and to summer 62 to reconstruct the encoded block for use as a reference picture.
[0130] Intra-prediction unit 46 within prediction processing unit 41 may perform intra prediction of the current video block relative to one or more neighboring blocks in the same frame or slice as the current block to be coded to provide spatial compression. Motion estimation unit 42 and motion compensation unit 44 within prediction processing unit 41 may perform inter prediction of the current video block relative to one or more reference blocks in one or more reference pictures to provide temporal compression.
[0131] Motion estimation unit 42 may be configured to determine the inter-prediction mode for a video slice according to a predetermined pattern for a video sequence. The predetermined pattern may specify a video slice in a sequence as a P slice or a B slice. Motion estimation unit 42 and motion compensation unit 44 may be highly integrated but are depicted separately for conceptual purposes. Motion estimation performed by motion estimation unit 42 is the process of generating motion vectors, which estimate motion for video blocks. For example, a motion vector may indicate the displacement of a PU of a video block within a current video frame or picture relative to a predictive block within a reference picture.
[0132] A predictive block is a block that is found to be a close match to the PU of the video block to be coded in terms of pixel difference, which may be determined by a sum of absolute difference (SAD), sum of square difference (SSD), or other difference metric. In some examples, video encoder 20 may calculate values for sub-integer pixel positions of a reference picture stored in DPB 66. For example, video encoder 20 may interpolate values for quarter-pixel positions, eighth-pixel positions, or other fractional pixel positions of the reference picture. Thus, motion estimation unit 42 may perform motion searches with full-pixel positions and fractional pixel positions and output motion vectors with fractional pixel precision.
[0133] Motion estimation unit 42 calculates a motion vector for a PU of a video block in an inter-coded slice by comparing the position of the PU to the position of a predictive block of a reference picture. The reference picture may be selected from a first reference picture list (List 0) or a second reference picture list (List 1), each of which identifies one or more reference pictures stored in DPB 66. Motion estimation unit 42 sends the calculated motion vector to entropy encoding unit 56 and motion compensation unit 44.
[0134] Motion compensation performed by motion compensation unit 44 may involve extracting or generating a predictive block based on a motion vector determined by motion estimation, possibly performing interpolation to sub-pixel accuracy. Upon receiving the motion vector for the PU of the current video block, motion compensation unit 44 may locate the predictive block to which the motion vector points in one of the reference picture lists. Video encoder 20 forms a residual video block by subtracting the pixel values of the predictive block from the pixel values of the current video block being decoded, forming pixel difference values. The pixel difference values form residual data for the block and may include both luma difference components and chroma difference components. Summer 50 represents a component or components that performs this subtraction operation. Motion compensation unit 44 may also generate syntax elements associated with video blocks and video slices for use by video decoder 30 in decoding video blocks of video slices.
[0135] After prediction processing unit 41 generates the predictive block for the current video block via intra prediction or inter prediction, video encoder 20 forms a residual video block by subtracting the predictive block from the current video block. The residual video data in the residual block may be included in one or more TUs and applied to transform processing unit 52. Transform processing unit 52 transforms the residual video data into residual transform coefficients using a transform such as a discrete cosine transform (DCT) or a conceptually similar transform. Transform processing unit 52 may convert the residual video data from the pixel domain to a transform domain, such as the frequency domain.
[0136] Transform processing unit 52 may send the resulting transform coefficients to quantization unit 54. Quantization unit 54 quantizes the transform coefficients to further reduce the bit rate. The quantization process may reduce the bit depth associated with some or all of the coefficients. The degree of quantization may be modified by adjusting a quantization parameter. In some examples, quantization unit 54 may then perform a scan of the matrix including the quantized transform coefficients. Alternatively, entropy encoding unit 56 may perform the scan.
[0137] After quantization, entropy encoding unit 56 entropy encodes the quantized transform coefficients. For example, entropy encoding unit 56 may perform context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), syntax-based context adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding, or another entropy encoding method or technique. After entropy encoding by entropy encoding unit 56, the encoded bitstream may be transmitted to video decoder 30, or archived for later transmission or retrieval by video decoder 30. Entropy encoding unit 56 may also entropy encode motion vectors and other syntax elements for the current video slice being coded.
[0138] Inverse quantization unit 58 and inverse transform processing unit 60 apply inverse quantization and inverse transform, respectively, to reconstruct the residual block in the pixel domain for later use as a reference block of a reference picture. Motion compensation unit 44 may calculate a reference block by adding the residual block to a predictive block of one of the reference pictures within one of the reference picture lists. Motion compensation unit 44 may also apply one or more interpolation filters to the reconstructed residual block to calculate sub-integer pixel values for use in motion estimation. Summer 62 adds the reconstructed residual block to the motion compensated prediction block produced by motion compensation unit 44 to produce a reconstructed block.
[0139] ALF unit 64 filters the reconstructed block (e.g., the output of summer 62) and stores the filtered reconstructed block in DPB 66 for use as a reference block. The reference block may be used by motion estimation unit 42 and motion compensation unit 44 as a reference block to inter-predict a block in a subsequent video frame or picture. Figure 4 , but video encoder 20 may include additional filters, such as one or more of a deblocking filter, a sample adaptive offset (SAO) filter, or another type of loop filter. A deblocking filter may, for example, apply deblocking filtering to filter block boundaries to remove blockiness artifacts from reconstructed video. An SAO filter may apply an offset to reconstructed pixel values in order to improve overall coding quality. In some implementations, SAO may be a special filtering condition or a special filtering mode. Additional loop filters (in-loop or post-loop) may also be used.
[0140] ALF unit 64, alone or in conjunction with other components of video encoder 20, may be configured to perform the various ALF techniques described in this disclosure. For example, the output of summer 62 is decoded video data that was previously encoded by other elements of video encoder 20, such as prediction processing unit 41, transform processing unit 52, and quantization unit 54. Thus, ALF unit 64 may filter the decoded video data in accordance with the techniques of this disclosure. In particular, ALF unit 64 performs the filtering as an "in-loop" filtering process, in that ALF unit 64 filters decoded pictures stored in DPB 66 that are subsequently used as reference pictures to be used by prediction processing unit 41 to predict subsequent pictures.
[0141] According to the techniques of this disclosure, ALF unit 64 may construct filters for various block categories. ALF unit 64 may classify blocks based on, for example, the directionality of gradients calculated from pixels of the blocks. In general, ALF unit 64 may construct different filters for each block category. However, in some cases, ALF unit 64 may calculate a set of filter coefficients used by two or more block categories. For example, ALF unit 64 may calculate multiple sets of filter coefficients. ALF unit 64 may further encode an index value identifying one of the multiple sets of filter coefficients for each block category (or a subset of block categories). ALF unit 64 may construct a data structure specifying the index for each block category and provide the data structure to entropy encoding unit 56 for entropy encoding and inclusion in the bitstream. Entropy encoding unit 56 may entropy encode the data structure and add the data structure to, for example, a slice header, a picture parameter set, or other such data structures. Thus, in the event that ALF unit 64 encodes the same index for two or more block categories, the block categories will use the same set of filter coefficients, ie, the set of filter coefficients that corresponds to the encoded index value.
[0142] Additionally or alternatively, ALF unit 64 may indicate that, for at least one block category, a filter is to be generated by using the same filter coefficients as another block category, but where a geometric transform is applied to the filter support region or filter coefficients of the filter. Functionally, applying a geometric transform to the filter support region yields the same mathematical result as applying a geometric transform to the filter coefficients, and therefore, ALF unit 64 may apply the geometric transform to the filter support region or filter coefficients. In this example, ALF unit 64 may encode, for the current block category, data identifying the type of geometric transform (e.g., rotation, diagonal flip, or vertical flip) and a previously constructed filter whose filter coefficients are to be used for the generated filter for the current block category. Again, ALF unit 64 may provide this data to entropy encoding unit 56, which may entropy encode the data and add the data to a data structure, such as, for example, a slice header or a picture parameter set.
[0143] Additionally or alternatively, ALF unit 64 may encode a value (e.g., a value of a flag) indicating whether a fixed filter is used to predict a set of filter coefficients for a block class. Likewise, ALF unit 64 may provide such values to entropy encoding unit 56 for entropy encoding, e.g., as part of a slice header, picture parameter set, or other such data structure. A flag may indicate, for example, whether filter coefficients for a filter for a block class are predicted from a fixed filter, or instead predicted (or inherited) from a filter of a reference picture. In some examples, ALF unit 64 may be configured to have multiple fixed filters for each block class. In such examples, when the value indicates that the filter coefficients are predicted from a fixed filter, ALF unit 64 may additionally encode an index into the multiple fixed filters that identifies one of the multiple fixed filters to be used to predict the filter coefficients of the current filter for the block class.
[0144] In some examples, ALF unit 64 may further encode information indicating that none of the filter coefficients for any category are predicted from any fixed filter, all of the filter coefficients are predicted from fixed filters, or there are some filter coefficients predicted from fixed filters while other filter coefficients are not predicted from fixed filters. When none of the filter coefficients are predicted from fixed filters, ALF unit 64 may avoid (e.g., omit or prevent) encoding of data representing indexes into a plurality of fixed filters. On the other hand, when some or all of the filter coefficients are predicted from fixed filters, ALF unit 64 may encode an index into a respective plurality of fixed filters for the set of filter coefficients predicted from fixed filters, wherein the index identifies a reference fixed filter for predicting the corresponding filter coefficient. In addition, ALF unit 64 may use the fixed filter identified by the index to predict the corresponding filter coefficient. After prediction, ALF unit 64 may further encode a residual value (e.g., an offset value) representing the difference between the predicted filter coefficient and the actual filter coefficient value.
[0145] ALF unit 64 may apply such techniques individually or in combination. For example, ALF unit 64 may explicitly encode multiple sets of filter coefficients, an index into the multiple sets of filter coefficients for a first set of block categories, and predictively encode filter coefficients for filters of a second set of block categories from fixed filters or filters of one or more reference pictures in DPB 66. Alternatively, ALF unit 64 may encode each of the multiple sets of filter coefficients predicted from fixed filters or from filters of one or more reference pictures in DPB 66, and then encode an index identifying one of the sets of filter coefficients for each block category. As yet another example, ALF unit 64 may encode filter coefficients for a first set of block categories using any of the above techniques, and encode geometric transform information for a second set of block categories, including data identifying the geometric transform, and data identifying one category of filter coefficients in the first set of block categories for inheritance.
[0146] To determine how to select indexes for block categories, whether to predict filter coefficients from fixed filters or reference pictures of DPB 66, and / or whether to use geometric transforms as discussed above to generate filters for block categories, video encoder 20 may perform multiple encoding passes on a picture or sequence of pictures and cause ALF unit 64 to apply various filtering techniques to various block categories in the picture. Video encoder 20 may calculate a rate-distortion optimization (RDO) metric for a decoded filtered picture to determine which combination of filter coefficients and filter coefficient prediction techniques produces the optimized RDO metric. Video encoder 20 may then select filter coefficients and filtering techniques for each picture based on the combination of filtering techniques that produces the optimized RDO metric for each picture.
[0147] Figure 5 is a block diagram illustrating an example video decoder 30 that may implement the techniques described in this disclosure. Figure 5 In an example of , video decoder 30 includes video data memory 78, entropy decoding unit 80, prediction processing unit 81, inverse quantization unit 86, inverse transform processing unit 88, summer 90, and decoded picture buffer (DPB) 94. Prediction processing unit 81 includes motion compensation unit 82 and intra-prediction processing unit 84. In some examples, video decoder 30 may perform processing related to the video data from the video decoder 30. Figure 4 The encoding pass described for video encoder 20 is generally the inverse of the decoding pass.
[0148] During the decoding process, the video decoder 30 receives an encoded video bitstream representing video blocks and associated syntax elements of an encoded video slice from the video encoder 20. The video decoder 30 stores the received encoded video bitstream in a video data memory 78. The video data memory 78 may store video data to be decoded by components of the video decoder 30, such as an encoded video bitstream. The video data stored in the video data memory 78 may be obtained, for example, from the storage device 26 or from a local video source (such as a camera) via the link 16 or by accessing a physical data storage medium. The video data memory 78 may form a coded picture buffer (CPB) storing the encoded video data from the encoded video bitstream. The DPB 94 may be a reference picture memory storing reference video data for decoding video data by the video decoder 30, for example, in an intra-frame or inter-frame decoding mode. The video data memory 78 and the DPB 94 may be formed by any of a variety of memory devices, such as DRAM, SDRAM, MRAM, RRAM, or other types of memory devices. Video data memory 78 and DPB 94 may be provided by the same memory device or separate memory devices. In various examples, video data memory 78 may be on-chip with other components of video decoder 30, or off-chip relative to such components.
[0149] Entropy decoding unit 80 of video decoder 30 entropy decodes the video data stored in video data memory 78 to produce quantized coefficients, motion vectors, and other syntax elements. Entropy decoding unit 80 forwards the motion vectors and other syntax elements to prediction processing unit 81. Video decoder 30 may receive the syntax elements at the video slice level and / or the video block level.
[0150] When a video slice is coded as an intra-coded (I) slice, intra-prediction processing unit 84 of prediction processing unit 81 may generate prediction data for a video block of the current video slice based on the signaled intra-prediction mode and data from a previously decoded block of the current frame or picture. When a video frame is coded as an inter-coded slice (e.g., a B slice or a P slice), motion compensation unit 82 of prediction processing unit 81 generates a predictive block for a video block of the current video slice based on motion vectors and other syntax elements received from entropy decoding unit 80. The predictive block may be generated from one of the reference pictures within one of the reference picture lists. Video decoder 30 may construct reference frame lists: List 0 and List 1 using a default construction technique based on the reference pictures stored in DPB 94.
[0151] Motion compensation unit 82 determines prediction information for a video block of the current video slice by parsing the motion vectors and other syntax elements, and uses the prediction information to generate a predictive block for the current video block being decoded. For example, motion compensation unit 82 uses some of the received syntax elements to determine a prediction mode (e.g., intra- or inter-prediction) used to code a video block of the video slice, an inter-prediction slice type (e.g., B slice or P slice), construction information for one or more of the reference picture lists for the slice, motion vectors for each inter-coded video block of the slice, inter-prediction status for each inter-coded video block of the slice, and other information used to decode a video block in the current video slice.
[0152] Motion compensation unit 82 may also perform interpolation based on interpolation filters. Motion compensation unit 82 may use interpolation filters as used by video encoder 20 during encoding of the video blocks to calculate interpolated values for sub-integer pixels of reference blocks. In this case, motion compensation unit 82 may determine the interpolation filters used by video encoder 20 from the received syntax elements and use the interpolation filters to produce the predictive blocks.
[0153] Inverse quantization unit 86 inverse quantizes (i.e., de-quantizes) the quantized transform coefficients provided in the bitstream and decoded by entropy decoding unit 80. The inverse quantization process may include using quantization parameters calculated by video encoder 20 for each video block in a video slice to determine a degree of quantization and likewise determine a degree of inverse quantization that should be applied. Inverse transform processing unit 88 applies an inverse transform (e.g., an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process) to the transform coefficients to produce residual blocks in the pixel domain.
[0154] After prediction processing unit generates a predictive block for the current video block using, for example, intra- or inter-prediction, video decoder 30 forms a reconstructed video block by summing the residual block from inverse transform processing unit 88 with the corresponding predictive block generated by motion compensation unit 82. Summer 90 represents a component or components that may perform this summing operation. ALF unit 92 filters the reconstructed video block using, for example, one or more of the filter techniques described in this disclosure.
[0155] although Figure 5 , but video decoder 30 may also include one or more of a deblocking filter, an SAO filter, or other types of filters. Other loop filters (either in the coding loop or after the coding loop) may also be used to smooth pixel transitions or otherwise improve video quality. The decoded video blocks in a given frame or picture are then stored in DPB 94, which stores reference pictures for subsequent motion compensation. DPB 94 may be part of or separate from additional memory that stores reference pictures for later presentation to a display device (e.g., Figure 1 The decoded video on the display device 32).
[0156] Alone or in conjunction with other components of video decoder 30, ALF unit 92 may be configured to perform various techniques described in this disclosure, including techniques described in the claims section and elsewhere. For example, the output of summer 90 is decoded video data. Thus, ALF unit 92 may filter decoded video data in accordance with the techniques of this disclosure. In detail, ALF unit 92 performs filtering as an "in-loop" filtering process, in that ALF unit 92 filters decoded pictures stored in DPB 94 that are subsequently used as reference pictures to be used by prediction processing unit 81 to predict subsequent pictures.
[0157] ALF unit 92 may apply the techniques of this disclosure alone or in combination. For example, based on decoded data from a bitstream (e.g., a slice header or a picture parameter set), ALF unit 92 may explicitly decode multiple sets of filter coefficients, decode an index into the multiple sets of filter coefficients for a first set of block categories, and predictively decode filter coefficients for filters of a second set of block categories from fixed filters or filters of one or more reference pictures in DPB 94. Alternatively, based on decoded data from a bitstream (e.g., a slice header or a picture parameter set), ALF unit 92 may decode each of multiple sets of filter coefficients predicted from fixed filters or from filters of one or more reference pictures in DPB 94, and then decode an index identifying one of the sets of filter coefficients for each block category. As yet another example, based on decoded data from the bitstream (e.g., a slice header or a picture parameter set), ALF unit 92 may use any of the above techniques to decode filter coefficients for a first set of block categories and decode geometric transform information for a second set of block categories, including data identifying the geometric transform, and data identifying one category in the first set of block categories for inheriting filter coefficients. Thus, in general,
[0158] In some examples, ALF unit 92 may construct filters for various block categories. ALF unit 92 may classify blocks based on, for example, the directionality of gradients calculated from pixels of the block. In general, ALF unit 92 may construct different ALFs for each block category. However, in some cases, ALF unit 92 may calculate filter coefficient sets used by two or more block categories. For example, ALF unit 92 may calculate multiple filter coefficient sets. ALF unit 92 may further decode an index value identifying one of the multiple filter coefficient sets for each block category (or a subset of block categories). Entropy decoding unit 80 may entropy decode a data structure specifying an index for each block category and provide the data structure to ALF unit 92. Entropy decoding unit 80 may entropy decode a data structure from, for example, a slice header, a picture parameter set, or other such data structures. Therefore, in the case where ALF unit 92 decodes the same index for two or more block categories, the block categories will use the same filter coefficient set, i.e., the filter coefficient set corresponding to the decoded index value.
[0159] Additionally or alternatively, ALF unit 92 may indicate that, for at least one block category, a filter is to be generated by using the same filter coefficients as for a different block category, but where a geometric transform is applied to the filter support region or filter coefficients of the filter. Functionally, applying a geometric transform to the filter support region yields the same mathematical result as applying a geometric transform to the filter coefficients, and therefore, ALF unit 92 may apply a geometric transform to the filter support region or filter coefficients. In this example, ALF unit 92 may decode data identifying a geometric transform type (e.g., rotation, diagonal flip, or vertical flip) and a previously constructed filter for the current block category whose filter coefficients are to be used for the generated filter for the current block category. Again, entropy decoding unit 80 may entropy decode this data and provide the decoded data to ALF unit 92. The data may be included in a data structure such as, for example, a slice header or a picture parameter set.
[0160] Additionally or alternatively, entropy decoding unit 80 may entropy decode a value (e.g., a value of a flag) indicating whether a fixed filter is used to predict a set of filter coefficients for a block category. Likewise, entropy decoding unit 80 may provide such values to ALF unit 92. Entropy decoding unit 80 may decode data from portions of a slice header, a picture parameter set, or other such data structure. A flag may indicate, for example, whether filter coefficients for a filter for a block category are predicted from a fixed filter, or are instead predicted (or inherited) from a filter of a reference picture. In some examples, ALF unit 92 may be configured to have multiple fixed filters for each block category. In such examples, when the value indicates that the filter coefficients are predicted from a fixed filter, ALF unit 92 may additionally decode an index into the multiple fixed filters that identifies one of the multiple fixed filters to be used to predict the filter coefficients for the current filter for the block category.
[0161] In some examples, ALF unit 92 may further receive entropy decoded information indicating that none of the filter coefficients for any category are predicted from any fixed filter, all filter coefficients are predicted from fixed filters, or there are some filter coefficients predicted from fixed filters while other filter coefficients are not predicted from fixed filters. When none of the filter coefficients are predicted from fixed filters, ALF unit 92 (or entropy decoding unit 80) may avoid (e.g., omit or prevent) decoding of data representing indexes into multiple fixed filters. On the other hand, when some or all of the filter coefficients are predicted from fixed filters, ALF unit 92 may decode indices into respective multiple fixed filters for the set of filter coefficients predicted from fixed filters, wherein the indices identify reference fixed filters for predicting the corresponding filter coefficients. In addition, ALF unit 92 may use the fixed filters identified by the indices to predict the corresponding filter coefficients. After prediction, ALF unit 92 may further decode residual values (e.g., offset values) representing the differences between the predicted filter coefficients and the actual filter coefficient values.
[0162] Figure 6 1 is a flowchart illustrating an example method for filtering blocks of a decoded picture by a video encoder (eg, during a video encoding process). Figure 4 The video encoder 20 is described Figure 6 method.
[0163] Initially, video encoder 20 encodes a picture (100). For example, video encoder 20 may intra-predict or inter-predict blocks of the picture, calculate residual values for the predicted blocks, transform and quantize the residual data, and entropy encode prediction information and quantized transform coefficients for the picture, as described above with respect to Figure 4 Video encoder 20 may then decode the picture (102), eg, by inverse quantizing and inverse transforming the quantized transform coefficients to reproduce residual values, which are then added to the predicted block.
[0164] ALF unit 64 may then calculate filter coefficients for various block categories (104). For example, ALF unit 64 may determine the block category based on the potential gradient for the block. ALF unit 64 may then generate filters for the block categories from the calculated filter coefficients (106). ALF unit 64 may use any of the various techniques for generating the filters of the present invention. For example, for at least some block categories, ALF unit 64 may select an index into a plurality of calculated filter coefficient sets, wherein the index for each block category identifies the calculated filter coefficient set to be used to generate the filter for the corresponding block category. Additionally or alternatively, for at least some block categories, ALF unit 64 may generate data indicating a previously generated filter to be used, and a geometric transform to be applied to at least one of the filter coefficients of the filter support region or the previously generated filter. Additionally or alternatively, for at least some block categories, ALF unit 64 may predict the filter coefficients from a fixed filter or a filter of a reference picture, and generate data indicating the fixed filter or reference picture to be used to predict the corresponding filter coefficients.
[0165] In addition, video encoder 20 may encode data defining filters for various block categories (108). For example, for any block category for which a filter is to be generated using an index into a plurality of sets of filter coefficients, entropy encoding unit 56 may entropy encode an index for the block category. Additionally or alternatively, for any block category for which a filter is to be generated using a previously generated filter and a geometric transform, entropy encoding unit 56 may entropy encode data identifying the previously generated filter and the geometric transform (e.g., rotation, vertical flip, or diagonal flip) to be applied. Additionally or alternatively, for any block category for which a filter is to be generated using filter coefficients predicted from a fixed filter, entropy encoding unit 56 may entropy encode data indicating whether the filter coefficients are to be predicted from a fixed filter or a filter of a reference picture, as well as an indication of the fixed filter or reference picture.
[0166] ALF unit 64 may also filter blocks of the decoded picture using corresponding filters (110). That is, for each block of the picture, ALF unit 64 may calculate gradients and determine a category for the block based on the gradients. ALF unit 64 may further select a filter corresponding to the category. ALF unit 64 may then filter each pixel of the block using the filter corresponding to the category for the block.
[0167] In this way, Figure 6The method represents an example of a method of filtering a decoded block of video data, which includes: constructing multiple filters for block categories of a current picture of the video data, wherein constructing the multiple filters includes performing the following operations for each of the categories: determining whether to use a fixed filter to predict a filter coefficient set for the category, and in response to determining to use a fixed filter to predict the filter coefficient set, determining an index value into the fixed filter set for the category and using the fixed filter identified by the index value in the fixed filter set to predict the filter coefficient set for the category; decoding a current block of the current picture of the video data; determining a category for the current block; selecting a filter from a plurality of filters that corresponds to the category for the current block; and filtering at least one pixel of the current block using the selected filter.
[0168] Figure 7 1 is a flowchart illustrating an example method for filtering a block of a decoded picture by a video decoder (eg, during a video decoding process). Figure 5 The video decoder 30 is described Figure 6 method.
[0169] Initially, video decoder 30 decodes a picture (120). For example, video decoder 30 may entropy decode prediction information and quantized transform coefficients for the picture, intra-predict or inter-predict blocks of the picture based on the prediction information, inverse quantize and inverse transform the quantized transform coefficients to regenerate residual data, and combine the predicted block with the residual data to regenerate the block, as described above with respect to FIG. Figure 5 Discussed.
[0170] Entropy decoding unit 80 may further entropy decode data defining filters for various block categories (122). For example, entropy decoding unit 80 may entropy decode data indicating a block category for which the filter is to be generated using an index into a plurality of sets of filter coefficients, and entropy decode the index for the block category. Additionally or alternatively, entropy decoding unit 80 may entropy decode data indicating a block category for which the filter is to be generated using a previously generated filter and a geometric transform, and data identifying the previously generated filter and a geometric transform (e.g., rotation, vertical flip, or diagonal flip) to be applied. Additionally or alternatively, entropy decoding unit 80 may entropy decode data indicating a block category for which the filter is to be generated using filter coefficients predicted from a fixed filter, and data indicating whether the filter coefficients are to be predicted from a fixed filter or a filter of a reference picture, and an indication of the fixed filter or reference picture.
[0171] ALF unit 92 may then calculate filter coefficients for various block categories (124). For example, ALF unit 92 may determine the block category based on potential gradients for the block. ALF unit 92 may then generate filters for the block categories from the calculated filter coefficients based on entropy decoded data representing how to generate filters as discussed above (126). ALF unit 92 may use any of the various techniques for generating the filters of the present invention. For example, for at least some block categories, ALF unit 92 may receive an index into a plurality of calculated filter coefficient sets from entropy decoding unit 80, wherein the index for each block category identifies the calculated filter coefficient set to be used to generate the filter for the corresponding block category. Additionally or alternatively, for at least some block categories, ALF unit 92 may receive data indicating a previously generated filter to be used from entropy decoding unit 80, as well as a geometric transform to be applied to at least one of the filter support region or the filter coefficients of the previously generated filter. Additionally or alternatively, for at least some block categories, ALF unit 92 may predict filter coefficients from a fixed filter or a filter of a reference picture and generate data indicative of the fixed filter or reference picture to be used to predict the filter coefficients, as indicated by data received from entropy decoding unit 80.
[0172] ALF unit 92 may then filter the blocks of the decoded picture using the corresponding filters (128). That is, for each block of the picture, ALF unit 92 may calculate gradients and determine a category for the block based on the gradients. ALF unit 92 may further select a filter corresponding to the category. ALF unit 92 may then filter each pixel of the block using the filter corresponding to the category for the block.
[0173] In this way, Figure 7 The method represents an example of a method of filtering a decoded block of video data, which includes: constructing multiple filters for block categories of a current picture of the video data, wherein constructing the multiple filters includes performing the following operations for each of the categories: determining whether to use a fixed filter to predict a filter coefficient set for the category, and in response to determining to use a fixed filter to predict the filter coefficient set, determining an index value into the fixed filter set for the category and using the fixed filter identified by the index value in the fixed filter set to predict the filter coefficient set for the category; decoding a current block of the current picture of the video data; determining a category for the current block; selecting a filter from a plurality of filters that corresponds to the category for the current block; and filtering at least one pixel of the current block using the selected filter.
[0174] Figure 8 1 is a flowchart illustrating an example method for filtering blocks of a decoded picture by a video encoder (eg, during a video encoding process). Figure 4 The video encoder 20 is described Figure 8 method.
[0175] Initially, video encoder 20 encodes a picture (140). For example, video encoder 20 may intra-predict or inter-predict blocks of the picture, calculate residual values for the predicted blocks, transform and quantize the residual data, and entropy encode prediction information and quantized transform coefficients for the picture, as described above with respect to Figure 4 Video encoder 20 may then decode the picture (142), eg, by inverse quantizing and inverse transforming the quantized transform coefficients to reproduce residual values, which are then added to the predicted block.
[0176] ALF unit 64 may then select a filter for the block category of the picture, such as according to adaptive loop filtering (ALF) (144). ALF unit 64 may select the category based on, for example, gradients calculated for one or more pixels of the block. Alternatively, ALF unit 64 may determine the category for the block based on other characteristics of the block.
[0177] According to the techniques of this disclosure, ALF unit 64 may calculate gradients for the block (146). ALF unit 64 may further determine and perform a geometric transform based on the calculated gradients (148). For example, ALF unit 64 may determine the geometric transform according to the techniques of Table 1 as discussed above. ALF unit 64 may apply the geometric transform to coefficients of the selected filter or to a filter support region of the selected filter (e.g., neighboring pixels of a pixel to be filtered using the selected filter). ALF unit 64 may then filter the block of the decoded picture using the selected filter (150). That is, ALF unit 64 filters each pixel of the block using the selected filter.
[0178] In this way, Figure 8 The method represents an example of a method of filtering a decoded block of video data, which includes: decoding a current block of a current picture of the video data; selecting a filter to be used to filter pixels of the current block (for example, according to adaptive loop filtering (ALF)); selecting a geometric transform to be performed on one of the filter support area or coefficients of the selected filter; performing the geometric transform on the filter support area or the coefficients of the selected filter; and filtering at least one pixel of the current block using the selected filter after performing the geometric transform.
[0179] Fig. 9 1 is a flowchart illustrating an example method for filtering a block of a decoded picture by a video decoder (eg, during a video decoding process). Figure 5 The video decoder 30 is described Fig. 9 method.
[0180] Initially, video decoder 30 decodes a picture (160), e.g., by entropy decoding values of syntax elements for prediction and quantized transform coefficients, inverse quantizing and inverse transforming the quantized transform coefficients to reproduce residual values, and then adding the residual values to the predicted block. ALF unit 92 may then select a filter (e.g., according to adaptive loop filtering (ALF)) for a block category of the picture (162). ALF unit 92 may select the category based on, for example, gradients calculated for one or more pixels of the block. Alternatively, ALF unit 92 may determine the category for the block based on other characteristics of the block.
[0181] According to the techniques of this disclosure, ALF unit 92 may calculate gradients for the block (164). ALF unit 92 may further determine and perform a geometric transform based on the calculated gradients (166). For example, ALF unit 92 may determine the geometric transform according to the techniques of Table 1 as discussed above. ALF unit 92 may apply the geometric transform to coefficients of the selected filter or to a filter support area of the selected filter (e.g., neighboring pixels of a pixel to be filtered using the selected filter). ALF unit 92 may then filter the block of the decoded picture using the selected filter (168). That is, ALF unit 92 filters each pixel of the block using the selected filter.
[0182] In this way, Fig. 9 The method represents an example of a method of filtering a decoded block of video data, which includes: decoding a current block of a current picture of the video data; selecting a filter to be used to filter pixels of the current block (for example, according to adaptive loop filtering (ALF)); selecting a geometric transform to be performed on one of the filter support area or coefficients of the selected filter; performing the geometric transform on the filter support area or the coefficients of the selected filter; and filtering at least one pixel of the current block using the selected filter after performing the geometric transform.
[0183] Fig.10 1 is a flowchart illustrating an example method for filtering blocks of a decoded picture by a video encoder (eg, during a video encoding process). Figure 4 The video encoder 20 is described Fig.10 method.
[0184] Initially, video encoder 20 encodes a picture (170). For example, video encoder 20 may intra-predict or inter-predict blocks of the picture, calculate residual values for the predicted blocks, transform and quantize the residual data, and entropy encode prediction information and quantized transform coefficients for the picture, as described above with respect to Figure 4Video encoder 20 may then decode the picture (172), eg, by inverse quantizing and inverse transforming the quantized transform coefficients to reproduce residual values, which are then added to the predicted block.
[0185] ALF unit 64 may then predict the coefficients of the filter for the block class of the picture using the fixed filter (e.g., according to adaptive loop filtering (ALF)) (174). ALF unit 64 may select the class based on, for example, gradients calculated for one or more pixels of the block. Alternatively, ALF unit 64 may determine the class for the block based on other characteristics of the block. In some examples, multiple fixed filters may be used for each block class, and ALF unit 64 may test each of the available fixed filters to determine which one produces the best rate-distortion performance. ALF unit 64 may then select the fixed filter that yields the most preferred rate-distortion performance for each block class, or select a reference filter of a reference picture if a reference filter yields the preferred rate-distortion performance. ALF unit 64 then encodes a flag indicating which of the fixed filters is used for each block class (and, additionally or alternatively, whether the filter for a particular class is predicted from a reference filter of a reference picture) (176).
[0186] ALF unit 64 may then select a filter for each block category of the decoded picture (178), determine a category for each of the blocks of the decoded picture based on the gradients calculated for the blocks (180), and filter the blocks using the selected filters (182). Again, ALF unit 64 may test different filters for each block category to determine which filter results in the most optimal rate-distortion performance. In accordance with the techniques of this disclosure, in some examples, ALF unit 64 may merge two or more block categories such that each of the merged categories uses the same filter. Furthermore, video encoder 20 may encode data indicating which of the filters is to be used for each block category.
[0187] In this way, Fig.10The method represents an example of a method of filtering a decoded block of video data, which includes: constructing multiple filters for block categories of a current picture of the video data, wherein the multiple filters are constructed for the block categories of the current picture of the video data, wherein constructing the multiple filters includes performing the following operations for each of the categories: determining whether to use a fixed filter to predict a filter coefficient set for the category, and in response to determining to use a fixed filter to predict the filter coefficient set, determining an index value into the fixed filter set of the category and using the fixed filter identified by the index value in the fixed filter set to predict the filter coefficient set for the category; decoding a current block of the current picture of the video data; determining a category for the current block; selecting a filter from a plurality of filters that corresponds to the category for the current block; and filtering at least one pixel of the current block using the selected filter.
[0188] Fig.11 1 is a flowchart illustrating an example method for filtering a block of a decoded picture by a video decoder (eg, during a video decoding process). Figure 5 The video decoder 30 is described Fig.11 method.
[0189] Initially, video decoder 30 decodes a picture of video data (190), eg, by entropy decoding values of syntax elements for prediction and quantizing transform coefficients, inverse quantizing and inverse transforming the quantized transform coefficients to reproduce residual values, and then adding the residual values to the predicted block.
[0190] ALF unit 92 may then decode a flag indicating whether the coefficients of the filter are to be predicted from a fixed filter (192) and, in some examples, data identifying the fixed filter if the filter coefficients are to be predicted from the fixed filter. ALF unit 92 may then predict the coefficients of the filter using the fixed filter (assuming the filter coefficients are to be predicted from the fixed filter in this example) (194). In other examples, if the flag indicates that the filter coefficients are not to be predicted from the fixed filter, ALF unit 92 may predict the filter coefficients from a reference filter of a reference picture.
[0191] ALF unit 92 may then select a filter for each block category of the decoded picture (196), determine a category for each of the blocks of the decoded picture based on the gradients calculated for the blocks (198), and filter the blocks using the selected filters (200). ALF unit 92 may decode, for each block category, data identifying a filter to be used to filter pixels of blocks of that category.
[0192] In this way, Fig.11The method represents an example of a method of filtering a decoded block of video data, which includes: constructing multiple filters for block categories of a current picture of the video data, wherein constructing the multiple filters includes performing the following operations for each of the categories: determining whether to use a fixed filter to predict a filter coefficient set for the category, and in response to determining to use a fixed filter to predict the filter coefficient set, determining an index value into the fixed filter set for the category and using the fixed filter identified by the index value in the fixed filter set to predict the filter coefficient set for the category; decoding a current block of the current picture of the video data; determining a category for the current block; selecting a filter from a plurality of filters that corresponds to the category for the current block; and filtering at least one pixel of the current block using the selected filter.
[0193] In one or more examples, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted via a computer-readable medium as one or more instructions or program codes and executed by a hardware-based processing unit. Computer-readable media may include: computer-readable storage media, which corresponds to tangible media such as data storage media; or communication media, which includes any media that facilitates the transfer of a computer program from one place to another (e.g., according to a communication protocol). In this manner, computer-readable media may generally correspond to (1) tangible computer-readable storage media that is non-transitory, or (2) communication media such as signals or carrier waves. Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, program codes, and / or data structures for implementing the techniques described in the present invention. A computer program product may include a computer-readable medium.
[0194] As examples and not limitations, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage, flash memory, or any other medium that can be used to store the desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, any connection is properly referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server or other remote source using a coaxial cable, optical cable, twisted pair, digital subscriber line (DSL), or wireless technology (such as infrared, radio and microwave), then the coaxial cable, optical cable, twisted pair, DSL, or wireless technology (such as infrared, radio and microwave) is included in the definition of medium. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals or other temporary media, but rather relate to non-temporary tangible storage media. As used herein, disks and optical disks include compact disks (CDs), laser disks, optical disks, digital versatile disks (DVDs), floppy disks, and Blu-ray disks, where disks typically reproduce data magnetically, while optical disks use lasers to reproduce data optically. Combinations of the above should also be included within the scope of computer-readable media.
[0195] Instructions may 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 equivalent integrated or discrete logic circuit systems. Therefore, the term "processor" as used herein may refer to any of the above structures or any other structures suitable for implementing the techniques described herein. In addition, in some aspects, the functionality described herein may be provided in dedicated hardware and / or software modules configured for encoding and decoding, or incorporated into a combined codec. Moreover, the techniques may be fully implemented in one or more circuits or logic elements. Therefore, the processor may be formed by any of a variety of integrated processing circuit systems, including one or more processors implemented as a combination of fixed hardware processing circuit systems, programmable processing circuit systems, and / or fixed processing circuit systems and programmable processing circuit systems.
[0196] The techniques of this disclosure may be implemented in a variety of devices or apparatuses, including wireless handsets, integrated circuits (ICs), or sets of ICs (e.g., chipsets). Various components, modules, or units are described in this disclosure to emphasize functional aspects of devices configured to perform the disclosed techniques, but do not necessarily require implementation by different hardware units. Rather, as described above, the various units may be combined in a codec hardware unit or provided by a set of interoperable hardware units in conjunction with appropriate software and / or firmware, including one or more processors as described above.
[0197] Various examples have been described. These and other examples are within the scope of the following claims.
Claims
1. A method of filtering a decoded block of video data, the method comprising: For each of the 25 consecutive categories C, a corresponding index value i is determined (122) c , where each index value i c Identifies a set of filter coefficients f(k,l) defining each of the plurality of filters, wherein the filters having the same index value i c The categories use the same set of filter coefficients f(k,l) and have the same index value i c The categories include non-consecutive categories among the 25 consecutive categories; Decoding (120) a current block of a current picture; according to Determine the category C of the current block, where D is a value representing the directionality of the corresponding block, and where is a value representing the activity of the corresponding block; Based on the determined index value i of the category C of the current block c , selecting a filter from the plurality of filters; as well as At least one pixel of the current block is filtered (128) using the selected filter.
2. The method according to claim 1, further comprising: computing one or more gradients for the at least one pixel in the filter support region; as well as A geometric transformation is selected to be performed on one of the filter support region or coefficients of the selected filter, wherein selecting the geometric transformation comprises selecting the geometric transformation that corresponds to an orientation of the gradient of the at least one pixel.
3. The method of claim 2, wherein the geometric transformation comprises one of a rotation, a diagonal flip, or a vertical flip.
4. The method of claim 2, wherein the filter support area comprises a plurality of neighboring pixels of the at least one pixel of the current block to which the coefficients of the selected filter are to be applied, and filtering the at least one pixel comprises performing the geometric transformation on the filter support area or the coefficients of the selected filter.
5. The method according to claim 1, further comprising: determining, for at least one class, a value of a flag indicating whether to use a fixed filter to predict a set of filter coefficients for the class; as well as In response to the value of the flag indicating use of a fixed filter to predict the set of filter coefficients, an index value into a fixed filter set is determined and a fixed filter in the fixed filter set identified by the index value is used to predict the set of filter coefficients for the class. The method of claim 1 , further comprising encoding the current block before decoding the current block.
7. An apparatus for filtering a decoded block of video data, the apparatus comprising: a memory configured to store the video data; as well as One or more processing units, implemented as circuit systems, configured to perform the following operations: For each of the 25 consecutive categories C, determine the corresponding index value i c , where each index value i c Identifies a set of filter coefficients f(k,l) defining each of the plurality of filters, wherein the filters having the same index value i c The categories use the same set of filter coefficients f(k,l) and have the same index value i c The categories include non-consecutive categories among the 25 consecutive categories; Decode the current block of the current picture; according to Determine the category C of the current block, where D is a value representing the directionality of the corresponding block, and where is a value representing the activity of the corresponding block; Based on the determined index value i of the category C of the current block c , selecting a filter from the plurality of filters; as well as At least one pixel of the current block is filtered using the selected filter.
8. The device of claim 7, wherein the device is a wireless communication device, further comprising: A receiver is configured to receive video data including the current picture, wherein the wireless communication device is a cellular telephone and the video data is received by the receiver and modulated according to a cellular communication standard.
9. A computer-readable storage medium having stored thereon instructions, which when executed cause a processor to perform the method of any one of claims 1-6.
10. An apparatus for filtering a decoded block of video data, the apparatus comprising: For each of the 25 consecutive categories C, determine (122) a corresponding index value i c components, where each index value i c Identifies a set of filter coefficients f(k,l) defining each of the plurality of filters, wherein the filters having the same index value i c The categories use the same set of filter coefficients f(k,l) and have the same index value i c The categories include non-consecutive categories among the 25 consecutive categories; means for decoding (120) a current block of a current picture; Used according to means for determining a category C of the current block, wherein D is a value representing a directionality of the corresponding block, and wherein is a value representing the activity of the corresponding block; The index value i for the category C of the current block determined based on the c , selecting a component of a filter from the plurality of filters; as well as Means for filtering (128) at least one pixel of the current block using the selected filter.
