Image filtering method, device, equipment and program
The deep learning-based filtering model addresses performance deficiencies and high storage costs in loop filters by using classification information to enhance filtering effects and reduce storage requirements.
Patent Information
- Application Number
- JP2024516555
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-02-10
- Filing Date
- 2022-12-09
- Publication Date
- 2024-08-29
- Estimated Expiration
- 2042-12-09
AI Technical Summary
Deep learning-based loop filters in image processing suffer from performance optimization deficiencies and high storage costs for model parameters.
An image filtering method and device that utilizes a deep learning-based filtering model, which determines encoding information including classification information of the image to be filtered, and filters the image based on this information to improve filtering effects while reducing storage costs.
The method achieves improved filtering performance with reduced storage costs by using a general-purpose filtering model that can handle both intra-frame and inter-frame encoded images, optimizing performance and storage efficiency.
Smart Images

Figure 2024531738000001_ABST
Abstract
Description
[Technical field]
[0001] (CROSS-REFERENCE TO RELATED APPLICATIONS) This application claims priority to a Chinese patent application bearing application number 202210126411.X, filed with the China Patent Office on February 10, 2022, the entire contents of which are incorporated herein by reference.
[0002] The embodiments of the present application relate to the field of image processing technology, and more particularly to an image filtering method, device, apparatus, and program. [Background technology]
[0003] The loop filters in the related art include a deblocking filter (DBF), a sample adaptive offset (SAO), and an adaptive loop filter (ALF), and mainly filter the reconstructed image to reduce blocking effects, ringing effects, etc., thereby improving the quality of the reconstructed image. Ideally, the reconstructed image is restored to the original image by the filter. Many of the filtering coefficients of the filters in the related art are manually designed, so there is a large room for optimization. In view of the excellent performance of deep learning tools in image processing, deep learning-based loop filters are applied to loop filter modules. However, the deep learning-based loop filters in the related art still have deficiencies in performance optimization, and the performance of the filter needs to be further improved. Summary of the Invention
[0004] The embodiments of the present application provide an image filtering method, apparatus, device, and program that improves image filtering effect while reducing the storage cost of model parameters.
[0005] An embodiment of the present application provides an image filtering method, the method comprising: determining coding information of a filtered image, the coding information including classification information of the filtered image, the classification information indicating at least one of a coding image type, a coding mode of the filtered image; The method includes inputting the target image and the classification information into a same deep learning-based filtering model, and causing the filtering model to filter the target image based on the classification information to obtain a filtered image.
[0006] An embodiment of the present application provides an image filtering device, the device comprising: a determining unit configured to determine coding information of a filtered image, the coding information including classification information of the filtered image, the classification information indicating at least one of a coding image type, a coding mode of the filtered image; and a filtering unit configured to input the target image and the classification information into a same deep learning based filtering model, and cause the filtering model to filter the target image based on the classification information to obtain a filtered image.
[0007] An embodiment of the present application provides an electronic device comprising a processor and a memory, the memory being configured to store a computer program, and the processor executing the above-mentioned method by calling and executing the computer program stored in the memory.
[0008] An embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium being configured to store a computer program, the computer program causing an electronic device to perform the above method.
[0009] An embodiment of the present application provides a chip, the chip including a processor, the processor calling up and executing a computer program from a memory, thereby causing an electronic device equipped with the chip to perform the above-mentioned method.
[0010] An embodiment of the present application provides a computer program product, which includes computer program instructions that, when executed on an electronic device, cause the electronic device to perform the above method.
[0011] An embodiment of the present application provides a computer program, which when executed on an electronic device, causes the electronic device to perform the above method.
[0012] The filtering model of the embodiment of the present application can realize filtering of the filtering target image in intraframe coding mode, and can also realize filtering of the filtering target image in interframe coding mode. This corresponds to a universal filtering model as the filtering target image in different modes, and compared with constructing corresponding filtering models for different modes respectively, the storage space occupancy rate of model parameters is greatly reduced, and the storage cost of model parameters is low. In addition, by combining classification information with the filtering model and performing differential filtering on the filtering target image, the filtering target image in different modes can be applied, and the filtering effect of the filtering target image can be improved. [Brief description of the drawings]
[0013] [Figure 1] 1 is an exemplary block diagram of a video codec system according to an embodiment of the present application; [Diagram 2] FIG. 2 is an exemplary block diagram of a video encoder according to an embodiment of the present application; [Diagram 3] FIG. 2 is an exemplary block diagram of a video decoder according to an embodiment of the present application; [Figure 4] 1 is a flowchart of an image filtering method according to an embodiment of the present application; [Figure 5A] FIG. 1 is a schematic diagram of an application scene according to an embodiment of the present application. [Figure 5B] FIG. 1 is a schematic diagram of an application scene according to an embodiment of the present application. [Figure 5C] FIG. 1 is a schematic diagram of an application scene according to an embodiment of the present application. [Figure 6A] FIG. 2 is a schematic diagram of image division. [Figure 6B] FIG. 2 is a schematic diagram of image division. [Figure 6C] FIG. 2 is a schematic diagram of image division. [Figure 7A] FIG. 2 is a schematic diagram of a filtering scheme according to an embodiment of the present application; [Figure 7B] FIG. 2 is a schematic diagram of a filtering scheme according to an embodiment of the present application; [Figure 7C] FIG. 2 is a schematic diagram of a filtering scheme according to an embodiment of the present application; [Figure 8A] FIG. 2 is a schematic diagram of a residual block according to an embodiment of the present application; [Figure 8B] FIG. 2 is a schematic diagram of a residual block according to an embodiment of the present application; [Figure 8C] FIG. 2 is a schematic diagram of a residual block according to an embodiment of the present application; [Figure 8D] FIG. 2 is a schematic diagram of a residual block according to an embodiment of the present application; [Figure 9] FIG. 2 is a schematic diagram of model training according to an embodiment of the present application. [Figure 10] 1 is a schematic diagram showing a configuration of an image filtering device according to an embodiment of the present application; [Figure 11] FIG. 1 is an exemplary block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0014] In order to more clearly describe the technical solutions of the embodiments of the present application, the following briefly introduces the drawings used in the description of the embodiments. Obviously, the above drawings are only some embodiments of the present application, and those skilled in the art can also obtain other related drawings based on these drawings without any creative efforts.
[0015] In the following, the technical solutions of the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, but obviously, the described embodiments are only some of the embodiments of the present application, not all of the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are included in the protection scope of the present application.
[0016] In addition, the terms "first", "second", and the like in the specification of the embodiments of the present application, the claims, and the above drawings are not intended to limit a particular order or sequence, but to distinguish between similar objects. In addition, the data used in this manner may be exchanged where appropriate, so that the embodiments of the present application described herein may be performed in an order other than that shown or described herein. Furthermore, the terms "comprise", "have", and any variations thereof are intended to be non-exclusive inclusive. For example, a process, method, system, product, or server incorporating a series of steps or units need not be limited to those steps or units explicitly recited, but may include other steps or units not explicitly recited or inherent to those processes, methods, products, or devices.
[0017] In the following, "and / or" means at least one of the two. For example, A and / or B means at least one of A and B.
[0018] In order to facilitate understanding of the embodiments of the present application, a brief description of relevant concepts related to the embodiments of the present application is first provided below.
[0019] Artificial Intelligence (AI) is the theory, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use the knowledge to obtain optimal results. In other words, AI is a comprehensive technology of computer science that seeks to understand the nature of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI studies the design principles and realization methods of various intelligent machines so that machines can have the functions of perception, reasoning, and decision-making.
[0020] Artificial intelligence technology is a comprehensive discipline that includes a wide range of fields, including both hardware and software technology. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. Artificial intelligence software technology mainly includes several major directions, such as computer vision technology, voice processing technology, natural language processing technology, and machine learning / deep learning.
[0021] Machine learning (ML) is a multidisciplinary field that involves many disciplines, including probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. Machine learning specializes in the study of how computers can simulate or realize human learning behavior to acquire new knowledge and skills and reconstruct existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and is the fundamental means of endowing computers with intelligence, and its applications span various fields of artificial intelligence. Machine learning and deep learning usually include techniques such as artificial neural networks, trust networks, reinforcement learning, transfer learning, inductive learning, and learning from demonstration.
[0022] The embodiments of the present application may be applied to image codec fields, video codec fields, hardware video codec fields, dedicated circuit video codec fields, real-time video codec fields, etc. For example, the solutions in the embodiments of the present application may be combined with audio video coding standards (AVS: Audio Video coding Standard), such as H.264 / Audio Video Coding (AVC) standard, H.265 / High Efficiency Video Coding (HEVC) standard, and H.266 / Versatile Video Coding (VVC) standard. Or, the technical solutions in the embodiments of the present application may be combined with other proprietary standards or industry standards for operation. The standards include ITU-TH.261, ISO / IEC MPEG-1 Visual, ITU-TH.262 or ISO / IEC MPEG-2 Visual, ITU-TH.263, ISO / IEC MPEG-4 Visual, and ITU-TH.264 (also called ISO / IEC MPEG-4 AVC), including Scalable Video Coding (SVC) and Multiview Video Coding (MVC) extensions. Note that the technology of the embodiments of the present application is not limited to a specific codec standard or technology.
[0023] For ease of understanding, a video codec system according to an embodiment of the present application will first be described with reference to FIG.
[0024] FIG 1 is an exemplary block diagram of a video codec system according to an embodiment of the present application. Note that FIG 1 is merely an example, and the video codec system according to the embodiment of the present application includes, but is not limited to, that shown in FIG 1. As shown in FIG 1, the video codec system 100 includes an encoding device 110 and a decoding device 120. Here, the encoding device encodes (can be understood as compressing) video data to generate a code stream, and transmits the code stream to the decoding device. The decoding device decodes the code stream generated by the encoding device to obtain decoded video data.
[0025] The encoding device 110 in the embodiment of the present application can be understood as a device having a video encoding function, and the decoding device 120 can be understood as a device having a video decoding function, i.e., the encoding device 110 and the decoding device 120 in the embodiment of the present application include a wider range of devices such as smartphones, desktop computers, mobile computing devices, notebook computers (e.g., laptops), tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, game consoles, and in-vehicle computers.
[0026] In some embodiments, encoding device 110 may transmit encoded video data (e.g., a codestream) to decoding device 120 over channel 130. Channel 130 may include one or more media and / or devices that may transmit encoded video data from encoding device 110 to decoding device 120.
[0027] In one example, channel 130 includes one or more communication media that enable encoding device 110 to transmit encoded video data directly in real time to decoding device 120. In this example, encoding device 110 may modulate the encoded video data in accordance with a communication standard and transmit the modulated video data to decoding device 120, where the communication medium includes a wireless communication medium, such as a radio frequency spectrum, and in some embodiments, the communication medium may also include a wired communication medium, such as one or more physical transmission lines.
[0028] In another example, channel 130 includes a computer-readable storage medium, which can store the video data encoded by encoding device 110. The computer-readable storage medium can include a number of locally accessible data storage media, such as optical disks, DVDs, flash memory, etc. In this example, decoding device 120 can obtain the encoded video data from the computer-readable storage medium.
[0029] In another example, channel 130 may include a storage server capable of storing video data encoded by encoding device 110. In this example, decoding device 120 may download the stored encoded video data from the storage server. In some embodiments, the storage server may store the encoded video data and transmit the encoded video data to decoding device 120, such as a web server (e.g., for a website), a file transfer protocol (FTP) server, or the like.
[0030] In some embodiments, encoding device 110 includes a video encoder 112 and an output interface 113, where output interface 113 may include a modulator / demodulator (modem) and / or a transmitter.
[0031] In some embodiments, encoding device 110 may further include a video source 111 in addition to a video encoder 112 and an output interface 113 .
[0032] The video source 111 may include at least one of a video collection device (such as a video camera), a video archive, a video input interface, and a computer graphics system, where the video input interface is configured to receive video data from a video content provider and the computer graphics system is configured to generate the video data.
[0033] The video encoder 112 encodes video data from the video source 111 to generate a codestream. The video data may include one or more pictures or a sequence of pictures. The codestream contains coding information for a picture or sequence of pictures in the form of a bitstream. The coding information may include coded image data and associated data. The associated data may include sequence parameter sets (SPS), picture parameter sets (PPS), and other syntax structures. An SPS may contain parameters that apply to one or more sequences. A PPS may contain parameters that apply to one or more pictures. A syntax structure refers to a set of zero or more syntax elements arranged in a specified order in the codestream.
[0034] The video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113. The encoded video data may be stored in a storage medium or a storage server for later retrieval by the decoding device 120.
[0035] In some embodiments, decoding device 120 includes an input interface 121 and a video decoder 122 .
[0036] In some embodiments, decoding device 120 may also include a display device 123 in addition to input interface 121 and video decoder 122 .
[0037] Here, the input interface 121 includes a receiver and / or a modem, and can receive encoded video data via a channel 130.
[0038] The video decoder 122 is configured to decode the encoded video data to obtain decoded video data, and transmit the decoded video data to a display device 123 .
[0039] The display device 123 displays the decoded video data and may be integrated with the decoding device 120 or may be external to the decoding device 120. The display device 123 may include a variety of display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices.
[0040] Furthermore, FIG. 1 is only an example, and the technical solution of the embodiments of the present application is not limited to FIG. 1, and the technology of the embodiments of the present application can also be applied to one-sided video encoding and one-sided video decoding.
[0041] In the following, a video encoding framework according to an embodiment of the present application is described.
[0042] 2 is an exemplary block diagram of a video encoder according to an embodiment of the present application. The video encoder 200 may be configured to perform lossy compression of images, or may be configured to perform lossless compression of images. The lossless compression may be visually lossless compression or mathematically lossless compression.
[0043] The video encoder 200 is applicable to image data in luminance and chrominance (YCbCr, YUV) formats.
[0044] For example, the video encoder 200 reads video data and divides the image of one frame into multiple coding tree units (CTUs) for each frame image in the video data. In some examples, a CTB may be called a "tree block", a "largest coding unit" (LCU) or a "coding tree block" (CTB). Each CTU may be associated with an equal-sized pixel block in the image. Each pixel may correspond to one luminance (or luma) sample and two chrominance (or chroma) samples. Thus, each CTU may be associated with one luminance sample block and two chrominance sample blocks. The size of one CTU may be, for example, 128×128, 64×64, 32×32, etc. One CTU may be further divided into multiple coding units (CUs) for encoding, and a CU may be a rectangular or square block. The CU may be further divided into a prediction unit (PU) and a transform unit (TU), which allows for separation of coding, prediction, and transformation and improves processing flexibility. In one example, the CTU is divided into CUs in a quadtree manner, and the CU is divided into TUs and PUs in a quadtree manner.
[0045] The video encoder and the video decoder can support various PU sizes. Assuming that the size of a particular CU is 2N×2N, the video encoder and the video decoder can support a PU size of 2N×2N or N×N for intra-frame prediction, and support a symmetric PU of 2N×2N, 2N×N, N×2N, N×N or similar size for inter-frame prediction. The video encoder and the video decoder can further support asymmetric PUs of 2N×nU, 2N×nD, nL×2N and nR×2N for inter-frame prediction.
[0046] 2, the video encoder 200 may include a prediction unit 210, a residual unit 220, a transform / quantization unit 230, an inverse transform / quantization unit 240, a reconstruction unit 250, a loop filtering unit 260, a decoded image cache 270, and an entropy coding unit 280. However, the video encoder 200 may include more, fewer, or different functional components.
[0047] In some embodiments, in this application, a current block may be referred to as a current coding unit (CU) or a current prediction unit (PU), etc. A prediction block may be referred to as a predicted image block or an image prediction block, and a reconstructed image block may be referred to as a reconstruction block or an image reconstruction image block.
[0048] In some embodiments, the prediction unit 210 includes an inter-frame prediction unit 211 and an intra-frame prediction unit 212. Because there is a strong correlation between adjacent pixels in one frame of a video, the use of intra-frame prediction in video codec technology can eliminate spatial redundancy between adjacent pixels. Because there is a strong correlation between adjacent frames in a video, the use of inter-frame prediction methods in video codec technology can eliminate temporal redundancy between adjacent frames, thereby improving coding efficiency.
[0049] The inter-frame prediction unit 211 is configured to perform inter-frame prediction, which can refer to image information of different frames, and which uses motion information to find a reference block from a reference frame, generate a prediction block based on the reference block, and eliminate temporal redundancy, and the frame used for inter-frame prediction may be a P frame and / or a B frame. A P frame refers to a forward prediction frame, and a B frame refers to a bidirectional prediction frame. The motion information includes a reference frame list where the reference frame is located, a reference frame index, and a motion vector. The motion vector may be a full-pixel or sub-pixel one. If the motion vector is a sub-pixel one, it is necessary to use interpolation filtering on the reference frame to create a block of the required sub-pixel. Here, a block of a full pixel or a sub-pixel in the reference frame that is found based on the motion vector is called a reference block. Some techniques use the reference block directly as a prediction block, and some techniques reprocess based on the reference block to generate a prediction block. Reprocessing based on the reference block to generate a prediction block can be understood as using the reference block as a prediction block, and then processing based on the prediction block to generate a new prediction block.
[0050] The intra prediction unit 212 only refers to information of the same frame image to predict pixel information in the current coding image block, eliminating spatial redundancy. The frame used for intra prediction may be an I-frame.
[0051] The intra-frame prediction modes used in HEVC are Planar, DC, and 33 angle modes, for a total of 35 prediction modes. The intra-frame modes used in VVC are Planar, DC, and 65 angle modes, for a total of 67 prediction modes. The intra-frame modes used in AVS3 are DC, Plane, Bilinear, and 63 angle modes, for a total of 66 prediction modes.
[0052] In some embodiments, the intra prediction unit 212 may be implemented employing an intra block duplication technique and an intra string duplication technique.
[0053] Residual unit 220 may generate a residual block for a CU based on the pixel block of the CU and the prediction block of the PU of the CU. For example, residual unit 220 may generate a residual block for a CU such that each sample in the residual block has a value equal to the difference between a sample in the pixel block of the CU and a corresponding sample in the prediction block of the PU of the CU.
[0054] The transform / quantization unit 230 can quantize the transform coefficients. The residual video signal is transformed into a transform domain by a transform operation such as DFT, DCT, etc., and is called the transform coefficients. The signal in the transform domain loses certain information due to a further lossy quantization operation, so the quantized signal is advantageous for compressed representation. In some video coding standards, multiple transform methods can be selected, so the encoding side also needs to select one transform for the current coding CU and notify the decoding side. The fineness of the quantization is usually determined by the quantization parameter (QP), and a larger value of QP means that a wider range of coefficients are quantized as the same output, so that it usually results in a larger distortion and a lower bit rate. Conversely, a smaller value of QP means that a smaller range of coefficients are quantized as the same output, so that it usually results in a smaller distortion and a higher bit rate.
[0055] The inverse transform / quantization unit 240 may apply inverse quantization and inverse transform, respectively, to the quantized transform coefficients to reconstruct the residual block from the quantized transform coefficients.
[0056] Reconstruction unit 250 may add samples of the reconstructed residual block to corresponding samples of one or more prediction blocks generated by prediction unit 210 to generate a reconstructed image block associated with the TU. By reconstructing the sample blocks of each TU of the CU in this manner, video encoder 200 may reconstruct pixel blocks of the CU.
[0057] The loop filtering unit 260 may perform a deblocking filtering operation to reduce the blocking effect of pixel blocks associated with a CU. Compared with an original image, a reconstructed image is affected by quantization, so that some information is different from the original image, resulting in distortion. A filtering operation may be performed on the reconstructed image using a filter such as DBF, SAO, or ALF to effectively reduce the degree of distortion caused by quantization. These filtered reconstructed images are used as references for subsequent coding images to predict future signals, so the above filtering operation is also referred to as loop filtering, i.e., filtering operation in the coding loop.
[0058] The decoded image cache 270 can store the reconstructed pixel blocks. The inter-frame prediction unit 211 can perform inter-frame prediction on PUs of other images using a reference image including the reconstructed pixel blocks. Furthermore, the intra-frame prediction unit 212 can perform intra-frame prediction on other PUs in the same image as the CU using the reconstructed pixel blocks in the decoded image cache 270.
[0059] The entropy coding unit 280 can receive the quantized transform coefficients from the transform / quantization unit 230. The quantized transform domain signal is statistically compression coded according to the frequency of occurrence of each value, and finally a binary (0 or 1) compressed code stream is output. Other information may also be generated by coding, such as the selected mode, motion vector data, etc., which also need to be entropy coded to reduce the bit rate. Statistical coding is a lossless coding method, which can effectively reduce the bit rate required to represent the same signal. Common statistical coding methods are Variable Length Coding (VLC) or Content Adaptive Binary Arithmetic Coding (CABAC).
[0060] FIG. 3 is an exemplary block diagram of a video decoder according to an embodiment of the present application.
[0061] 3, the video decoder 300 includes an entropy decoding unit 310, a prediction unit 320, an inverse quantization / transform unit 330, a reconstruction unit 340, a loop filtering unit 350, and a decoded image cache 360. It should be noted that the video decoder 300 may include more, fewer, or different functional components.
[0062] The video decoder 300 may receive a codestream. The entropy decoding unit 310 may parse the codestream to extract syntax elements from the codestream. As part of parsing the codestream, the entropy decoding unit 310 may parse the entropy encoded syntax elements in the codestream. The prediction unit 320, the inverse quantization / transform unit 330, the reconstruction unit 340, and the loop filtering unit 350 may decode the video data based on the syntax elements extracted from the codestream to generate decoded video data.
[0063] In some embodiments, the prediction unit 320 includes an inter-frame prediction unit 321 and an intra-frame prediction unit 322 .
[0064] The inter-frame prediction unit 321 may perform intra-frame prediction to generate a predictive block of the PU. The inter-frame prediction unit 321 may use an intra-frame prediction mode to generate a predictive block of the PU based on pixel blocks of spatially neighboring PUs. The inter-frame prediction unit 321 may also determine an intra-frame prediction mode of the PU based on one or more syntax elements parsed from the codestream.
[0065] The intra prediction unit 322 may construct a first reference image list (List 0) and a second reference image list (List 1) based on syntax elements parsed from the codestream. Furthermore, if the PU uses inter-frame predictive coding, the entropy decoding unit 310 may analyze motion information of the PU. The intra prediction unit 322 may determine one or more reference blocks of the PU based on the motion information of the PU. The intra prediction unit 322 may generate a predictive block of the PU based on the one or more reference blocks of the PU.
[0066] The inverse quantization / transform unit 330 may inverse quantize (i.e., dequantize) the transform coefficients associated with the TU. The inverse quantization / transform unit 330 may determine the degree of quantization using a QP value associated with the CU of the TU.
[0067] After dequantizing the transform coefficients, inverse quantization / transform unit 330 may apply one or more inverse transforms to the inverse quantized transform coefficients to generate a residual block associated with the TU.
[0068] The reconstruction unit 340 reconstructs a pixel block of the CU using the residual block associated with the TU of the CU and the prediction block of the PU of the CU. For example, the reconstruction unit 340 can add samples of the residual block to corresponding samples of the prediction block to reconstruct the pixel block of the CU to obtain a reconstructed image block.
[0069] The loop filtering unit 350 may perform a deblocking filtering operation to reduce the blocking effect of pixel blocks associated with a CU.
[0070] The video decoder 300 can store the reconstructed image of the CU in the decoded image cache 360. The video decoder 300 can use the reconstructed image in the decoded image cache 360 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.
[0071] The basic process of the video codec is as follows: at the encoding side, a frame of an image is divided into blocks, and for a current block, the prediction unit 210 uses intraframe prediction or interframe prediction to generate a prediction block of the current block. The residual unit 220 can calculate a residual block, i.e., a difference between the prediction block and the original block of the current block, based on the prediction block and the original block of the current block, and the residual block can also be called residual information. The residual block can remove information insensitive to human eyes through a process such as transformation and quantization by the transform / quantization unit 230 to remove visual redundancy. In some embodiments, the residual block before transformation and quantization by the transform / quantization unit 230 can be called a time domain residual block, and the time domain residual block after transformation and quantization by the transform / quantization unit 230 can be called a frequency residual block or a frequency domain residual block. The entropy coding unit 280 may receive the quantized transform coefficients output from the transform / quantization unit 230, entropy code the quantized transform coefficients, and output a code stream. For example, the entropy coding unit 280 may remove character redundancy based on a target context model and probability information of the binary code stream.
[0072] On the decoding side, the entropy decoding unit 310 can analyze the code stream to obtain prediction information, a quantization coefficient matrix, etc., of the current block, and the prediction unit 320 uses intraframe prediction or interframe prediction for the current block based on the prediction information to generate a prediction block of the current block. The inverse quantization / transform unit 330 uses the quantization coefficient matrix obtained from the code stream to perform inverse quantization and inverse transformation on the quantization coefficient matrix to obtain a residual block. The reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed block. The reconstructed block constitutes a reconstructed image, and the loop filtering unit 350 loop filters the reconstructed image based on an image or based on a block to obtain a decoded image. The encoding side also needs to perform the same operations as the decoding side to obtain a decoded image. The decoded image is also called a reconstructed image, and the reconstructed image may be a subsequent frame and is used as a reference frame for interframe prediction.
[0073] In addition, the block division information determined on the encoding side, mode information such as prediction, transformation, quantization, entropy coding, loop filtering, or parameter information, etc. are carried in the code stream as necessary. The decoding side analyzes the code stream and analyzes it based on existing information to determine the same block division information as the encoding side, mode information such as prediction, transformation, quantization, entropy coding, loop filtering, or parameter information, thereby ensuring that the decoded image obtained on the encoding side is the same as the decoded image obtained on the decoding side.
[0074] The above is the basic process of video codec in the block-based hybrid coding framework, and some modules or steps of the framework or process may be optimized with the development of technology. The present application applies to the basic process of video codec in the block-based hybrid coding framework, but is not limited to the framework or process.
[0075] In some embodiments, the embodiments of the present application may be applied to various image processing scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, driving assistance, and the like.
[0076] The following describes in detail the technical solutions of the embodiments of the present application through some embodiments. The following some embodiments can be combined with each other, and the same or similar concepts or processes may not be repeatedly described in some embodiments.
[0077] FIG. 4 is a flow chart of an image filtering method according to an embodiment of the present application. As shown in FIG. 4, the method includes the following steps:
[0078] In step S401, coding information of a target image is determined, where the coding information includes classification information of the target image, and the classification information indicates at least one of a coding image type, a coding mode of the target image.
[0079] In some embodiments, the embodiments of the present application may be applied to both the encoding side and the decoding side, that is, the execution subject of the embodiments of the present application may be the encoder in the above-mentioned Figures 1 and 2, or the decoder in Figures 1 and 3.
[0080] In some embodiments, the embodiments of the present application may also be applied to other display devices, such as a decoder sending the decoded reconstructed image to a display device, which employs the image filtering method of the embodiments of the present application to filter the reconstructed image and display the filtered image.
[0081] That is, the subject of the implementation of the embodiments of the present application is a device having an image filtering function, such as an image filtering device. The image filtering device may be an electronic device or a part of an electronic device, such as a processor in an electronic device. The electronic device may be an encoder, a decoder, a codec, a display device, etc.
[0082] For ease of explanation, the following describes the method of the embodiment of the present application using an example in which the execution subject is an electronic device.
[0083] The filter according to the embodiment of the present application is a neural network filter, i.e. a filtering model, which in some embodiments is also called a Neural Network in-Loop Filter (NNLF).
[0084] The filtering model of the embodiment of the present application can not only realize the filtering of intraframe coded images, but also realize the filtering of interframe coded images, that is, the filtering model of the embodiment of the present application is a general-purpose filtering model, and can reduce the storage cost of model parameters.
[0085] Application scenarios of the embodiments of the present application include, but are not limited to, the following scenarios.
[0086] Scene 1: As shown in Fig. 5A, the above-mentioned filtering target image is an image reconstructed by the above-mentioned reconstruction unit. That is, the loop filtering unit in the embodiment of the present application is the filtering model, and the reconstruction unit 250 in Fig. 2 inputs the reconstructed image into the filtering model in the loop filtering unit 260 to perform filtering, obtains a filtered image, and stores the filtered image in the decoded image cache. Or, the reconstruction unit 340 in Fig. 3 inputs the reconstructed image into the filtering model in the loop filtering unit 350 to perform filtering, obtains a filtered image, and stores or displays the filtered image in the decoded image cache.
[0087] Scene 2: As shown in FIG. 5B, the above-mentioned filtering target image is an image filtered by at least one of DBF, SAO, and ALF. That is, the loop filtering unit of the embodiment of the present application includes not only a conventional filter such as at least one of DBF, SAO, and ALF, but also a filtering model. The reconstruction unit 250 in FIG. 2 inputs the reconstructed image to the conventional filter in the loop filtering unit 260 to perform filtering, and further inputs the filtered image to the filtering model to perform filtering, to obtain a filtered image, and stores the filtered image in the decoded image cache. Or, the reconstruction unit 340 in FIG. 3 inputs the reconstructed image to the conventional filter in the loop filtering unit 350 to perform filtering, and further inputs the filtered image to the filtering model to perform filtering, to obtain a filtered image, and stores the filtered image in the decoded image cache or displays it.
[0088] It should be noted that the above Fig. 5B only shows one example of the combination of the conventional filter and the filtering model of the embodiment of the present application. In some scenes, the combination method of the conventional filter and the filtering model of the embodiment of the present application includes, but is not limited to, first filtering using the filtering model and then filtering using the conventional filter, or first filtering using the conventional filter, then filtering using the filtering model and then filtering using the conventional filter, or other combination methods, and the present application is not limited thereto.
[0089] Scene 3: As shown in FIG. 5C, the above-mentioned filtering target image is a display target image. For example, the reconstruction unit 340 in FIG. 3 inputs the reconstructed image to the loop filtering unit 350 to perform filtering, and stores the filtered image in the decoded image cache. The image in the decoded image cache is predicted as a reference image in the subsequent figures. For example, the prediction unit 320 reads the reference image from the decoded image cache to perform prediction. The image in the decoded image cache is also used for display, but before being used for display, it is first filtered using the filtering model of the embodiment of the present application, and then the filtered image is displayed.
[0090] As shown above in FIGS. 5A and 5B, in some embodiments, the filtered image of the present embodiment is used as a reference image for subsequent images.
[0091] As shown above in FIG. 5C, in some embodiments, the filtered image of the present embodiment is used for display and is not used as a reference image for subsequent images.
[0092] The filtering model of the embodiment of the present application is a general-purpose filtering model, and may be used for filtering intraframe coded images or interframe coded images. However, due to the difference between intraframe coding and interframe coding, in order to improve filtering accuracy, the embodiment of the present application inputs a filtering target image to the filtering model. The input indicates classification information such as a coding image type, a coding mode, etc. of the filtering target image.
[0093] In the embodiment of the present application, the coding information of the filtered image is not particularly limited and may be coding type information involved in the coding process of the filtered image.
[0094] In some embodiments, the coding information of the filtered image comprises classification information, said classification information indicating at least one of a coding image type, a coding mode of the filtered image.
[0095] The coded image types according to the embodiment of the present application include full intra-frame coded images and inter-frame codeable images.
[0096] Here, a full intra-coded image refers to the coding type of the image being entirely intra-coded, meaning that all reference information for the prediction of a full intra-coded image comes from the spatial domain information of the image.
[0097] An inter-codeable image refers to the fact that the coding type of the image may be inter-coded, which means that the prediction process of the inter-codeable image can refer to the time-domain reference information of other reference frames.
[0098] In some embodiments, the coding mode classification includes all coding modes, for example including two types of inter-frame coding modes and intra-frame coding modes.
[0099] On the encoding side, the overall coding mode can be determined according to the prediction mode used by all prediction units corresponding to the image to be filtered.For example, in the encoding process of the image to be filtered, if all prediction units corresponding to the image to be filtered use intraframe prediction mode for prediction, the overall coding mode of the image to be filtered is determined to be intraframe coding mode, and if all prediction units corresponding to the image to be filtered use interframe prediction mode for prediction, the overall coding mode of the image to be filtered is determined to be interframe coding mode.
[0100] On the decoding side, the manner of obtaining the total coding mode of the filtering target image includes at least the following two manners:
[0101] Method 1: The codestream includes the overall coding mode of the image to be filtered, and thus the decoding side decodes the codestream to obtain the overall coding mode of the image to be filtered.
[0102] Method 2: The decoding side determines the overall coding mode of the filtering target image according to the prediction mode used by all prediction units corresponding to the filtering target image. For example, in the decoding process of the filtering target image, if all prediction units corresponding to the filtering target image predict using an intraframe prediction mode, the overall coding mode of the filtering target image is determined to be an intraframe coding mode, and if all prediction units corresponding to the filtering target image predict using an interframe prediction mode, the overall coding mode of the filtering target image is determined to be an interframe coding mode.
[0103] In some embodiments, the classification of coding modes can also be embodied in coding sub-modes, which can be understood as specific coding manners of the image to be filtered, such as specific sub-modes in an intra-frame coding mode or specific sub-modes in an inter-frame coding model.
[0104] Common intraframe coding techniques include normal intraframe coding mode, MIP mode (MIP: Matrix weighted Intra Prediction), intraframe block copy technique (IBC: Intra Block Copy), intraframe string prediction technique (ISP: Intra String Prediction), palette technique (PLT: Palette), etc.
[0105] Common interframe coding techniques include a normal interframe coding mode, a motion merge mode, a motion merge and residual skip mode, a combined inter and intra prediction mode (CIIP: Combined Inter and Intra Prediction), and the like.
[0106] On the encoding side, the encoding sub-mode can be determined according to the prediction mode used by all prediction units corresponding to the image to be filtered.For example, in the encoding process of the image to be filtered, if all prediction units corresponding to the image to be filtered use normal intraframe coding mode for prediction, determine that the encoding sub-mode of the image to be filtered is normal intraframe coding mode, and if all prediction units corresponding to the image to be filtered use Merge mode for prediction, determine that the encoding sub-mode of the image to be filtered is Merge mode.
[0107] On the decoding side, the manner of obtaining the coding sub-mode of the filtering target image includes at least the following two manners:
[0108] Method 1: The codestream includes the coding sub-mode of the image to be filtered, and thus the decoding side decodes the codestream to obtain the coding sub-mode of the image to be filtered.
[0109] Method 2: The decoding side determines the coding sub-mode of the filtering target image according to the prediction mode used by all prediction units corresponding to the filtering target image. For example, in the decoding process of the filtering target image, if all prediction units corresponding to the filtering target image predict using normal intraframe coding mode, the coding sub-mode of the filtering target image is determined to be normal intraframe coding mode, and if all prediction units corresponding to the filtering target image predict using Merge mode, the coding sub-mode of the filtering target image is determined to be Merge mode.
[0110] In an embodiment of the present application, during filtering, a filtering target image and classification information indicating at least one of the encoding image type and encoding mode of the filtering target image are input to a filtering model to obtain a filtered image of the filtering target image.
[0111] In some embodiments, the classification information of the filtered image may be a matrix including multiple elements.
[0112] In some embodiments, the classification information of the filtered image is one element of data.
[0113] The process of determining the coding information of the filtering target image in the embodiment of the present application will be described in detail below with reference to a specific example.
[0114] Case 1: if the classification information indicates the coding image type of the image to be filtered, in the above step S401, the process of determining the coding information of the image to be filtered includes the following steps:
[0115] In step S401-A1, obtain coded image types corresponding to a plurality of image regions in a filtering target image, and determine that the value of the classification information is a first value if the plurality of image regions all belong to a full-frame intra-coded image.
[0116] In step S401-A2, if the plurality of image regions all belong to inter-codable images, it is determined that the value of the classification information is a second value.
[0117] In step S401-A3, if the image to be filtered crosses a slice boundary or a tile boundary, the value of the classification information is determined to be a third value, or the classification information is determined based on the respective proportions in the image to be filtered of image areas belonging to full-frame intra-coded images and image areas belonging to inter-frame codeable images among the plurality of image areas.
[0118] Specifically, the coded image in the embodiment of the present application is divided into a full intra-frame coded image and an inter-frame codable image, where the image includes a frame, a slice, and a tile, as shown in Figures 6A to 6C. When the classification information represents a coded image type, the classification information may be indicated at one of a slice level, a tile level, or a frame header level.
[0119] In practice, when using a filtering model, it is common to divide an image into sub-images, and then sequentially input the sub-images into the filtering model for filtering, rather than directly inputting an entire frame for filtering. Since the sub-images may vary in size, the image to be filtered input to the filtering model may cross a slice / tile boundary. The image to be filtered in the embodiments of the present application may be understood as one sub-image.
[0120] Based on this, in the embodiment of the present application, the classification information of the filtered image is determined based on the coded image type of the filtered image and whether the filtered image crosses a slice or tile boundary.
[0121] The multiple image regions in the above-mentioned filtered image may be all image regions in the filtered image, or a portion of the image regions in the filtered image, for example, 80% of the image regions in the filtered image.
[0122] Specifically, if all image areas within the multiple image areas of the image to be filtered belong to full intra-frame coded images, the value of the classification information is determined to be a first value, and if all image areas within the multiple image areas of the image to be filtered belong to inter-frame codeable images, the value of the classification information is determined to be a second value.
[0123] The embodiment of the present application does not limit the specific values of the first value and the second value.
[0124] In some embodiments, the first value is zero.
[0125] In some embodiments, the second value is one.
[0126] In one example, the classification information of the embodiment of the present application is one element of data. For example, if all image regions in the plurality of image regions of the image to be filtered belong to full intra-frame coded images, the value of the classification information is determined to be 1, and if all image regions in the plurality of image regions of the image to be filtered belong to inter-frame codeable images, the value of the classification information of the image to be filtered is determined to be 0.
[0127] In another example, the classification information of the embodiment of the present application is a matrix, and the matrix may be consistent with or different from the size of the image to be filtered. For example, if all of the image regions of the current image to be filtered belong to a full intra-frame coded image, the classification information is determined to be an all-zero matrix. If all of the image regions of the current image to be filtered belong to an inter-frame codeable image, the classification information is determined to be an all-one matrix.
[0128] When the to-be-filtered image crosses a slice or tile boundary, the classification information of the to-be-filtered image can be determined based on the following two schemes.
[0129] Method 1: If the image to be filtered crosses a slice boundary or a tile boundary, the value of the classification information is determined to be the third value.
[0130] In the embodiment of the present application, the specific value of the third value is not limited as long as it is a value different from the above-mentioned first value and second value.
[0131] In one example, when the above classification information is one element of data, for example, when the filtered image crosses a slice boundary or a tile boundary, the classification information is determined to be 2.
[0132] In another example, when the above classification information is a one-matrix, for example, when the filtered image crosses a slice boundary or a tile boundary, it is determined that the classification information is an all-two matrix.
[0133] Method 2: When the image to be filtered crosses a slice boundary or a tile boundary, classification information is determined based on the respective proportions in the filtered image of image areas belonging to full intra-frame coded images and image areas belonging to inter-frame codeable images among multiple image regions of the filtered image.
[0134] In the above method 2, embodiments for determining classification information based on the respective proportions in the filtered image of image areas belonging to full-frame intra-coded images and image areas belonging to inter-frame codeable images among multiple image areas of the filtered image include, but are not limited to, some of the following examples.
[0135] Example 1: If the proportion of image regions in the filtered image that belong to full-frame intra-coded images among multiple image regions of the filtered image is greater than or equal to a first threshold, the value of the classification information is determined to be a first value, and if the proportion of image regions in the filtered image that belong to full-frame intra-coded images among multiple image regions of the filtered image is less than the first threshold, the value of the classification information is determined to be a second value.
[0136] Example 2: If, among multiple image regions of the image to be filtered, the proportion in the filtered image of image regions belonging to full-frame intra-coded images is greater than or equal to a first threshold, the value of the classification information is determined to be a first value; if, among multiple image regions of the image to be filtered, the proportion in the filtered image of image regions belonging to full-frame intra-coded images is less than the first threshold and greater than or equal to a second threshold, the value of the classification information is determined to be a second value; if, among multiple image regions of the image to be filtered, the proportion in the filtered image of image regions belonging to full-frame intra-coded images is less than the second threshold, the value of the classification information is determined to be a third value.
[0137] In the embodiment of the present application, the specific values of the first threshold and the second threshold are not limited, and the first threshold is greater than the second threshold.
[0138] In some embodiments, the first threshold is greater than 50% and less than 100%.
[0139] In the above case 1, the classification information indicates the coded image type of the image to be filtered, and after the classification information is input into the filtering model, the filtering model can accurately filter the image to be filtered based on the coded image type of the image to be filtered.
[0140] Case 2: the coding mode includes an intraframe coding mode and an interframe coding mode, and the classification information indicates the coding mode of the filtering target image, and the classification information includes at least one of first classification information and second classification information. In this embodiment, the classification information is indicated at a block level.
[0141] The first classification information indicates an encoding mode corresponding to one or more pixels in the to-be-filtered image.
[0142] The second classification information indicates an encoding mode corresponding to a region of a predetermined size in the image to be filtered.
[0143] For the first classification information and the second classification information, the process of determining the coding information of the filtering target image in the case 2 includes subcases of the case 1 and the case 2, where the case 1 is the process of determining the first classification information, and the case 2 is the process of determining the second classification information.
[0144] Case 1: When the classification information includes first classification information, and the first classification information is a matrix consisting of multiple elements, each element corresponding to an encoding mode of one or more pixels in the target image, the process of determining the encoding information of the target image in the above step S401 includes the following steps:
[0145] In step S401-B, an encoding mode corresponding to one or more pixels in the to-be-filtered image is obtained, and first classification information is determined based on the encoding mode corresponding to the one or more pixels in the to-be-filtered image.
[0146] In the case 1, the first classification information is determined according to an encoding mode of one or more pixels in the filtering target image. For example, if the encoding mode of each pixel in the filtering target image is an intraframe encoding mode, the value of each matrix element in the first classification information is determined to be a first value.
[0147] In some examples, the implementation of step S401-B above includes, but is not limited to, the following examples.
[0148] Example 1: If the coding modes corresponding to all pixels in the filtering target image are intraframe coding modes, the value of each matrix element in the first classification information is determined to be a first value.
[0149] Example 2: When the coding mode corresponding to all pixels in the filtering target image is an inter-frame coding mode, the value of each matrix element in the first classification information is determined to be a second value.
[0150] Example 3: If the coding mode corresponding to one or more pixels in a first image region in the image to be filtered is an intraframe coding mode and the coding mode corresponding to one or more pixels in a second image region is an interframe coding mode, it is determined that the value of a matrix element corresponding to one or more pixels in the first image region in the first classification information is a first value and the value of a matrix element corresponding to one or more pixels in the second image region is a second value.
[0151] The embodiment of the present application does not limit the specific values of the first value and the second value.
[0152] In some embodiments, the first value is zero.
[0153] In some embodiments, the second value is one.
[0154] In one possible embodiment, the size of the first classification information is consistent with the size of the image to be filtered, that is, each matrix element in the first classification information corresponds one-to-one with each pixel in the image to be filtered. In this way, the value of the first classification information can be determined based on the encoding mode corresponding to each pixel in the image to be filtered. For example, if the encoding mode corresponding to each pixel in the image to be filtered is an intraframe encoding mode, the value of each matrix element in the first classification information is determined to be a first value (e.g., 0). If the encoding mode corresponding to each pixel in the image to be filtered is an interframe encoding mode, the value of each matrix element in the first classification information is determined to be a second value (e.g., 1). If the encoding mode corresponding to the subpixels of the first portion in the image to be filtered is an intraframe encoding mode and the encoding mode corresponding to the subpixels of the second portion is an interframe encoding mode, the value of each matrix element corresponding to the subpixels of the first portion in the first classification information is determined to be a first value (e.g., 0), and the value of each matrix element corresponding to the subpixels of the second portion is determined to be a second value.
[0155] In another possible embodiment, the size of the first classification information does not match the size of the filtered image. For example, the size of the first classification information is smaller than the size of the filtered image. Exemplarily, when the size of the filtered image is 64×64, the size of the first classification information is 64 / n×64 / m, where n and m are both positive integers. For example, the size of the first classification information is 32×32, and one matrix element in the first classification information corresponds to four pixels in the filtered image. In this way, the value of the corresponding matrix element in the first classification information can be determined based on the encoding mode corresponding to every four pixels in the filtered image.
[0156] For example, pixel 1, pixel 2, pixel 3, and pixel 4 in the filtered image correspond to matrix element 1 in the first classification information. If the coding modes corresponding to pixel 1, pixel 2, pixel 3, and pixel 4 are all intraframe coding modes, the value of matrix element 1 in the first classification information is determined to be a first value. If the coding modes corresponding to pixel 1, pixel 2, pixel 3, and pixel 4 are all interframe coding modes, the value of matrix element 1 in the first classification information is determined to be a second value. If the coding modes corresponding to most of pixels of pixel 1, pixel 2, pixel 3, and pixel 4 are interframe coding modes, the value of matrix element 1 in the first classification information is determined to be a second value. If the coding modes corresponding to most of pixels of pixel 1, pixel 2, pixel 3, and pixel 4 are intraframe coding modes, the value of matrix element 1 in the first classification information is determined to be a first value.
[0157] Case 2: If the classification information includes second classification information, the process of determining the coding information of the filtering target image in the above step S401 includes the following steps:
[0158] In step S401-C, second classification information is determined based on the proportions in the filtered image of image regions that correspond to different encoding modes in the filtered image.
[0159] In the case 2, the second classification information can be determined based on the proportion (or ratio) of image regions in the filtering target image that correspond to different coding modes in the filtering target image. For example, if the image region in the filtering target image that corresponds to the intraframe coding mode is larger than the image region that corresponds to the interframe coding mode, the value of the second classification information is determined to be the first value.
[0160] In some examples, the implementation of step S401-C above includes, but is not limited to, the following forms.
[0161] Form 1: If the proportion of image regions in the filtered image that correspond to the intraframe coding mode is greater than or equal to a first predetermined threshold, the value of the second classification information is determined to be a first value, and if the proportion of image regions in the filtered image that correspond to the intraframe coding mode is less than the first predetermined threshold, the value of the second classification information is determined to be a second value.
[0162] In some embodiments, the second classification information is a value of one element, for example, 0 or 1. For example, if the proportion of image regions in the filtered image that correspond to an intraframe coding mode is greater than or equal to a first predetermined threshold, the value of the second classification information is determined to be 0; if the proportion of image regions in the filtered image that correspond to an intraframe coding mode is greater than or equal to a first predetermined threshold, the value of the second classification information is determined to be 1.
[0163] In some embodiments, the second classification information is a matrix. For example, if the proportion of image regions in the filtered image that correspond to an intraframe coding mode is greater than or equal to a first predetermined threshold, the second classification information is determined to be an all-zero matrix, and if the proportion of image regions in the filtered image that correspond to an intraframe coding mode is less than the first predetermined threshold, the second classification information is determined to be an all-one matrix.
[0164] The embodiment of the present application does not limit the specific value of the first threshold value.
[0165] In some embodiments, the first predetermined threshold is 80%.
[0166] For example, if an image region corresponding to the intraframe coding mode in the filtering target image is greater than or equal to 80% of the filtering target image size, the value of the second classification information is determined to be 0 (if the second classification information is a matrix, the value of each element in the second classification information is 0). If an image region corresponding to the intraframe coding mode in the filtering target image is smaller than 80% of the filtering target image size, the value of the second classification information is determined to be 1 (if the second classification information is a matrix, the value of each element in the second classification information is 1).
[0167] Form 2: If, in the image to be filtered, the proportion in the filtered image of an image region corresponding to the intraframe coding mode is greater than or equal to a first predetermined threshold, the value of the second classification information is determined to be a first value; if, in the image to be filtered, the proportion in the filtered image of an image region corresponding to the intraframe coding mode is smaller than the first predetermined threshold and greater than or equal to a second predetermined threshold (the second predetermined threshold is smaller than the first predetermined threshold), the value of the second classification information is determined to be a second value; if, in the image to be filtered, the proportion in the filtered image of an image region corresponding to the intraframe coding mode is smaller than the second predetermined threshold, the value of the second classification information is determined to be a third value.
[0168] The embodiment of the present application does not limit the specific values of the first value, the second value, and the third value.
[0169] In some embodiments, the first value is zero.
[0170] In some embodiments, the second value is one.
[0171] In some embodiments, the third value is two.
[0172] The embodiment of the present application does not limit the specific values of the first and second predetermined thresholds.
[0173] In some embodiments, the first predetermined threshold is 80%.
[0174] In some embodiments, the second predetermined threshold is 60%.
[0175] For example, if an image region corresponding to the intraframe coding mode in the filtering target image is greater than or equal to 80% of the filtering target image size, the value of the second classification information is determined to be 0 (if the second classification information is a matrix, the value of each element in the second classification information is 0). If an image region corresponding to the intraframe coding mode in the filtering target image is smaller than 80% of the filtering target image size and greater than or equal to 60% of the filtering target image size, the value of the second classification information is determined to be 1 (if the second classification information is a matrix, the value of each element in the second classification information is 1). If an image region corresponding to the intraframe coding mode in the filtering target image is smaller than 60% of the filtering target image size, the value of the second classification information is determined to be 2 (if the second classification information is a matrix, the value of each element in the second classification information is 2).
[0176] In the second case, the classification information indicates an encoding mode of the filtering target image, which can be understood as an overall encoding mode of the filtering target image, such as an intraframe encoding mode or an interframe encoding mode. After the classification information is input to the filtering model, the filtering model can accurately filter the filtering target image based on the encoding mode of the filtering target image to improve the filtering effect.
[0177] Case 3: The coding mode of the filtering target image includes at least one of a normal intraframe coding mode, a MIP mode, an IBC mode, an ISP mode, a PLT mode, a normal interframe coding mode, a Skip mode, a Merge mode, and a CIIP mode. In this case, if the classification information indicates the coding mode of the filtering target image, the classification information is indicated at a block level. If the classification information indicates the coding mode of the filtering target image, the process of determining the coding information of the filtering target image in the above step S401 includes the following steps:
[0178] In step S401-D, encoding modes corresponding to a plurality of image regions in the filtering target image are obtained, and classification information is determined based on the encoding modes corresponding to each image region in the filtering target image.
[0179] In the embodiment of the present application, one image region of the filtering target image may be one pixel, may be several consecutive pixels, or may be one coding block. In the embodiment of the present application, by obtaining coding modes corresponding to the plurality of image regions in the filtering target image, the classification information of the filtering target image is determined according to the coding modes corresponding to the plurality of image regions in the filtering target image. For example, when the coding modes corresponding to the plurality of image regions in the filtering target image are normal intraframe coding modes, the value of the classification information is determined to be a first value.
[0180] In some embodiments, the classification information can be determined based on the index of the coding mode. That is, the above step S401-D includes the following steps: in step S401-D1, determine the index of the coding mode corresponding to a plurality of image regions in the image to be filtered; in step S401-D2, determine the classification information based on the index of the coding mode corresponding to a plurality of image regions in the image to be filtered.
[0181] In some embodiments, one coding mode corresponds to one index, and different index values are pre-set for normal intra-frame coding mode, MIP mode, IBC mode, ISP mode, PLT mode, normal inter-frame coding mode, skip mode, merge mode, and CIIP mode. Based on this, the classification information can be determined according to the index of the coding mode corresponding to each image region in the image to be filtered. For example, when the coding modes corresponding to each image region in the image to be filtered are all normal intra-frame coding modes, and the index value of the normal intra-frame coding mode is 0, the classification information is determined to be a 0 value or an all-0 matrix.
[0182] In some embodiments, multiple coding modes correspond to one index. For example, the index value of the normal intraframe coding mode is 0, the index values of the MIP mode, IBC mode, ISP mode, and PLT mode are 1, the index value of the normal interframe coding mode is 2, the index values of the skip mode and the merge mode are 3, and the index value of the CIIP mode is 4. Based on this, the classification information can be determined based on the indexes of the coding modes corresponding to multiple image regions in the filtering target image. For example, the coding modes corresponding to the first region in the filtering target image are the skip mode and the merge mode, and the coding mode corresponding to the second region is the normal interframe coding mode. In this way, the value of the element corresponding to the first region in the classification information is 3, and the value of the element corresponding to the second region in the coding mode indication information is 2. In this case, the classification information is a matrix.
[0183] In the above cases 1 to 3, the coding image type and coding scheme of the filtering target image indicated by the classification information have been described.
[0184] In some embodiments, the classification information may indicate the coded image type and coding mode described in the above cases 1 to 3 by three matrices. Exemplarily, matrix A indicates the coded image type of the filtering target image, and specifically, the value of matrix A is determined according to the description of the above case 1. Matrix B indicates whether the coding mode of the filtering target image is an intraframe coding mode, an interframe coding mode, or a coexistence of the intraframe coding mode and the interframe coding mode, and specifically, the value of matrix B is determined according to the description of the above case 2. Matrix C indicates the coding mode used for the filtering target image, for example, whether the intraframe coding mode or the interframe coding mode is used, and specifically, the value of matrix C is determined according to the description of the above case 3.
[0185] When the classification indication information indicates both the encoding image type and the encoding mode, the classification information includes at least one of matrix A, matrix B, and matrix C.
[0186] For example, when the classification indication information indicates an encoding image type but does not indicate an encoding mode, the classification information may not include matrix B and matrix C, but may only include matrix A.
[0187] Exemplarily, when the classification indication information does not indicate the encoding image type but indicates the encoding mode, the classification information does not include matrix A, but includes at least one of matrix B and matrix C.
[0188] In some embodiments, according to the actual situation, the above matrix may be data having only one element.
[0189] In the embodiment of the present application, according to the above method, after the classification information of the filtering target image is determined, the following step S402 is executed.
[0190] In step S402, the target image to be filtered and the classification information of the target image to be filtered are input into a same deep learning-based filtering model, and the filtering model filters the target image to be filtered based on the classification information to obtain a filtered image.
[0191] The filtering model of the embodiment of the present application is a general model based on deep learning, and in order to improve the prediction accuracy of the model, in addition to inputting the filtering target image into the filtering model, as shown in FIG. 7A, the classification information of the filtering target image is further input into the filtering model. That is, by introducing the coding type auxiliary information as the input of the filtering model, it is possible to avoid the degradation of filtering performance caused by using the same filter to process images with many features (simultaneous processing of images including intraframe coding mode and interframe coding mode), and provide more precise image information to the image. This can improve the filtering effect when filtering each image region of the filtering target image based on the classification information of the filtering target image.
[0192] The embodiments of the present application are not limited to a specific network structure of the filtering model, and FIG. 7A is merely an example.
[0193] In some embodiments, in the above step S402, the process of inputting the target image and the classification information of the target image into a same deep learning-based filtering model includes the following steps: In step S402-A, at least one of the target image and the classification information is pre-processed and then input into the filtering model.
[0194] Preprocessing example 1: After merging the layers of the image to be filtered and the classification information, they are input to the filtering model.
[0195] As an example, layer merging is realized by the concatenation operation of DenseNet, and DenseNet is used to merge channels. As an example of layer merging, one classification information channel is newly added to record classification information based on the grayscale data of three channels (red, green, and blue) contained in the filtered image. As a result, the filtered image after merging contains data of four channels.
[0196] Preprocessing example 2: The image to be filtered is multiplied by classification information and then input to the filtering model.
[0197] As an example of multiplication, it can be realized by dot multiplication: the grayscale data of each channel (red, green, blue) of each pixel of the image to be filtered is multiplied by the embedding vector representation of the classification information, respectively, and the resulting grayscale data of the three channels is used as the input of the filtering model.
[0198] Pre-processing example 3: As shown in FIG. 7B, the image to be filtered and the classification information are multiplied (for example, the point multiplication mentioned above) and then input to a first feature extraction unit to obtain first feature information after fusing the image to be filtered and the classification information; the image to be filtered is input to a second feature extraction unit for feature extraction to obtain second feature information of the image to be filtered; and the first feature information and the second feature information are input to a filtering model to obtain a filtered image of the image to be filtered.
[0199] The embodiment of the present application does not limit the specific network structure of the filtering model, and FIG. 7B is merely an example. The embodiment of the present application does not limit the specific network structure of the first feature extraction unit and the second feature extraction unit. Illustratively, as shown in FIG. 7B, the first feature extraction unit includes one convolution layer conv (step length S=1) and one activation function (prelu activation function), and the second feature extraction unit also includes one convolution layer (step length S=1) and one activation function (prelu function). In some embodiments, the activation function may be other types of activation functions, such as relu activation function, in addition to the prelu activation function shown in FIG. 7B, and the embodiment of the present application is not limited thereto. The structure of the second feature extraction unit may be the same as that of the first feature extraction unit.
[0200] In some embodiments, in the above step S402, the process of inputting the target image and the classification information of the target image into a deep learning-based identical filtering model includes the following steps: In step S402-B, input at least one of a predicted image corresponding to the target image, a quantization parameter, and block division information, and the target image and the classification information into the filtering model, where the predicted image is a predicted image corresponding to the current target image and is formed by stitching each predicted block.
[0201] The block division information is a block division image corresponding to the current filtering target image. There are two generation methods. The first method is to assign different values to the block division boundary and the non-block division boundary, and the second method is to fill the area (coding unit) in each block division boundary with the average value of the filtering target image in the current area.
[0202] The quantization parameters include at least one of a sequence level quantization parameter and a slice level quantization parameter. The sequence level quantization parameter is a quantization parameter that operates on the current sequence (such as all frames, slices, and tiles), and other quantization parameters are obtained by adding an offset based on it. The slice level quantization parameter is a quantization parameter that operates on the current slice.
[0203] In one example, at least one of a predicted image, a quantization parameter, and block division information corresponding to the image to be filtered is combined with the image to be filtered and classification information, and then input into a filtering model to obtain a filtered image of the image to be filtered.
[0204] In another example, step S402-B includes the following steps: in step S402-B1, a predicted image is input to a first processing unit to obtain feature information of the predicted image; in step S402-B2, a filtering target image is input to a second processing unit to obtain feature information of the filtering target image; in step S402-B3, at least one of the feature information of the predicted image, the quantization parameter, and the block division information, and the feature information and classification information of the filtering target image are input to a filtering model to obtain a filtered image of the filtering target image.
[0205] In the embodiment of the present application, first, a predicted image corresponding to a filtering target image is input to a first processing unit to obtain feature information of the predicted image. The filtering target image is input to a second processing unit to obtain feature information of the filtering target image. As shown in FIG. 7C, at least one of the feature information of the predicted image, the quantization parameter, and the block division information, and the feature information and classification information of the filtering target image are input to a filtering model to obtain a filtered image of the filtering target image.
[0206] The embodiment of the present application does not limit the specific network structure of the first processing unit, the second processing unit and the filtering model. Exemplarily, as shown in FIG. 7C, the first processing unit includes one convolution layer and one activation function. Exemplarily, as shown in FIG. 7C, the second processing unit includes one convolution layer and one activation function.
[0207] In some embodiments, the above activation function may be other types of activation functions in addition to the prelu activation function shown in FIG. 7C, and the embodiments of the present application are not limited thereto.
[0208] The network structure of the filtering model in the embodiment of the present application may be other structures in addition to the structures shown in FIGS. 7A to 7C, and the present application does not limit the specific network structure of the filtering model.
[0209] In some embodiments, at least one of the feature information, quantization parameter, and block division information of the predicted image is fused with the feature information and classification information of the image to be filtered, and then input into the filtering model.
[0210] For example, in FIG. 7C, the feature information of the predicted image, the quantization parameter, the feature information of the filtering target image, and the classification information are merged and then input into the filtering model.
[0211] In another example, in FIG. 7C, the feature information of the predicted image, the quantization parameter, the feature information of the filtering target image and the classification information are multiplied and then input into the filtering model.
[0212] In some embodiments, referring to Figures 7A-7C, the filtering model of the embodiment of the present application includes a network structure of the filtering model, which includes the following structures connected in sequence: a convolution layer (step length s = 1), an activation function (prelu activation function), N residual blocks (N is a positive integer), a convolution layer (step length s = 1) and an upsampling layer. The network structures of the above N residual blocks may be the same or different.
[0213] In some embodiments, the number of input channels and the number of output channels of each convolutional layer included in at least one of the N residual blocks are the same.
[0214] Exemplarily, as shown in FIG. 8A , at least one of the N residual blocks includes a 1x1 convolutional layer and a 3x3 convolutional layer, and the number of input channels of the 1x1 convolutional layer and the 3x3 convolutional layer is equal to the number of output channels.
[0215] In some embodiments, an attention layer may be added based on the residual block shown in Figure 8A. For example, a Convolutional Block Attention Module (CBAM) is added as shown in Figure 8B.
[0216] In some embodiments, the number of input channels and the number of output channels of each convolutional layer included in at least one of the N residual blocks are different.
[0217] Exemplarily, as shown in FIG. 8C, at least one of the N residual blocks includes one 1x1 convolution layer and one 3x3 convolution layer, and the number of input channels of the 1x1 convolution layer and the 3x3 convolution layer is not equal to the number of output channels. For example, the number of channels may be increased before the activation function and decreased after the activation function. That is, the number of input channels and the number of output channels of the first 1x1 convolution layer are 64 and 192, respectively, the number of input channels and the number of output channels of the second 1x1 convolution layer are 192 and 64, respectively, and the number of input channels and the number of output channels of the third 3x3 convolution layer are 64 and 64, respectively.
[0218] In some embodiments, an attention layer may be added based on the residual block as shown in Figure 8C, for example, a Convolutional Block Attention Module (CBAM) is added as shown in Figure 8D.
[0219] 7A to 8D are merely schematic diagrams of the network structure of the filtering model according to the present application. The network structure of the filtering model according to the embodiment of the present application includes, but is not limited to, those shown in the above-mentioned FIGS. 7A to 8D. The specific network parameters shown in the above-mentioned FIGS. 7A to 8D are also merely examples, and the embodiment of the present application is not limited to these.
[0220] The filtering model of the embodiment of the present application can realize filtering of the filtering target image in intraframe coding mode, and can also realize filtering of the filtering target image in interframe coding mode. This corresponds to a universal filtering model as the filtering target image in different modes, and compared with constructing corresponding filtering models for different modes respectively, the storage space occupancy rate of model parameters is greatly reduced, and the storage cost of model parameters is low. In addition, by combining classification information with the filtering model and performing differential filtering on the filtering target image, the filtering target image in different modes can be applied, and the filtering effect of the filtering target image can be improved.
[0221] Above is a detailed description of the image filtering method according to the embodiment of the present application. Before using a filtering model to perform the above image filtering, the filtering model needs to be trained first. The following describes the filtering model training process.
[0222] As shown in FIG. 9, the training process of the filtering model in the embodiment of the present application includes the following steps:
[0223] Step 901: Generation of a data set.
[0224] Generate a training set using the (Codec) software.
[0225] It should be noted that the training images included in the training set include images in intraframe coding mode and also images in interframe coding mode.
[0226] Additionally, the training set further includes coding information for each training image, where the coding information includes classification information, and the classification information indicates at least one of a coding image type and a coding mode of the training image.
[0227] Step 902: Training the model.
[0228] The training set is used to train a filtering model, specifically, the above training image and classification information of the training image are input into the filtering model to train the filtering model, and a training filtering model is obtained.
[0229] In the model training process, a loss function is used. The loss function measures the difference between the predicted value and the actual value. A larger loss value represents a larger difference, and the goal of training is to reduce the loss. The loss functions in the embodiment of the present application include an L1 norm loss function, an L2 norm loss function, and a smooth L1 loss function.
[0230] In practice, when using a filtering model, it is common to divide an image into sub-images and then sequentially input the sub-images into the filtering model for filtering, rather than directly inputting an entire frame for filtering. Since the sub-images can be of different sizes, the image to be filtered that is input to the filtering model may cross slice / tile boundaries.
[0231] Based on this, in some embodiments, in addition to inputting the training image and the classification information of the training image into the filtering model, at least one of a predicted image corresponding to the training image, a quantization parameter, and block division information is further input into the filtering model, so that the filtered image can learn more information of the training image, thereby improving the filtering effect of the model.
[0232] Step 903: Software integration.
[0233] The trained filtering model is integrated into the software for filtering, for example, the trained filtering model is integrated into the encoder and / or decoder to filter the reconstructed image, thereby improving the reconstruction effect.
[0234] 4 to 9 are merely illustrative of the embodiments of the present application and should not be construed as limiting the embodiments of the present application.
[0235] Thus, the preferred embodiments of the embodiments of the present application have been described above with reference to the drawings, but the present application is not limited to the specific details in the above embodiments. Within the scope of the technical concept of the embodiments of the present application, various simple modifications can be made to the technical solutions of the embodiments of the present application, and all of these simple modifications belong to the protection scope of the embodiments of the present application. For example, each specific technical feature described in the above specific embodiments can be combined in any suitable manner without contradiction, and in order to avoid unnecessary repetition, the present application does not describe various possible combinations. In another example, various different embodiments of the embodiments of the present application can also be combined arbitrarily, and as long as it does not violate the idea of the embodiments of the present application, such combinations should also be considered as the contents disclosed in the present application.
[0236] Thus, the method according to the embodiment of the present application will be described in detail with reference to FIGS. 4 to 12, and the apparatus according to the embodiment of the present application will be described in detail below.
[0237] 10 is a schematic diagram showing a configuration of an image filtering device according to an embodiment of the present application. The image filtering device 10 includes a determining unit 11 configured to determine coding information of a filtering target image, the coding information including classification information of the filtering target image, the classification information indicating at least one of a coding image type and a coding mode of the filtering target image, and a filtering unit 12 configured to input the filtering target image and the classification information into a same deep learning-based filtering model, and have the filtering model filter the filtering target image based on the classification information to obtain a filtered image.
[0238] In some embodiments, the coded image type includes full intra-frame coded images and inter-frame codeable images, and when the classification information indicates the coded image type of the image to be filtered, in some embodiments, the above classification information is indicated at a slice level, an image block level, or an image header level.
[0239] In this case, the determination unit 11 is specifically configured to obtain coded image types corresponding to multiple image regions in the image to be filtered, and determine that the value of the classification information is a first value if all of the multiple image regions belong to the full intra-frame coded image, determine that the value of the classification information is a second value if all of the multiple image regions belong to the inter-frame codeable image, and determine that the value of the classification information is a third value if the image to be filtered crosses a slice boundary or a tile boundary, or determine the value of the classification information based on the respective proportions in the image to be filtered of the image regions belonging to the full intra-frame coded image and the image regions belonging to the inter-frame codeable image among the multiple image regions.
[0240] In some embodiments, the determination unit 11 is specifically configured to determine that the value of the classification information is the first value when a proportion of image areas in the filtered image that belong to the full-frame intra-coded image among a plurality of image regions of the filtered image is greater than or equal to a first threshold, and to determine that the value of the classification information is the second value when a proportion of image areas in the filtered image that belong to the full-frame intra-coded image among a plurality of image regions of the filtered image is less than the first threshold.
[0241] In some embodiments, the determination unit 11 is specifically configured to determine that the value of the classification information is the first value when a proportion of image areas in the filtered image that belong to the full-frame intra-coded image among the multiple image regions of the filtered image is greater than or equal to a first threshold, to determine that the value of the classification information is the second value when a proportion of image areas in the filtered image that belong to the full-frame intra-coded image among the multiple image regions of the filtered image is smaller than the first threshold and greater than or equal to a second threshold, and to determine that the value of the classification information is the third value when a proportion of image areas in the filtered image that belong to the full-frame intra-coded image among the multiple image regions of the filtered image is smaller than the second threshold.
[0242] In some embodiments, the coding modes include an intraframe coding mode and an interframe coding mode, and when the classification information indicates a coding mode of a filtered image, the classification information includes at least one of first classification information and second classification information, the first classification information indicating a coding mode corresponding to one or more pixels in the filtered image, and the second classification information indicating a coding mode corresponding to a predetermined size region in the filtered image. In some embodiments, the classification information is indicated at a block level.
[0243] In some embodiments, when the classification information includes the first classification information, and the first classification information is a matrix consisting of multiple elements, each element in the matrix corresponding to an encoding mode of one or more pixels in the filtered image, the determination unit 11 is specifically configured to obtain encoding modes corresponding to one or more pixels in the filtered image, and determine the first classification information based on the encoding modes corresponding to the one or more pixels in the filtered image.
[0244] In some embodiments, the determination unit 11 is specifically configured to determine that if an encoding mode corresponding to all pixels in the filtered image is the intra-frame encoding mode, the value of each matrix element in the first classification information is a first value, and if an encoding mode corresponding to all pixels in the filtered image is the inter-frame encoding mode, the value of each matrix element in the first classification information is a second value, and if an encoding mode corresponding to one or more pixels in a first image region in the filtered image is the intra-frame encoding mode and an encoding mode corresponding to one or more pixels in a second image region is the inter-frame encoding mode, the value of a matrix element corresponding to one or more pixels in the first image region in the first classification information is the first value and the value of a matrix element corresponding to one or more pixels in the second image region is the second value.
[0245] In some embodiments, when the classification information includes the second classification information, the determination unit 11 is specifically configured to determine the second classification information based on a proportion in the filtered image of image areas that correspond to different encoding modes in the filtered image.
[0246] In some embodiments, the determination unit 11 is specifically configured to determine that the value of the second classification information is a first value if the proportion of image areas in the filtered image that correspond to the intraframe coding mode in the filtered image is greater than or equal to a first predetermined threshold, and to determine that the value of the second classification information is a second value if the proportion of image areas in the filtered image that correspond to the intraframe coding mode in the filtered image is less than the first predetermined threshold.
[0247] In some embodiments, the determination unit 11 is specifically configured to determine that the value of the second classification information is a first value if the proportion of image areas in the filtered image corresponding to the intraframe coding mode in the filtered image is greater than or equal to a first predetermined threshold, to determine that the value of the second classification information is a second value if the proportion of image areas in the filtered image corresponding to the intraframe coding mode in the filtered image is smaller than the first predetermined threshold and greater than or equal to a second predetermined threshold, and to determine that the value of the second classification information is a third value if the proportion of image areas in the filtered image corresponding to the intraframe coding mode in the filtered image is smaller than the second predetermined threshold.
[0248] In some embodiments, the encoding mode includes at least one of a normal intraframe encoding mode, a matrix weighted intraframe prediction (MIP) mode, an intraframe block duplication (IBC) mode, an intraframe string prediction (ISP) mode, a palette (PLT) mode, a normal interframe encoding mode, a skip mode, a motion merge mode, and a combined inter and intraframe prediction (CIIP) mode, and when the classification information indicates the encoding mode of the image to be filtered, in some embodiments, the classification information is indicated at the block level.
[0249] In this case, the determination unit 11 is specifically configured to obtain encoding modes corresponding to multiple image regions in the filtered image, and determine the classification information based on the encoding modes corresponding to the multiple image regions in the filtered image.
[0250] In some embodiments, the determination unit 11 is specifically configured to determine indices of encoding modes corresponding to a plurality of image regions in the filtered image, and to determine the classification information based on the indices of encoding modes corresponding to a plurality of image regions in the filtered image.
[0251] In some embodiments, one coding mode corresponds to one index, or multiple coding modes correspond to one index.
[0252] In some embodiments, the filtering unit 12 is specifically configured to pre-process at least one of the to-be-filtered image and the classification information before inputting them into the filtering model.
[0253] In some embodiments, the filtering unit 12 is specifically configured to input the target image and the classification information into the filtering model after layer merging.
[0254] In some embodiments, the filtering unit 12 is specifically configured to multiply the image to be filtered and the classification information, and then input them to a first feature extraction unit to obtain first feature information after fusing the image to be filtered and the classification information, input the image to be filtered to a second feature extraction unit to perform feature extraction to obtain second feature information of the image to be filtered, and input the first feature information and the second feature information to the filtering model.
[0255] In some embodiments, the filtering unit 12 is specifically configured to input at least one of a predicted image, a quantization parameter, and block division information corresponding to the image to be filtered, the image to be filtered, and the classification information into the filtering model.
[0256] In some embodiments, the filtering unit 12 is specifically configured to input the predicted image to a first processing unit to obtain feature information of the predicted image, input the image to be filtered to a second processing unit to obtain feature information of the image to be filtered, and input at least one of the feature information of the predicted image, the quantization parameter, and the block division information, and the feature information and the classification information of the image to be filtered to the filtering model.
[0257] In some embodiments, the quantization parameter includes at least one of a sequence level quantization parameter and a slice level quantization parameter.
[0258] In some embodiments, the filtering model includes N residual blocks, where N is a positive integer.
[0259] In some embodiments, the number of input channels and the number of output channels of each convolutional layer included in at least one of the N residual blocks are the same, or the number of input channels and the number of output channels of each convolutional layer included in at least one of the N residual blocks are different.
[0260] In some embodiments, at least one residual block of the N residual blocks comprises a layer of interest.
[0261] In some embodiments, the filtered image is used as a reference image for a subsequent image, or the filtered image is used for display and is not used as a reference image for a subsequent image.
[0262] It should be noted that the device embodiment and the method embodiment correspond to each other, and similar descriptions can be referred to the method embodiment. In order to avoid repetition, the description will not be repeated here. Specifically, the device 10 shown in FIG. 10 can execute the above method embodiment, and the above operations and other operations and / or functions of each module in the device 16 are respectively used to realize the above method embodiment, and the description will not be repeated here for the sake of brevity.
[0263] Thus, the apparatus of the embodiment of the present application has been described in terms of functional modules with reference to the drawings. It should be noted that the functional modules may be implemented in the form of hardware, or may be implemented by instructions in the form of software, or may be implemented by a combination of hardware modules and software modules. Specifically, each step of the method embodiment in the embodiment of the present application may be completed by a hardware integrated logic circuit in a processor and / or instructions in the form of software, and the steps of the method disclosed in the embodiment of the present application may be completed by a hardware decoding processor, or may be completed by a combination of hardware and software modules in a decoding processor. Optionally, the software module may be located in a conventional storage medium such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the above method embodiment in combination with the hardware.
[0264] 11 is an exemplary block diagram of an electronic device according to an embodiment of the present application, which may be the image filtering device described above, or a video encoder, or a video decoder.
[0265] 11, the electronic device 40 may include a memory 41 and a processor 42, where the memory 41 is configured to store a computer program and transmit the program code to the processor 42. In other words, the processor 42 can realize the method in the embodiment of the present application by calling and executing the computer program from the memory 41. For example, the processor 42 may be configured to execute the above embodiment of the method according to instructions in the computer program.
[0266] In some embodiments of the present application, the processor 42 may include, but is not limited to, a general purpose computer, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or the like.
[0267] In some embodiments of the present application, the memory 41 may include, but is not limited to, volatile memory and / or non-volatile memory, where the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory, and the volatile memory may be a random access memory (RAM) used as an external cache. By way of illustrative but non-limiting example, RAM may come in many forms, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct memory bus random access memory (DR RAM).
[0268] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 41 and executed by the processor 42 to complete the method provided by the embodiments of the present application. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, and the instruction segments are used to describe the execution process of the computer program in the video production device.
[0269] As shown in Fig. 11, the electronic device 40 may further include a transceiver 43, which may be connected to the processor 42 or memory 41. Here, the processor 42 may control the transceiver 43 to communicate with other devices, specifically, to transmit information or data to other devices or receive information or data transmitted by other devices. The transceiver 43 may include a transmitter and a receiver. The transceiver 43 may further include one or more antennas.
[0270] The components of the video production device are connected by a bus system, which includes a power bus, a control bus, and a status signal bus in addition to a data bus.
[0271] The present application further provides a computer-readable storage medium, the computer-readable storage medium storing a computer program, the computer program being executed by an electronic device to cause the electronic device to perform the method in the above method embodiment. Alternatively, the present application further provides a computer program product including instructions, the instructions being executed by a computer to cause the electronic device to perform the method in the above method embodiment.
[0272] Modules described as separate parts may or may not be physically separated, and parts shown as modules may or may not be physical modules, located in one place or distributed across multiple network units. According to actual needs, some or all of the parts therein may be selected to achieve the objective of the technical solution in the present embodiment. For example, each functional module in each embodiment of the present application may be integrated into one processing module, or each unit may exist physically separately, or two or more modules may be integrated into one module.
[0273] The above content is only a specific embodiment of the present application, and the protection scope of the present application is not limited thereto. Any modifications or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. 1. A method for filtering an image, comprising: determining coding information of a target image, the coding information including classification information of the target image, the classification information indicating at least one of a coding image type, a coding mode of the target image; inputting the target image and the classification information into a same deep learning-based filtering model, and causing the filtering model to filter the target image based on the encoding information to obtain a filtered image.
2. The coded image type includes a full intra-frame coded image and an inter-frame codable image, and when the classification information indicates a coded image type of the filtered image, the step of determining coding information of the filtered image includes: obtaining coded image types corresponding to a plurality of image regions in the to-be-filtered image; determining that a value of the classification information is a first value if all of the image regions belong to the full-frame intra-coded image; determining that the value of the classification information is a second value if all of the image regions belong to the inter-frame codable image; determining that the value of the classification information is a third value if the filtered image crosses a slice or tile boundary, or determining the value of the classification information based on the respective proportions of image regions in the filtered image that belong to the full intra-frame coded image and that belong to the inter-frame codeable image among the plurality of image regions, The image filtering method according to claim 1 .
3. The step of determining the classification information based on the respective proportions of the image regions belonging to the full intra-frame coded image and the image regions belonging to the inter-frame codeable image among the plurality of image regions in the filtering target image, determining that a value of the classification information is the first value when a proportion of image regions in the filtered image that belong to the full-frame intra-coded image among the plurality of image regions is greater than or equal to a first threshold value; determining that a value of the classification information is the second value when a ratio of an image region belonging to the full-frame intra-coded image among the plurality of image regions in the filtering target image is smaller than the first threshold value; The image filtering method according to claim 2.
4. The step of determining a value of the classification information based on a proportion of the image area belonging to the full intra-frame coded image and the image area belonging to the inter-frame codeable image among the plurality of image areas in the filtering target image, determining that a value of the classification information is the first value when a proportion of image regions in the filtered image that belong to the full-frame intra-coded image among the plurality of image regions is greater than or equal to a first threshold value; determining that a value of the classification information is the second value when a ratio of image regions belonging to the full-frame intra-coded image among the plurality of image regions in the filtering target image is smaller than the first threshold value and is greater than or equal to a second threshold value; determining that a value of the classification information is the third value when a ratio of an image region belonging to the full-frame intra-coded image among the plurality of image regions in the filtering target image is smaller than the second threshold value; The image filtering method according to claim 2.
5. The classification information is indicated at a slice level, an image block level, or an image header level. The image filtering method according to claim 2.
6. the coding mode includes an intraframe coding mode and an interframe coding mode, and when the classification information indicates a coding mode of a filtering target image, the classification information includes at least one of first classification information and second classification information; the first classification information indicates an encoding mode corresponding to one or more pixels in the filtered image, and the second classification information indicates an encoding mode corresponding to a predetermined size region in the filtered image. The image filtering method according to claim 1 .
7. When the classification information includes the first classification information, the step of determining coding information of the filtering target image includes: obtaining an encoding mode corresponding to one or more pixels in the to-be-filtered image; determining first classification information in the coding information based on a coding mode corresponding to one or more pixels in the filtered image; the first classification information is a matrix of elements, each element of the matrix corresponding to an encoding mode of one or more pixels in the filtered image; The image filtering method according to claim 6.
8. Determining the first classification information based on an encoding mode corresponding to one or more pixels in the filtered image further comprises: determining that, when a coding mode corresponding to all pixels in the filtered image is the intra-frame coding mode, a value of each matrix element in the first classification information is a first value; determining that a value of each matrix element in the first classification information is a second value when a coding mode corresponding to all pixels in the filtered image is the inter-frame coding mode; determining, when an encoding mode corresponding to one or more pixels in a first image region in the filtered image is the intraframe encoding mode and an encoding mode corresponding to one or more pixels in a second image region is the interframe encoding mode, that values of matrix elements corresponding to one or more pixels in the first image region in the first classification information are the first value and that values of matrix elements corresponding to one or more pixels in the second image region are the second value. The image filtering method according to claim 7.
9. When the classification information includes the second classification information, the step of determining coding information of the filtering target image includes: determining the second classification information based on a proportion in the filtered image of image regions corresponding to different encoding modes in the filtered image; The image filtering method according to claim 6.
10. The step of determining the second classification information based on a proportion in the filtered image of image regions corresponding to different encoding modes in the filtered image, determining that a value of the second classification information is a first value if a proportion of an image area in the filtered image that corresponds to the intraframe coding mode in the filtered image is greater than or equal to a first predetermined threshold; determining that a value of the second classification information is a second value if a ratio of an image region in the filtered image that corresponds to the intraframe coding mode in the filtered image is smaller than the first predetermined threshold value; The image filtering method according to claim 9.
11. The step of determining the second classification information based on a proportion in the filtered image of image regions corresponding to different encoding modes in the filtered image, determining that a value of the second classification information is a first value if a proportion of an image area in the filtered image that corresponds to the intraframe coding mode in the filtered image is greater than or equal to the first predetermined threshold; determining that a value of the second classification information is a second value when a ratio of an image area in the filtered image that corresponds to the intraframe coding mode in the filtered image is smaller than the first predetermined threshold and is greater than or equal to a second predetermined threshold; determining that a value of the second classification information is a third value if a ratio of an image region in the filtered image that corresponds to the intraframe coding mode in the filtered image is smaller than the second predetermined threshold value; The image filtering method according to claim 9.
12. The classification information is indicated at the block level. The image filtering method according to claim 6.
13. The coding mode includes at least one of a normal intra-frame coding mode, a matrix weighted intra-frame prediction (MIP) mode, an intra-frame block cloning (IBC) mode, an intra-frame string prediction (ISP) mode, a palette (PLT) mode, a normal inter-frame coding mode, a skip mode, a motion merge mode, and a combined inter-intra prediction (CIIP) mode; If the classification information indicates an encoding mode of the filtered image, determining encoding information of the filtered image comprises: obtaining coding modes corresponding to a plurality of image regions in the to-be-filtered image; determining classification information in the coding information based on coding modes corresponding to a plurality of image regions in the filtered image; The image filtering method according to claim 1 .
14. The step of determining classification information in the coding information based on coding modes corresponding to a plurality of image regions in the filtering target image includes: determining indices of coding modes corresponding to a plurality of image regions in the to-be-filtered image; determining the classification information based on indices of coding modes corresponding to a plurality of image regions in the filtered image; The image filtering method according to claim 13.
15. One coding mode corresponds to one index, or multiple coding modes correspond to one index; 15. The image filtering method according to claim 14.
16. The classification information is indicated at the block level. The image filtering method according to claim 13.
17. The step of inputting the filtered image and the classification information into a same deep learning based filtering model includes: and pre-processing at least one of the image to be filtered and the classification information before inputting the image to the filtering model. The image filtering method according to claim 1 .
18. The step of preprocessing at least one of the filtering target image and the classification information and then inputting the preprocessed information into the filtering model includes: The filtering target image and the classification information are input to the filtering model after layer merging.
18. The image filtering method of claim 17.
19. The step of preprocessing at least one of the filtering target image and the classification information and then inputting the preprocessed information into the filtering model includes: multiplying the target image and the classification information, and then inputting the result into a first feature extraction unit to obtain a first feature information obtained by fusing the target image and the classification information; inputting the filtered image to a second feature extraction unit for feature extraction to obtain second feature information of the filtered image; inputting the first characteristic information and the second characteristic information into the filtering model; 18. The image filtering method of claim 17.
20. The step of inputting the filtered image and the classification information into a same deep learning based filtering model includes: inputting at least one of a predicted image, a quantization parameter, and block division information corresponding to the filtering target image, the filtering target image, and the classification information into the filtering model; The image filtering method according to claim 1 .
21. The step of inputting at least one of a predicted image, a quantization parameter, and block division information corresponding to the filtering target image, the filtering target image, and the classification information into the filtering model includes: inputting the predicted image into a first processing unit to obtain feature information of the predicted image; inputting the filtering target image to a second processing unit to obtain feature information of the filtering target image; inputting at least one of feature information of the predicted image, the quantization parameter, and the block division information, and feature information and classification information of the filtering target image into the filtering model; 21. The image filtering method of claim 20.
22. the quantization parameters include at least one of a sequence level quantization parameter and a slice level quantization parameter.
21. The image filtering method of claim 20.
23. the filtering model includes N residual blocks, where N is a positive integer; The image filtering method according to claim 1 .
24. The number of input channels and the number of output channels of each convolutional layer included in at least one residual block among the N residual blocks are the same, or the number of input channels and the number of output channels of each convolutional layer included in at least one residual block among the N residual blocks are different.
24. The image filtering method of claim 23.
25. At least one residual block among the N residual blocks includes a layer of interest.
24. The image filtering method of claim 23.
26. the filtered image is used as a reference image for a subsequent image, or the filtered image is used for display and is not used as a reference image for a subsequent image; The image filtering method according to claim 1 .
27. 1. An image filtering device, comprising: a determining unit configured to determine coding information of a filtered image, the coding information including classification information of the filtered image, the classification information indicating at least one of a coding image type, a coding mode of the filtered image; a filtering unit configured to input the target image and the classification information into a same deep learning based filtering model, and filter the target image based on the classification information to obtain a filtered image.
28. An electronic device, An electronic device comprising a processor and a memory, the memory being configured to store a computer program, the processor executing the method according to any one of claims 1 to 26 by calling and executing the computer program stored in the memory.
29. A computer program comprising computer program instructions which, when executed on an electronic device, cause said electronic device to carry out a method according to any one of claims 1 to 26.
Citation Information
Patent Citations
Video loop filter based on deep convolutional network
CN110351568A
Loop filtering method and device in video coding and decoding, equipment and storage medium
CN113259671A
Image filter device, image decoding device, and image coding device
WO2019031410A1
Image processing device, and image processing method
WO2019093268A1
Neural network based filter in video coding
WO2021244884A1
