Coding method, decoding method, bitstream, coders, decoders and storage medium
By employing the Temporal Adaptive Loop Filtering (TALF) method in video coding and utilizing inter-frame reference image information, the problem of unsatisfactory filtering effects in existing technologies is solved, achieving more efficient encoding and decoding performance.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2024-07-05
- Publication Date
- 2026-05-21
AI Technical Summary
In existing video coding technologies, loop filters do not fully utilize the relevant information of the temporally reconstructed image, resulting in unsatisfactory filtering effects and reduced encoding and decoding performance.
The time-domain adaptive loop filter (TALF) method is adopted to select and reuse relevant information of historical TALF filters during the filtering process, thereby reducing codeword consumption and improving encoding and decoding performance.
By utilizing relevant information from inter-frame reference images, the filtering effect is improved, codeword consumption is reduced, and encoding/decoding performance is enhanced.
Smart Images

Figure CN2024103966_21052026_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-loop filters include deblocking filters (DBF), sample adaptive offset (SAO), adaptive loop filters (ALF), and cross component adaptive loop filters (CCALF).
[0003] However, common filtering techniques do not fully utilize the relevant information of the reconstructed image in the time domain, resulting in less than ideal filtering effects and reduced encoding and 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 reduce codeword consumption and improve 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] If it is determined that the current image is filtered using TALF, decode the bitstream and determine the multiplexing identification information;
[0009] When filtering is performed based on the multiplexing identifier information to determine the multiplexing history TALF information, the bitstream is decoded, the multiplexing index parameters are determined, and the history TALF information is determined according to the multiplexing index parameters.
[0010] The current image is filtered based on the historical TALF information to determine the filtered reconstructed value of the current image.
[0011] Secondly, embodiments of this application provide an encoding method applied to an encoder, the method comprising:
[0012] When filtering the current image using TALF, determine the cost of using historical TALF information for filtering and the cost of not using historical TALF information for filtering.
[0013] Based on the cost of filtering using the reused historical TALF information and the cost of filtering without reusing the historical TALF information, 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;
[0014] If it is determined that the historical TALF information is reused for filtering, the reuse index parameter is determined and the reuse index parameter is written into the bitstream.
[0015] 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 one or more of the following: first syntax element identification information, multiplexing identification information, multiplexing index parameters, filtering mode, number of filter groups, and filter coefficients of candidate filters.
[0016] Fourthly, embodiments of this application provide an encoder, the encoder including a first determining unit; wherein,
[0017] The first determining unit is configured to, when filtering the current image using TALF, determine the cost of filtering using historical TALF information and the cost of filtering without reusing historical TALF information; determine reuse identifier information based on the cost of filtering using historical TALF information and the cost of filtering without reusing historical TALF information, and write the reuse identifier information into the bitstream; wherein, the reuse identifier information is used to determine whether to reuse historical TALF information for filtering; if it is determined that historical TALF information should be reused for filtering, determine reuse index parameters and write the reuse index parameters into the bitstream.
[0018] Fifthly, embodiments of this application provide an encoder, which includes a first memory and a first processor; wherein,
[0019] The first memory is used to store computer programs that can run on the first processor;
[0020] The first processor is configured to execute the encoding method described above when running the computer program.
[0021] Sixthly, embodiments of this application provide a decoder, which includes a second determining unit; wherein,
[0022] The second determining unit is configured to, when determining that the current image is filtered using TALF, decode the bitstream and determine multiplexing identifier information; when determining that multiplexing historical TALF information is used for filtering based on the multiplexing identifier information, decode the bitstream, determine multiplexing index parameters, and determine historical TALF information based on the multiplexing index parameters; filter the current image based on the historical TALF information, and determine the filtered reconstructed value of the current image.
[0023] In a seventh aspect, embodiments of this application provide a decoder, which includes a second memory and a second processor; wherein,
[0024] The second memory is used to store computer programs that can run on the second processor;
[0025] The second processor is configured to execute the decoding method described above when running the computer program.
[0026] 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.
[0027] 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.
[0028] This application provides an encoding / decoding method, a bitstream, an encoder, a decoder, and a storage medium. At the decoding end, when it is determined that the current image will be filtered using TALF, the bitstream is decoded to determine multiplexing identifier information. When it is determined that historical TALF information will be reused for filtering based on the multiplexing identifier information, the bitstream is decoded to determine multiplexing index parameters, and historical TALF information is determined based on the multiplexing index parameters. The current image is then filtered based on the historical TALF information to determine the reconstructed value of the current image after filtering. At the encoding end, when the current image is filtered using TALF, the cost of using historical TALF information for filtering and the cost of not using historical TALF information for filtering are determined. Multiplexing identifier information is determined based on the cost of using historical TALF information for filtering and the cost of not using historical TALF information for filtering, and the multiplexing identifier information is written into the bitstream. The multiplexing identifier information is used to determine whether historical TALF information is reused for filtering. When it is determined that historical TALF information is reused for filtering, the multiplexing index parameters are determined and written into the bitstream. Therefore, the embodiments of this application propose a time-domain adaptive loop filtering method. In the TALF filtering process, relevant information of recorded and stored historical TALF filters can be reused, thereby reducing codeword consumption and improving encoding and decoding performance. Attached Figure Description
[0029] Figure 1 is a schematic diagram of the application of a coding framework provided by related technologies;
[0030] Figure 2 is a schematic diagram of the application of a loop filter module provided by related technologies;
[0031] Figure 3 is a schematic diagram of the shape of a common brightness adaptive loop filter;
[0032] Figure 4 is a schematic diagram of the shape of a common chromaticity adaptive loop filter.
[0033] Figure 5 is a schematic diagram of the loop filtering implementation process;
[0034] Figure 6 is a schematic diagram of the shape of the cross-component adaptive filter;
[0035] Figure 7 shows the relationship between encoding / decoding and playback order under one RA configuration;
[0036] Figure 8 is a system block diagram of an encoder provided in an embodiment of this application;
[0037] Figure 9 is a system block diagram of a decoder provided in an embodiment of this application;
[0038] Figure 10 is a schematic diagram of the decoding method proposed in an embodiment of this application;
[0039] Figure 11 is a schematic diagram of the implementation of TALF filtering proposed in an embodiment of this application;
[0040] Figure 12 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application;
[0041] Figure 13 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application;
[0042] Figure 14 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application;
[0043] Figure 15 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application;
[0044] Figure 16 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application;
[0045] Figure 17 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application;
[0046] Figure 18 is a schematic diagram of the filter proposed in an embodiment of this application;
[0047] Figure 19 is a schematic diagram of the filter proposed in the embodiment of this application;
[0048] Figure 20 is a schematic diagram of the filter proposed in the embodiment of this application;
[0049] Figure 21 is a schematic diagram of the filter proposed in the embodiment of this application;
[0050] Figure 22 is a schematic diagram of the filter proposed in the embodiment of this application;
[0051] Figure 23 is a schematic diagram of the filter proposed in the embodiment of this application;
[0052] Figure 24 is a schematic diagram of the filter proposed in the embodiment of this application;
[0053] Figure 25 is a schematic diagram of the encoding method proposed in the embodiments of this application;
[0054] Figure 26 is a schematic diagram of a time-domain adaptive loop filter for storing history proposed in an embodiment of this application;
[0055] Figure 27 is a schematic diagram of the time-domain adaptive loop filter for storing history proposed in an embodiment of this application;
[0056] Figure 28 is a schematic diagram of the time-domain adaptive loop filter for storing history proposed in an embodiment of this application;
[0057] Figure 29 is a schematic diagram of the filter proposed in the embodiment of this application;
[0058] Figure 30 is a schematic diagram nine of the filter proposed in the embodiments of this application;
[0059] Figure 31 is a schematic diagram of the encoder structure proposed in the embodiment of this application;
[0060] Figure 32 is a schematic diagram of the specific hardware structure of the encoder proposed in the embodiment of this application;
[0061] Figure 33 is a schematic diagram of the composition structure of the decoder proposed in the embodiment of this application;
[0062] Figure 34 is a schematic diagram of the specific hardware structure of the decoder proposed in the embodiment of this application;
[0063] Figure 35 is a schematic diagram of the composition structure of the encoding and decoding system proposed in the embodiment of this application. Detailed Implementation
[0064] 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.
[0065] 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.
[0066] 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.
[0067] 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.
[0068] 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.
[0069] 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.
[0070] 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 perceptible 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.
[0071] 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 Enhanced Compression Model (ECM), loop filtering further includes cross component sample adaptive offset (CCSAO) and bilateral filter (BIF). For example, Figure 2 shows an application diagram of a loop filtering module provided by related technologies. The block diagram of ECM loop filtering is shown in Figure 2.
[0072] 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.
[0073] Adaptive loop filtering in VVC can be applied to both luminance and chrominance components. Figure 3 shows a schematic diagram of a common luminance adaptive loop filter, where the filter for the luminance component is a 7x7 diamond-shaped filter with symmetrical coefficients. Figure 4 shows a schematic diagram of a common chrominance adaptive loop filter, where the filter for the chrominance component is a 5x5 diamond-shaped filter with symmetrical coefficients.
[0074] In VVC, the adaptive loop filter for luminance and chrominance uses the reconstructed sample under the filter window as the input value. After multiplying with each coefficient of the adaptive filter and then summing them, a correction value for the center position of the filter is generated. The correction value is added to the reconstructed value at the center position to obtain the filtered value.
[0075] In ECM, adaptive loop filtering offers more refined processing. ECM's adaptive loop filtering has more coefficients, and the filter's input values are no longer limited to the current reconstructed value; they can also include residual values, reconstructed values before deblocking filtering, reconstructed values after deblocking filtering, reconstructed values after Gaussian filtering, and so on. The inputs to adaptive loop filtering in ECM have mostly undergone some pre-filtering, eliminating the need for the extensive transmission of adaptive coefficients through the bitstream as before.
[0076] For example, in VVC, the cross-component adaptive filtering is an 8-coefficient filter that applies only to the chroma component. Cross-component adaptive filtering uses the reconstructed luminance value as input to the filter, which, along with the filter coefficients, produces a correction value added to the chroma component to improve the subjective and objective quality of the chroma. In ECM, the number of filter coefficients is further increased to achieve higher filtering efficiency. Simultaneously, the luminance residual and the reconstructed chroma value are also used as inputs to the cross-component adaptive filter.
[0077] Figure 5 is a schematic diagram of the loop filtering process. As shown in Figure 5, CCALF can take the reconstructed brightness information and residual information (l0) as input. Therefore, CCALF takes the brightness reconstruction information and brightness residual information output by SAO as input, calculates the filter coefficients, performs filtering processing, and obtains the filtering result. or In addition, the chroma ALF itself also filters the chroma reconstruction information output by SAO, obtaining the corresponding filtered results. Finally, the filtered results of CCALF are... or The final chroma filtering result can be obtained by adding the filtering results of ALF and chroma.
[0078] Figure 6 is a schematic diagram of the cross-component adaptive filter shape. As shown in Figure 6, luminance information (luminance samples) can be used to minimize the error between the chroma reconstructed image and the original image, thereby completing the correction of the chroma samples.
[0079] Video encoding and decoding typically include several mainstream configurations: All Intra (AI), Random Access (RA), and Low Delay (LD). In AI, all video frames use intra-frame coding. In RA, several inter-frame coded frames are interspersed between every two intra-frame coded frames, depending on the settings. In LD, all frames except the first intra-frame are inter-frame coded. In AI and LD configurations, the encoding / decoding order matches the playback order, while in RA, the encoding / decoding order may differ from the playback order.
[0080] For example, Figure 7 illustrates the relationship between encoding / decoding and playback order under one RA configuration. As shown in Figure 7, the actual RA encoding / decoding order is not based on the order of the variable (Picture order count, POC) used to determine the video playback order. For instance, under the current ECM CTC test conditions, the relationship between the RA encoding / decoding order, POC value, and temporal ID (TID) is shown in Table 1 below:
[0081] Table 1
[0082] Inter-coded frames with larger TIDs have more usable reference images and are often easier to compress. Therefore, the higher the TID, the larger the quantization parameter used, and the lower the bitrate may be.
[0083] An adaptive parameter set (APS) is an image layer-level parameter set used to transmit adaptive parameters. The APS syntax element table in VVC is as follows:
[0084] The APS parameter set includes several syntax elements. `aps_adaptation_parameter_set_id` is used to assign an index to the currently decoded APS set, and `aps_params_type` indicates the type of the APS parameter set. In VVC, it can be a parameter set encoding ALF adaptive parameters, a parameter set for Luma Mapping with Chroma Scaling (LMCS) filters, or a SCALING parameter set. When the APS is an ALF type parameter set, it will further parse data such as the number of ALF filters and filter parameters.
[0085] Common filtering techniques do not fully utilize the relevant information of the reconstructed image in the temporal domain, resulting in less than ideal filtering effects and reduced encoding / decoding performance. To address this, this application proposes the TALF scheme, which can fully utilize the relevant information of inter-frame reference images, thereby improving the filtering effect.
[0086] Furthermore, embodiments of this application provide an encoding / decoding method, a bitstream, an encoder, a decoder, and a storage medium. During the TALF filtering process, relevant information of recorded and stored historical TALF filters can be reused, thereby reducing codeword consumption and improving encoding / decoding performance.
[0087] Referring to Figure 8, which shows an example of a system block diagram of an encoder provided in an embodiment of this application. As shown in Figure 8, 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 consisting 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.
[0088] 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.
[0089] 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.
[0090] 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.
[0091] 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.
[0092] 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 9.
[0093] Referring to Figure 9, it shows an example of a system block diagram of a decoder provided in an embodiment of this application. As shown in Figure 9, 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.
[0094] 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.
[0095] 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.
[0096] 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.
[0097] 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.
[0098] 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.
[0099] 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.
[0100] 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.
[0101] 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 8.
[0102] 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").
[0103] Based on Figure 7, the encoding method in this embodiment is mainly applied to the "filtering unit 113" part of the encoder 10.
[0104] Based on Figure 8, the decoding method in this embodiment is mainly applied to the "filtering unit 208" part of the decoder 20.
[0105] 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.
[0106] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0107] One embodiment of this application proposes a decoding method, which is applied to a decoder for performing filtering processing through a TALF filter. Figure 10 is a schematic diagram of the decoding method proposed in this application embodiment. As shown in Figure 10, the decoding method of the decoder may include the following steps:
[0108] Step 1001: If it is determined that the current image is filtered using TALF, decode the bitstream and determine the multiplexing identification information.
[0109] 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.
[0110] 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.
[0111] 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.
[0112] 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.
[0113] 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.
[0114] 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.
[0115] 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.
[0116] 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.
[0117] 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.
[0118] 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.
[0119] 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.
[0120] Of course, the value of talf_reuse_flag is not limited to 0 and 1, and this application does not impose specific restrictions.
[0121] For example, in some embodiments, the slice-level syntax element is parsed as follows:
[0122] 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; if the flag is 0, it indicates that it is not reused. When this syntax element does not exist in the bitstream, its default value can be 0.
[0123] Therefore, in the embodiments of this application, for TALF filtering, an adaptive loop filter that reuses the history can be introduced by reusing the identification information, thereby saving the extra codeword consumption caused by encoding and decoding new filter coefficients (filter coefficients).
[0124] Furthermore, in the embodiments of this application, the bitstream can also be decoded to determine the first syntax element identification information.
[0125] In embodiments of this application, decoding the bitstream can determine the first syntax element identification information. This first syntax element identification information can be used to determine whether the current block in the current image is filtered using TALF; that is, based on the first syntax element identification information, it can be determined whether a TALF filter is used to filter the reconstructed values of the image components of the current block.
[0126] 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.
[0127] 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.
[0128] Furthermore, in the embodiments of this application, the first syntax element identification information can be used to determine whether to use TALF to filter the current block. The first syntax element identification information can be a flag, wherein if the current block is a CTU corresponding to the current image, then the first syntax element identification information can be a CTU-level flag; if the current block is a CU corresponding to the current image, then the first syntax element identification information can be a CU-level flag. Of course, corresponding to any size sub-region in the current image, the first syntax element identification information can also be a flag of other block levels. This application does not impose specific limitations.
[0129] Furthermore, in the embodiments of this application, the value of the first syntax element identifier information can be used to determine whether to use TALF filtering on the current block.
[0130] 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 on the current block. If the value of the first syntax element identifier information is not a first value, it is determined that TALF filtering will be used on the current block.
[0131] It should be noted that, in the embodiments of this application, the first syntax element identification information can be used to indicate whether the current block uses TALF for filtering. Furthermore, the first value can be in parameter form or numeric form; no limitation is made here.
[0132] For example, in some embodiments, if the first syntax element identification information is a block-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.
[0133] 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 the current block does not use TALF for filtering. Otherwise, if the value of the first syntax element identifier information is not 0, then it can be determined that the current block uses TALF for filtering.
[0134] For example, in some embodiments, if the current block of the current image is a CTU, then the first syntax element identification information can be CTU-level syntax. For instance, the first syntax element identification information can be represented by the syntax element control identifier talf_ctb_idc[CtbAddrX][CtbAddrY], that is, talf_ctb_idc[CtbAddrX][CtbAddrY] indicates whether to use TALF filtering on the current block of the current image. If the value of talf_ctb_idc[CtbAddrX][CtbAddrY] is 0, it is determined that TALF filtering is not used on the current block; if the value of talf_ctb_idc[CtbAddrX][CtbAddrY] is not 0, it is determined that TALF filtering is used on the current block. Of course, the value of talf_ctb_idc[CtbAddrX][CtbAddrY] is not limited to 0, and this application does not impose specific limitations.
[0135] Furthermore, in the embodiments of this application, the bitstream can be decoded first to determine the second syntax element identification information; if it is determined based on the second syntax element identification information that the current image is allowed to use TALF for filtering, the process of determining the first syntax element identification information is executed, that is, the process of parsing the first syntax element identification information is executed.
[0136] Furthermore, in embodiments of this application, the second syntax element identification information can be used to determine whether the current image is allowed to be filtered using TALF. The second syntax element identification information can be a flag.
[0137] It should be noted that, in the embodiments of this application, the second syntax element identification information can be an image-level flag, a slice-level flag, a sub-picture-level flag, or a tile-level flag. This application does not impose any specific limitations.
[0138] For example, in some embodiments, if the second syntax element identification information is a slice-level flag, then the second syntax element identification information can be used to determine whether the current slice is allowed to use TALF for filtering.
[0139] Furthermore, in the embodiments of this application, the value of the second syntax element identifier information can be used to determine whether the current image (and / or the current slice) is allowed to use TALF for filtering.
[0140] For example, in some embodiments, if the value of the second syntax element identifier information is a second value, it is determined that the current image (and / or the current slice) is allowed to be filtered using TALF. If the value of the second syntax element identifier information is a third value, it is determined that the current image (and / or the current slice) is not filtered using TALF.
[0141] It should be noted that, in the embodiments of this application, the second syntax element identification information can be used to indicate whether the current image (and / or the current slice) is filtered using TALF. Furthermore, the second value and the third value are different, and the second and third values can be in parameter form or in numerical form. Typically, the second syntax element identification information can be a parameter written in the Slice header or picture header; no limitations are imposed here.
[0142] It should also be noted that if the second syntax element identifier is an image-level flag or a slice-level flag, then in one specific example, the second value can be set to 1 and the third value can be set to 0; in another specific example, the second value can also be set to true and the third value can also be set to false; even in yet another specific example, the second value can also be set to 0 and the third value can also be set to 1; or, the second value can also be set to false and the third value can also be set to true. The second and third values are not limited in any way in the embodiments of this application.
[0143] Assuming the second syntax element identifier is an image-level flag, with a second value of 1 and a third value of 0 as an example, in this embodiment, if the value of the second syntax element identifier is 1, it can be determined that the current image uses TALF filtering. Otherwise, if the value of the second syntax element identifier is 0, it can be determined that the current image does not use TALF filtering.
[0144] For example, in some embodiments, assuming the second syntax element identification information is an image-level flag, then the second syntax element identification information can be represented by the syntax element ph_talf_enabled_flag, that is, ph_talf_enabled_flag indicates whether the current image is allowed to use TALF filtering. If the value of ph_talf_enabled_flag is 0, it is determined that TALF filtering is not used on the current image; if the value of ph_talf_enabled_flag is 1, it is determined that TALF filtering is allowed on the current image.
[0145] For example, in some embodiments, assuming the second syntax element identification information is a slice-level flag, the second syntax element identification information can be represented by the syntax element sh_talf_enabled_flag, that is, sh_talf_enabled_flag indicates whether the current slice is allowed to use TALF filtering. If the value of sh_talf_enabled_flag is 0, it is determined that TALF filtering is not used for the current slice; if the value of sh_talf_enabled_flag is 1, it is determined that TALF filtering is allowed for the current slice.
[0146] Of course, the value of sh_talf_enabled_flag is not limited to 0 and 1, and this application does not impose specific restrictions.
[0147] Therefore, in the embodiments of this application, the parsing of the first syntax element identifier information may depend on the second syntax element identifier information. That is, the block-level identifier may depend on the image-level identifier, or the block-level identifier may depend on the slice-level identifier. For example, if it is determined that the current image (and / or the current slice) is filtered using TALF based on the second syntax element identifier information, the determination of the first syntax element identifier information can be further performed; otherwise, it is not necessary to decode the first syntax element identifier information.
[0148] For example, in some embodiments, the image-level TALF identifier (second syntax element identification information) and the corresponding APS index are encoded in the image header as follows:
[0149] Among them, ph_talf_enabled_flag is used to indicate whether the current image is filtered using TALF, and ph_talf_aps_id can be used to indicate which APS parameter set the adaptive parameters of TALF (such as the number of filters and filter coefficients) are obtained when using TALF.
[0150] Furthermore, in the embodiments of this application, the bitstream can be decoded first to determine the third syntax element identification information; if it is determined based on the third syntax element identification information that the current sequence is filtered using TALF, the process of determining the second syntax element identification information is executed.
[0151] Furthermore, in embodiments of this application, the third syntax element identification information can be used to determine whether to apply TALF filtering to the current sequence. The third syntax element identification information can be a flag, for example, a sequence-level flag.
[0152] Furthermore, in the embodiments of this application, the value of the third syntax element identifier information can be used to determine whether to use TALF filtering on the current sequence.
[0153] For example, in some embodiments, if the value of the third syntax element identifier information is a fourth value, it is determined that TALF filtering should be applied to the current sequence. If the value of the third syntax element identifier information is a fifth value, it is determined that TALF filtering should not be applied to the current sequence.
[0154] It should be noted that, in the embodiments of this application, the third syntax element identification information can be used to indicate whether the current sequence is filtered using TALF. Furthermore, the fourth and fifth values are different, and both can be in parameter form or numerical form; no limitation is made here.
[0155] It should also be noted that if the third syntax element identifier is a sequence-level flag, then in one specific example, the fourth value can be set to 1 and the fifth value can be set to 0; in another specific example, the fourth value can also be set to true and the fifth value can also be set to false; even in yet another specific example, the fourth value can also be set to 0 and the fifth value can also be set to 1; or, the fourth value can also be set to false and the fifth value can also be set to true. The fourth and fifth values are not limited in any way in the embodiments of this application.
[0156] Assuming the third syntax element identifier is a sequence-level flag, with the fourth value being 1 and the fifth value being 0, in this embodiment, if the value of the third syntax element identifier is 1, then it can be determined that the current sequence uses TALF filtering. Otherwise, if the value of the third syntax element identifier is 0, then it can be determined that the current sequence does not use TALF filtering.
[0157] For example, in some embodiments, assuming the third syntax element identification information is a sequence-level flag, the third syntax element identification information can be represented by the syntax element `sps_talf_enabled_flag`, that is, `sps_talf_enabled_flag` indicates whether to use TALF filtering on the current sequence. If the value of `sps_talf_enabled_flag` is 0, it is determined that TALF filtering is not used on the current sequence; if the value of `sps_talf_enabled_flag` is 1, it is determined that TALF filtering is used on the current sequence.
[0158] Of course, the value of sps_talf_enabled_flag is not limited to 0 and 1, and this application does not impose specific restrictions.
[0159] Therefore, in the embodiments of this application, the parsing of the second syntax element identifier information may depend on the third syntax element identifier information; that is, the image-level (and / or slice-level) identifier may depend on the sequence-level identifier. For example, if it is determined that the current sequence is to be filtered using TALF based on the third syntax element identifier information, the determination of the second syntax element identifier information can be further performed; otherwise, it is not necessary to decode the second syntax element identifier information.
[0160] In other words, in the embodiments of this application, TALF may include a sequence-level enable flag, i.e., third syntax element identification information. For example, adding a TALF sequence-level flag to standard text can be done as follows:
[0161] Among them, sps_talf_enabled_flag is used to indicate whether the current sequence is filtered using TALF, and sps_alf_enabled_flag is used to indicate whether the current sequence is filtered using ALF.
[0162] Furthermore, in the embodiments of this application, the sequence-level TALF identifier may depend on the sequence-level ALF identifier, that is, the parsing of the third syntax element identifier information may be dependent on the parsing of the sequence-level syntax elements of ALF.
[0163] For example, in some embodiments, it is assumed that the sequence-level ALF flag can be represented by the syntax element `sps_alf_enabled_flag`, that is, `sps_alf_enabled_flag` indicates whether ALF filtering is applied to the current sequence. If `sps_alf_enabled_flag` indicates that ALF filtering is not applied to the current sequence, then the third syntax element flag information can be left undecoded; if `sps_alf_enabled_flag` indicates that ALF filtering is applied to the current sequence, then the determination of the third syntax element flag information can be further performed.
[0164] For example, in some embodiments, the TALF sequence-level identifier (third syntax element identifier information) may depend on the ALF image-level identifier (image-level ALF identifier), and the dependency relationship may be as follows:
[0165] Among them, sps_talf_enabled_flag is used to indicate whether the current sequence is filtered using TALF, and sps_alf_enabled_flag is used to indicate whether the current sequence is filtered using ALF. Only when the current sequence is allowed to use ALF, that is, when sps_alf_enabled_flag indicates that ALF is used to filter the current sequence, can sps_talf_enabled_flag be further parsed.
[0166] Furthermore, in embodiments of this application, the image-level (and / or slice-level) identifier depends on the sequence-level identifier, which may include the image-level (and / or slice-level) TALF identifier depending on the sequence-level TALF identifier, and may also include the image-level (and / or slice-level) TALF identifier depending on the sequence-level ALF identifier.
[0167] In other words, in the embodiments of this application, the parsing of the second syntax element identification information may depend on the third syntax element identification information or on the sequence-level ALF identifier.
[0168] For example, in some embodiments, it is assumed that the sequence-level ALF flag can be represented by the syntax element `sps_alf_enabled_flag`, that is, `sps_alf_enabled_flag` indicates whether ALF filtering is applied to the current sequence. If `sps_alf_enabled_flag` indicates that ALF filtering is not applied to the current sequence, then the second syntax element flag information can be left undecoded; if `sps_alf_enabled_flag` indicates that ALF filtering is applied to the current sequence, then the determination of the second syntax element flag information can be further performed.
[0169] For example, in some embodiments, the TALF image-level identifier (image-level TALF identifier) may depend on the ALF sequence-level identifier (sequence-level ALF identifier), and the dependency relationship may be as follows:
[0170] Among them, sps_talf_enabled_flag is used to indicate whether the current sequence uses TALF for filtering, sps_alf_enabled_flag is used to indicate whether the current sequence uses ALF for filtering, ph_talf_enabled_flag is used to indicate whether the current image uses TALF for filtering, and ph_talf_aps_id can be used to indicate which APS parameter set the adaptive parameters of TALF (such as the number of filters, filter coefficients) are obtained when using TALF.
[0171] Furthermore, in embodiments of this application, the image-level (and / or slice-level) TALF identifier may also depend on the image-level (and / or slice-level) ALF identifier.
[0172] In other words, in the embodiments of this application, the parsing of the second syntax element identification information can also rely on image-level (and / or slice-level) ALF identification.
[0173] For example, in some embodiments, it is assumed that the image-level ALF flag can be represented by the syntax element ph_alf_enabled_flag, that is, ph_alf_enabled_flag indicates whether the current image is allowed to be filtered using ALF. If ph_alf_enabled_flag indicates that the current image is not to be filtered using ALF, then the second syntax element flag information can be left undecoded; if ph_alf_enabled_flag indicates that the current image is allowed to be filtered using ALF, then the determination of the second syntax element flag information can be further performed.
[0174] For example, in some embodiments, the TALF image-level identifier (image-level TALF identifier) may depend on the ALF image-level identifier (image-level ALF identifier), and the dependency relationship may be as follows:
[0175] Among them, sps_talf_enabled_flag is used to indicate whether the current sequence is filtered using TALF, ph_alf_enabled_flag is used to indicate whether the current image is filtered using ALF, ph_talf_enabled_flag is used to indicate whether the current image is filtered using TALF, and ph_talf_aps_id can be used to indicate which APS parameter set the adaptive parameters of TALF (such as the number of filters, filter coefficients) are obtained when using TALF.
[0176] For example, in some embodiments, the image-level (and / or slice-level) TALF identifier may also rely on some high-level syntax, such as the high-level syntax element pps_alf_info_in_ph_flag to identify the image-level or slice-level control identifier that uses image-level or slice-level syntax elements to parse the ALF, and the ALF identifier may also exist in the slice header.
[0177] For example, in some embodiments, the TALF slice-level identifier (slice-level TALF identifier) may depend on the TALF control identifier, and the dependency relationship may be as follows:
[0178] Among them, sps_talf_enabled_flag is used to indicate whether the current sequence uses TALF for filtering, pps_alf_info_in_ph_flag is used to indicate whether to use image-level or slice-level syntax elements to parse ALF image-level or slice-level control flags, sh_talf_enabled_flag is used to indicate whether the current slice uses TALF for filtering, and sh_talf_aps_id can be used to indicate which APS parameter set the adaptive parameters of TALF (such as the number of filters, filter coefficients) are obtained when using TALF.
[0179] Step 1002: When filtering based on the multiplexing identifier information to determine the multiplexing history TALF information, decode the bitstream, determine the multiplexing index parameters, and determine the history TALF information according to the multiplexing index parameters.
[0180] Step 1003: Filter the current image based on historical TALF information to determine the reconstructed value of the current image after filtering.
[0181] In the embodiments of this application, if filtering is performed based on the reuse identification information to determine the reuse history TALF information, after determining the reuse index parameters and determining the history TALF information based on the reuse index parameters, the current image can be further filtered based on the history TALF information to determine the filtered reconstructed value of the current image.
[0182] In the embodiments of this application, after determining the multiplexing identifier information, if the multiplexing historical TALF information is determined based on the multiplexing identifier information for filtering, the bitstream can be further decoded to determine the multiplexing index parameters. Then, the historical TALF information can be determined based on the multiplexing index parameters. Finally, the current image can be filtered based on the historical TALF information to determine the filtered reconstructed value of the current image.
[0183] It is understood that, in the embodiments of this application, the reused index parameter can be used to determine the data unit that records and stores historical TALF information. The data unit that records and stores historical TALF information can be a storage structure or storage element in the candidate historical dataset, and this application does not impose specific limitations on it.
[0184] In other words, in the embodiments of this application, the historical TALF information to be reused can be indicated by the reuse index parameter.
[0185] It is understood that, in the embodiments of this application, the determination of whether to reuse historical time-domain adaptive loop filters (historical TALF information) is made by parsing the obtained multiplexing identifier information. If reused, a multiplexing index (multiplexing index parameter) can be parsed to indicate which historical TALF information is being reused.
[0186] Furthermore, in the embodiments of this application, after determining the reuse identifier information, if it is determined based on the reuse identifier information that historical TALF information should not be reused for filtering, then the parsing of the reuse index parameter can be skipped, and the TALF information corresponding to the current image (or current slice) can be directly determined; then the candidate historical dataset is updated based on the TALF information corresponding to the current image (or current slice).
[0187] It is understood that, in the embodiments of this application, the determination of whether to reuse the historical time-domain adaptive loop filter (historical TALF information) is made by parsing the obtained reuse identifier information. If it is not reused, the filter and its coefficients of the current image are further parsed, that is, the TALF information corresponding to the current image is determined. Then, the candidate historical dataset can be updated using the TALF information corresponding to the current image, for example, the TALF information corresponding to the current image can be stored in the candidate historical dataset.
[0188] It should be noted that, in the embodiments of this application, the candidate historical dataset may include one or more historical datasets. That is, this application does not specifically limit the number of datasets that record and store historical TALF information.
[0189] 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.
[0190] It is understood that, in the embodiments of this application, assuming that the candidate historical dataset is a FIFO, the method of 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.
[0191] 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.
[0192] 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.
[0193] 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.
[0194] 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.
[0195] Of course, the length of the FIFO can be any integer value greater than 0, and is not limited to 8.
[0196] Therefore, in the embodiments of this application, when the current image (or current slice) uses TALF, it is necessary to additionally encode and decode an identifier to indicate whether to reuse the TALFs (historical TALF information) of other images (or slices) in the FIFO. If reused, the index of the FIFO is further encoded and decoded to determine the TALFs to be reused. Otherwise, the adaptive temporal filtering parameters obtained from the current image are encoded and decoded, and the FIFO is updated.
[0197] It is understood that in the embodiments of this application, the reuse 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. The value of talf_reuse_idx can be determined based on the storage length of the candidate historical dataset. For example, assuming that the maximum length of the FIFO is 8, then the value range of talf_reuse_idx can be 0 to 7, which respectively represent which set of historical time-domain adaptive loop filters in the FIFO is reused.
[0198] For example, in some embodiments, the slice-level syntax element is parsed as follows:
[0199] The `talf_reuse_idx` parameter indicates the index of the time-domain adaptive filter in the FIFO. Since the FIFO length is a maximum of 8 bits in this example, `talf_reuse_idx` uses a 3-bit fixed-length code for encoding and decoding. In other cases, variable-length codes or other length encoding / decoding methods can be used. The value of `talf_reuse_idx` ranges from 0 to 7, representing which set of historical time-domain adaptive loop filters in the FIFO is reused. When this syntax element is not present in the bitstream, its default value is 0.
[0200] Furthermore, in the embodiments of this application, after determining the reuse index parameters, historical TALF information can be determined based on the reuse index parameters.
[0201] In one implementation, when determining historical TALF information based on multiplexing index parameters, one can choose to determine the data unit index based on the multiplexing index parameters; then determine the data unit corresponding to the data unit index in a historical dataset; thus, historical TALF information can be determined based on the data unit corresponding to the data unit index; wherein, historical TALF information includes: filtering mode, number of filter groups, and filter coefficients of candidate filters.
[0202] In other words, in the embodiments of this application, a method for reusing historical TALF information includes determining a data unit corresponding to a data unit index from a historical dataset, such as an element in a FIFO, and then obtaining the filtering mode, the number of filter groups, and the filter coefficients of the candidate filters recorded and stored in the data unit.
[0203] For example, in some embodiments, the slice-level syntax element is parsed as follows:
[0204] The `talf_reuse_flag` flag indicates whether to reuse the time-domain adaptive filter in the FIFO. If this flag is 1, it means that the historical adaptive loop filter recorded in the FIFO is reused; if the flag is 0, it means that it is not reused. When this syntax element does not exist in the bitstream, its default value can be 0.
[0205] `talf_reuse_idx` can be used to indicate the index of the time-domain adaptive filter in the FIFO. Since the FIFO length is at most 8 bits in this example, `talf_reuse_idx` uses a 3-bit fixed-length code for encoding and decoding. In other cases, variable-length codes or other length encoding and decoding methods can be used. The value of `talf_reuse_idx` ranges from 0 to 7, representing which set of historical time-domain adaptive loop filters in the FIFO is reused. When this syntax element is not present in the bitstream, its default value is 0.
[0206] The `updateFIFO()` function updates the FIFO using the TALFs decoded from the current slice. The update process is as follows:
[0207] Among them, tAlfParamPool is a FIFO that records historical adaptive loop filtering information, where each element can store one or more sets of time-domain adaptive filters resolved by the current slice.
[0208] Therefore, if the historical TALF information recorded and stored in the historical dataset includes the filtering mode, the number of filter groups, and the filter coefficients of the candidate filters, then when updating the historical dataset, it is also necessary to store the corresponding TALF information, including the filtering mode, the number of filter groups, and the filter coefficients of the candidate filters, into the historical dataset.
[0209] Furthermore, in the embodiments of this application, after decoding the bitstream and determining the first syntax element identification information, when filtering is performed based on the first syntax element identification information to determine the current block multiplexing historical TALF information, the filter coefficients corresponding to the current block can be determined according to the first syntax element identification information and the historical TALF information.
[0210] Furthermore, in the embodiments of this application, when determining the filter coefficients corresponding to the current block based on the first syntax element identification information and the historical TALF information, the candidate filter corresponding to the current block can be determined first based on the first syntax element identification information and the number of filter groups; and then the filter coefficients corresponding to the candidate filter can be determined as the filter coefficients corresponding to the current block.
[0211] It is understood that, in the embodiments of this application, when reusing historical TALF information, if the historical TALF information includes filter coefficients corresponding to candidate filters, then the filter coefficients (filter coefficients) corresponding to the current block can be determined from the filter coefficients corresponding to candidate filters by combining the first syntax element identification information talf_ctb_idc[CtbAddrX][CtbAddrY].
[0212] It is understood that in the embodiments of this application, when reusing historical time-domain adaptive loop filters, since the FIFO may contain more than one time-domain adaptive filter at the talf_reuse_idx position, the corresponding identifier should also be used to indicate whether a historical time-domain adaptive loop filter has been selected and which filter in TALFs has been selected when encoding and decoding the CTU identifier.
[0213] If the current slice does not reuse the historical adaptive loop filter, the method for parsing the block-level syntax elements of the coding tree is the same as the conventional TALF method in the above embodiments.
[0214] If the current slice uses a history-adaptive loop filter, the number of filters used (filterCount) is obtained first:
[0215] filterCount=tAlfParamPool[talf_reuse_idx].filterCount
[0216] For example, in some embodiments, the block-level syntax elements of the encoding tree are parsed as follows:
[0217] The first syntax element, `talf_ctb_idc[CtbAddrX][CtbAddrY]`, indicates whether the luminance block of the coding tree, numbered `CtbAddrX` horizontally and `CtbAddrY` vertically, uses TALF filtering. If `talf_reuse_flag` is 0 (i.e., the historical adaptive loop filter is not reused), the value of `talf_ctb_idc[CtbAddrX][CtbAddrY]` ranges from 0 to `talf_num_filters_signalled_minus1`. If `talf_reuse_flag` is 1 (i.e., the historical adaptive loop filter is reused), the value of `talf_ctb_idc[CtbAddrX][CtbAddrY]` ranges from 0 to `filterCount-1`. When this syntax element is not present in the bitstream, its default value is 0.
[0218] Furthermore, in the embodiments of this application, when reconstructing the filter coefficients, if talf_reuse_flag is 0, i.e., the historical adaptive loop filter is not reused, the process of reconstructing the filter coefficients is the same as the conventional TALF method in the above embodiments. If talf_reuse_flag is 1, i.e., the historical adaptive loop filter is reused, the reused filter mode, the number of filters (the number of filter groups), and the filter coefficients are obtained respectively.
[0219] When talf_reuse_flag is 1, numCoeff can be used for either unidirectional or bidirectional filtering based on the tAlfMode indicator. For example, it is 13 for unidirectional filtering and 14 for bidirectional filtering.
[0220] In one implementation, if it is determined that the current image is filtered using TALF, the bitstream is decoded to determine the filtering mode corresponding to the current image. Then, when determining historical TALF information based on the multiplexing index parameters, a first historical dataset can be determined from the plurality of historical datasets according to the filtering mode corresponding to the current image; a data unit index can be determined based on the multiplexing index parameters, and the data unit corresponding to the data unit index can be determined in the first historical dataset; based on the data unit corresponding to the data unit index, the historical TALF information is determined; wherein, the historical TALF information includes: the number of filter groups and the filter coefficients of the candidate filters.
[0221] It is understood that, in the embodiments of this application, considering that time-domain filtering has three filtering modes under RA and LD configurations respectively, different types of filtering modes can be stored and updated using different FIFOs. For example, the forward filtering filter of RA uses one FIFO to record historical filters, the backward filtering filter uses one FIFO to record historical filters, and the bidirectional filtering filter uses one FIFO to record historical filters; the filter using POC N-1 in LD uses one FIFO to record historical filters, the filter using POC N-2 uses one FIFO to record historical filters, and the filters using both POC N-1 and POC N-2 use one FIFO to record historical filters.
[0222] It should be noted that, in the embodiments of this application, the first historical dataset can be one of the multiple candidate historical datasets that corresponds to the filtering mode.
[0223] Accordingly, in the embodiments of this application, a talf_filter_mode needs to be encoded and decoded to represent the selected filter mode (filtering mode). That is, regardless of whether the multiplexing flag talf_reuse_flag indicates whether a historical filter is reused, the talf_filter_mode indicating the filtering mode needs to be transmitted.
[0224] In other words, in the embodiments of this application, a method for reusing historical TALF information includes selecting a historical dataset corresponding to a filtering mode from multiple historical datasets, then determining the data unit corresponding to the data unit index in the historical dataset, and then obtaining the number of filter groups and the filter coefficients of the candidate filters recorded and stored in the data unit.
[0225] For example, in some embodiments, the slice-level syntax element is parsed as follows:
[0226] The `talf_reuse_flag` flag indicates whether to reuse the time-domain adaptive filter in the FIFO. If this flag is 1, it means that the historical adaptive loop filter recorded in the FIFO is reused; if the flag is 0, it means that it is not reused. When this syntax element does not exist in the bitstream, its default value can be 0.
[0227] `talf_reuse_idx` can be used to indicate the index of the time-domain adaptive filter in the FIFO. Since the FIFO length is at most 8 bits in this example, `talf_reuse_idx` uses a 3-bit fixed-length code for encoding and decoding. In other cases, variable-length codes or other length encoding and decoding methods can be used. The value of `talf_reuse_idx` ranges from 0 to 7, representing which set of historical time-domain adaptive loop filters in the FIFO is reused. When this syntax element is not present in the bitstream, its default value is 0.
[0228] The `updateFIFO()` function updates the FIFO using the TALFs decoded from the current slice. The update process is as follows:
[0229] Among them, tAlfParamPool is a FIFO that records historical adaptive loop filtering information, where each element can store one or more sets of time-domain adaptive filters resolved by the current slice.
[0230] Therefore, if the historical TALF information recorded and stored in the historical dataset includes the number of filter groups and the filter coefficients of the candidate filters, then when updating the historical dataset, it is also necessary to store the corresponding TALF information, including the number of filter groups and the filter coefficients of the candidate filters, into the historical dataset.
[0231] Furthermore, in the embodiments of this application, after decoding the bitstream and determining the first syntax element identification information, when filtering is performed based on the first syntax element identification information to determine the current block multiplexing historical TALF information, the filter coefficients corresponding to the current block can be determined according to the first syntax element identification information and the historical TALF information.
[0232] Furthermore, in the embodiments of this application, when determining the filter coefficients corresponding to the current block based on the first syntax element identification information and the historical TALF information, the candidate filter corresponding to the current block can be determined first based on the first syntax element identification information and the number of filter groups; and then the filter coefficients corresponding to the candidate filter can be determined as the filter coefficients corresponding to the current block.
[0233] It is understood that, in the embodiments of this application, when reusing historical TALF information, if the historical TALF information includes filter coefficients corresponding to candidate filters, then the filter coefficients (filter coefficients) corresponding to the current block can be determined from the filter coefficients corresponding to candidate filters by combining the first syntax element identification information talf_ctb_idc[CtbAddrX][CtbAddrY].
[0234] It is understood that in the embodiments of this application, when reusing historical time-domain adaptive loop filters, since the FIFO may contain more than one time-domain adaptive filter at the talf_reuse_idx position, the corresponding identifier should also be used to indicate whether a historical time-domain adaptive loop filter has been selected and which filter in TALFs has been selected when encoding and decoding the CTU identifier.
[0235] If the current slice does not reuse the historical adaptive loop filter, the method for parsing the block-level syntax elements of the coding tree is the same as the conventional TALF method in the above embodiments.
[0236] If the current slice uses a history-adaptive loop filter, the number of filters used (filterCount) is obtained first:
[0237] filterCount=tAlfParamPool[talf_filter_mode][talf_reuse_idx].filterCount
[0238] For example, in some embodiments, the block-level syntax elements of the encoding tree are parsed as follows:
[0239] 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. If `talf_reuse_flag` is 0, meaning the historical adaptive loop filter is not reused, the value of `talf_ctb_idc[CtbAddrX][CtbAddrY]` ranges from 0 to `talf_num_filters_signalled_minus1`. If `talf_reuse_flag` is 1, meaning the historical adaptive loop filter is reused, the value of `talf_ctb_idc[CtbAddrX][CtbAddrY]` ranges from 0 to `filterCount-1`. When this syntax element does not exist in the bitstream, its default value can be 0.
[0240] Furthermore, in the embodiments of this application, when reconstructing the filter coefficients, if talf_reuse_flag is 0, i.e., the historical adaptive loop filter is not reused, the process of reconstructing the filter coefficients is the same as the conventional TALF method in the above embodiments. If talf_reuse_flag is 1, i.e., the historical adaptive loop filter is reused, the reused filter mode, the number of filters (the number of filter groups), and the filter coefficients are obtained respectively.
[0241] In one implementation, for TALF, the filtering mode always uses one 7x7 filter or two 5x5 filters, corresponding to using reconstructed values from one reconstructed image as input and reconstructed values from two reconstructed images as input, respectively. The FIFO update is mainly divided into forward, backward, and bidirectional TALF filters, which can be updated separately in different FIFOs or always in the same FIFO. The FIFO update can also be divided into two categories: using one reconstructed image and using two reconstructed images.
[0242] In other words, in the embodiments of this application, considering that the input of TALF may include one inter-frame reference image and two inter-frame reference images, different FIFOs can be used to store and update the data volume of different input images. For example, one FIFO is used to record the historical filter for the input of one inter-frame reference image, and another FIFO is used to record the historical filter for the input of two inter-frame reference images.
[0243] It should be noted that, in the embodiments of this application, the first historical dataset can be one of multiple candidate historical datasets that corresponds to the filtering mode. Specifically, this involves first determining the number of inter-frame reference images for the TALF input based on the filtering mode, and then determining a corresponding historical dataset from multiple candidate historical datasets based on the number of input inter-frame reference images.
[0244] Accordingly, in the embodiments of this application, a talf_filter_mode needs to be encoded and decoded to represent the selected filter mode (filtering mode). That is, regardless of whether the multiplexing flag talf_reuse_flag indicates whether a historical filter is reused, the talf_filter_mode indicating the filtering mode needs to be transmitted.
[0245] In other words, in the embodiments of this application, a method for reusing historical TALF information includes selecting a historical dataset corresponding to a filtering mode (the number of input inter-frame reference images) from multiple historical datasets, then determining the data unit corresponding to the data unit index in the historical dataset, and then obtaining the number of filter groups and the filter coefficients of the candidate filters recorded and stored in the data unit.
[0246] For example, in some embodiments, the slice-level syntax element is parsed as follows:
[0247] The `talf_reuse_flag` flag indicates whether to reuse the time-domain adaptive filter in the FIFO. If this flag is 1, it means that the historical adaptive loop filter recorded in the FIFO is reused; if the flag is 0, it means that it is not reused. When this syntax element does not exist in the bitstream, its default value can be 0.
[0248] `talf_reuse_idx` can be used to indicate the index of the time-domain adaptive filter in the FIFO. Since the FIFO length is at most 8 bits in this example, `talf_reuse_idx` uses a 3-bit fixed-length code for encoding and decoding. In other cases, variable-length codes or other length encoding and decoding methods can be used. The value of `talf_reuse_idx` ranges from 0 to 7, representing which set of historical time-domain adaptive loop filters in the FIFO is reused. When this syntax element is not present in the bitstream, its default value is 0.
[0249] The `updateFIFO()` function updates the FIFO using the TALFs decoded from the current slice. The update process is as follows:
[0250] As can be seen, if the FIFO update is divided into two categories: one using a reconstructed image and the other using two reconstructed images, then there are only two FIFOs. The updated FIFO is determined by FIFOType. When the filter to be updated in the FIFO is a 13-coefficient filter (one reconstructed image input, 7x7 shape), FIFOType is set to 0; when the filter to be updated in the FIFO is a 14-coefficient filter (two reconstructed image inputs, two 5x5 shapes), FIFOType is set to 1.
[0251] Therefore, if the historical TALF information recorded and stored in the historical dataset includes the number of filter groups and the filter coefficients of the candidate filters, then when updating the historical dataset, it is also necessary to store the corresponding TALF information, including the number of filter groups and the filter coefficients of the candidate filters, into the historical dataset.
[0252] Furthermore, in the embodiments of this application, after decoding the bitstream and determining the first syntax element identification information, when filtering is performed based on the first syntax element identification information to determine the current block multiplexing historical TALF information, the filter coefficients corresponding to the current block can be determined according to the first syntax element identification information and the historical TALF information.
[0253] Furthermore, in the embodiments of this application, when determining the filter coefficients corresponding to the current block based on the first syntax element identification information and the historical TALF information, the candidate filter corresponding to the current block can be determined first based on the first syntax element identification information and the number of filter groups; and then the filter coefficients corresponding to the candidate filter can be determined as the filter coefficients corresponding to the current block.
[0254] It is understood that, in the embodiments of this application, when reusing historical TALF information, if the historical TALF information includes filter coefficients corresponding to candidate filters, then the filter coefficients (filter coefficients) corresponding to the current block can be determined from the filter coefficients corresponding to candidate filters by combining the first syntax element identification information talf_ctb_idc[CtbAddrX][CtbAddrY].
[0255] It is understood that in the embodiments of this application, when reusing historical time-domain adaptive loop filters, since the FIFO may contain more than one time-domain adaptive filter at the talf_reuse_idx position, the corresponding identifier should also be used to indicate whether a historical time-domain adaptive loop filter has been selected and which filter in TALFs has been selected when encoding and decoding the CTU identifier.
[0256] If the current slice does not reuse the historical adaptive loop filter, the method for parsing the block-level syntax elements of the coding tree is the same as the conventional TALF method in the above embodiments.
[0257] If the current slice uses a history-adaptive loop filter, the number of filters used (filterCount) is obtained first:
[0258] filterCount=tAlfParamPool[FIFOType][talf_reuse_idx].filterCount
[0259] For example, in some embodiments, the block-level syntax elements of the encoding tree are parsed as follows:
[0260] 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. If `talf_reuse_flag` is 0, meaning the historical adaptive loop filter is not reused, the value of `talf_ctb_idc[CtbAddrX][CtbAddrY]` ranges from 0 to `talf_num_filters_signalled_minus1`. If `talf_reuse_flag` is 1, meaning the historical adaptive loop filter is reused, the value of `talf_ctb_idc[CtbAddrX][CtbAddrY]` ranges from 0 to `filterCount-1`. When this syntax element does not exist in the bitstream, its default value can be 0.
[0261] Furthermore, in the embodiments of this application, when reconstructing the filter coefficients, if talf_reuse_flag is 0, i.e., the historical adaptive loop filter is not reused, the process of reconstructing the filter coefficients is the same as the conventional TALF method in the above embodiments. If talf_reuse_flag is 1, i.e., the historical adaptive loop filter is reused, the reused filter mode, the number of filters (the number of filter groups), and the filter coefficients are obtained respectively.
[0262] When talf_reuse_flag is 1, numCoeff can be configured for either unidirectional or bidirectional filtering based on the talf_filter_mode indicator. It is 13 for unidirectional filtering and 14 for bidirectional filtering.
[0263] In one implementation, if it is determined that the current image is filtered using TALF, the bitstream is decoded to determine the filtering mode and the number of filter groups corresponding to the current image. Then, when determining historical TALF information based on the multiplexing index parameters, data unit indices can be determined based on the multiplexing index parameters, and data units corresponding to the data unit indices can be determined in the historical dataset; wherein the number of data unit indices and the number of data units corresponding to the data unit indices are determined based on the number of filter groups; based on the data units corresponding to the data unit indices, the historical TALF information is determined; wherein the historical TALF information includes the filter coefficients of the candidate filters.
[0264] It is understood that, in the embodiments of this application, temporal adaptive filters from different slices (or different images) can be combined. The temporal adaptive filters for all filtering modes are updated in the same FIFO, where each element can only store one set of filters. If one set of filters is resolved in the current slice (or current image), then one set is updated in the FIFO; if multiple sets of filters are resolved in the current slice (or current image), then multiple sets of filters are updated in the FIFO. Each index corresponds to one set of filters. During multiplexing, one or more sets of filters can be obtained through one or more indices of the FIFO for use in the current slice (or current image).
[0265] In other words, in the embodiments of this application, since each element in the FIFO can only store one set of filters, that is, each data unit stores a set of historical TALF information, the number of data unit indices and the number of data units corresponding to the data unit indices are determined based on the number of filter sets.
[0266] Accordingly, in the embodiments of this application, it is necessary to encode and decode a `talf_filter_mode` to represent the selected filter mode (filtering mode), and also to encode and decode a `talf_num_filters_signalled_minus1` to indicate the number of filters being encoded and decoded minus one. That is, regardless of whether the reuse flag `talf_reuse_flag` indicates whether historical filters are reused, it is necessary to transmit `talf_filter_mode` indicating the filtering mode and `talf_num_filters_signalled_minus1` indicating the number of filter groups.
[0267] In other words, in the embodiments of this application, a method for reusing historical TALF information includes determining a data unit corresponding to a data unit index from a historical dataset, and then obtaining the filter coefficients of the candidate filters recorded and stored in that data unit.
[0268] For example, in some embodiments, the slice-level syntax element is parsed as follows:
[0269] The `talf_reuse_flag` flag indicates whether to reuse the time-domain adaptive filter in the FIFO. If this flag is 1, it means that the historical adaptive loop filter recorded in the FIFO is reused; if the flag is 0, it means that it is not reused. When this syntax element does not exist in the bitstream, its default value can be 0.
[0270] `talf_reuse_idx` can be used to indicate the index of the time-domain adaptive filter in the FIFO. Since the FIFO length is at most 8 bits in this example, `talf_reuse_idx` uses a 3-bit fixed-length code for encoding and decoding. In other cases, variable-length codes or other length encoding and decoding methods can be used. The value of `talf_reuse_idx` ranges from 0 to 7, representing which set of historical time-domain adaptive loop filters in the FIFO is reused. When this syntax element is not present in the bitstream, its default value is 0.
[0271] It should be noted that, in the embodiments of this application, during the process of reusing the historical time-domain adaptive loop filter, multiple talf_reuse_idx can be further decoded to indicate the index of each multiplexed filter in the FIFO.
[0272] The `updateFIFO()` function updates the FIFO using the TALFs decoded from the current slice. The update process is as follows:
[0273] Among them, tAlfParamPool is a FIFO that records historical adaptive loop filtering information, where each element can store a set of time-domain adaptive filters resolved by the current slice.
[0274] Therefore, if the historical TALF information recorded and stored in the historical dataset includes the filter coefficients of the candidate filters, then when updating the historical dataset, it is also necessary to store the corresponding TALF information including the filter coefficients of the candidate filters in the historical dataset.
[0275] Furthermore, in the embodiments of this application, when reconstructing the filter coefficients, if talf_reuse_flag is 0, i.e., the historical adaptive loop filter is not reused, the process of reconstructing the filter coefficients is the same as the conventional TALF method in the above embodiments; if talf_reuse_flag is 1, i.e., the historical adaptive loop filter is reused, then the filter coefficients are obtained:
[0276] In one implementation, if it is determined that the current image is filtered using TALF, the bitstream is decoded to determine the number of filter groups corresponding to the current image. Then, when determining historical TALF information based on the multiplexing index parameters, a data unit index can be determined based on the multiplexing index parameters; a data unit corresponding to the data unit index can be determined in the historical dataset; and the historical TALF information is determined based on the data unit corresponding to the data unit index; wherein the historical TALF information includes: filtering mode and filter coefficients of candidate filters.
[0277] It is understood that in the embodiments of this application, historical time-domain loop filters are allowed to be combined, but the filters in each filtering mode are updated in the same FIFO.
[0278] Accordingly, in the embodiments of this application, a talf_num_filters_signalled_minus1 needs to be encoded and decoded to indicate the number of encoded and decoded filters minus one. That is, regardless of whether the multiplexing flag talf_reuse_flag indicates whether historical filters are multiplexed, talf_num_filters_signalled_minus1 indicating the number of filter groups needs to be transmitted.
[0279] In other words, in the embodiments of this application, a method for reusing historical TALF information includes determining the data unit corresponding to the data unit index from a historical dataset, and then obtaining the filtering mode and filter coefficients of the candidate filter recorded and stored in the data unit.
[0280] For example, in some embodiments, the slice-level syntax element is parsed as follows:
[0281] The `talf_reuse_flag` flag indicates whether to reuse the time-domain adaptive filter in the FIFO. If this flag is 1, it means that the historical adaptive loop filter recorded in the FIFO is reused; if the flag is 0, it means that it is not reused. When this syntax element does not exist in the bitstream, its default value can be 0.
[0282] `talf_reuse_idx` can be used to indicate the index of the time-domain adaptive filter in the FIFO. Since the FIFO length is at most 8 bits in this example, `talf_reuse_idx` uses a 3-bit fixed-length code for encoding and decoding. In other cases, variable-length codes or other length encoding and decoding methods can be used. The value of `talf_reuse_idx` ranges from 0 to 7, representing which set of historical time-domain adaptive loop filters in the FIFO is reused. When this syntax element is not present in the bitstream, its default value is 0.
[0283] It should be noted that, in the embodiments of this application, each filter should be assigned a corresponding filter mode type during the FIFO update process.
[0284] The `updateFIFO()` function updates the FIFO using the TALFs decoded from the current slice. The update process is as follows:
[0285] Among them, tAlfParamPool is a FIFO that records historical adaptive loop filtering information, where each element can store one or more sets of time-domain adaptive filters resolved by the current slice.
[0286] Therefore, if the historical TALF information recorded and stored in the historical dataset includes the filter modes and filter coefficients of the candidate filters, then when updating the historical dataset, it is also necessary to store the corresponding TALF information, including the filter modes and filter coefficients of the candidate filters, into the historical dataset.
[0287] Furthermore, in the embodiments of this application, when reconstructing the filter coefficients, if talf_reuse_flag is 0, i.e., the historical adaptive loop filter is not reused, the process of reconstructing the filter coefficients is the same as the conventional TALF method in the above embodiments; if talf_reuse_flag is 1, i.e., the historical adaptive loop filter is reused, then the filter coefficients are obtained:
[0288] When talf_reuse_flag is 1, numCoeff can be configured for either unidirectional or bidirectional filtering based on the tAlfMode indicator. It is 13 for unidirectional filtering and 14 for bidirectional filtering.
[0289] Furthermore, in the embodiments of this application, if it is determined that historical TALF information will not be reused for filtering, at least one inter-frame reference image corresponding to the current image and the filter coefficients corresponding to the current block can be further determined. That is, if it is determined based on the reuse identifier information that historical TALF information will not be reused for filtering, the TALF information corresponding to the current image can be determined.
[0290] Furthermore, in the embodiments of this application, when determining at least one inter-frame reference image corresponding to the current image and the filter coefficients corresponding to the current block, the TALF parameters corresponding to the current block can be determined first; wherein, the TALF parameters include one or more of the following: mode parameters, quantity parameters, coefficient value parameters, and coefficient sign parameters; then, the filtering mode and the number of filter groups are determined according to the TALF parameters; at least one inter-frame reference image can be determined according to the filtering mode; and at the same time, the filter coefficients corresponding to the current block can be determined according to the number of filter groups, coefficient value parameters, coefficient sign parameters, and the first syntax element identification information.
[0291] It is understood that, in the embodiments of this application, the mode parameter can be used to determine the filtering mode of the TALF filter, wherein, for different filtering modes, the inter-frame reference image corresponding to the current image can be different. The quantity parameter can be used to determine the number of filter groups corresponding to the current image. The coefficient value parameter can be used to determine the absolute value of the filter coefficients. The coefficient sign parameter can be used to determine the sign of the filter coefficients, including positive and negative signs.
[0292] Furthermore, in the embodiments of this application, when determining the TALF parameters corresponding to the current block, the bitstream can be decoded and the APS index can be determined if the current image is determined to be filtered using TALF based on the second syntax element identification information; then the APS set can be determined based on the APS index, and the TALF parameters can be determined based on the APS set.
[0293] It is understood that, in the embodiments of this application, the APS index can be used to determine the APS parameter set corresponding to the current image, that is, the APS set corresponding to the current image can be determined through the APS index.
[0294] For example, in some embodiments, when it is determined that the current image is filtered using TALF based on the second syntax element identification information, the bitstream can be further decoded to determine the corresponding APS index ph_talf_aps_id. The ph_talf_aps_id can be used to indicate in which APS parameter set the adaptive parameters (TALF parameters) of the current image are obtained when using TALF.
[0295] For example, in some embodiments, when it is determined that the current slice uses TALF for filtering based on the second syntax element identification information, the bitstream can be further decoded to determine the corresponding APS index sh_talf_aps_id. The sh_talf_aps_id can be used to indicate in which APS parameter set the adaptive parameters (TALF parameters) of the current slice are obtained when using TALF.
[0296] In other words, in the embodiments of this application, the TALF parameters corresponding to the current image can be stored in the APS, so that the TALF parameters can be obtained by parsing in the APS.
[0297] For example, in some embodiments, the implementation of determining TALF parameters by parsing APS is as follows:
[0298] The `alf_data()` function parses the syntax elements and parameters of ALF and CCALF. This solution can further incorporate the syntax elements and parameters of TALF into the parsing of `alf_data()`.
[0299] For example, in some embodiments, the implementation of determining TALF parameters by parsing alf_data() is as follows:
[0300] Among them, talf_filter_signal_flag is used to identify whether there are TALF parameters in the current alf_data parameters;
[0301] talf_filter_mode is the mode parameter, which indicates which specific mode of TALF, such as forward, backward, or bidirectional, TALF belongs to if the TALF parameter exists.
[0302] `talf_num_filters_signalled_minus1` is the quantity parameter, used to represent the number of filter groups. For example, if the TALF parameter exists, `talf_num_filters_signalled_minus1` is the number of TALF filters being encoded and decoded in the current APS minus one.
[0303] talf_coeff_abs is the coefficient numerical parameter, used to represent the absolute value of the coefficients in each filter of the encoding and decoding process;
[0304] talf_coeff_sign is the coefficient sign parameter, used to indicate the sign of the non-zero coefficients in each filter of the encoding and decoding process;
[0305] The variable numCoeff represents the number of filter coefficients in the filter.
[0306] Furthermore, in the embodiments of this application, when determining the TALF parameters corresponding to the current block, the bitstream can be decoded and the TALF parameters can be determined if the current image is determined to be filtered using TALF based on the second syntax element identification information.
[0307] In other words, in the embodiments of this application, the TALF parameters corresponding to the current image can be directly written into the bitstream, thereby obtaining the TALF parameters through decoding the bitstream. For example, the TALF parameters can be encoded and decoded in the image perspective or in the title sequence.
[0308] For example, in some embodiments, the method for encoding and decoding TALF identifiers and TALF parameters in the image header is as follows:
[0309] Furthermore, in the embodiments of this application, when determining the filtering mode and the number of filter groups based on the TALF parameters, the current configuration can be determined first; if the current configuration is a random access (RA) configuration, the filtering mode is determined from the first candidate modes based on the mode parameters; wherein, the first candidate modes include one or more of forward filtering mode, reverse filtering mode, and bidirectional filtering mode; if the current configuration is a low latency (LD) configuration, the filtering mode is determined from the second candidate modes based on the mode parameters; wherein, the second candidate modes include one or more of the first forward filtering mode, second forward filtering mode, and third forward filtering mode.
[0310] It should be noted that, in the embodiments of this application, the filtering mode corresponding to the current image can be determined by combining the current configuration and the mode parameters in the TALF parameters. Specifically, the current configuration can determine whether to use a first candidate mode or a second candidate mode for filtering, and then the corresponding filtering mode can be selected from the first or second candidate mode based on the mode parameters.
[0311] It is understood that, in the embodiments of this application, for the RA configuration, the corresponding first candidate mode may include one or more of the forward filtering mode, the inverse filtering mode, and the bidirectional filtering mode. Specifically, the forward filtering mode can be understood as using the reconstruction information of a reconstructed image smaller than the current image POC as the filter input; the inverse filtering mode can be understood as using the reconstruction information of a reconstructed image larger than the current image POC as the filter input; and the bidirectional filtering mode can be understood as simultaneously using the reconstruction information of both images smaller than the current image POC and images larger than the current image POC as the filter input.
[0312] It is understood that, in the embodiments of this application, for the LD configuration, the corresponding second candidate mode may include one or more of the first forward filtering mode, the second forward filtering mode, and the third forward filtering mode. Specifically, for encoding and decoding under the LD configuration, the encoding / decoding order is the same as the playback order, so only reference images smaller than the current image POC can be used as the filter input, i.e., only the forward filtering mode is supported. However, corresponding to different inter-frame reference images, the corresponding forward filtering modes can be distinguished as the first forward filtering mode, the second forward filtering mode, and the third forward filtering mode.
[0313] Furthermore, in the embodiments of this application, after determining the filtering mode corresponding to the current image, at least one inter-frame reference image can be further determined based on the filtering mode.
[0314] It is understood that in the embodiments of this application, the determination of the inter-frame reference image depends on the filtering mode, and the final determined inter-frame reference image may be different for different filtering modes.
[0315] For example, in some embodiments, if the POC value of the current image is N, for the RA configuration, if the determined filtering mode is forward filtering mode, then the image with a POC value of N-1 can be selected as the inter-frame reference image of the current image; if the determined filtering mode is reverse filtering mode, then the image with a POC value of N+1 can be selected as the inter-frame reference image of the current image; if the determined filtering mode is bidirectional filtering mode, then the image with a POC value of N-1 and the image with a POC value of N+1 can be selected as the inter-frame reference image of the current image.
[0316] For example, in some embodiments, if the POC value of the current image is N, for the LD configuration, images with POC values of N-1, N-2, ... can be used as inter-frame reference images for the current image. For instance, if the determined filtering mode is a first forward filtering mode, then an image with a POC value of N-1 can be selected as the inter-frame reference image for the current image; if the determined filtering mode is a second forward filtering mode, then an image with a POC value of N-2 can be selected as the inter-frame reference image for the current image; if the determined filtering mode is a third forward filtering mode, then images with POC values of both N-1 and N-2 can be selected as the inter-frame reference images for the current image.
[0317] In other words, in the embodiments of this application, the POC values of the inter-frame reference images determined based on different filtering modes can be different, and the number of inter-frame reference images determined can also be different. For example, for the forward filtering mode and backward filtering mode in the RA configuration, and the first forward filtering mode (most recent first frame) and the second forward filtering mode (most recent second frame) in the LD configuration, the current image corresponds to one inter-frame reference image; for the bidirectional filtering mode in the RA configuration, and the third forward filtering mode (most recent first frame and most recent second frame) in the LD configuration, the current image corresponds to two inter-frame reference images.
[0318] Therefore, for temporal adaptive loop filtering, intra-frame coded images have no reference image, while inter-frame coded images do. Thus, the temporal filtering in this scheme is applied to inter-frame coded images, such as those under RA and LD configurations. For LD configurations, the encoding / decoding order is the same as the playback order. Therefore, when applying temporal adaptive filtering to inter-frame coded images, a reference image smaller than the current image's POC is always used as the filter input. For RA configurations, the encoding / decoding order may differ from the playback order. When applying temporal filtering to the current inter-frame coded image, a reference frame with a larger or smaller POC than the current frame can be used as the filter input.
[0319] Forward filtering uses the reconstruction information of reconstructed images with a smaller POC than the current image as input to the filter, generating a filtered value that applies to the current reconstructed image. For example, in LD configuration, if the POC of the current image is N (where N is a non-negative integer), the reconstruction values of reconstructed images with POC values of N-1, N-2, etc., can be used as input to the filter. Similarly, in RA configuration, under the encoding / decoding sequence, when the POC of the current image is N, the inter-frame coded image with TID 5 can use the reconstruction value of an image with a POC value of N-1 as input; when TID is 4, it can use the reconstruction value of an image with a POC value of N-2; when TID is 3, it can use the reconstruction value of an image with a POC value of N-4; when TID is 2, it can use the image with a POC value of N-8; when TID is 1, it can use the reconstruction value of an image with a POC value of N-16; and when TID is 0, it can use the reconstruction value of an image with a POC value of N-32.
[0320] It should be noted that, in the embodiments of this application, the POC value of the reference frame used during forward filtering may also change due to different encoding configurations.
[0321] Inverse filtering uses the reconstruction information of a reconstructed image with a larger POC than the current image as input to the filter, generating a filtered value that applies to the current reconstructed image. Under current coding configurations, inverse filtering is only used in the RA configuration. For example, in the RA configuration, in the encoding / decoding order, when the POC of the current image is N, the inter-frame coded image with TID 5 can use the reconstructed value of the image with POC value N+1 as the filter input; when TID is 4, it can use the reconstructed value of the image with POC value N+2; when TID is 3, it can use the reconstructed value of the image with POC value N+4; when TID is 2, it can use the image with POC value N+8; when TID is 1, it can use the reconstructed value of the image with POC value N+16; and when TID is 0, it can use the reconstructed value of the image with POC value N+32.
[0322] It should be noted that, in the embodiments of this application, the POC value of the reference frame used during inverse filtering may also change due to different encoding configurations.
[0323] Bidirectional filtering uses reconstruction information from both images with a smaller POC than the current image and images with a larger POC as input to the filter, generating a filtered value that applies to the current reconstructed image. Under current coding configurations, inverse filtering is only used in the RA configuration. For example, in the RA configuration, in the encoding / decoding order, when the current image's POC is N, the inter-frame coded image with TID 5 can use the reconstructed values of images with POC values of N+1 and N-1 as filter input; with TID 4, it can use the reconstructed values of images with POC values of N+2 and N-2; with TID 3, it can use the reconstructed values of images with POC values of N+4 and N-4; with TID 2, it can use the images with POC values of N+8 and N-8; with TID 1, it can use the reconstructed values of images with POC values of N+16 and N-16; and with TID 0, it can use the reconstructed values of images with POC values of N+32 and N-32.
[0324] It should be noted that, in the embodiments of this application, due to different encoding configurations, the POC value of the reference frame used in bidirectional filtering will also change. In principle, under the RA configuration, bidirectional filtering will always use the reconstructed values of the two reconstructed images with the closest forward and backward distances as the input of the filter.
[0325] For example, in some embodiments, assuming the filtering mode is a forward filtering mode, then the following forward filtering modes may be included, but are not limited to:
[0326] 1. In RA configuration, use the reference image with the smallest POC and the closest temporal distance to the current image as the input for temporal filtering;
[0327] 2. In LD configuration, when the current image POC value is N, corresponding to the first forward filtering mode, a reference image with a POC value of N-1 is used as the input for temporal filtering;
[0328] 3. In LD configuration, when the current image POC value is N, corresponding to the second forward filtering mode, a reference image with a POC value of N-2 is used as the input for temporal filtering;
[0329] 4. In LD configuration, when the current image POC value is N, it corresponds to the third forward filtering mode, and two reference images with POC values of N-2 and N-1 are used as inputs for temporal filtering.
[0330] Furthermore, in the embodiments of this application, when determining the number of filter groups based on the TALF parameters, the number of filter groups can be determined based on the quantity parameter. Specifically, the number of filter groups can be determined based on the quantity parameter and a preset value.
[0331] It is understood that, in the embodiments of this application, when determining the number of filter groups based on the quantity parameter and the preset value, mathematical operations can be performed on the value of the quantity parameter and the preset value to calculate the number of filter groups.
[0332] For example, in some embodiments, the quantity parameter can be represented by the syntax element `talf_num_filters_signalled_minus1`, which indicates the number of TALF filters in the current slice minus 1 (i.e., a default value of 1). Assuming a slice can have a maximum of four TALF filters, the value of `talf_num_filters_signalled_minus1` can be 0, 1, 2, or 3. A syntax element 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, and 3 indicates that the current slice has four TALF filters. When this syntax element is not present in the bitstream, its default value can be 0.
[0333] Furthermore, in the embodiments of this application, when determining the filter coefficients corresponding to the current block based on the number of filter groups, coefficient numerical parameters, coefficient sign parameters, and first syntax element identification information, the candidate filter corresponding to the current block can be determined first based on the first syntax element identification information and the number of filter groups; and then the filter coefficients corresponding to the current block can be determined based on the candidate filter corresponding to the current block, coefficient numerical parameters, and coefficient sign parameters.
[0334] It is understood that, in the embodiments of this application, the first syntax element identification information can also be used to determine the TALF information used by the current block. For example, the candidate filter corresponding to the current block can be determined by the value of the first syntax element identification information.
[0335] 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 on the current block. If the value of the first syntax element identifier information is not a first value, it is determined that TALF filtering will be used on the current block, and the candidate filter corresponding to the current block can be further determined based on the first syntax element identifier information.
[0336] Furthermore, in the embodiments of this application, when determining the candidate filter corresponding to the current block based on the first syntax element identifier information and the number of filter groups, the number of filter groups corresponding to the current block can be determined first based on the first syntax element identifier information; then, the candidate filter corresponding to the current block can be determined based on the number of filter groups and the number of filter groups corresponding to the current block.
[0337] It is understood that, in the embodiments of this application, when it is determined that TALF filtering will be applied to the current block, the group index of the filter corresponding to the current block can be determined based on the value of the first syntax element identifier information. The group index of the filter can represent the index of the TALF filter used by the current block in the set of filters encoded and decoded in the current image; that is, the group index of the filter can be used to select the candidate filter corresponding to the current block from among multiple filters corresponding to the current image.
[0338] For example, in some embodiments, if the current block of the current image is a CTU, assuming the first syntax element identification information is represented by the syntax element control identifier talf_ctb_idc[CtbAddrX][CtbAddrY], if the value of talf_ctb_idc[CtbAddrX][CtbAddrY] is 0, it is determined that TALF filtering is not used on the current block; if the value of talf_ctb_idc[CtbAddrX][CtbAddrY] is 1, it can be determined that the candidate filter corresponding to the current block can be the first filter in at least one set of filters; if the value of talf_ctb_idc[CtbAddrX][CtbAddrY] is 2, it can be determined that the candidate filter corresponding to the current block can be the second filter in at least one set of filters.
[0339] It should be noted that, in the embodiments of this application, the value of the first syntax element identifier information depends on the number of filter groups. Assuming that the number of filter groups can be determined by the quantity parameter talf_num_filters_signalled_minus1, then the value of the first syntax element identifier information talf_ctb_idc[CtbAddrX][CtbAddrY] can depend on talf_num_filters_signalled_minus1. For example, the value range of talf_ctb_idc[CtbAddrX][CtbAddrY]-1 can be 0-talf_num_filters_signalled_minus1.
[0340] Furthermore, in the embodiments of this application, when determining the filter coefficients corresponding to the current block based on the candidate filter, coefficient numerical parameters, and coefficient sign parameters, the value of the filter coefficients corresponding to the candidate filter can be determined based on the coefficient numerical parameters; at the same time, the sign of the filter coefficients corresponding to the candidate filter can be determined based on the coefficient sign parameters; finally, the filter coefficients corresponding to the current block can be determined based on the value and sign of the filter coefficients corresponding to the candidate filter.
[0341] It is understood that, in the embodiments of this application, after determining the candidate filter corresponding to the current block based on the first syntax element identification information, the filter coefficients can be reconstructed by further combining the coefficient numerical parameters and coefficient sign parameters, thereby obtaining the filter coefficients corresponding to the current block.
[0342] For example, in some embodiments, the numerical parameter of the coefficient can be represented by the syntax element talf_coeff_abs[sfIdx][j], where talf_coeff_abs[sfIdx][j] can be used to determine the absolute value of the j-th coefficient of the sfIdx-th filter group. For example, talf_coeff_abs[sfIdx][j] can be represented using K-order exponential Golomb code, where K is 0.
[0343] It should be noted that, in the embodiments of this application, if the syntax element talf_coeff_abs[sfIdx][j] does not exist in the bitstream, its value can be defaulted to 0.
[0344] For example, in some embodiments, the coefficient sign parameter can be represented by the syntax element talf_coeff_sign[sfIdx][j], where talf_coeff_sign[sfIdx][j] can be used to determine the sign of the j-th coefficient of the sfIdx-th filter group. For example, a value of 1 for talf_coeff_sign[sfIdx][j] indicates that the j-th coefficient of the sfIdx-th filter group has a negative sign, and a value of 0 for talf_coeff_sign[sfIdx][j] indicates that the j-th coefficient of the sfIdx-th filter group has a positive sign.
[0345] It should be noted that, in the embodiments of this application, if the syntax element talf_coeff_sign[sfIdx][j] does not exist in the bitstream, its value can be defaulted to 0.
[0346] In other words, in the embodiments of this application, if the candidate filter determined based on the first syntax element identification information is the sfIdx group filter, the filter coefficients can be reconstructed by combining the coefficient numerical parameter talf_coeff_abs[sfIdx][j] and the coefficient sign parameter talf_coeff_sign[sfIdx][j].
[0347] For example, in some embodiments, based on the candidate filter corresponding to the current block, according to the absolute value of the filter coefficients and the filter...
[0348] The process of reconstructing filters with positive and negative coefficients is as follows:
[0349] The variable numCoeff represents the number of filter coefficients in the filter.
[0350] For example, in some embodiments, when the current image corresponds to one inter-frame reference image, such as the forward filtering mode and backward filtering mode in the RA configuration, and the first forward filtering mode (most recent first frame) and the second forward filtering mode (most recent second frame) in the LD configuration, a 7x7 symmetrical filter with 13 filter coefficients can be selected, and the value of the numCoeff variable can be 13; when the current image corresponds to two inter-frame reference images, such as the bidirectional filtering mode in the RA configuration, and the third forward filtering mode (most recent first frame and most recent second frame) in the LD configuration, two 5x5 symmetrical filters with 7 filter coefficients can be selected, and the value of the numCoeff variable can be 14.
[0351] It should be noted that, in the embodiments of this application, the image-level control identifiers can be applied to the slice level, sub-image level, and tile level. That is, the image-level syntax element identification information can be replaced by the slice-level syntax element identification information, the sub-image-level syntax element identification information, and the tile-level syntax element identification information. This application mainly uses the image-level control identifiers as an example for illustration, and does not specifically limit the type and form of the control identifiers.
[0352] Furthermore, in the embodiments of this application, after determining at least one inter-frame reference image corresponding to the current image and the filter coefficients corresponding to the current block, the current block can be further filtered based on the reconstructed samples of at least one inter-frame reference image and the filter coefficients corresponding to the current block to determine the filtered reconstructed value of the current block.
[0353] It is understood that, in the embodiments of this application, since the POC values of the inter-frame reference images determined based on different filtering modes may be different, and the number of inter-frame reference images determined may also be different, when performing TALF filtering on the current block of the current image, the filtering process performed will be different for different numbers of inter-frame reference images.
[0354] Furthermore, in the embodiments of this application, when filtering the current block based on the reconstructed samples of at least one inter-frame reference image and the filter coefficients corresponding to the current block to determine the filtered reconstructed value of the current block, for the current sample position in the current block, the reconstructed sample value of the current sample position is determined according to the reconstructed value of the current block, and the reconstructed sample value of the reference sample position corresponding to the current sample position is determined according to the reconstructed samples of the inter-frame reference image; the filtered reconstructed sample value of the current sample position is determined according to the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, and the reconstructed sample value of the reference sample position; and the filtered reconstructed value of the current block is determined according to the filtered reconstructed sample value of the current sample position.
[0355] It is understood that in the embodiments of this application, for the forward filtering mode and backward filtering mode in the RA configuration, and the first forward filtering mode (most recent first frame) and the second forward filtering mode (most recent second frame) in the LD configuration, the current image corresponds to an inter-frame reference image. When performing TALF filtering on the reconstructed value of the current block based on the reconstructed sample of the inter-frame reference image, the reference sample position corresponding to the current sample position can be determined in the inter-frame reference image. Then, the reconstructed sample value corresponding to the current sample position and the reconstructed sample value corresponding to the reference sample position are respectively input into the TALF filter. Combined with the determined filter coefficients corresponding to the current block, the filtered reconstructed sample value corresponding to the current sample position is finally determined. The above scheme is used to traverse any sample position of the current block to complete the filtering of the current block and obtain the filtered reconstructed value of the current block.
[0356] For example, in some embodiments, assuming that the current image corresponds to an inter-frame reference image, the process of filtering the sample value at coordinate (x, y) (the current sample position) in the current image using a 7x7 symmetric filter with 13 filter coefficients is as follows:
[0357] Among them, rec′ (x,y) rec represents the reconstructed sample value at position (x, y) after time-domain adaptive filtering correction. (x,y) These are the reconstructed sample values at the (x, y) positions to be corrected. and It is in the inter-frame reference image (xu) i ,yu i ) and (x+u i y+u i The reconstructed sample values on the time domain are c, which are the coefficients of the time-domain adaptive filter.
[0358] Furthermore, in the embodiments of this application, when determining the filtered reconstructed sample value of the current sample position based on the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, and the reconstructed sample value of the reference sample position, a first sample difference can be determined based on the reconstructed sample value of the current sample position and the reconstructed sample value of the reference sample position; and then the filtered reconstructed sample value of the current sample position can be determined based on the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, and the first sample difference.
[0359] In other words, in the embodiments of this application, it is also possible to first determine the first sample difference based on the reconstructed sample value at the current sample position and the reconstructed sample value at the reference sample position, and then use the first sample difference as the input of the filter.
[0360] For example, in some embodiments, assuming that the current image corresponds to an inter-frame reference image, the process of filtering the sample value at coordinate (x, y) (the current sample position) in the current image using a 7x7 symmetric filter with 13 filter coefficients is as follows:
[0361] Furthermore, in the embodiments of this application, when determining the filtered reconstructed sample value of the current sample position based on the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, and the reconstructed sample value of the reference sample position, the filtering position corresponding to the reference sample position can be determined in the current block, and the reconstructed sample value of the filtering position can be determined based on the reconstructed value of the current block; the second sample difference can be determined based on the reconstructed sample value of the filtering position and the reconstructed sample value of the reference sample position; and the filtered reconstructed sample value of the current sample position can be determined based on the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, and the second sample difference.
[0362] In other words, in the embodiments of this application, it is also possible to select, for each filtering position, a second sample difference value is determined based on the reconstructed sample value of the filtering position and the reconstructed sample value of the reference sample position, and then the second sample difference value is used as the input of the filter.
[0363] For example, in some embodiments, assuming that the current image corresponds to an inter-frame reference image, the process of filtering the sample value at coordinate (x, y) (the current sample position) in the current image using a 7x7 symmetric filter with 13 filter coefficients is as follows:
[0364] Further, in the embodiments of this application, when filtering the current block based on the reconstructed samples of at least one inter-frame reference image and the filter coefficients corresponding to the current block to determine the filtered reconstructed value of the current block, for the current sample position in the current block, the reconstructed sample value of the current sample position is determined according to the reconstructed value of the current block; the reconstructed sample value of the first reference sample position corresponding to the current sample position is determined according to the reconstructed samples of the first inter-frame reference image; the reconstructed sample value of the second reference sample position corresponding to the current sample position is determined according to the reconstructed samples of the second inter-frame reference image; the filtered reconstructed sample value of the current sample position is determined according to the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, the reconstructed sample value of the first reference sample position, and the reconstructed sample value of the second reference sample position; and the filtered reconstructed value of the current block is determined according to the filtered reconstructed sample value of the current sample position.
[0365] It is understood that in the embodiments of this application, for the bidirectional filtering mode in the RA configuration and the third forward filtering mode (most recent first frame and most recent second frame) in the LD configuration, the current image corresponds to two inter-frame reference images. When performing TALF filtering on the reconstructed value of the current block based on the reconstructed samples of the two inter-frame reference images, the reference sample positions corresponding to the current sample position can be determined in the two inter-frame reference images respectively. Then, the reconstructed sample value corresponding to the current sample position and the reconstructed sample values corresponding to the two reference sample positions are respectively input into the TALF filter. Combined with the determined filter coefficients corresponding to the current block, the filtered reconstructed sample value corresponding to the current sample position is finally determined. The above scheme is used to traverse any sample position of the current block to complete the filtering of the current block and obtain the filtered reconstructed value of the current block.
[0366] For example, in some embodiments, assuming that the current image corresponds to two inter-frame reference images, the process of filtering the sample value at coordinate (x, y) (the current sample position) in the current image using two 5x5 symmetrical filters with 7 filter coefficients is as follows:
[0367] Among them, rec′ (x,y) rec represents the reconstructed sample value at position (x, y) after time-domain adaptive filtering correction. (x,y) These are the reconstructed sample values at the (x, y) position to be corrected, where ref0 and ref1 are the reconstructed values from the first and second inter-frame reference images, respectively. and It is in the first inter-frame reference image (xu) i ,yu i ) and (x+u i y+u i Reconstructed sample values on ) and It is in the second inter-frame reference image (xu) i ,yu i ) and (x+u i y+u i The reconstructed sample values on the time domain are c, which are the coefficients of the time-domain adaptive filter.
[0368] Furthermore, in the embodiments of this application, when determining the filtered reconstructed sample value of the current sample position based on the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, the reconstructed sample value of the first reference sample position, and the reconstructed sample value of the second reference sample position, a third sample difference can be determined based on the reconstructed sample value of the current sample position and the reconstructed sample value of the first reference sample position; a fourth sample difference can be determined based on the reconstructed sample value of the current sample position and the reconstructed sample value of the second reference sample position; and the filtered reconstructed sample value of the current sample position can be determined based on the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, the third sample difference, and the fourth sample difference.
[0369] In other words, in the embodiments of this application, it is also possible to first determine the third sample difference and the fourth sample difference based on the reconstructed sample value at the current sample position and the reconstructed sample values at the two reference sample positions, and then use the third sample difference and the fourth sample difference as the input of the filter.
[0370] For example, in some embodiments, assuming that the current image corresponds to two inter-frame reference images, the process of filtering the sample value at coordinate (x, y) (the current sample position) in the current image using two 5x5 symmetrical filters with 7 filter coefficients is as follows:
[0371] Furthermore, in the embodiments of this application, when determining the filtered reconstructed sample value of the current sample position based on the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, the reconstructed sample value of the first reference sample position, and the reconstructed sample value of the second reference sample position, the filtering position corresponding to the reference sample position can be determined in the current block, and the reconstructed sample value of the filtering position can be determined based on the reconstructed value of the current block; the fifth sample difference can be determined based on the reconstructed sample value of the filtering position and the reconstructed sample value of the first reference sample position; the sixth sample difference can be determined based on the reconstructed sample value of the filtering position and the reconstructed sample value of the second reference sample position; and the filtered reconstructed sample value of the current sample position can be determined based on the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, the fifth sample difference, and the sixth sample difference.
[0372] In other words, in the embodiments of this application, it is also possible to select, for each filtering position, to determine the fifth sample difference and the sixth sample difference based on the reconstructed sample value of the filtering position and the reconstructed sample values of the two reference sample positions respectively, and then use the fifth sample difference and the sixth sample difference as the input of the filter.
[0373] For example, in some embodiments, assuming that the current image corresponds to two inter-frame reference images, the process of filtering the sample value at coordinate (x, y) (the current sample position) in the current image using two 5x5 symmetrical filters with 7 filter coefficients is as follows:
[0374] It should be noted that, in the embodiments of this application, the filtering process shown in the above formula is an exemplary illustration of the TALF filtering proposed in this application. Of course, in practical applications, if the adaptive filter does not have the symmetry of the above example, then the adaptive filter coefficients and the input values corresponding to each coefficient should also be adjusted accordingly. That is, the filtering process should be a process in which the adaptive filter coefficients work together with the reconstructed values of the reference image at each relevant location.
[0375] It should be noted that, in the embodiments of this application, the filter coefficients can be integers, and the parameters used in the filtering process may also include bias and shift.
[0376] Furthermore, in the embodiments of this application, for the TALF filter, in addition to at least one inter-frame reference image that has been decoded in the time domain, the corresponding input information may also include the reconstructed value of the current block, such as the reconstructed value of any image component of the current block. The reconstructed value of the current block can be obtained by processing the current block in the current image based on any loop filtering method.
[0377] In other words, in the embodiments of this application, this application does not specifically limit the method for determining the reconstructed value of the current block. Correspondingly, this application does not specifically limit the specific position of TALF filtering in the loop filtering process, that is, the position of the time domain adaptive loop filtering can be located at any point in the loop filtering.
[0378] For example, in some embodiments, FIG11 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application. As shown in FIG11, the input of TALF may include the reconstructed value on the reconstructed image of the decoded and reconstructed image in the time domain and the current image before ALF filtering.
[0379] For example, in some embodiments, FIG12 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application. As shown in FIG12, the input of TALF may include the reconstructed image of the decoded and reconstructed image in the time domain and the reconstructed image of the current image after deblocking. That is, TALF can be placed in the same position as SAO in the loop filtering.
[0380] For example, in some embodiments, Figure 13 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application. As shown in Figure 13, TALF can be placed alongside Deblocking in the loop filtering.
[0381] For example, in some embodiments, Figure 14 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application. As shown in Figure 14, the position of TALF in the loop filtering can be before Deblocking.
[0382] For example, in some embodiments, Figure 15 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application. As shown in Figure 15, the input of TALF may include the reconstructed image of the decoded and reconstructed image in the time domain and the reconstructed image of the current image after deblocking. That is, the position of TALF in the loop filtering can be after deblocking.
[0383] For example, in some embodiments, FIG16 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application. As shown in FIG16, the input of TALF may include the reconstructed image of the decoded and reconstructed image in the time domain and the reconstructed image of the current image after SAO. That is, the position of TALF in the loop filtering can be after SAO.
[0384] For example, in some embodiments, FIG17 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application. As shown in FIG17, the input of TALF may also include the reconstructed value on the reconstructed image of the time-domain decoded reconstructed image and the current image after ALF filtering, that is, the position of TALF in the loop filtering may be after ALF.
[0385] Therefore, in some embodiments, the TALF can be placed at any position in a series of loop filters, which means that the input of the TALF includes the decoded image and the reconstructed value on the reconstructed image at any stage of the current loop filter.
[0386] 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.
[0387] In other words, in the embodiments of this application, TALF filtering can be applied to any image component of the current image.
[0388] 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.
[0389] 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.
[0390] For example, in some embodiments, FIG18 is a schematic diagram of a filter proposed in an embodiment of the present application. As shown in FIG18, a 5x5 symmetrical filter contains 7 filter coefficients.
[0391] For example, in some embodiments, Figure 19 is a schematic diagram of a filter proposed in the embodiments of this application. As shown in Figure 19, a 7x7 symmetrical filter contains 13 filter coefficients.
[0392] For example, in some embodiments, Figure 20 is a schematic diagram of the filter proposed in the embodiments of this application. As shown in Figure 20, a 9x9 symmetrical filter contains 21 filter coefficients.
[0393] Among them, the above types are symmetrical filters. Each index value corresponds to a filter coefficient value. Except for the filter center point, each filter coefficient corresponds to two filter input values at symmetrical positions.
[0394] For example, in some embodiments, Figure 21 is a schematic diagram of a filter proposed in the embodiments of this application. As shown in Figure 21, a 5x5 symmetrical filter contains 4 filter coefficients.
[0395] For example, in some embodiments, Figure 22 is a schematic diagram of the filter proposed in the embodiments of this application. As shown in Figure 22, a 7x7 symmetrical filter contains 6 filter coefficients.
[0396] In a symmetrical filter, each index value corresponds to a filter coefficient value, and each filter coefficient corresponds to filter input values in multiple directions, except for the filter center point.
[0397] Of course, filters can also be asymmetric, which means that each filter input location has different coefficient values.
[0398] For example, in some embodiments, Figure 23 is a schematic diagram of a filter proposed in the embodiments of this application. As shown in Figure 23, a 5x5 asymmetric filter contains 13 filter coefficients.
[0399] For example, in some embodiments, for forward filtering and backward filtering under RA configuration, and for forward filtering using reconstructed values from the POC N-1 reference image as input and forward filtering using reconstructed values from the POC N-2 reference image as input under LD configuration, a 7x7 symmetric filter with 13 filter coefficients can be selected.
[0400] For example, in some embodiments, Figure 24 is a schematic diagram of the filter proposed in the embodiments of this application. As shown in Figure 24, there are two 5x5 symmetrical filters, which contain a total of 14 filter coefficients. Among them, for bidirectional filtering under RA configuration and forward filtering using the reconstructed values in the reference images of POC N-1 and N-2 as input under LD configuration, the two filters shown in Figure 24 can be selected to be used, respectively for the reconstructed values in the two reference images as input.
[0401] It is understood that the decoding method proposed in this application is a method that uses reconstructed sample values in the time domain as an information source to improve the reconstruction quality of the current image. The method uses a TALF filter to extract information from the reconstructed samples of the reconstructed image to filter the current image.
[0402] It is understood that in the decoding method proposed in this application, the filter coefficients of the time-domain filter can be predefined or transmitted through the bitstream.
[0403] It is understood that the decoding method proposed in this application embodiment can be adapted to different encoding configurations, resulting in different filtering methods under different filtering modes. Specifically, under the RA configuration, the filtering modes can be distinguished into forward filtering mode, reverse filtering mode, and bidirectional filtering mode; under the LD configuration, the filtering modes can be distinguished into first forward filtering mode, second forward filtering mode, and third forward filtering mode.
[0404] It is understood that the decoding method proposed in this application embodiment can use TALF for either the luminance component or the chrominance component.
[0405] 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.
[0406] It is understood that the decoding method proposed in this application embodiment may also choose to skip the encoding and decoding process of the CTU identifier and directly decide whether to perform TALF filtering on the entire image based on the image-level identifier. In this case, the current image corresponds to only one candidate filter.
[0407] This application provides a decoding method in which, during the TALF filtering process, relevant information of recorded and stored historical TALF filters can be reused, thereby reducing codeword consumption and improving encoding and decoding performance.
[0408] One embodiment of this application proposes an encoding method applied to an encoder for use in scenarios where filtering is performed by a TALF filter. Figure 25 is a schematic diagram of the encoding method proposed in this application embodiment. As shown in Figure 25, the method for the encoder to perform encoding processing may include the following steps:
[0409] Step 2001: When filtering the current image using TALF, determine the cost of using historical TALF information for filtering and the cost of not using historical TALF information for filtering.
[0410] 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.
[0411] 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.
[0412] 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.
[0413] In one implementation, a method for reusing historical TALF information includes determining a data cell corresponding to a data cell index from a historical dataset, such as an element in a FIFO, and then obtaining the filtering mode, the number of filter groups, and the filter coefficients of the candidate filters recorded and stored in that data cell.
[0414] In one implementation, considering that time-domain filtering has three filtering modes under both RA and LD configurations, different types of filtering modes can be stored and updated using different FIFOs. One method for reusing historical TALF information includes selecting a historical dataset corresponding to a filtering mode from multiple historical datasets, then determining the data unit corresponding to the data unit index within that historical dataset, and then obtaining the number of filter groups and filter coefficients of the candidate filters recorded and stored in that data unit.
[0415] In one implementation, considering that the input to TALF can include either one inter-frame reference image or two inter-frame reference images, different FIFOs can be used to store and update the data volume of different input images. One method for reusing historical TALF information includes selecting a historical dataset corresponding to the filtering mode (the number of input inter-frame reference images) from multiple historical datasets, then identifying the data unit corresponding to the data unit index within that historical dataset, and finally obtaining the number of filter groups and the filter coefficients of the candidate filters recorded and stored in that data unit.
[0416] In one implementation, temporal adaptive filters from different slices (or different images) can be combined. One method of reusing historical TALF information includes identifying data cells corresponding to data cell indices from a historical dataset, and then obtaining the filter coefficients of candidate filters recorded and stored in that data cell.
[0417] In one implementation, historical time-domain loop filters can be combined, but the filters in each filtering mode are updated in the same FIFO. One method of reusing historical TALF information includes determining a data cell corresponding to a data cell index from a historical dataset, and then obtaining the filtering modes and filter coefficients of the candidate filters recorded and stored in that data cell.
[0418] It should be noted that, in the embodiments of this application, the cost value can be calculated in any way, including but not limited to the rate-distortion optimization (RDO) algorithm.
[0419] Step 2002: Determine the multiplexing identifier information based on the cost of filtering with and without using the historical TALF information, and write the multiplexing identifier information into the bitstream; wherein, the multiplexing identifier information is used to determine whether to use the historical TALF information for filtering.
[0420] 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.
[0421] 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.
[0422] 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.
[0423] 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.
[0424] 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.
[0425] 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.
[0426] 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.
[0427] 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.
[0428] 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.
[0429] 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.
[0430] Of course, the value of talf_reuse_flag is not limited to 0 and 1, and this application does not impose specific restrictions.
[0431] For example, in some embodiments, the slice-level syntax element is as follows:
[0432] 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; if the flag is 0, it indicates that it is not reused. When this syntax element does not exist in the bitstream, its default value can be 0.
[0433] Therefore, in the embodiments of this application, for TALF filtering, an adaptive loop filter that reuses the history can be introduced by reusing the identification information, thereby saving the extra codeword consumption caused by encoding and decoding new filter coefficients (filter coefficients).
[0434] Furthermore, in the embodiments of this application, when determining the reuse identifier information based on the cost of filtering with reused historical TALF information and the cost of filtering without reused historical TALF information, if the cost of filtering with reused historical TALF information is greater than or equal to the cost of filtering without reused historical TALF information, the reuse identifier information is set to indicate that filtering with reused historical TALF information is not performed; if the cost of filtering with reused historical TALF information is less than the cost of filtering with reused historical TALF information, the reuse identifier information is set to indicate that filtering with reused historical TALF information is performed.
[0435] Step 2003: If it is determined that the historical TALF information is to be filtered, determine the multiplexing index parameter and write the multiplexing index parameter into the bitstream.
[0436] In the embodiments of this application, if it is determined that historical TALF information is reused for filtering, then the reuse index parameters can be further determined and written into the bitstream.
[0437] Furthermore, in the embodiments of this application, when determining the reuse index parameters, if it is determined that the reused historical TALF information is filtered, the minimum cost value among the cost values when the reused historical TALF information is filtered is determined; the historical TALF information corresponding to the minimum cost value is determined, and the data unit for storing the historical TALF information corresponding to the minimum cost value is determined; the reuse index parameters are determined according to the data unit.
[0438] It is understood that, in the embodiments of this application, the reused index parameter can be used to determine the data unit that records and stores historical TALF information. The data unit that records and stores historical TALF information can be a storage structure or storage element in the candidate historical dataset, and this application does not impose specific limitations on it.
[0439] In other words, in the embodiments of this application, the historical TALF information to be reused can be indicated by the reuse index parameter. For example, a reuse index (reuse index parameter) can be used to indicate which historical TALF information is being reused.
[0440] It should be noted that, in the embodiments of this application, the candidate historical dataset may include one or more historical datasets. That is, this application does not specifically limit the number of datasets that record and store historical TALF information.
[0441] For example, in some embodiments, the candidate historical dataset can be a FIFO, that is, the FIFO used to store historical filters can be saved and updated in units of slices (or images), and the corresponding historical filter can be selected from the FIFO when it is determined that a historical filter is to be reused.
[0442] It is understood that, in the embodiments of this application, assuming that the candidate historical dataset is a FIFO, the method of 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.
[0443] 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.
[0444] 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.
[0445] 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.
[0446] 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.
[0447] Of course, the length of the FIFO can be any integer value greater than 0, and is not limited to 8.
[0448] Therefore, in the embodiments of this application, when the current image (or current slice) uses TALF, it is necessary to additionally encode and decode an identifier to indicate whether to reuse the TALFs (historical TALF information) of other images (or slices) in the FIFO. If reused, the index of the FIFO is further encoded and decoded to determine the TALFs to be reused. Otherwise, the adaptive temporal filtering parameters obtained from the current image are encoded and decoded, and the FIFO is updated.
[0449] It is understood that in the embodiments of this application, the reuse 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. The value of talf_reuse_idx can be determined based on the storage length of the candidate historical dataset. For example, assuming that the maximum length of the FIFO is 8, then the value range of talf_reuse_idx can be 0 to 7, which respectively represent which set of historical time-domain adaptive loop filters in the FIFO is reused.
[0450] For example, in some embodiments, the slice-level syntax element is as follows:
[0451] The `talf_reuse_idx` parameter indicates the index of the time-domain adaptive filter in the FIFO. Since the FIFO length is a maximum of 8 bits in this example, `talf_reuse_idx` uses a 3-bit fixed-length code for encoding and decoding. In other cases, variable-length codes or other length encoding / decoding methods can be used. The value of `talf_reuse_idx` ranges from 0 to 7, representing which set of historical time-domain adaptive loop filters in the FIFO is reused. When this syntax element is not present in the bitstream, its default value is 0.
[0452] Furthermore, in the embodiments of this application, if it is determined that historical TALF information will not be reused for filtering, the TALF information corresponding to the current image can be determined first; then the candidate historical dataset corresponding to the current image can be updated based on the TALF information corresponding to the current image; wherein the candidate historical dataset includes at least one historical dataset.
[0453] Furthermore, in the embodiments of this application, after determining the reuse identifier information, if it is determined based on the reuse identifier information that historical TALF information should not be reused for filtering, then the determination and encoding of the reuse index parameter can be skipped, and the TALF information corresponding to the current image (or current slice) can be directly determined; then the candidate historical dataset is updated based on the TALF information corresponding to the current image (or current slice).
[0454] It is understood that in the embodiments of this application, the comparison of cost values is used to determine whether to reuse the historical temporal adaptive loop filter (historical TALF information). If it is not reused, the filter and its coefficients for the current image are further determined, that is, the TALF information corresponding to the current image is determined. Then, the candidate historical dataset can be updated using the TALF information corresponding to the current image, for example, the TALF information corresponding to the current image can be stored in the candidate historical dataset.
[0455] Furthermore, in the embodiments of this application, after determining that historical TALF information is not reused, at least one inter-frame reference image corresponding to the current image and the filter coefficients corresponding to the current block can be determined first.
[0456] It is understood that, in the embodiments of this application, at least one inter-frame reference image corresponding to the current image and the filter coefficients corresponding to the current block can be determined in the current configuration and in each candidate mode corresponding to the current configuration.
[0457] 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 encoded 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.
[0458] 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.
[0459] Furthermore, in the embodiments of this application, when determining at least one inter-frame reference image corresponding to the current image and the filter coefficients corresponding to the current block, a candidate mode can be determined first according to the current configuration; then, under each candidate mode, the at least one inter-frame reference image is determined, the candidate filter corresponding to the current block is determined, and the filter coefficients corresponding to the current block are determined based on the candidate filter corresponding to the current block.
[0460] Furthermore, in embodiments of this application, when determining a candidate mode based on the current configuration, if the current configuration is RA configuration, the candidate mode is determined as a first candidate mode; wherein, the first candidate mode includes one or more of forward filtering mode, reverse filtering mode, and bidirectional filtering mode; if the current configuration is LD configuration, the candidate mode is determined as a second candidate mode; wherein, the second candidate mode includes one or more of first forward filtering mode, second forward filtering mode, and third forward filtering mode.
[0461] It is understood that, in the embodiments of this application, for the RA configuration, the corresponding first candidate mode may include one or more of the forward filtering mode, the inverse filtering mode, and the bidirectional filtering mode. Specifically, the forward filtering mode can be understood as using the reconstruction information of a reconstructed image smaller than the current image POC as the filter input; the inverse filtering mode can be understood as using the reconstruction information of a reconstructed image larger than the current image POC as the filter input; and the bidirectional filtering mode can be understood as simultaneously using the reconstruction information of both images smaller than the current image POC and images larger than the current image POC as the filter input.
[0462] It is understood that, in the embodiments of this application, for the LD configuration, the corresponding second candidate mode may include one or more of the first forward filtering mode, the second forward filtering mode, and the third forward filtering mode. Specifically, for encoding and decoding under the LD configuration, the encoding / decoding order is the same as the playback order, so only reference images smaller than the current image POC can be used as the filter input, i.e., only the forward filtering mode is supported. However, corresponding to different inter-frame reference images, the corresponding forward filtering modes can be distinguished as the first forward filtering mode, the second forward filtering mode, and the third forward filtering mode.
[0463] Furthermore, in the embodiments of this application, after determining the filtering mode corresponding to the current image, at least one inter-frame reference image can be further determined based on the filtering mode.
[0464] It is understood that in the embodiments of this application, the determination of the inter-frame reference image depends on the filtering mode, and the final determined inter-frame reference image may be different for different filtering modes.
[0465] For example, in some embodiments, if the POC value of the current image is N, for the RA configuration, if the determined filtering mode is forward filtering mode, then the image with a POC value of N-1 can be selected as the inter-frame reference image of the current image; if the determined filtering mode is reverse filtering mode, then the image with a POC value of N+1 can be selected as the inter-frame reference image of the current image; if the determined filtering mode is bidirectional filtering mode, then the image with a POC value of N-1 and the image with a POC value of N+1 can be selected as the inter-frame reference image of the current image.
[0466] For example, in some embodiments, if the POC value of the current image is N, for the LD configuration, images with POC values of N-1, N-2, ... can be used as inter-frame reference images for the current image. For instance, if the determined filtering mode is a first forward filtering mode, then an image with a POC value of N-1 can be selected as the inter-frame reference image for the current image; if the determined filtering mode is a second forward filtering mode, then an image with a POC value of N-2 can be selected as the inter-frame reference image for the current image; if the determined filtering mode is a third forward filtering mode, then images with POC values of both N-1 and N-2 can be selected as the inter-frame reference images for the current image.
[0467] In other words, in the embodiments of this application, the POC values of the inter-frame reference images determined based on different filtering modes can be different, and the number of inter-frame reference images determined can also be different. For example, for the forward filtering mode and backward filtering mode in the RA configuration, and the first forward filtering mode (most recent first frame) and the second forward filtering mode (most recent second frame) in the LD configuration, the current image corresponds to one inter-frame reference image; for the bidirectional filtering mode in the RA configuration, and the third forward filtering mode (most recent first frame and most recent second frame) in the LD configuration, the current image corresponds to two inter-frame reference images.
[0468] Therefore, for temporal adaptive loop filtering, intra-frame coded images have no reference image, while inter-frame coded images do. Thus, the temporal filtering in this scheme is applied to inter-frame coded images, such as those under RA and LD configurations. For LD configurations, the encoding / decoding order is the same as the playback order. Therefore, when applying temporal adaptive filtering to inter-frame coded images, a reference image smaller than the current image's POC is always used as the filter input. For RA configurations, the encoding / decoding order may differ from the playback order. When applying temporal filtering to the current inter-frame coded image, a reference frame with a larger or smaller POC than the current frame can be used as the filter input.
[0469] Forward filtering uses the reconstruction information of a reconstructed image with a smaller POC than the current image as input to the filter, generating a filtered value that applies to the current reconstructed image. For example, in LD configuration, if the POC of the current image is N (where N is a non-negative integer), the reconstruction values of reconstructed images with POC values of N-1, N-2, etc., can be used as input to the filter. Similarly, in RA configuration, under the encoding / decoding sequence, when the POC of the current image is N, the inter-frame coded image with TID 5 can use the reconstruction value of an image with a POC value of N-1 as input; when TID is 4, it can use the reconstruction value of an image with a POC value of N-2; when TID is 3, it can use the reconstruction value of an image with a POC value of N-4; when TID is 2, it can use the image with a POC value of N-8; when TID is 1, it can use the reconstruction value of an image with a POC value of N-16; and when TID is 0, it can use the reconstruction value of an image with a POC value of N-32.
[0470] It should be noted that, in the embodiments of this application, the POC value of the reference frame used during forward filtering may also change due to different encoding configurations.
[0471] Inverse filtering uses the reconstruction information of a reconstructed image with a larger POC than the current image as input to the filter, generating a filtered value that applies to the current reconstructed image. Under current coding configurations, inverse filtering is only used in the RA configuration. For example, in the RA configuration, in the encoding / decoding order, when the POC of the current image is N, the inter-frame coded image with TID 5 can use the reconstructed value of the image with POC value N+1 as the filter input; when TID is 4, it can use the reconstructed value of the image with POC value N+2; when TID is 3, it can use the reconstructed value of the image with POC value N+4; when TID is 2, it can use the image with POC value N+8; when TID is 1, it can use the reconstructed value of the image with POC value N+16; and when TID is 0, it can use the reconstructed value of the image with POC value N+32.
[0472] It should be noted that, in the embodiments of this application, the POC value of the reference frame used during inverse filtering may also change due to different encoding configurations.
[0473] Bidirectional filtering uses reconstruction information from both images with a smaller POC than the current image and images with a larger POC as input to the filter, generating a filtered value that applies to the current reconstructed image. Under current coding configurations, inverse filtering is only used in the RA configuration. For example, in the RA configuration, in the encoding / decoding order, when the current image's POC is N, the inter-frame coded image with TID 5 can use the reconstructed values of images with POC values of N+1 and N-1 as filter input; with TID 4, it can use the reconstructed values of images with POC values of N+2 and N-2; with TID 3, it can use the reconstructed values of images with POC values of N+4 and N-4; with TID 2, it can use the images with POC values of N+8 and N-8; with TID 1, it can use the reconstructed values of images with POC values of N+16 and N-16; and with TID 0, it can use the reconstructed values of images with POC values of N+32 and N-32.
[0474] It should be noted that, in the embodiments of this application, due to different encoding configurations, the POC value of the reference frame used in bidirectional filtering will also change. In principle, under the RA configuration, bidirectional filtering will always use the reconstructed values of the two reconstructed images with the closest forward and backward distances as the input of the filter.
[0475] For example, in some embodiments, assuming the filtering mode is a forward filtering mode, then the following forward filtering modes may be included, but are not limited to:
[0476] 1. In RA configuration, use the reference image with the smallest POC and the closest temporal distance to the current image as the input for temporal filtering;
[0477] 2. In LD configuration, when the current image POC value is N, corresponding to the first forward filtering mode, a reference image with a POC value of N-1 is used as the input for temporal filtering;
[0478] 3. In LD configuration, when the current image POC value is N, corresponding to the second forward filtering mode, a reference image with a POC value of N-2 is used as the input for temporal filtering;
[0479] 4. In LD configuration, when the current image POC value is N, it corresponds to the third forward filtering mode, and two reference images with POC values of N-2 and N-1 are used as inputs for temporal filtering.
[0480] It is understood that in the embodiments of this application, under the encoding configuration of RA or LD, the allowed modes of TALF can be determined by traversing each candidate mode. Specifically, there are three candidate modes for TALF under both RA and LD configurations. For the RA configuration, in the corresponding first candidate modes, forward filtering (forward filtering mode) is mode 1, backward filtering (backward filtering mode) is mode 2, and bidirectional filtering (bidirectional filtering mode) is mode 3. For the LD configuration, in the corresponding second candidate modes, using reference image POC N-1 as the TALF filter input (first forward filtering mode) is mode 1, using reference image POC N-2 as the TALF filter input (second forward filtering mode) is mode 2, and simultaneously using both reference images POC N-1 and N-2 as the TALF filter input (third forward filtering mode) is mode 3.
[0481] Furthermore, in the embodiments of this application, each candidate mode can be traversed, and in each candidate mode, a candidate filter corresponding to the current block can be determined, and the filter coefficients corresponding to the current block can be determined based on the candidate filter corresponding to the current block.
[0482] It is understood that, in the embodiments of this application, each filtering mode (candidate mode) can be traversed, and the Wienerhof equation can be constructed using the current image reconstruction value under the corresponding mode, the reconstruction value of the reconstructed image (inter-frame reference image), and the original value of the current image, and 1 to 4 sets of filter coefficients can be parsed out. Specifically, for each set of candidate filters that may be used in the current block, the filter coefficients corresponding to that candidate filter can be derived; that is, the filter coefficients corresponding to the current block may include the filter coefficients of each set of candidate filters.
[0483] Furthermore, in the embodiments of this application, after determining at least one inter-frame reference image corresponding to the current image and the filter coefficients corresponding to the current block, the current block can be further filtered based on the reconstructed samples of the at least one inter-frame reference image and the filter coefficients corresponding to the current block to determine the filtered reconstructed value of the current block.
[0484] It is understood that, in the embodiments of this application, in each candidate mode, each set of candidate filters can be used respectively, and the reconstructed value of the current block can be filtered by using the filter coefficients corresponding to the current block under the candidate filter and the reconstructed samples of at least one inter-frame reference image corresponding to the candidate mode, so as to determine the filtered reconstructed value of the current block.
[0485] It is understood that, in the embodiments of this application, since the POC values of the inter-frame reference images determined based on different filtering modes may be different, and the number of inter-frame reference images determined may also be different, when performing TALF filtering on the current block of the current image, the filtering process performed will be different for different numbers of inter-frame reference images.
[0486] Furthermore, in the embodiments of this application, when filtering the current block based on the reconstructed samples of at least one inter-frame reference image and the filter coefficients corresponding to the current block to determine the filtered reconstructed value of the current block, for the current sample position in the current block, the reconstructed sample value of the current sample position is determined according to the reconstructed value of the current block, and the reconstructed sample value of the reference sample position corresponding to the current sample position is determined according to the reconstructed samples of the inter-frame reference image; the filtered reconstructed sample value of the current sample position is determined according to the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, and the reconstructed sample value of the reference sample position; and the filtered reconstructed value of the current block is determined according to the filtered reconstructed sample value of the current sample position.
[0487] It is understood that in the embodiments of this application, for the forward filtering mode and backward filtering mode in the RA configuration, and the first forward filtering mode (most recent first frame) and the second forward filtering mode (most recent second frame) in the LD configuration, the current image corresponds to an inter-frame reference image. When performing TALF filtering on the reconstructed value of the current block based on the reconstructed sample of the inter-frame reference image, the reference sample position corresponding to the current sample position can be determined in the inter-frame reference image. Then, the reconstructed sample value corresponding to the current sample position and the reconstructed sample value corresponding to the reference sample position are respectively input into the TALF filter. Combined with the determined filter coefficients corresponding to the current block, the filtered reconstructed sample value corresponding to the current sample position is finally determined. The above scheme is used to traverse any sample position of the current block to complete the filtering of the current block and obtain the filtered reconstructed value of the current block.
[0488] For example, in some embodiments, it is assumed that the current image corresponds to an inter-frame reference image. In this case, the process of filtering the sample value at the coordinate (x, y) position (current sample position) in the current image using 13 filter coefficients and a 7x7 symmetric filter is as shown in formula (1).
[0489] Furthermore, in the embodiments of this application, when determining the filtered reconstructed sample value of the current sample position based on the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, and the reconstructed sample value of the reference sample position, a first sample difference can be determined based on the reconstructed sample value of the current sample position and the reconstructed sample value of the reference sample position; and then the filtered reconstructed sample value of the current sample position can be determined based on the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, and the first sample difference.
[0490] In other words, in the embodiments of this application, it is also possible to first determine the first sample difference based on the reconstructed sample value at the current sample position and the reconstructed sample value at the reference sample position, and then use the first sample difference as the input of the filter.
[0491] For example, in some embodiments, it is assumed that the current image corresponds to an inter-frame reference image. In this case, the process of filtering the sample value at the coordinate (x, y) position (current sample position) in the current image using 13 filter coefficients and a 7x7 symmetric filter is as shown in formula (2).
[0492] Furthermore, in the embodiments of this application, when determining the filtered reconstructed sample value of the current sample position based on the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, and the reconstructed sample value of the reference sample position, the filtering position corresponding to the reference sample position can be determined in the current block, and the reconstructed sample value of the filtering position can be determined based on the reconstructed value of the current block; the second sample difference can be determined based on the reconstructed sample value of the filtering position and the reconstructed sample value of the reference sample position; and the filtered reconstructed sample value of the current sample position can be determined based on the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, and the second sample difference.
[0493] In other words, in the embodiments of this application, it is also possible to select, for each filtering position, a second sample difference value is determined based on the reconstructed sample value of the filtering position and the reconstructed sample value of the reference sample position, and then the second sample difference value is used as the input of the filter.
[0494] For example, in some embodiments, it is assumed that the current image corresponds to an inter-frame reference image. In this case, the process of filtering the sample value at the coordinate (x, y) position (current sample position) in the current image using 13 filter coefficients and a 7x7 symmetric filter is as shown in formula (3).
[0495] Further, in the embodiments of this application, when filtering the current block based on the reconstructed samples of at least one inter-frame reference image and the filter coefficients corresponding to the current block to determine the filtered reconstructed value of the current block, for the current sample position in the current block, the reconstructed sample value of the current sample position is determined according to the reconstructed value of the current block; the reconstructed sample value of the first reference sample position corresponding to the current sample position is determined according to the reconstructed samples of the first inter-frame reference image; the reconstructed sample value of the second reference sample position corresponding to the current sample position is determined according to the reconstructed samples of the second inter-frame reference image; the filtered reconstructed sample value of the current sample position is determined according to the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, the reconstructed sample value of the first reference sample position, and the reconstructed sample value of the second reference sample position; and the filtered reconstructed value of the current block is determined according to the filtered reconstructed sample value of the current sample position.
[0496] It is understood that in the embodiments of this application, for the bidirectional filtering mode in the RA configuration and the third forward filtering mode (most recent first frame and most recent second frame) in the LD configuration, the current image corresponds to two inter-frame reference images. When performing TALF filtering on the reconstructed value of the current block based on the reconstructed samples of the two inter-frame reference images, the reference sample positions corresponding to the current sample position can be determined in the two inter-frame reference images respectively. Then, the reconstructed sample value corresponding to the current sample position and the reconstructed sample values corresponding to the two reference sample positions are respectively input into the TALF filter. Combined with the determined filter coefficients corresponding to the current block, the filtered reconstructed sample value corresponding to the current sample position is finally determined. The above scheme is used to traverse any sample position of the current block to complete the filtering of the current block and obtain the filtered reconstructed value of the current block.
[0497] For example, in some embodiments, it is assumed that the current image corresponds to two inter-frame reference images. In this case, the process of filtering the sample value at the coordinate (x, y) position (current sample position) in the current image using 7 filter coefficients and 2 filters with 5x5 symmetry is as shown in formula (4).
[0498] Furthermore, in the embodiments of this application, when determining the filtered reconstructed sample value of the current sample position based on the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, the reconstructed sample value of the first reference sample position, and the reconstructed sample value of the second reference sample position, a third sample difference can be determined based on the reconstructed sample value of the current sample position and the reconstructed sample value of the first reference sample position; a fourth sample difference can be determined based on the reconstructed sample value of the current sample position and the reconstructed sample value of the second reference sample position; and the filtered reconstructed sample value of the current sample position can be determined based on the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, the third sample difference, and the fourth sample difference.
[0499] In other words, in the embodiments of this application, it is also possible to first determine the third sample difference and the fourth sample difference based on the reconstructed sample value at the current sample position and the reconstructed sample values at the two reference sample positions, and then use the third sample difference and the fourth sample difference as the input of the filter.
[0500] For example, in some embodiments, it is assumed that the current image corresponds to two inter-frame reference images. In this case, the process of filtering the sample value at the coordinate (x, y) position (current sample position) in the current image using 7 filter coefficients and 2 filters with 5x5 symmetry is as shown in formula (5).
[0501] Furthermore, in the embodiments of this application, when determining the filtered reconstructed sample value of the current sample position based on the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, the reconstructed sample value of the first reference sample position, and the reconstructed sample value of the second reference sample position, the filtering position corresponding to the reference sample position can be determined in the current block, and the reconstructed sample value of the filtering position can be determined based on the reconstructed value of the current block; the fifth sample difference can be determined based on the reconstructed sample value of the filtering position and the reconstructed sample value of the first reference sample position; the sixth sample difference can be determined based on the reconstructed sample value of the filtering position and the reconstructed sample value of the second reference sample position; and the filtered reconstructed sample value of the current sample position can be determined based on the filter coefficients corresponding to the current block, the reconstructed sample value of the current sample position, the fifth sample difference, and the sixth sample difference.
[0502] In other words, in the embodiments of this application, it is also possible to select, for each filtering position, to determine the fifth sample difference and the sixth sample difference based on the reconstructed sample value of the filtering position and the reconstructed sample values of the two reference sample positions respectively, and then use the fifth sample difference and the sixth sample difference as the input of the filter.
[0503] For example, in some embodiments, it is assumed that the current image corresponds to two inter-frame reference images. In this case, the process of filtering the sample value at the coordinate (x, y) position (current sample position) in the current image using 7 filter coefficients and 2 filters with 5x5 symmetry is as shown in formula (6).
[0504] It should be noted that, in the embodiments of this application, the filtering process shown in the above formula is an exemplary illustration of the TALF filtering proposed in this application. Of course, in practical applications, if the adaptive filter does not have the symmetry of the above example, then the adaptive filter coefficients and the input values corresponding to each coefficient should also be adjusted accordingly. That is, the filtering process should be a process in which the adaptive filter coefficients work together with the reconstructed values of the reference image at each relevant location.
[0505] It should be noted that, in the embodiments of this application, the filter coefficients can be integers, and the parameters used in the filtering process may also include bias and shift.
[0506] Furthermore, in the embodiments of this application, for the TALF filter, in addition to at least one inter-frame reference image that has been decoded in the time domain, the corresponding input information may also include the reconstructed value of the current block, such as the reconstructed value of any image component of the current block. The reconstructed value of the current block can be obtained by processing the current block in the current image based on any loop filtering method.
[0507] In other words, in the embodiments of this application, this application does not specifically limit the method for determining the reconstructed value of the current block. Correspondingly, this application does not specifically limit the specific position of TALF filtering in the loop filtering process, that is, the position of the time domain adaptive loop filtering can be located at any point in the loop filtering.
[0508] For example, in some embodiments, FIG11 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application. As shown in FIG11, the input of TALF may include the reconstructed value on the reconstructed image of the decoded and reconstructed image in the time domain and the current image before ALF filtering. That is, TALF can be placed in the same position as ALF in the loop filtering.
[0509] For example, in some embodiments, FIG12 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application. As shown in FIG12, the input of TALF may include the reconstructed image of the decoded and reconstructed image in the time domain and the reconstructed image of the current image after deblocking. That is, TALF can be placed in the same position as SAO in the loop filtering.
[0510] For example, in some embodiments, Figure 13 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application. As shown in Figure 13, TALF can be placed alongside Deblocking in the loop filtering.
[0511] For example, in some embodiments, Figure 14 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application. As shown in Figure 14, the position of TALF in the loop filtering can be before Deblocking.
[0512] For example, in some embodiments, Figure 15 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application. As shown in Figure 15, the input of TALF may include the reconstructed image of the decoded and reconstructed image in the time domain and the reconstructed image of the current image after deblocking. That is, the position of TALF in the loop filtering can be after deblocking.
[0513] For example, in some embodiments, FIG16 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application. As shown in FIG16, the input of TALF may include the reconstructed image of the decoded and reconstructed image in the time domain and the reconstructed image of the current image after SAO. That is, the position of TALF in the loop filtering can be after SAO.
[0514] For example, in some embodiments, FIG17 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application. As shown in FIG17, the input of TALF may also include the reconstructed value on the reconstructed image of the time-domain decoded reconstructed image and the current image after ALF filtering, that is, the position of TALF in the loop filtering may be after ALF.
[0515] Therefore, in some embodiments, the TALF can be placed at any position in a series of loop filters, which means that the input of the TALF includes the existing image and the reconstructed value on the reconstructed image of any stage in the current loop filter.
[0516] 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.
[0517] In other words, in the embodiments of this application, TALF filtering can be applied to any image component of the current image.
[0518] 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.
[0519] 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.
[0520] For example, in some embodiments, FIG18 is a schematic diagram of a filter proposed in an embodiment of the present application. As shown in FIG18, a 5x5 symmetrical filter contains 7 filter coefficients.
[0521] For example, in some embodiments, Figure 19 is a schematic diagram of a filter proposed in the embodiments of this application. As shown in Figure 19, a 7x7 symmetrical filter contains 13 filter coefficients.
[0522] For example, in some embodiments, Figure 20 is a schematic diagram of the filter proposed in the embodiments of this application. As shown in Figure 20, a 9x9 symmetrical filter contains 21 filter coefficients.
[0523] Among them, the above types are symmetrical filters. Each index value corresponds to a filter coefficient value. Except for the filter center point, each filter coefficient corresponds to two filter input values at symmetrical positions.
[0524] For example, in some embodiments, Figure 21 is a schematic diagram of a filter proposed in the embodiments of this application. As shown in Figure 21, a 5x5 symmetrical filter contains 4 filter coefficients.
[0525] For example, in some embodiments, Figure 22 is a schematic diagram of the filter proposed in the embodiments of this application. As shown in Figure 22, a 7x7 symmetrical filter contains 6 filter coefficients.
[0526] In a symmetrical filter, each index value corresponds to a filter coefficient value, and each filter coefficient corresponds to filter input values in multiple directions, except for the filter center point.
[0527] Of course, filters can also be asymmetric, which means that each filter input location has different coefficient values.
[0528] For example, in some embodiments, Figure 23 is a schematic diagram of a filter proposed in the embodiments of this application. As shown in Figure 23, a 5x5 asymmetric filter contains 13 filter coefficients.
[0529] For example, in some embodiments, for forward filtering and backward filtering under RA configuration, and for forward filtering using reconstructed values from the POC N-1 reference image as input and forward filtering using reconstructed values from the POC N-2 reference image as input under LD configuration, a 7x7 symmetric filter with 13 filter coefficients can be selected.
[0530] For example, in some embodiments, Figure 24 is a schematic diagram of the filter proposed in the embodiments of this application. As shown in Figure 24, there are two 5x5 symmetrical filters, which contain a total of 14 filter coefficients. Among them, for bidirectional filtering under RA configuration and forward filtering using the reconstructed values in the reference images of POC N-1 and N-2 as input under LD configuration, the two filters shown in Figure 24 can be selected to be used, respectively for the reconstructed values in the two reference images as input.
[0531] Furthermore, in the embodiments of this application, after filtering the current block based on the reconstructed samples of the at least one inter-frame reference image and the filter coefficients corresponding to the current block, and determining the filtered reconstructed value of the current block, a first generation value can be further determined based on the filtered reconstructed value of the current block, and a first syntax element identification information can be determined based on the first generation value, and the first syntax element identification information is written into the bitstream; wherein, the first syntax element identification information is used to determine whether the current block is filtered using TALF.
[0532] Furthermore, in the embodiments of this application, when determining the first generation value based on the filtered reconstructed value of the current block, in each candidate mode, the second generation value of the filter coefficients corresponding to the current block is determined based on the filtered reconstructed value of the current block; the smallest second generation value is determined as the first generation value corresponding to the current block when filtered using TALF.
[0533] It is understood that, in the embodiments of this application, each candidate filter can be traversed in each candidate mode to determine the second generation value corresponding to the filter coefficients of the current block after filtering. The method for calculating the generation value includes, but is not limited to, rate-distortion optimization algorithms.
[0534] Accordingly, in the embodiments of this application, in each candidate mode, multiple second-generation values can be calculated by traversing the candidate filters and multiple possible combinations of filter coefficients, and then the minimum generation value among the multiple second-generation values can be determined as the first-generation value corresponding to the current block when using TALF for filtering in this candidate mode.
[0535] Furthermore, in the embodiments of this application, when determining the first syntax element identification information based on the first generation value, the third generation value corresponding to the current block not using TALF for filtering can be determined; if the first generation value is greater than or equal to the third generation value, the first syntax element identification information is set to indicate that the current block does not use TALF for filtering; if the first generation value is less than the third generation value, the first syntax element identification information is set to indicate that the current block uses TALF for filtering.
[0536] It is understood that, in the embodiments of this application, rate-distortion optimization can be used to determine whether each CTU should enable TALF filtering based on 1 to 4, calculate the optimal number of filter groups for each mode, and determine whether each CTU uses TALF and which TALF filter group should be used.
[0537] Furthermore, in the embodiments of this application, the first syntax element identification information can be used to determine whether the current block in the current image is filtered using TALF, that is, based on the first syntax element identification information, it can be determined whether the reconstructed value of the image component of the current block is filtered using a TALF filter.
[0538] Furthermore, in the embodiments of this application, the first syntax element identification information can be used to determine whether to use TALF to filter the current block. The first syntax element identification information can be a flag, wherein if the current block is a CTU corresponding to the current image, then the first syntax element identification information can be a CTU-level flag; if the current block is a CU corresponding to the current image, then the first syntax element identification information can be a CU-level flag. Of course, corresponding to any size sub-region in the current image, the first syntax element identification information can also be a flag of other block levels. This application does not impose specific limitations.
[0539] Furthermore, in the embodiments of this application, the value of the first syntax element identifier information can be used to determine whether to use TALF filtering on the current block.
[0540] 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 on the current block. If the value of the first syntax element identifier information is not a first value, it is determined that TALF filtering will be used on the current block.
[0541] It should be noted that, in the embodiments of this application, the first syntax element identification information can be used to indicate whether the current block uses TALF for filtering. Furthermore, the first value can be in parameter form or numeric form; no limitation is made here.
[0542] For example, in some embodiments, if the first syntax element identification information is a block-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.
[0543] 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 the current block does not use TALF for filtering. Otherwise, if the value of the first syntax element identifier information is not 0, then it can be determined that the current block uses TALF for filtering.
[0544] For example, in some embodiments, if the current block of the current image is a CTU, then the first syntax element identification information can be CTU-level syntax. For instance, the first syntax element identification information can be represented by the syntax element control identifier talf_ctb_idc[CtbAddrX][CtbAddrY], that is, talf_ctb_idc[CtbAddrX][CtbAddrY] indicates whether to use TALF filtering on the current block of the current image. If the value of talf_ctb_idc[CtbAddrX][CtbAddrY] is 0, it is determined that TALF filtering is not used on the current block; if the value of talf_ctb_idc[CtbAddrX][CtbAddrY] is not 0, it is determined that TALF filtering is used on the current block. Of course, the value of talf_ctb_idc[CtbAddrX][CtbAddrY] is not limited to 0, and this application does not impose specific limitations.
[0545] Furthermore, in the embodiments of this application, in each candidate mode, the fourth generation value corresponding to each candidate mode when the current image is filtered using TALF can be determined based on the filtered reconstructed value of the current block; and the smallest fourth generation value is determined as the fifth generation value corresponding to the current image when the current image is filtered using TALF.
[0546] Furthermore, in the embodiments of this application, the sixth generation value corresponding to the current image when TALF is not used for filtering is determined; if the fifth generation value is greater than or equal to the sixth generation value, a second syntax element identifier is set to indicate that the current image is not used for TALF filtering; if the fifth generation value is less than the sixth generation value, a second syntax element identifier is set to indicate that the current image is used for TALF filtering.
[0547] Furthermore, in an embodiment of this application, when the second syntax element identification information indicates that the current image is filtered using TALF, the first syntax element is written into the bitstream.
[0548] Furthermore, in embodiments of this application, the second syntax element identification information can be used to determine whether the current image is allowed to be filtered using TALF. The second syntax element identification information can be a flag.
[0549] It should be noted that, in the embodiments of this application, the second syntax element identification information can be an image-level flag, a slice-level flag, a sub-picture-level flag, or a tile-level flag. This application does not impose any specific limitations.
[0550] For example, in some embodiments, if the second syntax element identification information is a slice-level flag, then the second syntax element identification information can be used to determine whether the current slice is allowed to use TALF for filtering.
[0551] Furthermore, in the embodiments of this application, the value of the second syntax element identifier information can be used to determine whether the current image (and / or the current slice) is allowed to use TALF for filtering.
[0552] For example, in some embodiments, if the value of the second syntax element identifier information is a second value, it is determined that the current image (and / or the current slice) is allowed to be filtered using TALF. If the value of the second syntax element identifier information is a third value, it is determined that the current image (and / or the current slice) is not filtered using TALF.
[0553] It should be noted that, in the embodiments of this application, the second syntax element identification information can be used to indicate whether the current image (and / or the current slice) is filtered using TALF. Furthermore, the second value and the third value are different, and the second value and the third value can be in parameter form or in numerical form; no limitation is made here.
[0554] It should also be noted that if the second syntax element identifier is an image-level flag or a slice-level flag, then in one specific example, the second value can be set to 1 and the third value can be set to 0; in another specific example, the second value can also be set to true and the third value can also be set to false; even in yet another specific example, the second value can also be set to 0 and the third value can also be set to 1; or, the second value can also be set to false and the third value can also be set to true. The second and third values are not limited in any way in the embodiments of this application.
[0555] Assuming the second syntax element identifier is an image-level flag, with a second value of 1 and a third value of 0 as an example, in this embodiment, if the value of the second syntax element identifier is 1, it can be determined that the current image uses TALF filtering. Otherwise, if the value of the second syntax element identifier is 0, it can be determined that the current image does not use TALF filtering.
[0556] For example, in some embodiments, assuming the second syntax element identification information is an image-level flag, then the second syntax element identification information can be represented by the syntax element ph_talf_enabled_flag, that is, ph_talf_enabled_flag indicates whether the current image is allowed to use TALF filtering. If the value of ph_talf_enabled_flag is 0, it is determined that TALF filtering is not used on the current image; if the value of ph_talf_enabled_flag is 1, it is determined that TALF filtering is allowed on the current image.
[0557] For example, in some embodiments, assuming the second syntax element identification information is a slice-level flag, the second syntax element identification information can be represented by the syntax element sh_talf_enabled_flag, that is, sh_talf_enabled_flag indicates whether the current slice is allowed to use TALF filtering. If the value of sh_talf_enabled_flag is 0, it is determined that TALF filtering is not used for the current slice; if the value of sh_talf_enabled_flag is 1, it is determined that TALF filtering is allowed for the current slice.
[0558] Of course, the value of sh_talf_enabled_flag is not limited to 0 and 1, and this application does not impose specific restrictions.
[0559] Therefore, in the embodiments of this application, the encoding of the first syntax element identifier information may depend on the second syntax element identifier information. That is, the block-level identifier may depend on the image-level identifier, or the block-level identifier may depend on the slice-level identifier. For example, if it is determined that the current image (and / or the current slice) is to be filtered using TALF based on the second syntax element identifier information, the encoding of the first syntax element identifier information can be further performed; otherwise, it is not necessary to encode the first syntax element identifier information.
[0560] Furthermore, in embodiments of this application, a third syntax element identifier can be determined and written into the bitstream; wherein, the third syntax element identifier is used to determine whether the current sequence uses TALF for filtering; if the third syntax element identifier indicates that the current sequence uses TALF for filtering, the second syntax element is written into the bitstream.
[0561] Furthermore, in embodiments of this application, the third syntax element identification information can be used to determine whether to apply TALF filtering to the current sequence. The third syntax element identification information can be a flag, for example, a sequence-level flag.
[0562] Furthermore, in the embodiments of this application, the value of the third syntax element identifier information can be used to determine whether to use TALF filtering on the current sequence.
[0563] For example, in some embodiments, if the value of the third syntax element identifier information is a fourth value, it is determined that TALF filtering should be applied to the current sequence. If the value of the third syntax element identifier information is a fifth value, it is determined that TALF filtering should not be applied to the current sequence.
[0564] It should be noted that, in the embodiments of this application, the third syntax element identification information can be used to indicate whether the current sequence is filtered using TALF. Furthermore, the fourth and fifth values are different, and both can be in parameter form or numerical form; no limitation is made here.
[0565] It should also be noted that if the third syntax element identifier is a sequence-level flag, then in one specific example, the fourth value can be set to 1 and the fifth value can be set to 0; in another specific example, the fourth value can also be set to true and the fifth value can also be set to false; even in yet another specific example, the fourth value can also be set to 0 and the fifth value can also be set to 1; or, the fourth value can also be set to false and the fifth value can also be set to true. The fourth and fifth values are not limited in any way in the embodiments of this application.
[0566] Assuming the third syntax element identifier is a sequence-level flag, with the fourth value being 1 and the fifth value being 0, in this embodiment, if the value of the third syntax element identifier is 1, then it can be determined that the current sequence uses TALF filtering. Otherwise, if the value of the third syntax element identifier is 0, then it can be determined that the current sequence does not use TALF filtering.
[0567] For example, in some embodiments, assuming the third syntax element identification information is a sequence-level flag, the third syntax element identification information can be represented by the syntax element `sps_talf_enabled_flag`, that is, `sps_talf_enabled_flag` indicates whether to use TALF filtering on the current sequence. If the value of `sps_talf_enabled_flag` is 0, it is determined that TALF filtering is not used on the current sequence; if the value of `sps_talf_enabled_flag` is 1, it is determined that TALF filtering is used on the current sequence.
[0568] Of course, the value of sps_talf_enabled_flag is not limited to 0 and 1, and this application does not impose specific restrictions.
[0569] Therefore, in the embodiments of this application, the encoding of the second syntax element identifier information can depend on the third syntax element identifier information; that is, the image-level (and / or slice-level) identifier can depend on the sequence-level identifier. For example, if it is determined that the current sequence is to be filtered using TALF based on the third syntax element identifier information, the encoding of the second syntax element identifier information can be further performed; otherwise, it is not necessary to encode the second syntax element identifier information.
[0570] Furthermore, in the embodiments of this application, the sequence-level TALF identifier may depend on the sequence-level ALF identifier, that is, the encoding of the third syntax element identifier information may be dependent on the sequence-level syntax element encoding of the ALF.
[0571] Furthermore, in embodiments of this application, the image-level (and / or slice-level) identifier depends on the sequence-level identifier, which may include the image-level (and / or slice-level) TALF identifier depending on the sequence-level TALF identifier, and may also include the image-level (and / or slice-level) TALF identifier depending on the sequence-level ALF identifier.
[0572] In other words, in the embodiments of this application, the encoding of the second syntax element identification information can depend on the third syntax element identification information or on the sequence-level ALF identifier.
[0573] Furthermore, in embodiments of this application, the image-level (and / or slice-level) TALF identifier may also depend on the image-level (and / or slice-level) ALF identifier.
[0574] In other words, in the embodiments of this application, the encoding of the second syntax element identification information may also rely on the image-level (and / or slice-level) ALF identifier.
[0575] For example, in some embodiments, the image-level (and / or slice-level) TALF identifier may also rely on some high-level syntax, such as the high-level syntax element pps_alf_info_in_ph_flag to identify the image-level or slice-level control identifier that uses image-level or slice-level syntax elements to parse the ALF, and the ALF identifier may also exist in the slice header.
[0576] Furthermore, in the embodiments of this application, after selecting the optimal candidate mode, candidate filter, and corresponding filter coefficients based on the rate-distortion optimization algorithm, the TALF parameters can be further determined, and the TALF parameters and the filter coefficients corresponding to the current block can be written into the bitstream. The TALF parameters include one or more of the following: mode parameters, quantity parameters, coefficient value parameters, and coefficient sign parameters.
[0577] It is understood that, in the embodiments of this application, the mode parameter can be used to determine the filtering mode of the TALF filter, wherein, for different filtering modes, the inter-frame reference image corresponding to the current image can be different. The quantity parameter can be used to determine the number of filter groups corresponding to the current image. The coefficient value parameter can be used to determine the absolute value of the filter coefficients. The coefficient sign parameter can be used to determine the sign of the filter coefficients, including positive and negative signs.
[0578] For example, in some embodiments, the coefficient numerical parameters can be determined based on the values of the filter coefficients corresponding to the current block; the coefficient sign parameters can be determined based on the signs of the filter coefficients corresponding to the current block; and the TALF parameters can be determined based on the coefficient numerical parameters and the coefficient sign parameters, that is, the coefficient numerical parameters and coefficient sign parameters in the TALF parameters can be determined.
[0579] For example, in some embodiments, the filtering mode and the number of candidate filter groups corresponding to the fifth-generation value can be determined; a mode parameter can be determined based on the filtering mode and the current configuration; a quantity parameter can be determined based on the number of candidate filter groups; and TALF parameters can be determined based on the mode parameter and the quantity parameter, that is, the mode parameter and quantity parameter in the TALF parameters can be determined.
[0580] Furthermore, in the embodiments of this application, the APS set corresponding to the TALF parameter can be determined; then the APS index corresponding to the APS set can be determined, and the APS index can be written into the bitstream.
[0581] It is understood that, in the embodiments of this application, the APS index can be used to determine the APS parameter set corresponding to the current image, that is, the APS set corresponding to the current image can be determined through the APS index.
[0582] In other words, in the embodiments of this application, the TALF parameters corresponding to the current image can be stored in the APS, so that the TALF parameters can be obtained by parsing in the APS.
[0583] Furthermore, in the embodiments of this application, the TALF parameters can also be directly written into the bitstream.
[0584] In other words, in the embodiments of this application, the TALF parameters corresponding to the current image can also be directly written into the bitstream. For example, the TALF parameters can be encoded and decoded in the image perspective or in the title sequence.
[0585] It is understood that, in the embodiments of this application, the first syntax element identification information can also be used to determine the TALF information used by the current block. For example, the value of the first syntax element identification information can be set according to the candidate filter corresponding to the current block that is finally determined.
[0586] For example, in some embodiments, when the value of the first syntax element identifier information is a first value, it indicates that TALF filtering should not be used on the current block. When the value of the first syntax element identifier information is not a first value, it indicates that TALF filtering should be used on the current block. The candidate filter corresponding to the current block can be indicated by setting the value of the first syntax element identifier information.
[0587] It is understood that, in the embodiments of this application, when it is determined that TALF filtering is applied to the current block, the value of the first syntax element identifier information can be set to indicate the group index of the filter corresponding to the current block. The group index of the filter can represent the index of the TALF filter used by the current block in the filter set encoded and decoded in the current image; that is, the group index of the filter can be used to select the candidate filter corresponding to the current block from among multiple filters corresponding to the current image.
[0588] For example, in the embodiments of this application, the reconstructed image is filtered using the optimal filtering mode optimized by rate distortion, the number of filter groups, and the CTU switch. At the same time, the filtering mode, the number of filter groups, the filter coefficients are encoded in the image header, and information such as the CTU switch is encoded in each CTU unit.
[0589] It is understood that the encoding method proposed in this application is a method that uses reconstructed sample values in the time domain as an information source to improve the reconstruction quality of the current image. The method uses a TALF filter to extract information from the reconstructed samples of the reconstructed image to filter the current image.
[0590] It is understood that in the encoding method proposed in the embodiments of this application, the filter coefficients of the time-domain filter can be predefined or transmitted through the bitstream.
[0591] It is understood that the encoding method proposed in this application embodiment can be adapted to different encoding configurations, resulting in different filtering methods under different filtering modes. Specifically, under the RA configuration, the filtering modes can be divided into forward filtering mode, reverse filtering mode, and bidirectional filtering mode; under the LD configuration, the filtering modes can be divided into first forward filtering mode, second forward filtering mode, and third forward filtering mode.
[0592] 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.
[0593] 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.
[0594] It is understood that the encoding method proposed in this application embodiment may also choose to skip the encoding and decoding process of CTU identifier and directly decide whether to perform TALF filtering on the entire image through image-level identifier. In this case, the current image corresponds to only one candidate filter.
[0595] This application provides an encoding method in which, during the TALF filtering process, relevant information of recorded and stored historical TALF filters can be reused, thereby reducing codeword consumption and improving encoding and decoding performance.
[0596] Based on the above embodiments, this application proposes a temporal adaptive loop filtering technique, which is an adaptive loop filtering technique that uses the reconstructed image in the temporal domain as an information source to improve the reconstructed image of the current frame. Furthermore, during the TALF filtering process, relevant information from recorded and stored historical TALF filters can be reused, thereby reducing codeword consumption and improving encoding / decoding performance.
[0597] This application proposes a technique to improve the quality of a current image by reconstructing an image in the temporal domain. This technique involves an encoder acquiring one or more sets of filter coefficients for improving the quality of the reconstructed image and transmitting them through a bitstream; and a decoder using the parsed filter coefficients and information including, but not limited to, the reconstructed values in the temporal domain as input to filter the current image.
[0598] This application proposes a technique to improve the quality of a current image by reconstructing the image in the temporal domain. Alternatively, the encoder can select appropriate filters and coefficients from one or more predefined sets of filters and coefficients, and transmit the syntax elements related to whether to use filters and coefficients through the bitstream. The decoder determines the filters and coefficients by parsing the syntax elements, and uses information including but not limited to the reconstructed values in the temporal domain as input to filter the current image.
[0599] This application proposes a technique to improve the quality of a current image by reconstructing an image in the temporal domain. Alternatively, the encoder can select predefined filters and coefficients and / or obtain coefficients that need to be transmitted through the bitstream, and transmit the corresponding syntax elements through the bitstream; the decoder determines to use predefined filters and coefficients by parsing the syntax elements, and / or parses the filters and coefficients from the bitstream, and uses information including but not limited to the reconstructed values in the temporal domain as input to filter the current image.
[0600] For example, in some embodiments, a block-level identifier (first syntax element identifier information) may be used to indicate whether the current block is filtered using TALF.
[0601] For example, in some embodiments, taking the CTU level as an example, there is an identifier at the CTU level to control whether TALF is enabled. In addition, since there may be multiple TALFs (candidate filters) available for selection in a frame of image, when a CTU-level TALF identifier is true, the relevant identifier should also be parsed to indicate the selected TALF filter used to filter the current CTU.
[0602] For example, in some embodiments, the parsing process of the first syntax element identification information talf_ctb_idc[CtbAddrX][CtbAddrY] is as follows:
[0603] When the current slice / image is allowed to use TALF, the CTU-level control flag talf_ctb_idc[CtbAddrX][CtbAddrY] of TALF should also be encoded and decoded when encoding and decoding each CTU-level syntax. A non-zero flag indicates that the current CTU uses TALF, and the value of talf_ctb_idc[CtbAddrX][CtbAddrY]-1 corresponds to the index of the TALF filter used by the current CTU in the filter set encoded and decoded in the current image / slice. For example, if the current image / video is encoded and decoded with 3 sets of TALF filter coefficients, then talf_ctb_idc[CtbAddrX][CtbAddrY] being 0 indicates that the current CTU does not use TALF, talf_ctb_idc[CtbAddrX][CtbAddrY] being 1 indicates that the current CTU uses the first set of TALF filter coefficients to filter the current CTU, talf_ctb_idc[CtbAddrX][CtbAddrY] being 2 indicates that the current CTU uses the second set of TALF filter coefficients to filter the current CTU, and talf_ctb_idc[CtbAddrX][CtbAddrY] being 3 indicates that the current CTU uses the third set of TALF filter coefficients to filter the current CTU.
[0604] Of course, you can also omit the CTU identifier and directly decide whether to perform TALF filtering on the entire image, or use a CU-level identifier or a block-level identifier of a different size than the CTU identifier.
[0605] For example, in some embodiments, each frame can encode and decode up to 4 sets of TALF coefficients (4 sets of filter coefficients corresponding to 4 sets of candidate filters). Assuming that TALF is placed after ALF, a reference image (inter-frame reference image) can be used to further improve the quality of the reconstructed image after ALF filtering.
[0606] For example, in some embodiments, 7x7 symmetric filters and 5x5 symmetric filters can be used. A 7x7, 13-coefficient symmetric filter is used for filtering a TALF that takes one reconstructed image (inter-frame reference image) as input; two 5x5, 7-coefficient symmetric filters are used for filtering a TALF that takes two reconstructed images as input.
[0607] For example, in some embodiments, the difference between the reconstructed value of the reconstructed image and the reconstructed value of the current image can be used as the input to the TALF filter. Assuming that the current image corresponds to an inter-frame reference image, the process of filtering the sample value at coordinate (x, y) (the current sample position) in the current image using 13 filter coefficients and a 7x7 symmetric filter is as follows:
[0608] For example, in some embodiments, the difference between the reconstructed value of the reconstructed image and the reconstructed value of the current image can be used as the input to the TALF filter. Assuming that the current image corresponds to two inter-frame reference images, the process of filtering the sample value at coordinate (x, y) (the current sample position) in the current image using two 5x5 symmetrical filters with 7 filter coefficients is as follows:
[0609] It should be noted that, in the embodiments of this application, the filter-related parameters (TALF parameters and filter coefficients) can be encoded and decoded at the beginning of the image (or the image header) or written into the APS parameter set. This application does not impose any specific limitations.
[0610] It should be noted that, in the embodiments of this application, TALF filtering can be applied to either the luminance component or the chrominance component (color component).
[0611] It should be noted that, in the embodiments of this application, when only the TALF filter is used on the luminance component, the chrominance component can also use the information of the reconstructed image in the time domain as an aid to improve the reconstruction quality of the current chrominance image.
[0612] For example, in some embodiments, at the encoding end, it is assumed that TALF is placed after ALF, that is, after ALF filtering, it enters the decision process of TALF.
[0613] First, based on the encoding configuration RA or LD, determine the allowed TALF modes. There are three TALF modes in both RA and LD. In RA, forward filtering is mode 1, backward filtering is mode 2, and bidirectional filtering is mode 3. In LD, using reference image POC N-1 as the TALF filter input is mode 1, using reference image POC N-2 as the TALF filter input is mode 2, and using both reference images POC N-1 and N-2 as the TALF filter input is mode 3.
[0614] Iterate through each filtering mode, use the current image reconstruction value in the corresponding mode, construct the Wienerhof equation with reference to the reconstructed image value and the original value of the current image, and parse out 1 to 4 sets of filter coefficients. Through rate distortion optimization, determine whether each CTU should turn on TALF filtering according to 1 to 4, calculate the optimal number of filter groups in each mode, whether each CTU uses TALF and which set of TALF filters to use.
[0615] Furthermore, the optimal filtering mode, number of filter banks, and CTU switch optimized using rate distortion are used to filter the reconstructed image. At the same time, the filtering mode, number of filter banks, filter coefficients, CTU switch, and other information are encoded in the image header and incorporated into each CTU unit.
[0616] For example, in some embodiments, at the decoding end, 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 is used for filtering.
[0617] After ALF filtering, the CTUs selected by ALF in the current image are filtered using the corresponding filter.
[0618] For example, in some embodiments, when performing time-domain adaptive loop filtering, sequence-level syntax elements, such as third syntax element identification information, can be parsed. The parsing process is as follows:
[0619] 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.
[0620] For example, in some embodiments, when performing time-domain adaptive loop filtering, slice-level syntax elements, such as second syntax element identification information, can be parsed. The parsing process is as follows:
[0621] 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.
[0622] The `talf_filter_mode` syntax element indicates which TALF mode to use for the current slice. A value of 0 indicates forward filtering in RA configuration or forward filtering of the previous first frame in LD configuration; a value of 1 indicates backward filtering in RA configuration or forward filtering of the previous second frame in LD configuration; and a value of 2 indicates bidirectional filtering in RA configuration or filtering of the previous two frames in LD configuration. Its value is 0 when this syntax element is not present in the bitstream.
[0623] 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 four TALF filters, the value of `talf_num_filters_signalled_minus1` can be 0, 1, 2, or 3. A value of 0 indicates that the current slice has one TALF filter, 1 indicates two TALF filters, 2 indicates three TALF filters, and 3 indicates four TALF filters. When this syntax element is not present in the bitstream, its value is 0.
[0624] The variable numCoeff represents the number of filter coefficients in the filter. In this scheme, the filters used in the forward and backward directions of the RA configuration and the first and second most recent frames of 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 in the two most recent frames 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).
[0625] 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.
[0626] 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.
[0627] For example, in some embodiments, when performing time-domain adaptive loop filtering, CTU-level syntax elements, such as the first syntax element identification information, can be parsed. The parsing process is as follows:
[0628] The syntax element `talf_ctb_idc[CtbAddrX][CtbAddrY]` 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. Its value ranges from 0 to `talf_num_filters_signalled_minus1`. For example, if `talf_num_filters_signalled_minus1` is 1, then `talf_ctb_idc` can be 0 or 1. Similarly, if `talf_num_filters_signalled_minus1` is 2, then `talf_ctb_idc` can be 0, 1, or 2. `talf_ctb_idc` being 0 indicates that the current luminance block of the coding tree does not use TALF filtering, being 1 indicates that the first set of filters is used, being 2 indicates that the second set of filters is used, and so on. When this syntax element is not present in the bitstream, its value is 0.
[0629] Furthermore, in the embodiments of this application, the filter reconstruction process can be performed based on the resolved number of filters, filter type, absolute value of filter coefficients, and positive / negative sign of filter coefficients, as follows:
[0630] Furthermore, in the embodiments of this application, assuming that the reconstructed value of the luminance component is subjected to TALF filtering, that is, the current block is a luminance block (luminance coding tree block), then TALF filtering is required when the talf_ctb_idc identifier of the current luminance coding tree block is non-zero.
[0631] Exemplarily, in some embodiments, the input to the filtering process includes:
[0632] 1. A reconstructed luminance image array rec after luminance adaptive loop filtering.
[0633] 2. The corresponding temporal reconstructed luminance image array. For example, if the `talf_filter_mode` syntax element is 0, the most recent forward-reconstructed temporal image is used in RA configuration, or the first previously reconstructed image `rec0` is used in LD configuration; if it is 1, the most recent backward-reconstructed temporal image is used in RA configuration, or the first previously reconstructed image `rec1` is used in LD configuration; if it is 2, two reconstructed image arrays `rec0` and `rec1` are used.
[0634] 3. Indicates the luminance coordinates (xCtb, yCtb) of the current luminance coding tree block in the current image.
[0635] 4. The width tAlfWidth and height tAlfHeight of the luminance coding tree block.
[0636] 5. The coefficients tAlfCoeff of the time-domain adaptive loop filter [][].
[0637] Accordingly, the filtering calculation for each position in the luminance-coded block is as follows:
[0638] When numCoeff is 14:
[0639] In the above calculation and filtering process, shift is a positive integer, which is 6 in this scheme. 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.
[0640] When numCoeff is 13 and talf_filter_mode is 0:
[0641] When numCoeff is 13 and talf_filter_mode is 1:
[0642] It should be noted that, in the embodiments of this application, during the filtering process, the same image edge padding method as ALF is used for the image boundaries to obtain the TALF input values outside the required image range.
[0643] For example, 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.
[0644] Furthermore, in the embodiments of this application, a scheme for reusing historical decoding time-domain adaptive loop filter is also included, that is, TALF can introduce a history-reusing adaptive loop filter, thereby saving the extra codeword consumption caused by encoding and decoding new filter coefficients (filter coefficients).
[0645] In one implementation, a FIFO used to store historical filters can be saved and updated on a slice (or image) basis. The current slice determines whether it uses temporal adaptive filtering by parsing a 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 filter and its coefficients for the current frame (current image) 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. Updating the FIFO involves shifting each element one position to the right and storing 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 is removed before shifting the elements and storing the filters.
[0646] For example, in some embodiments, FIG26 is a schematic diagram of a time-domain adaptive loop filter for storing history proposed in the embodiments of this application. As shown in FIG26, a FIFO of length 8 is used to store the time-domain adaptive loop filter. At this time, there are already 2 TALFs in the FIFO, and each TALFs is one or more filters contained in a chip of history decoding.
[0647] For example, in some embodiments, Figure 27 is a schematic diagram of the time-domain adaptive loop filter for storing history proposed in the embodiments of this application. As shown in Figure 27, 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 stored at the first position.
[0648] For example, in some embodiments, Figure 28 is a schematic diagram of the time-domain adaptive loop filter for storing history proposed in the embodiments of this application. As shown in Figure 28, a FIFO of length 8 is used to store the time-domain adaptive loop filter. 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 decoding. Since the number of TALFs in the FIFO has reached the maximum, the last TALF 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.
[0649] When the current image (or current slice) uses TALF, an additional identifier needs to be encoded and decoded to indicate whether TALFs of other images (or slices) in the FIFO are reused. If reused, the index of the FIFO is further encoded and decoded to determine the TALFs to be reused. Otherwise, the adaptive temporal filtering parameters obtained from the current image are encoded and decoded, and the FIFO is updated.
[0650] For example, in some embodiments, `talf_reuse_flag` is used to indicate whether the time-domain adaptive filter in the FIFO is reused. If this flag is 1, it indicates that the historical adaptive loop filter recorded in the FIFO is reused; if the flag is 0, it indicates that it is not reused. When this syntax element does not exist in the bitstream, its value can be defaulted to 0.
[0651] For example, in some embodiments, `talf_reuse_idx` can be used to indicate the index of the time-domain adaptive filter in the FIFO. Since the FIFO length is at most 8 bits in this example, `talf_reuse_idx` is encoded and decoded using a 3-bit fixed-length code. In other cases, variable-length codes or other length encoding and decoding methods can be used. The value of `talf_reuse_idx` ranges from 0 to 7, representing which set of historical time-domain adaptive loop filters in the FIFO is reused. When this syntax element is not present in the bitstream, its default value can be 0.
[0652] In other words, in the embodiments of this application, a method for reusing historical TALF information includes determining a data unit corresponding to a data unit index from a historical dataset, such as an element in a FIFO, and then obtaining the filtering mode, the number of filter groups, and the filter coefficients of the candidate filters recorded and stored in the data unit.
[0653] For example, in some embodiments, updateFIFO() is a step of updating the FIFO using the TALFs decoded in the current slice, where tAlfParamPool is a FIFO that records historical adaptive loop filtering information, and each element can store one or more sets of time-domain adaptive filters parsed in the current slice.
[0654] If the historical TALF information recorded and stored in the historical dataset includes the filtering mode, the number of filter groups, and the filter coefficients of the candidate filters, then when updating the historical dataset, the corresponding TALF information including the filtering mode, the number of filter groups, and the filter coefficients of the candidate filters also needs to be stored in the historical dataset.
[0655] It is understood that, in the embodiments of this application, when reusing historical TALF information, if the historical TALF information includes filter coefficients corresponding to candidate filters, then the filter coefficients (filter coefficients) corresponding to the current block can be determined from the filter coefficients corresponding to candidate filters by combining the first syntax element identification information talf_ctb_idc[CtbAddrX][CtbAddrY].
[0656] It is understood that in the embodiments of this application, when reusing historical time-domain adaptive loop filters, since the FIFO may contain more than one time-domain adaptive filter at the talf_reuse_idx position, the corresponding identifier should also be used to indicate whether a historical time-domain adaptive loop filter has been selected and which filter in TALFs has been selected when encoding and decoding the CTU identifier.
[0657] If the current slice does not reuse the historical adaptive loop filter, the method for parsing the block-level syntax elements of the coding tree is the same as the conventional TALF method in the above embodiments.
[0658] If the current slice uses a history-adaptive loop filter, the number of filters used (filterCount) is obtained first:
[0659] filterCount=tAlfParamPool[talf_reuse_idx].filterCount
[0660] For example, in some embodiments, the block-level syntax elements of the encoding tree are parsed as follows:
[0661] The first syntax element, `talf_ctb_idc[CtbAddrX][CtbAddrY]`, indicates whether the luminance block of the coding tree, numbered `CtbAddrX` horizontally and `CtbAddrY` vertically, uses TALF filtering. If `talf_reuse_flag` is 0 (i.e., the historical adaptive loop filter is not reused), the value of `talf_ctb_idc[CtbAddrX][CtbAddrY]` ranges from 0 to `talf_num_filters_signalled_minus1`. If `talf_reuse_flag` is 1 (i.e., the historical adaptive loop filter is reused), the value of `talf_ctb_idc[CtbAddrX][CtbAddrY]` ranges from 0 to `filterCount-1`. When this syntax element is not present in the bitstream, its default value is 0.
[0662] Furthermore, in the embodiments of this application, when reconstructing the filter coefficients, if talf_reuse_flag is 0, i.e., the historical adaptive loop filter is not reused, the process of reconstructing the filter coefficients is the same as the conventional TALF method in the above embodiments. If talf_reuse_flag is 1, i.e., the historical adaptive loop filter is reused, the reused filter mode, the number of filters (the number of filter groups), and the filter coefficients are obtained respectively.
[0663] When talf_reuse_flag is 1, numCoeff can be used for either unidirectional or bidirectional filtering based on the tAlfMode indicator. For example, it is 13 for unidirectional filtering and 14 for bidirectional filtering.
[0664] In one implementation, considering that time-domain filtering has three filtering modes under both RA and LD configurations, different types of filtering modes can be stored and updated using different FIFOs. For example, the forward filtering filter of RA uses one FIFO to record historical filters, the backward filtering filter uses one FIFO to record historical filters, and the bidirectional filtering filter uses one FIFO to record historical filters; the filter using POC N-1 in LD uses one FIFO to record historical filters, the filter using POC N-2 uses one FIFO to record historical filters, and the filter using both POC N-1 and POC N-2 uses one FIFO to record historical filters.
[0665] Accordingly, in the embodiments of this application, a talf_filter_mode needs to be encoded and decoded to represent the selected filter mode (filtering mode). That is, regardless of whether the multiplexing flag talf_reuse_flag indicates whether a historical filter is reused, the talf_filter_mode indicating the filtering mode needs to be transmitted.
[0666] In other words, in the embodiments of this application, a method for reusing historical TALF information includes selecting a historical dataset corresponding to a filtering mode from multiple historical datasets, then determining the data unit corresponding to the data unit index in the historical dataset, and then obtaining the number of filter groups and the filter coefficients of the candidate filters recorded and stored in the data unit.
[0667] If the historical TALF information recorded and stored in the historical dataset includes the number of filter groups and the filter coefficients of the candidate filters, then when updating the historical dataset, the corresponding TALF information including the number of filter groups and the filter coefficients of the candidate filters also needs to be stored in the historical dataset.
[0668] It is understood that, in the embodiments of this application, when reusing historical TALF information, if the historical TALF information includes filter coefficients corresponding to candidate filters, then the filter coefficients (filter coefficients) corresponding to the current block can be determined from the filter coefficients corresponding to candidate filters by combining the first syntax element identification information talf_ctb_idc[CtbAddrX][CtbAddrY].
[0669] It is understood that in the embodiments of this application, when reusing historical time-domain adaptive loop filters, since the FIFO may contain more than one time-domain adaptive filter at the talf_reuse_idx position, the corresponding identifier should also be used to indicate whether a historical time-domain adaptive loop filter has been selected and which filter in TALFs has been selected when encoding and decoding the CTU identifier.
[0670] If the current slice does not reuse the historical adaptive loop filter, the method for parsing the block-level syntax elements of the coding tree is the same as the conventional TALF method in the above embodiments.
[0671] If the current slice uses a history-adaptive loop filter, the number of filters used (filterCount) is obtained first:
[0672] filterCount=tAlfParamPool[talf_filter_mode][talf_reuse_idx].filterCount
[0673] For example, in some embodiments, the block-level syntax elements of the encoding tree are parsed as follows:
[0674] 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. If `talf_reuse_flag` is 0, meaning the historical adaptive loop filter is not reused, the value of `talf_ctb_idc[CtbAddrX][CtbAddrY]` ranges from 0 to `talf_num_filters_signalled_minus1`. If `talf_reuse_flag` is 1, meaning the historical adaptive loop filter is reused, the value of `talf_ctb_idc[CtbAddrX][CtbAddrY]` ranges from 0 to `filterCount-1`. When this syntax element does not exist in the bitstream, its default value can be 0.
[0675] Furthermore, in the embodiments of this application, when reconstructing the filter coefficients, if talf_reuse_flag is 0, i.e., the historical adaptive loop filter is not reused, the process of reconstructing the filter coefficients is the same as the conventional TALF method in the above embodiments. If talf_reuse_flag is 1, i.e., the historical adaptive loop filter is reused, the reused filter mode, the number of filters (the number of filter groups), and the filter coefficients are obtained respectively.
[0676] In one implementation, considering that the input to TALF can include either one inter-frame reference image or two inter-frame reference images, different FIFOs can be used to store and update the data volume of different input images. For example, one FIFO can be used to record the history filter for the input of one inter-frame reference image, and another FIFO can be used to record the history filter for the input of two inter-frame reference images.
[0677] In other words, for TALF, the filtering mode always uses one 7x7 filter or two 5x5 filters, corresponding to using reconstructed values from one reconstructed image as input and reconstructed values from two reconstructed images as input, respectively. The FIFO update is mainly divided into forward, backward, and bidirectional TALF filters, which can be updated separately in different FIFOs or always in the same FIFO. The FIFO update can also be divided into two categories: using one reconstructed image and using two reconstructed images.
[0678] Accordingly, in the embodiments of this application, a talf_filter_mode needs to be encoded and decoded to represent the selected filter mode. That is, regardless of whether the multiplexing flag talf_reuse_flag indicates whether a historical filter is reused, the talf_filter_mode indicating the filter mode needs to be transmitted.
[0679] In other words, in the embodiments of this application, a method for reusing historical TALF information includes selecting a historical dataset corresponding to a filtering mode (the number of input inter-frame reference images) from multiple historical datasets, then determining the data unit corresponding to the data unit index in the historical dataset, and then obtaining the number of filter groups and the filter coefficients of the candidate filters recorded and stored in the data unit.
[0680] If we divide FIFO updates into two categories: those using one reconstructed image and those using two reconstructed images, then there are only two FIFOs. The updated FIFO is determined by FIFOType. When the filter to be updated in the FIFO is a 13-coefficient filter (one reconstructed image input, 7x7 shape), FIFOType is set to 0; when the filter to be updated in the FIFO is a 14-coefficient filter (two reconstructed image inputs, two 5x5 shapes), FIFOType is set to 1.
[0681] If the historical TALF information recorded and stored in the historical dataset includes the number of filter groups and the filter coefficients of the candidate filters, then when updating the historical dataset, the corresponding TALF information including the number of filter groups and the filter coefficients of the candidate filters also needs to be stored in the historical dataset.
[0682] It is understood that, in the embodiments of this application, when reusing historical TALF information, if the historical TALF information includes filter coefficients corresponding to candidate filters, then the filter coefficients (filter coefficients) corresponding to the current block can be determined from the filter coefficients corresponding to candidate filters by combining the first syntax element identification information talf_ctb_idc[CtbAddrX][CtbAddrY].
[0683] It is understood that in the embodiments of this application, when reusing historical time-domain adaptive loop filters, since the FIFO may contain more than one time-domain adaptive filter at the talf_reuse_idx position, the corresponding identifier should also be used to indicate whether a historical time-domain adaptive loop filter has been selected and which filter in TALFs has been selected when encoding and decoding the CTU identifier.
[0684] If the current slice does not reuse the historical adaptive loop filter, the method for parsing the block-level syntax elements of the coding tree is the same as the conventional TALF method in the above embodiments.
[0685] If the current slice uses a history-adaptive loop filter, the number of filters used (filterCount) is obtained first:
[0686] filterCount=tAlfParamPool[FIFOType][talf_reuse_idx].filterCount
[0687] For example, in some embodiments, the block-level syntax elements of the encoding tree are parsed as follows:
[0688] 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. If `talf_reuse_flag` is 0, meaning the historical adaptive loop filter is not reused, the value of `talf_ctb_idc[CtbAddrX][CtbAddrY]` ranges from 0 to `talf_num_filters_signalled_minus1`. If `talf_reuse_flag` is 1, meaning the historical adaptive loop filter is reused, the value of `talf_ctb_idc[CtbAddrX][CtbAddrY]` ranges from 0 to `filterCount-1`. When this syntax element does not exist in the bitstream, its default value can be 0.
[0689] Furthermore, in the embodiments of this application, when reconstructing the filter coefficients, if talf_reuse_flag is 0, i.e., the historical adaptive loop filter is not reused, the process of reconstructing the filter coefficients is the same as the conventional TALF method in the above embodiments. If talf_reuse_flag is 1, i.e., the historical adaptive loop filter is reused, the reused filter mode, the number of filters (the number of filter groups), and the filter coefficients are obtained respectively.
[0690] When talf_reuse_flag is 1, numCoeff can be configured for either unidirectional or bidirectional filtering based on the talf_filter_mode indicator. It is 13 for unidirectional filtering and 14 for bidirectional filtering.
[0691] It is understood that in the embodiments of this application, when reusing historical time-domain adaptive loop filters, since the FIFO may contain more than one time-domain adaptive filter at the talf_reuse_idx position, the corresponding identifier should also be used to indicate whether a historical time-domain adaptive loop filter has been selected and which filter in TALFs has been selected when encoding and decoding the CTU identifier.
[0692] If the current slice does not reuse the historical adaptive loop filter, the method for parsing the block-level syntax elements of the coding tree is the same as the conventional TALF method in the above embodiments.
[0693] If the current slice uses a history-adaptive loop filter, the number of filters used (filterCount) is obtained first:
[0694] filterCount=tAlfParamPool[talf_filter_mode][talf_reuse_idx].filterCount
[0695] For example, in some embodiments, the block-level syntax elements of the encoding tree are parsed as follows:
[0696] 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. If `talf_reuse_flag` is 0, meaning the historical adaptive loop filter is not reused, the value of `talf_ctb_idc[CtbAddrX][CtbAddrY]` ranges from 0 to `talf_num_filters_signalled_minus1`. If `talf_reuse_flag` is 1, meaning the historical adaptive loop filter is reused, the value of `talf_ctb_idc[CtbAddrX][CtbAddrY]` ranges from 0 to `filterCount-1`. When this syntax element does not exist in the bitstream, its default value can be 0.
[0697] Furthermore, in the embodiments of this application, when reconstructing the filter coefficients, if talf_reuse_flag is 0, i.e., the historical adaptive loop filter is not reused, the process of reconstructing the filter coefficients is the same as the conventional TALF method in the above embodiments. If talf_reuse_flag is 1, i.e., the historical adaptive loop filter is reused, then the reused filter mode, the number of filters (the number of filter groups), and the filter coefficients are obtained respectively.
[0698] In one implementation, temporal adaptive filters from different slices (or different images) can be combined. The temporal adaptive filters for all filtering modes are updated in the same FIFO, where each element stores only one set of filters. If one set of filters is resolved for the current slice (or current image), then that set is updated in the FIFO; if multiple sets of filters are resolved for the current slice (or current image), then multiple sets of filters are updated in the FIFO. Each index corresponds to one set of filters. During multiplexing, one or more sets of filters can be obtained from one or more indices of the FIFO for use in the current slice (or current image).
[0699] Accordingly, in the embodiments of this application, it is necessary to encode and decode a `talf_filter_mode` to represent the selected filter mode, and also to encode and decode a `talf_num_filters_signalled_minus1` to indicate the number of filters being encoded and decoded minus one. That is, regardless of whether the reuse flag `talf_reuse_flag` indicates whether historical filters are reused, it is necessary to transmit both the `talf_filter_mode` indicating the filter mode and `talf_num_filters_signalled_minus1` indicating the number of filter groups.
[0700] In other words, in the embodiments of this application, a method for reusing historical TALF information includes determining a data unit corresponding to a data unit index from a historical dataset, and then obtaining the filter coefficients of the candidate filters recorded and stored in that data unit.
[0701] If the historical TALF information recorded and stored in the historical dataset includes the filter coefficients of the candidate filters, then when updating the historical dataset, the corresponding TALF information including the filter coefficients of the candidate filters also needs to be stored in the historical dataset.
[0702] Furthermore, in the embodiments of this application, when reconstructing the filter coefficients, if talf_reuse_flag is 0, i.e., the historical adaptive loop filter is not reused, the process of reconstructing the filter coefficients is the same as the conventional TALF method in the above embodiments; if talf_reuse_flag is 1, i.e., the historical adaptive loop filter is reused, then the filter coefficients are obtained:
[0703] In one implementation, historical time-domain loop filters can be combined, but the filters in each filtering mode are updated in the same FIFO.
[0704] Accordingly, in the embodiments of this application, a talf_num_filters_signalled_minus1 needs to be encoded and decoded to indicate the number of encoded and decoded filters minus one. That is, regardless of whether the multiplexing flag talf_reuse_flag indicates whether historical filters are multiplexed, talf_num_filters_signalled_minus1 indicating the number of filter groups needs to be transmitted.
[0705] In other words, in the embodiments of this application, a method for reusing historical TALF information includes determining the data unit corresponding to the data unit index from a historical dataset, and then obtaining the filtering mode and filter coefficients of the candidate filter recorded and stored in the data unit.
[0706] It should be noted that, in the embodiments of this application, each filter should be assigned a corresponding filter mode type during the FIFO update process.
[0707] If the historical TALF information recorded and stored in the historical dataset includes the filter modes and filter coefficients of the candidate filters, then when updating the historical dataset, the corresponding TALF information including the filter modes and filter coefficients of the candidate filters also needs to be stored in the historical dataset.
[0708] Furthermore, in the embodiments of this application, when reconstructing the filter coefficients, if talf_reuse_flag is 0, i.e., the historical adaptive loop filter is not reused, the process of reconstructing the filter coefficients is the same as the conventional TALF method in the above embodiments; if talf_reuse_flag is 1, i.e., the historical adaptive loop filter is reused, then the filter coefficients are obtained:
[0709] When talf_reuse_flag is 1, numCoeff can be configured for either unidirectional or bidirectional filtering based on the tAlfMode indicator. It is 13 for unidirectional filtering and 14 for bidirectional filtering.
[0710] In one implementation, an improvement is proposed for bidirectional filtering or filtering modes that use reconstructed values from two reference images as input. Specifically, when multiplexing bidirectional filtering, an additional mode can be introduced where the two inputs of the original bidirectional filter are swapped before being input to the filter.
[0711] Accordingly, in the embodiments of this application, a talf_filter_mode needs to be encoded and decoded to represent the selected filter mode. That is, regardless of whether the multiplexing flag talf_reuse_flag indicates whether a historical filter is reused, the talf_filter_mode indicating the filter mode (filtering mode) needs to be transmitted.
[0712] For example, in some embodiments, the slice-level syntax element is parsed as follows:
[0713] The `talf_reuse_flag` flag indicates whether the time-domain adaptive filter in the FIFO is reused. A value of 1 indicates reuse of the historical adaptive loop filter recorded in the FIFO, while a value of 0 indicates no reuse. Its value is 0 when this syntax element is not present in the bitstream.
[0714] `talf_reuse_idx` indicates the index of the time-domain adaptive filter in the FIFO. Since the FIFO length is at most 8 bits in this example, `talf_reuse_idx` uses a 3-bit fixed-length code for encoding and decoding. In other cases, variable-length codes or other length encoding / decoding methods can be used. Its value ranges from 0 to 7, representing which set of historical time-domain adaptive loop filters in the FIFO is being reused. Its value is 0 when this syntax element is not present in the bitstream.
[0715] The value range of talf_filter_mode will vary depending on the value of talf_reuse_flag. When talf_reuse_flag is 0, the value range and meaning of talf_filter_mode are the same as in the background art. When talf_reuse_flag is 1, talf_filter_mode can be 0, 1, 2 or 3. When the value is 0, 1 or 2, the meaning remains unchanged. A value of 3 indicates that when filtering two inputs, the two inputs of the filter need to be swapped before being used as inputs.
[0716] The `updateFIFO()` function updates the FIFO using the TALFs decoded from the current slice. The update process is as follows:
[0717] There are only two FIFOs. The updated FIFO is determined by FIFOType. When the filter to be updated in the FIFO is a 13-coefficient filter (one reconstructed image input, 7x7 shape), FIFOType is set to 0; when the filter to be updated in the FIFO is a 14-coefficient filter (two reconstructed image inputs, two 5x5 shapes).
[0718] Furthermore, in the embodiments of this application, assuming that the reconstructed value of the luminance component is subjected to TALF filtering, that is, the current block is a luminance block (luminance coding tree block), then when the talf_filter_mode value is 0, 1, or 2, the TALF filtering process of the luminance coding tree block is the same as that in the above embodiments.
[0719] When talf_filter_mode is set to 3, TALF filtering is required when the talf_ctb_idc flag of the current luminance coding tree block is non-zero.
[0720] Exemplarily, in some embodiments, the input to the filtering process includes:
[0721] 1. A reconstructed luminance image array rec after luminance adaptive loop filtering.
[0722] 2. The corresponding temporal reconstructed luminance image array. For example, if the talf_filter_mode syntax element is 0, the most recent forward temporal reconstructed image is used in RA configuration, or the first previous reconstructed image rec0 is used in LD configuration; if it is 1, the most recent backward temporal reconstructed image is used in RA configuration, or the first previous reconstructed image rec1 is used in LD configuration; if it is 2, two reconstructed image arrays rec0 and rec1 are used; if it is 3, rec0 and rec1 are swapped, that is, rec0 becomes the original rec1, and rec1 becomes the original rec0.
[0723] 3. Indicates the luminance coordinates (xCtb, yCtb) of the current luminance coding tree block in the current image.
[0724] 4. The width tAlfWidth and height tAlfHeight of the luminance coding tree block.
[0725] 5. The coefficients tAlfCoeff of the time-domain adaptive loop filter [][].
[0726] The filtering calculation for each position in the luminance coding tree block is as follows:
[0727] When numCoeff is 14:
[0728] The remaining one-way prediction parts are the same.
[0729] In the above calculation and filtering process, shift is a positive integer, which is 6 in this scheme. The 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.
[0730] This application provides an encoding / decoding method, a temporal adaptive loop filtering method, which can perform TALF filtering on the reconstructed values of the current block based on reconstructed samples and corresponding filter coefficients from at least one inter-frame reference image. During TALF filtering, relevant information from at least one inter-frame reference image is fully utilized, thereby improving the filtering effect and enhancing encoding / decoding performance. Furthermore, during TALF filtering, relevant information from recorded and stored historical TALF filters can be reused, thereby reducing codeword consumption and improving encoding / decoding performance.
[0731] Based on the above embodiments, this application proposes a temporal adaptive loop filtering technique. This technique uses a temporally reconstructed image as an information source to improve the reconstructed image of the current frame. Furthermore, in the TALF filtering process, on the one hand, historically decoded temporal adaptive loop filters can be reused; on the other hand, nonlinear temporal adaptive loop filters can be used; furthermore, adaptive precision of the temporal loop filter can be introduced; and still others, vector information-assisted temporal loop filtering can be selected. This maximizes the encoding and decoding performance.
[0732] The TALF filtering scheme and related TALF-based schemes proposed in the embodiments of this application will be described by way of example below.
[0733] For example, a 7x7 symmetrical filter and two 5x5 symmetrical filters can be selected, but this application does not specifically limit the choice. Specifically, for a TALF using a single reconstructed image as input, a 7x7 symmetrical filter with 13 coefficients is used for filtering; for a TALF using two reconstructed images as input, two 5x5 symmetrical filters with 7 coefficients are used for filtering.
[0734] For example, filter-related parameters can be encoded and decoded at the beginning of the chip, but this application does not impose specific limitations.
[0735] For example, TALF technology can be used on the luminance component. In some implementations, chrominance can also be improved by using information from the reconstructed image in the time domain as an aid to enhance the reconstruction quality of the current chrominance image, but this application does not impose any specific limitations.
[0736] In one embodiment, during the TALF filtering process, a time-domain adaptive loop filter from the previous decoding can be reused, while a nonlinear time-domain adaptive loop filter is used, and adaptive accuracy of the time-domain loop filter is introduced. A maximum of four time-domain adaptive loop filters are allowed to be used per slice (strip), and the TALF can be performed after the ALF for loop filtering.
[0737] The syntax elements of the opening sequence are analyzed as follows:
[0738] The FIFO of the historical time-domain filter needs to be cleared when at least one of the following three conditions is true:
[0739] pcSlice->isIDRorBLA(): This condition indicates whether the current slice is IDR or BLA; IDR and BLA are both NAL types, indicating the start of a sequence; all slices in an image should have the same NAL type.
[0740] pcSlice->getPendingRasInit(): This condition indicates whether the POC has accumulated to the maximum allowed value and has been reset to 0.
[0741] pcSlice->isInterGDR(): This condition, as the name suggests, indicates whether it is a GDR.
[0742] The tAlfParamPool.clear() operation clears the FIFO of the history time-domain filter.
[0743] 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.
[0744] 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.
[0745] `talf_shift_minus5` indicates the variable precision used by one or more time-domain loop filters in the current slice encoding / decoding. It means subtracting 5 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.
[0746] `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 does not exist in the bitstream.
[0747] The operation tAlfParamPool[talf_filter_mode][0].shift = talf_shift_minus5 + 5 means restoring the parsed talf_shift_minus5 to the shift value and updating the first and second positions of the FIFO of the historical time-domain loop filter.
[0748] `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.
[0749] `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.
[0750] The operation tAlfParamPool[talf_filter_mode][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.
[0751] Furthermore, when reconstructing the time-domain filter coefficients, considering the introduction of a reuse mechanism, if the current slice's sh_talf_enabled_flag is 1 and talf_reuse_flag is 0, it is necessary to reconstruct the coefficient values, shift values, and nonlinear limit values of the time-domain adaptive loop filter.
[0752] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0753] The process of obtaining the nonlinear cutoff value tAlfClip of the current slice is as follows:
[0754] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0755] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0756] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows: shift = talf_shift_minus5 + 5
[0757] 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.
[0758] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0759] The process of obtaining the nonlinear cutoff value tAlfClip of the current slice is as follows:
[0760] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0761] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0762] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows: shift = tAlfParamPool[talf_filter_mode][talf_reuse_idx].shift
[0763] Furthermore, when performing TALF filtering on the luminance coding tree block, a non-zero talf_ctb_idc flag for the current luminance coding tree block indicates that TALF filtering is required.
[0764] The inputs to the filtering process include:
[0765] 1. A reconstructed luminance image array rec after luminance adaptive loop filtering.
[0766] 2. The corresponding temporal reconstructed luminance image array. For example, if the `talf_filter_mode` syntax element is 0, the most recent forward-reconstructed temporal image is used in RA configuration, or the first previously reconstructed image `rec0` is used in LD configuration; if it is 1, the most recent backward-reconstructed temporal image is used in RA configuration, or the first previously reconstructed image `rec1` is used in LD configuration; if it is 2, two reconstructed image arrays `rec0` and `rec1` are used.
[0767] 3. Indicates the luminance coordinates (xCtb, yCtb) of the current luminance coding tree block in the current image.
[0768] 4. The width tAlfWidth and height tAlfHeight of the luminance coding tree block.
[0769] 5. The coefficients tAlfCoeff of the time-domain adaptive loop filter.
[0770] 6. The nonlinear cutoff value tAlfClip for time-domain adaptive loop filtering.
[0771] 7. Time-domain adaptive loop filter shift value shift.
[0772] The filtering calculation for each position in the luminance coding tree block is as follows:
[0773] When numCoeff is 14:
[0774] The BitDepth variable represents the bit depth of the luminance component, and x and y represent the horizontal and vertical coordinates of the reconstructed image array. K(a, b) = min(b, max(-b, a)).
[0775] When numCoeff is 13 and talf_filter_mode is 0:
[0776] When numCoeff is 13 and talf_filter_mode is 1:
[0777] In 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 for the image boundaries.
[0778] It should be noted that, through experimental verification, the encoding and decoding method proposed in this application improves the compression performance of the ECM reference software under RA and LD configurations. For example, implementing the above method on the ECM-13.0 reference software can achieve some improvements in BD-rates under the RA configuration, with performance improvements in test sequences class-B, class-C, class-D, and class-F as shown in Table 2.
[0779] Table 2
[0780] Meanwhile, some improvements in BD-rates can be obtained under the LD configuration, with performance improvements in test sequences class-C, class-D, and class-E as shown in Table 3.
[0781] Table 3
[0782] In another embodiment, during the TALF filtering process, a time-domain adaptive loop filter from the historical decoding can be reused, while a nonlinear time-domain adaptive loop filter is used. Adaptive accuracy of the time-domain loop filter is introduced, and vector information-assisted time-domain loop filtering is employed. A maximum of eight time-domain adaptive loop filters are allowed per slice (strip), and the TALF can be located between the ALF and SAO for loop filtering.
[0783] The syntax elements of the opening sequence are analyzed as follows:
[0784] The FIFO of the historical time-domain filter needs to be cleared when at least one of the following three conditions is true:
[0785] pcSlice->isIDRorBLA(): This condition indicates whether the current slice is IDR or BLA; IDR and BLA are both NAL types, indicating the start of a sequence; all slices in an image should have the same NAL type.
[0786] pcSlice->getPendingRasInit(): This condition indicates whether the POC has accumulated to the maximum allowed value and has been reset to 0.
[0787] pcSlice->isInterGDR(): This condition, as the name suggests, indicates whether it is ...
Claims
1. A decoding method applied to a decoder, the method comprising: If it is determined that the current image is filtered using the Temporal Adaptive Loop Filter (TALF), the bitstream is decoded and the multiplexing identification information is determined. When filtering is performed based on the multiplexing identifier information to determine the multiplexing history TALF information, the bitstream is decoded, the multiplexing index parameters are determined, and the history TALF information is determined according to the multiplexing index parameters. The current image is filtered based on the historical TALF information to determine the filtered reconstructed value of the current image.
2. The method of claim 1, wherein, The method further includes: If filtering is performed based on the reuse identifier information and it is determined that historical TALF information will not be reused, the TALF information corresponding to the current image will be determined. The candidate historical dataset is updated based on the TALF information corresponding to the current image; wherein, the candidate historical dataset includes one or more historical datasets.
3. The method of claim 2, wherein, The step of determining historical TALF information based on the reuse index parameters includes: The data unit index is determined based on the reuse index parameters; In the historical dataset, determine the data unit corresponding to the data unit index; Based on the data unit corresponding to the data unit index, the historical TALF information is determined; wherein, the historical TALF information includes: filtering mode, number of filter groups, and filter coefficients of candidate filters.
4. The method of claim 2, wherein, The method further includes: If it is determined that the current image is filtered using TALF, the bitstream is decoded to determine the filtering mode corresponding to the current image.
5. The method of claim 4, wherein, The step of determining historical TALF information based on the reuse index parameters includes: The first historical dataset is determined from the plurality of historical datasets based on the filtering mode corresponding to the current image. The data unit index is determined according to the reuse index parameter, and the data unit corresponding to the data unit index is determined in the first historical dataset. Based on the data unit corresponding to the data unit index, the historical TALF information is determined; wherein, the historical TALF information includes: the number of filter groups and the filter coefficients of the candidate filters.
6. The method of claim 2, wherein, The method further includes: If it is determined that the current image is filtered using TALF, the bitstream is decoded to determine the filtering mode and the number of filter groups corresponding to the current image.
7. The method of claim 6, wherein, The step of determining historical TALF information based on the reuse index parameters includes: The data unit index is determined based on the reuse index parameters, and the data unit corresponding to the data unit index is determined in the historical dataset; wherein, the number of data unit indices and the number of data units corresponding to the data unit indices are determined based on the number of filter groups; Based on the data unit corresponding to the data unit index, the historical TALF information is determined; wherein, the historical TALF information includes the filter coefficients of the candidate filter.
8. The method of claim 2, wherein, The method further includes: If it is determined that the current image is filtered using TALF, the bitstream is decoded to determine the number of filter groups corresponding to the current image.
9. The method of claim 8, wherein, The step of determining historical TALF information based on the reuse index parameters includes: The data unit index is determined based on the reuse index parameters; In the historical dataset, determine the data unit corresponding to the data unit index; Based on the data unit corresponding to the data unit index, the historical TALF information is determined; wherein, the historical TALF information includes: the filtering mode and the filter coefficients of the candidate filter.
10. The method of any one of claims 3-5, wherein, The method further includes: Decode the bitstream to determine the first syntax element identifier information; When filtering is performed by reusing historical TALF information for the current block based on the first syntax element identification information, the filter coefficients corresponding to the current block are determined according to the first syntax element identification information and the historical TALF information.
11. The method of claim 10, wherein, The step of determining the filter coefficients corresponding to the current block based on the first syntax element identifier information and the historical TALF information includes: Based on the first syntax element identifier information and the number of filter groups, determine the candidate filter corresponding to the current block; The filter coefficients corresponding to the candidate filter are determined as the filter coefficients corresponding to the current block.
12. An encoding method applied to an encoder, the method comprising: When filtering the current image using TALF, determine the cost of using historical TALF information for filtering and the cost of not using historical TALF information for filtering. Based on the cost of filtering using the reused historical TALF information and the cost of filtering without reusing the historical TALF information, 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; If it is determined that the historical TALF information is reused for filtering, the reuse index parameter is determined and written into the bitstream.
13. The method of claim 12, wherein, The determination of reuse identification information based on the cost of filtering according to the reused historical TALF information and the cost of filtering without reusing historical TALF information includes: If the cost of filtering by reusing historical TALF information is greater than or equal to the cost of filtering by not reusing historical TALF information, the reuse identifier information is set to indicate that filtering by not 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 historical TALF information should be reused for filtering.
14. The method of claim 12 or 13, wherein, The method further includes: If it is determined that historical TALF information will not be reused for filtering, the TALF information corresponding to the current image is determined; The candidate historical dataset corresponding to the current image is updated based on the TALF information corresponding to the current image; wherein, the candidate historical dataset includes at least one historical dataset.
15. The method of claim 12 or 13, wherein, The determination of the reuse index parameters includes: Given that historical TALF information is reused for filtering, determine the minimum cost among the cost values when using historical TALF information for filtering. Determine the historical TALF information corresponding to the minimum cost value, and determine the data unit for storing the historical TALF information corresponding to the minimum cost value; The reuse index parameters are determined based on the data unit.
16. The method of claim 12, wherein, The method further includes: The first generation value corresponding to the current image when TALF is used for filtering is determined, and the first syntax element identification information is determined based on the first generation value. The first syntax element identification information is written into the bitstream; wherein, the first syntax element identification information is used to determine whether the current block is filtered using TALF.
17. The method of claim 16, wherein, Determining the first-generation value corresponding to the current image when filtered using TALF includes: Determine the candidate mode based on the current configuration; In each candidate mode, a candidate filter corresponding to the current block is determined, and the filter coefficients corresponding to the current block are determined based on the candidate filter corresponding to the current block. Determine the second-generation value of the filter coefficients corresponding to the current block; The minimum second-generation value is determined as the first-generation value corresponding to the current block when filtered using TALF.
18. The method of claim 17, wherein, The determination of the first syntax element identifier information based on the first generation value includes: Determine the third-generation value corresponding to the current block when TALF filtering is not used; If the value of the first generation is greater than or equal to the value of the third generation, the first syntax element identification information is set to indicate that the current block does not use TALF for filtering. If the value of the first generation is less than the value of the third generation, the first syntax element identifier information is set to instruct the current block to use TALF for filtering.
19. A code stream, wherein the code stream is generated by bit-encoding information to be encoded; and wherein, The information to be encoded includes at least one of the following: first syntax element identification information, multiplexing identification information, multiplexing index parameters, filtering mode, number of filter groups, and filter coefficients of candidate filters.
20. An encoder, the encoder comprising a first determining unit; wherein, The first determining unit is configured to, when filtering the current image using TALF, determine the cost of filtering using historical TALF information and the cost of filtering without reusing historical TALF information; determine reuse identifier information based on the cost of filtering using historical TALF information and the cost of filtering without reusing historical TALF information, and write the reuse identifier information into the bitstream; wherein, the reuse identifier information is used to determine whether to reuse historical TALF information for filtering; if it is determined that historical TALF information should be reused for filtering, determine reuse index parameters and write the reuse index parameters into the bitstream.
21. An encoder, the encoder comprising a first memory and a first processor; wherein, The first memory is used to store computer programs that can run on the first processor; The first processor is configured to, when running the computer program, perform the method as described in any one of claims 12 to 18.
22. A decoder, the decoder comprising a second determining unit; wherein, The second determining unit is configured to, when determining that the current image is filtered using TALF, decode the bitstream and determine multiplexing identifier information; when determining that multiplexing historical TALF information is used for filtering based on the multiplexing identifier information, decode the bitstream, determine multiplexing index parameters, and determine historical TALF information based on the multiplexing index parameters; filter the current image based on the historical TALF information, and determine the filtered reconstructed value of the current image.
23. A decoder, the 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; The second processor is configured to, when running the computer program, perform the method as described in any one of claims 1 to 11.
24. A computer-readable storage medium storing a computer program that, when executed, implements the decoding method as described in any one of claims 1 to 11, or the encoding method as described in any one of claims 12 to 18.
25. A computer-readable storage medium for storing a bitstream generated by the encoding method of any one of claims 12 to 18.