Encoding and decoding method, bitstream, encoder, decoder, and storage medium
By introducing a multiplexing scheme of multiple historical filter banks into TALF, the problem of insufficient flexibility in the filtering process is solved, and the encoding/decoding performance and filtering effect are improved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2024-10-23
- Publication Date
- 2026-04-30
AI Technical Summary
In existing technologies, the filtering process of Time-Domain Adaptive Loop Filtering (TALF) lacks flexibility, which affects encoding and decoding performance.
Multiple historical filter banks are introduced for multiplexing. By determining the filter bank number identification information and multiplexing index parameters, an appropriate historical filter bank is selected to filter the current block, thereby improving the flexibility of the filtering process.
It improves encoding and decoding performance and achieves better filtering results.
Smart Images

Figure CN2024126889_30042026_PF_FP_ABST
Abstract
Description
Encoding / decoding methods, bitstreams, encoders, decoders, and storage media Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an encoding / decoding method, a bitstream, an encoder, a decoder, and a storage medium. Background Technology
[0002] In Versatile Video Coding (VVC), in order to improve filtering performance, the Time Adaptive Loop Filter (TALF) scheme has been proposed. TALF is an adaptive loop filtering technique that uses an image that has been reconstructed in the temporal or spatial domain as an information source to improve the reconstructed pixels at the current position in the current image.
[0003] In common techniques, historical filters can be reused. This can be achieved by using a set of historical filters, but this reduces the flexibility of the filtering process, affects filtering effectiveness, and degrades encoding / decoding performance.
[0004] Summary of the Invention
[0005] This application provides an encoding / decoding method, a bitstream, an encoder, a decoder, and a storage medium, which can improve the flexibility of the filtering process, thereby achieving better filtering results and improving encoding / decoding performance.
[0006] The technical solution of this application embodiment can be implemented as follows:
[0007] In a first aspect, embodiments of this application provide a decoding method applied to a decoder, the method comprising:
[0008] Decode the bitstream and determine the filter group number identifier information; wherein, the filter group number identifier information is used to determine the number of multiplexed historical filter groups;
[0009] In the case where multiple historical filter banks are determined to be reused based on the filter bank number identification information, the bitstream is decoded, multiple first multiplexing index parameters are determined, and multiple historical filter banks are determined to be reused based on the multiple first multiplexing index parameters.
[0010] Determine the historical TALF information corresponding to the current block from the plurality of historical filter banks;
[0011] The current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block.
[0012] Secondly, embodiments of this application provide an encoding method applied to an encoder, the method comprising:
[0013] When it is determined that multiple historical filter banks are to be reused, filter bank number identification information is set to indicate the reuse of multiple historical filter banks, and the filter bank number identification information is written into the bitstream; wherein, the filter bank number identification information is used to determine the number of historical filter banks reused;
[0014] Multiple historical filter banks are determined for reuse, and multiple first multiplexing index parameters are determined based on the multiple historical filter banks for reuse, and the multiple first multiplexing index parameters are written into the bitstream;
[0015] Determine the historical TALF information corresponding to the current block from the plurality of historical filter banks;
[0016] The current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block.
[0017] Thirdly, embodiments of this application provide a bitstream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least: filter group number identifier information, filter enable identifier information, multiplexing identifier information, first multiplexing index parameter, second multiplexing index parameter, third multiplexing index parameter, first filter identifier information, and second filter identifier information.
[0018] Fourthly, embodiments of this application provide an encoder, the encoder including a first determining portion; wherein,
[0019] The first determining part is configured to, when it is determined that multiple historical filter groups are to be reused, set filter group number identification information to indicate the reuse of multiple historical filter groups, and write the filter group number identification information into the bitstream; wherein, the filter group number identification information is used to determine the number of reused historical filter groups; determine the multiple reused historical filter groups, and determine multiple first multiplexing index parameters based on the multiple reused historical filter groups, and write the multiple first multiplexing index parameters into the bitstream; determine the historical TALF information corresponding to the current block in the multiple historical filter groups; filter the current block based on the historical TALF information, and determine the filtered reconstructed value of the current block.
[0020] Fifthly, embodiments of this application provide an encoder, which includes a first memory and a first processor; wherein,
[0021] A first memory for storing computer programs that can run on a first processor;
[0022] A first processor is configured to execute the encoding method described above when running the computer program.
[0023] Sixthly, embodiments of this application provide a decoder, which includes a second determining portion; wherein,
[0024] The second determination part is configured to decode the bitstream and determine filter group number identification information; wherein, the filter group number identification information is used to determine the number of multiplexed historical filter groups; if multiple historical filter groups are determined to be multiplexed based on the filter group number identification information, the bitstream is decoded, multiple first multiplexing index parameters are determined, and multiple multiplexed historical filter groups are determined based on the multiple first multiplexing index parameters; the historical TALF information corresponding to the current block is determined in the multiple historical filter groups; the current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block.
[0025] In a seventh aspect, embodiments of this application provide a decoder, which includes a second memory and a second processor; wherein,
[0026] The second memory is used to store computer programs that can run on the second processor;
[0027] The second processor is used to execute the decoding method described above when running the computer program.
[0028] Eighthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed, implements the decoding method as described in the first aspect or the encoding method as described in the second aspect.
[0029] In a ninth aspect, embodiments of this application provide a computer-readable storage medium for storing a bitstream generated by the encoding method described in the first aspect.
[0030] This application provides an encoding / decoding method, a bitstream, an encoder, a decoder, and a storage medium. At the decoding end, the bitstream is decoded to determine filter group number identification information. The filter group number identification information is used to determine the number of multiplexed historical filter groups. If multiple historical filter groups are determined to be multiplexed based on the filter group number identification information, the bitstream is decoded to determine multiple first multiplexing index parameters, and multiple multiplexed historical filter groups are determined based on these parameters. Historical TALF information corresponding to the current block is determined from among the multiple historical filter groups. The current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block. At the encoding end, when it is determined that multiple historical filter banks are to be reused, filter bank number identification information is set to indicate the reuse of multiple historical filter banks, and the filter bank number identification information is written into the bitstream; wherein, the filter bank number identification information is used to determine the number of reused historical filter banks; multiple reused historical filter banks are determined, and multiple first multiplexing index parameters are determined based on the multiple reused historical filter banks, and the multiple first multiplexing index parameters are written into the bitstream; the historical TALF information corresponding to the current block is determined in the multiple historical filter banks; the current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block. Therefore, this application proposes a scheme to introduce multiple historical filter banks for multiplexing, wherein, when it is determined that multiple reuse of multiple historical filter banks is supported, multiple reused filter banks can be selected, and the historical filters reused in the current block can be determined based on these multiple filter banks. In this way, for the current block, there are more historical filters to choose from when reusing historical filters, thereby improving the flexibility of the filtering process, achieving better filtering effects, and improving encoding and decoding performance. Attached Figure Description
[0031] Figure 1 is a schematic diagram of the application of a coding framework provided by related technologies;
[0032] Figure 2 is a schematic diagram of the filter proposed in an embodiment of this application;
[0033] Figure 3 is a schematic diagram of the filter proposed in the embodiment of this application;
[0034] Figure 4 is a system block diagram of an encoder provided in an embodiment of this application;
[0035] Figure 5 is a system block diagram of a decoder provided in an embodiment of this application;
[0036] Figure 6 is a schematic diagram of the decoding method proposed in the embodiments of this application;
[0037] Figure 7 is a schematic diagram of the encoding method proposed in the embodiments of this application;
[0038] Figure 8 is a schematic diagram of the encoder structure proposed in the embodiment of this application;
[0039] Figure 9 is a schematic diagram of the specific hardware structure of the encoder proposed in the embodiment of this application;
[0040] Figure 10 is a schematic diagram of the composition structure of the decoder proposed in the embodiment of this application;
[0041] Figure 11 is a schematic diagram of the specific hardware structure of the decoder proposed in the embodiment of this application;
[0042] Figure 12 is a schematic diagram of the composition structure of the encoding and decoding system proposed in the embodiment of this application. Detailed Implementation
[0043] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It is understood that the specific embodiments described herein are merely for explaining the relevant application and not for limiting the application. Furthermore, it should be noted that, for ease of description, only the parts relevant to the application are shown in the accompanying drawings.
[0044] In the following description, references to "some embodiments" refer to a subset of all possible embodiments. It is understood that "some embodiments" may be the same or different subsets of all possible embodiments and may be combined with each other without conflict. It should also be noted that the terms "first, second, third" used in the embodiments of this application are merely for distinguishing similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0045] Digital video compression technology primarily compresses massive amounts of digital video data to facilitate transmission and storage. With the surge in internet video and increasing demands for video clarity, while existing digital video compression standards can save considerable video data, there is still a need to pursue better digital video compression technologies to reduce the bandwidth and traffic burden of digital video transmission.
[0046] In digital video encoding, the encoder reads unequal samples from the original video sequence in different color formats, including luminance and chrominance components; that is, the encoder reads a black-and-white or color image. This data is then divided into blocks, and the block data is passed to the encoder for encoding.
[0047] Common video codec standards all employ a block-based hybrid coding framework. Each frame of a video image is divided into squares of equal size (e.g., 128×128, 64×64, etc.) called Largest Coding Units (LCUs) or Coding Tree Units (CTUs). Each LCU or CTU can be further divided into rectangular Coding Units (CUs) according to rules. Moreover, Coding Units may be further divided into smaller Prediction Units (PUs), Transform Units (TUs), etc.
[0048] Figure 1 is a schematic diagram of an application of a coding framework provided by related technologies. As shown in Figure 1, the hybrid coding framework may include a prediction module 11, a transform and quantization module 12, an entropy coding module 13, an inverse quantization and inverse transform module 14, a loop filtering module 15, and a decoding image buffer module 16. The prediction module 11 may include an intra-frame prediction module 11a and an inter-frame prediction module 11b. The inter-frame prediction module 11b may include a motion estimation module and a motion compensation module. Since there is a strong correlation between adjacent samples within a video image frame, using intra-frame prediction in video coding and decoding technology can eliminate spatial redundancy between adjacent samples. However, since there is also a strong similarity between adjacent frames in a video image, using inter-frame prediction in video coding and decoding technology can eliminate temporal redundancy between adjacent frames, thereby improving coding and decoding efficiency. The basic workflow of a video codec is as follows: At the encoding end, a frame is divided into blocks. Intra-frame prediction or inter-frame prediction is used on the coded blocks to generate prediction blocks. The original block of the coded block is subtracted from the prediction block to obtain a residual block. The residual block is transformed and quantized to obtain a quantization coefficient matrix. The quantization coefficient matrix is entropy-encoded and output to the bitstream. At the decoding end, intra-frame prediction or inter-frame prediction is used on the coded blocks to generate prediction blocks. On the other hand, the bitstream is decoded to obtain a quantization coefficient matrix. The quantization coefficient matrix is inverse-quantized and inverse-transformed to obtain a residual block. The prediction block and the residual block are added to obtain the reconstructed value. The reconstructed value forms the reconstructed image. Loop filtering is performed on the reconstructed image based on the image or based on the blocks to obtain the decoded image. The encoding end also needs similar operations to the decoding end to obtain the decoded image. The decoded image can be used as a reference frame for inter-frame prediction in subsequent frames. The block division information, prediction, transformation, quantization, entropy coding, loop filtering, and other mode information or parameter information determined at the encoding end need to be output to the bitstream if necessary. The decoding end determines the same block partitioning information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information as the encoding end by parsing and analyzing existing information, thereby ensuring that the decoded image obtained by the encoding end is the same as that obtained by the decoding end. The decoded image obtained by the encoding end is usually also called the reconstructed image. During prediction, the coded block can be divided into prediction units, and during transform, the coded block can be divided into transform units. The division of prediction units and transform units can be different. The above is the basic flow of a video codec under a block-based hybrid coding framework. With the development of technology, some modules or steps of this framework or flow may be optimized. The embodiments of this application are applicable to the basic flow of a video codec under this block-based hybrid coding framework, but are not limited to this framework and flow.
[0049] Understandably, intra-frame prediction only references information from the same frame to predict sample information within the current block, thus eliminating spatial redundancy; inter-frame prediction can reference image information from different frames, using motion estimation to search for the motion vector information that best matches the current block, thus eliminating temporal redundancy; transform converts the predicted image block to the frequency domain, redistributing energy, and combined with quantization, removes information that is not sensitive to the human eye, thus eliminating visual redundancy; entropy coding can eliminate character redundancy based on the current context model and the probability information of the binary code stream; loop filtering mainly processes the samples after inverse transform and inverse quantization to compensate for distorted information and provide a better reference for subsequent encoded samples.
[0050] Loop filtering is prevalent in existing video coding standards, significantly improving the subjective and objective quality of reconstructed video. In VVC, loop filtering includes a deblocking filter (DBF), sample adaptive offset (SAO), adaptive loop filter (ALF), and cross component adaptive loop filter (CCALF). In the latest JVET Legacy Video Coding Exploration Platform Reference Software Test Model (ECM), loop filtering further includes cross component sample adaptive offset (CCSAO) and bilateral filter (BIF).
[0051] The principle of adaptive loop filtering and cross-component adaptive loop filtering is to calculate one or more sets of filter coefficients based on the relationship between the reconstructed values and the original sample values. The filter coefficients are transmitted through the bitstream. After the decoder obtains the filter coefficients, it can construct a filter and use the filter to filter the reconstructed image, making the reconstructed image closer to the original image after filtering.
[0052] Adaptive Loop Filtering in the Temporal Domain (TALF) is an adaptive loop filtering technique that uses an image that has been reconstructed in the temporal or spatial domain as an information source to improve the reconstructed pixels at the current position in the current image.
[0053] I. Unidirectional Filtering and Bidirectional Time-Domain Adaptive Loop Filtering
[0054] In time-domain adaptive loop filtering, filters are divided into unidirectional and bidirectional filters, which can be further subdivided into the following six types (assuming the current position is (x, y) in the current image).
[0055] 1. Use the (x, y) of the nearest reference image in the time domain of the current image and its corresponding reconstructed values as the filter input to perform unidirectional filtering;
[0056] 2. Use the (x, y) values of the second nearest reference image in the temporal domain of the current image and the corresponding reconstructed values of its surroundings as the filter input to perform unidirectional filtering; (in bidirectional prediction images, there may be a second nearest reference image whose temporal distance is the same as the nearest reference image).
[0057] 3. Use the (x, y) values of the nearest and second nearest reference images in the time domain of the current image and their corresponding reconstructed values as filter inputs to perform bidirectional filtering;
[0058] 4. When the current position (x, y) belongs to the inter-frame prediction block and there is an Mv0 pointing to the reference image list 0 in the motion buffer, use Mv0 and (x, y) to find the reference position (x', y'), and use the (x', y') of the reference image pointed to by Mv0 and the corresponding reconstruction value of its surrounding area as the filter input to perform one-way filtering.
[0059] 5. When the current position (x, y) belongs to the inter-frame prediction block and there is an Mv1 pointing to the reference image list 1 in the motion buffer, use Mv1 and (x, y) to find the reference position (x', y'), and use the (x', y') of the reference image pointed to by Mv1 and the corresponding reconstruction value of its surrounding area as the filter input to perform one-way filtering.
[0060] 6. When the current position (x, y) belongs to the inter-frame prediction block, and there are Mv0 pointing to reference image list 0 and Mv1 pointing to reference image list 1 in the motion buffer, use Mv0 and (x, y) to find the reference position (x', y'), use Mv1 and (x, y) to find the reference position (x”, y”), and use the reconstructed values of (x', y') of the reference image pointed to by Mv0 and its surrounding area and the reconstructed values of (x”, y”) of the reference image pointed to by Mv1 and its surrounding area as filter inputs to perform bidirectional filtering.
[0061] In some embodiments, in addition to using Mv to guide the offset to find the filter input in the reconstructed image, Bv can also be used to guide the offset to find the filter input in the current image.
[0062] Figure 2 is a schematic diagram of the filter proposed in an embodiment of this application. As shown in Figure 2, a 5x5 symmetrical filter contains 7 filter coefficients. Bidirectional filtering uses two filters from Figure 2 for filtering.
[0063] Figure 3 is a schematic diagram of the filter proposed in an embodiment of this application. As shown in Figure 3, a 7x7 symmetrical filter contains 13 filter coefficients. The filter in Figure 3 is used for unidirectional filtering.
[0064] The time-domain adaptive loop filter further includes the reuse of historical filters, adaptive accuracy of filter coefficients, and nonlinear truncation of the filter.
[0065] II. Time-Domain Adaptive Loop Filter for Reusing Historical Decoding
[0066] Adaptive loop filter (ALF), cross component adaptive loop filter (CCALF), and cross component sample adaptive offset (CCSAO) all employ techniques to reuse already decoded filters on the current image. This saves on the extra codeword overhead of encoding and decoding new filter coefficients. In ALF and CCALF, filter-related syntax elements are encoded and decoded in the APS (Adaptive Preset Filter). If the current image reuses a historical filter, an index in the APS is encoded and decoded to indicate which APS filter is being reused. In CCSAO, the reused filter information is indicated by the syntax elements in the header. Historical CCSAO filters are recorded using a FIFO of length N, and a header index is encoded and decoded to indicate which of the N historical filters is being reused.
[0067] Similar to these, TALF also introduces adaptive loop filters that reuse history. One implementation method is to store and update the FIFO used to store historical filters on a slice-by-slice basis. The current slice determines whether it uses temporal adaptive filtering by parsing the slice-level control identifier. If the current slice uses it, an identifier is further parsed to indicate whether the historical temporal adaptive loop filter is reused. If it is not reused, the current image's filter and its coefficients are further parsed and used to update the FIFO; otherwise, a reuse index is parsed to indicate which set of filters in the FIFO is reused. The method for updating the FIFO is to shift each element in the FIFO one position to the right and store one or more sets of filters parsed from the current slice at the beginning of the FIFO; if the number of elements in the FIFO reaches the maximum FIFO length, the last element of the FIFO is removed first, and then the elements are shifted and the filters are stored.
[0068] Third, in ALF, when the nonlinear ALF mode is set to 1, ALF uses nonlinear filtering, and each input value of the filter is limited to a specified range. This design also exists in TALF.
[0069] The following example does not use a non-linear TALF:
[0070] For unidirectional filtering in the Random Access (RA) configuration, or a 7x7 symmetric 13-tap filter using a reconstructed value from a reconstructed image as input in the Low Delay (LD) configuration, the filtering formula is:
[0071] Among them, rec (x,y) rec′ represents the reconstructed value of the current image at coordinates (x, y) before inputting TALF. (x,y) c represents the reconstructed value of the current image at coordinates (x, y) after TALF filtering. i The filter coefficients represent the filter parameters. and It is in the inter-frame reference image (xu) i ,yu i ) and (x+u i y+u i Reconstructed sample values on ).
[0072] For bidirectional filtering in RA, or two 5x5 symmetrical 14-tap filters using reconstructed values from two reconstructed images as input in LD, the filtering formula is:
[0073] A formula K(a, b) that restricts the range of values can be defined as follows, where b is an integer greater than or equal to zero.
[0074] K(a, b)=min (b, max(-b, a)) (3)
[0075] Where min(i,j) is the smaller of i and j, and max(i,j) is the larger of i and j.
[0076] When using nonlinear time-domain adaptive loop filtering, for unidirectional filtering in RA, or a 7x7 symmetric 13-tap filter using a reconstructed image as input in LD, the filtering formula is:
[0077] Among them, b i Represents the corresponding c iThe filter coefficient positions are used to limit the range of filter inputs, and in this scheme, they are determined by the syntax elements used for encoding and decoding in the bitstream.
[0078] For bidirectional filtering in RA, or two 5x5 symmetrical 14-tap filters using reconstructed values from two reconstructed images as input in LD, the filtering formula is:
[0079] IV. Adaptive Accuracy of Time-Domain Loop Filters
[0080] Assuming the time-domain loop filter is defined as shown in formulas (1) and (2), the filter coefficients c should ideally be floating-point numbers. However, considering the issues of coefficient representation and hardware implementation, actual ALF, CCALF, TALF, etc., should use integer precision coefficients. Furthermore, actual filtering should involve biasing and shifting operations. When the range of integer coefficient values is large, more codewords are needed to represent the coefficients, and the reconstructed image after filtering is closer to the original image with less distortion. When the range of integer coefficient values is small, fewer codewords are needed to represent the coefficients, but the reconstructed image after filtering differs significantly from the original image, resulting in greater distortion. The process of obtaining better compression efficiency is the process of obtaining the best balance between codewords and distortion. Therefore, the time-domain loop filter needs a precision that can achieve optimal rate-distortion. This precision affects the number of codewords consumed by encoding and decoding, and also affects the quality of the reconstructed image.
[0081] Below is an example of a TALF filtering process. For instance, when using two reconstructed images as input in RA or LD, the filter value is calculated as follows:
[0082] sum=tAlfCoeff[talf_ctb_idc-1][0]*(rec0[x][y]-rec[x][y])+
[0083] tAlfCoeff[talf_ctb_idc-1][1]*(rec1[x][y]-rec[x][y])+
[0084] tAlfCoeff[talf_ctb_idc-1][2]*(rec0[x-1][y]+rec0[x+1][y]–2*rec[x][y])+
[0085] tAlfCoeff[talf_ctb_idc-1][3]*(rec1[x-1][y]+rec1[x+1][y]–2*rec[x][y])+
[0086] tAlfCoeff[talf_ctb_idc-1][4]*(rec0[x][y-1]+rec0[x][y+1]-2*rec[x][y])+
[0087] tAlfCoeff[talf_ctb_idc-1][5]*(rec1[x][y-1]+rec1[x][y+1]-2*rec[x][y])+
[0088] tAlfCoeff[talf_ctb_idc-1][6]*(rec0[x+1][y-1]+rec0[x-1][y+1]-2*rec[x][y])+
[0089] tAlfCoeff[talf_ctb_idc-1][7]*(rec1[x+1][y-1]+rec1[x-1][y+1]-2*rec[x][y])+
[0090] tAlfCoeff[talf_ctb_idc-1][8]*(rec0[x-1][y-1]+rec0[x+1][y+1]-2*rec[x][y])+
[0091] tAlfCoeff[talf_ctb_idc-1][9]*(rec1[x-1][y-1]+rec1[x+1][y+1]-2*rec[x][y])+
[0092] tAlfCoeff[talf_ctb_idc-1]
[0010] *(rec0[x-2][y]+rec0[x+2][y]-2*rec[x][y])+
[0093] tAlfCoeff[talf_ctb_idc-1]
[0011] *(rec1[x-2][y]+rec1[x+2][y]-2*rec[x][y])+
[0094] tAlfCoeff[talf_ctb_idc-1]
[0012] *(rec0[x][y-2]+rec0[x][y+2]-2*rec[x][y])+
[0095] tAlfCoeff[talf_ctb_idc-1]
[0013] *(rec1[x][y-2]+rec1[x][y+2]-2*rec[x][y])
[0096] signSum=sum<0?-1:1
[0097] scaledAbsSum=(abs(sum)+(1<<(shift-1)))>>shift
[0098] scaledSum=scaledAbsSum*signSum
[0099] rec'[x][y]=max(min(rec[x][y]+scaledSum, (1< <BitDepth)-1),0)
[0100] A variable shift value can be used because a large shift value results in a wide range of filter coefficients, better filtering, and more codewords; a small shift value results in a narrow range of filter coefficients, poorer filtering, and fewer codewords. Transmitting a variable shift value through the bitstream makes the filter coefficients more adaptive. The transmitted shift value can be one for each temporal filter, one for each frame, or one for each sequence.
[0101] In related technologies, the absolute value of each filter coefficient is represented using 0th-order exponential Golomb code when encoding and decoding. Due to the introduction of a variable shift value, the range of coefficient values is wider when the shift is larger. Using 0th-order Golomb code cannot minimize the number of codewords used when encoding and decoding coefficients. Therefore, a variable-order Golomb code can be introduced to encode and decode each coefficient. For example, each filter can choose an optimal order from 0, 1, ... N, and the order is transmitted to each filter through the bitstream, allowing the coefficient encoding of each filter to use the optimal exponential Golomb order. Besides transmitting an order per filter, some embodiments can also transmit the order on a per-image, per-sequence basis, meaning that the time-domain filter coefficients encoded and decoded in an image use the same order of exponential Golomb code, or the same sequence uses the same order of exponential Golomb code.
[0102] V. Implementation Methods of TALF
[0103] The decoder parses the bitstream to obtain the current image's filtering mode, number of filters, filter coefficients, whether each CTU uses TALF filtering, and which set of filters to use.
[0104] After ALF filtering, the CTUs selected by ALF in the current image are filtered using the corresponding filter.
[0105] Referring to the decoding practices specified in the VVC standard text, the time-domain adaptive loop filtering implemented in this scheme should include the following parts:
[0106] (a) Parsing sequence-level syntax elements
[0107] The sequence flag `sps_talf_enabled_flag` indicates whether the current sequence can use TALF. When this syntax element is not present in the bitstream, its value is inferred to be 0. A value of 1 indicates that the current sequence can use TALF, while a value of 0 indicates that TALF cannot be used.
[0108] (b) Parsing fragment-level syntax elements
[0109] The `sh_talf_enabled_flag` syntax element is the TALF enable flag in the slice header. When this syntax element is not present in the bitstream, its value is inferred to be 0. A value of 1 indicates that TALF can be used in the current slice, while a value of 0 indicates that TALF cannot be used.
[0110] The talf_filter_mode syntax element is a syntax element that indicates which TALF mode the current chip uses. The values 0 to 5 indicate which of the six filtering modes (one-way and two-way filtering) the current chip uses.
[0111] The `talf_num_filters_signalled_minus1` syntax element indicates the number of TALF filters in the current slice minus one. In this scheme, since a slice can have a maximum of 8 TALF filters, the value of `talf_num_filters_signalled_minus1` can be 0, 1, 2, ..., or 7. A value of 0 indicates that the current slice has one TALF filter; 1 indicates that the current slice has two TALF filters; 2 indicates that the current slice has three TALF filters; 3 indicates that the current slice has four TALF filters, and so on. When this syntax element is not present in the bitstream, its value is 0.
[0112] The variable numCoeff represents the number of filter coefficients in the filter. In this scheme, the filters used for the forward and backward directions in the RA configuration and the most recent first and second frames in the LD configuration are symmetrical 7x7 filters with 13 coefficients. Therefore, numCoeff is equal to 13 in the corresponding cases (i.e., talf_filter_mode is 0 or 1). For the bidirectional filtering in the RA configuration and the filters used for the two most recent images in the LD configuration, the filters are two 5x5 filters with 7 coefficients each, for a total of 14 coefficients. Therefore, numCoeff is equal to 14 in the corresponding cases (i.e., talf_filter_mode is 2).
[0113] The `talf_coeff_abs[sfIdx][j]` syntax element indicates the absolute value of the j-th coefficient of the sfIdx-th filter group, represented using K-order exponential Golomb code where K is 0. Its value is 0 when this syntax element is not present in the bitstream.
[0114] The `talf_coeff_sign[sfIdx][j]` syntax element indicates the sign of the j-th coefficient of the sfIdx-th filter group. A value of 1 indicates a negative coefficient, and a value of 0 indicates a positive coefficient. Its value is 0 when this syntax element is not present in the bitstream.
[0115] The FIFO of the historical time-domain filter needs to be cleared when at least one of the following three conditions is true, as shown in the table above.
[0116] The tAlfParamPool.clear() operation clears the FIFO of the history time-domain filter.
[0117] The `talf_reuse_flag` syntax element indicates whether the historical time-domain loop filter is reused during the current slice encoding / decoding. A value of 1 indicates reuse of the historical time-domain loop filter, while a value of 0 indicates non-reuse. When this flag is not present in the bitstream, its value is 0.
[0118] The `talf_reuse_index` syntax element represents the index of the historical time-domain loop filter FIFO used in the current slice multiplexing. Since the maximum FIFO length used in this scheme is 8, the index value can be 0, 1, 2, 3, 4, 5, 6, or 7, represented using a fixed-length code of 3 bins. When this syntax element is not present in the bitstream, its value is 0.
[0119] If the current chip does not reuse the historical time-domain adaptive loop filter, and the current chip uses time-domain loop filtering technology, then the FIFO of the historical time-domain loop filter needs to be updated based on the new filter obtained from the analysis.
[0120] `talf_shift_minus6` indicates the variable precision used by one or more time-domain loop filters in the current slice encoding / decoding. It means subtracting 6 from the shift value used in the filtering. This syntax element is represented in this scheme using a fixed-length code of length 2 bins, with values of 0, 1, 2, or 3. Its value is 0 when this syntax element is not present in the bitstream.
[0121] `talf_k_order[sfIdx]` represents the exponential Golomb order used when calculating the absolute value of the `sfIdx`-th filter encoding / decoding coefficients in the current slice. Its value is either 0 or 1; 0 indicates the use of 0th-order exponential Golomb code, and 1 indicates the use of 1st-order exponential Golomb code. Its value is 0 when this syntax element is not present in the bitstream.
[0122] The operation tAlfParamPool[poolIdx][0].shift = talf_shift_minus6 + 6 means restoring the parsed talf_shift_minus6 to the shift value and updating the first and second positions of the FIFO in the historical time-domain loop filter.
[0123] `talf_clip_flag[sfIdx]` indicates whether the `sfIdx`-th time-domain loop filter in the current slice uses nonlinearity. This syntax element takes the value 0 or 1; 1 indicates that the `sfIdx`-th time-domain loop filter uses nonlinearity, and 0 indicates that nonlinearity is not used. When this syntax element is not present in the bitstream, its value is 0.
[0124] `talf_clip_idx[sfIdx][j]` represents the nonlinearity index value used by the i-th coefficient of the sfIdx-th time-domain loop filter in the current slice. This syntax element takes the value 0, 1, 2, or 3. A value of 0 indicates that the input of the filter coefficient at this position does not use nonlinearity. 1, 2, and 3 represent the indices of the corresponding nonlinear truncation values, used to retrieve the truncation value from the nonlinear truncation value table. This syntax element uses a fixed-length code encoding / decoding of 2 bins. Its value is 0 if this syntax element does not exist in the bitstream.
[0125] The operation tAlfParamPool[poolIdx][0].clipIdx[sfIdx][j]=talf_clip_idx[sfIdx][j] means that the parsed talf_clip_idx value is assigned to the FIFO of the corresponding historical time-domain loop filter.
[0126] (c) Parse the code tree block syntax elements
[0127] The `talf_ctb_idc[CtbAddrX][CtbAddrY]` syntax element indicates whether the luminance block of the coding tree, which is CtbAddrX in the horizontal direction and CtbAddrY in the vertical direction, uses TALF filtering. When `talf_reuse_flag` is 0, its value ranges from 0 to `talf_num_filters_signalled_minus1`. For example, if `talf_num_filters_signalled_minus1` is 1, then the value of `talf_ctb_idc` can be 0 or 1. If `talf_num_filters_signalled_minus1` is 2, then `talf_ctb_idc` can take the value 0, 1, or 2. When `talf_reuse_flag` is 1, its value range should be 1 to `tAlfParamPool[poolIdx][talf_reuse_idx].filterCount`, where `tAlfParamPool[poolIdx][talf_reuse_idx].filterCount` represents the number of filters in the selected historical filter group. `talf_ctb_idc` being 0 indicates that the current coding tree luma block does not use TALF filtering, 1 indicates that the first filter group is used, 2 indicates that the second filter group is used, and so on. Its value is 0 when the syntax element does not exist in the bitstream.
[0128] (d) Reconstructing filter coefficients
[0129] If the current slice's talf_ctb_idc is not equal to 0 and talf_reuse_flag is 0, the coefficients, shift values, and nonlinear limit values of the time-domain adaptive loop filter need to be reconstructed.
[0130] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0131] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0132] {
[0133] for(j=0;j <numCoeff;j++)
[0134] {
[0135] tAlfCoeff[sfIdx][j]=(talf_coeff_sign[sfIdx][j]==1)?
[0136] -talf_coeff_abs[sfIdx][j]:talf_coeff_abs[sfIdx][j]
[0137] }
[0138] }
[0139] The process of obtaining the nonlinear tAlfClip value of the current slice is as follows:
[0140] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0141] clipTable[0] = 1 < <inputBitdepth
[0142] for(i=0;i<4;i++)
[0143] {
[0144] clipTable[i]=1<<((7-2*i+(inputBitdepth-8)))
[0145] }
[0146] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0147] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0148] {
[0149] for(j=0;j <numCoeff;j++)
[0150] {
[0151] tAlfClip[sfIdx][j]=clipTable[talf_clip_idx[sfIdx][j]]
[0152] }
[0153] }
[0154] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0155] shift = talf_shift_minus6 + 6
[0156] If the current slice's talf_ctb_idc is not equal to 0 and talf_reuse_flag is 1, then the coefficient values, shift values, and nonlinear limit values need to be obtained from the FIFO of the historical time-domain adaptive loop filter.
[0157] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0158] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0159] {
[0160] for(j=0;j <numCoeff;j++)
[0161] {
[0162] tAlfCoeff[sfIdx][j]=tAlfParamPool[poolIdx][talf_reuse_idx].coeff[sfIdx][j]
[0163] }
[0164] }
[0165] The process of obtaining the nonlinear tAlfClip value of the current slice is as follows:
[0166] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0167] clipTable[0] = 1 < <inputBitdepth
[0168] for(i=0;i<4;i++)
[0169] {
[0170] clipTable[i]=1<<((7-2*i+(inputBitdepth-8)))
[0171] }
[0172] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0173] filterCount=tAlfParamPool[poolIdx][talf_reuse_idx].filterCount
[0174] for(sfIdx=0;sfIdx<=filterCount;sfIdx++)
[0175] {
[0176] for(j=0;j <numCoeff;j++)
[0177] {
[0178] tAlfClip[sfIdx][j]=
[0179] clipTable[tAlfParamPool[poolIdx][talf_reuse_idx].clipIdx[sfIdx][j]]
[0180] }
[0181] }
[0182] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0183] shift=tAlfParamPool[poolIdx][talf_reuse_idx].shift
[0184] (e) Perform TALF filtering on the luminance coding tree block
[0185] If the talf_ctb_idc flag of the current luminance coding tree block is non-zero, TALF filtering is required. This step first requires obtaining the following variable values:
[0186] - A reconstructed luminance image array rec after luminance adaptive loop filtering.
[0187] -talf_filter_mode mode value
[0188] - Indicates the luminance coordinates (xCtb, yCtb) of the current luminance coding tree block in the current image.
[0189] - The width tAlfWidth and height tAlfHeight of the luminance coding tree block
[0190] - The coefficients tAlfCoeff[][] of the time-domain adaptive loop filter.
[0191] - The cutoff value tAlfClip[][] of the time-domain adaptive loop filter.
[0192] -Time-domain adaptive loop filter shift value
[0193] The first step is to obtain the reconstructed image and MV:
[0194] The input image of the filter is determined based on talf_filter_mode.
[0195] If talf_filter_mode is 0, then the nearest reconstructed image rec0 is used as input;
[0196] If talf_filter_mode is 3, then check the motion vector buffer corresponding to the current position (x, y), and check whether the motion vector buffer contains Mv0 pointing to the reference image in the reference image list 0. If it contains it, then use the reference image rec0 pointed to by Mv0 as input; otherwise, skip the filtering at the current position.
[0197] If talf_filter_mode is 1, the backward nearest reconstructed image rec1 is used in RA mode, and the forward second nearest reconstructed image rec1 is used as input in LD mode.
[0198] If talf_filter_mode is 4, then check the motion vector buffer corresponding to the current position (x, y), and check whether the motion vector buffer contains Mv1 pointing to the reference image in reference image list 1. If it contains it, then use the reference image rec1 pointed to by Mv1 as input; otherwise, skip the filtering at the current position.
[0199] If talf_filter_mode is 2, then in RA mode, the forward nearest reconstructed image rec0 and the backward nearest reconstructed image rec1 are used as input, and in LD mode, the forward nearest reconstructed image rec0 and the second nearest reconstructed image rec1 are used as input.
[0200] If talf_filter_mode is 5, then check the motion vector buffer corresponding to the current position (x, y). Check if the motion vector buffer contains Mv0 pointing to the reference image in reference image list 0 and Mv1 pointing to the reference image in reference image list 1. If it contains them, then use the reference image rec0 pointed to by Mv0 and the reference image rec1 pointed to by Mv1 as input. Otherwise, skip the filtering at the current position.
[0201] The second step is to obtain the shift value:
[0202] If Mv0 and Mv1 are found in the first step, then since Mv is used in inter-frame prediction with subpixel precision, the position offset on the reconstructed image pointed to by Mv is obtained here by rounding to positive pixel precision.
[0203] The horizontal integer pixel offset of Mv0 is:
[0204] Offset0X=Mv0. Hor<0? -((abs(Mv0.Hor)+8)>>4):((abs(Mv0.Hor)+8)>>4)
[0205] The vertical integer pixel position offset of Mv0 is:
[0206] Offset0Y=Mv0. Ver<0? -((abs(Mv0.Ver)+8)>>4):((abs(Mv0.Ver)+8)>>4)
[0207] The horizontal integer pixel offset of Mv1 is:
[0208] Offset1X=Mv1.Hor<0? -((abs(Mv1.Hor)+8)>>4):((abs(Mv1.Hor)+8)>>4)
[0209] The vertical integer pixel position offset of Mv1 is:
[0210] Offset1Y=Mv1.Ver<0? -((abs(Mv1.Ver)+8)>>4):((abs(Mv1.Ver)+8)>>4)
[0211] If talf_filter_mode is 0, 1, or 2 in the first step, since it is not necessary to export offset values based on Mv, Offset0X, Offset0Y, Offset1X, and Offset1Y are set to 0.
[0212] The third step is to reconstruct the image based on the obtained positional offset and then filter it using filtering coefficients.
[0213] The filtering calculation for each position in the luminance-coded block is as follows:
[0214] talf_filter_mode is 2:
[0215] In the above calculation and filtering process, shift is 6, BitDepth variable is the bit depth of the luminance component, and x and y represent the horizontal and vertical coordinates of the reconstructed image array. x0, y0, x1, and y1 are the coordinates of the center positions of rec0 and rec1 after offset, respectively. When reconstructing values in the arrays of coordinate positions rec0 and rec1, the horizontal coordinate should be limited to between 0 and the image width picWidth-1, and the vertical coordinate should be limited to between 0 and the image height picHeight-1, referring to formula (3).
[0216] When talf_filter_mode is 5, compared to talf_filter_mode 2, filtering for positions without corresponding motion information needs to be skipped.
[0217] When talf_filter_mode is 0:
[0218] When talf_filter_mode is 3, compared to talf_filter_mode is 0, filtering for positions without corresponding motion information needs to be skipped.
[0219] When talf_filter_mode is 1:
[0220] When talf_filter_mode is 4, compared to talf_filter_mode 1, filtering for positions without corresponding motion information needs to be skipped.
[0221] During the filtering process, this scheme uses the same image edge padding method as ALF to obtain the TALF input values outside the required image range.
[0222] In some embodiments, ALF filtering performs edge padding on a block-by-block basis. Filtering within a block does not use the reconstructed values of other blocks. In this case, TALF can also perform edge padding on a block-by-block basis.
[0223] In the latest JVET Enhanced Compression Model (ECM) reference software test model, motion information includes motion vectors (MV), block vectors (BV), and a series of coding unit-level variables. This motion information is referenced in inter-frame prediction or IBC, intraTMP prediction modes. After each coding unit decides its prediction mode, the unit's motion information is stored in a motion information buffer. However, storing motion information in the motion information buffer pixel by pixel would require a large amount of on-chip storage. In ECM, to save on-chip storage, motion information is stored in sub-blocks of NxN pixels, for example, N=2, N=4, etc.
[0224] In common TALF methods, when the slice level flag talf_reuse_flag is 1, the CTU level will select one set of filters from multiple sets of filters saved from the historical slices for filtering.
[0225] In other words, in common technologies, filtering can be performed using fixed one-way and two-way filters in encoding and decoding. However, this reduces the flexibility of the filtering process, affects the filtering effect, and reduces the encoding and decoding performance.
[0226] To address the aforementioned issues, embodiments of this application provide an encoding / decoding method, a bitstream, an encoder, a decoder, and a storage medium. At the decoding end, the bitstream is decoded to determine filter group number identifier information; wherein, the filter group number identifier information is used to determine the number of multiplexed historical filter groups; if multiple historical filter groups are determined to be multiplexed based on the filter group number identifier information, the bitstream is decoded to determine multiple first multiplexing index parameters, and multiple multiplexed historical filter groups are determined based on the multiple first multiplexing index parameters; historical TALF information corresponding to the current block is determined among the multiple historical filter groups; the current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block. At the encoding end, when it is determined that multiple historical filter banks are to be reused, filter bank number identification information is set to indicate the reuse of multiple historical filter banks, and the filter bank number identification information is written into the bitstream; wherein, the filter bank number identification information is used to determine the number of reused historical filter banks; multiple reused historical filter banks are determined, and multiple first multiplexing index parameters are determined based on the multiple reused historical filter banks, and the multiple first multiplexing index parameters are written into the bitstream; the historical TALF information corresponding to the current block is determined in the multiple historical filter banks; the current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block. Therefore, this application proposes a scheme to introduce multiple historical filter banks for multiplexing, wherein, when it is determined that multiple reuse of multiple historical filter banks is supported, multiple reused filter banks can be selected, and the historical filters reused in the current block can be determined based on these multiple filter banks. In this way, for the current block, there are more historical filters to choose from when reusing historical filters, thereby improving the flexibility of the filtering process, achieving better filtering effects, and improving encoding and decoding performance.
[0227] Referring to Figure 4, which shows an example of a system block diagram of an encoder provided in an embodiment of this application. As shown in Figure 4, the encoder 10 may include: a segmentation unit 101, a prediction unit 102, a first adder 107, a transform unit 108, a quantization unit 109, an inverse quantization unit 110, an inverse transform unit 111, a second adder 112, a filtering unit 113, a Decoded Picture Buffer (DPB) unit 114, and an entropy coding unit 115. Here, the input of the encoder 10 can be a video composed of a series of images or a single still image, and the output of the encoder 10 can be a bitstream (also called a "bitstream") representing a compressed version of the input video.
[0228] The segmentation unit 101 segments the images in the input video into one or more Coding Tree Units (CTUs). The segmentation unit 101 divides the image into multiple tiles, and can further divide a tile into one or more bricks. Here, a tile or a brick can include one or more complete and / or partial CTUs. Additionally, the segmentation unit 101 can form one or more slices, where a slice can include one or more tiles arranged in raster order in the image, or one or more tiles covering a rectangular area of the image. The segmentation unit 101 can also form one or more sub-images, where a sub-image can include one or more slices, tiles, or bricks.
[0229] During the encoding process of encoder 10, segmentation unit 101 transmits the CTU to prediction unit 102. Typically, prediction unit 102 may consist of block segmentation unit 103, motion estimation (ME) unit 104, motion compensation (MC) unit 105, and intra-prediction unit 106. Specifically, block segmentation unit 103 iteratively uses quadtree segmentation, binary tree segmentation, and ternary tree segmentation to further divide the input CTU into smaller coding units (CUs). Prediction unit 102 can use ME unit 104 and MC unit 105 to obtain inter-frame prediction blocks of the CUs. Intra-prediction unit 106 can use various intra-prediction modes, including MIP modes, to obtain intra-frame prediction blocks of the CUs. In the example, rate-distortion optimized motion estimation can be invoked by ME unit 104 and MC unit 105 to obtain inter-frame prediction blocks, and rate-distortion optimized mode determination can be invoked by intra-prediction unit 106 to obtain intra-frame prediction blocks.
[0230] Prediction unit 102 outputs the predicted block of the CU. First adder 107 calculates the difference between the CU in the output of segmentation unit 101 and the predicted block of the CU, i.e., the residual CU. Transform unit 108 reads the residual CU and performs one or more transform operations on the residual CU to obtain coefficients. Quantization unit 109 quantizes the coefficients and outputs quantization coefficients (i.e., levels). Inverse quantization unit 110 performs a scaling operation on the quantization coefficients to output reconstructed coefficients. Inverse transform unit 111 performs one or more inverse transforms corresponding to the transforms in transform unit 108 and outputs the reconstructed residual. Second adder 112 calculates the reconstructed CU by adding the reconstructed residual to the predicted block of the CU from prediction unit 102. Second adder 112 also sends its output to prediction unit 102 as an intra-frame prediction reference. After all CUs in the image or sub-image are reconstructed, filtering unit 113 performs loop filtering on the reconstructed image or sub-image. Here, the filtering unit 113 includes one or more filters, such as a deblocking filter, a sample adaptive offset (SAO) filter, an adaptive loop filter (ALF), a luma mapping with chroma scaling (LMCS) filter, and a neural network-based filter. Alternatively, when the filtering unit 113 determines that the CU is not used as a reference for encoding other CUs, the filtering unit 113 performs loop filtering on one or more target samples in the CU.
[0231] The output of the filtering unit 113 is a decoded image or sub-image, which is buffered in the DPB unit 114. The DPB unit 114 outputs the decoded image or sub-image according to timing and control information. Here, the image stored in the DPB unit 114 can also be used as a reference for the prediction unit 102 to perform inter-frame prediction or intra-frame prediction. Finally, the entropy coding unit 115 converts the parameters (such as control parameters and supplementary information) necessary for decoding the image from the encoder 10 into binary form, and writes such binary form into the bitstream according to the syntax structure of each data unit, which is the final output bitstream of the encoder 10.
[0232] Furthermore, encoder 10 may be a first memory having a first processor and a computer program for recording. When the first processor reads and runs the computer program, encoder 10 reads the input video and generates a corresponding bitstream. Alternatively, encoder 10 may also be a computing device having one or more chips. These units, implemented as integrated circuits on the chips, have similar connection and data exchange functions to the corresponding units in Figure 4.
[0233] Referring to Figure 5, it shows an example of a system block diagram of a decoder provided in an embodiment of this application. As shown in Figure 5, the decoder 20 may include: a parsing unit 201, a prediction unit 202, an inverse quantization unit 205, an inverse transform unit 206, an adder 207, a filtering unit 208, and a decoded image buffer unit 209. Here, the input of the decoder 20 is a bitstream representing a compressed version of a video or a still image, and the output of the decoder 20 may be a decoded video composed of a series of images or a decoded still image.
[0234] The input bitstream to decoder 20 can be the bitstream generated by encoder 10. Parsing unit 201 parses the input bitstream and obtains the values of syntax elements from it. Parsing unit 201 converts the binary representation of the syntax elements into numerical values and sends these values to units in decoder 20 to obtain one or more decoded images. Parsing unit 201 can also parse one or more syntax elements from the input bitstream to display the decoded images.
[0235] During the decoding process of decoder 20, parsing unit 201 sends the value of the syntax element and one or more variables set or determined according to the value of the syntax element for obtaining one or more decoded images to the unit in decoder 20.
[0236] Prediction unit 202 determines the prediction block of the current decoded block (e.g., CU). Here, prediction unit 202 may include motion compensation unit 203 and intra-prediction unit 204. Specifically, when an inter-frame decoding mode is indicated for decoding the current decoded block, prediction unit 202 passes relevant parameters from parsing unit 201 to motion compensation unit 203 to obtain inter-frame prediction blocks; when an intra-frame prediction mode (including MIP mode indicated by MIP mode index value) is indicated for decoding the current decoded block, prediction unit 202 passes relevant parameters from parsing unit 201 to intra-prediction unit 204 to obtain intra-frame prediction blocks.
[0237] The dequantization unit 205 has the same function as the dequantization unit 110 in the encoder 10. The dequantization unit 205 performs a scaling operation on the quantization coefficients (i.e., levels) from the parsing unit 201 to obtain the reconstruction coefficients.
[0238] The inverse transform unit 206 has the same function as the inverse transform unit 111 in the encoder 10. The inverse transform unit 206 performs one or more transform operations (i.e., the inverse operation of one or more transform operations performed by the inverse transform unit 111 in the encoder 10) to obtain the reconstructed residual.
[0239] Adder 207 performs an addition operation on its inputs (the predicted block from prediction unit 202 and the reconstructed residual from inverse transform unit 206) to obtain the reconstructed block of the current decoded block. The reconstructed block is also sent to prediction unit 202 as a reference for other blocks encoded in intra-frame prediction mode.
[0240] After all CUs in an image or sub-image are reconstructed, filtering unit 208 performs loop filtering on the reconstructed image or sub-image. Filtering unit 208 includes one or more filters, such as deblocking filters, sampling adaptive compensation filters, adaptive loop filters, luminance mapping and chroma scaling filters, and neural network-based filters. Alternatively, when filtering unit 208 determines that a reconstructed block is not used as a reference for decoding other blocks, filtering unit 208 performs loop filtering on one or more target samples in the reconstructed block. Here, the output of filtering unit 208 is a decoded image or sub-image, which is buffered in DPB unit 209. DPB unit 209 outputs the decoded image or sub-image based on timing and control information. The image stored in DPB unit 209 can also be used as a reference for performing inter-frame prediction or intra-frame prediction by prediction unit 202.
[0241] Furthermore, decoder 20 can be a second memory having a second processor and a computer program for recording. When the first processor reads and runs the computer program, decoder 20 reads the input bitstream and generates the corresponding decoded video. Alternatively, decoder 20 can also be a computing device having one or more chips. These units, implemented as integrated circuits on the chips, have similar connection and data exchange functions to the corresponding units in Figure 5.
[0242] It should also be noted that when the embodiments of this application are applied to encoder 10, "encoding block" specifically refers to the block to be encoded in the video image (which can also be simply referred to as "encoding block"); when the embodiments of this application are applied to decoder 20, "encoding block" specifically refers to the block to be decoded in the video image (which can also be simply referred to as "decoding block").
[0243] Based on Figure 4, the encoding method in this embodiment is mainly applied to the "filtering unit 113" part of the encoder 10.
[0244] Based on Figure 5, the decoding method in this embodiment is mainly applied to the "filtering unit 208" part of the decoder 20.
[0245] In other words, the encoding and decoding methods in the embodiments of this application can be applied to a video encoding system (referred to as "encoder"), a video decoding system (referred to as "decoder"), or even to both a video encoding system and a video decoding system simultaneously, but no limitations are made here.
[0246] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0247] One embodiment of this application proposes a decoding method. This method is applied to a decoder and can be used in scenarios where filtering is performed by a TALF filter or in scenarios where filtering is performed by other filtering techniques. This application does not impose any specific limitations.
[0248] Figure 6 is a schematic diagram of the decoding method proposed in the embodiment of this application. As shown in Figure 6, the decoding method of the decoder may include the following steps:
[0249] Step 1001: Decode the bitstream and determine the filter group number identification information; wherein, the filter group number identification information is used to determine the number of multiplexed historical filter groups.
[0250] In the embodiments of this application, decoding the bitstream can determine the filter group number identification information.
[0251] It should be noted that, in the embodiments of this application, the filter group number identification information can be used to determine the number of historical filter groups that can be reused, that is, to determine how many historical filter groups can be reused during the filtering process by using the filter group number identification information.
[0252] It is understood that, in the embodiments of this application, the historical filter bank can be elements in the candidate historical dataset cached during the filtering process, or referred to as storage units or data units, such as TALFs, wherein the storage units TALFs in the candidate historical dataset can record and store historical TALF information.
[0253] For example, in some embodiments, the candidate historical dataset can be a First-In-First-Out (FIFO) queue, that is, the FIFO used to store historical filters can be saved and updated in units of slices (or images). At the same time, if it is determined that a historical filter is to be reused, the corresponding historical filter can be selected from the FIFO.
[0254] It is understood that in the embodiments of this application, it is assumed that the candidate historical dataset is a FIFO, the historical filter group is a data unit in the FIFO, and the method of updating the FIFO is to shift each element (data unit) in the FIFO one position to the right and store one or more sets of filters parsed from the current slice at the first position of the FIFO, that is, the first data unit.
[0255] It should be noted that in the embodiments of this application, if the number of elements in the FIFO reaches the maximum value of the FIFO length, the last element of the FIFO is removed first, and then the elements are shifted and the filter is stored.
[0256] For example, in some embodiments, an 8-bit FIFO is used to store time-domain adaptive loop filters, where the FIFO already contains two TALFs, each of which is one or more filters contained in a chip in a historical decoding process.
[0257] For example, in some embodiments, when updating the FIFO, since the number of TALFs in the FIFO has not reached the maximum, the two existing TALFs are shifted backward and the TALFs of the current slice are placed at the beginning.
[0258] For example, in some embodiments, a FIFO of length 8 is used to store time-domain adaptive loop filters. At this time, there are already 8 TALFs in the FIFO. Each TALF is one or more filters contained in a chip in the history of decoding. Since the TALFs in the FIFO have reached the maximum number, the last TALFs element should be removed first, then each TALF should be shifted one position to the right, and finally the TALFs parsed from the current chip should be stored in the first position of the FIFO.
[0259] Of course, the length of the FIFO can be any integer value greater than 0, and is not limited to 8.
[0260] Furthermore, in the embodiments of this application, for the current image or the current slice, when reusing historical filters, multiple historical filter banks can be reused, that is, multiple data units TALFs in the candidate historical dataset FIFO can be selected for reuse. Compared with the conventional technology that only reuses one data unit TALF in the FIFO, it has greater flexibility.
[0261] Furthermore, in the embodiments of this application, the filter group number identification information can be image-level identification information or slice-level identification information, and this application does not impose specific limitations.
[0262] Furthermore, the decoding method proposed in this application embodiment can provide one or more historical filter banks for multiplexing filtered information, thereby increasing the flexibility of multiplexing by multiplexing more than one historical filter bank.
[0263] It should be noted that, in the embodiments of this application, based on the reuse of historical filters in related technologies, more sets of historical filters can be introduced, which can provide more combinations and quantities of historical filters, thereby improving the filtering effect.
[0264] In the embodiments of this application, the filter group number identification information can be determined by decoding the bitstream. This filter group number identification information can be used to determine the number of historical filter groups used during the filtering process; that is, the number of multiplexed filter groups can be determined based on the filter group number identification information, or in other words, the number of historical filter groups used in the multiplexing can be determined based on the filter group number identification information.
[0265] Furthermore, in the embodiments of this application, the filter group number identification information can be a flag, wherein the value of the filter group number identification information can determine how many groups of historical filters are reused for filtering.
[0266] For example, in some embodiments, if the filter group number identifier information is a first value, it is determined that one set of historical filters will be reused for filtering. If the filter group number identifier information is not a first value, it is determined that multiple sets of historical filters will be reused for filtering.
[0267] In other words, in the embodiments of this application, the filter group number identification information can also be used to indicate whether multiple historical filters are reused for filtering. Furthermore, the first value can be in parametric form or in numerical form; no limitation is made here.
[0268] For example, in some embodiments, if the filter bank number identification information is a slice-level flag, then in one specific example, the first value can be set to 0; in another specific example, the first value can also be set to false. The first value is not limited in any way in the embodiments of this application.
[0269] Taking a first value of 0 as an example, in this embodiment of the application, if the value of the filter group number identifier information is 0, then it can be determined that the current chip reuses one set of historical filters for filtering. Otherwise, if the value of the filter group number identifier information is not 0, then it can be determined that the current chip reuses multiple sets of historical filters for filtering.
[0270] For example, in some embodiments, if the filter bank number identifier is a slice-level flag, then the filter bank number identifier can be slice-level syntax. For instance, the filter bank number identifier can be represented by the syntax element `num_talf_reuse_minus1`, meaning `num_talf_reuse_minus1` indicates how many historical filter banks are reused for the current slice of the current image. If the value of `num_talf_reuse_minus1` is 0, then it is determined that the current slice reuses one historical filter bank; if the value of `num_talf_reuse_minus1` is not 0, then it is determined that the current slice reuses multiple historical filter banks. For example, `num_talf_reuse_minus1+1` historical filter banks are reused. Of course, the value of `num_talf_reuse_minus1` is not limited to 0, and this application does not impose specific limitations.
[0271] For example, in some embodiments, if the filter bank number identifier is an image-level flag, then the filter bank number identifier can be an image-level syntax. For instance, the filter bank number identifier can be represented by the syntax element control flag `num_talf_reuse_minus1`, meaning `num_talf_reuse_minus1` indicates how many historical filter banks are reused for the current image. If the value of `num_talf_reuse_minus1` is 0, then it is determined that the current image reuses one historical filter bank; if the value of `num_talf_reuse_minus1` is not 0, then it is determined that the current image reuses multiple historical filter banks. For example, `num_talf_reuse_minus1+1` historical filter banks are reused. Of course, the value of `num_talf_reuse_minus1` is not limited to 0, and this application does not impose a specific limitation.
[0272] Furthermore, in the embodiments of this application, when it is determined that the current image is filtered using TALF, the bitstream is decoded and multiplexing identification information is determined; when filtering is performed based on multiplexing historical TALF information determined by the multiplexing identification information, filter group number identification information is determined.
[0273] In other words, in the embodiments of this application, if the current block reuses historical TALF information for filtering by means of the reuse identification information, the step of determining the filter group number identification information can be continued, so that the number of reused historical filter groups can be further determined by means of the filter group number identification information.
[0274] Therefore, in the embodiments of this application, the parsing of filter group number identification information can depend on multiplexing identification information. Specifically, if the current image (and / or current slice) is determined to be filtered using the multiplexing history TALF based on the multiplexing identification information, the determination of the filter group number identification information can be further performed; otherwise, it is not necessary to decode the filter group number identification information.
[0275] It should be noted that, in the embodiments of this application, the first syntax element identification information can be determined by decoding the bitstream. This first syntax element identification information can be used to determine whether to use TALF filtering; that is, based on the first syntax element identification information, it can be determined whether to use a TALF filter to filter the reconstructed values of the image components.
[0276] Furthermore, in embodiments of this application, for the TALF filter, the corresponding input information may include at least one inter-frame reference image corresponding to the current image, which may be a reconstructed image decoded in the temporal domain. The reconstructed sample values of at least one inter-frame reference image can be used to perform TALF filtering on the current block in the current image.
[0277] Furthermore, in the embodiments of this application, the first syntax element identification information can be used to determine whether to use TALF for filtering. The first syntax element identification information can be a flag.
[0278] Furthermore, in the embodiments of this application, whether to use TALF for filtering can be determined by the value of the first syntax element identifier information.
[0279] For example, in some embodiments, if the value of the first syntax element identifier information is a first value, it is determined that TALF filtering will not be used. If the value of the first syntax element identifier information is not a first value, it is determined that TALF filtering will be used.
[0280] It should be noted that, in the embodiments of this application, the first syntax element identifier information can be used to indicate whether TALF filtering is used. Furthermore, the first value can be in parameter form or in numerical form; no limitation is made here.
[0281] For example, in some embodiments, if the first syntax element identification information is an image-level or slice-level flag, then in one specific example, the first value can be set to 0; in another specific example, the first value can also be set to false. The first value is not limited in any way in the embodiments of this application.
[0282] Taking a first value of 0 as an example, in this embodiment of the application, if the value of the first syntax element identifier information is 0, then it can be determined that TALF filtering is not used. Otherwise, if the value of the first syntax element identifier information is not 0, then it can be determined that TALF filtering is used.
[0283] Furthermore, in the embodiments of this application, if the current image is filtered using TALF, the reuse identifier information can be determined by decoding the bitstream. The reuse identifier information is used to determine whether to reuse historical TALF information for filtering.
[0284] It should be noted that, in the embodiments of this application, historical TALF information is used to determine historical filters, including but not limited to one or more of the following: filtering mode, number of filter groups, and filter coefficients.
[0285] Furthermore, in embodiments of this application, the reuse identifier information can be used to determine whether the current image is allowed to use historical TALF information to perform TALF filtering. The reuse identifier information can be a flag.
[0286] It should be noted that, in the embodiments of this application, the reuse identification information can be an image-level flag, a slice-level (strip-level) flag, a sub-picture-level flag, or a tile-level flag. This application does not impose any specific limitations.
[0287] For example, in some embodiments, if the multiplexing identification information is a slice-level flag, then the multiplexing identification information can be used to determine whether the current slice is allowed to multiplex historical TALF information for filtering.
[0288] Furthermore, in the embodiments of this application, the value of the reuse identifier information can be used to determine whether the current image (and / or the current slice) is allowed to reuse historical TALF information for filtering. The value of the reuse identifier information can be in parametric form or in numerical form.
[0289] For example, in some embodiments, when the reuse identifier is set to 1, it is determined that the current image (and / or the current slice) is allowed to reuse historical TALF information for filtering. When the reuse identifier is set to 0, it is determined that historical TALF information is not reused for filtering. Typically, the reuse identifier can be a parameter written in the Slice header or picture header, and there are no limitations on this.
[0290] For example, in some embodiments, when the reuse identifier information is set to 1, it is determined that the current image (and / or the current slice) is allowed to reuse historical TALF information for filtering. When the reuse identifier information is set to 0, it is determined that historical TALF information is not reused for filtering.
[0291] For example, in some embodiments, if the reuse identifier information is set to true, it is determined that the current image (and / or the current slice) is allowed to reuse historical TALF information for filtering. If the reuse identifier information is set to false, it is determined that historical TALF information is not reused for filtering.
[0292] For example, in some embodiments, assuming the reuse identifier is an image-level flag, the reuse identifier can be represented by the syntax element `talf_reuse_flag`, which indicates whether the current image is allowed to reuse TALF information for filtering. If the value of `talf_reuse_flag` is 0, it is determined that TALF information is not reused for filtering; if the value of `talf_reuse_flag` is 1, it is determined that the current image is allowed to reuse TALF information for filtering.
[0293] For example, in some embodiments, assuming the multiplexing identification information is a slice-level flag, the multiplexing identification information can be represented by the syntax element `talf_reuse_flag`, that is, `talf_reuse_flag` indicates whether the current slice is allowed to use TALF for filtering. If the value of `talf_reuse_flag` is 0, it is determined that the current slice will not use TALF for filtering; if the value of `talf_reuse_flag` is 1, it is determined that the current slice is allowed to use TALF for filtering.
[0294] Of course, the value of talf_reuse_flag is not limited to 0 and 1, and this application does not impose specific restrictions.
[0295] For example, in some embodiments, the syntax elements refer to the following:
[0296] The `talf_reuse_flag` flag indicates whether historical TALF information is reused, such as the historical adaptive filter of the record. If this flag is 1, it indicates that the historical adaptive loop filter of the record is reused, which means that at least one set of historical filters is selected. A flag of 0 indicates that it is not reused. When this syntax element does not exist in the bitstream, its default value of 0 can be used.
[0297] The num_talf_reuse_minus1 flag indicates that the number of historical filter groups reused in the current slice is reduced by one. When there is no such syntax element in the bitstream, its value defaults to 0.
[0298] Step 1002: If multiple historical filter banks are determined to be reused based on the filter bank number identification information, decode the bit stream, determine multiple first multiplexing index parameters, and determine multiple historical filter banks to be reused based on the multiple first multiplexing index parameters.
[0299] In the embodiments of this application, after determining the filter group number identification information, and in the case of determining multiple historical filters based on the filter group number identification information, the bit stream is decoded, multiple first multiplexing index parameters are determined, and multiple historical filters are determined based on the multiple first multiplexing index parameters, that is, multiple filter groups are determined.
[0300] It is understood that, in the embodiments of this application, the filter bank number identifier information can be used to determine the number of reused historical filter banks. For example, the num_talf_reuse_minus1 identifier indicates that the number of reused historical filter banks in the current slice is reduced by one. If num_talf_reuse_minus1 is 0, it can be determined that one historical filter bank is reused. If num_talf_reuse_minus1 is greater than 0, it can be determined that multiple historical filter banks are reused, that is, num_talf_reuse_minus1+1 historical filter banks are reused.
[0301] Furthermore, in the embodiments of this application, when multiple historical filter banks are determined to be reused based on the filter bank number identification information, the specific historical filter banks being reused can be further determined by using the determined multiple first reuse index parameters.
[0302] It is understood that, in the embodiments of this application, the first multiplexing index parameter can be used to indicate the history filter bank of multiplexing, that is, the corresponding history filter bank can be determined based on the first multiplexing parameter. Accordingly, multiple history filter banks of multiplexing can be determined by parsing multiple first multiplexing index parameters.
[0303] It is understood that, in the embodiments of this application, the first multiplexing index parameter can be represented as talf_reuse_idx, where talf_reuse_idx can be used to indicate the index of the time-domain adaptive filter in the FIFO, that is, to indicate the historical filter group in the FIFO. The value of talf_reuse_idx can be determined based on the storage length of the candidate historical dataset. For example, assuming the maximum FIFO length is 8, then the value range of talf_reuse_idx can be 0 to 7, representing which set of historical time-domain adaptive loop filters in the multiplexed FIFO, that is, which historical filter group in the multiplexed FIFO.
[0304] Furthermore, in the embodiments of this application, when it is determined that multiple historical filter banks are to be reused, multiple first multiplexing index parameters can be determined to indicate which historical filter banks are being reused. The number of first multiplexing index parameters can be determined by the filter bank number identifier information num_talf_reuse_minus1.
[0305] For example, in some embodiments, the bitstream can be decoded to determine num_talf_reuse_minus1+1 first multiplexing index parameters talf_reuse_idx, which are denoted as talf_reuse_idx[i].
[0306] For example, in some embodiments, the slice-level syntax element is parsed as follows:
[0307] In terms of slice-level syntax elements, due to the more flexible reuse mechanism, compared with the conventional technology where the current slice can only parse one talf_reuse_idx to determine which set of historical filters the current slice reuses, in the embodiments of this application, the current slice first determines how many sets of historical filters the current slice reuses by parsing num_talf_reuse_minus1.
[0308] When `talf_reuse_flag` is 1, it indicates that the current slice reuses historical filters, meaning that at least one set of historical filters is selected. The `num_talf_reuse_minus1` flag indicates that the number of historical filter sets reused in the current slice is reduced by one; its value defaults to 0 when this syntax element is not present in the bitstream.
[0309] After parsing num_talf_reuse_minus1, further parsing (num_talf_reuse_minus1+1) talf_reuse_idx is used to determine which groups of historical filters are selected by the current chip, that is, to determine the multiple groups of historical filters that support multiplexing.
[0310] Furthermore, in the embodiments of this application, when it is determined that a historical filter bank is to be reused based on the filter bank number identification information, the bit stream is decoded to determine the first multiplexing index parameter; and historical TALF information is determined based on the first multiplexing index parameter.
[0311] Furthermore, in the embodiments of this application, when determining historical TALF information based on the first multiplexing index parameter, the data unit index is determined according to the first multiplexing index parameter; the historical filter group corresponding to the current block is determined based on the data unit index; and the historical TALF information corresponding to the current block is determined based on the historical filter group corresponding to the current block.
[0312] In other words, in the embodiments of this application, if it is determined that a historical filter bank should be reused, a corresponding first reuse index parameter talf_reuse_idx can be parsed, and then the corresponding data unit index can be determined based on the first reuse index parameter talf_reuse_idx. This data unit index can be used to indicate data units in the candidate historical dataset FIFO, that is, the data unit index can be used to indicate the corresponding historical filter bank in the candidate historical dataset FIFO. Accordingly, based on the data unit index, the reused data units (historical filter banks) can be further determined. Then, based on the historical filter bank corresponding to the current block, the historical TALF information corresponding to the current block can be determined.
[0313] It is understood that, in the embodiments of this application, historical TALF information may include at least one or more of the following: filtering mode, number of filter groups, and filter coefficients of candidate filters.
[0314] In other words, in the embodiments of this application, a method for reusing historical TALF information includes determining historical filters corresponding to data unit indices from candidate historical datasets, such as elements in a FIFO, and then obtaining the filtering modes, number of filter groups, and filter coefficients of the candidate filters recorded and stored in the historical filter.
[0315] Step 1003: Determine the historical TALF information corresponding to the current block from multiple historical filter banks.
[0316] In the embodiments of this application, after determining multiple first multiplexing index parameters and determining multiple historical filter banks for multiplexing based on the multiple first multiplexing index parameters, the historical TALF information corresponding to the current block can be further determined in the multiple historical filter banks.
[0317] It is understood that, in the embodiments of this application, historical TALF information may include at least one or more of the following: filtering mode, number of filter groups, and filter coefficients of candidate filters.
[0318] For example, in some embodiments, the historical TALF information corresponding to the current block may include, but is not limited to, the historical filters multiplexed by the current block and the filter coefficients of the historical filters multiplexed by the current block.
[0319] Furthermore, in the embodiments of this application, when determining the historical TALF information corresponding to the current block among multiple historical filter banks, the bitstream is decoded to determine the filter enable flag information corresponding to the current block; if it is determined that the current block uses TALF for filtering based on the filter enable flag information, the bitstream is decoded to determine the second multiplexing index parameter; the historical filter bank corresponding to the current block is determined among multiple historical filter banks based on the second multiplexing index parameter; and the historical TALF information corresponding to the current block is determined based on the historical filter bank corresponding to the current block.
[0320] It is understood that in the embodiments of this application, multiple historical filter groups can be reused for the current slice or the current image. Therefore, for the current block in the current slice or the current image, it is necessary to first determine which of the multiple historical filter groups the current block reuses.
[0321] In the embodiments of this application, the filter enable flag information can be used to determine whether the current block is filtered using TALF. That is, based on the filter enable flag information, it can be determined whether to use the TALF filter to filter the reconstructed values of the image components of the current block.
[0322] Furthermore, in the embodiments of this application, the filter enable flag information can be used to determine whether the current block uses TALF for filtering. The filter enable flag information can be a flag, wherein if the current block is a CTU corresponding to the current image, then the filter enable flag information can be a CTU-level flag; if the current block is a CU corresponding to the current image, then the filter enable flag information can be a CU-level flag. Of course, corresponding to any size sub-region in the current image, the filter enable flag information can also be a flag of other block levels. This application does not impose specific limitations.
[0323] Furthermore, in the embodiments of this application, the value of the filtering enable identifier information can be used to determine whether to use TALF filtering for the current block.
[0324] For example, in some embodiments, if the filter enable flag information is set to a first value, it is determined that TALF filtering will not be used on the current block. If the filter enable flag information is set to a second value, it is determined that TALF filtering will be used on the current block.
[0325] It should be noted that, in the embodiments of this application, the filter enable flag information can be used to indicate whether the current block uses TALF for filtering. Furthermore, the first value and the second value are different, and the first value and the second value can be in parameter form or in numerical form; no limitation is made here.
[0326] For example, in some embodiments, if the filter enable flag is a block-level flag, then in one specific example, the first value can be set to 1 and the second value can be set to 0; in another specific example, the first value can also be set to true and the second value can also be set to false; even in yet another specific example, the first value can also be set to 0 and the second value can also be set to 1; or, the first value can also be set to false and the second value can also be set to true. The first and second values are not limited in any way in the embodiments of this application.
[0327] Taking a first value of 0 and a second value of 1 as an example, in this embodiment of the application, if the value of the filter enable flag information is 0, it can be determined that the current block does not use TALF for filtering. Otherwise, if the filter enable flag information is 1, it can be determined that the current block uses TALF for filtering.
[0328] For example, in some embodiments, if the current block of the current image is a CTU, the filter enable flag information can be CTU-level syntax. For instance, the filter enable flag information can be represented by the syntax element control flag `talf_ctb_enabled`, that is, `talf_ctb_enabled` indicates whether to use TALF filtering on the current block of the current image. If the value of `talf_ctb_enabled` is 0, it is determined that TALF filtering is not used on the current block; if the value of `talf_ctb_enabled` is 1, it is determined that TALF filtering is used on the current block. Of course, the value of `talf_ctb_enabled` is not limited to 0, and this application does not specifically limit it.
[0329] In other words, in the embodiments of this application, a talf_ctb_enabled flag can be determined first, that is, the filtering enable flag information can be determined. When the flag is 1, it means that the current CTU (current block) uses TALF, and when the flag is 0, it means that the current CTU does not use TALF.
[0330] Furthermore, in the embodiments of this application, when it is determined that the current block uses TALF for filtering based on the filter enable identifier information, a second multiplexing index parameter can be determined to indicate which historical filter bank the current block specifically reuses, thereby determining the historical filter bank corresponding to the current block among multiple historical filter banks based on the second multiplexing index parameter.
[0331] It is understood that, in the embodiments of this application, the second multiplexing index parameter can be represented as talf_reuse_setId, where talf_reuse_setId can be used to indicate the index of the time-domain adaptive filter multiplexed in the current block of the FIFO, that is, to indicate the historical filter bank multiplexed in the current block of the FIFO. The value of talf_reuse_setId can be determined based on the number of multiplexed historical filter banks.
[0332] Furthermore, in the embodiments of this application, when determining the historical TALF information corresponding to the current block based on the historical filter bank corresponding to the current block, the bitstream is decoded and the third multiplexing index parameter is determined; based on the third multiplexing index parameter, the historical filter of the current block and the filter coefficient of the historical filter of the current block are determined in the historical filter bank corresponding to the current block.
[0333] It is understood that, in the embodiments of this application, the third multiplexing index parameter can be represented as talf_ctb_filter_idx, where talf_ctb_filter_idx can be used to indicate the historical filters in the historical filter bank of the current block multiplexing. The value of talf_ctb_filter_idx can be determined based on the number of historical filters in the multiplexed historical filter bank.
[0334] It is understood that, in the embodiments of this application, for any historical filter bank, i.e., any TALFs in the FIFO, one or more filters contained in a chip for historical decoding are stored. Therefore, after determining which historical filter bank among the multiple historical filter banks multiplexed by the current block is used, it is necessary to further determine the historical TALF information corresponding to the current block in the historical filter bank through the third multiplexing index parameter, that is, to determine the historical filters multiplexed by the current block and the filter coefficients of the historical filters multiplexed by the current block.
[0335] For example, in some embodiments, the syntax elements refer to the following:
[0336] In conventional schemes, it is possible to determine whether the current CTU is using TALF and which filter is being used by encoding and decoding a talf_ctb_idc.
[0337] In this embodiment, a talf_ctb_enabled flag is first decoded. When the flag is 1, it means that the current CTU uses TALF. When the flag is 0, it means that the current CTU does not use TALF. When the syntax element does not exist in the bitstream, its value is 0.
[0338] Next, if the current slice reuses a historical filter and the number of reused groups is greater than 1 (i.e., num_talf_reuse_minus1>0), talf_reuse_setId is further decoded to determine which historical filter group is being reused by the current CTU.
[0339] For example, the multiplexing index talf_reuse_idx[talf_reuse_setId] can be determined using talf_reuse_setId, and then the multiplexing index can be used to determine a set of multiplexed filters tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]]. If the current slice multiplexes only one set of historical filters, then talf_reuse_setId is not parsed and its default value is 0, and the multiplexing index is determined as talf_reuse_idx[0]. Finally, talf_ctb_filter_idx is parsed according to the number of selected filters or the number of multiplexed filters, and the filter used by the current CTU is determined.
[0340] Step 1004: Filter the current block based on historical TALF information to determine the filtered reconstructed value of the current block.
[0341] In the embodiments of this application, after determining the historical TALF information corresponding to the current block in multiple historical filter banks, the current block can be further filtered based on the historical TALF information to determine the filtered reconstructed value of the current block.
[0342] It is understood that in the embodiments of this application, the current block can be a CTU determined after dividing the current image, the current block can be a coding unit (CU) obtained after dividing the CTU, or the current block can be a sub-region of any size obtained after dividing the current image. This application does not specifically limit the size and acquisition method of the current block in the current image.
[0343] Furthermore, in the embodiments of this application, after determining the historical TALF information including the historical filter multiplexed by the current block and the filter coefficients of the historical filter multiplexed by the current block, the current block can be further filtered based on the historical filter multiplexed by the current block and the filter coefficients of the historical filter multiplexed by the current block to determine the filtered reconstructed value of the current block.
[0344] For example, in some embodiments, when reconstructing filter coefficients, if the current slice's sh_talf_enabled_flag is 1 and talf_reuse_flag is 0, the coefficient values, shift values, and nonlinear limit values of the time-domain adaptive loop filter need to be reconstructed.
[0345] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0346] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0347] {
[0348] for(j=0;j <numCoeff;j++)
[0349] {
[0350] tAlfCoeff[sfIdx][j]=(talf_coeff_sign[sfIdx][j]==1)?
[0351] -talf_coeff_abs[sfIdx][j]:talf_coeff_abs[sfIdx][j]
[0352] }
[0353] }
[0354] The process of obtaining the nonlinear tAlfClip value of the current slice is as follows:
[0355] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0356] clipTable[0] = 1 < <inputBitdepth
[0357] for(i=0;i<4;i++)
[0358] {
[0359] clipTable[i]=1<<((7-2*i+(inputBitdepth-8)))
[0360] }
[0361] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0362] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0363] {
[0364] for(j=0;j <numCoeff;j++)
[0365] {
[0366] tAlfClip[sfIdx][j]=clipTable[talf_clip_idx[sfIdx][j]]
[0367] }
[0368] }
[0369] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0370] shift = talf_shift_minus6 + 6
[0371] If the current slice's sh_talf_enabled_flag is 1 and talf_reuse_flag is 1, then the coefficient values, shift values, and nonlinear limit values need to be obtained from the FIFO of the historical time-domain adaptive loop filter.
[0372] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0373] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0374] {
[0375] for(j=0;j <numCoeff;j++)
[0376] {
[0377] tAlfCoeff[sfIdx][j]=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].coeff[sfIdx][j]
[0378] }
[0379] }
[0380] The process of obtaining the nonlinear tAlfClip value of the current slice is as follows:
[0381] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0382] clipTable[0] = 1 < <inputBitdepth
[0383] for(i=0;i<4;i++)
[0384] {
[0385] clipTable[i]=1<<((7-2*i+(inputBitdepth-8)))
[0386] }
[0387] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0388] filterCount=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].filterCount
[0389] for(sfIdx=0;sfIdx<=filterCount;sfIdx++)
[0390] {
[0391] for(j=0;j <numCoeff;j++)
[0392] {
[0393] tAlfClip[sfIdx][j]=
[0394] clipTable[tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].clipIdx[sfIdx][j]]
[0395] }
[0396] }
[0397] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0398] shift=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].shift
[0399] Further, in the embodiments of this application, the bitstream is decoded to determine the first filter identification information; if the first filter group is determined based on the first filter identification information, the TALF information corresponding to the current block is determined; wherein, the TALF information corresponding to the current block includes the filtering mode, the number of filters in the first filter group, and the filter coefficients of the filters in the first filter group.
[0400] It is understood that, in the embodiments of this application, the first filter identification information can be used to determine whether to decode the first filter group. The first filter group can be a new set of filters obtained through encoding and decoding.
[0401] Therefore, in the embodiments of this application, the first filter identification information can be used to indicate whether to encode or decode a new filter bank.
[0402] Furthermore, in the embodiments of this application, the first filter identification information can be image-level identification information or slice-level identification information, and this application does not impose any specific limitations.
[0403] Furthermore, the decoding method proposed in this application can not only provide one or more historical filter banks for multiplexing filtered information, but also introduce new filter banks to further increase the flexibility of multiplexing.
[0404] In other words, in the embodiments of this application, the slice level or image level can simultaneously select historical filter banks and new filter banks.
[0405] It should be noted that, in the embodiments of this application, the first filter identification information can be determined by decoding the bitstream. This first filter identification information can be used to determine whether to encode or decode a new filter bank; that is, based on the first filter identification information, it can be determined whether to encode or decode a new set of TALF filters to filter the reconstructed values of the image components.
[0406] Furthermore, in embodiments of this application, the first filter identification information can be used to determine whether to encode or decode a new filter bank. The first filter identification information can be a flag.
[0407] Furthermore, in the embodiments of this application, the value of the first filter identification information can be used to determine whether to encode and decode a new set of TALF filters for filtering.
[0408] For example, in some embodiments, if the value of the first filter identifier information is a first value, it is determined not to encode or decode a new filter bank. If the value of the first filter identifier information is a second value, it is determined to encode or decode a new filter bank.
[0409] It should be noted that, in the embodiments of this application, the first filter identification information can be used to indicate whether to encode and decode a new set of TALF filters for filtering. Furthermore, the first value and the second value are different, and the first value and the second value can be in parametric form or in numerical form; no limitation is made here.
[0410] For example, in some embodiments, if the first filter identification information is an image-level or slice-level flag, then in one specific example, the first value can be set to 1 and the second value can be set to 0; in another specific example, the first value can also be set to true and the second value can also be set to false; even in yet another specific example, the first value can also be set to 0 and the second value can also be set to 1; or, the first value can also be set to false and the second value can also be set to true. The first and second values are not limited in any way in the embodiments of this application.
[0411] Taking a first value of 0 and a second value of 1 as an example, in this embodiment of the application, if the first filter identifier information is 0, it can be determined that no new filter bank will be encoded or decoded for filtering. Otherwise, if the first filter identifier information is 1, it can be determined that a new filter bank will be encoded or decoded for filtering.
[0412] For example, in some embodiments, for the current slice or the current image, the first filter identification information can be represented by the syntax element control flag `talf_new_flag`, that is, `talf_new_flag` indicates whether to encode and decode a new set of TALFs for filtering. If the value of `talf_new_flag` is 0, it is determined that no new set of TALFs will be encoded and decoded for filtering; if the value of `talf_new_flag` is 1, it is determined that a new set of TALFs will be encoded and decoded for filtering. Of course, the value of `talf_new_flag` is not limited to 0 and 1, and this application does not impose specific limitations.
[0413] It is understood that, in the embodiments of this application, if the encoding / decoding first filter bank is determined through the first filter identification information, then the TALF information corresponding to the current block can be further determined. The TALF information corresponding to the current block may include, but is not limited to, the filtering mode, the number of filters in the first filter bank, and the filter coefficients of the filters in the first filter bank.
[0414] In other words, in the embodiments of this application, if it is determined that a new set of filters can be encoded and decoded, then the encoding and decoding of the first filter group can be further performed to determine the number of filters in the first filter group and the filter coefficients of the filters in the first filter group.
[0415] For example, in some embodiments, the syntax elements refer to the following:
[0416] Regarding slice-level syntax elements, due to the more flexible multiplexing mechanism, compared to the conventional approach where only one `talf_reuse_idx` can be parsed for the current slice to determine which set of historical filters is multiplexed, in the embodiments of this application, the current slice first determines how many sets of historical filters are multiplexed by parsing `num_talf_reuse_minus1`. When `talf_reuse_flag` is 1, it indicates that the current slice is multiplexing historical filters, meaning that at least one set of historical filters is selected. The `num_talf_reuse_minus1` flag indicates the number of multiplexed historical filter sets minus one; its value defaults to 0 when this syntax element is not present in the bitstream. After parsing `num_talf_reuse_minus1`, (num_talf_reuse_minus1+1) `talf_reuse_idx` values are further parsed to determine which sets of historical filters are selected by the current slice.
[0417] Furthermore, in the embodiments of this application, the talf_new_flag can also be decoded at the slice level, which indicates whether the current slice has encoded or decoded a new set of filters (the first filter set). If a new set of filters has been encoded, the number of filters, coefficients, etc., can be further encoded or decoded.
[0418] Here, compared with conventional techniques, in the embodiments of this application, the chip level can simultaneously select multiplexed filters and new filters.
[0419] Further, in the embodiments of this application, the bitstream is decoded to determine the second filter identification information; wherein, the second filter identification information is used to determine whether the current block uses the first filter group; if it is determined that the current block uses the first filter group based on the second filter identification information, the current block is filtered based on the TALF information corresponding to the current block to determine the filtered reconstructed value of the current block.
[0420] It is understood that, in the embodiments of this application, the second filter identification information can be used to determine whether the current block uses the first filter group. The first filter group can be a new filter group obtained through encoding and decoding.
[0421] Therefore, in the embodiments of this application, the second filter identification information can be used to indicate whether the current block uses a new filter bank that has already been encoded and decoded.
[0422] Furthermore, in the embodiments of this application, the second filter identification information can be block-level identification information.
[0423] Furthermore, the decoding method proposed in this application can provide one or more historical filter banks for multiplexing filtered information, while also introducing new filter banks. In this way, for the current block, the corresponding filter can be selected from both the historical filter banks and the new filter banks used for encoding and decoding, further increasing the flexibility of multiplexing.
[0424] In other words, in the embodiments of this application, at the slice level or image level, both historical filter banks and new filter banks can be selected simultaneously, while at the block level, it is necessary to select whether to reuse historical filter banks or use a newly determined filter bank.
[0425] It should be noted that, in the embodiments of this application, the second filter identification information can be determined by decoding the bitstream. This second filter identification information can be used to determine whether the current block uses a new filter bank; that is, based on the second filter identification information, it can be determined whether the current block uses a new set of TALF filters that has already been encoded and decoded to filter the reconstructed values of the image components.
[0426] Furthermore, in embodiments of this application, the second filter identification information can be used to determine whether to use a new set of TALF filters that has already been encoded and decoded to filter the current block. The second filter identification information can be a flag.
[0427] Furthermore, in the embodiments of this application, the value of the second filter identification information can be used to determine whether the current block uses a new set of TALF filters for filtering.
[0428] For example, in some embodiments, if the value of the second filter identifier information is a first value, it is determined that the current block does not use a new filter bank. If the value of the second filter identifier information is a second value, it is determined that the current block uses a new filter bank. Furthermore, the first value and the second value are different, and both the first value and the second value can be in parametric form or in numerical form; no limitation is made here.
[0429] For example, in some embodiments, if the second filter identification information is a CTU-level flag, then in one specific example, the first value can be set to 1 and the second value can be set to 0; in another specific example, the first value can also be set to true and the second value can also be set to false; even in yet another specific example, the first value can also be set to 0 and the second value can also be set to 1; or, the first value can also be set to false and the second value can also be set to true. The first and second values are not limited in any way in the embodiments of this application.
[0430] Taking a first value of 0 and a second value of 1 as an example, in this embodiment of the application, if the second filter identifier information is 0, it can be determined that the current block does not use a new filter bank for filtering, that is, it does not use the first filter bank. Otherwise, if the second filter identifier information is 1, it can be determined that the current block uses a new filter bank for filtering, that is, it uses the first filter bank.
[0431] For example, in some embodiments, for the current block, the second filter identification information can be represented by the syntax element control flag `talf_ctb_new_flag`, that is, `talf_ctb_new_flag` indicates whether to use the newly encoded / decoded filter bank for filtering. If the value of `talf_ctb_new_flag` is 0, it is determined that the newly encoded / decoded filter bank will not be used for filtering; if the value of `talf_ctb_new_flag` is 1, it is determined that the newly encoded / decoded filter bank will be used for filtering. Of course, the value of `talf_ctb_new_flag` is not limited to 0 and 1, and this application does not impose specific limitations.
[0432] Furthermore, in the embodiments of this application, if it is determined that the current block does not use the first filter bank based on the second filter identification information, the historical TALF information corresponding to the current block can be further determined based on the filter bank number identification information; the current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block.
[0433] In other words, in the embodiments of this application, for the current block, if it is determined based on the second filter identification information that the current block does not use a new first filter group for encoding and decoding, the historical TALF information corresponding to the current block can be further determined based on the filter group number identification information.
[0434] Furthermore, in the embodiments of this application, when determining the historical TALF information corresponding to the current block based on the filter group number identification information, if multiple historical filter groups are determined to be reused based on the filter group number identification information, the bitstream is decoded to determine the second multiplexing index parameter; the historical filter group corresponding to the current block is determined among multiple historical filter groups based on the second multiplexing index parameter; and the historical TALF information corresponding to the current block is determined based on the historical filter group corresponding to the current block.
[0435] In other words, in the embodiments of this application, when it is determined that the current block does not use the first filter group based on the second filter identification information, and it is determined that multiple historical filter groups are reused based on the filter group number identification information, a second multiplexing index parameter can be further determined to indicate which historical filter group the current block specifically reuses. Thus, the historical filter group corresponding to the current block can be determined from multiple historical filter groups based on the second multiplexing index parameter.
[0436] Furthermore, in the embodiments of this application, when determining the historical TALF information corresponding to the current block based on the historical filter bank corresponding to the current block, the bitstream is decoded to determine the third multiplexing index parameter; based on the third multiplexing index parameter and the historical filter bank corresponding to the current block, the historical TALF information corresponding to the current block is determined.
[0437] It is understood that, in the embodiments of this application, for any historical filter bank, i.e., any TALFs in the FIFO, one or more filters contained in a chip for historical decoding are stored. Therefore, after determining which historical filter bank among the multiple historical filter banks multiplexed by the current block is used, it is necessary to further determine the historical TALF information corresponding to the current block in the historical filter bank through the third multiplexing index parameter, that is, to determine the historical filters multiplexed by the current block and the filter coefficients of the historical filters multiplexed by the current block.
[0438] Furthermore, in the embodiments of this application, when the first filter bank is determined to be decoded based on the first filter identification information, or when the multiplexing history TALF information is determined based on the multiplexing identification information for filtering, the bitstream is decoded and the filtering enable identification information corresponding to the current block is determined.
[0439] It is understood that, in the embodiments of this application, the parsing condition for the filter enable flag information talf_ctb_enabled is to determine the decoding of the first filter group based on the first filter flag information talf_new_flag, or to determine the multiplexing history TALF information for filtering based on the multiplexing flag information talf_reuse_flag.
[0440] In other words, in the embodiments of this application, when the first filter identifier information talf_new_flag indicates decoding the first filter bank, it is possible to further determine the filter enable identifier information talf_ctb_enabled; or, when the multiplexing identifier information talf_reuse_flag indicates multiplexing historical TALF information, it is possible to further determine the filter enable identifier information talf_ctb_enabled.
[0441] Furthermore, in the embodiments of this application, when it is determined that the current block uses TALF for filtering based on the filter enable identifier information, and the first filter group is determined to be decoded based on the first filter identifier information, and the multiplexing historical TALF information is determined to be used for filtering based on the multiplexing identifier information, the second filter identifier information is determined.
[0442] It is understood that, in the embodiments of this application, the parsing condition of the second filter identification information talf_ctb_new_flag is based on the filter enable identification information talf_ctb_enabled to determine that the current block uses TALF for filtering, and at the same time, based on the first filter identification information talf_new_flag to determine that the first filter group is decoded, and based on the multiplexing identification information talf_reuse_flag to determine that the historical TALF information is multiplexed for filtering.
[0443] In other words, in the embodiments of this application, when the filter enable flag information talf_ctb_enabled indicates that the current block uses TALF for filtering, the first filter flag information talf_new_flag indicates that the first filter group is decoded, and the multiplexing flag information talf_reuse_flag indicates that historical TALF information is reused, the filter enable flag information talf_ctb_enabled can be further determined.
[0444] For example, in some embodiments, the syntax elements refer to the following:
[0445] In the embodiments of this application, a `talf_ctb_new_flag` is further introduced at the CTU level. A `talf_ctb_new_flag` of 1 indicates that the current CTU uses the `talf_ctb_filter_idx`-th filter from a new set of filters decoded at the slice level to filter the current CTU; a `talf_ctb_filter_idx`-th filter from the `talf_reuse_idx[talf_reuse_setId]`-th group of historical filters to filter the current CTU. When both `talf_new_flag` and `talf_reuse_flag` at the slice level are 1, the encoding / decoding `talf_ctb_new_flag` flag is used; otherwise, if `talf_new_flag` is 1 and `talf_reuse_flag` is 0, `talf_ctb_new_flag` defaults to 1; otherwise, it defaults to 0.
[0446] For example, in some embodiments, when reconstructing filter coefficients, if the current slice's talf_ctb_enabled is 1 and talf_ctb_new_flag is 1, the coefficient values, shift values, and nonlinear limit values of the time-domain adaptive loop filter need to be reconstructed.
[0447] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0448] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0449] {
[0450] for(j=0;j <numCoeff;j++)
[0451] {
[0452] tAlfCoeff[sfIdx][j]=(talf_coeff_sign[sfIdx][j]==1)?
[0453] -talf_coeff_abs[sfIdx][j]:talf_coeff_abs[sfIdx][j]
[0454] }
[0455] }
[0456] The process of obtaining the nonlinear tAlfClip value of the current slice is as follows:
[0457] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0458] clipTable[0] = 1 < <inputBitdepth
[0459] for(i=0;i<4;i++)
[0460] {
[0461] clipTable[i]=1<<((7-2*i+(inputBitdepth-8)))
[0462] }
[0463] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0464] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0465] {
[0466] for(j=0;j <numCoeff;j++)
[0467] {
[0468] tAlfClip[sfIdx][j]=clipTable[talf_clip_idx[sfIdx][j]]
[0469] }
[0470] }
[0471] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0472] shift = talf_shift_minus6 + 6
[0473] If the current slice's talf_ctb_enabled is 1 and talf_ctb_new_flag is 0, then the coefficient values, shift values, and nonlinear limit values need to be obtained from the FIFO of the historical time-domain adaptive loop filter.
[0474] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0475] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0476] {
[0477] for(j=0;j <numCoeff;j++)
[0478] {
[0479] tAlfCoeff[sfIdx][j]=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].coeff[sfIdx][j]
[0480] }
[0481] }
[0482] The process of obtaining the nonlinear tAlfClip value of the current slice is as follows:
[0483] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0484] clipTable[0] = 1 < <inputBitdepth
[0485] for(i=0;i<4;i++)
[0486] {
[0487] clipTable[i]=1<<((7-2*i+(inputBitdepth-8)))
[0488] }
[0489] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0490] filterCount=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].filterCount
[0491] for(sfIdx=0;sfIdx<=filterCount;sfIdx++)
[0492] {
[0493] for(j=0;j <numCoeff;j++)
[0494] {
[0495] tAlfClip[sfIdx][j]=
[0496] clipTable[tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].clipIdx[sfIdx][j]]
[0497] }
[0498] }
[0499] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0500] shift=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].shift
[0501] Furthermore, in the embodiments of this application, the reconstructed value of the current block can be either the reconstructed value of the luminance component of the current block or the reconstructed value of the chrominance component of the current block; this application does not impose any specific limitation.
[0502] In other words, in the embodiments of this application, TALF filtering can be applied to any image component of the current image.
[0503] It should be noted that, in the embodiments of this application, the image components of the current image in the video image may include a first image component, a second image component, and a third image component. These three image components are respectively a luminance component, a blue color component, and a red color component. Specifically, the luminance component is typically represented by the symbol Y, the blue color component is typically represented by the symbol Cb or U, and the red color component is typically represented by the symbol Cr or V; thus, the video image can be represented in YCbCr format or YUV format.
[0504] Furthermore, in the embodiments of this application, the shape, size, and number of taps of the filter used in the TALF filtering process are not specifically limited; that is, filters of any shape and size can be applied to TALF filtering. For example, the shapes of filters used in the TALF filtering process include, but are not limited to, diamond-shaped, cross-shaped, rectangular, and square.
[0505] It is understood that the decoding method proposed in this application embodiment can use TALF for either the luminance component or the chrominance component.
[0506] It is understood that in the decoding method proposed in this application, the TALF switch identifier can be at any level. For example, the TALF can be switched on by image as a unit, or by CTU as a unit, or by CU as a unit, or by other methods of dividing the image into sub-regions.
[0507] In summary, the decoding method proposed in the embodiments of this application, on the one hand, allows for the reuse of filter banks saved from multiple historical chips within a single TALF, resulting in a greater number and combination of selectable historical filters for each CTU compared to conventional techniques, thus increasing the flexibility of the filtering process. On the other hand, in addition to allowing the reuse of filter banks from multiple historical chips, the current chip can select both historical and new filter banks simultaneously. Furthermore, each CTU can choose between the new and historical filter banks, further enhancing the flexibility of the filtering process.
[0508] In other words, the decoding method proposed in this application can reuse one or more historical filters in the time-domain adaptive loop filtering, or it can select between a new filter bank and one or more historical filter banks. Furthermore, the indication information for whether to reuse historical filters can be determined at the image level, the slice level, or the CTU level.
[0509] This application provides a decoding method, which is a scheme to introduce multiple historical filter banks for multiplexing. In this scheme, when it is determined that multiple historical filter banks can be multiplexed, multiple filter banks can be selected for multiplexing, and the historical filters to be multiplexed in the current block can be determined based on these multiple filter banks. In this way, for the current block, there are more historical filters to choose from when multiplexing historical filters, thereby improving the flexibility of the filtering process, achieving better filtering effect, and improving encoding and decoding performance.
[0510] One embodiment of this application proposes an encoding method applied to an encoder. This method can be used in scenarios where filtering is performed through a TALF filter, or in scenarios where filtering is performed through other filtering techniques. This application does not impose any specific limitations.
[0511] Figure 7 is a schematic diagram of the encoding method proposed in the embodiment of this application. As shown in Figure 7, the method of the encoder performing encoding processing may include the following steps:
[0512] Step 2001: When it is determined that multiple historical filter banks are to be reused, filter bank number identification information is set to indicate that multiple historical filter banks are to be reused, and the filter bank number identification information is written into the bit stream; wherein, the filter bank number identification information is used to determine the number of historical filter banks to be reused.
[0513] In the embodiments of this application, when it is determined that multiple historical filter banks can be reused, filter bank number identification information can be set to indicate the reuse of multiple historical filter banks, and then the filter bank number identification information can be written into the bit stream.
[0514] Furthermore, in the embodiments of this application, the cost value when using multiple historical filter banks for filtering and the cost value when using one historical filter bank for filtering can be determined separately. Then, the cost value when using multiple historical filter banks for filtering and the cost value when using one historical filter bank for filtering are compared, and the filter bank number identification information can be determined based on the comparison result.
[0515] Furthermore, in the embodiments of this application, when the cost of using multiple historical filter banks for filtering is less than the cost of using one historical filter bank for filtering, it is determined that multiple historical filter banks should be used for filtering. In this case, filter bank number identification information can be set to indicate the reuse of multiple historical filter banks, that is, the value of the filter bank number identification information is set to indicate the reuse of multiple historical filter banks, and the filter bank number identification information is written into the bit stream.
[0516] Furthermore, in the embodiments of this application, if the cost of filtering using multiple historical filter banks is greater than or equal to the cost of filtering using one historical filter bank, it is determined that one historical filter bank will be used for filtering. In this case, the filter bank number identifier information can be set to indicate the reuse of one historical filter bank, that is, the value of the filter bank number identifier information is set to indicate the reuse of one historical filter bank, and the filter bank number identifier information is written into the bit stream.
[0517] In the embodiments of this application, the methods for calculating cost value include, but are not limited to, rate-distortion optimization algorithms.
[0518] It should be noted that, in the embodiments of this application, the filter group number identification information can be used to determine the number of historical filter groups that can be reused, that is, to determine how many historical filter groups can be reused during the filtering process by using the filter group number identification information.
[0519] It is understood that, in the embodiments of this application, the historical filter bank can be elements in the candidate historical dataset cached during the filtering process, or referred to as storage units or data units, such as TALFs, wherein the storage units TALFs in the candidate historical dataset can record and store historical TALF information.
[0520] For example, in some embodiments, the candidate historical dataset can be a First-In-First-Out (FIFO) queue, that is, the FIFO used to store historical filters can be saved and updated in units of slices (or images). At the same time, if it is determined that a historical filter is to be reused, the corresponding historical filter can be selected from the FIFO.
[0521] It is understood that in the embodiments of this application, it is assumed that the candidate historical dataset is a FIFO, the historical filter group is a data unit in the FIFO, and the method of updating the FIFO is to shift each element (data unit) in the FIFO one position to the right and store one or more sets of filters parsed from the current slice at the first position of the FIFO, that is, the first data unit.
[0522] It should be noted that in the embodiments of this application, if the number of elements in the FIFO reaches the maximum value of the FIFO length, the last element of the FIFO is removed first, and then the elements are shifted and the filter is stored.
[0523] For example, in some embodiments, an 8-bit FIFO is used to store time-domain adaptive loop filters, where the FIFO already contains two TALFs, each of which is one or more filters contained in a chip in a historical decoding process.
[0524] For example, in some embodiments, when updating the FIFO, since the number of TALFs in the FIFO has not reached the maximum, the two existing TALFs are shifted backward and the TALFs of the current slice are placed at the beginning.
[0525] For example, in some embodiments, a FIFO of length 8 is used to store time-domain adaptive loop filters. At this time, there are already 8 TALFs in the FIFO. Each TALF is one or more filters contained in a chip in the history of decoding. Since the TALFs in the FIFO have reached the maximum number, the last TALFs element should be removed first, then each TALF should be shifted one position to the right, and finally the TALFs parsed from the current chip should be stored in the first position of the FIFO.
[0526] Of course, the length of the FIFO can be any integer value greater than 0, and is not limited to 8.
[0527] Furthermore, in the embodiments of this application, for the current image or the current slice, when reusing historical filters, multiple historical filter banks can be reused, that is, multiple data units TALFs in the candidate historical dataset FIFO can be selected for reuse. Compared with the conventional technology that only reuses one data unit TALF in the FIFO, it has greater flexibility.
[0528] Furthermore, in the embodiments of this application, the filter group number identification information can be image-level identification information or slice-level identification information, and this application does not impose specific limitations.
[0529] Furthermore, the encoding method proposed in this application embodiment can provide one or more historical filter banks for multiplexing filtered information, thereby increasing the flexibility of multiplexing by multiplexing more than one historical filter bank.
[0530] It should be noted that, in the embodiments of this application, based on the reuse of historical filters in related technologies, more sets of historical filters can be introduced, which can provide more combinations and quantities of historical filters, thereby improving the filtering effect.
[0531] In the embodiments of this application, after determining the filter bank number identification information based on the multiplexing status of historical filter banks, the filter bank number identification information can be encoded. The filter bank number identification information can be used to determine the number of historical filter banks used in the filtering process; that is, the number of multiplexed filter banks can be determined based on the filter bank number identification information, or in other words, the number of multiplexed historical filter banks can be determined based on the filter bank number identification information.
[0532] Furthermore, in the embodiments of this application, the filter group number identification information can be a flag, wherein the value of the filter group number identification information can determine how many groups of historical filters are reused for filtering.
[0533] For example, in some embodiments, if the filter group number identifier information is a first value, it is determined that one set of historical filters will be reused for filtering. If the filter group number identifier information is not a first value, it is determined that multiple sets of historical filters will be reused for filtering.
[0534] In other words, in the embodiments of this application, the filter group number identification information can also be used to indicate whether multiple historical filters are reused for filtering. Furthermore, the first value can be in parametric form or in numerical form; no limitation is made here.
[0535] For example, in some embodiments, if the filter bank number identification information is a slice-level flag, then in one specific example, the first value can be set to 0; in another specific example, the first value can also be set to false. The first value is not limited in any way in the embodiments of this application.
[0536] Taking a first value of 0 as an example, in this embodiment of the application, if the value of the filter group number identifier information is 0, then it can be determined that the current chip reuses one set of historical filters for filtering. Otherwise, if the value of the filter group number identifier information is not 0, then it can be determined that the current chip reuses multiple sets of historical filters for filtering.
[0537] For example, in some embodiments, if the filter bank number identifier is a slice-level flag, then the filter bank number identifier can be slice-level syntax. For instance, the filter bank number identifier can be represented by the syntax element `num_talf_reuse_minus1`, meaning `num_talf_reuse_minus1` indicates how many historical filter banks are reused for the current slice of the current image. If the value of `num_talf_reuse_minus1` is 0, then it is determined that the current slice reuses one historical filter bank; if the value of `num_talf_reuse_minus1` is not 0, then it is determined that the current slice reuses multiple historical filter banks. For example, `num_talf_reuse_minus1+1` historical filter banks are reused. Of course, the value of `num_talf_reuse_minus1` is not limited to 0, and this application does not impose specific limitations.
[0538] For example, in some embodiments, if the filter bank number identifier is an image-level flag, then the filter bank number identifier can be an image-level syntax. For instance, the filter bank number identifier can be represented by the syntax element control flag `num_talf_reuse_minus1`, meaning `num_talf_reuse_minus1` indicates how many historical filter banks are reused for the current image. If the value of `num_talf_reuse_minus1` is 0, then it is determined that the current image reuses one historical filter bank; if the value of `num_talf_reuse_minus1` is not 0, then it is determined that the current image reuses multiple historical filter banks. For example, `num_talf_reuse_minus1+1` historical filter banks are reused. Of course, the value of `num_talf_reuse_minus1` is not limited to 0, and this application does not impose a specific limitation.
[0539] Furthermore, in the embodiments of this application, if it is determined that the current image is filtered using TALF, it is determined whether to reuse historical TALF information for filtering; if it is determined that historical TALF information is reused for filtering, the filter group number identifier information is written into the bitstream.
[0540] It is understood that, in the embodiments of this application, when it is determined that the current image is filtered using TALF, when filtering the current image using TALF, the cost of using historical TALF information for filtering and the cost of not using historical TALF information for filtering are determined; based on the cost of using historical TALF information for filtering and the cost of not using historical TALF information for filtering, multiplexing identification information is determined and written into the bitstream; wherein, the multiplexing identification information is used to determine whether to reuse historical TALF information for filtering; when it is determined that historical TALF information is reused for filtering, filter group number identification information is determined and encoded.
[0541] In the embodiments of this application, when filtering the current image using TALF, the cost of reusing historical TALF information for filtering and the cost of not reusing historical TALF information for filtering can be determined.
[0542] It should be noted that, in the embodiments of this application, historical TALF information is used to determine historical filters, including but not limited to one or more of historical filter indices and filter coefficients.
[0543] It is understood that, in the embodiments of this application, the specific information included in the reused historical TALF information may be different for different reuse methods.
[0544] In the embodiments of this application, after determining the cost of filtering with reused historical TALF information and the cost of filtering without reused historical TALF information, multiplexing identification information can be further determined based on the cost of filtering with reused historical TALF information and the cost of filtering without reused historical TALF information, and the multiplexing identification information is written into the bitstream; wherein, the multiplexing identification information is used to determine whether to reuse historical TALF information for filtering.
[0545] Furthermore, in embodiments of this application, the reuse identifier information can be used to determine whether the current image is allowed to use historical TALF information to perform TALF filtering. The reuse identifier information can be a flag.
[0546] It should be noted that, in the embodiments of this application, the reuse identification information can be an image-level flag, a slice-level (strip-level) flag, a sub-picture-level flag, or a tile-level flag. This application does not impose any specific limitations.
[0547] For example, in some embodiments, if the multiplexing identification information is a slice-level flag, then the multiplexing identification information can be used to determine whether the current slice is allowed to multiplex historical TALF information for filtering.
[0548] Furthermore, in the embodiments of this application, the value of the reuse identifier information can be used to determine whether the current image (and / or the current slice) is allowed to reuse historical TALF information for filtering. The value of the reuse identifier information can be in parametric form or in numerical form.
[0549] For example, in some embodiments, when the reuse identifier is set to 1, it is determined that the current image (and / or the current slice) is allowed to reuse historical TALF information for filtering. When the reuse identifier is set to 0, it is determined that historical TALF information is not reused for filtering. Typically, the reuse identifier can be a parameter written in the Slice header or picture header, and there are no limitations on this.
[0550] For example, in some embodiments, when the reuse identifier information is set to 1, it is determined that the current image (and / or the current slice) is allowed to reuse historical TALF information for filtering. When the reuse identifier information is set to 0, it is determined that historical TALF information is not reused for filtering.
[0551] For example, in some embodiments, if the reuse identifier information is set to true, it is determined that the current image (and / or the current slice) is allowed to reuse historical TALF information for filtering. If the reuse identifier information is set to false, it is determined that historical TALF information is not reused for filtering.
[0552] For example, in some embodiments, assuming the reuse identifier is an image-level flag, the reuse identifier can be represented by the syntax element `talf_reuse_flag`, which indicates whether the current image is allowed to reuse TALF information for filtering. If the value of `talf_reuse_flag` is 0, it is determined that TALF information is not reused for filtering; if the value of `talf_reuse_flag` is 1, it is determined that the current image is allowed to reuse TALF information for filtering.
[0553] For example, in some embodiments, assuming the multiplexing identification information is a slice-level flag, the multiplexing identification information can be represented by the syntax element `talf_reuse_flag`, that is, `talf_reuse_flag` indicates whether the current slice is allowed to use TALF for filtering. If the value of `talf_reuse_flag` is 0, it is determined that the current slice will not use TALF for filtering; if the value of `talf_reuse_flag` is 1, it is determined that the current slice is allowed to use TALF for filtering.
[0554] Of course, the value of talf_reuse_flag is not limited to 0 and 1, and this application does not impose specific restrictions.
[0555] Furthermore, in the embodiments of this application, when determining the reuse identifier information based on the cost of filtering using reused historical TALF information and the cost of filtering without reusing historical TALF information, if the cost of filtering using reused historical TALF information is greater than or equal to the cost of filtering without reusing historical TALF information, the reuse identifier information is set to indicate that filtering without reusing historical TALF information; if the cost of filtering using reused historical TALF information is less than the cost of filtering without reusing historical TALF information, the reuse identifier information is set to indicate that filtering using reused historical TALF information.
[0556] For example, in some embodiments, the syntax elements refer to the following:
[0557] The `talf_reuse_flag` flag indicates whether historical TALF information is reused, such as the historical adaptive filter of the record. If this flag is 1, it indicates that the historical adaptive loop filter of the record is reused, which means that at least one set of historical filters is selected. A flag of 0 indicates that it is not reused. When this syntax element does not exist in the bitstream, its default value of 0 can be used.
[0558] The num_talf_reuse_minus1 flag indicates that the number of historical filter groups reused in the current slice is reduced by one. When there is no such syntax element in the bitstream, its value defaults to 0.
[0559] Step 2002: Determine multiple historical filter banks for multiplexing, determine multiple first multiplexing index parameters based on the multiple historical filter banks for multiplexing, and write the multiple first multiplexing index parameters into the bit stream.
[0560] In the embodiments of this application, when it is determined that multiple historical filter banks are to be reused, multiple multiple historical filter banks to be reused can be further determined, and multiple first multiplexing index parameters can be determined based on the multiple multiple historical filter banks to be reused, and the multiple first multiplexing index parameters can be written into the bit stream.
[0561] It is understood that, in the embodiments of this application, the filter bank number identifier information can be used to determine the number of reused historical filter banks. For example, the num_talf_reuse_minus1 identifier indicates that the number of reused historical filter banks in the current slice is reduced by one. If num_talf_reuse_minus1 is 0, it can be determined that one historical filter bank is reused. If num_talf_reuse_minus1 is greater than 0, it can be determined that multiple historical filter banks are reused, that is, num_talf_reuse_minus1+1 historical filter banks are reused.
[0562] Furthermore, in the embodiments of this application, when it is determined that multiple historical filter banks are being reused, it is possible to further determine which historical filter banks are being reused, and then determine multiple first multiplexing index parameters based on the multiple reused historical filter banks, wherein the multiple first multiplexing index parameters are used to determine which historical filter banks are being reused.
[0563] It is understood that, in the embodiments of this application, when it is determined that historical TALF information is reused for filtering and multiple historical filter banks are reused, multiple first multiplexing index parameters can be determined and written into the bitstream.
[0564] Furthermore, in the embodiments of this application, when determining which historical filter groups are being reused, the cost of filtering using the reused historical filter groups is determined, and then multiple minimum cost values among the cost values of filtering using the reused historical filter groups are used to determine the corresponding multiple historical filter groups, which are the multiple historical filter groups determined to be reused.
[0565] Accordingly, in the embodiments of this application, multiple data unit indices corresponding to multiple historical filter banks that are multiplexed are determined, and multiple first multiplexing index parameters indicating multiple historical filter banks that are multiplexed are determined based on the multiple data unit indices.
[0566] It is understood that, in the embodiments of this application, the first multiplexing index parameter can be used to indicate the history filter group of multiplexing, that is, the corresponding history filter group can be determined based on the first multiplexing parameter. Accordingly, multiple first multiplexing index parameters can be set by determining multiple history filter groups of multiplexing.
[0567] It is understood that, in the embodiments of this application, the first multiplexing index parameter can be represented as talf_reuse_idx, where talf_reuse_idx can be used to indicate the index of the time-domain adaptive filter in the FIFO, that is, to indicate the historical filter group in the FIFO. The value of talf_reuse_idx can be determined based on the storage length of the candidate historical dataset. For example, assuming the maximum FIFO length is 8, then the value range of talf_reuse_idx can be 0 to 7, representing which set of historical time-domain adaptive loop filters in the multiplexed FIFO, that is, which historical filter group in the multiplexed FIFO.
[0568] Furthermore, in the embodiments of this application, when it is determined that multiple historical filter banks are to be reused, multiple first multiplexing index parameters can be determined to indicate which historical filter banks are being reused. The number of first multiplexing index parameters can be determined by the filter bank number identifier information num_talf_reuse_minus1.
[0569] For example, in some embodiments, the bitstream can be decoded to determine num_talf_reuse_minus1+1 first multiplexing index parameters talf_reuse_idx, which are denoted as talf_reuse_idx[i].
[0570] For example, in some embodiments, the slice-level syntax element is parsed as follows:
[0571] In terms of slice-level syntax elements, due to the more flexible reuse mechanism, compared with the conventional technology where the current slice can only parse one talf_reuse_idx to determine which set of historical filters the current slice reuses, in the embodiments of this application, the current slice first determines how many sets of historical filters the current slice reuses by parsing num_talf_reuse_minus1.
[0572] When `talf_reuse_flag` is 1, it indicates that the current slice reuses historical filters, meaning that at least one set of historical filters is selected. The `num_talf_reuse_minus1` flag indicates that the number of historical filter sets reused in the current slice is reduced by one; its value defaults to 0 when this syntax element is not present in the bitstream.
[0573] After parsing num_talf_reuse_minus1, further parsing (num_talf_reuse_minus1+1) talf_reuse_idx is used to determine which groups of historical filters are selected by the current chip, that is, to determine the multiple groups of historical filters that support multiplexing.
[0574] Furthermore, in the embodiments of this application, when it is determined that a historical filter group is to be reused, filter group number identification information is set to indicate that a historical filter group is to be reused, and the filter group number identification information is written into the bit stream; a historical filter group to be reused is determined, a first multiplexing index parameter is determined according to the historical filter group to be reused, and multiple first multiplexing index parameters are written into the bit stream; the historical TALF information corresponding to the current block is determined in a historical filter group.
[0575] Furthermore, in the embodiments of this application, when determining a first multiplexing index parameter based on a multiplexed historical filter bank, the historical filter bank corresponding to the current block can be determined; then the data unit index corresponding to the historical filter bank corresponding to the current block can be determined; and then the first multiplexing index parameter can be determined based on the data unit index.
[0576] It is understood that, in the embodiments of this application, when it is determined that historical TALF information is reused for filtering and a historical filter bank is reused, a first multiplexing index parameter can be determined and written into the bitstream.
[0577] Furthermore, in the embodiments of this application, when determining which historical filter bank is being reused, the cost of filtering using the reused historical filter bank is determined, and then the minimum cost among the cost values of filtering using the reused historical filter bank is used to determine the multiple historical filter banks to be reused.
[0578] Accordingly, in the embodiments of this application, a data unit index corresponding to a multiplexed historical filter bank is determined, and a first multiplexing index parameter indicating a multiplexed historical filter bank is determined based on the data unit index.
[0579] Step 2003: Determine the historical TALF information corresponding to the current block from multiple historical filter banks.
[0580] In the embodiments of this application, when multiple historical filter banks are determined to be reused, the historical TALF information corresponding to the current block is determined from the multiple historical filter banks.
[0581] It is understood that, in the embodiments of this application, historical TALF information may include at least one or more of the following: filtering mode, number of filter groups, and filter coefficients of candidate filters.
[0582] For example, in some embodiments, the historical TALF information corresponding to the current block may include, but is not limited to, the historical filters multiplexed by the current block and the filter coefficients of the historical filters multiplexed by the current block.
[0583] Further, in the embodiments of this application, when determining the historical TALF information corresponding to the current block among multiple historical filter banks, if it is determined that the current block uses TALF for filtering, the filtering enable flag information corresponding to the current block is set to indicate that the current block uses TALF for filtering, and the filtering enable flag information is written into the bitstream; the historical filter bank corresponding to the current block is determined among multiple historical filter banks, the second multiplexing index parameter is determined according to the historical filter bank corresponding to the current block, and the second multiplexing index parameter is written into the bitstream; the historical TALF information corresponding to the current block is determined based on the historical filter bank corresponding to the current block; wherein, the historical TALF information includes the historical filters multiplexed by the current block and the filter coefficients of the historical filters multiplexed by the current block.
[0584] Furthermore, in the embodiments of this application, the third multiplexing index parameter is determined based on the historical TALF information corresponding to the current block, and the third multiplexing index is written into the bitstream.
[0585] It is understood that in the embodiments of this application, multiple historical filter groups can be reused for the current slice or the current image. Therefore, for the current block in the current slice or the current image, it is necessary to first determine which of the multiple historical filter groups the current block reuses.
[0586] In the embodiments of this application, the filter enable flag information can be used to determine whether the current block is filtered using TALF. That is, based on the filter enable flag information, it can be determined whether to use the TALF filter to filter the reconstructed value of the image component of the current block, and the filter enable flag information is written into the bitstream.
[0587] Furthermore, in the embodiments of this application, the filter enable flag information can be used to determine whether the current block uses TALF for filtering. The filter enable flag information can be a flag, wherein if the current block is a CTU corresponding to the current image, then the filter enable flag information can be a CTU-level flag; if the current block is a CU corresponding to the current image, then the filter enable flag information can be a CU-level flag. Of course, corresponding to any size sub-region in the current image, the filter enable flag information can also be a flag of other block levels. This application does not impose specific limitations.
[0588] Furthermore, in the embodiments of this application, it can be determined whether to use TALF filtering on the current block, and then the value of the filtering enable flag information can be set to indicate whether to use TALF filtering on the current block.
[0589] For example, in some embodiments, if the filter enable flag information is set to a first value, it is determined that TALF filtering will not be used on the current block. If the filter enable flag information is set to a second value, it is determined that TALF filtering will be used on the current block.
[0590] It should be noted that, in the embodiments of this application, the filter enable flag information can be used to indicate whether the current block uses TALF for filtering. Furthermore, the first value and the second value are different, and the first value and the second value can be in parameter form or in numerical form; no limitation is made here.
[0591] For example, in some embodiments, if the filter enable flag is a block-level flag, then in one specific example, the first value can be set to 1 and the second value can be set to 0; in another specific example, the first value can also be set to true and the second value can also be set to false; even in yet another specific example, the first value can also be set to 0 and the second value can also be set to 1; or, the first value can also be set to false and the second value can also be set to true. The first and second values are not limited in any way in the embodiments of this application.
[0592] Taking a first value of 0 and a second value of 1 as an example, in this embodiment of the application, if the value of the filter enable flag information is 0, it can be determined that the current block does not use TALF for filtering. Otherwise, if the filter enable flag information is 1, it can be determined that the current block uses TALF for filtering.
[0593] For example, in some embodiments, if the current block of the current image is a CTU, the filter enable flag information can be CTU-level syntax. For instance, the filter enable flag information can be represented by the syntax element control flag `talf_ctb_enabled`, that is, `talf_ctb_enabled` indicates whether to use TALF filtering on the current block of the current image. If the value of `talf_ctb_enabled` is 0, it is determined that TALF filtering is not used on the current block; if the value of `talf_ctb_enabled` is 1, it is determined that TALF filtering is used on the current block. Of course, the value of `talf_ctb_enabled` is not limited to 0, and this application does not specifically limit it.
[0594] In other words, in the embodiments of this application, a talf_ctb_enabled flag can be determined first, that is, the filtering enable flag information can be determined. When the flag is 1, it means that the current CTU (current block) uses TALF, and when the flag is 0, it means that the current CTU does not use TALF.
[0595] Furthermore, in the embodiments of this application, when it is determined that the current block uses TALF for filtering based on the filter enable identifier information, a second multiplexing index parameter can be determined to indicate which historical filter bank the current block specifically reuses, thereby determining the historical filter bank corresponding to the current block among multiple historical filter banks based on the second multiplexing index parameter.
[0596] It is understood that, in the embodiments of this application, the second multiplexing index parameter can be represented as talf_reuse_setId, where talf_reuse_setId can be used to indicate the index of the time-domain adaptive filter multiplexed in the current block of the FIFO, that is, to indicate the historical filter bank multiplexed in the current block of the FIFO. The value of talf_reuse_setId can be determined based on the number of multiplexed historical filter banks.
[0597] Furthermore, in the embodiments of this application, when determining the historical TALF information corresponding to the current block based on the historical filter bank corresponding to the current block, the cost value of using any historical filter in the historical filter bank can be determined by calculating the cost value. Then, the historical filter corresponding to the minimum cost value is selected, and the corresponding historical TALF information is determined. The historical TALF information includes the historical filters multiplexed in the current block and the filter coefficients of the historical filters multiplexed in the current block.
[0598] Accordingly, in the embodiments of this application, after determining the historical TALF information corresponding to the current block, a third reuse index parameter can also be set, and the value of the third reuse index parameter can be set to indicate the historical TALF information corresponding to the current block.
[0599] It is understood that, in the embodiments of this application, the third multiplexing index parameter can be represented as talf_ctb_filter_idx, where talf_ctb_filter_idx can be used to indicate the historical filters in the historical filter bank of the current block multiplexing. The value of talf_ctb_filter_idx can be determined based on the number of historical filters in the multiplexed historical filter bank.
[0600] It is understood that, in the embodiments of this application, for any historical filter bank, i.e., any TALFs in the FIFO, one or more filters contained in a chip for historical decoding are stored. Therefore, after determining which historical filter bank among the multiple historical filter banks multiplexed by the current block is used, it is necessary to further determine the historical TALF information corresponding to the current block in that historical filter bank, that is, to determine the historical filters multiplexed by the current block and the filter coefficients of the historical filters multiplexed by the current block.
[0601] For example, in some embodiments, the syntax elements refer to the following:
[0602] In conventional schemes, it is possible to determine whether the current CTU is using TALF and which filter is being used by encoding and decoding a talf_ctb_idc.
[0603] In this embodiment, a talf_ctb_enabled flag is first decoded. When the flag is 1, it means that the current CTU uses TALF. When the flag is 0, it means that the current CTU does not use TALF. When the syntax element does not exist in the bitstream, its value is 0.
[0604] Next, if the current slice reuses a historical filter and the number of reused groups is greater than 1 (i.e., num_talf_reuse_minus1>0), talf_reuse_setId is further decoded to determine which historical filter group is being reused by the current CTU.
[0605] For example, the multiplexing index talf_reuse_idx[talf_reuse_setId] can be determined using talf_reuse_setId, and then the multiplexing index can be used to determine a set of multiplexed filters tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]]. If the current slice multiplexes only one set of historical filters, then talf_reuse_setId is not parsed and its default value is 0, and the multiplexing index is determined as talf_reuse_idx[0]. Finally, talf_ctb_filter_idx is parsed according to the number of selected filters or the number of multiplexed filters, and the filter used by the current CTU is determined.
[0606] Step 2004: Filter the current block based on historical TALF information to determine the filtered reconstructed value of the current block.
[0607] In the embodiments of this application, after determining the historical TALF information corresponding to the current block in multiple historical filter banks, the current block can be further filtered based on the historical TALF information to determine the filtered reconstructed value of the current block.
[0608] It is understood that in the embodiments of this application, the current block can be a CTU determined after dividing the current image, the current block can be a coding unit (CU) obtained after dividing the CTU, or the current block can be a sub-region of any size obtained after dividing the current image. This application does not specifically limit the size and acquisition method of the current block in the current image.
[0609] Furthermore, in the embodiments of this application, after determining the historical TALF information including the historical filter multiplexed by the current block and the filter coefficients of the historical filter multiplexed by the current block, the current block can be further filtered based on the historical filter multiplexed by the current block and the filter coefficients of the historical filter multiplexed by the current block to determine the filtered reconstructed value of the current block.
[0610] For example, in some embodiments, when reconstructing filter coefficients, if the current slice's sh_talf_enabled_flag is 1 and talf_reuse_flag is 0, the coefficient values, shift values, and nonlinear limit values of the time-domain adaptive loop filter need to be reconstructed.
[0611] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0612] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0613] {
[0614] for(j=0;j <numCoeff;j++)
[0615] {
[0616] tAlfCoeff[sfIdx][j]=(talf_coeff_sign[sfIdx][j]==1)?
[0617] -talf_coeff_abs[sfIdx][j]:talf_coeff_abs[sfIdx][j]
[0618] }
[0619] }
[0620] The process of obtaining the nonlinear tAlfClip value of the current slice is as follows:
[0621] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0622] clipTable[0] = 1 < <inputBitdepth
[0623] for(i=0;i<4;i++)
[0624] {
[0625] clipTable[i]=1<<((7-2*i+(inputBitdepth-8)))
[0626] }
[0627] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0628] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0629] {
[0630] for(j=0;j <numCoeff;j++)
[0631] {
[0632] tAlfClip[sfIdx][j]=clipTable[talf_clip_idx[sfIdx][j]]
[0633] }
[0634] }
[0635] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0636] shift = talf_shift_minus6 + 6
[0637] If the current slice's sh_talf_enabled_flag is 1 and talf_reuse_flag is 1, then the coefficient values, shift values, and nonlinear limit values need to be obtained from the FIFO of the historical time-domain adaptive loop filter.
[0638] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0639] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0640] {
[0641] for(j=0;j <numCoeff;j++)
[0642] {
[0643] tAlfCoeff[sfIdx][j]=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].coeff[sfIdx][j]
[0644] }
[0645] }
[0646] The process of obtaining the nonlinear tAlfClip value of the current slice is as follows:
[0647] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0648] clipTable[0] = 1 < <inputBitdepth
[0649] for(i=0;i<4;i++)
[0650] {
[0651] clipTable[i]=1<<((7-2*i+(inputBitdepth-8)))
[0652] }
[0653] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0654] filterCount=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].filterCount
[0655] for(sfIdx=0;sfIdx<=filterCount;sfIdx++)
[0656] {
[0657] for(j=0;j <numCoeff;j++)
[0658] {
[0659] tAlfClip[sfIdx][j]=
[0660] clipTable[tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].clipIdx[sfIdx][j]]
[0661] }
[0662] }
[0663] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0664] shift=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].shift
[0665] Furthermore, in the embodiments of this application, when it is determined that the first filter group is to be encoded, the first filter identification information is set to indicate the encoding of the first filter group, and the first filter identification information is written into the bit stream; the TALF information corresponding to the current block is determined; wherein, the TALF information corresponding to the current block includes the filtering mode, the number of filters in the first filter group, and the filter coefficients of the filters in the first filter group.
[0666] Furthermore, in the embodiments of this application, when it is determined that the current block uses the first filter bank, a second filter identification information is set to indicate that the current block uses the first filter bank, and the second filter identification information is written into the bit stream; the current block is filtered based on the TALF information corresponding to the current block to determine the filtered reconstructed value of the current block.
[0667] It is understood that, in the embodiments of this application, the first filter identification information can be used to determine whether to decode the first filter group. The first filter group can be a new set of filters obtained through encoding and decoding.
[0668] Therefore, in the embodiments of this application, the first filter identification information can be used to indicate whether to encode or decode a new filter bank.
[0669] Furthermore, in the embodiments of this application, the first filter identification information can be image-level identification information or slice-level identification information, and this application does not impose any specific limitations.
[0670] Furthermore, the encoding method proposed in this application can not only provide one or more historical filter banks for the reuse of filtered information, but also introduce new filter banks to further increase the flexibility of reuse.
[0671] In other words, in the embodiments of this application, the slice level or image level can simultaneously select historical filter banks and new filter banks.
[0672] It should be noted that, in the embodiments of this application, it can be first determined whether to encode a new filter bank, and then a first filter identification information can be set to indicate whether to encode or decode the first filter bank. The first filter identification information can be used to determine whether to encode or decode a new filter bank; that is, based on the first filter identification information, it can be determined whether to encode or decode a new set of TALF filters to filter the reconstructed values of the image components.
[0673] Furthermore, in embodiments of this application, the first filter identification information can be used to determine whether to encode or decode a new filter bank. The first filter identification information can be a flag.
[0674] Furthermore, in the embodiments of this application, the value of the first filter identification information can be used to determine whether to encode and decode a new set of TALF filters for filtering.
[0675] For example, in some embodiments, if the value of the first filter identifier information is a first value, it is determined not to encode or decode a new filter bank. If the value of the first filter identifier information is a second value, it is determined to encode or decode a new filter bank.
[0676] It should be noted that, in the embodiments of this application, the first filter identification information can be used to indicate whether to encode and decode a new set of TALF filters for filtering. Furthermore, the first value and the second value are different, and the first value and the second value can be in parametric form or in numerical form; no limitation is made here.
[0677] For example, in some embodiments, if the first filter identification information is an image-level or slice-level flag, then in one specific example, the first value can be set to 1 and the second value can be set to 0; in another specific example, the first value can also be set to true and the second value can also be set to false; even in yet another specific example, the first value can also be set to 0 and the second value can also be set to 1; or, the first value can also be set to false and the second value can also be set to true. The first and second values are not limited in any way in the embodiments of this application.
[0678] Taking a first value of 0 and a second value of 1 as an example, in this embodiment of the application, if the first filter identifier information is 0, it can be determined that no new filter bank will be encoded or decoded for filtering. Otherwise, if the first filter identifier information is 1, it can be determined that a new filter bank will be encoded or decoded for filtering.
[0679] For example, in some embodiments, for the current slice or the current image, the first filter identification information can be represented by the syntax element control flag `talf_new_flag`, that is, `talf_new_flag` indicates whether to encode and decode a new set of TALFs for filtering. If the value of `talf_new_flag` is 0, it is determined that no new set of TALFs will be encoded and decoded for filtering; if the value of `talf_new_flag` is 1, it is determined that a new set of TALFs will be encoded and decoded for filtering. Of course, the value of `talf_new_flag` is not limited to 0 and 1, and this application does not impose specific limitations.
[0680] It is understood that, in the embodiments of this application, if the first filter bank is determined to be encoded and decoded, the TALF information corresponding to the current block can be further determined. The TALF information corresponding to the current block may include, but is not limited to, the filtering mode, the number of filters in the first filter bank, and the filter coefficients of the filters in the first filter bank.
[0681] In other words, in the embodiments of this application, if it is determined that a new set of filters can be encoded and decoded, then the encoding and decoding of the first filter group can be further performed to determine the number of filters in the first filter group and the filter coefficients of the filters in the first filter group.
[0682] For example, in some embodiments, the syntax elements refer to the following:
[0683] Regarding slice-level syntax elements, due to the more flexible multiplexing mechanism, compared to the conventional approach where only one `talf_reuse_idx` can be parsed for the current slice to determine which set of historical filters is multiplexed, in the embodiments of this application, the current slice first determines how many sets of historical filters are multiplexed by parsing `num_talf_reuse_minus1`. When `talf_reuse_flag` is 1, it indicates that the current slice is multiplexing historical filters, meaning that at least one set of historical filters is selected. The `num_talf_reuse_minus1` flag indicates the number of multiplexed historical filter sets minus one; its value defaults to 0 when this syntax element is not present in the bitstream. After parsing `num_talf_reuse_minus1`, (num_talf_reuse_minus1+1) `talf_reuse_idx` values are further parsed to determine which sets of historical filters are selected by the current slice.
[0684] Furthermore, in the embodiments of this application, the talf_new_flag can also be decoded at the slice level, which indicates whether the current slice has encoded or decoded a new set of filters (the first filter set). If a new set of filters has been encoded, the number of filters, coefficients, etc., can be further encoded or decoded.
[0685] Here, compared with conventional techniques, in the embodiments of this application, the chip level can simultaneously select multiplexed filters and new filters.
[0686] Furthermore, in the embodiments of this application, it can be first determined whether the current block uses the first filter group, and then the value of the second filter identification information is used to indicate whether the current block uses the first filter group; wherein, the second filter identification information is used to determine whether the current block uses the first filter group; if it is determined that the current block uses the first filter group, the current block is filtered based on the TALF information corresponding to the current block to determine the filtered reconstructed value of the current block.
[0687] It is understood that, in the embodiments of this application, the second filter identification information can be used to determine whether the current block uses the first filter group. The first filter group can be a new filter group obtained through encoding and decoding.
[0688] Therefore, in the embodiments of this application, the second filter identification information can be used to indicate whether the current block uses a new filter bank that has already been encoded and decoded.
[0689] Furthermore, in the embodiments of this application, the second filter identification information can be block-level identification information.
[0690] Furthermore, the encoding method proposed in this application can provide one or more historical filter banks for multiplexing filtered information, while also introducing new filter banks. In this way, for the current block, the corresponding filter can be selected from both the historical filter banks and the new filter banks used for encoding and decoding, further increasing the flexibility of multiplexing.
[0691] In other words, in the embodiments of this application, at the slice level or image level, both historical filter banks and new filter banks can be selected simultaneously, while at the block level, it is necessary to select whether to reuse historical filter banks or use a newly determined filter bank.
[0692] It should be noted that, in the embodiments of this application, after determining the second filter identification information, the second filter identification information can be written into the bitstream. The second filter identification information can be used to determine whether the current block uses a new filter bank; that is, based on the second filter identification information, it can be determined whether the current block uses a new set of TALF filters that has already been encoded and decoded to filter the reconstructed values of the image components.
[0693] Furthermore, in embodiments of this application, the second filter identification information can be used to determine whether to use a new set of TALF filters that has already been encoded and decoded to filter the current block. The second filter identification information can be a flag.
[0694] Furthermore, in the embodiments of this application, the value of the second filter identification information can be used to determine whether the current block uses a new set of TALF filters for filtering.
[0695] For example, in some embodiments, if the value of the second filter identifier information is a first value, it is determined that the current block does not use a new filter bank. If the value of the second filter identifier information is a second value, it is determined that the current block uses a new filter bank. Furthermore, the first value and the second value are different, and both the first value and the second value can be in parametric form or in numerical form; no limitation is made here.
[0696] For example, in some embodiments, if the second filter identification information is a CTU-level flag, then in one specific example, the first value can be set to 1 and the second value can be set to 0; in another specific example, the first value can also be set to true and the second value can also be set to false; even in yet another specific example, the first value can also be set to 0 and the second value can also be set to 1; or, the first value can also be set to false and the second value can also be set to true. The first and second values are not limited in any way in the embodiments of this application.
[0697] Taking a first value of 0 and a second value of 1 as an example, in this embodiment of the application, if the second filter identifier information is 0, it can be determined that the current block does not use a new filter bank for filtering, that is, it does not use the first filter bank. Otherwise, if the second filter identifier information is 1, it can be determined that the current block uses a new filter bank for filtering, that is, it uses the first filter bank.
[0698] For example, in some embodiments, for the current block, the second filter identification information can be represented by the syntax element control flag `talf_ctb_new_flag`, that is, `talf_ctb_new_flag` indicates whether to use the newly encoded / decoded filter bank for filtering. If the value of `talf_ctb_new_flag` is 0, it is determined that the newly encoded / decoded filter bank will not be used for filtering; if the value of `talf_ctb_new_flag` is 1, it is determined that the newly encoded / decoded filter bank will be used for filtering. Of course, the value of `talf_ctb_new_flag` is not limited to 0 and 1, and this application does not impose specific limitations.
[0699] Furthermore, in the embodiments of this application, when it is determined that the current block does not use the first filter bank, a second filter identification information is set to indicate that the current block does not use the first filter bank, and the second filter identification information is written into the bit stream; when it is determined that multiple historical filter banks are reused, the historical TALF information corresponding to the current block is determined; the current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block.
[0700] In other words, in the embodiments of this application, if it is determined that the current block does not use a new first filter bank for encoding and decoding, the historical TALF information corresponding to the current block can be further determined if it is determined that multiple historical filter banks are reused.
[0701] Furthermore, in the embodiments of this application, if it is determined that multiple historical filter banks are to be reused, then when determining the historical TALF information corresponding to the current block, the historical filter bank corresponding to the current block can be determined from among the multiple historical filter banks; then, based on the historical filter bank corresponding to the current block, the historical TALF information corresponding to the current block is determined.
[0702] In other words, in the embodiments of this application, when it is determined that the current block does not use the first filter bank, and it is determined that multiple historical filter banks are reused, the historical filter bank corresponding to the current block can be determined from multiple historical filter banks.
[0703] It is understood that, in the embodiments of this application, for any historical filter bank, i.e., any TALFs in the FIFO, one or more filters contained in a chip for historical decoding are stored. Therefore, after determining which historical filter bank among the multiple historical filter banks multiplexed by the current block is used, it is necessary to further determine the historical TALF information corresponding to the current block in that historical filter bank, that is, to determine the historical filters multiplexed by the current block and the filter coefficients of the historical filters multiplexed by the current block.
[0704] Furthermore, in the embodiments of this application, when it is determined to encode the first filter bank, or when it is determined to reuse historical TALF information for filtering, the filtering enable flag information corresponding to the current block is written into the bit stream.
[0705] It is understood that, in the embodiments of this application, the encoding condition of the filter enable identifier information talf_ctb_enabled is to determine whether to decode the first filter bank or to determine whether to reuse historical TALF information for filtering.
[0706] In other words, in the embodiments of this application, when it is determined that the first filter bank is to be decoded, it is possible to further encode the filter enable identifier information talf_ctb_enabled; or, when it is determined that the historical TALF information is to be reused, it is possible to further encode the filter enable identifier information talf_ctb_enabled.
[0707] Furthermore, in the embodiments of this application, when it is determined that the current block uses TALF for filtering, and it is determined that the first filter group is encoded, and it is determined that historical TALF information is reused for filtering, the second filter identification information is written into the bit stream.
[0708] It is understood that, in the embodiments of this application, the encoding conditions of the second filter identifier information talf_ctb_new_flag are to determine that the current block uses TALF for filtering, to determine that the first filter group is decoded, and to determine that historical TALF information is reused for filtering.
[0709] In other words, in the embodiments of this application, when it is determined that the current block uses TALF for filtering, the first filter bank is decoded, and the historical TALF information is reused, it is possible to further encode the filtering enable identifier information talf_ctb_enabled.
[0710] For example, in some embodiments, the syntax elements refer to the following:
[0711] In the embodiments of this application, a `talf_ctb_new_flag` is further introduced at the CTU level. A `talf_ctb_new_flag` of 1 indicates that the current CTU uses the `talf_ctb_filter_idx`-th filter from a new set of filters decoded at the slice level to filter the current CTU; a `talf_ctb_filter_idx`-th filter from the `talf_reuse_idx[talf_reuse_setId]`-th group of historical filters to filter the current CTU. When both `talf_new_flag` and `talf_reuse_flag` at the slice level are 1, the encoding / decoding `talf_ctb_new_flag` flag is used; otherwise, if `talf_new_flag` is 1 and `talf_reuse_flag` is 0, `talf_ctb_new_flag` defaults to 1; otherwise, it defaults to 0.
[0712] For example, in some embodiments, when reconstructing filter coefficients, if the current slice's talf_ctb_enabled is 1 and talf_ctb_new_flag is 1, the coefficient values, shift values, and nonlinear limit values of the time-domain adaptive loop filter need to be reconstructed.
[0713] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0714] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0715] {
[0716] for(j=0;j <numCoeff;j++)
[0717] {
[0718] tAlfCoeff[sfIdx][j]=(talf_coeff_sign[sfIdx][j]==1)?
[0719] -talf_coeff_abs[sfIdx][j]:talf_coeff_abs[sfIdx][j]
[0720] }
[0721] }
[0722] The process of obtaining the nonlinear tAlfClip value of the current slice is as follows:
[0723] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0724] clipTable[0] = 1 < <inputBitdepth
[0725] for(i=0;i<4;i++)
[0726] {
[0727] clipTable[i]=1<<((7-2*i+(inputBitdepth-8)))
[0728] }
[0729] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0730] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0731] {
[0732] for(j=0;j <numCoeff;j++)
[0733] {
[0734] tAlfClip[sfIdx][j]=clipTable[talf_clip_idx[sfIdx][j]]
[0735] }
[0736] }
[0737] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0738] shift = talf_shift_minus6 + 6
[0739] If the current slice's talf_ctb_enabled is 1 and talf_ctb_new_flag is 0, then the coefficient values, shift values, and nonlinear limit values need to be obtained from the FIFO of the historical time-domain adaptive loop filter.
[0740] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0741] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0742] {
[0743] for(j=0;j <numCoeff;j++)
[0744] {
[0745] tAlfCoeff[sfIdx][j]=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].coeff[sfIdx][j]
[0746] }
[0747] }
[0748] The process of obtaining the nonlinear tAlfClip value of the current slice is as follows:
[0749] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0750] clipTable[0] = 1 < <inputBitdepth
[0751] for(i=0;i<4;i++)
[0752] {
[0753] clipTable[i]=1<<((7-2*i+(inputBitdepth-8)))
[0754] }
[0755] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0756] filterCount=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].filterCount
[0757] for(sfIdx=0;sfIdx<=filterCount;sfIdx++)
[0758] {
[0759] for(j=0;j <numCoeff;j++)
[0760] {
[0761] tAlfClip[sfIdx][j]=
[0762] clipTable[tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].clipIdx[sfIdx][j]]
[0763] }
[0764] }
[0765] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0766] shift=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].shift
[0767] Furthermore, in the embodiments of this application, the reconstructed value of the current block can be either the reconstructed value of the luminance component of the current block or the reconstructed value of the chrominance component of the current block; this application does not impose any specific limitation.
[0768] In other words, in the embodiments of this application, TALF filtering can be applied to any image component of the current image.
[0769] It should be noted that, in the embodiments of this application, the image components of the current image in the video image may include a first image component, a second image component, and a third image component. These three image components are respectively a luminance component, a blue color component, and a red color component. Specifically, the luminance component is typically represented by the symbol Y, the blue color component is typically represented by the symbol Cb or U, and the red color component is typically represented by the symbol Cr or V; thus, the video image can be represented in YCbCr format or YUV format.
[0770] Furthermore, in the embodiments of this application, the shape, size, and number of taps of the filter used in the TALF filtering process are not specifically limited; that is, filters of any shape and size can be applied to TALF filtering. For example, the shapes of filters used in the TALF filtering process include, but are not limited to, diamond-shaped, cross-shaped, rectangular, and square.
[0771] It is understood that the encoding method proposed in this application embodiment, TALF can be used for either the luminance component or the chrominance component.
[0772] It is understood that in the encoding method proposed in this application, the switch identifier of TALF can be at any level. For example, TALF can be switched on by image as a unit, or on by CTU as a unit, or on by CU as a unit, or on by other methods of dividing the image into sub-regions.
[0773] In summary, the encoding method proposed in the embodiments of this application, on the one hand, allows for the reuse of filter banks saved from multiple historical chips within a single TALF, resulting in a greater number and combination of selectable historical filters for each CTU compared to conventional techniques, thus increasing the flexibility of the filtering process. On the other hand, in addition to allowing the reuse of filter banks from multiple historical chips, the current chip can select both historical and new filter banks simultaneously. Furthermore, each CTU can choose between the new and historical filter banks, further enhancing the flexibility of the filtering process.
[0774] In other words, the encoding method proposed in this application embodiment can reuse one or more historical filters in the time-domain adaptive loop filtering, or it can select between a new filter bank and one or more historical filter banks. Furthermore, the indication information for whether to reuse historical filters can be determined at the image level, the slice level, or the CTU level.
[0775] This application provides an encoding method, which is a scheme to introduce multiple historical filter banks for multiplexing. In this method, when it is determined that multiple historical filter banks can be multiplexed, multiple filter banks can be selected for multiplexing, and the historical filters to be multiplexed in the current block can be determined based on these multiple filter banks. In this way, for the current block, there are more historical filters to choose from when multiplexing historical filters, thereby improving the flexibility of the filtering process, achieving better filtering results, and improving encoding and decoding performance.
[0776] Based on the above embodiments, this application proposes an encoding / decoding method. During the execution of TALF filtering, the time-domain adaptive loop filtering can reuse more than one set of historical filters to increase the flexibility of multiplexing. Furthermore, new filter sets can be added simultaneously with historical filter sets, allowing each CTU to choose between new and historical filter sets, further increasing the flexibility of the filtering process.
[0777] In related technologies, when the slice-level flag `talf_reuse_flag` is 1, the CTU level selects one set of filters from multiple sets of filters saved from historical slices for filtering. The encoding / decoding method proposed in this application can be further extended to allow the current slice to reuse multiple sets of filters from multiple historical slices, while at the CTU level, the flag is used to select which filter from which set of historical filters is used for filtering.
[0778] For example, in some embodiments, multiple historical filter banks can be selected for filter multiplexing. The CTU can select whether to reuse historical filters and how many banks to reuse based on high-level syntax. For example, it can determine whether to reuse based on the slice level, or it can determine whether to reuse based on the image level or the APS level. This application does not make specific limitations.
[0779] The syntax elements at the beginning of the title sequence have been modified as follows:
[0780] Here, regarding slice-level syntax elements, due to the more flexible reuse mechanism, compared to the conventional approach where the current slice can only parse one talf_reuse_idx to determine which set of historical filters the current slice reuses, in this embodiment, the current slice first determines how many sets of historical filters the current slice reuses by parsing num_talf_reuse_minus1.
[0781] When `talf_reuse_flag` is 1, it indicates that the current slice reuses historical filters, meaning that at least one set of historical filters is selected. At this point, `talf_reuse_index` is not parsed; instead, `num_talf_reuse_minus1` is further parsed. `num_talf_reuse_minus1` indicates that the number of historical filter groups reused in the current slice is reduced by one. Its value defaults to 0 when this syntax element is not present in the bitstream.
[0782] After parsing num_talf_reuse_minus1, further parsing (num_talf_reuse_minus1+1) talf_reuse_idx values is used to determine which groups of historical filters are selected by the current chip.
[0783] In the embodiments of this application, since the current chip can reuse multiple sets of historical filters, at the CTU level, it is necessary to determine which set to reuse based on the number of reused historical filter sets. For example, when the number of reused sets is greater than 1, it is necessary to further parse the syntax element talf_reuse_setId to determine which set to reuse.
[0784] The syntax elements of the coding tree block are modified as follows:
[0785] In conventional schemes, it is possible to determine whether the current CTU uses TALF and which filter it uses by directly encoding and decoding a talf_ctb_idc. However, in the embodiments of this application, talf_ctb_idc[CtbAddrX][CtbAddrY] is no longer parsed.
[0786] In the embodiments of this application, a talf_ctb_enabled flag is first decoded. When the flag is 1, it means that the current CTU uses TALF. When the flag is 0, it means that the current CTU does not use TALF. When the syntax element does not exist in the bitstream, its value is 0. Next, if the current slice reuses a historical filter and the number of reused groups is greater than 1 (i.e., num_talf_reuse_minus1>0), talf_reuse_setId is further decoded to determine which group of historical filters the current CTU reuses. Specifically, talf_reuse_setId is used to determine the reuse index talf_reuse_idx[talf_reuse_setId], and then the reuse index is used to determine the reused filter tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]]. If the current slice reuses a historical filter but only reuses one group, talf_reuse_setId is not parsed and its value is defaulted to 0. The reuse index is determined to be talf_reuse_idx[0]. Finally, based on the number of selected filters or the number of multiplexed filters, talf_ctb_filter_idx is parsed to determine the filters currently used by the CTU.
[0787] When reconstructing filter coefficients, if the current slice's sh_talf_enabled_flag is 1 and talf_reuse_flag is 0, the coefficient values, shift values, and nonlinear limit values of the time-domain adaptive loop filter need to be reconstructed.
[0788] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0789] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0790] {
[0791] for(j=0;j <numCoeff;j++)
[0792] {
[0793] tAlfCoeff[sfIdx][j]=(talf_coeff_sign[sfIdx][j]==1)?
[0794] -talf_coeff_abs[sfIdx][j]:talf_coeff_abs[sfIdx][j]
[0795] }
[0796] }
[0797] The process of obtaining the nonlinear tAlfClip value of the current slice is as follows:
[0798] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0799] clipTable[0] = 1 < <inputBitdepth
[0800] for(i=0;i<4;i++)
[0801] {
[0802] clipTable[i]=1<<((7-2*i+(inputBitdepth-8)))
[0803] }
[0804] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0805] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0806] {
[0807] for(j=0;j <numCoeff;j++)
[0808] {
[0809] tAlfClip[sfIdx][j]=clipTable[talf_clip_idx[sfIdx][j]]
[0810] }
[0811] }
[0812] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0813] shift = talf_shift_minus6 + 6
[0814] If the current slice's sh_talf_enabled_flag is 1 and talf_reuse_flag is 1, then the coefficient values, shift values, and nonlinear limit values need to be obtained from the FIFO of the historical time-domain adaptive loop filter.
[0815] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0816] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0817] {
[0818] for(j=0;j <numCoeff;j++)
[0819] {
[0820] tAlfCoeff[sfIdx][j]=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].coeff[sfIdx][j]
[0821] }
[0822] }
[0823] The process of obtaining the nonlinear tAlfClip value of the current slice is as follows:
[0824] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0825] clipTable[0] = 1 < <inputBitdepth
[0826] for(i=0;i<4;i++)
[0827] {
[0828] clipTable[i]=1<<((7-2*i+(inputBitdepth-8)))
[0829] }
[0830] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0831] filterCount=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].filterCount
[0832] for(sfIdx=0;sfIdx<=filterCount;sfIdx++)
[0833] {
[0834] for(j=0;j <numCoeff;j++)
[0835] {
[0836] tAlfClip[sfIdx][j]=
[0837] clipTable[tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].clipIdx[sfIdx][j]]
[0838] }
[0839] }
[0840] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0841] shift=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].shift
[0842] For example, in some embodiments, multiple historical filter banks and new filter banks can be introduced for filter selection. The CTU can more flexibly determine whether to reuse historical filters. When reusing filters, it determines which filter in which group of historical filters is selected; when not reusing filters, it determines which filter in the current filter bank is selected.
[0843] The syntax elements at the beginning of the title sequence have been modified as follows:
[0844] Here, regarding slice-level syntax elements, due to the more flexible multiplexing mechanism, compared to the conventional approach where only one `talf_reuse_idx` can be parsed for the current slice to determine which set of historical filters is multiplexed, in this embodiment, the current slice first determines how many sets of historical filters are multiplexed by parsing `num_talf_reuse_minus1`. When `talf_reuse_flag` is 1, it indicates that the current slice is multiplexing historical filters, meaning that at least one set of historical filters is selected. At this point, `talf_reuse_index` is not parsed; instead, `num_talf_reuse_minus1` is further parsed. `num_talf_reuse_minus1` indicates that the number of historical filter sets multiplexed by the current slice is reduced by one; its value defaults to 0 when this syntax element is not present in the bitstream. After parsing `num_talf_reuse_minus1`, (num_talf_reuse_minus1+1) `talf_reuse_idx` values are further parsed to determine which sets of historical filters are selected by the current slice.
[0845] In slice-level decoding, `talf_new_flag` indicates whether the current slice has a new set of filters to be encoded or decoded. If a new set of filters has been encoded, then the number of filters, coefficients, etc., are further encoded or decoded. However, in the prior art, a multiplexed filter and a new filter cannot be selected simultaneously at the slice level.
[0846] In the embodiments of this application, since the current chip can reuse multiple sets of historical filters, at the CTU level, it is necessary to determine which set to reuse based on the number of reused historical filter sets. For example, when the number of reused sets is greater than 1, it is necessary to further parse the syntax element talf_reuse_setId to determine which set to reuse.
[0847] The syntax elements of the coding tree block are modified as follows:
[0848] In the embodiments of this application, talf_ctb_idc[CtbAddrX][CtbAddrY] is no longer parsed.
[0849] In the embodiments of this application, a `talf_ctb_new_flag` is further introduced at the CTU level. `talf_ctb_new_flag` being 1 indicates that the current CTU uses the `talf_ctb_filter_idx`-th filter from a new set of filters decoded at the slice level to filter the current CTU; being 0 indicates that the `alf_ctb_filter_idx`-th filter from the `talf_reuse_idx[talf_reuse_setId]`-th group of historical filters is used to filter the current CTU. When both `talf_new_flag` and `talf_reuse_flag` at the slice level are 1, the encoding / decoding `talf_ctb_new_flag` flag is used; otherwise, if `talf_new_flag` is 1 and `talf_reuse_flag` is 0, `talf_ctb_new_flag` defaults to 1; otherwise, it defaults to 0.
[0850] When reconstructing filter coefficients, if the current slice's talf_ctb_enabled is 1 and talf_ctb_new_flag is 1, the coefficient values, shift values, and nonlinear limit values of the time-domain adaptive loop filter need to be reconstructed.
[0851] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0852] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0853] {
[0854] for(j=0;j <numCoeff;j++)
[0855] {
[0856] tAlfCoeff[sfIdx][j]=(talf_coeff_sign[sfIdx][j]==1)?
[0857] -talf_coeff_abs[sfIdx][j]:talf_coeff_abs[sfIdx][j]
[0858] }
[0859] }
[0860] The process of obtaining the nonlinear tAlfClip value of the current slice is as follows:
[0861] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0862] clipTable[0] = 1 < <inputBitdepth
[0863] for(i=0;i<4;i++)
[0864] {
[0865] clipTable[i]=1<<((7-2*i+(inputBitdepth-8)))
[0866] }
[0867] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0868] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0869] {
[0870] for(j=0;j <numCoeff;j++)
[0871] {
[0872] tAlfClip[sfIdx][j]=clipTable[talf_clip_idx[sfIdx][j]]
[0873] }
[0874] }
[0875] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0876] shift = talf_shift_minus6 + 6
[0877] If the current slice's talf_ctb_enabled is 1 and talf_ctb_new_flag is 0, then the coefficient values, shift values, and nonlinear limit values need to be obtained from the FIFO of the historical time-domain adaptive loop filter.
[0878] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0879] for(sfIdx=0;sfIdx<=talf_num_filters_signalled_minus1;sfIdx++)
[0880] {
[0881] for(j=0;j <numCoeff;j++)
[0882] {
[0883] tAlfCoeff[sfIdx][j]=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].coeff[sfIdx][j]
[0884] }
[0885] }
[0886] The process of obtaining the nonlinear tAlfClip value of the current slice is as follows:
[0887] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0888] clipTable[0] = 1 < <inputBitdepth
[0889] for(i=0;i<4;i++)
[0890] {
[0891] clipTable[i]=1<<((7-2*i+(inputBitdepth-8)))
[0892] }
[0893] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0894] filterCount=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].filterCount
[0895] for(sfIdx=0;sfIdx<=filterCount;sfIdx++)
[0896] {
[0897] for(j=0;j <numCoeff;j++)
[0898] {
[0899] tAlfClip[sfIdx][j]=
[0900] clipTable[tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].clipIdx[sfIdx][j]]
[0901] }
[0902] }
[0903] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0904] shift=tAlfParamPool[poolIdx][talf_reuse_idx[talf_reuse_setId]].shift
[0905] In summary, the encoding / decoding method proposed in this application, on the one hand, allows for the reuse of filter banks saved from multiple historical chips within a single TALF. For each CTU, the combination and number of available historical filters are greater than in conventional techniques, thus increasing the flexibility of the filtering process. On the other hand, in addition to allowing the reuse of filter banks from multiple historical chips, the current chip can select both historical and new filter banks simultaneously. For each CTU, the selection can also be made between the new and historical filter banks, further enhancing the flexibility of the filtering process.
[0906] This application proposes an encoding / decoding method, which is a scheme that introduces multiple historical filter banks for multiplexing. In this method, when it is determined that multiple historical filter banks can be multiplexed, multiple filter banks can be selected for multiplexing, and the historical filters to be multiplexed in the current block can be determined based on these multiple filter banks. In this way, for the current block, there are more historical filters to choose from when multiplexing historical filters, thereby improving the flexibility of the filtering process, achieving better filtering results, and improving encoding / decoding performance.
[0907] In another embodiment of this application, based on the same inventive concept as the foregoing embodiments, referring to FIG8, a schematic diagram of the composition structure of the encoder 50 proposed in this application embodiment is shown. As shown in FIG8, the encoder 50 may include: a first determining portion 501; wherein,
[0908] The first determining part 501 is configured to, when determining that multiple historical filter groups are to be reused, set filter group number identification information to indicate the reuse of multiple historical filter groups, and write the filter group number identification information into the bitstream; wherein, the filter group number identification information is used to determine the number of reused historical filter groups; determine multiple reused historical filter groups, and determine multiple first multiplexing index parameters based on the multiple reused historical filter groups, and write the multiple first multiplexing index parameters into the bitstream; determine the historical TALF information corresponding to the current block in the multiple historical filter groups; filter the current block based on the historical TALF information, and determine the filtered reconstructed value of the current block.
[0909] It should be noted that, in the embodiments of this application, encoder 50 can also be regarded as a data processing mode (or "entropy encoder"), used to encode the values of the syntax elements to be encoded.
[0910] Understandably, in the embodiments of this application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular component. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional module.
[0911] If the integrated unit is implemented as a software functional module and not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0912] Therefore, embodiments of this application provide a computer-readable storage medium applied to an encoder 50, wherein the computer-readable storage medium stores a computer program, which, when executed by a first processor, implements the encoding method described in any of the foregoing embodiments.
[0913] Based on the composition of encoder 50 and the computer-readable storage medium, see Figure 9, which shows a schematic diagram of the specific hardware structure of encoder 50 provided in this embodiment. As shown in Figure 9, encoder 50 may include: a first communication interface 502, a first memory 503, and a first processor 504; the various components are coupled together through a first bus system 505. It is understood that the first bus system 505 is used to realize the connection and communication between these components. In addition to a data bus, the first bus system 505 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the first bus system 505 in the figure.
[0914] The first communication interface 502 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
[0915] The first memory 503 is used to store computer programs that can run on the first processor 504;
[0916] The first processor 504, when running the computer program, performs the following: when it is determined that multiple historical filter banks are being reused, sets filter bank number identification information to indicate the reuse of multiple historical filter banks, and writes the filter bank number identification information into the bitstream; wherein the filter bank number identification information is used to determine the number of reused historical filter banks; determines the multiple reused historical filter banks, and determines multiple first multiplexing index parameters based on the multiple reused historical filter banks, and writes the multiple first multiplexing index parameters into the bitstream; determines the historical TALF information corresponding to the current block in the multiple historical filter banks; filters the current block based on the historical TALF information, and determines the filtered reconstructed value of the current block.
[0917] It is understood that the first memory 503 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The first memory 503 of the systems and methods described in this application is intended to include, but is not limited to, these and any other suitable types of memory.
[0918] The first processor 504 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the first processor 504 or by instructions in software form. The first processor 504 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the first memory 503. The first processor 504 reads the information in the first memory 503 and completes the steps of the above method in conjunction with its hardware.
[0919] It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or combinations thereof. For software implementation, the technology described in this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions described in this application. Software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0920] Alternatively, as another embodiment, the first processor 504 is further configured to execute any of the encoding methods described in the foregoing embodiments when running the computer program.
[0921] This embodiment provides an encoder that, when it is determined that multiple historical filter banks can be reused, selects multiple filter banks to be reused, and determines the historical filters to be reused in the current block based on these multiple filter banks. In this way, for the current block, there are more historical filters to choose from when reusing historical filters, thereby improving the flexibility of the filtering process, achieving better filtering results, and improving encoding and decoding performance.
[0922] In another embodiment of this application, based on the same inventive concept as the foregoing embodiments, referring to FIG10, a schematic diagram of the composition structure of the decoder 70 proposed in this application embodiment is shown. As shown in FIG10, the decoder 70 may include: a second determining portion 701; wherein,
[0923] The second determining part 701 is configured to decode the bitstream and determine filter group number identification information; wherein, the filter group number identification information is used to determine the number of multiplexed historical filter groups; if multiple historical filter groups are determined to be multiplexed based on the filter group number identification information, the bitstream is decoded, multiple first multiplexing index parameters are determined, and multiple multiplexed historical filter groups are determined based on the multiple first multiplexing index parameters; the historical TALF information corresponding to the current block is determined in the multiple historical filter groups; the current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block.
[0924] It should be noted that, in the embodiments of this application, the decoder 70 can also be regarded as a data processing mode (or "entropy decoder"), which is used to decode the values of the syntax elements to be decoded.
[0925] Understandably, in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular component. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional module.
[0926] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium applied to the decoder 70. The computer-readable storage medium stores a computer program, which, when executed by a second processor, implements the method described in any of the foregoing embodiments.
[0927] Based on the composition of decoder 70 and the computer-readable storage medium, Figure 11 illustrates a schematic diagram of the specific hardware structure of decoder 70 provided in this embodiment. As shown in Figure 11, decoder 70 may include: a second communication interface 702, a second memory 703, and a second processor 704; the various components are coupled together through a second bus system 705. It is understood that the second bus system 705 is used to realize the connection and communication between these components. In addition to a data bus, the second bus system 705 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the second bus system 705 in the figure.
[0928] The second communication interface 702 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
[0929] The second memory 703 is used to store computer programs that can run on the second processor 704;
[0930] The second processor 704, when running the computer program, performs the following actions: decoding the bitstream and determining filter group number identification information; wherein the filter group number identification information is used to determine the number of multiplexed historical filter groups; if multiple historical filter groups are determined to be multiplexed based on the filter group number identification information, decoding the bitstream, determining multiple first multiplexing index parameters, and determining multiple multiplexed historical filter groups based on the multiple first multiplexing index parameters; determining historical TALF information corresponding to the current block in the multiple historical filter groups; filtering the current block based on the historical TALF information, and determining the filtered reconstructed value of the current block.
[0931] Alternatively, as another embodiment, the second processor 704 is also configured to perform any of the methods described in the foregoing embodiments when running the computer program.
[0932] It is understood that the second memory 703 has similar hardware functions to the first memory 503, and the second processor 704 has similar hardware functions to the first processor 504; these will not be described in detail here.
[0933] This embodiment provides a decoder that, when it is determined that multiple historical filter banks can be reused, selects multiple filter banks to be reused, and determines the historical filters to be reused in the current block based on these multiple filter banks. In this way, for the current block, there are more historical filters to choose from when reusing historical filters, thereby improving the flexibility of the filtering process, achieving better filtering results, and improving encoding and decoding performance.
[0934] In another embodiment of this application, referring to FIG12, a schematic diagram of the composition structure of the encoding and decoding system proposed in this application is shown. As shown in FIG12, the encoding and decoding system 90 may include an encoder 50 and a decoder 70.
[0935] In the embodiments of this application, the encoder 50 may be any of the encoders described in the foregoing embodiments, and the decoder 70 may be any of the decoders described in the foregoing embodiments.
[0936] Furthermore, embodiments of this application also propose a bitstream, wherein the bitstream is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least: filter group number identifier information, filter enable identifier information, multiplexing identifier information, first multiplexing index parameter, second multiplexing index parameter, third multiplexing index parameter, first filter identifier information, and second filter identifier information.
[0937] Furthermore, this embodiment provides a computer-readable storage medium for storing a bitstream generated by any of the encoding methods in the foregoing embodiments.
[0938] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0939] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0940] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0941] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0942] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0943] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims. Industrial applicability
[0944] This application provides an encoding / decoding method, a bitstream, an encoder, a decoder, and a storage medium. At the decoding end, the bitstream is decoded to determine filter group number identification information. The filter group number identification information is used to determine the number of multiplexed historical filter groups. If multiple historical filter groups are determined to be multiplexed based on the filter group number identification information, the bitstream is decoded to determine multiple first multiplexing index parameters, and multiple multiplexed historical filter groups are determined based on these parameters. Historical TALF information corresponding to the current block is determined from among the multiple historical filter groups. The current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block. At the encoding end, when it is determined that multiple historical filter banks are to be reused, filter bank number identification information is set to indicate the reuse of multiple historical filter banks, and the filter bank number identification information is written into the bitstream; wherein, the filter bank number identification information is used to determine the number of reused historical filter banks; multiple reused historical filter banks are determined, and multiple first multiplexing index parameters are determined based on the multiple reused historical filter banks, and the multiple first multiplexing index parameters are written into the bitstream; the historical TALF information corresponding to the current block is determined in the multiple historical filter banks; the current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block. Therefore, this application proposes a scheme to introduce multiple historical filter banks for multiplexing, wherein, when it is determined that multiple reuse of multiple historical filter banks is supported, multiple reused filter banks can be selected, and the historical filters reused in the current block can be determined based on these multiple filter banks. In this way, for the current block, there are more historical filters to choose from when reusing historical filters, thereby improving the flexibility of the filtering process, achieving better filtering effects, and improving encoding and decoding performance.
Claims
1. A decoding method applied to a decoder, the method comprising: Decode the bitstream and determine the filter group number identifier information; wherein, the filter group number identifier information is used to determine the number of multiplexed historical filter groups; In the case where multiple historical filter banks are determined to be reused based on the filter bank number identification information, the bitstream is decoded, multiple first multiplexing index parameters are determined, and multiple historical filter banks are determined to be reused based on the multiple first multiplexing index parameters. Determine the historical TALF information corresponding to the current block from the plurality of historical filter banks; The current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block.
2. The method according to claim 1, wherein, Determining the historical TALF information corresponding to the current block from the plurality of historical filter banks includes: Decode the bitstream and determine the filter enable flag information corresponding to the current block; If it is determined that the current block uses TALF for filtering based on the filter enable flag information, the bitstream is decoded and the second multiplexing index parameter is determined. Based on the second multiplexing index parameter, the historical filter group corresponding to the current block is determined among the plurality of historical filter groups; Based on the historical filter bank corresponding to the current block, the historical TALF information corresponding to the current block is determined; wherein, the historical TALF information includes the historical filters multiplexed by the current block and the filter coefficients of the historical filters multiplexed by the current block.
3. The method according to claim 2, wherein, The step of determining the historical TALF information corresponding to the current block based on the historical filter bank corresponding to the current block includes: Decode the bitstream and determine the third multiplexing index parameters; Based on the third multiplexing index parameter, the historical filters and filter coefficients of the current block multiplexed are determined in the historical filter bank corresponding to the current block.
4. The method according to claim 1, wherein, The method further includes: If a historical filter group is determined to be reused based on the filter group number identification information, the bitstream is decoded and the first multiplexing index parameter is determined. The historical TALF information is determined based on the first reuse index parameter.
5. The method according to claim 4, wherein, Determining the historical TALF information based on the first reuse index parameter includes: The data unit index is determined based on the first reused index parameter; The historical filter group corresponding to the current block is determined based on the data unit index; Based on the historical filter bank corresponding to the current block, determine the historical TALF information corresponding to the current block.
6. The method according to any one of claims 1-5, wherein, The method further includes: Decode the bitstream and determine the first filter identification information; wherein, the first filter identification information is used to determine whether to decode the first filter group; When the decoding of the first filter group is determined based on the first filter identification information, the TALF information corresponding to the current block is determined; wherein, the TALF information corresponding to the current block includes the filtering mode, the number of filters in the first filter group, and the filter coefficients of the filters in the first filter group.
7. The method according to claim 6, wherein, The method further includes: Decode the bitstream and determine the second filter identification information; wherein, the second filter identification information is used to determine whether the current block uses the first filter group; If it is determined that the current block uses the first filter bank based on the second filter identification information, the current block is filtered based on the TALF information corresponding to the current block to determine the filtered reconstructed value of the current block.
8. The method according to claim 7, wherein, The method further includes: If it is determined based on the second filter identification information that the current block does not use the first filter bank, the historical TALF information corresponding to the current block is determined based on the filter bank number identification information; The current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block.
9. The method according to claim 8, wherein, The step of determining the historical TALF information corresponding to the current block based on the filter group number identifier information includes: If multiple historical filter banks are determined to be reused based on the filter bank number identification information, the bitstream is decoded and the second multiplexing index parameter is determined. Based on the second multiplexing index parameter, the historical filter group corresponding to the current block is determined among the plurality of historical filter groups; Based on the historical filter bank corresponding to the current block, determine the historical TALF information corresponding to the current block.
10. The method according to any one of claims 1-5, 7-9, wherein, The method further includes: If it is determined that the current image is filtered using TALF, decode the bitstream and determine the multiplexing identification information; When filtering is performed based on the multiplexing identification information to determine the multiplexing history TALF information, the filter group number identification information is determined.
11. The method according to claim 10, wherein, The method further includes: If the first filter bank is determined to be decoded based on the first filter identification information, or if the multiplexing history TALF information is determined to be filtered based on the multiplexing identification information, the bitstream is decoded and the filtering enable identification information corresponding to the current block is determined.
12. The method according to claim 11, wherein, The method further includes: If the current block is determined to use TALF for filtering based on the filter enable identifier information, and the first filter group is determined to be decoded based on the first filter identifier information, and the multiplexing historical TALF information is determined to be used for filtering based on the multiplexing identifier information, then the second filter identifier information is determined.
13. An encoding method applied to an encoder, the method comprising: When it is determined that multiple historical filter banks are to be reused, filter bank number identification information is set to indicate the reuse of multiple historical filter banks, and the filter bank number identification information is written into the bitstream; wherein, the filter bank number identification information is used to determine the number of historical filter banks reused; Multiple historical filter banks are determined for reuse, and multiple first multiplexing index parameters are determined based on the multiple historical filter banks for reuse, and the multiple first multiplexing index parameters are written into the bitstream; Determine the historical TALF information corresponding to the current block from the plurality of historical filter banks; The current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block.
14. The method according to claim 13, wherein, Determining the historical TALF information corresponding to the current block from the plurality of historical filter banks includes: If it is determined that the current block uses TALF for filtering, the filter enable flag information corresponding to the current block is set to indicate that the current block uses TALF for filtering, and the filter enable flag information is written into the bit stream; The historical filter group corresponding to the current block is determined from the plurality of historical filter groups, the second multiplexing index parameter is determined according to the historical filter group corresponding to the current block, and the second multiplexing index parameter is written into the bit stream; Based on the historical filter bank corresponding to the current block, the historical TALF information corresponding to the current block is determined; wherein, the historical TALF information includes the historical filters multiplexed by the current block and the filter coefficients of the historical filters multiplexed by the current block.
15. The method according to claim 14, wherein, The method further includes: The third multiplexing index parameter is determined based on the historical TALF information corresponding to the current block, and the third multiplexing index is written into the bitstream.
16. The method according to claim 13, wherein, The method further includes: If it is determined that a historical filter group is to be reused, filter group number identification information is set to indicate that a historical filter group is to be reused, and the filter group number identification information is written into the bit stream; A historical filter bank for multiplexing is determined, a first multiplexing index parameter is determined based on the historical filter bank for multiplexing, and the plurality of first multiplexing index parameters are written into the bit stream; The historical TALF information corresponding to the current block is determined in the historical filter group.
17. The method according to claim 16, wherein, Determining a first multiplexing index parameter based on a history filter bank of the multiplexing includes: Determine the data cell index corresponding to the historical filter group corresponding to the current block; The first reuse index parameter is determined based on the data unit index.
18. The method according to any one of claims 13-17, wherein, The method further includes: If the encoding of the first filter group is determined, the first filter identification information is set to indicate the encoding of the first filter group, and the first filter identification information is written into the bit stream; Determine the TALF information corresponding to the current block; wherein, the TALF information corresponding to the current block includes the filtering mode, the number of filters in the first filter bank, and the filter coefficients of the filters in the first filter bank.
19. The method according to claim 18, wherein, The method further includes: If it is determined that the current block uses the first filter group, a second filter identification information is set to indicate that the current block uses the first filter group, and the second filter identification information is written into the bit stream; The current block is filtered based on the TALF information corresponding to the current block to determine the filtered reconstructed value of the current block.
20. The method according to claim 19, wherein, The method further includes: If it is determined that the current block does not use the first filter bank, a second filter identification information is set to indicate the current... The block does not use the first filter bank and writes the second filter identification information into the bitstream; In the case of reusing multiple historical filter banks, the historical TALF information corresponding to the current block is determined; The current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block.
21. The method according to any one of claims 13-17, 19-20, wherein, The method further includes: If it is determined that the current image is filtered using TALF, determine whether to reuse historical TALF information for filtering; If it is determined that the historical TALF information is reused for filtering, the filter group number identifier information is written into the bitstream.
22. The method according to claim 21, wherein, The method further includes: If the first filter bank is determined to be encoded, or if the historical TALF information is determined to be reused for filtering, the filter enable flag information corresponding to the current block is written into the bit stream.
23. The method according to claim 22, wherein, The method further includes: If it is determined that the current block uses TALF for filtering, and the first filter group is encoded, and the historical TALF information is reused for filtering, the second filter identification information is written into the bitstream.
24. A bitstream, said bitstream being generated by bit encoding based on information to be encoded; wherein, The information to be encoded includes at least: filter group number identifier information, filter enable identifier information, multiplexing identifier information, first multiplexing index parameter, second multiplexing index parameter, third multiplexing index parameter, first filter identifier information, and second filter identifier information.
25. An encoder, the encoder comprising a first defining portion; wherein, The first determining part is configured to, when it is determined that multiple historical filter groups are to be reused, set filter group number identification information to indicate the reuse of multiple historical filter groups, and write the filter group number identification information into the bitstream; wherein, the filter group number identification information is used to determine the number of reused historical filter groups; determine the multiple reused historical filter groups, and determine multiple first multiplexing index parameters based on the multiple reused historical filter groups, and write the multiple first multiplexing index parameters into the bitstream; determine the historical TALF information corresponding to the current block in the multiple historical filter groups; filter the current block based on the historical TALF information, and determine the filtered reconstructed value of the current block.
26. An encoder, the encoder comprising a first memory and a first processor; wherein, A first memory for storing computer programs that can run on a first processor; A first processor is configured to, while running the computer program, perform the method as described in any one of claims 13-23.
27. A decoder, the decoder comprising a second deterministic portion; wherein, The second determination part is configured to decode the bitstream and determine filter group number identification information; wherein, the filter group number identification information is used to determine the number of multiplexed historical filter groups; if multiple historical filter groups are determined to be multiplexed based on the filter group number identification information, the bitstream is decoded, multiple first multiplexing index parameters are determined, and multiple multiplexed historical filter groups are determined based on the multiple first multiplexing index parameters; the historical TALF information corresponding to the current block is determined in the multiple historical filter groups; the current block is filtered based on the historical TALF information to determine the filtered reconstructed value of the current block.
28. A decoder, comprising a second memory and a second processor; wherein, The second memory is used to store computer programs that can run on the second processor; A second processor is configured to, while running the computer program, perform the method as described in any one of claims 1-12.
29. A computer-readable storage medium storing a computer program that, when executed, implements the decoding method as described in any one of claims 1-12, or the encoding method as described in any one of claims 13-23.
30. A computer-readable storage medium for storing a bitstream generated by the encoding method of any one of claims 13-23.
Citation Information
Patent Citations
A method and a device for picture encoding and decoding
CN110870319A
Adaptive loop filtering for video coding
CN117499679A
Rhombus-shaped sidewalk and driveway block
KR102771750B1
A method and a device for picture encoding and decoding
US20200169730A1