Encoding method, decoding method, bitstream, encoder, decoder, and storage medium
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
Smart Images

Figure CN2024103984_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 improve filtering effects and enhance 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, the bitstream is decoded to determine the order identifier information and shift identifier information;
[0009] Determine at least one inter-frame reference image corresponding to the current image, determine filter coefficients based on the order identifier information, and determine shift parameters based on the shift identifier information;
[0010] The filtered reconstructed value of the current block is determined by filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients, and the shift parameters.
[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, the calculus value corresponding to the candidate order is determined, the order identification information is determined based on the calculus value corresponding to the candidate order, and the order identification information is written into the bitstream.
[0013] When filtering the current image using TALF, the cost value corresponding to the candidate shift parameter is determined, the shift identifier information is determined based on the cost value corresponding to the candidate shift parameter, and the shift identifier information is written into the bitstream;
[0014] Determine at least one inter-frame reference image corresponding to the current image, and determine the filter coefficients and shift parameters;
[0015] The filtered reconstructed value of the current block is determined by filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients, and the shift parameters.
[0016] 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 identifier information, order identifier information, shift identifier information, coefficient numerical parameter, quantity parameter, and coefficient sign parameter.
[0017] Fourthly, embodiments of this application provide an encoder, the encoder including a first determining unit; wherein,
[0018] The first determining unit is configured to: when filtering the current image using TALF, determine the cost value corresponding to a candidate order, determine order identification information based on the cost value corresponding to the candidate order, and write the order identification information into the bitstream; when filtering the current image using TALF, determine the cost value corresponding to a candidate shift parameter, determine shift identification information based on the cost value corresponding to the candidate shift parameter, and write the shift identification information into the bitstream; determine at least one inter-frame reference image corresponding to the current image, determine filter coefficients and shift parameters; and perform filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients, and the shift parameters to determine the filtered reconstructed value of the current block.
[0019] Fifthly, embodiments of this application provide an encoder, which includes a first memory and a first processor; wherein,
[0020] The first memory is used to store computer programs that can run on the first processor;
[0021] The first processor is configured to execute the encoding method described above when running the computer program.
[0022] Sixthly, embodiments of this application provide a decoder, which includes a second determining unit; wherein,
[0023] The second determining unit is configured to, when it is determined that the current image is filtered using TALF, decode the bitstream, determine order identifier information and shift identifier information; determine at least one inter-frame reference image corresponding to the current image, determine filter coefficients according to the order identifier information, determine shift parameters according to the shift identifier information; and perform filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients and the shift parameters to determine the filtered reconstructed value of the current block.
[0024] Seventhly, embodiments of this application provide a decoder, which includes a second memory and a second processor; wherein,
[0025] The second memory is used to store computer programs that can run on the second processor;
[0026] The second processor is configured to execute the decoding method described above when running the computer program.
[0027] 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.
[0028] 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.
[0029] 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 is being filtered using TALF, the bitstream is decoded to determine order identifier information and shift identifier information; at least one inter-frame reference image corresponding to the current image is determined; filter coefficients are determined based on the order identifier information; and shift parameters are determined based on the shift identifier information. Filtering is performed based on reconstructed samples from at least one inter-frame reference image, filter coefficients, and shift parameters to determine the filtered reconstructed value of the current block. At the encoding end, when the current image is being filtered using TALF, the cost value corresponding to the candidate order is determined; order identifier information is determined based on the cost value corresponding to the candidate order; and the order identifier information is written into the bitstream. When the current image is being filtered using TALF, the cost value corresponding to the candidate shift parameter is determined; shift identifier information is determined based on the cost value corresponding to the candidate shift parameter; and the shift identifier information is written into the bitstream. At least one inter-frame reference image corresponding to the current image is determined; filter coefficients and shift parameters are determined. Filtering is performed based on reconstructed samples from at least one inter-frame reference image, filter coefficients, and shift parameters to determine the filtered reconstructed value of the current block. Therefore, the embodiments of this application propose a time-domain adaptive loop filtering method, which introduces a variable-order exponential Golomb to encode and decode filter coefficients by transmitting order identification information. At the same time, a variable shift value is introduced during the filtering process by transmitting shift identification information, thereby achieving better adaptability in TALF filtering and further improving the filtering effect of time-domain adaptive loop filtering. Attached Figure Description
[0030] Figure 1 is a schematic diagram of the application of a coding framework provided by related technologies;
[0031] Figure 2 is a schematic diagram of the application of a loop filter module provided by related technologies;
[0032] Figure 3 is a schematic diagram of the shape of a common brightness adaptive loop filter;
[0033] Figure 4 is a schematic diagram of the shape of a common chromaticity adaptive loop filter.
[0034] Figure 5 is a schematic diagram of the loop filtering implementation process;
[0035] Figure 6 is a schematic diagram of the shape of the cross-component adaptive filter;
[0036] Figure 7 shows the relationship between encoding / decoding and playback order under one RA configuration;
[0037] Figure 8 is a system block diagram of an encoder provided in an embodiment of this application;
[0038] Figure 9 is a system block diagram of a decoder provided in an embodiment of this application;
[0039] Figure 10 is a schematic diagram of the decoding method proposed in an embodiment of this application;
[0040] Figure 11 is a schematic diagram of the implementation of TALF filtering proposed in an embodiment of this application;
[0041] Figure 12 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application;
[0042] Figure 13 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application;
[0043] Figure 14 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application;
[0044] Figure 15 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application;
[0045] Figure 16 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application;
[0046] Figure 17 is a schematic diagram of the implementation of TALF filtering proposed in the embodiments of this application;
[0047] Figure 18 is a schematic diagram of the filter proposed in an embodiment of this application;
[0048] Figure 19 is a schematic diagram of the filter proposed in the embodiment of this application;
[0049] Figure 20 is a schematic diagram of the filter proposed in the embodiment of this application;
[0050] Figure 21 is a schematic diagram of the filter proposed in the embodiment of this application;
[0051] Figure 22 is a schematic diagram of the filter proposed in the embodiment of this application;
[0052] Figure 23 is a schematic diagram of the filter proposed in the embodiment of this application;
[0053] Figure 24 is a schematic diagram of the filter proposed in the embodiment of this application;
[0054] Figure 25 is a schematic diagram of the encoding method proposed in the embodiments of this application;
[0055] Figure 26 is a schematic diagram of the filter proposed in the embodiment of this application;
[0056] Figure 27 is a schematic diagram nine of the filter proposed in the embodiments of this application;
[0057] Figure 28 is a schematic diagram of the encoder structure proposed in the embodiment of this application;
[0058] Figure 29 is a schematic diagram of the specific hardware structure of the encoder proposed in the embodiment of this application;
[0059] Figure 30 is a schematic diagram of the composition structure of the decoder proposed in the embodiment of this application;
[0060] Figure 31 is a schematic diagram of the specific hardware structure of the decoder proposed in the embodiment of this application;
[0061] Figure 32 is a schematic diagram of the composition structure of the encoding and decoding system proposed in the embodiment of this application. Detailed Implementation
[0062] 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.
[0063] 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.
[0064] 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.
[0065] 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.
[0066] 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.
[0067] 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.
[0068] 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.
[0069] 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.
[0070] 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.
[0071] 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.
[0072] 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.
[0073] 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.
[0074] 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.
[0075] 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.
[0076] 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.
[0077] 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.
[0078] 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:
[0079] Table 1
[0080] 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.
[0081] 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:
[0082] 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.
[0083] 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.
[0084] Furthermore, embodiments of this application provide an encoding / decoding method, a bitstream, an encoder, a decoder, and a storage medium. By transmitting order identification information, a variable-order exponential Golomb is introduced to encode and decode filter coefficients. Simultaneously, by transmitting shift identification information, a variable shift value is introduced during the filtering process, thereby achieving better adaptability in TALF filtering and further improving the filtering effect of time-domain adaptive loop filtering.
[0085] 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.
[0086] 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.
[0087] 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.
[0088] 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.
[0089] 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.
[0090] 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.
[0091] 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.
[0092] 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.
[0093] 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.
[0094] 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.
[0095] 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.
[0096] 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.
[0097] 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.
[0098] 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.
[0099] 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.
[0100] 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").
[0101] Based on Figure 7, the encoding method in this embodiment is mainly applied to the "filtering unit 113" part of the encoder 10.
[0102] Based on Figure 8, the decoding method in this embodiment is mainly applied to the "filtering unit 208" part of the decoder 20.
[0103] 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.
[0104] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0105] 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:
[0106] Step 1001: If it is determined that the current block image is filtered using TALF, decode the bitstream and determine the order identifier information and shift identifier information.
[0107] In the embodiments of this application, if it is determined that the current image is filtered using TALF, then the order identifier information and shift identifier information can be determined by decoding the bitstream.
[0108] It should be noted that, in the embodiments of this application, the order identification information can be used to determine the exponential Golomb order. The exponential Golomb order can be used for encoding and decoding filter coefficients; for example, it can be used to encode and decode the numerical parameters of the coefficients corresponding to the filter coefficients.
[0109] Furthermore, in the embodiments of this application, the exponential Golomb order of the encoder-decoder filter coefficients can be determined by the value of the order identifier information. The value of the order identifier information can be in parametric form or in numerical form; this application does not impose specific limitations on this.
[0110] It should be noted that, in the embodiments of this application, the order identification information can be an image-level flag or a slice-level flag. Typically, the order identification information can be a parameter written in the slice header or picture header, and no limitations are imposed here.
[0111] Furthermore, in the embodiments of this application, the order identification information can correspond to a filter, or it can correspond to image level, slice level, block level, sequence level, etc. That is to say, in addition to transmitting an order for each filter, some embodiments can also transmit the order in units of images, sequences, etc., meaning that the temporal filter coefficients encoded and decoded in an image use the same order of exponential Golomb code or the same sequence uses the same order of exponential Golomb code.
[0112] For example, in some embodiments, if the order identifier information is 1, then the order of the exponential Columbus can be determined to be 1; if the order identifier information is 0, then the order of the exponential Columbus can be determined to be 0; if the order identifier information is M, then the order of the exponential Columbus can be determined to be M, where M is an integer greater than or equal to 0.
[0113] In other words, in the embodiments of this application, a variable-order Golomb code can be introduced to encode and decode filter coefficients by setting the order identification information. For example, an optimal order can be selected from 0, 1, ... M, and the optimal order can be transmitted through the code stream, so that the filter coefficients can be encoded using the optimal exponential Golomb order.
[0114] For example, in some embodiments, if the order identifier information is true, then the order of the exponential Columbus can be determined to be 1; if the order identifier information is false, then the order of the exponential Columbus can be determined to be 0.
[0115] For example, in some embodiments, assuming the order identification information is a slice-level flag, the order identification information can be represented by the syntax element `talf_k_order[sfIdx]`, that is, `talf_k_order[sfIdx]` indicates the exponential Golomb order of the filter coefficients of the sfIdx-th filter group being encoded and decoded. If the value of `talf_k_order[sfIdx]` is 0, it can be determined that the exponential Golomb order of the filter coefficients of the sfIdx-th filter group being encoded and decoded is 0; if the value of `talf_k_order[sfIdx]` is 1, it can be determined that the exponential Golomb order of the filter coefficients of the sfIdx-th filter group being encoded and decoded is 1.
[0116] Of course, the value of talf_k_order[sfIdx] is not limited to 0 and 1, and this application does not impose specific restrictions.
[0117] It should be noted that, in the embodiments of this application, the shift identifier information can be used to determine the shift parameter, that is, the shift identifier information can determine the shift value shift in the filtering process. This shift parameter is the shift value shift, which can be determined by the variable precision in the filtering process of the current image (or current slice), and the value of the shift identifier information can characterize this variable precision.
[0118] It is understood that, in the embodiments of this application, compared to a fixed shift value, a variable shift value is introduced through shift identifier information, and a variable shift value is transmitted through the bitstream, enabling the filter coefficients to achieve better adaptability. Specifically, a larger shift value results in a wider range of filter coefficients, better filtering performance, and more codewords; a smaller shift value results in a smaller range of filter coefficients, poorer filtering performance, and fewer codewords.
[0119] Furthermore, in the embodiments of this application, the shift identifier information can correspond to a filter, or it can correspond to the image level, slice level, block level, sequence level, etc. That is to say, in addition to transmitting a variable shift for each filter, some embodiments can also transmit shift on a per-image, per-sequence, etc., i.e., the transmitted shift value can be transmitted for each temporal filter, or for each frame of image, or for each sequence.
[0120] Furthermore, in the embodiments of this application, the shift value shift in the filtering process can be determined by the value of the shift identifier information. The value of the shift identifier information can be in parameter form or in numerical form; this application does not impose any specific limitation.
[0121] It should be noted that, in the embodiments of this application, the shift identifier information can be an image-level flag or a slice-level flag. Typically, the shift identifier information can be a parameter written in the slice header or picture header, and no limitations are imposed here.
[0122] For example, in some embodiments, assuming the shift identifier is a slice-level flag, the shift identifier can be represented by the syntax element `talf_shift_minus5`. For instance, `talf_shift_minus5` is the shift value used by the current slice during filtering minus 5. `talf_shift_minus5` can be represented by a fixed-length code of 2 bins, with values of 0, 1, 2, or 3.
[0123] Of course, the value of the shift identifier information can also represent the shift value used in the filtering process minus any integer greater than 0, and is not limited to 5.
[0124] For example, in some embodiments, the title sequence syntax elements are parsed as follows:
[0125] Here, `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 by a fixed-length code of length 2 bins in this scheme, with values of 0, 1, 2, or 3. Its value is 0 when this syntax element is not present in the bitstream.
[0126] `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.
[0127] Furthermore, in the embodiments of this application, the bitstream can be decoded first to determine the first syntax element identification information.
[0128] It is understood that, in the 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 to use a TALF filter to filter the reconstructed values of the image components of the current block.
[0129] 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.
[0130] 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.
[0131] 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.
[0132] 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.
[0133] 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.
[0134] 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.
[0135] 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.
[0136] 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.
[0137] 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.
[0138] 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.
[0139] 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.
[0140] 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 (strip-level) flag, a sub-picture-level flag, or a tile-level flag. This application does not impose specific limitations.
[0141] 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.
[0142] Furthermore, in the embodiments of this application, the value of the second syntax element identification information can be used to determine whether the current image (and / or the current slice) is allowed to use TALF for filtering.
[0143] 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.
[0144] 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.
[0145] 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.
[0146] 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.
[0147] 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.
[0148] 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.
[0149] Of course, the value of sh_talf_enabled_flag is not limited to 0 and 1, and this application does not impose specific restrictions.
[0150] 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.
[0151] 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:
[0152] 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.
[0153] 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.
[0154] 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.
[0155] 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.
[0156] 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.
[0157] 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.
[0158] 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.
[0159] 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.
[0160] 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.
[0161] Of course, the value of sps_talf_enabled_flag is not limited to 0 and 1, and this application does not impose specific restrictions.
[0162] 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.
[0163] 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:
[0164] 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.
[0165] 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.
[0166] 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.
[0167] 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:
[0168] 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.
[0169] 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.
[0170] 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.
[0171] 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.
[0172] 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:
[0173] 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.
[0174] 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.
[0175] 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.
[0176] 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.
[0177] 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:
[0178] 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.
[0179] 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.
[0180] 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:
[0181] 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.
[0182] Step 1002: Determine at least one inter-frame reference image corresponding to the current image, determine the filter coefficients based on the order identifier information, and determine the shift parameters based on the shift identifier information.
[0183] In the embodiments of this application, if it is determined that TALF is used for filtering, then at least one inter-frame reference image corresponding to the current image can be further determined. At the same time, after the order identifier information and shift identifier information are determined in the decoded bitstream, the filter coefficients can be determined according to the order identifier information, and the shift parameters can be determined according to the shift identifier information.
[0184] Furthermore, in the embodiments of this application, when determining the filter coefficients based on the order identification information, the exponential Golomb order can be determined based on the order identification information; then, the numerical parameters of the coefficients corresponding to the filter coefficients can be determined based on the decoded bitstream of the exponential Golomb order; finally, the filter coefficients can be determined based on the numerical parameters of the coefficients.
[0185] It is understood that, in the examples of this application, the exponential Golomb order can include 0 or 1, meaning that 0th-order exponential Golomb codes or 1st-order exponential Golomb codes can be used to encode and decode the numerical parameters of the filter coefficients. Of course, the exponential Golomb order can also be any other integer greater than 0, and this application does not impose any specific limitations.
[0186] 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.
[0187] 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.
[0188] 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.
[0189] 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.
[0190] 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.
[0191] 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.
[0192] 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.
[0193] For example, in some embodiments, the implementation of determining TALF parameters by parsing APS is as follows:
[0194] 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()`.
[0195] For example, in some embodiments, the implementation of determining TALF parameters by parsing alf_data() is as follows:
[0196] Among them, talf_filter_signal_flag is used to identify whether there are TALF parameters in the current alf_data parameters;
[0197] 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.
[0198] `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.
[0199] 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;
[0200] 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;
[0201] The variable numCoeff represents the number of filter coefficients in the filter.
[0202] 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.
[0203] 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.
[0204] For example, in some embodiments, the method for encoding and decoding TALF identifiers and TALF parameters in the image header is as follows:
[0205] 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.
[0206] 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.
[0207] 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.
[0208] 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.
[0209] 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.
[0210] 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.
[0211] 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.
[0212] 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.
[0213] 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.
[0214] 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.
[0215] 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.
[0216] 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.
[0217] 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.
[0218] 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.
[0219] 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.
[0220] 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.
[0221] 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:
[0222] 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;
[0223] 2. Under 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;
[0224] 3. Under 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;
[0225] 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.
[0226] 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.
[0227] 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.
[0228] 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.
[0229] 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.
[0230] 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.
[0231] 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.
[0232] It is understood that, in the embodiments of this application, when it is determined that the current block uses TALF for filtering based on the first syntax element identification information, the process of determining the filter coefficients corresponding to the current block can be executed.
[0233] It should be noted that, in the embodiments of this application, after determining the coefficient value parameters corresponding to the filter coefficients based on the decoded bitstream of the exponential Golomb order, when determining the filter coefficients based on the coefficient value parameters, the number of filter groups can be determined based on the quantity parameter; the filter coefficients are determined based on the number of filter groups, the coefficient value parameters, the coefficient sign parameters, and the first syntax element identification information.
[0234] 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.
[0235] 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.
[0236] 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.
[0237] 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.
[0238] 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.
[0239] 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.
[0240] 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.
[0241] 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.
[0242] 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.
[0243] 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.
[0244] 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].
[0245] 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...
[0246] The process of reconstructing filters with positive and negative coefficients is as follows:
[0247] The variable numCoeff represents the number of filter coefficients in the filter.
[0248] 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.
[0249] 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.
[0250] Furthermore, in the embodiments of this application, when determining the shift parameter based on the shift identifier information, the variable precision can be determined first based on the shift identifier information; then, the shift parameter can be determined based on the variable precision and the preset value.
[0251] For example, in some embodiments, assuming the shift identifier information is talf_shift_minus5 and the preset value is 5, then the shift parameter shift, i.e. the shift value shift, can be determined by shift = talf_shift_minus5 + 5.
[0252] It is understood that, in the embodiments of this application, the preset value can be any integer greater than 0, and is not limited to 5.
[0253] Step 1003: Filter based on the reconstructed samples, filter coefficients and shift parameters of at least one inter-frame reference image to determine the filtered reconstructed value of the current block.
[0254] In the embodiments of this application, after determining that TALF is used for filtering and determining at least one inter-frame reference image, filter coefficients, and shift parameters corresponding to the current image, filtering can be further performed based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients, and the shift parameters to determine the filtered reconstructed value of the current block.
[0255] 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.
[0256] Furthermore, in the embodiments of this application, when filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients, and the shift parameters 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 shift coefficients, filter coefficients, 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.
[0257] 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 and shift 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.
[0258] 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:
[0259] 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.
[0260] 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.
[0261] 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.
[0262] 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:
[0263] 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.
[0264] 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.
[0265] 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:
[0266] Further, in the embodiments of this application, when filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients, and the shift parameters 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 shift coefficients, filter coefficients, 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.
[0267] 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 and shift 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.
[0268] 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:
[0269] 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 iReconstructed 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.
[0270] 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.
[0271] 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.
[0272] 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:
[0273] For example, in some embodiments, based on the filtering process of formula (5), the filtering calculation at each position is as follows:
[0274] When numCoeff is 14:
[0275] Where shift is the shift value calculated based on the extracted talf_shift_minus5, BitDepth is the bit depth of the luminance component, and x and y represent the horizontal and vertical coordinates of the reconstructed image array.
[0276] 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.
[0277] 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.
[0278] 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:
[0279] 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.
[0280] 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.
[0281] 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.
[0282] 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.
[0283] 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.
[0284] 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.
[0285] 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.
[0286] 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.
[0287] 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.
[0288] 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.
[0289] 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.
[0290] 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.
[0291] 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.
[0292] In other words, in the embodiments of this application, TALF filtering can be applied to any image component of the current image.
[0293] 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.
[0294] 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.
[0295] 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.
[0296] 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.
[0297] 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.
[0298] 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.
[0299] 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.
[0300] 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.
[0301] 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.
[0302] Of course, filters can also be asymmetric, which means that each filter input location has different coefficient values.
[0303] 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.
[0304] 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.
[0305] 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.
[0306] 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.
[0307] 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.
[0308] 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.
[0309] It is understood that the decoding method proposed in this application embodiment can use TALF for either the luminance component or the chrominance component.
[0310] 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.
[0311] 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.
[0312] This application provides a decoding method that introduces a variable-order exponential Golomb to encode and decode filter coefficients by transmitting order identification information. At the same time, a variable shift value is introduced during the filtering process by transmitting shift identification information, thereby achieving better adaptability in TALF filtering and further improving the filtering effect of time-domain adaptive loop filtering.
[0313] 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 27 is a schematic diagram of the encoding method proposed in this application. As shown in Figure 27, the method for the encoder to perform encoding processing may include the following steps:
[0314] Step 2001: When filtering the current image using TALF, determine the cost value corresponding to the candidate order, determine the order identification information based on the cost value corresponding to the candidate order, and write the order identification information into the bitstream.
[0315] Step 2002: When filtering the current image using TALF, determine the cost value corresponding to the candidate shift parameter, determine the shift identifier information based on the cost value corresponding to the candidate shift parameter, and write the shift identifier information into the bit stream.
[0316] In the embodiments of this application, if TALF is used to filter the current image, the cost value corresponding to the candidate order can be determined first, the order identification information can be determined according to the cost value corresponding to the candidate order, and the order identification information can be written into the bitstream.
[0317] It should be noted that, in the embodiments of this application, the order identification information can be used to determine the exponential Golomb order. The exponential Golomb order can be used for encoding and decoding filter coefficients; for example, it can be used to encode and decode the numerical parameters of the coefficients corresponding to the filter coefficients.
[0318] Furthermore, in the embodiments of this application, the exponential Golomb order of the encoder-decoder filter coefficients can be determined by the value of the order identifier information. The value of the order identifier information can be in parametric form or in numerical form; this application does not impose specific limitations on this.
[0319] It should be noted that, in the embodiments of this application, the order identification information can be an image-level flag or a slice-level flag. Typically, the order identification information can be a parameter written in the slice header or picture header, and no limitations are imposed here.
[0320] Furthermore, in the embodiments of this application, the order identification information can correspond to a filter, or it can correspond to image level, slice level, block level, sequence level, etc. That is to say, in addition to transmitting an order for each filter, some embodiments can also transmit the order in units of images, sequences, etc., meaning that the temporal filter coefficients encoded and decoded in an image use the same order of exponential Golomb code or the same sequence uses the same order of exponential Golomb code.
[0321] Furthermore, in the embodiments of this application, the candidate orders can be traversed, and the cost value corresponding to each candidate order can be calculated respectively. In this way, the optimal candidate order can be determined based on the cost value, and the order identification information can be set and transmitted.
[0322] It is understood that, in the embodiments of this application, the candidate order may include one or more exponential Golomb orders. For example, the candidate order may include orders 0, 1, ..., M, for a total of M+1 orders, where M is an integer greater than or equal to 0.
[0323] Furthermore, in the embodiments of this application, when determining the order identification information based on the substitution value corresponding to the candidate order, the minimum substitution value among the substitution values corresponding to the candidate order can be determined first; then the candidate order corresponding to the minimum substitution value can be determined as the optimal exponential Columbus order; finally, the order identification information can be determined based on the optimal exponential Columbus order.
[0324] In other words, in the embodiments of this application, a variable-order Golomb code can be introduced to encode and decode filter coefficients by setting the order identification information. For example, an optimal order can be selected from 0, 1, ... M, and the optimal order can be transmitted through the code stream, so that the filter coefficients can be encoded using the optimal exponential Golomb order.
[0325] For example, in some embodiments, if the order of the exponential Columbus is determined to be 1, then the value of the order identification information can be set to 1; if the order of the exponential Columbus is determined to be 0, then the value of the order identification information can be set to 0; if the order of the exponential Columbus is determined to be M, then the value of the order identification information can be set to M.
[0326] For example, in some embodiments, assuming the order identification information is a slice-level flag, the order identification information can be represented by the syntax element `talf_k_order[sfIdx]`, that is, `talf_k_order[sfIdx]` indicates the exponential Golomb order of the filter coefficients of the sfIdx-th filter group being encoded and decoded. If the value of `talf_k_order[sfIdx]` is 0, it can be determined that the exponential Golomb order of the filter coefficients of the sfIdx-th filter group being encoded and decoded is 0; if the value of `talf_k_order[sfIdx]` is 1, it can be determined that the exponential Golomb order of the filter coefficients of the sfIdx-th filter group being encoded and decoded is 1.
[0327] Of course, the value of talf_k_order[sfIdx] is not limited to 0 and 1, and this application does not impose specific restrictions.
[0328] In the embodiments of this application, if TALF is used to filter the current image, the cost value corresponding to the candidate shift parameter can be determined first, and then the shift identification information can be determined according to the cost value corresponding to the candidate shift parameter, and the shift identification information can be written into the bitstream.
[0329] Furthermore, in the embodiments of this application, when determining the shift identifier information based on the cost value corresponding to the candidate shift parameters, the minimum cost value among the cost values corresponding to the candidate shift parameters can be determined first; then the candidate shift parameter corresponding to the minimum cost value can be determined as the optimal shift parameter; then, the variable precision can be determined based on the optimal shift parameter and a preset value; finally, the shift identifier information can be determined based on the variable precision.
[0330] It is understood that, in the embodiments of this application, the candidate shift parameters can be traversed, and the cost value corresponding to each candidate shift parameter can be calculated respectively. In this way, the optimal shift parameter can be determined based on the cost value, and the shift identification information can be set and transmitted.
[0331] It is understood that in the embodiments of this application, the candidate shift parameter may include one or more shift values, and this application does not impose specific limitations.
[0332] It should be noted that, in the embodiments of this application, the shift identifier information can be used to determine the shift parameter, that is, the shift identifier information can determine the shift value shift in the filtering process. This shift parameter is the shift value shift, which can be determined by the variable precision in the filtering process of the current image (or current slice), and the value of the shift identifier information can characterize this variable precision.
[0333] It is understood that, in the embodiments of this application, compared to a fixed shift value, a variable shift value is introduced through shift identifier information, and a variable shift value is transmitted through the bitstream, enabling the filter coefficients to achieve better adaptability. Specifically, a larger shift value results in a wider range of filter coefficients, better filtering performance, and more codewords; a smaller shift value results in a smaller range of filter coefficients, poorer filtering performance, and fewer codewords.
[0334] Furthermore, in the embodiments of this application, the shift identifier information can correspond to a filter, or it can correspond to the image level, slice level, block level, sequence level, etc. That is to say, in addition to transmitting a variable shift for each filter, some embodiments can also transmit shift on a per-image, per-sequence, etc., i.e., the transmitted shift value can be transmitted for each temporal filter, or for each frame of image, or for each sequence.
[0335] Furthermore, in the embodiments of this application, the shift value shift in the filtering process can be determined by the value of the shift identifier information. The value of the shift identifier information can be in parameter form or in numerical form; this application does not impose any specific limitation.
[0336] It should be noted that, in the embodiments of this application, the shift identifier information can be an image-level flag or a slice-level flag. Typically, the shift identifier information can be a parameter written in the slice header or picture header, and no limitations are imposed here.
[0337] For example, in some embodiments, assuming the shift identifier is a slice-level flag, the shift identifier can be represented by the syntax element `talf_shift_minus5`. For instance, `talf_shift_minus5` is the shift value used by the current slice during filtering minus 5. `talf_shift_minus5` can be represented by a fixed-length code of 2 bins, with values of 0, 1, 2, or 3.
[0338] Of course, the value of the shift identifier information can also represent the shift value used in the filtering process minus any integer greater than 0, and is not limited to 5.
[0339] For example, in some embodiments, the title sequence syntax elements are as follows:
[0340] Here, `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 by a fixed-length code of length 2 bins in this scheme, with values of 0, 1, 2, or 3. Its value is 0 when this syntax element is not present in the bitstream.
[0341] `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.
[0342] 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.
[0343] Step 2003: Determine at least one inter-frame reference image corresponding to the current image, and determine the filter coefficients and shift parameters.
[0344] In embodiments of this application, at least one inter-frame reference image corresponding to the current image may be further determined, and filter coefficients and shift parameters may be determined.
[0345] It is understood that, in the embodiments of this application, after determining the optimal exponential Golomb order based on the cost value corresponding to the candidate order, the optimal exponential Golomb order can be used to encode and decode the filter coefficients.
[0346] It is understood that, in the embodiments of this application, after determining the optimal shift parameter based on the cost corresponding to the candidate shift, the optimal shift parameter can be encoded and decoded to determine the shift parameter used in the filtering process.
[0347] Furthermore, 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 first.
[0348] 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.
[0349] 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.
[0350] 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.
[0351] 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.
[0352] 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.
[0353] 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.
[0354] 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.
[0355] 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.
[0356] 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.
[0357] 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.
[0358] 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.
[0359] 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.
[0360] 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.
[0361] 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.
[0362] 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.
[0363] 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.
[0364] 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.
[0365] 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.
[0366] 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.
[0367] 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:
[0368] 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;
[0369] 2. Under 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;
[0370] 3. Under 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;
[0371] 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.
[0372] 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.
[0373] 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.
[0374] 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 reconstructed value of the current image under the corresponding mode, the reconstructed 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.
[0375] Step 2004: Filter based on the reconstructed samples, filter coefficients and shift parameters of at least one inter-frame reference image to determine the filtered reconstructed value of the current block.
[0376] In the embodiments of this application, after determining that TALF is used for filtering and determining at least one inter-frame reference image, filter coefficients, and shift parameters corresponding to the current image, filtering can be further performed based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients, and the shift parameters to determine the filtered reconstructed value of the current block.
[0377] 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.
[0378] Furthermore, in the embodiments of this application, when filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients, and the shift parameters 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 shift coefficients, filter coefficients, 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.
[0379] 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 and shift 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.
[0380] In some embodiments, assuming that the current image corresponds to an inter-frame reference image, 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).
[0381] 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.
[0382] 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.
[0383] 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).
[0384] 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.
[0385] 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.
[0386] 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).
[0387] Further, in the embodiments of this application, when filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients, and the shift parameters 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 shift coefficients, filter coefficients, 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.
[0388] 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 and shift 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.
[0389] 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).
[0390] 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.
[0391] 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.
[0392] 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).
[0393] For example, in some embodiments, based on the filtering process of formula (5), the filtering calculation at each position is as follows:
[0394] When numCoeff is 14:
[0395] Where shift is the shift value calculated based on the extracted talf_shift_minus5, BitDepth is the bit depth of the luminance component, and x and y represent the horizontal and vertical coordinates of the reconstructed image array.
[0396] 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.
[0397] 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.
[0398] 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).
[0399] 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.
[0400] 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.
[0401] 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.
[0402] 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.
[0403] 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.
[0404] 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.
[0405] 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.
[0406] 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.
[0407] 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.
[0408] 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.
[0409] 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.
[0410] 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.
[0411] 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.
[0412] In other words, in the embodiments of this application, TALF filtering can be applied to any image component of the current image.
[0413] 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.
[0414] 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.
[0415] 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.
[0416] 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.
[0417] 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.
[0418] 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.
[0419] 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.
[0420] 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.
[0421] 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.
[0422] Of course, filters can also be asymmetric, which means that each filter input location has different coefficient values.
[0423] 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.
[0424] 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.
[0425] 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.
[0426] 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.
[0427] 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.
[0428] 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.
[0429] 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.
[0430] 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.
[0431] 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.
[0432] 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.
[0433] 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.
[0434] 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.
[0435] 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.
[0436] 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.
[0437] 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.
[0438] 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.
[0439] 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.
[0440] 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.
[0441] 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.
[0442] 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.
[0443] 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.
[0444] 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.
[0445] 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.
[0446] Furthermore, in the embodiments of this application, the value of the second syntax element identification information can be used to determine whether the current image (and / or the current slice) is allowed to use TALF for filtering.
[0447] 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.
[0448] 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.
[0449] 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.
[0450] 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.
[0451] 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.
[0452] 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.
[0453] Of course, the value of sh_talf_enabled_flag is not limited to 0 and 1, and this application does not impose specific restrictions.
[0454] 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.
[0455] 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.
[0456] 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.
[0457] 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.
[0458] 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.
[0459] 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.
[0460] 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.
[0461] 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.
[0462] 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.
[0463] Of course, the value of sps_talf_enabled_flag is not limited to 0 and 1, and this application does not impose specific restrictions.
[0464] Therefore, in the embodiments of this application, the encoding of the second syntax element identification information can depend on the third syntax element identification information; that is, the image-level (and / or slice-level) identification can depend on the sequence-level identification. For example, if it is determined that the current sequence is to be filtered using TALF based on the third syntax element identification information, the encoding of the second syntax element identification information can be further performed; otherwise, it is not necessary to encode the second syntax element identification information.
[0465] 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.
[0466] 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.
[0467] 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.
[0468] 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.
[0469] 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.
[0470] 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.
[0471] 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.
[0472] 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.
[0473] 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.
[0474] 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.
[0475] 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.
[0476] 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.
[0477] 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.
[0478] Furthermore, in the embodiments of this application, the TALF parameters can also be directly written into the bitstream.
[0479] 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.
[0480] 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.
[0481] 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.
[0482] 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.
[0483] 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.
[0484] 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.
[0485] 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.
[0486] 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.
[0487] 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.
[0488] 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.
[0489] 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.
[0490] This application provides an encoding method that introduces a variable-order exponential Golomb to encode and decode filter coefficients by transmitting order identification information. At the same time, a variable shift value is introduced during the filtering process by transmitting shift identification information, thereby achieving better adaptability in TALF filtering and further improving the filtering effect of time-domain adaptive loop filtering.
[0491] 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, a variable-order exponential Golomb is introduced to encode and decode the filter coefficients through the transmission of order identifier information. Simultaneously, a variable shift value is introduced during the filtering process through the transmission of shift identifier information, thereby achieving better adaptability in TALF filtering and further improving the filtering effect of the temporal adaptive loop filtering.
[0492] 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.
[0493] 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.
[0494] 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.
[0495] 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.
[0496] 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.
[0497] For example, in some embodiments, the parsing process of the first syntax element identification information talf_ctb_idc[CtbAddrX][CtbAddrY] is as follows:
[0498] 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.
[0499] 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.
[0500] 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.
[0501] 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.
[0502] 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:
[0503] 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:
[0504] 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.
[0505] 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).
[0506] 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.
[0507] 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.
[0508] 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.
[0509] 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.
[0510] 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.
[0511] 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.
[0512] After ALF filtering, the CTUs selected by ALF in the current image are filtered using the corresponding filter.
[0513] 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:
[0514] 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.
[0515] 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:
[0516] 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.
[0517] 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.
[0518] 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.
[0519] 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).
[0520] 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.
[0521] 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.
[0522] 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:
[0523] 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.
[0524] 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:
[0525] 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.
[0526] Exemplarily, in some embodiments, the input to the filtering process includes:
[0527] 1. A reconstructed luminance image array rec after luminance adaptive loop filtering.
[0528] 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.
[0529] 3. Indicates the luminance coordinates (xCtb, yCtb) of the current luminance coding tree block in the current image.
[0530] 4. The width tAlfWidth and height tAlfHeight of the luminance coding tree block.
[0531] 5. The coefficients tAlfCoeff of the time-domain adaptive loop filter [][].
[0532] Accordingly, the filtering calculation for each position in the luminance-coded block is as follows:
[0533] When numCoeff is 14:
[0534] 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.
[0535] When numCoeff is 13 and talf_filter_mode is 0:
[0536] When numCoeff is 13 and talf_filter_mode is 1:
[0537] 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.
[0538] 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.
[0539] Furthermore, in the embodiments of this application, for the TALF filtering process, as in the above formula (2) or formula (5), the filter coefficient c should ideally be a floating-point number. However, considering the issues of coefficient representation and hardware implementation, the actual filter coefficients often use integer precision coefficients, and the actual filtering process should also include bias and shift operations.
[0540] When the range of integer coefficients is large, more codewords are needed to represent the coefficients, and the reconstructed image after filtering is closer to the original image with less distortion. Conversely, when the range of integer coefficients is small, fewer codewords are needed to represent the coefficients, but the reconstructed image after filtering differs significantly from the original image, resulting in greater distortion. Achieving better compression efficiency is essentially finding the optimal balance between codewords and distortion. Therefore, the temporal loop filter needs to achieve the optimal accuracy in terms of rate-distortion. This accuracy affects the number of codewords consumed during encoding and decoding, as well as the quality of the reconstructed image.
[0541] For example, in some embodiments, the filter value at position (x,y) for bidirectional filtering under RA or using two reconstructed frames as input under LD is calculated as follows:
[0542] The `shift` value is fixed at 6. However, a variable `shift` value can be used in practice. A large `shift` value results in a wider range of filter coefficients, better filtering, and more codewords; a small `shift` value results in a narrower range of coefficients, poorer filtering, and fewer codewords. Transmitting a variable `shift` value through the bitstream allows for better adaptability of the filter coefficients. The transmitted `shift` value can be one for each temporal filter, one for each frame, or one for each sequence.
[0543] On the other hand, in common techniques, the absolute value of each filter coefficient is represented using 0th-order exponential Golomb code when encoding and decoding. Because a variable shift value is introduced, the range of coefficient values is wider when the shift is larger. Using 0th-order Golomb code cannot minimize the number of codewords used when encoding and decoding coefficients. Therefore, a variable-order Golomb code can also be introduced when encoding and decoding each coefficient. For example, each filter can choose an optimal order from 0, 1, ... N, and the order is transmitted to each filter through the bitstream, so that the coefficient encoding of each filter can use the optimal exponential Golomb order. Besides transmitting an order per filter, some embodiments can also transmit the order on a per-image, per-sequence basis, meaning that the time-domain filter coefficients encoded and decoded in an image use the same order of exponential Golomb code, or the same sequence uses the same order of exponential Golomb code.
[0544] For example, in some embodiments, after parsing the slice header syntax elements, the order identifier information `talf_k_order[sfIdx]` and the shift identifier information `talf_shift_minus5` can be determined. Here, `talf_shift_minus5` represents the variable precision used by one or more time-domain loop filters in the current slice encoding / decoding. It means that the shift value used in filtering is reduced by 5. This syntax element is represented by a fixed-length code of length 2 bins in this scheme, taking values of 0, 1, 2, or 3. When this syntax element does not exist in the bitstream, its value is 0. `talf_k_order[sfIdx]` represents the exponential Golomb order used when calculating the absolute value of the encoding / decoding coefficients of the `sfIdx`-th filter in the current slice. Its value is 0 or 1; 0 indicates that a 0th-order exponential Golomb code is used; 1 indicates that a 1st-order exponential Golomb code is used. When this syntax element does not exist in the bitstream, its value is 0.
[0545] For example, in some embodiments, when reconstructing the filter coefficients, a shift value is used where further reconstruction is required, wherein the process of obtaining the shift value of the adaptive loop filter for the current slice is shift = talf_shift_minus5 + 5.
[0546] For example, in some embodiments, TALF filtering is required when the talf_ctb_idc flag of the current luminance coding tree block is non-zero. The inputs to the filtering process include:
[0547] 1. A reconstructed luminance image array rec after luminance adaptive loop filtering.
[0548] 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 under RA configuration, or the first previously reconstructed image `rec0` is used under LD configuration; if it is 1, the most recent backward-reconstructed temporal image is used under RA configuration, or the first previously reconstructed image `rec1` is used under LD configuration; if it is 2, two reconstructed image arrays `rec0` and `rec1` are used.
[0549] 3. Indicates the luminance coordinates (xCtb, yCtb) of the current luminance coding tree block in the current image.
[0550] 4. The width tAlfWidth and height tAlfHeight of the luminance coding tree block.
[0551] 5. The coefficients tAlfCoeff of the time-domain adaptive loop filter [][],
[0552] The filtering calculation for each position in the luminance coding tree block is as follows:
[0553] When numCoeff is 14:
[0554] Where shift is the shift value calculated based on the extracted talf_shift_minus5, BitDepth is the bit depth of the luminance component, and x and y represent the horizontal and vertical coordinates of the reconstructed image array.
[0555] When numCoeff is 13 and talf_filter_mode is 0:
[0556] When numCoeff is 13 and talf_filter_mode is 1:
[0557] 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.
[0558] In some embodiments, ALF filtering performs edge padding on a block-by-block basis. Filtering within a block does not use the reconstructed values from other blocks. In this case, TALF can also perform edge padding on a block-by-block basis.
[0559] This application provides an encoding / decoding method, specifically a temporal adaptive loop filtering method. Based on reconstructed samples from at least one inter-frame reference image and corresponding filter coefficients, it performs TALF filtering on the reconstructed values of the current block. During TALF filtering, it fully utilizes relevant information from at least one inter-frame reference image, thereby improving the filtering effect and enhancing encoding / decoding performance. Furthermore, a variable-order exponential Golomb is introduced to encode and decode the filter coefficients through the transmission of order identifier information. Simultaneously, a variable shift value is introduced during filtering through the transmission of shift identifier information, resulting in better adaptability during TALF filtering and further improving the filtering effect of the temporal adaptive loop filtering.
[0560] 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.
[0561] The TALF filtering scheme and related TALF-based schemes proposed in the embodiments of this application will be described by way of example below.
[0562] 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.
[0563] For example, filter-related parameters can be encoded and decoded at the beginning of the chip, but this application does not impose specific limitations.
[0564] 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.
[0565] 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.
[0566] The syntax elements of the opening sequence are analyzed as follows:
[0567] The FIFO of the historical time-domain filter needs to be cleared when at least one of the following three conditions is true:
[0568] 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.
[0569] pcSlice->getPendingRasInit(): This condition indicates whether the POC has accumulated to the maximum allowed value and has been reset to 0.
[0570] pcSlice->isInterGDR(): This condition, as the name suggests, indicates whether it is a GDR.
[0571] The tAlfParamPool.clear() operation clears the FIFO of the history time-domain filter.
[0572] 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.
[0573] 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.
[0574] `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.
[0575] `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.
[0576] 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.
[0577] `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.
[0578] `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.
[0579] 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.
[0580] 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 constraint values of the time-domain adaptive loop filter.
[0581] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0582] The process of obtaining the nonlinear cutoff value tAlfClip of the current slice is as follows:
[0583] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0584] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0585] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0586] shift = talf_shift_minus5 + 5
[0587] 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.
[0588] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0589] The process of obtaining the nonlinear cutoff value tAlfClip of the current slice is as follows:
[0590] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0591] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0592] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0593] shift=tAlfParamPool[talf_filter_mode][talf_reuse_idx].shift
[0594] 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.
[0595] The inputs to the filtering process include:
[0596] 1. A reconstructed luminance image array rec after luminance adaptive loop filtering.
[0597] 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.
[0598] 3. Indicates the luminance coordinates (xCtb, yCtb) of the current luminance coding tree block in the current image.
[0599] 4. The width tAlfWidth and height tAlfHeight of the luminance coding tree block.
[0600] 5. The coefficients tAlfCoeff of the time-domain adaptive loop filter.
[0601] 6. The nonlinear cutoff value tAlfClip for time-domain adaptive loop filtering.
[0602] 7. Time-domain adaptive loop filter shift value shift.
[0603] The filtering calculation for each position in the luminance coding tree block is as follows:
[0604] When numCoeff is 14:
[0605] 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.
[0606] K(a,b)=min(b,max(-b,a))
[0607] When numCoeff is 13 and talf_filter_mode is 0:
[0608] When numCoeff is 13 and talf_filter_mode is 1:
[0609] 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.
[0610] 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.
[0611] Table 2
[0612] 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.
[0613] Table 3
[0614] 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.
[0615] The syntax elements of the opening sequence are analyzed as follows:
[0616] The FIFO of the historical time-domain filter needs to be cleared when at least one of the following three conditions is true:
[0617] 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.
[0618] pcSlice->getPendingRasInit(): This condition indicates whether the POC has accumulated to the maximum allowed value and has been reset to 0.
[0619] pcSlice->isInterGDR(): This condition, as the name suggests, indicates whether it is a GDR.
[0620] The tAlfParamPool.clear() operation clears the FIFO of the history time-domain filter.
[0621] 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.
[0622] 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.
[0623] `talf_mv_guided_flag` is a flag indicating whether motion vector-guided TALF is used. A flag of 1 means the current slice uses motion vector-guided TALF; a flag of 0 means the current slice does not use motion vector-guided TALF. When this flag is not present in the bitstream, its value is 0.
[0624] `talf_shift_minus6` indicates the variable precision used by one or more time-domain loop filters in the current slice encoding / decoding. It means subtracting 6 from the shift value used in the filtering. This syntax element is represented in this scheme using a fixed-length code of length 2 bins, with values of 0, 1, 2, or 3. Its value is 0 when this syntax element is not present in the bitstream.
[0625] `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.
[0626] The operation tAlfParamPool[talf_mv_guided_flag][0].shift = talf_shift_minus6 + 6 means restoring the parsed talf_shift_minus6 to the shift value and updating the first and second bits of the FIFO of the historical time-domain loop filter.
[0627] `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.
[0628] `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.
[0629] The operation tAlfParamPool[talf_mv_guided_flag][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.
[0630] 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.
[0631] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0632] The process of obtaining the nonlinear cutoff value tAlfClip of the current slice is as follows:
[0633] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0634] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0635] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0636] shift = talf_shift_minus6 + 6
[0637] If the current slice's sh_talf_enabled_flag is 1 and talf_reuse_flag is 1, then the coefficient values, shift values, and nonlinear limit values need to be obtained from the FIFO of the historical time-domain adaptive loop filter.
[0638] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0639] The process of obtaining the nonlinear cutoff value tAlfClip of the current slice is as follows:
[0640] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0641] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0642] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0643] shift=tAlfParamPool[talf_mv_guided_flag][talf_reuse_idx].shift
[0644] Furthermore, when performing TALF filtering on the luminance coding tree block, TALF filtering is required if the talf_ctb_idc flag of the current luminance coding tree block is non-zero.
[0645] The inputs to the filtering process include:
[0646] 1. A reconstructed luminance image array rec after luminance adaptive loop filtering.
[0647] 2. The mode value of talf_filter_mode,
[0648] 3. The flag value of talf_mv_guided_flag.
[0649] 4. Indicates the luminance coordinates (xCtb, yCtb) of the current luminance coding tree block in the current image.
[0650] 5. The width tAlfWidth and height tAlfHeight of the luminance coding tree block.
[0651] 6. The coefficients tAlfCoeff of the time-domain adaptive loop filter [][].
[0652] For each position (x, y) in the current luminance coding tree block, the value of x ranges from xCtb to xCtb+tAlfWidth-1, and the value of y ranges from yCtb to yCtb+tAlfHeight-1.
[0653] The first step is to obtain the reconstructed image and MV:
[0654] The input image of the filter is determined based on talf_mv_guided_flag and talf_filter_mode.
[0655] If talf_filter_mode is 0 and talf_mv_guided_flag is 0, then the forward nearest reconstructed image rec0 is used as input;
[0656] If talf_filter_mode is 0 and talf_mv_guided_flag is 1, then check whether the prediction block to which the current position belongs selects Mv0 pointing to the reference image in the reference image list 0. If it is selected, then use the reference image rec0 pointed to by Mv0 as input; otherwise, skip the filtering at the current position.
[0657] If talf_filter_mode is 1 and talf_mv_guided_flag is 0, then the backward nearest reconstructed image rec1 is used in RA mode, and the forward second nearest reconstructed image rec1 is used as input in LD mode.
[0658] If talf_filter_mode is 1 and talf_mv_guided_flag is 1, then check whether the prediction block to which the current position belongs has selected Mv1 pointing to the reference image in the reference image list 1. If it is selected, then use the reference image rec1 pointed to by Mv1 as input; otherwise, skip the filtering at the current position.
[0659] If talf_filter_mode is 2 and talf_mv_guided_flag is 0, then in RA, the forward nearest reconstructed image rec0 and the backward nearest reconstructed image rec1 are used as input, and in LD, the forward nearest reconstructed image rec0 and the second nearest reconstructed image rec1 are used as input. If talf_filter_mode is 2 and talf_mv_guided_flag is 1, then it is checked whether the prediction block to which the current position belongs has simultaneously selected Mv0 pointing to the reference image in reference image list 0 and Mv1 pointing to the reference image in reference image list 1. If selected, then the reference image rec0 pointed to by Mv0 and the reference image rec1 pointed to by Mv1 are used as input; otherwise, the filtering at the current position is skipped.
[0660] The second step is to obtain the shift value:
[0661] If Mv0 and Mv1 are found in the first step, then since Mv is used in inter-frame prediction with subpixel precision, the position offset on the reconstructed image pointed to by Mv is obtained here by rounding to positive pixel precision.
[0662] The horizontal integer pixel offset of Mv0 is:
[0663] Offset0X=Mv0.Hor<0? -((abs(Mv0.Hor)+8)>>4): ((abs(Mv0.Hor)+8)>>4)
[0664] The vertical integer pixel position offset of Mv0 is:
[0665] Offset0Y=Mv0.Ver<0? -((abs(Mv0.Ver)+8)>>4): ((abs(Mv0.Ver)+8)>>4)
[0666] The horizontal integer pixel offset of Mv1 is:
[0667] Offset1X=Mv1.Hor<0? -((abs(Mv1.Hor)+8)>>4): ((abs(Mv1.Hor)+8)>>4)
[0668] The vertical integer pixel position offset of Mv1 is:
[0669] Offset1Y=Mv1.Ver<0? -((abs(Mv1.Ver)+8)>>4): ((abs(Mv1.Ver)+8)>>4)
[0670] If talf_mv_guided_flag is 0 in the first step, then Offset0X, Offset0Y, Offset1X, and Offset1Y are set to 0.
[0671] The third step is to reconstruct the image based on the obtained positional offset, and then filter the (x, y) position using filtering coefficients. When numCoeff is 14:
[0672] In the above calculation and filtering process, shift is 6, BitDepth is the bit depth of the luminance component, and x and y represent the horizontal and vertical coordinates of the reconstructed image array. x0, y0, x1, and y1 are the coordinates of the center positions of rec0 and rec1 after the offset, respectively. When using the reconstructed values in the coordinate positions rec0 and rec1 arrays, the horizontal coordinate should be limited to between 0 and the image width picWidth-1, and the vertical coordinate should be limited to between 0 and the image height picHeight-1. Where K(a, b) = m□n(b, max(-b, a)).
[0673] When numCoeff is 13 and talf_filter_mode is 0:
[0674] When numCoeff is 13 and talf_filter_mode is 1:
[0675] During the filtering process, this scheme uses the same image edge padding method as ALF to obtain the TALF input values outside the required image range.
[0676] 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.
[0677] 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 TALF can perform loop filtering in parallel with ALF.
[0678] Here, other filter shapes can be used for TALF filtering. Figure 26 is a schematic diagram of the filter proposed in this embodiment. As shown in Figure 26, for unidirectional filtering, the 7x7 filter can be changed from 13 taps to 12 taps. Figure 27 is a schematic diagram of the filter proposed in this embodiment. As shown in Figure 27, for bidirectional filtering, the two 5x5 filters each change from 7 taps to 6 taps, for a total of 12 taps.
[0679] Accordingly, the filtering formula for a 7x7 filter is as follows:
[0680] Accordingly, the filtering formulas for the two 5x5 filters are as follows:
[0681] It should be noted that in the above formula, for the reconstructed pixels in the reference image, the reconstructed value at the current image filtering position is no longer subtracted. Instead, the reconstructed value at the corresponding center position of the reference image is subtracted. This reduces the number of filter taps, while keeping the number of taps the same for unidirectional and bidirectional filters. Furthermore, since the filter input no longer depends on the ALF output, the correction values of TALF and ALF can be calculated in parallel.
[0682] It should be noted that you can choose to always use the MV guided displacement for filtering, instead of letting talf_mv_guided_flag indicate whether to perform displacement. Therefore, in the filtering formula, the input position on each reference image should be the position after the MV offset.
[0683] Accordingly, the filtering formula for a 7x7 filter is as follows:
[0684] Accordingly, the filtering formulas for the two 5x5 filters are as follows:
[0685] Where x' and y' are x and y after Mv offset, respectively. In bidirectional filtering, x” and y” are x and y after the second Mv offset, respectively.
[0686] The syntax elements of the opening sequence are analyzed as follows:
[0687] The value of talf_filter_mode can be 0, 1, or 2. talf_filter_mode of 0 indicates that the current slice will use mode 0, which is a one-way filter pointing to the mv indicator offset in reference image list 0; talf_filter_mode of 1 indicates that the current slice will use mode 1, which is a one-way filter pointing to the mv indicator offset in reference image list 1; and talf_filter_mode of 2 indicates that the current slice will use mode 2, which is a two-way filter pointing to both the mv indicator offsets in reference image list 0 and reference image list 1.
[0688] The FIFO of the historical time-domain filter needs to be cleared when at least one of the following three conditions is true:
[0689] 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.
[0690] pcSlice->getPendingRasInit(): This condition indicates whether the POC has accumulated to the maximum allowed value and has been reset to 0.
[0691] pcSlice->isInterGDR(): This condition, as the name suggests, indicates whether it is a GDR.
[0692] The tAlfParamPool.clear() operation clears the FIFO of the history time-domain filter.
[0693] 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.
[0694] 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.
[0695] poolIdx is an index variable representing the multiplexed FIFO, which is related to whether the current talf_filter_mode is bidirectional filtering. When talf_filter_mode represents bidirectional filtering, poolIdx is 1, otherwise it is 0.
[0696] `talf_shift_minus6` indicates the variable precision used by one or more time-domain loop filters in the current slice encoding / decoding. It means subtracting 6 from the shift value used in the filtering. This syntax element is represented in this scheme using a fixed-length code of length 2 bins, with values of 0, 1, 2, or 3. Its value is 0 when this syntax element is not present in the bitstream.
[0697] `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.
[0698] The operation tAlfParamPool[poolIdx][0].shift = talf_shift_minus6 + 6 means restoring the parsed talf_shift_minus6 to the shift value and updating the first and second bits of the FIFO of the historical time-domain loop filter.
[0699] `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.
[0700] `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.
[0701] The operation tAlfParamPool[poolIdx][0].clipIdx[sfIdx][j]=talf_clip_idx[sfIdx][j] means that the parsed talf_clip_idx value is assigned to the FIFO of the corresponding historical time-domain loop filter.
[0702] 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.
[0703] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0704] The process of obtaining the nonlinear cutoff value tAlfClip of the current slice is as follows:
[0705] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0706] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0707] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0708] shift = talf_shift_minus6 + 6
[0709] 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.
[0710] The process of obtaining the filter coefficients tAlfCoeff of the current slice is as follows:
[0711] The process of obtaining the nonlinear cutoff value tAlfClip of the current slice is as follows:
[0712] - Construct a non-linear truncation value table based on the pixel depth inputBitdepth of the luminance component.
[0713] - Obtain the nonlinear cutoff value for each coefficient of each filter in the current slice:
[0714] The process of obtaining the shift value of the adaptive loop filter for the current slice is as follows:
[0715] shift=tAlfParamPool[poolIdx][talf_reuse_idx].shift.
[0716] Furthermore, when performing TALF filtering on the luminance coding tree block, TALF filtering is required if the talf_ctb_idc flag of the current luminance coding tree block is non-zero.
[0717] The inputs to the filtering process include:
[0718] 1. A reconstructed luminance image array rec after luminance adaptive loop filtering.
[0719] 2. The mode value of talf_filter_mode,
[0720] 3. Indicates the luminance coordinates (xCtb, yCtb) of the current luminance coding tree block in the current image.
[0721] 4. The width tAlfWidth and height tAlfHeight of the luminance coding tree block.
[0722] 5. The coefficients tAlfCoeff of the time-domain adaptive loop filter [][].
[0723] For each position (x, y) in the current luminance coding tree block, the value of x ranges from xCtb to xCtb+tAlfWidth-1, and the value of y ranges from yCtb to yCtb+tAlfHeight-1.
[0724] The first step is to obtain the reconstructed image and MV:
[0725] The input image of the filter is determined based on talf_filter_mode.
[0726] If talf_filter_mode is 0, then check whether the prediction block to which the current position belongs selects Mv0, which points to the reference image in the reference image list 0. If it is selected, then use the reference image rec0 pointed to by Mv0 as input; otherwise, skip the filtering at the current position.
[0727] If talf_filter_mode is 1, then check whether the prediction block to which the current position belongs has selected Mv1 pointing to the reference image in the reference image list 1. If it is selected, then use the reference image rec1 pointed to by Mv1 as input; otherwise, skip the filtering at the current position.
[0728] If talf_filter_mode is 2, it checks whether the prediction block to which the current position belongs has selected both Mv0 pointing to the reference image in reference image list 0 and Mv1 pointing to the reference image in reference image list 1. If selected, the reference image rec0 pointed to by Mv0 and the reference image rec1 pointed to by Mv1 are used as input; otherwise, the filtering at the current position is skipped.
[0729] The second step is to obtain the shift value:
[0730] If Mv0 and Mv1 are found in the first step, then since Mv is used in inter-frame prediction with subpixel precision, the position offset on the reconstructed image pointed to by Mv is obtained here by rounding to positive pixel precision.
[0731] The horizontal integer pixel offset of Mv0 is:
[0732] Offset0X=Mv0.Hor<0? -((abs(Mv0.Hor)+8)>>4):((abs(Mv0.Hor)+8)>>4)
[0733] The vertical integer pixel position offset of Mv0 is:
[0734] Offset0Y=Mv0.Ver<0? -((abs(Mv0.Ver)+8)>>4):((abs(Mv0.Ver)+8)>>4)
[0735] The horizontal integer pixel offset of Mv1 is:
[0736] Offset1X=Mv1.Hor<0? -((abs(Mv1.Hor)+8)>>4):((abs(Mv1.Hor)+8)>>4)
[0737] The vertical integer pixel position offset of Mv1 is:
[0738] Offset1Y=Mv1.Ver<0? -((abs(Mv1.Ver)+8)>>4):((abs(Mv1.Ver)+8)>>4)
[0739] The third step is to reconstruct the image based on the obtained position offset, and filter the (x,y) position using filter coefficients. This is done when talf_filter_mode is 2 and no filtering is skipped at the current position.
[0740] In the above calculation and filtering process, shift is 6, BitDepth is the bit depth of the luminance component, and x and y represent the horizontal and vertical coordinates of the reconstructed image array. x0, y0, x1, y1 are the coordinates of the center positions of rec0 and rec1 after offset, respectively. When using the reconstructed values in the coordinate array rec0 and rec1, the horizontal coordinate should be limited to between 0 and the image width picWidth-1, and the vertical coordinate should be limited to between 0 and the image height picHeight-1. Where K(a, b) = min(b, max(-b, a)).
[0741] When talf_filter_mode is 0 and no filtering is skipped at the current position:
[0742] When talf_filter_mode is 1 and no filtering is skipped at the current position:
[0743] During the filtering process, this scheme uses the same image edge padding method as ALF to obtain the TALF input values outside the required image range.
[0744] 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.
[0745] In another embodiment, during TALF filtering, 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 TALF can perform loop filtering in parallel with ALF. In bidirectional multiplexing, a mode that swaps the two inputs of the filter is introduced.
[0746] The syntax elements of the opening sequence are analyzed as follows:
[0747] The value of talf_filter_mode can be 0, 1, or 2. talf_filter_mode of 0 indicates that the current slice will use mode 0, which is a one-way filter pointing to the mv indicator offset in reference image list 0; talf_filter_mode of 1 indicates that the current slice will use mode 1, which is a one-way filter pointing to the mv indicator offset in reference image list 1; and talf_filter_mode of 2 indicates that the current slice will use mode 2, which is a two-way filter pointing to both the mv indicator offsets in reference image list 0 and reference image list 1.
[0748] The FIFO of the historical time-domain filter needs to be cleared when at least one of the following three conditions is true.
[0749] 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.
[0750] pcSlice->getPendingRasInit(): This condition indicates whether the POC has accumulated to the maximum allowed value and has been reset to 0.
[0751] pcSlice->isInterGDR(): This condition, as the name suggests, indicates whether it is a GDR.
[0752] The tAlfParamPool.clear() operation clears the FIFO of the history time-domain filter.
[0753] 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.
[0754] 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.
[0755] 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.
[0756] poolIdx is an index variable representing the multiplexed FIFO, which is related to whether the current talf_filter_mode is bidirectional filtering. When talf_filter_mode represents bidirectional filtering, poolIdx is 1, otherwise it is 0.
[0757] `talf_shift_minus6` indicates the variable precision used by one or more time-domain loop filters in the current slice encoding / decoding. It means subtracting 6 from the shift value used in the filtering. This syntax element is represented in this scheme using a fixed-length code of length 2 bins, with values of 0, 1, 2, or 3. Its value is 0 when this syntax element is not present in the bitstream.
[0758] `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.
[0759] The operation tAlfParamPool[poolIdx][0].shift = talf_shift_minus6 + 6 means restoring the parsed talf_shift_minus6 to the shift value and updating the first and second bits of the FIFO of the historical time-domain loop filter.
[0760] `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.
[0761] `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.
[0762] The operation tAlfParamPool[poolIdx][0].clipIdx[sfIdx][j]=talf_clip_idx[sfIdx][j] means that the parsed talf_clip_idx value is assigned to the FIFO of the corresponding historical time-domain loop filter.
[0763] Furthermore, when performing TALF filtering on the luminance coding tree block, TALF filtering is required if the talf_ctb_idc flag of the current luminance coding tree block is non-zero.
[0764] The inputs to the filtering process include:
[0765] 1. A reconstructed luminance image array rec after luminance adaptive loop filtering.
[0766] 2. The mode value of talf_filter_mode,
[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] For each position (x, y) in the current luminance coding tree block, the value of x ranges from xCtb to xCtb+tAlfWidth-1, and the value of y ranges from yCtb to yCtb+tAlfHeight-1.
[0771] The first step is to obtain the reconstructed image and MV:
[0772] The input image of the filter is determined based on talf_filter_mode.
[0773] If talf_filter_mode is 0, then check whether the prediction block to which the current position belongs selects Mv0, which points to the reference image in the reference image list 0. If it is selected, then use the reference image rec0 pointed to by Mv0 as input; otherwise, skip the filtering at the current position.
[0774] If talf_filter_mode is 1, then check whether the prediction block to which the current position belongs has selected Mv1 pointing to the reference image in the reference image list 1. If it is selected, then use the reference image rec1 pointed to by Mv1 as input; otherwise, skip the filtering at the current position.
[0775] If talf_filter_mode is 2, it checks whether the prediction block to which the current position belongs has selected both Mv0 pointing to the reference image in reference image list 0 and Mv1 pointing to the reference image in reference image list 1. If selected, the reference image rec0 pointed to by Mv0 and the reference image rec1 pointed to by Mv1 are used as input; otherwise, the filtering at the current position is skipped.
[0776] If talf_filter_mode is 3, it checks whether the prediction block at the current position simultaneously selects Mv0 pointing to the reference image in reference image list 0 and Mv1 pointing to the reference image in reference image list 1. If selected, the reference image pointed to by Mv0 is used as rec1 and the reference image pointed to by Mv1 is used as rec0 as input; otherwise, the filtering at the current position is skipped.
[0777] The second step is to obtain the shift value:
[0778] If Mv0 and Mv1 are found in the first step, then since Mv is used in inter-frame prediction with subpixel precision, the position offset on the reconstructed image pointed to by Mv is obtained here by rounding to positive pixel precision.
[0779] The horizontal integer pixel offset of Mv0 is:
[0780] Offset0X=Mv0.Hor<0? -((abs(Mv0.Hor)+8)>>4):((abs(Mv0.Hor)+8)>>4)
[0781] The vertical integer pixel position offset of Mv0 is:
[0782] Offset0Y=Mv0.Ver<0? -((abs(Mv0.Ver)+8)>>4):((abs(Mv0.Ver)+8)>>4)
[0783] The horizontal integer pixel offset of Mv1 is:
[0784] Offset1X=Mv1.Hor<0? -((abs(Mv1.Hor)+8)>>4):((abs(Mv1.Hor)+8)>>4)
[0785] The vertical integer pixel position offset of Mv1 is:
[0786] Offset1Y=Mv1.Ver<0? -((abs(Mv1.Ver)+8)>>4):((abs(Mv1.Ver)+8)>>4)
[0787] The third step is to reconstruct the image based on the obtained positional offset, and apply filtering coefficients to the (x,y) position. The `talf_filter_mode` is set to 2 or 3, and no filtering is skipped at the current position.
[0788] In the above calculation and filtering process, shift is 6, BitDepth is the bit depth of the luminance component, and x and y represent the horizontal and vertical coordinates of the reconstructed image array. x0, y0, x1, and y1 are the coordinates of the center positions of rec0 and rec1 after the offset, respectively. When using the reconstructed values in the coordinate array rec0 and rec1, the horizontal coordinate should be limited to between 0 and the image width picWidth-1, and the vertical coordinate should be limited to between 0 and the image height picHeight-1.
[0789] K(a,b)=min(b,max(-b,a))
[0790] When talf_filter_mode is 0 and no filtering is skipped at the current position:
[0791] When talf_filter_mode is 1 and no filtering is skipped at the current position:
[0792] During the filtering process, this scheme uses the same image edge padding method as ALF to obtain the TALF input values outside the required image range.
[0793] 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.
[0794] It is understandable that 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.
[0795] Understandably, in some implementations, non-linear truncation (non-linear constraint) currently supports four index values talf_clip_idx, while also reusing the truncation value table used by ALF, and can also use more index values and different truncation value tables.
[0796] Understandably, in some embodiments, the adaptive shift value shift allows for four values: 5, 6, 7, and 8, but other integer shift values can also be used. The K value talf_k_order for Exponential Columbus currently supports 0 and 1, and some embodiments may also use more M values.
[0797] Understandably, in some embodiments, the filter coefficient tAlfCoeff can be an integer. However, for boundary calculation purposes, tAlfCoeff can be restricted to a value that is easier to calculate. For example, tAlfCoeff can only be a power of 2. In this way, shift calculation can be used instead of multiplication when calculating the filter.
[0798] It is understood that in some embodiments, each image can support encoding, decoding and filtering of up to 4 sets of TALF filters. More maximum sets can be supported to obtain better performance, or fewer maximum sets can be supported to obtain the shortest encoding time.
[0799] It is understood that in some embodiments, this application is described using a temporal adaptive filtering method for luminance coding tree blocks as an example. Of course, there can also be a corresponding implementation scheme for chrominance. When implementing chrominance, a corresponding method can be added in comparison with the luminance approach.
[0800] This application provides an encoding / decoding method, which is a temporal adaptive loop filtering method. It can perform TALF filtering on the reconstructed value of the current block based on the reconstructed samples and corresponding filter coefficients of at least one inter-frame reference image. In the TALF filtering process, the relevant information of at least one inter-frame reference image is fully utilized, thereby improving the filtering effect and enhancing the encoding / decoding performance.
[0801] In another embodiment of this application, based on the same inventive concept as the foregoing embodiments, referring to FIG28, a schematic diagram of the composition structure of the encoder 210 proposed in this application embodiment is shown. As shown in FIG28, the encoder 210 may include: a first determining unit 2101; wherein,
[0802] The first determining unit 2101 is configured to: when filtering the current image using TALF, determine the cost value corresponding to a candidate order, determine order identification information based on the cost value corresponding to the candidate order, and write the order identification information into the bitstream; when filtering the current image using TALF, determine the cost value corresponding to a candidate shift parameter, determine shift identification information based on the cost value corresponding to the candidate shift parameter, and write the shift identification information into the bitstream; determine at least one inter-frame reference image corresponding to the current image, determine filter coefficients and shift parameters; and perform filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients, and the shift parameters to determine the filtered reconstructed value of the current block.
[0803] It should be noted that, in the embodiments of this application, encoder 210 can also be regarded as a data processing mode (or "entropy encoder"), used to encode the values of the syntax elements to be encoded.
[0804] Understandably, in the embodiments of this application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular component. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional module.
[0805] If the integrated unit is implemented as a software functional module and not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0806] Therefore, this application provides a computer-readable storage medium for encoder 210, wherein the computer-readable storage medium stores a computer program, which, when executed by a first processor, implements the encoding method described in any of the foregoing embodiments.
[0807] Based on the composition of encoder 210 and the computer-readable storage medium, see Figure 29, which shows a schematic diagram of the specific hardware structure of encoder 210 provided in this embodiment of the application. As shown in Figure 29, encoder 210 may include: a first communication interface 2102, a first memory 2103, and a first processor 2104; the various components are coupled together through a first bus system 2105. It is understood that the first bus system 2105 is used to realize the connection and communication between these components. In addition to a data bus, the first bus system 2105 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the first bus system 2105 in the figure.
[0808] The first communication interface 2102 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
[0809] The first memory 2103 is used to store computer programs that can run on the first processor 2104;
[0810] The first processor 2104 is configured to, when running the computer program, perform the following: when filtering the current image using TALF, determine the cost value corresponding to a candidate order, determine order identification information based on the cost value corresponding to the candidate order, and write the order identification information into the bitstream; when filtering the current image using TALF, determine the cost value corresponding to a candidate shift parameter, determine shift identification information based on the cost value corresponding to the candidate shift parameter, and write the shift identification information into the bitstream; determine at least one inter-frame reference image corresponding to the current image, determine filter coefficients and shift parameters; and perform filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients, and the shift parameters to determine the filtered reconstructed value of the current block.
[0811] It is understood that the first memory 2103 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The first memory 2103 of the system and method described in this application is intended to include, but is not limited to, these and any other suitable types of memory.
[0812] The first processor 2104 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the first processor 2104 or by instructions in software form. The first processor 2104 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the first memory 2103. The first processor 2104 reads the information in the first memory 2103 and completes the steps of the above method in conjunction with its hardware.
[0813] It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or combinations thereof. For software implementation, the technology described in this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions described in this application. Software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0814] Alternatively, as another embodiment, the first processor 2104 is further configured to execute any of the encoding methods described in the foregoing embodiments when running the computer program.
[0815] This embodiment provides an encoder that introduces a variable-order exponential Columbus through the transmission of order identification information to encode and decode filter coefficients. At the same time, a variable shift value is introduced during the filtering process through the transmission of shift identification information, thereby achieving better adaptability in TALF filtering and further improving the filtering effect of time-domain adaptive loop filtering.
[0816] In another embodiment of this application, based on the same inventive concept as the foregoing embodiments, referring to FIG30, a schematic diagram of the composition structure of the decoder 230 proposed in this application embodiment is shown. As shown in FIG30, the decoder 230 may include: a second determining unit 2301; wherein,
[0817] The second determining unit 2301 is configured to, when it is determined that the current image is filtered using TALF, decode the bitstream, determine order identifier information and shift identifier information; determine at least one inter-frame reference image corresponding to the current image, determine filter coefficients according to the order identifier information, determine shift parameters according to the shift identifier information; and perform filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients and the shift parameters to determine the filtered reconstructed value of the current block.
[0818] It should be noted that, in the embodiments of this application, the decoder 230 can also be regarded as a data processing mode (or "entropy decoder"), which is used to decode the values of the syntax elements to be decoded.
[0819] Understandably, in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular component. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional module.
[0820] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium applied to the decoder 230. The computer-readable storage medium stores a computer program, which, when executed by a second processor, implements the method described in any of the foregoing embodiments.
[0821] Based on the composition of the decoder 230 and the computer-readable storage medium, see Figure 31, which shows a schematic diagram of the specific hardware structure of the decoder 230 provided in this embodiment. As shown in Figure 31, the decoder 230 may include: a second communication interface 2302, a second memory 2303, and a second processor 2304; the various components are coupled together through a second bus system 2305. It is understood that the second bus system 2305 is used to realize the connection and communication between these components. In addition to a data bus, the second bus system 2305 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the second bus system 2305 in the figure.
[0822] The second communication interface 2302 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
[0823] The second memory 2303 is used to store computer programs that can run on the second processor 2304;
[0824] The second processor 2304 is configured to, when running the computer program, perform the following: when it is determined that the current image is filtered using TALF, decode the bitstream, determine order identifier information and shift identifier information; determine at least one inter-frame reference image corresponding to the current image, determine filter coefficients according to the order identifier information, and determine shift parameters according to the shift identifier information; perform filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients and the shift parameters, and determine the filtered reconstructed value of the current block.
[0825] Alternatively, as another embodiment, the second processor 2304 is also configured to perform any of the methods described in the foregoing embodiments when running the computer program.
[0826] It is understood that the second memory 2303 has similar hardware functions to the first memory 2103, and the second processor 2304 has similar hardware functions to the first processor 2104; details will not be elaborated here.
[0827] This embodiment provides a decoder that introduces a variable-order exponential Columbus to encode and decode filter coefficients through the transmission of order identification information. At the same time, a variable shift value is introduced during the filtering process through the transmission of shift identification information, thereby achieving better adaptability in TALF filtering and further improving the filtering effect of time-domain adaptive loop filtering.
[0828] In another embodiment of this application, referring to FIG32, a schematic diagram of the composition structure of the encoding and decoding system proposed in this application is shown. As shown in FIG32, the encoding and decoding system 300 may include an encoder 210 and a decoder 230.
[0829] In the embodiments of this application, the encoder 210 may be any of the encoders described in the foregoing embodiments, and the decoder 230 may be any of the decoders described in the foregoing embodiments.
[0830] Furthermore, embodiments of this application also propose a bitstream, wherein the bitstream is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one or more of the following: first syntax element identifier information, order identifier information, shift identifier information, coefficient numerical parameter, quantity parameter, and coefficient sign parameter.
[0831] Furthermore, this embodiment provides a computer-readable storage medium for storing a bitstream generated by any of the encoding methods in the foregoing embodiments.
[0832] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0833] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0834] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0835] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0836] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0837] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims. Industrial applicability
[0838] 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 is being filtered using TALF, the bitstream is decoded to determine order identifier information and shift identifier information; at least one inter-frame reference image corresponding to the current image is determined; filter coefficients are determined based on the order identifier information; and shift parameters are determined based on the shift identifier information. Filtering is performed based on reconstructed samples from at least one inter-frame reference image, filter coefficients, and shift parameters to determine the filtered reconstructed value of the current block. At the encoding end, when the current image is being filtered using TALF, the cost value corresponding to the candidate order is determined; order identifier information is determined based on the cost value corresponding to the candidate order; and the order identifier information is written into the bitstream. When the current image is being filtered using TALF, the cost value corresponding to the candidate shift parameter is determined; shift identifier information is determined based on the cost value corresponding to the candidate shift parameter; and the shift identifier information is written into the bitstream. At least one inter-frame reference image corresponding to the current image is determined; filter coefficients and shift parameters are determined. Filtering is performed based on reconstructed samples from at least one inter-frame reference image, filter coefficients, and shift parameters to determine the filtered reconstructed value of the current block. Therefore, the embodiments of this application propose a time-domain adaptive loop filtering method, which introduces a variable-order exponential Golomb to encode and decode filter coefficients by transmitting order identification information. At the same time, a variable shift value is introduced during the filtering process by transmitting shift identification information, thereby achieving better adaptability in TALF filtering and further improving the filtering effect of time-domain adaptive loop filtering.
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 to determine the order identifier information and the shift identifier information. Determine at least one inter-frame reference image corresponding to the current image, determine filter coefficients based on the order identifier information, and determine shift parameters based on the shift identifier information; The filtered reconstructed value of the current block is determined by filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients, and the shift parameters.
2. The method of claim 1, wherein, Determining the filter coefficients based on the order identifier information includes: The order of the exponential Columbus is determined based on the order identifier information. Based on the decoded bitstream of the exponential Golomb order, determine the numerical parameters of the filter coefficients; The filter coefficients are determined based on the numerical parameters of the coefficients.
3. The method of claim 2, wherein, The method further includes: Decode the bitstream to determine the first syntax element identifier information; If it is determined that the current block uses TALF for filtering based on the first syntax element identification information, the process of determining the filter coefficients corresponding to the current block is executed.
4. The method of claim 3, wherein, Determining the filter coefficients based on the numerical parameters of the coefficients includes: Determine the quantity parameters and the coefficient sign parameters corresponding to the filter coefficients; The number of filter groups is determined based on the quantity parameters; The filter coefficients are determined based on the number of filter groups, the numerical parameters of the coefficients, the symbol parameters of the coefficients, and the identifier information of the first syntax element.
5. The method of claim 4, wherein, Determining the filter coefficients based on the number of filter groups, the numerical parameters of the coefficients, the sign parameters of the coefficients, and the first syntax element identifier 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 are determined based on the candidate filter corresponding to the current block, the coefficient numerical parameters, and the coefficient sign parameters.
6. The method of claim 5, wherein, The step of determining the filter coefficients based on the candidate filter corresponding to the current block, the coefficient numerical parameters, and the coefficient sign parameters includes: The values of the filter coefficients corresponding to the candidate filter are determined based on the numerical parameters of the coefficients. The sign of the filter coefficients corresponding to the candidate filter is determined based on the coefficient sign parameter; The filter coefficients corresponding to the candidate filter are determined based on the values and signs of the filter coefficients corresponding to the candidate filter.
7. The method of any one of claims 1-6, wherein, Determining the shift parameters based on the shift identifier information includes: The variable precision is determined based on the shift identifier information; The shift parameters are determined based on the variable precision and the preset value.
8. The method of claim 7, wherein, The step of filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients, and the shift parameter to determine the filtered reconstructed value of the current block includes: For the current sample position in the current block, the reconstructed sample value of the current sample position is determined based on 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 based on the reconstructed sample of the inter-frame reference image. The filtered reconstructed sample value at the current sample position is determined based on the shift coefficient, the filter coefficient, the reconstructed sample value at the current sample position, and the reconstructed sample value at the reference sample position. The filtered reconstructed value of the current block is determined based on the filtered reconstructed sample value at the current sample position.
9. The method of claim 7, wherein, The step of filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients, and the shift parameter to determine the filtered reconstructed value of the current block includes: For the current sample position in the current block, the reconstructed sample value of the current sample position is determined based on 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 based on the reconstructed sample of the first inter-frame reference image, and the reconstructed sample value of the second reference sample position corresponding to the current sample position is determined based on the reconstructed sample of the second inter-frame reference image. Based on the shift coefficient, the filter coefficient, the reconstructed sample value at the current sample position, the reconstructed sample value at the first reference sample position, and the reconstructed sample value at the second reference sample position, the filtered reconstructed sample value at the current sample position is determined. This value; The filtered reconstructed value of the current block is determined based on the filtered reconstructed sample value at the current sample position.
10. An encoding method applied to an encoder, the method comprising: When filtering the current image using TALF, the calculus value corresponding to the candidate order is determined, the order identification information is determined based on the calculus value corresponding to the candidate order, and the order identification information is written into the bitstream. When filtering the current image using TALF, the cost value corresponding to the candidate shift parameter is determined, the shift identifier information is determined based on the cost value corresponding to the candidate shift parameter, and the shift identifier information is written into the bitstream; Determine at least one inter-frame reference image corresponding to the current image, and determine the filter coefficients and shift parameters; The filtered reconstructed value of the current block is determined by filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients, and the shift parameters.
11. The method of claim 10, wherein, The step of determining the order identifier information based on the cost value corresponding to the candidate order includes: Determine the minimum algebraic value among the algebraic values corresponding to the candidate orders; The candidate order corresponding to the minimum cost value is determined as the optimal exponential Columbus order. The order identification information is determined based on the optimal index Columbus order.
12. The method of claim 11, wherein, The method further includes: The coefficient values of the filter coefficients are encoded according to the exponential Golomb order.
13. The method of claim 10, wherein, The step of determining the shift identifier information based on the cost corresponding to the candidate shift parameters includes: Determine the minimum cost value among the cost values corresponding to the candidate shift parameters; The candidate shift parameter corresponding to the minimum cost value is determined as the optimal shift parameter; The variable precision is determined based on the optimal shift parameters and preset values; The shift identifier information is determined based on the variable precision.
14. The method of claim 10, 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.
15. The method of claim 14, 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 are determined based on the candidate filter corresponding to the current block; Determine the second-generation value of the filter coefficients; The minimum second-generation value is determined as the first-generation value corresponding to the current block when filtered using TALF.
16. The method of claim 15, 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.
17. A code stream, the code stream being generated by bit-encoding according to information to be encoded; wherein, The information to be encoded includes at least one or more of the following: first syntax element identifier information, order identifier information, shift identifier information, coefficient numerical parameter, quantity parameter, and coefficient sign parameter.
18. An encoder, the encoder comprising a first determining unit; wherein, The first determining unit is configured to determine the cost value corresponding to the candidate order when filtering the current image using TALF, determine order identification information based on the cost value corresponding to the candidate order, and write the order identification information into the bitstream. When filtering the current image using TALF, the cost value corresponding to the candidate shift parameter is determined, the shift identifier information is determined based on the cost value corresponding to the candidate shift parameter, and the shift identifier information is written into the bitstream; Determine at least one inter-frame reference image corresponding to the current image, and determine filter coefficients and shift parameters; perform filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients, and the shift parameters, and determine the filtered reconstructed value of the current block.
19. 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 10 to 16.
20. A decoder, the decoder comprising a second determining unit; wherein, The second determining unit is configured to, when it is determined that the current image is filtered using TALF, decode the bitstream, determine order identifier information and shift identifier information; determine at least one inter-frame reference image corresponding to the current image, determine filter coefficients according to the order identifier information, determine shift parameters according to the shift identifier information; and perform filtering based on the reconstructed samples of the at least one inter-frame reference image, the filter coefficients and the shift parameters to determine the filtered reconstructed value of the current block.
21. A decoder, comprising a second memory and a second processor; wherein, The second memory is used to store computer programs that can run on the second processor; The second processor is configured to perform the method as described in any one of claims 1 to 9 when running the computer program.
22. 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 9, or the encoding method as described in any one of claims 10 to 16.
23. A computer-readable storage medium for storing a bitstream generated by the encoding method of any one of claims 10 to 16.