Image encoding method, image decoding method, and related devices
Patent Information
- Application Number
- CN202310078510.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-17
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2043-01-17
AI Technical Summary
[0003]在以CTU(Coding Tree Unit,编码树单元/解码树单元)为单位对图像/视频帧图像进行编码或解码的过程中,由于CTU边界两侧的像素具有依赖关系,相关技术中提供的按照CTU边界对待处理图像中每个CTU执行ALF处理的方案,存在大量冗余计算
[0011] The technical solution provided in this disclosure determines the target filtering range for adaptive loop filtering of the target coding tree unit/decoding tree unit based on the virtual boundary of the coding tree unit/decoding tree unit in the image to be processed, and then performs adaptive loop filtering on the target pixels within the target filtering range. Since the pixels on both sides of the virtual boundary have no dependency relationship, the technical solution provided in this disclosure reduces the number of reference pixels and lowers redundant calculations by performing adaptive loop filtering on each coding tree unit/decoding tree unit according to the virtual boundary.
Smart Images

Figure CN116320502B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, and more specifically, to an image encoding method, an image decoding method, and related equipment. Background Technology
[0002] In the process of image / video encoding or decoding, ALF (Adaptive Loop Filter) is a commonly used filtering technique.
[0003] In the process of encoding or decoding image / video frame images in units of CTU (Coding Tree Unit), due to the dependency relationship between pixels on both sides of the CTU boundary, the scheme provided in related technologies that performs ALF processing on each CTU in the image to be processed according to the CTU boundary has a lot of redundant calculations. Summary of the Invention
[0004] This disclosure provides an image encoding method, an image decoding method, and related equipment to at least solve the technical problem of excessive redundant calculations in related technologies where ALF processing is performed on each CTU in the image to be processed according to the CTU boundary.
[0005] This disclosure provides an image encoding method, which includes: determining virtual boundaries of coding tree units in an image to be processed, wherein the coding tree units include target coding tree units to be subjected to adaptive loop filtering; determining a target filtering range for performing adaptive loop filtering on the target coding tree units based on the virtual boundaries of the coding tree units; and performing adaptive loop filtering on target pixels within the target filtering range.
[0006] This disclosure provides an image decoding method, which includes: determining the virtual boundary of a decoding tree unit in an image to be processed, wherein the decoding tree unit includes a target decoding tree unit to be subjected to adaptive loop filtering; determining a target filtering range for performing adaptive loop filtering on the target decoding tree unit based on the virtual boundary of the decoding tree unit; and performing adaptive loop filtering on target pixels within the target filtering range.
[0007] This disclosure provides an encoding apparatus, comprising: an encoding virtual boundary determination module configured to determine virtual boundaries of encoding tree units in an image to be processed, wherein the encoding tree units include target encoding tree units to be subjected to adaptive loop filtering; an encoding filtering range determination module configured to determine a target filtering range for performing adaptive loop filtering on the target encoding tree units based on the virtual boundaries of the encoding tree units; and an encoding filtering processing module configured to perform adaptive loop filtering on target pixels within the target filtering range.
[0008] This disclosure provides a decoding apparatus, comprising: a decoding virtual boundary determination module configured to determine virtual boundaries of decoding tree units in an image to be processed, wherein the decoding tree units include target decoding tree units to be subjected to adaptive loop filtering; a decoding filtering range determination module configured to determine a target filtering range for performing adaptive loop filtering on the target decoding tree units based on the virtual boundaries of the decoding tree units; and a decoding filtering processing module configured to perform adaptive loop filtering on target pixels within the target filtering range.
[0009] This disclosure provides a computer-readable storage medium in which, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is able to perform an image encoding method or an image decoding method as described in any of the preceding claims.
[0010] This disclosure provides a computer program that, when executed by a processor, implements the image encoding method or the image decoding method described in any of the preceding claims.
[0011] The technical solution provided in this disclosure determines the target filtering range for adaptive loop filtering of the target coding tree unit / decoding tree unit based on the virtual boundary of the coding tree unit / decoding tree unit in the image to be processed, and then performs adaptive loop filtering on the target pixels within the target filtering range. Since the pixels on both sides of the virtual boundary have no dependency relationship, the technical solution provided in this disclosure reduces the number of reference pixels and lowers redundant calculations by performing adaptive loop filtering on each coding tree unit / decoding tree unit according to the virtual boundary. Attached Figure Description
[0012] Figure 1 This is a schematic diagram of an image processing system architecture according to an exemplary embodiment;
[0013] Figure 2 This is a schematic diagram of the shape of an ALF filter according to an exemplary embodiment;
[0014] Figure 3 This is a schematic diagram of another ALF filter shape according to an exemplary embodiment;
[0015] Figure 4 This is a schematic diagram illustrating the filtering process for virtual boundaries according to an exemplary embodiment;
[0016] Figure 5 This is a schematic diagram illustrating filtering at a virtual boundary using a 7×7 diamond filter according to an exemplary embodiment;
[0017] Figure 6 This is a schematic diagram illustrating a scheme for performing ALF processing on a CTU according to a CTU virtual boundary, based on an exemplary embodiment.
[0018] Figure 7 This is a flowchart illustrating an image encoding method according to an exemplary embodiment;
[0019] Figure 8 This is a schematic diagram illustrating several cases of determining the ALF range based on the virtual boundaries of the coding tree unit, according to an exemplary embodiment.
[0020] Figure 9 This is a flowchart illustrating an image decoding method according to an exemplary embodiment;
[0021] Figure 10 This is a schematic diagram of an encoding device according to an exemplary embodiment;
[0022] Figure 11 This is a schematic diagram of a decoding device according to an exemplary embodiment;
[0023] Figure 12 This is a schematic diagram of an electronic device according to an exemplary embodiment. Detailed Implementation
[0024] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0025] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0026] To facilitate understanding, before introducing the embodiments of this disclosure, the following explanations are provided for several terms involved in the embodiments of this disclosure:
[0027] CTU: Coding Tree Unit. Image encoding / decoding involves dividing an image into multiple blocks. The unit (block) on the encoding side is called the coding tree unit, and the processing unit on the decoding side is called the decoding tree unit.
[0028] DBF: DeBlocking Filter, used to remove block boundary effects caused by block encoding.
[0029] SAO: Sample Adaptive Offset. It classifies images based on the pixel values of the samples and the gradient values of the surrounding blocks, and adds different compensation values to the pixel values of each class, making the reconstructed image closer to the original image.
[0030] ALF: Adaptive Loop Filter, which uses a Wiener filter to enhance the reconstructed image, making the reconstructed image closer to the original image.
[0031] Figure 1 A schematic diagram of an exemplary image processing system architecture is shown, illustrating an application of the image encoding and image decoding methods described in the embodiments of this disclosure. Figure 1 As shown, the image processing system includes an encoding device 10 and a decoding device 20, wherein the encoding device 10 can be used for encoding images / videos; and the decoding device 20 can be used for decoding images / videos.
[0032] In some embodiments, the encoding device 10 and the decoding device 20 may be deployed on a single device; in other embodiments, the encoding device 10 and the decoding device 20 may be deployed on different devices.
[0033] like Figure 1As shown, the image / video encoding process generally includes operations such as prediction, transformation, quantization, entropy coding, and filtering. Among them, prediction can be divided into intra-frame prediction and inter-frame prediction. Intra-frame prediction uses surrounding coded blocks as a reference to predict the current uncoded block, effectively removing spatial redundancy. Inter-frame prediction uses neighboring coded images to predict the current image, effectively removing temporal redundancy.
[0034] Transformation refers to converting an image from the spatial domain to the transform domain, and then representing the image using transform coefficients. Most images contain many flat regions and slowly changing regions. Appropriate transformations can change the image from a scattered distribution in the spatial domain to a relatively concentrated distribution in the transform domain, removing frequency domain correlations between signals. Combined with quantization, this can effectively compress the bitstream.
[0035] Entropy coding is a lossless coding method that transforms a series of symbolic elements into a binary code stream for transmission or storage. The input symbols may include quantized transform coefficients, motion vector information, prediction mode information, transform quantization related syntax, etc. Entropy coding can effectively remove redundancy from video symbolic elements.
[0036] It should be noted that the decoding process of an image / video is relative to the encoding process. That is, the decoding process of an image / video generally includes operations such as entropy decoding, prediction, inverse quantization, inverse transform, and filtering. The implementation principle of each operation in the decoding process is the same as or similar to that in the encoding process.
[0037] In the process of encoding or decoding images / videos based on coding tree units, it is often necessary to perform filtering operations on the reconstructed image to make it closer to the original image. Filtering operations performed on the reconstructed image can include DBF, SAO, and ALF. DBF is used to remove block boundary effects caused by block coding; SAO is used to classify based on the pixel values of the sample and the gradient values of surrounding blocks, adding different compensation values to the pixel values of each category to make the reconstructed image closer to the original image; ALF is used to enhance the reconstructed image using a Wiener filter, further making the reconstructed image closer to the original image.
[0038] The image encoding method provided in this disclosure can be applied to, but is not limited to, adaptive loop filtering processing of the reconstructed image during the image / video encoding process; the image decoding method provided in this disclosure can be applied to, but is not limited to, adaptive loop filtering processing of the reconstructed image during the image / video decoding process.
[0039] Adaptive Loop Filtering (ALF) filters the reconstructed image based on the filter shape and filter coefficients, using samples as a basis. The encoder can determine whether to apply ALF by comparing the reconstructed image and the original image, as well as information such as the shape and coefficients of the ALF filter used when applying ALF, and then notify the decoder of the relevant filtering information (whether ALF is applied, ALF filter shape information, and ALF filter coefficient information).
[0040] Figure 2 and Figure 3 Two commonly used ALF filter shapes are shown, such as Figure 2 The image shows a 5×5 diamond filter. Figure 3 The image shows a 7×7 diamond filter. Figure 2 and Figure 3 C in the filter shape shown n Represents the filter coefficients, when C n When the value of 'n' is the same, it means that the same filter coefficients can be configured. Using the same filter coefficients in two positions of the filter can reduce the cost of transmitting filter coefficients.
[0041] As described in the background section of this disclosure, for images that undergo adaptive loop filtering processing at the CTU level, the adaptive loop filtering processing schemes provided in related technologies are based on the CTU boundaries. Since the pixels on both sides of the CTU boundary often have a dependency relationship, when performing adaptive loop filtering processing on each CTU, it is necessary not only to refer to the pixels within each CTU, but also to refer to the pixels that extend from the CTU boundary to the surrounding adjacent CTUs (i.e., the extended pixels), resulting in a large amount of redundant calculation.
[0042] The inventors discovered that when performing adaptive loop filtering in parallel at the CTU row level (i.e., performing adaptive loop filtering in parallel for CTUs in different rows), there is a dependency between the uplink and downlink CTUs. The last few rows of pixels in the current row CTU need to wait for the next row CTU to decode and reconstruct before they can be processed, thus requiring the buffering of pixels in the corresponding row. To reduce the row buffer requirements, the adaptive loop filtering tool defines virtual boundaries. When the filter uses pixels that cross the virtual boundary, the virtual boundary needs to be symmetrically padded so that the pixels on both sides of the virtual boundary are independent. When performing adaptive loop filtering on a pixel on one side of the virtual boundary, it is not necessary to refer to the pixels on the other side of the virtual boundary.
[0043] In view of this, the image encoding method and image decoding method provided in the embodiments of this disclosure, when performing adaptive loop filtering on each CTU in the current row, reserve the pixels below the virtual boundary in each CTU in the current row for adaptive loop filtering on the next row CTU. That is, the encoding / decoding range for performing adaptive loop filtering on the current row CTU is determined according to the virtual boundary between the current row and the previous row CTU. Since adaptive loop filtering is performed on the pixels within the virtual boundary, there is no need to refer to the pixels outside the virtual boundary, which can greatly reduce the number of pixels referenced when performing adaptive loop filtering on each CTU, thereby reducing redundant calculations.
[0044] Figure 4 A schematic diagram of filtering processing for virtual boundaries is shown, such as... Figure 4 As shown, for the calculation of the one-dimensional Laplacian gradient of the 4×4 block above the virtual boundary, only the pixels above the virtual boundary can be used; for the calculation of the one-dimensional Laplacian gradient of the 4×4 block below the virtual boundary, only the pixels below the virtual boundary can be used.
[0045] Analysis shows that if adaptive loop filtering is performed on each CTU according to the virtual boundary, since the pixels on both sides of the virtual boundary are not dependent, when performing adaptive loop filtering on a pixel on one side of the virtual boundary, there is no need to refer to the pixels on the other side of the virtual boundary. Therefore, when performing adaptive loop filtering on each CTU according to the virtual boundary, there is no need to expand the pixels outside the virtual boundary, which can greatly reduce the number of pixels referenced when performing adaptive loop filtering, thereby reducing redundant calculations.
[0046] by Figure 3 Taking the 7×7 diamond filter as an example, before filtering the virtual boundary, pixels in rows where the filter size exceeds the virtual boundary need to be copied using the nearest row. Similarly, pixels on the other side of the filter also need to be copied using the nearest row. Figure 5 (a) shows that the reference pixels of row 1 are copied to row 2, and the pixels of row 7 are copied to row 6; Figure 5 (b) shows that the reference pixels of rows 1 and 2 are copied to row 3, and the pixels of rows 6 and 7 are copied to row 5; Figure 5 (c) shows that the reference pixels of rows 1, 2, and 3 are copied to row 4, and the pixels of rows 5, 6, and 7 are copied to row 4, with each row processed differently. Filtering calculations are performed after the virtual boundaries are processed.
[0047] Given an image to be processed containing 4×6 CTUs, Figure 6 The diagram illustrates a scheme for performing adaptive loop filtering on a target CTU according to a virtual boundary in an embodiment of this disclosure. It is assumed that the target CTU currently undergoing adaptive loop filtering is... Figure 6 When performing adaptive loop filtering on the CTU in the second row and third column according to the horizontal virtual boundary, it only needs to refer to the pixels within this CTU, as well as some pixels within the upper left, upper right, upper left, and upper right CTUs. It does not need to refer to the pixels within the lower left, lower right, and lower right CTUs. Icon 300 shows the target filtering range for performing adaptive loop filtering on the target CTU according to the horizontal virtual boundary.
[0048] It should be noted that, in this embodiment of the disclosure, the target CTU refers to the CTU in the image to be processed that is currently undergoing adaptive loop filtering; the upper left CTU refers to the CTU located to the upper left of the target CTU; the top CTU refers to the CTU located directly above the target CTU; the upper right CTU refers to the CTU located to the upper right of the target CTU; the left CTU refers to the CTU located to the left of the target CTU; the right CTU refers to the CTU located to the right of the target CTU; the lower left CTU refers to the CTU located to the lower left of the target CTU; the bottom CTU refers to the CTU located directly below the target CTU; and the lower right CTU refers to the CTU located to the lower right of the target CTU.
[0049] Analysis shows that the adaptive loop filtering scheme for CTUs based on virtual boundaries in this embodiment can not only reduce the number of reference pixels, but also reduce the number of dependent CTUs. Taking a CTU located in the middle of the image to be processed as an example, the adaptive loop filtering scheme based on CTU boundaries requires at least 9 CTUs, including the target CTU, to be referenced; while the adaptive loop filtering scheme based on CTU virtual boundaries only requires 6 CTUs, including the target CTU, to be referenced.
[0050] When performing adaptive loop filtering on each CTU in the image to be processed, the adaptive loop filtering can be performed in parallel on CTUs in different rows. However, due to the dependency between CTU rows, the CTUs in the later row will be executed two CTUs later than the CTUs in the previous row. Figure 5 As shown, in the related technology, the scheme of performing adaptive loop filtering processing based on CTU boundaries allows the CTU in the 2nd row and 3rd column, the CTU in the 1st row and 5th column, and the CTU in the 3rd row and 1st column to be processed in parallel. Figure 6As shown in the embodiments of this disclosure, the scheme for performing adaptive loop filtering with virtual boundaries allows CTUs in different virtual rows to be processed in parallel. Since the adaptive loop filtering (ALF) process is performed after the sample adaptive compensation (SAO) process, the related technologies that perform adaptive loop filtering with CTU boundaries require not only that the CTUs above, directly above, above, to the left, to the right, to the lower left, to the lower right, and to the upper left of the target CTU complete SAO processing, but also that the CTUs to the left, above, directly above, and to the upper right of the target CTU complete ALF processing. In contrast, the scheme in this disclosure that performs adaptive loop filtering with virtual boundaries only requires the CTUs to the left, right, lower left, to the lower right, and to the upper right of the target CTU to complete SAO processing, and only requires the CTUs to the left of the target CTU to complete ALF processing.
[0051] As can be seen from the above analysis, the scheme for performing adaptive loop filtering with virtual boundaries provided in this embodiment of the present disclosure shifts the pixels of the current row of CTUs up by 4 pixels when performing adaptive loop filtering on each CTU row, and processes them together with the last 4 rows of pixels of the previous row of CTUs (the four rows below the virtual boundary of the upper CTU). The last 4 rows of pixels of the current CTU are left for the next row of CTUs to process. The pixels referenced when performing adaptive loop filtering on the current row of CTUs are the pixels between the virtual boundary of the previous row of CTUs and the virtual boundary of the current row of CTUs, which is exactly the number of pixel rows of one CTU (the pixels from row VB of the upper CTU to row VB of the current CTU). This reduces the number of reference pixels and reduces redundant calculations. The number of referenced CTUs when performing adaptive loop filtering on the current CTU is reduced (taking the middle CTU as an example, the number of referenced CTUs is reduced from 9 to 6), which improves parallelism.
[0052] Figure 7 This is a flowchart illustrating an image encoding method according to an exemplary embodiment, such as... Figure 7 As shown, the image encoding method may include the following steps:
[0053] S702, determine the virtual boundary of the coding tree unit in the image to be processed, wherein the coding tree unit includes the target coding tree unit to be subjected to adaptive loop filtering processing.
[0054] It should be noted that the image to be processed in S702 above can be any image that requires enhancement filtering. In some embodiments, the image to be processed can be a frame from the video to be processed. In other embodiments, it can be a reconstructed image of the image to be encoded, obtained by performing transformation, quantization, and other operations on the image to be encoded according to the coding tree unit, followed by inverse transformation, inverse quantization, and other operations. The coding tree unit in this embodiment can be a processing unit that performs block encoding on the image to be processed. After dividing the image to be processed into multiple coding tree units, the image to be processed can be encoded on a unit basis. In this embodiment, the virtual boundary of the coding tree unit refers to the boundary obtained by extending the boundary of the coding tree unit outward by a preset number of pixel rows.
[0055] For ease of description, in this embodiment of the disclosure, the coding tree unit to be subjected to adaptive loop filtering on the coding side is referred to as the target coding tree unit. In principle, the target coding tree unit can be any coding tree unit in the image to be processed.
[0056] In some embodiments, the virtual boundary of the coding tree unit in this disclosure includes a first-direction virtual boundary and a second-direction virtual boundary. The first-direction virtual boundary is a virtual boundary parallel to the row direction of the coding tree unit, and the second-direction virtual boundary is a virtual boundary parallel to the column direction of the coding tree unit. It should be noted that when encoding images in blocks, the image to be processed is often segmented according to two directions to obtain multiple coding tree units. In principle, the first and second directions can be any two predefined intersecting directions, as long as they can segment the image to be processed into multiple coding tree units. For ease of description, this disclosure uses the first direction as the horizontal direction and the second direction as the vertical direction as an example to illustrate various embodiments.
[0057] S704 determines the target filtering range for performing adaptive loop filtering on the target coding tree unit based on the virtual boundary of the coding tree unit.
[0058] It should be noted that the virtual boundary of the coding tree unit in S704 above may include: a first-direction virtual boundary and a second-direction virtual boundary. In some embodiments, when performing adaptive loop filtering on the coding tree unit in the image to be processed according to the first direction, the target filtering range for performing adaptive loop filtering on the target coding tree unit can be determined based on the first-direction virtual boundary of the coding tree unit in the image to be processed. In other embodiments, when performing adaptive loop filtering on the coding tree unit in the image to be processed according to the second direction, the target filtering range for performing adaptive loop filtering on the target coding tree unit can be determined based on the second-direction virtual boundary of the coding tree unit in the image to be processed. Determining the target filtering range of adaptive loop filtering with the first-direction virtual boundary can reduce the number of pixels that need to be referenced when performing adaptive loop filtering in the first direction and improve the parallelism of encoding in the first direction; determining the target filtering range of adaptive loop filtering with the second-direction virtual boundary can reduce the number of pixels that need to be referenced when performing adaptive loop filtering in the second direction and improve the parallelism of encoding in the second direction.
[0059] In some embodiments, the first directional virtual boundary of the aforementioned coding tree unit is a virtual boundary obtained by moving the bottom boundary of the corresponding coding tree unit upward by a preset number of pixel rows; the second directional virtual boundary of the aforementioned coding tree unit is a virtual boundary obtained by moving the right boundary of the corresponding coding tree unit to the left by a preset number of pixel columns. In specific implementations, the corresponding virtual boundary is defined according to the number of pixel rows or columns with dependencies at the boundary of the coding tree unit.
[0060] It should be noted that when encoding and decoding video, images in the video are usually represented using the YUV model, not the RGB model. When the image to be processed is an image from a video, the coding tree unit in this embodiment includes a luma coding tree unit and a chroma coding tree unit. For the luma coding tree unit, a... Figure 3 The diagram shows a 7×7 diamond-shaped filter; for chroma coding tree units, a 7×7 diamond-shaped filter can be used. Figure 2 The diagram shows a 5×5 diamond filter.
[0061] In some embodiments, when the coding tree unit is a luma coding tree unit, the values of the preset pixel row and the preset pixel column can both be 4; when the coding tree unit is a chroma coding tree unit, the values of the preset pixel row and the preset pixel column can both be 2. In this embodiment of the present disclosure, different virtual boundaries are defined for the luma coding tree unit and the chroma coding tree unit, and adaptive loop filtering is performed according to the corresponding virtual boundaries, which enables efficient adaptive loop filtering during video encoding.
[0062] S706 performs adaptive loop filtering on target pixels within the target filtering range.
[0063] In one embodiment of this disclosure, when the target coding tree units to be subjected to adaptive loop filtering in the image to be processed include multiple target coding tree units located in different target rows, the above-described S406 can perform adaptive loop filtering in parallel on target pixels within the target filtering range corresponding to different target coding tree units in different target rows. In this embodiment, performing adaptive loop filtering in parallel on coding tree units located in different rows can improve the efficiency of performing adaptive loop filtering on the image to be processed.
[0064] It should be noted that, in this embodiment of the disclosure, before determining the target filtering range for performing adaptive loop filtering on the target coding tree unit based on the virtual boundaries (first direction virtual boundary and second direction virtual boundary) of the coding tree unit, the row and column of each coding tree unit in the image to be processed can be determined first based on the virtual boundaries (first direction virtual boundary and second direction virtual boundary) of the coding tree unit. When the target coding tree unit to be subjected to adaptive loop filtering is located in different positions in the image to be processed, the corresponding target filtering range may be different. Assuming that the target coding tree unit is located in the target row and target column in the image to be processed, the following descriptions address several possible scenarios:
[0065] 1) If the target row is not the first or last row of the image to be processed, and the target column is not the first or last column of the image to be processed, then determine the first directional virtual boundary of the target row and the row above the target row; obtain the second directional virtual boundary of the column before the target column, and determine the extended virtual boundary of the column after the target column based on the second directional virtual boundary of the column before the target column; determine the target filtering range based on the first directional virtual boundary of the target row and the row above the target row, the second directional virtual boundary of the column before the target column, and the extended virtual boundary of the column after the target column.
[0066] like Figure 8 The target coding tree unit shown in (f) and (g) is neither located in the first or last row of the image to be processed, nor in the first or last column of the image to be processed. In this case, the reference pixel range for performing adaptive loop filtering on the current CTU is the region determined by the horizontal virtual boundary of the current row CTU, the horizontal virtual boundary of the previous row CTU, the vertical virtual boundary of the previous column, and the extended virtual boundary of the next column.
[0067] 2) If the target row is the first row of the image to be processed, and the target column is the first column of the image to be processed, then determine the first directional virtual boundary of the target row and the first row boundary of the image to be processed; obtain the first column boundary of the image to be processed, and determine the extended virtual boundary of the next column of the target column; determine the target filtering range based on the first directional virtual boundary of the target row, the first row boundary of the image to be processed, the first column boundary of the image to be processed, and the extended virtual boundary of the next column.
[0068] like Figure 8 The target coding tree unit shown in (a) is located in the first row and first column of the image to be processed. In this case, the reference pixel range for performing adaptive loop filtering on the current CTU is the region determined by the horizontal virtual boundary of the current row CTU, the first row boundary of the image to be processed, the first column boundary of the image to be processed, and the extended virtual boundary of the next column.
[0069] 3) If the target row is the first row of the image to be processed, and the target column is not the first or last column of the image to be processed, then determine the first directional virtual boundary of the target row and the first row boundary of the image to be processed; obtain the second directional virtual boundary of the column preceding the target column, and determine the extended virtual boundary of the column following the target column based on the second directional virtual boundary of the column preceding the target column; determine the target filtering range based on the first directional virtual boundary of the target row, the first row boundary of the image to be processed, the second directional virtual boundary of the column preceding the target column, and the extended virtual boundary of the column following the target column.
[0070] like Figure 8 The target coding tree unit shown in (b) and (c) is located in the first row and non-first and last columns of the image to be processed. In this case, the reference pixel range for performing adaptive loop filtering on the current CTU is the region determined by the horizontal virtual boundary of the current row CTU, the first row boundary of the image to be processed, the vertical virtual boundary of the previous column, and the extended virtual boundary of the next column.
[0071] 4) If the target row is the first row of the image to be processed and the target column is the last column of the image to be processed, then determine the first directional virtual boundary of the target row and the first row boundary of the image to be processed; determine the second directional virtual boundary of the column preceding the target column and obtain the last column boundary of the image to be processed; determine the target filtering range based on the first directional virtual boundary of the target row, the first row boundary of the image to be processed, the second directional virtual boundary of the column preceding the target column, and the last column boundary of the image to be processed.
[0072] like Figure 8 The target coding tree unit shown in (d) is located in the first row and last column of the image to be processed. In this case, the reference pixel range for performing adaptive loop filtering on the current CTU is the region determined by the horizontal virtual boundary of the current row CTU, the first row boundary of the image to be processed, the vertical virtual boundary of the previous column, and the last column boundary of the image to be processed.
[0073] 5) If the target row is not the first or last row of the image to be processed, and the target column is the first column of the image to be processed, then determine the first directional virtual boundary of the target row and the row above the target row; obtain the boundary of the first column of the image to be processed, and determine the extended virtual boundary of the next column of the target column; determine the target filtering range based on the first directional virtual boundary of the target row and the row above the target row, the boundary of the first column of the image to be processed, and the extended virtual boundary of the next column.
[0074] like Figure 8 The target coding tree unit shown in (e) is located in the non-first and last rows and the first column of the image to be processed. In this case, the reference pixel range for performing adaptive loop filtering on the current CTU is the region determined by the horizontal virtual boundary of the current row CTU, the horizontal virtual boundary of the previous row CTU, the first column boundary of the image to be processed, and the extended virtual boundary of the next column.
[0075] 6) If the target row is not the first or last row of the image to be processed, and the target column is the last column of the image to be processed, then determine the first directional virtual boundary of the target row and the row above the target row; determine the second directional virtual boundary of the column before the target column, and obtain the last column boundary of the image to be processed; determine the target filtering range based on the first directional virtual boundary of the target row and the row above the target row, the second directional virtual boundary of the column before the target row, and the last column boundary of the image to be processed.
[0076] like Figure 8 The target coding tree unit shown in (h) is located in the non-first and last rows and the last column of the image to be processed. In this case, the reference pixel range for performing adaptive loop filtering on the current CTU is the region determined by the horizontal virtual boundary of the current row CTU, the horizontal virtual boundary of the previous row CTU, the vertical virtual boundary of the previous column, and the last column boundary of the image to be processed.
[0077] 7) If the target row is the last row of the image to be processed, and the target column is the first column of the image to be processed, then determine the last row boundary of the image to be processed and the first direction virtual boundary of the target row; obtain the first column boundary of the image to be processed, and determine the extended virtual boundary of the next column of the target column; determine the target filtering range based on the last row boundary of the image to be processed, the first direction virtual boundary of the target row, the first column boundary of the image to be processed, and the extended virtual boundary of the next column.
[0078] like Figure 8 The target coding tree unit shown in (i) is located in the last row and first column of the image to be processed. In this case, the reference pixel range for performing adaptive loop filtering on the current CTU is the region determined by the boundary of the last row of the image to be processed, the horizontal virtual boundary of the current row CTU, the boundary of the first column of the image to be processed, and the extended virtual boundary of the next column.
[0079] 8) If the target row is the last row of the image to be processed, and the target column is not the first or last column of the image to be processed, then determine the last row boundary of the image to be processed and the first direction virtual boundary of the target row; obtain the second direction virtual boundary of the column preceding the target column, and determine the extended virtual boundary of the column following the target column based on the second direction virtual boundary of the column preceding the target column; determine the target filtering range based on the last row boundary of the image to be processed, the first direction virtual boundary of the target row, the second direction virtual boundary of the column preceding the target column, and the extended virtual boundary of the column following the target column.
[0080] like Figure 8 The target coding tree unit shown in (j) and (k) is located in the last row of the image to be processed, not in the first or last column. In this case, the reference pixel range for performing adaptive loop filtering on the current CTU is the region determined by the boundary of the last row of the image to be processed, the horizontal virtual boundary of the current row CTU, the vertical virtual boundary of the previous column, and the extended virtual boundary of the next column.
[0081] 9) If the target row is the last row of the image to be processed, and the target column is the last column of the image to be processed, then determine the last row boundary of the image to be processed and the first direction virtual boundary of the target row; determine the second direction virtual boundary of the column preceding the target column, and obtain the last column boundary of the image to be processed; determine the target filtering range based on the last row boundary of the image to be processed, the first direction virtual boundary of the target row, the second direction virtual boundary of the column preceding the target column, and the last column boundary of the image to be processed.
[0082] like Figure 8 The target coding tree unit shown in (l) is located in the last row and last column of the image to be processed. In this case, the reference pixel range for performing adaptive loop filtering on the current CTU is the region determined by the boundary of the last row of the image to be processed, the horizontal virtual boundary of the current row CTU, the vertical virtual boundary of the previous column, and the boundary of the last column of the image to be processed.
[0083] In this embodiment of the present disclosure, the adaptive loop filtering process is performed according to the virtual boundary. When performing adaptive loop filtering based on the virtual boundary of the coding tree unit, the pixels located within the virtual boundary are subjected to adaptive loop filtering, without needing to consider the pixels outside the virtual boundary, which can greatly reduce the number of reference pixels. Figure 8 An adaptive loop filtering scheme for horizontal direction is shown, which is performed according to a horizontal virtual boundary. In some other embodiments, an adaptive loop filtering scheme for vertical direction can be performed according to a vertical virtual boundary. In some extended embodiments, an adaptive loop filtering scheme for corresponding direction can also be performed according to other directions. This disclosure does not specifically limit the scope of the application.
[0084] Figure 9This is a flowchart illustrating an image decoding method according to an exemplary embodiment, with reference to... Figure 9 The image encoding method may include the following steps:
[0085] S902, determine the virtual boundary of the decoding tree unit in the image to be processed, wherein the decoding tree unit includes the target decoding tree unit to be subjected to adaptive loop filtering processing.
[0086] It should be noted that the image to be processed in S902 above can be any image that requires enhanced filtering. In some embodiments, the image to be processed can be a frame from the video to be processed. In other embodiments, it can be a reconstructed image obtained by performing entropy decoding, inverse transform, and inverse quantization on the received binary bitstream at the decoding side. The decoding tree unit in this embodiment can be a processing unit for block decoding of the image to be processed. After dividing the image to be processed into multiple decoding tree units, the image to be processed can be decoded in units of decoding tree units. In this embodiment, the virtual boundary of the decoding tree unit refers to the boundary obtained by extending the boundary of the decoding tree unit outward by a preset number of pixel rows.
[0087] For ease of description, in this embodiment of the disclosure, the decoding tree unit to be subjected to adaptive loop filtering on the decoding side is referred to as the target decoding tree unit. In principle, the target decoding tree unit can be any decoding tree unit in the image to be processed.
[0088] S904 determines the target filtering range for performing adaptive loop filtering on the target decoding tree unit based on the virtual boundary of the decoding tree unit.
[0089] It should be noted that the virtual boundary of the aforementioned decoding tree unit includes a first-direction virtual boundary and a second-direction virtual boundary. In some embodiments, when performing adaptive loop filtering on the decoding tree unit in the image to be processed according to the first direction, the target filtering range for performing adaptive loop filtering on the target decoding tree unit can be determined based on the first-direction virtual boundary of the decoding tree unit in the image to be processed. In other embodiments, when performing adaptive loop filtering on the decoding tree unit in the image to be processed according to the second direction, the target filtering range for performing adaptive loop filtering on the target decoding tree unit can be determined based on the second-direction virtual boundary of the decoding tree unit in the image to be processed. Determining the target filtering range of adaptive loop filtering with the first-direction virtual boundary can reduce the number of pixels required for adaptive loop filtering in the first direction and improve the parallelism of decoding in the first direction; determining the target filtering range of adaptive loop filtering with the second-direction virtual boundary can reduce the number of pixels required for adaptive loop filtering in the second direction and improve the parallelism of decoding in the second direction.
[0090] In some embodiments, the first directional virtual boundary is a virtual boundary obtained by moving the bottom boundary of the corresponding decoding tree unit upward by a preset number of pixels; the second directional virtual boundary is a virtual boundary obtained by moving the right boundary of the corresponding decoding tree unit to the left by a preset number of pixels.
[0091] In some embodiments, when the decoding tree unit is a luma decoding tree unit, the values of the preset pixel row and the preset pixel column are both 4; when the decoding tree unit is a chroma decoding tree unit, the values of the preset pixel row and the preset pixel column are both 2. In this embodiment of the present disclosure, different virtual boundaries are defined for the luma decoding tree unit and the chroma decoding tree unit, and adaptive loop filtering is performed according to the corresponding virtual boundaries, which enables efficient adaptive loop filtering during video decoding.
[0092] S906 performs adaptive loop filtering on target pixels within the target filtering range.
[0093] It should be noted that, in this embodiment of the disclosure, before determining the target filtering range for performing adaptive loop filtering on the target decoding tree unit based on the virtual boundary of the decoding tree unit, the row and column of each decoding tree unit in the image to be processed can be determined first based on the virtual boundary of the decoding tree unit. When the target decoding tree unit to be processed for adaptive loop filtering is located in a different position in the image to be processed, the corresponding target filtering range may differ. Assuming the target decoding tree unit is located in the target row and target column of the image to be processed, the following explanations address several possible scenarios:
[0094] 1) If the target row is not the first or last row of the image to be processed, and the target column is not the first or last column of the image to be processed, then determine the first directional virtual boundary of the target row and the row above the target row; obtain the second directional virtual boundary of the column before the target column, and determine the extended virtual boundary of the column after the target column based on the second directional virtual boundary of the column before the target column; determine the target filtering range based on the first directional virtual boundary of the target row and the row above the target row, the second directional virtual boundary of the column before the target column, and the extended virtual boundary of the column after the target column.
[0095] 2) If the target row is the first row of the image to be processed, and the target column is the first column of the image to be processed, then determine the first directional virtual boundary of the target row and the first row boundary of the image to be processed; obtain the first column boundary of the image to be processed, and determine the extended virtual boundary of the next column of the target column; determine the target filtering range based on the first directional virtual boundary of the target row, the first row boundary of the image to be processed, the first column boundary of the image to be processed, and the extended virtual boundary of the next column.
[0096] 3) If the target row is the first row of the image to be processed, and the target column is not the first or last column of the image to be processed, then determine the first directional virtual boundary of the target row and the first row boundary of the image to be processed; obtain the second directional virtual boundary of the column preceding the target column, and determine the extended virtual boundary of the column following the target column based on the second directional virtual boundary of the column preceding the target column; determine the target filtering range based on the first directional virtual boundary of the target row, the first row boundary of the image to be processed, the second directional virtual boundary of the column preceding the target column, and the extended virtual boundary of the column following the target column.
[0097] 4) If the target row is the first row of the image to be processed and the target column is the last column of the image to be processed, then determine the first directional virtual boundary of the target row and the first row boundary of the image to be processed; determine the second directional virtual boundary of the column preceding the target column and obtain the last column boundary of the image to be processed; determine the target filtering range based on the first directional virtual boundary of the target row, the first row boundary of the image to be processed, the second directional virtual boundary of the column preceding the target column, and the last column boundary of the image to be processed.
[0098] 5) If the target row is not the first or last row of the image to be processed, and the target column is the first column of the image to be processed, then determine the first directional virtual boundary of the target row and the row above the target row; obtain the boundary of the first column of the image to be processed, and determine the extended virtual boundary of the next column of the target column; determine the target filtering range based on the first directional virtual boundary of the target row and the row above the target row, the boundary of the first column of the image to be processed, and the extended virtual boundary of the next column.
[0099] 6) If the target row is not the first or last row of the image to be processed, and the target column is the last column of the image to be processed, then determine the first directional virtual boundary of the target row and the row above the target row; determine the second directional virtual boundary of the column before the target column, and obtain the last column boundary of the image to be processed; determine the target filtering range based on the first directional virtual boundary of the target row and the row above the target row, the second directional virtual boundary of the column before the target row, and the last column boundary of the image to be processed.
[0100] 7) If the target row is the last row of the image to be processed, and the target column is the first column of the image to be processed, then determine the last row boundary of the image to be processed and the first direction virtual boundary of the target row; obtain the first column boundary of the image to be processed, and determine the extended virtual boundary of the next column of the target column; determine the target filtering range based on the last row boundary of the image to be processed, the first direction virtual boundary of the target row, the first column boundary of the image to be processed, and the extended virtual boundary of the next column.
[0101] 8) If the target row is the last row of the image to be processed, and the target column is not the first or last column of the image to be processed, then determine the last row boundary of the image to be processed and the first direction virtual boundary of the target row; obtain the second direction virtual boundary of the column preceding the target column, and determine the extended virtual boundary of the column following the target column based on the second direction virtual boundary of the column preceding the target column; determine the target filtering range based on the last row boundary of the image to be processed, the first direction virtual boundary of the target row, the second direction virtual boundary of the column preceding the target column, and the extended virtual boundary of the column following the target column.
[0102] 9) If the target row is the last row of the image to be processed, and the target column is the last column of the image to be processed, then determine the last row boundary of the image to be processed and the first direction virtual boundary of the target row; determine the second direction virtual boundary of the column preceding the target column, and obtain the last column boundary of the image to be processed; determine the target filtering range based on the last row boundary of the image to be processed, the first direction virtual boundary of the target row, the second direction virtual boundary of the column preceding the target column, and the last column boundary of the image to be processed.
[0103] In some embodiments, the target decoding tree unit includes multiple target decoding tree units located in different target rows; wherein, performing adaptive loop filtering on target pixels within the target filtering range includes: performing adaptive loop filtering in parallel on target pixels within the target filtering range corresponding to different target decoding tree units in different target rows.
[0104] Figure 10 This is a schematic diagram of an encoding device according to an exemplary embodiment, with reference to... Figure 10 The encoding device may include: an encoding virtual boundary determination module 101, an encoding filtering range determination module 102, and an encoding filtering processing module 103.
[0105] The encoding virtual boundary determination module 101 is configured to determine the virtual boundary of the encoding tree unit in the image to be processed, wherein the encoding tree unit includes the target encoding tree unit to be subjected to adaptive loop filtering; the encoding filtering range determination module 102 is configured to determine the target filtering range for performing adaptive loop filtering on the target encoding tree unit based on the virtual boundary of the encoding tree unit; and the encoding filtering processing module 103 is configured to perform adaptive loop filtering on the target pixels within the target filtering range.
[0106] In some embodiments, the virtual boundary of the coding tree unit includes a first-direction virtual boundary and a second-direction virtual boundary, wherein the first-direction virtual boundary is a virtual boundary parallel to the row direction of the coding tree unit, and the second-direction virtual boundary is a virtual boundary parallel to the column direction of the coding tree unit; wherein the coding filtering range determination module 102 is further configured to: determine the row and column of each coding tree unit in the image to be processed based on the first-direction virtual boundary and the second-direction virtual boundary of the coding tree unit, and the target coding tree unit is located in the target row and target column in the image to be processed; if the target row is not the first row and the last row of the image to be processed, and the target column is not the first column and the last column of the image to be processed, then determine the first-direction virtual boundary of the target row and the row above the target row; obtain the second-direction virtual boundary of the column before the target column, and determine the extended virtual boundary of the column after the target column based on the second-direction virtual boundary of the column before the target column; determine the target filtering range based on the first-direction virtual boundary of the target row and the row before the target row, the second-direction virtual boundary of the column before the target column, and the extended virtual boundary of the column after the target column.
[0107] In some embodiments, the encoding filtering range determination module 102 is further configured to: if the target row is the first row of the image to be processed and the target column is the first column of the image to be processed, determine the first directional virtual boundary of the target row and the first row boundary of the image to be processed; obtain the first column boundary of the image to be processed and determine the extended virtual boundary of the next column of the target column; and determine the target filtering range based on the first directional virtual boundary of the target row, the first row boundary of the image to be processed, the first column boundary of the image to be processed, and the extended virtual boundary of the next column of the image to be processed.
[0108] In some embodiments, the encoding filtering range determination module 102 is further configured to: if the target row is the first row of the image to be processed, and the target column is not the first or last column of the image to be processed, then determine the first directional virtual boundary of the target row and the first row boundary of the image to be processed; obtain the second directional virtual boundary of the column preceding the target column, and determine the extended virtual boundary of the column following the target column based on the second directional virtual boundary of the column preceding the target column; and determine the target filtering range based on the first directional virtual boundary of the target row, the first row boundary of the image to be processed, the second directional virtual boundary of the column preceding the target column, and the extended virtual boundary of the column following the target column.
[0109] In some embodiments, the encoding filtering range determination module 102 is further configured to: if the target row is the first row of the image to be processed and the target column is the last column of the image to be processed, determine the first directional virtual boundary of the target row and the first row boundary of the image to be processed; determine the second directional virtual boundary of the column preceding the target column and obtain the last column boundary of the image to be processed; and determine the target filtering range based on the first directional virtual boundary of the target row, the first row boundary of the image to be processed, the second directional virtual boundary of the column preceding the target column, and the last column boundary of the image to be processed.
[0110] In some embodiments, the encoding filtering range determination module 102 is further configured to: if the target row is not the first and last rows of the image to be processed, and the target column is the first column of the image to be processed, determine the first directional virtual boundary of the target row and the row above the target row; obtain the boundary of the first column of the image to be processed, and determine the extended virtual boundary of the next column of the target column; and determine the target filtering range based on the first directional virtual boundary of the target row and the row above the target row, the boundary of the first column of the image to be processed, and the extended virtual boundary of the next column.
[0111] In some embodiments, the encoding filtering range determination module 102 is further configured to: if the target row is not the first or last row of the image to be processed, and the target column is the last column of the image to be processed, then determine the first directional virtual boundary of the target row and the row above the target row; determine the second directional virtual boundary of the column before the target column, and obtain the last column boundary of the image to be processed; and determine the target filtering range based on the target row, the first directional virtual boundary of the row above the target row, the second directional virtual boundary of the column before the target row, and the last column boundary of the image to be processed.
[0112] In some embodiments, the encoding filtering range determination module 102 is further configured to: if the target row is the last row of the image to be processed and the target column is the first column of the image to be processed, then determine the last row boundary of the image to be processed and the first directional virtual boundary of the target row; obtain the first column boundary of the image to be processed and determine the extended virtual boundary of the next column of the target column; and determine the target filtering range based on the last row boundary of the image to be processed, the first directional virtual boundary of the target row, the first column boundary of the image to be processed, and the extended virtual boundary of the next column.
[0113] In some embodiments, the encoding filtering range determination module 102 is further configured to: if the target row is the last row of the image to be processed, and the target column is not the first or last column of the image to be processed, then determine the last row boundary of the image to be processed and the first directional virtual boundary of the target row; obtain the second directional virtual boundary of the column preceding the target column, and determine the extended virtual boundary of the column following the target column based on the second directional virtual boundary of the column preceding the target column; and determine the target filtering range based on the last row boundary of the image to be processed, the first directional virtual boundary of the target row, the second directional virtual boundary of the column preceding the target column, and the extended virtual boundary of the column following the target column.
[0114] In some embodiments, the encoding filtering range determination module 102 is further configured to: if the target row is the last row of the image to be processed and the target column is the last column of the image to be processed, then determine the last row boundary of the image to be processed and the first directional virtual boundary of the target row; determine the second directional virtual boundary of the column preceding the target column and obtain the last column boundary of the image to be processed; and determine the target filtering range based on the last row boundary of the image to be processed, the first directional virtual boundary of the target row, the second directional virtual boundary of the column preceding the target column, and the last column boundary of the image to be processed.
[0115] In some embodiments, the first directional virtual boundary is a virtual boundary obtained by moving the bottom boundary of the corresponding coding tree unit upward by a preset number of pixels; the second directional virtual boundary is a virtual boundary obtained by moving the right boundary of the corresponding coding tree unit to the left by a preset number of pixels.
[0116] In some embodiments, when the coding tree unit is a luminance coding tree unit, the value of the preset pixel row and the preset pixel column is 4; when the coding tree unit is a chrominance coding tree unit, the value of the preset pixel row and the preset pixel column is 2.
[0117] In some embodiments, the target coding tree unit includes multiple target coding tree units located in different target rows; wherein, the coding filtering processing module 103 is further configured to: perform adaptive loop filtering processing in parallel on target pixels within the target filtering range corresponding to different target coding tree units located in different target rows.
[0118] Figure 11 This is a schematic diagram of a decoding device according to an exemplary embodiment, with reference to... Figure 11 The decoding device may include: a decoding virtual boundary determination module 111, a decoding filtering range determination module 112, and a decoding filtering processing module 113.
[0119] The decoding virtual boundary determination module 111 is configured to determine the virtual boundary of the decoding tree unit in the image to be processed, wherein the decoding tree unit includes the target decoding tree unit to be subjected to adaptive loop filtering; the decoding filtering range determination module 112 is configured to determine the target filtering range for performing adaptive loop filtering on the target decoding tree unit based on the virtual boundary of the decoding tree unit; and the decoding filtering processing module 113 is configured to perform adaptive loop filtering on the target pixels within the target filtering range.
[0120] In some embodiments, the virtual boundary of the decoding tree unit in this disclosure includes a first-direction virtual boundary and a second-direction virtual boundary; wherein, the decoding filtering range determination module 112 is further configured to: determine the row and column of each decoding tree unit in the image to be processed based on the first-direction virtual boundary and the second-direction virtual boundary of the decoding tree unit, wherein the target decoding tree unit is located in the target row and target column of the image to be processed; if the target row is not the first row and the last row of the image to be processed, and the target column is not the first column and the last column of the image to be processed, then determine the first-direction virtual boundary of the target row and the row above the target row; obtain the second-direction virtual boundary of the column before the target column, and determine the extended virtual boundary of the column after the target column based on the second-direction virtual boundary of the column before the target column; determine the target filtering range based on the first-direction virtual boundary of the target row and the row before the target row, the second-direction virtual boundary of the column before the target column, and the extended virtual boundary of the column after the target column.
[0121] In some embodiments, the decoding filtering range determination module 112 is further configured to: if the target row is the first row of the image to be processed and the target column is the first column of the image to be processed, determine the first directional virtual boundary of the target row and the first row boundary of the image to be processed; obtain the first column boundary of the image to be processed and determine the extended virtual boundary of the next column of the target column; and determine the target filtering range based on the first directional virtual boundary of the target row, the first row boundary of the image to be processed, the first column boundary of the image to be processed, and the extended virtual boundary of the next column of the image to be processed.
[0122] In some embodiments, the decoding filtering range determination module 112 is further configured to: if the target row is the first row of the image to be processed, and the target column is not the first or last column of the image to be processed, then determine the first directional virtual boundary of the target row and the first row boundary of the image to be processed; obtain the second directional virtual boundary of the column preceding the target column, and determine the extended virtual boundary of the column following the target column based on the second directional virtual boundary of the column preceding the target column; and determine the target filtering range based on the first directional virtual boundary of the target row, the first row boundary of the image to be processed, the second directional virtual boundary of the column preceding the target column, and the extended virtual boundary of the column following the target column.
[0123] In some embodiments, the decoding filtering range determination module 112 is further configured to: if the target row is the first row of the image to be processed and the target column is the last column of the image to be processed, determine the first directional virtual boundary of the target row and the first row boundary of the image to be processed; determine the second directional virtual boundary of the column preceding the target column and obtain the last column boundary of the image to be processed; and determine the target filtering range based on the first directional virtual boundary of the target row, the first row boundary of the image to be processed, the second directional virtual boundary of the column preceding the target column, and the last column boundary of the image to be processed.
[0124] In some embodiments, the decoding filtering range determination module 112 is further configured to: if the target row is not the first and last rows of the image to be processed, and the target column is the first column of the image to be processed, determine the first directional virtual boundary of the target row and the row above the target row; obtain the boundary of the first column of the image to be processed, and determine the extended virtual boundary of the next column of the target column; and determine the target filtering range based on the first directional virtual boundary of the target row and the row above the target row, the boundary of the first column of the image to be processed, and the extended virtual boundary of the next column.
[0125] In some embodiments, the decoding filtering range determination module 112 is further configured to: if the target row is not the first or last row of the image to be processed, and the target column is the last column of the image to be processed, determine the first directional virtual boundary of the target row and the row above the target row; determine the second directional virtual boundary of the column before the target column, and obtain the last column boundary of the image to be processed; determine the target filtering range based on the target row, the first directional virtual boundary of the row above the target row, the second directional virtual boundary of the column before the target row, and the last column boundary of the image to be processed.
[0126] In some embodiments, the decoding filtering range determination module 112 is further configured to: if the target row is the last row of the image to be processed and the target column is the first column of the image to be processed, determine the last row boundary of the image to be processed and the first directional virtual boundary of the target row; obtain the first column boundary of the image to be processed and determine the extended virtual boundary of the next column of the target column; and determine the target filtering range based on the last row boundary of the image to be processed, the first directional virtual boundary of the target row, the first column boundary of the image to be processed, and the extended virtual boundary of the next column.
[0127] In some embodiments, the decoding filtering range determination module 112 is further configured to: if the target row is the last row of the image to be processed, and the target column is not the first or last column of the image to be processed, then determine the last row boundary of the image to be processed and the first directional virtual boundary of the target row; obtain the second directional virtual boundary of the column preceding the target column, and determine the extended virtual boundary of the column following the target column based on the second directional virtual boundary of the column preceding the target column; and determine the target filtering range based on the last row boundary of the image to be processed, the first directional virtual boundary of the target row, the second directional virtual boundary of the column preceding the target column, and the extended virtual boundary of the column following the target column.
[0128] In some embodiments, the decoding filtering range determination module 112 is further configured to: if the target row is the last row of the image to be processed and the target column is the last column of the image to be processed, then determine the last row boundary of the image to be processed and the first directional virtual boundary of the target row; determine the second directional virtual boundary of the column preceding the target column and obtain the last column boundary of the image to be processed; and determine the target filtering range based on the last row boundary of the image to be processed, the first directional virtual boundary of the target row, the second directional virtual boundary of the column preceding the target column, and the last column boundary of the image to be processed.
[0129] In some embodiments, the first directional virtual boundary is a virtual boundary obtained by moving the bottom boundary of the corresponding coding tree unit upward by a preset number of pixels; the second directional virtual boundary is a virtual boundary obtained by moving the right boundary of the corresponding coding tree unit to the left by a preset number of pixels.
[0130] In some embodiments, when the coding tree unit is a luminance coding tree unit, the value of the preset pixel row and the preset pixel column is 4; when the coding tree unit is a chrominance coding tree unit, the value of the preset pixel row and the preset pixel column is 2.
[0131] In some embodiments, the target decoding tree unit includes multiple target decoding tree units located in different target rows; wherein, the decoding filtering processing module 113 is further configured to: perform adaptive loop filtering processing in parallel on target pixels within the target filtering range corresponding to different target decoding tree units located in different target rows.
[0132] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0133] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."
[0134] The following reference Figure 12 To describe an electronic device 1200 according to such an embodiment of the present disclosure. Figure 12 The electronic device 1200 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0135] like Figure 12 As shown, the electronic device 1200 is manifested in the form of a general-purpose computing device. The components of the electronic device 1200 may include, but are not limited to: at least one processing unit 1210, at least one storage unit 1220, and a bus 1230 connecting different system components (including storage unit 1220 and processing unit 1210).
[0136] The storage unit stores program code that can be executed by the processing unit 1210, causing the processing unit 1210 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processing unit 1210 can perform the following steps of the above method embodiments: determining the virtual boundaries of coding tree units / decoding tree units in the image to be processed, wherein the coding tree units / decoding tree units include target coding tree units to which adaptive loop filtering processing is to be performed; determining the target filtering range for performing adaptive loop filtering processing on the target coding tree units based on the virtual boundaries of the coding tree units / decoding tree units; and performing adaptive loop filtering processing on target pixels within the target filtering range.
[0137] Storage unit 1220 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 12201 and / or cache memory 12202, and may further include a read-only memory (ROM) 12203.
[0138] Storage unit 1220 may also include a program / utility 12204 having a set (at least one) of program modules 12205, such program modules 12205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0139] Bus 1230 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0140] Electronic device 1200 can also communicate with one or more external devices 1240 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 1200, and / or any device that enables electronic device 1200 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1250. Furthermore, electronic device 1200 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1260. As shown, network adapter 1260 communicates with other modules of electronic device 1200 via bus 1230. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0141] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0142] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the methods described above is stored thereon. In some possible implementations, various aspects of this disclosure may also be implemented as a program product including program code, which, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.
[0143] More specific examples of computer-readable storage media in this disclosure may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0144] In this disclosure, a computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of transmitting, propagating, or transmitting a program for use by or in connection with an instruction execution system, apparatus, or device.
[0145] Optionally, the program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0146] In practical implementation, program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0147] In an exemplary embodiment of this disclosure, a computer program is also provided, which, when executed by a processor, implements the image encoding method or the image decoding method described in any of the preceding claims.
[0148] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0149] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0150] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0151] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the appended claims.
[0152] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. An image encoding method, characterized in that, include: Determine the virtual boundaries of coding tree units in the image to be processed, wherein the coding tree units include target coding tree units to be subjected to adaptive loop filtering processing; Based on the virtual boundary of the coding tree unit, determine the target filtering range for performing adaptive loop filtering on the target coding tree unit; Perform adaptive loop filtering on the target pixels within the target filtering range; The virtual boundaries of the coding tree unit include a first-direction virtual boundary and a second-direction virtual boundary. The first-direction virtual boundary is a virtual boundary parallel to the row direction of the coding tree unit, obtained by moving the bottom boundary of the corresponding coding tree unit upward by a preset number of pixels. The second-direction virtual boundary is a virtual boundary parallel to the column direction of the coding tree unit, obtained by moving the right boundary of the corresponding coding tree unit to the left by a preset number of pixels. The target coding tree unit is located in the target row and target column of the image to be processed, and the target filtering range is determined based on the position of the target row and the target column.
2. The image encoding method according to claim 1, characterized in that, Based on the virtual boundaries of the coding tree unit, the target filtering range for performing adaptive loop filtering on the target coding tree unit is determined, including: Based on the first and second direction virtual boundaries of the coding tree unit, determine the row and column of each coding tree unit in the image to be processed; If the target row is not the first or last row of the image to be processed, and the target column is not the first or last column of the image to be processed, then the first directional virtual boundary of the target row and the row above the target row is determined. Obtain the second directional virtual boundary of the preceding column of the target column, and determine the extended virtual boundary of the following column of the target column based on the second directional virtual boundary of the preceding column; The target filtering range is determined based on the target row, the first directional virtual boundary of the previous row, the second directional virtual boundary of the preceding column, and the extended virtual boundary of the following column.
3. The image encoding method according to claim 2, characterized in that, After determining the row and column of each coding tree unit in the image to be processed based on the first and second directional virtual boundaries of the coding tree unit, the method further includes: If the target row is the first row of the image to be processed, and the target column is the first column of the image to be processed, then the first directional virtual boundary of the target row and the first row boundary of the image to be processed are determined. Obtain the first column boundary of the image to be processed, and determine the extended virtual boundary of the next column after the target column; The target filtering range is determined based on the first directional virtual boundary of the target row, the first row boundary of the image to be processed, the first column boundary of the image to be processed, and the extended virtual boundary of the next column.
4. The image encoding method according to claim 2, characterized in that, After determining the row and column of each coding tree unit in the image to be processed based on the first and second directional virtual boundaries of the coding tree unit, the method further includes: If the target row is the first row of the image to be processed, and the target column is not the first or last column of the image to be processed, then the first directional virtual boundary of the target row and the first row boundary of the image to be processed are determined. Obtain the second directional virtual boundary of the preceding column of the target column, and determine the extended virtual boundary of the following column of the target column based on the second directional virtual boundary of the preceding column; The target filtering range is determined based on the first directional virtual boundary of the target row, the first row boundary of the image to be processed, the second directional virtual boundary of the preceding column, and the extended virtual boundary of the following column.
5. The image encoding method according to claim 2, characterized in that, After determining the row and column of each coding tree unit in the image to be processed based on the first and second directional virtual boundaries of the coding tree unit, the method further includes: If the target row is the first row of the image to be processed, and the target column is the last column of the image to be processed, then the first directional virtual boundary of the target row and the first row boundary of the image to be processed are determined. Determine the second directional virtual boundary of the column preceding the target column, and obtain the tail column boundary of the image to be processed; The target filtering range is determined based on the first directional virtual boundary of the target row, the first row boundary of the image to be processed, the second directional virtual boundary of the preceding column, and the last column boundary of the image to be processed.
6. The image encoding method according to claim 2, characterized in that, After determining the row and column of each coding tree unit in the image to be processed based on the first and second directional virtual boundaries of the coding tree unit, the method further includes: If the target row is not the first or last row of the image to be processed, and the target column is the first column of the image to be processed, then the first directional virtual boundary of the target row and the row above the target row is determined. Obtain the first column boundary of the image to be processed, and determine the extended virtual boundary of the next column after the target column; The target filtering range is determined based on the target row, the first directional virtual boundary of the row above the target row, the first column boundary of the image to be processed, and the extended virtual boundary of the next column.
7. The image encoding method according to claim 2, characterized in that, After determining the row and column of each coding tree unit in the image to be processed based on the first and second directional virtual boundaries of the coding tree unit, the method further includes: If the target row is not the first or last row of the image to be processed, and the target column is the last column of the image to be processed, then the first directional virtual boundary of the target row and the row above the target row is determined. Determine the second directional virtual boundary of the column preceding the target column, and obtain the tail column boundary of the image to be processed; The target filtering range is determined based on the target row, the first directional virtual boundary of the row above the target row, the second directional virtual boundary of the column preceding the target row, and the tail column boundary of the image to be processed.
8. The image encoding method according to claim 2, characterized in that, After determining the row and column of each coding tree unit in the image to be processed based on the first and second directional virtual boundaries of the coding tree unit, the method further includes: If the target row is the last row of the image to be processed, and the target column is the first column of the image to be processed, then the last row boundary of the image to be processed and the first directional virtual boundary of the target row are determined. Obtain the first column boundary of the image to be processed, and determine the extended virtual boundary of the next column after the target column; The target filtering range is determined based on the trailing boundary of the image to be processed, the first directional virtual boundary of the target row, the first column boundary of the image to be processed, and the extended virtual boundary of the next column.
9. The image encoding method according to claim 2, characterized in that, After determining the row and column of each coding tree unit in the image to be processed based on the first and second directional virtual boundaries of the coding tree unit, the method further includes: If the target row is the last row of the image to be processed, and the target column is not the first or last column of the image to be processed, then the last row boundary of the image to be processed and the first directional virtual boundary of the target row are determined. Obtain the second directional virtual boundary of the preceding column of the target column, and determine the extended virtual boundary of the following column of the target column based on the second directional virtual boundary of the preceding column; The target filtering range is determined based on the trailing boundary of the image to be processed, the first directional virtual boundary of the target row, the second directional virtual boundary of the preceding column, and the extended virtual boundary of the following column.
10. The image encoding method according to claim 2, characterized in that, After determining the row and column of each coding tree unit in the image to be processed based on the first and second directional virtual boundaries of the coding tree unit, the method further includes: If the target row is the last row of the image to be processed, and the target column is the last column of the image to be processed, then the last row boundary of the image to be processed and the first directional virtual boundary of the target row are determined. Determine the second directional virtual boundary of the column preceding the target column, and obtain the tail column boundary of the image to be processed; The target filtering range is determined based on the tail row boundary of the image to be processed, the first direction virtual boundary of the target row, the second direction virtual boundary of the preceding column, and the tail column boundary of the image to be processed.
11. The image encoding method according to claim 1, characterized in that, When the coding tree unit is a luminance coding tree unit, the value of the preset pixel row and the preset pixel column are both 4; When the coding tree unit is a chroma coding tree unit, the values of the preset pixel row and the preset pixel column are both 2.
12. The image encoding method according to claim 1, characterized in that, The target coding tree unit includes multiple target coding tree units located in different target rows; The adaptive loop filtering process performed on the target pixels within the target filtering range includes: For target pixels within the target filtering range corresponding to different target coding tree units in different target rows, adaptive loop filtering is performed in parallel.
13. An image decoding method, characterized in that, include: Determine the virtual boundaries of the decoding tree units in the image to be processed, wherein the decoding tree units include the target decoding tree units to be subjected to adaptive loop filtering processing; Based on the virtual boundary of the decoding tree unit, determine the target filtering range for performing adaptive loop filtering on the target decoding tree unit; Perform adaptive loop filtering on the target pixels within the target filtering range; The virtual boundary of the decoding tree unit includes a first-direction virtual boundary and a second-direction virtual boundary. The first-direction virtual boundary is a virtual boundary parallel to the row direction of the decoding tree unit, obtained by moving the bottom boundary of the corresponding decoding tree unit upward by a preset number of pixels. The second-direction virtual boundary is a virtual boundary parallel to the column direction of the decoding tree unit, obtained by moving the right boundary of the corresponding decoding tree unit to the left by a preset number of pixels. The target decoding tree unit is located in the target row and target column of the image to be processed, and the target filtering range is determined based on the position of the target row and the target column.
14. An encoding device, characterized in that, include: The coding virtual boundary determination module is configured to determine the virtual boundary of coding tree units in the image to be processed, wherein the coding tree units include target coding tree units to be subjected to adaptive loop filtering processing; The coding filtering range determination module is configured to determine the target filtering range for performing adaptive loop filtering on the target coding tree unit based on the virtual boundary of the coding tree unit; The encoding filtering processing module is configured to perform adaptive loop filtering processing on target pixels within the target filtering range; The virtual boundaries of the coding tree unit include a first-direction virtual boundary and a second-direction virtual boundary. The first-direction virtual boundary is a virtual boundary parallel to the row direction of the coding tree unit, obtained by moving the bottom boundary of the corresponding coding tree unit upward by a preset number of pixels. The second-direction virtual boundary is a virtual boundary parallel to the column direction of the coding tree unit, obtained by moving the right boundary of the corresponding coding tree unit to the left by a preset number of pixels. The target coding tree unit is located in the target row and target column of the image to be processed, and the target filtering range is determined based on the position of the target row and the target column.
15. A decoding device, characterized in that, include: A decoding virtual boundary determination module is configured to determine the virtual boundary of a decoding tree unit in an image to be processed, wherein the decoding tree unit includes a target decoding tree unit to be subjected to adaptive loop filtering processing; The decoding filtering range determination module is configured to determine the target filtering range for performing adaptive loop filtering on the target decoding tree unit based on the virtual boundary of the decoding tree unit; The decoding and filtering module is configured to perform adaptive loop filtering on the target pixels within the target filtering range; The virtual boundary of the decoding tree unit includes a first-direction virtual boundary and a second-direction virtual boundary. The first-direction virtual boundary is a virtual boundary parallel to the row direction of the decoding tree unit, obtained by moving the bottom boundary of the corresponding decoding tree unit upward by a preset number of pixels. The second-direction virtual boundary is a virtual boundary parallel to the column direction of the decoding tree unit, obtained by moving the right boundary of the corresponding decoding tree unit to the left by a preset number of pixels. The target decoding tree unit is located in the target row and target column of the image to be processed, and the target filtering range is determined based on the position of the target row and the target column.
16. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the image encoding method as described in any one of claims 1 to 12, or the image decoding method as described in claim 13.
17. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the image encoding method as claimed in any one of claims 1 to 12, or the image decoding method as claimed in claim 13.
Citation Information
Patent Citations
Method and apparatus of cross-component adaptive loop filtering with virtual boundary for video coding
CN113994670A