Video coding method, apparatus, device, storage medium and computer program
By distinguishing between textured and non-textured regions in video frames using mask labels, adjusting quantization parameters and encoding methods, and combining with a texture enhancement network, the problem of poor video frame reconstruction quality was solved, improving encoding efficiency and quality.
Patent Information
- Application Number
- CN202111341486.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-12
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2041-11-12
AI Technical Summary
In existing technologies, the reconstruction quality of video frames is not optimized enough, and the texture regions of different video frames cannot be effectively distinguished and processed, resulting in poor quality after encoding.
By determining the mask labels of video frames, textured and non-textured regions are distinguished based on semantic categories and texture features. The quantization parameters and encoding methods are adjusted according to the region type, and the encoding quality is improved by combining a texture enhancement network.
It improves the quality of texture regions during video frame reconstruction, ensures optimized video quality after encoding, reduces the encoding bitrate, and enhances the encoding effect of texture regions.
Smart Images

Figure CN116156184B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of encoding and decoding technology, and in particular to a video encoding and decoding method, apparatus, device, storage medium, and computer program. Background Technology
[0002] With the rapid development of multimedia technology, the amount of video data is increasing dramatically. However, there are difficulties in transmitting and storing such large amounts of data, making video encoding and decoding a key focus in the industry.
[0003] Related technologies have proposed a video encoding and decoding method. In this method, for a video frame to be encoded, the encoding end divides the video frame into multiple coding blocks, encodes each coding block based on pre-set quantization parameters, and writes them into the bitstream. Since the quantization parameters are crucial for controlling the degree of quantization, reflecting the compression of the video frame, and are related to the quality of the encoded video, encoding each coding block using the quantization parameters can lead to image distortion. To mitigate this distortion, the decoding end parses each coding block from the bitstream and processes each block using a filter to determine the reconstructed video frame.
[0004] However, since the video content of different video frames is different, the quality of the reconstructed video frames obtained after decoding using the above method may not be optimal. Summary of the Invention
[0005] This application provides a video encoding / decoding method, apparatus, device, storage medium, and computer program, which can solve the problem that the quality of reconstructed video frames is not optimal in related technologies. The technical solution is as follows:
[0006] In a first aspect, a video encoding method is provided, in which a mask label of the video frame is determined based on the attribute information of the video frame to be encoded, the attribute information including semantic category and / or texture features, the mask label of the video frame is used to distinguish textured regions and non-texture regions in the video frame; the mask label of the video frame is encoded; multiple coding blocks included in the video frame are encoded; and the encoding result of the mask label of the video frame and the encoding result of the multiple coding blocks are written into the bitstream.
[0007] Since the attribute information of this video frame includes semantic category and / or texture features, meaning there are three possible scenarios for the attribute information of this video frame, the method for determining the mask label of this video frame differs depending on the attribute information. Therefore, the following will introduce the methods for determining the mask label of this video frame in several scenarios.
[0008] In the first scenario, the attribute information of the video frame includes semantic category and texture features. Determining the mask label of the video frame based on its attribute information includes: performing semantic segmentation on the video frame to obtain a first semantic segmentation map, which includes multiple semantic regions, each corresponding to a semantic category. Based on the semantic categories corresponding to these multiple semantic regions and the texture features of the video frame, the mask label of the video frame is determined. The mask label of the video frame is also used to distinguish the texture category to which the texture regions in the video frame belong.
[0009] Based on the semantic categories corresponding to the multiple semantic regions and the texture features of the video frame, the mask label of the video frame is determined, including: determining the mask labels corresponding to the multiple semantic regions based on the semantic categories corresponding to the multiple semantic regions and the texture features of the video frame; and determining the mask label of the video frame based on the mask labels corresponding to the multiple semantic regions.
[0010] Since the method for determining the mask label for each of the multiple semantic regions is the same, we will now take one of the semantic regions as an example. That is, a semantic region is selected from the multiple semantic regions. If a first texture category corresponding to a first semantic category exists in the stored correspondence between semantic categories and texture categories, then the mask label for the selected semantic region is determined based on the first texture category, where the first semantic category is the semantic category corresponding to the selected semantic region. If the first texture category does not exist in the correspondence between semantic categories and texture categories, then the mask label for the selected semantic region is determined based on the texture features within the first image region, where the first image region is the image region corresponding to the selected semantic region in that video frame.
[0011] For some typical and special regions, these regions typically possess rich textures, such as grasslands, buildings, mountains, and plants. Therefore, embodiments of this application predetermine the semantic categories and texture categories of these regions and store the correspondence between semantic categories and texture categories. Thus, for a selected semantic region, if the stored correspondence between semantic categories and texture categories contains a first texture category corresponding to the first semantic category, it indicates that the selected semantic region is a textured region, and a typical and special textured region. Then, a mask label corresponding to the selected semantic region is determined based on the first texture category. If the stored correspondence between semantic categories and texture categories does not contain a first texture category, it indicates that the selected semantic region may be a non-textured region or a textured region, but not a typical and special textured region. In this case, it is necessary to determine the mask label corresponding to the selected semantic region based on the texture features within the first image region.
[0012] It should be noted that a texture category may correspond to one semantic category, and conversely, a texture category may correspond to multiple semantic categories. For example, the semantic categories of "trees" and "grass" correspond to the same texture category, namely "plants." Similarly, the semantic categories of "mountains" and "hills" correspond to the same texture category, namely "mountains."
[0013] Since the mask labels of this video frame are used not only to distinguish between textured and non-textured regions, but also to distinguish between texture categories of different textured regions, embodiments of this application can pre-determine the texture categories corresponding to some typical and special textured regions, as well as the mask labels corresponding to these texture categories, and then store the correspondence between texture categories and mask labels. Thus, when determining the mask label corresponding to the selected semantic region based on the first texture category, the mask label corresponding to the first texture category can be obtained from the correspondence between texture categories and mask labels, and this mask label can be determined as the mask label corresponding to the selected semantic region.
[0014] The process of determining the mask label corresponding to the selected semantic region based on the texture features within the first image region includes: acquiring the texture features corresponding to multiple local image regions within the first image region, wherein these multiple local image regions do not overlap; determining the texture similarity between the multiple local image regions and each of the multiple reference video frames (including textured video frames and non-textured video frames) based on the texture similarity; determining the mask label corresponding to the multiple local image regions based on the determined texture similarity; and determining the mask label corresponding to the selected semantic region based on the mask labels corresponding to the multiple local image regions.
[0015] After determining the texture similarity between the plurality of local image regions and each of the plurality of reference video frames, each local image region corresponds to a plurality of texture similarities, and these plurality of texture similarities correspond one-to-one with the plurality of reference video frames. Therefore, in some embodiments, for any local image region, the reference video frames corresponding to the first K texture similarities can be selected in descending order of texture similarity based on the plurality of texture similarities corresponding to the local image region, to obtain K reference video frames. The number of textured video frames and the number of non-textured video frames in the K reference video frames are determined. If the number of non-textured video frames is greater than the number of textured video frames, the local image region is determined to be a non-textured region, and the mask label corresponding to the local image region is determined to be a first value. If the number of textured video frames is greater than the number of non-textured video frames, the local image region is determined to be a textured region, and the mask label corresponding to the local image region is determined to be a second value.
[0016] Since the semantic categories described above can only identify typical and special texture regions, but not non-typical and non-special texture regions (also known as regular texture regions), this embodiment identifies regular texture regions through texture features. When identifying regular texture regions through texture features, if the number of textured video frames in the K reference video frames is greater than the number of non-textured video frames, it indicates that the local image region is a regular texture region. In this case, the mask label corresponding to the local image region can be directly determined as the second value, which is different from the mask label in the above correspondence between texture categories and mask labels. Of course, the above correspondence between texture categories and mask labels can also include the correspondence between texture categories and mask labels for regular texture regions. Thus, if the number of textured video frames in the K reference video frames is greater than the number of non-textured video frames, the texture category corresponding to the local image region can be determined to be a regular texture. Then, the mask label corresponding to the local image region is obtained from the above correspondence between texture categories and mask labels.
[0017] After identifying K reference video frames, it is necessary to determine whether the local image region is a textured region or a non-textured region based on the number of textured video frames and the number of non-textured video frames among the K reference video frames. Therefore, in some embodiments, K is an odd number. However, if the number of textured video frames and the number of non-textured video frames are equal, it indicates that the area of the textured region and the area of the non-textured region in the local image region are equal. Therefore, in other embodiments, in order not to degrade the encoding quality of the non-textured region, the local image region can be directly determined to be a non-textured region.
[0018] Since the selected semantic region includes multiple local image regions, indicating that the selected semantic region is homogeneous with these multiple local image regions, after determining the mask label corresponding to each local image region, the number of local image regions with mask labels of the first value and the number of local image regions with mask labels of the second value can be determined. If the number of local image regions with mask labels of the first value is greater than the number of local image regions with mask labels of the second value, then the mask label corresponding to the selected semantic region is determined to be the first value. If the number of local image regions with mask labels of the second value is greater than the number of local image regions with mask labels of the first value, then the mask label corresponding to the selected semantic region is determined to be the second value. That is, the mask label with the greater number among the multiple local image regions is taken as the mask label corresponding to the entire semantic region.
[0019] To avoid the number of local image regions with a mask label of the first value being equal to the number of local image regions with a mask label of the second value, in some embodiments, the number of these multiple local image regions is odd. However, if the number of local image regions with a mask label of the first value is equal to the number of local image regions with a mask label of the second value, it indicates that the area of the textured region and the area of the non-textured region in the selected semantic region are equal. Therefore, in other embodiments, in order not to degrade the encoding quality of the non-textured region, the mask label corresponding to the selected semantic region can be directly determined to be the first value.
[0020] Since the mask labels corresponding to each semantic region can distinguish between textured and non-textured regions, and also differentiate the texture category to which the textured region belongs, in some embodiments, the mask labels corresponding to the multiple semantic regions can be directly used as the mask labels of the video frame. However, to facilitate subsequent determination of whether each coding block in the multiple coding blocks included in the video frame belongs to a textured or non-textured region, in other embodiments, a simple discrimination can be performed on the mask labels corresponding to the multiple semantic regions to determine the mask label corresponding to each coding block, thereby using the mask labels corresponding to the multiple coding blocks as the mask labels of the video frame. That is, the mask labels of the video frame include the mask labels corresponding to the multiple semantic regions, or include the mask labels corresponding to the multiple coding blocks.
[0021] The first scenario mentioned above considers both the semantic and texture attributes of video frames, which can distinguish not only typical and special texture regions, but also regular texture regions, thereby improving the accuracy of texture classification and enabling adaptive texture enhancement for different texture categories in the future.
[0022] In the second scenario, the attribute information of the video frame includes texture features, and the mask label of the video frame includes the mask labels corresponding to the multiple coding blocks respectively. Determining the mask label of the video frame based on the attribute information of the video frame to be encoded includes: determining the mask label corresponding to the multiple coding blocks respectively based on the texture features corresponding to the multiple coding blocks.
[0023] Since the mask labels for each of the multiple coding blocks are determined in the same way, one coding block can be selected from these multiple coding blocks, and the mask label corresponding to the selected coding block can be determined according to the following operations until the mask label corresponding to each coding block is determined: Obtain the texture features corresponding to multiple local image regions within the selected coding block, where these multiple local image regions do not overlap. Based on the texture features corresponding to these multiple local image regions, and the texture features corresponding to multiple stored reference video frames, determine the texture similarity between each of the multiple local image regions and each of the multiple reference video frames, which includes textured video frames and non-textured video frames. Based on the determined texture similarity, determine the mask labels corresponding to each of the multiple local image regions. Based on the mask labels corresponding to each of the multiple local image regions, determine the mask label corresponding to the selected coding block.
[0024] It should be noted that the first case described above determines the mask label corresponding to a semantic region by using texture features within that region, while the second case determines the mask label corresponding to a coding block by using texture features within that block. The specific implementation methods are the same, and will not be elaborated upon here.
[0025] In the third scenario, the attribute information of the video frame includes a semantic category. Determining the mask label of the video frame based on its attribute information includes: performing semantic segmentation on the video frame to obtain a first semantic segmentation map. The first semantic segmentation map includes multiple semantic regions, each corresponding to a semantic category. The mask label of the video frame includes the semantic categories corresponding to these multiple semantic regions.
[0026] After determining the mask label of the video frame through the above three methods, the multiple coding blocks can be encoded based on the mask label of the video frame. Of course, the multiple coding blocks can also be encoded in other ways, and this application does not limit this.
[0027] The process of encoding multiple coding blocks based on the mask label of the video frame includes: determining the quantization parameters corresponding to each of the multiple coding blocks based on the mask label of the video frame, wherein the quantization parameters corresponding to the coding blocks belonging to the texture region are greater than the quantization parameters corresponding to the coding blocks belonging to the non-texture region; and encoding the multiple coding blocks based on the quantization parameters corresponding to each of the multiple coding blocks.
[0028] Based on the above description, the mask label of the video frame is used to distinguish between textured and non-textured regions. Moreover, the mask label of the video frame includes mask labels corresponding to multiple semantic regions or mask labels corresponding to multiple coding blocks. In either case, after determining the mask label of the video frame, it is possible to determine whether each coding block belongs to a textured or non-textured region based on the mask label of the video frame.
[0029] For example, when the mask labels of the video frame include mask labels corresponding to multiple semantic regions, for any one of the multiple coding blocks, based on the mask labels of the video frame, the number of pixels located within the coding block with a mask label of a first value is counted to obtain a first number. A ratio is determined between the first number and a second number, where the second number is the total number of pixels in the coding block. If the ratio is greater than or equal to a ratio threshold, the coding block is determined to belong to a non-texture region; if the ratio is less than the ratio threshold, the coding block is determined to belong to a texture region. That is, if the ratio is greater than or equal to the ratio threshold, it indicates that most of the area within the coding block is a non-texture region, and the coding block is determined to belong to a non-texture region. If the ratio is less than the ratio threshold, it indicates that most of the area within the coding block is a texture region, and the coding block is determined to belong to a texture region.
[0030] In this way, one coding block can be selected from the multiple coding blocks, and the quantization parameters corresponding to the selected coding block are determined according to the following operations until the quantization parameters corresponding to each coding block are determined: If the selected coding block is determined to belong to a texture region based on the mask label of the video frame, then the standard deviation of the pixel value corresponding to the selected coding block is determined. This standard deviation of the pixel value is used to indicate the texture complexity within the selected coding block. This standard deviation of the pixel value is multiplied by the maximum adjustable quantization parameter to obtain the first quantization parameter. The first quantization parameter is added to the second quantization parameter to obtain the quantization parameter corresponding to the selected coding block. The second quantization parameter is the quantization parameter corresponding to the coding block belonging to the non-texture region among the multiple coding blocks. If the selected coding block is determined to belong to a non-texture region based on the mask label of the video frame, then the quantization parameter corresponding to the selected coding block is determined to be the second quantization parameter.
[0031] Because textured areas are particularly rich in texture, encoding them using conventional encoding methods would consume a significant amount of bitrate. However, users are not sensitive to distortion or changes in textured areas. Therefore, in some embodiments, non-textured areas are encoded using conventional methods, while textured areas are encoded using higher quantization parameters. This reduces the encoding quality of textured areas, thereby lowering the bitrate consumed by textured areas.
[0032] Secondly, a video decoding method is provided. In this method, the bitstream is parsed to obtain multiple reconstructed coding blocks. Mask labels corresponding to each of the multiple reconstructed coding blocks are determined. These mask labels are used to distinguish between textured and non-texture regions, and to distinguish the texture category to which the texture region belongs. Based on the mask labels corresponding to each reconstructed coding block belonging to a texture region, the texture enhancement network corresponding to each reconstructed coding block belonging to a texture region is determined from multiple texture enhancement networks. Each reconstructed coding block belonging to a texture region is input into its corresponding texture enhancement network to obtain multiple texture enhancement coding blocks. The reconstructed coding blocks belonging to non-texture regions are concatenated with the multiple texture enhancement coding blocks to obtain a reconstructed video frame.
[0033] When the mask labels of the video frame determined at the encoding end are different, the way the decoding end determines the mask labels corresponding to the multiple reconstructed coding blocks is also different. Therefore, we will introduce them in several cases below.
[0034] In the first scenario, corresponding to the first scenario at the encoding end, the mask labels corresponding to the multiple reconstructed coding blocks are determined. This includes: parsing the bitstream to obtain the mask labels of the video frames to be reconstructed. The mask labels of the video frames to be reconstructed are used to distinguish between textured and non-texture regions, and to distinguish the texture category to which the texture regions belong. The mask labels corresponding to the multiple reconstructed coding blocks are determined based on the mask labels of the video frames to be reconstructed.
[0035] Based on the foregoing description, the mask label of this video frame includes mask labels corresponding to multiple semantic regions, or the mask label of this video frame includes mask labels corresponding to multiple coded blocks. When the mask label of this video frame includes mask labels corresponding to multiple coded blocks, the decoder can directly determine the mask labels corresponding to the multiple reconstructed coded blocks from the mask label of this video frame. When the mask label of this video frame includes mask labels corresponding to multiple semantic regions, the decoder can perform a simple discrimination based on the mask label of this video frame to determine the mask labels corresponding to the multiple reconstructed coded blocks.
[0036] The second scenario corresponds to the second scenario at the encoding end. It involves determining the mask labels corresponding to each of the multiple reconstructed coding blocks, including: parsing the bitstream to obtain the mask labels of the video frames to be reconstructed. These mask labels are used to distinguish between textured and non-texture regions. Semantic segmentation is performed on the base reconstructed frame to obtain a second semantic segmentation map. The base reconstructed frame is the video frame obtained by concatenating the multiple reconstructed coding blocks. The second semantic segmentation map includes multiple semantic regions, each corresponding to a semantic category. Based on the mask labels of the video frames to be reconstructed and the semantic categories corresponding to the multiple semantic regions, the mask labels corresponding to each of the multiple semantic regions are determined. Based on the mask labels corresponding to the multiple semantic regions, the mask labels corresponding to each of the multiple reconstructed coding blocks are determined.
[0037] In some embodiments, a semantic region is selected from the plurality of semantic regions, and the selected semantic region is processed according to the following operations until each semantic region has been processed: If a second texture category corresponding to a second semantic category exists in the stored correspondence between semantic categories and texture categories, then a mask label corresponding to the selected semantic region is determined based on the second texture category, where the second semantic category is the semantic category corresponding to the selected semantic region. If a second texture category does not exist in the correspondence between semantic categories and texture categories, then a mask label corresponding to the selected semantic region is determined based on the mask label of the video frame.
[0038] If a second texture category exists in the stored correspondence between semantic categories and texture categories, it indicates that the selected semantic region is a typical or special texture region. In this case, the mask label corresponding to the selected semantic region can be determined based on the second texture category. If no second texture category exists in the stored correspondence between semantic categories and texture categories, it indicates that the selected semantic region may be a regular texture region or a non-texture region. In this case, the number of pixels within the selected semantic region with a mask label of the first value and the number of pixels with a mask label of the second value can be determined based on the mask label of the video frame. If the number of pixels with a mask label of the first value is greater than the number of pixels with a mask label of the second value, then the mask label corresponding to the selected semantic region is determined to be the first value; otherwise, the mask label corresponding to the selected semantic region is determined to be the second value.
[0039] Since the mask labels of this video frame can only distinguish between textured and non-textured regions, but not between regions of different texture categories within a textured region, this embodiment of the application can also determine the mask labels corresponding to typical and special textured regions based on the semantic category corresponding to each semantic region in the second semantic segmentation map. After determining the mask labels corresponding to typical and special textured regions, the remaining textured regions are considered regular textured regions. In this way, not only can textured and non-textured regions be distinguished, but also the texture category to which the textured region belongs can be identified.
[0040] Since the mask label corresponding to each semantic region is used not only to distinguish between textured and non-textured regions, but also to distinguish the texture category to which the textured region belongs, the mask labels corresponding to these multiple semantic regions can be easily judged to determine the mask labels corresponding to these multiple reconstructed coding blocks respectively.
[0041] The simple method of identification is the same as that described above; please refer to the relevant descriptions above for details, which will not be repeated here.
[0042] The third scenario corresponds to the third scenario at the encoding end. It involves determining the mask labels corresponding to each of the multiple reconstructed coding blocks. This includes: parsing the bitstream to obtain the mask labels of the video frame to be reconstructed. The mask labels of the video frame to be reconstructed include semantic categories corresponding to multiple semantic regions. Based on the semantic categories corresponding to these multiple semantic regions and the texture features of the base reconstructed frame, the mask labels corresponding to each of these multiple semantic regions are determined. The base reconstructed frame is obtained by concatenating these multiple reconstructed coding blocks. Finally, based on the mask labels corresponding to these multiple semantic regions, the mask labels corresponding to each of the multiple reconstructed coding blocks are determined.
[0043] In some embodiments, a semantic region is selected from the plurality of semantic regions, and the mask label corresponding to the selected semantic region is determined according to the following operations until the mask label corresponding to each semantic region is determined: if a first texture category corresponding to a first semantic category exists in the stored correspondence between semantic categories and texture categories, then the mask label corresponding to the selected semantic region is determined based on the first texture category, where the semantic category is the semantic category corresponding to the selected semantic region. If a first texture category does not exist in the stored correspondence between semantic categories and texture categories, then the mask label corresponding to the selected semantic region is determined based on the texture features in a second image region, where the second image region is the image region corresponding to the selected semantic region in the base reconstruction frame.
[0044] The process of determining the mask label corresponding to the selected semantic region based on the texture features within the second image region includes: acquiring the texture features corresponding to multiple local image regions within the second image region, wherein these multiple local image regions do not overlap; determining the texture similarity between each of the multiple local image regions and each of the multiple reference video frames (including textured video frames and non-texture video frames) based on the determined texture similarity; determining the mask label corresponding to each of the multiple local image regions based on the determined texture similarity; and determining the mask label corresponding to the selected semantic region based on the mask labels corresponding to the multiple local image regions.
[0045] The fourth scenario involves determining the mask labels corresponding to each of the multiple reconstructed coding blocks. This includes: performing semantic segmentation on the base reconstructed frame to obtain a second semantic segmentation map. The base reconstructed frame is a video frame obtained by concatenating the multiple reconstructed coding blocks. The second semantic segmentation map includes multiple semantic regions, each corresponding to a semantic category. Based on the semantic categories corresponding to the multiple semantic regions and the texture features of the base reconstructed frame, the mask labels corresponding to the multiple semantic regions are determined. Based on the mask labels corresponding to the multiple semantic regions, the mask labels corresponding to the multiple reconstructed coding blocks are determined.
[0046] After determining the mask label of the video frame at the encoding end according to the first scenario, the mask label of the video frame can be encoded into the bitstream. The decoding end can then parse the bitstream to obtain the mask label of the video frame to be reconstructed, and thus determine the mask labels corresponding to the multiple reconstructed coding blocks. In other embodiments, the encoding end may not need to encode the mask label of the video frame into the bitstream. In this case, the decoding end can determine the mask labels corresponding to the multiple reconstructed coding blocks using the fourth scenario.
[0047] The implementation method of determining the mask labels corresponding to the multiple semantic regions based on the semantic categories and texture features of the basic reconstructed frames is similar to the third case mentioned above, and will not be elaborated further in this application.
[0048] To reduce the encoding rate, the encoding end increases the quantization parameters corresponding to the encoded blocks belonging to the texture region, thereby reducing the encoding quality of these blocks. However, to minimize distortion in the reconstructed texture region, after the decoding end determines the mask labels corresponding to the multiple reconstructed encoded blocks using the four methods described above, it is necessary to enhance the texture of each reconstructed encoded block belonging to the texture region. Similarly, after the encoding end encodes the encoded blocks belonging to the texture region using the conventional encoding method, the decoding end also needs to enhance the texture of each reconstructed encoded block belonging to the texture region to improve its quality.
[0049] In this embodiment, different texture categories correspond to different texture enhancement networks, and texture categories can be distinguished by the mask labels corresponding to the coding blocks. That is, different mask labels correspond to different texture enhancement networks. Therefore, after determining the mask labels corresponding to each reconstructed coding block, a corresponding texture enhancement network can be selected from the multiple texture enhancement networks based on the mask labels corresponding to each reconstructed coding block belonging to the texture region, so as to obtain the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region.
[0050] Since different texture categories correspond to different textures, the embodiments of this application can select the corresponding texture enhancement network from the multiple texture enhancement networks based on the mask labels corresponding to each reconstructed coding block belonging to the texture region in the multiple reconstructed coding blocks, so as to obtain the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region, and then perform texture enhancement according to their respective texture enhancement networks, so as to make texture enhancement more targeted and ensure that the quality of the reconstructed video frame is optimal.
[0051] Thirdly, a video encoding apparatus is provided, which has the function of implementing the video encoding method described in the first aspect. The video encoding apparatus includes at least one module for implementing the video encoding method provided in the first aspect.
[0052] Fourthly, a video decoding apparatus is provided, which has the function of implementing the video decoding method described in the second aspect above. The video decoding apparatus includes at least one module for implementing the video decoding method provided in the second aspect above.
[0053] Fifthly, an encoding end device is provided, the encoding end device including a processor and a memory, the memory being used to store a computer program for executing the video encoding method provided in the first aspect. The processor is configured to execute the computer program stored in the memory to implement the video encoding method described in the first aspect.
[0054] Optionally, the encoding end device may further include a communication bus for establishing a connection between the processor and the memory.
[0055] In a sixth aspect, a decoding device is provided, the decoding device including a processor and a memory, the memory being used to store a computer program for executing the video decoding method provided in the second aspect above. The processor is configured to execute the computer program stored in the memory to implement the video decoding method described in the second aspect above.
[0056] Optionally, the decoding device may further include a communication bus for establishing a connection between the processor and the memory.
[0057] In a seventh aspect, a computer-readable storage medium is provided, the storage medium storing instructions that, when executed on a computer, cause the computer to perform the steps of the method described in the first or second aspect.
[0058] Eighthly, a computer-readable storage medium is provided, comprising the bitstream obtained by the encoding method described in the first aspect above.
[0059] A ninth aspect provides a computer program product comprising instructions that, when executed on a computer, cause the computer to perform the steps of the methods described in the first or second aspect. Alternatively, a computer program is provided that, when executed on a computer, causes the computer to perform the steps of the methods described in the first or second aspect.
[0060] The technical effects achieved by the third to ninth aspects mentioned above are similar to those achieved by the corresponding technical means in the first or second aspects, and will not be repeated here.
[0061] The technical solutions provided in this application can bring at least the following beneficial effects:
[0062] To improve the quality of texture regions in the reconstructed video frame, the mask labels of the video frame can be encoded into the bitstream. This allows the mask labels for each reconstructed coding block to be determined based on the mask labels of the video frame. Then, based on the mask labels corresponding to each reconstructed coding block, the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region can be determined from multiple texture enhancement networks. Finally, texture enhancement is performed on each reconstructed coding block belonging to the texture region using the texture enhancement networks corresponding to those reconstructed coding blocks, thereby improving the quality of texture regions in the reconstructed video frame. Attached Figure Description
[0063] Figure 1This is a schematic diagram of an implementation environment provided in an embodiment of this application;
[0064] Figure 2 This is a schematic diagram of an exemplary implementation environment provided in an embodiment of this application;
[0065] Figure 3 This is an exemplary block diagram of a video encoding and decoding method provided in an embodiment of this application;
[0066] Figure 4 This is a flowchart of the first video encoding method provided in the embodiments of this application;
[0067] Figure 5 This is a schematic diagram illustrating a method for determining a mask label for a video frame, as provided in an embodiment of this application.
[0068] Figure 6 This is a flowchart of the first video decoding method provided in the embodiments of this application;
[0069] Figure 7 This is a schematic diagram of the structure of a generator provided in an embodiment of this application;
[0070] Figure 8 This is a schematic diagram of the structure of a discriminator provided in an embodiment of this application;
[0071] Figure 9 This is an exemplary block diagram of a video encoding / decoding method provided in an embodiment of this application;
[0072] Figure 10 This is a flowchart of the second video encoding method provided in the embodiments of this application;
[0073] Figure 11 This is a flowchart of the second video decoding method provided in the embodiments of this application;
[0074] Figure 12 This is a flowchart of the third video encoding method provided in the embodiments of this application;
[0075] Figure 13 This is a flowchart of the third video decoding method provided in the embodiments of this application;
[0076] Figure 14 This is a flowchart of the fourth video encoding method provided in the embodiments of this application;
[0077] Figure 15 This is a flowchart of the fourth video decoding method provided in the embodiments of this application;
[0078] Figure 16 This is an exemplary block diagram of a video encoding / decoding method provided in an embodiment of this application;
[0079] Figure 17 This is a schematic diagram of the structure of a video encoding device provided in an embodiment of this application;
[0080] Figure 18 This is a schematic diagram of the structure of a video decoding device provided in an embodiment of this application;
[0081] Figure 19 This is a schematic block diagram of an encoding / decoding device provided in an embodiment of this application. Detailed Implementation
[0082] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0083] Before providing a detailed explanation of the video encoding and decoding methods provided in the embodiments of this application, the terminology and implementation environment involved in the embodiments of this application will be introduced first.
[0084] To facilitate understanding, the terms used in the embodiments of this application will be explained first.
[0085] Encoding refers to the process of compressing a video to be encoded into a bitstream. A video consists of multiple video frames, and video encoding is the process of compressing the sequence of video frames into a bitstream.
[0086] It should be noted that a video compressed into a bitstream can be called an encoded video, and a video frame compressed into a bitstream can be called an encoded video frame.
[0087] Decoding refers to the process of restoring an encoded bitstream into a reconstructed video according to specific syntax rules and processing methods. Specifically, video bitstream decoding refers to the process of restoring a video bitstream into a reconstructed sequence of video frames.
[0088] A coding block is a region of data obtained by dividing a video frame into its corresponding coding blocks. A video frame can be divided into multiple coding blocks, which together constitute the video frame. Each coding block can be encoded independently, and its size can be 128*128.
[0089] Quantization is the process of mapping continuous values of a signal to multiple discrete amplitude values. Quantization can effectively reduce the range of signal values, thereby achieving better compression, and it is also the root cause of distortion.
[0090] The quantization parameter (QP) is a crucial parameter controlling the degree of quantization and reflects the compression level of a video frame. Generally, a smaller QP results in finer quantization, preserving more image details and producing higher encoded quality, but also consuming more bitrate. Conversely, a larger QP results in coarser quantization, greater loss of image details, lower encoded quality, more noticeable distortion, and less bitrate. In other words, the quantization parameter and bitrate are negatively correlated.
[0091] Mask: Typically used for semantic differentiation. This application extends the mask to distinguish between textured and non-textured regions in a video frame, and optionally, also to distinguish the texture category to which the textured region belongs. In this application, the extended mask is referred to as a mask label.
[0092] The implementation environment involved in the embodiments of this application will be described next.
[0093] Please refer to Figure 1 , Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application. The implementation environment includes a source device 10, a destination device 20, a link 30, and a storage device 40. The source device 10 can generate encoded video. Therefore, the source device 10 can also be referred to as a video encoding device. The destination device 20 can decode the encoded video generated by the source device 10. Therefore, the destination device 20 can also be referred to as a video decoding device. The link 30 can receive the encoded video generated by the source device 10 and can transmit the encoded video to the destination device 20. The storage device 40 can receive the encoded video generated by the source device 10 and can store the encoded video. Under such conditions, the destination device 20 can directly obtain the encoded video from the storage device 40. Alternatively, the storage device 40 can correspond to a file server or another intermediate storage device that can store the encoded video generated by the source device 10. Under such conditions, the destination device 20 can stream or download the encoded video stored in the storage device 40.
[0094] Both source device 10 and destination device 20 may include one or more processors and memory coupled to the one or more processors. This memory may include random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or any other media that can be used to store desired program code in the form of computer-accessible instructions or data structures. For example, both source device 10 and destination device 20 may include desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, handsets such as so-called "smartphones," televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, or the like.
[0095] Link 30 may include one or more media or devices capable of transmitting encoded video from source device 10 to destination device 20. In one possible implementation, link 30 may include one or more communication media enabling source device 10 to directly transmit encoded video to destination device 20 in real time. In this embodiment, source device 10 may modulate the encoded video according to a communication standard, such as a wireless communication protocol, and transmit the modulated video to destination device 20. The one or more communication media may include wireless and / or wired communication media, such as radio frequency (RF) spectrum or one or more physical transmission lines. The one or more communication media may form part of a packet-based network, such as a local area network, wide area network, or global network (e.g., the Internet). The one or more communication media may include routers, switches, base stations, or other devices facilitating communication from source device 10 to destination device 20, etc., which are not specifically limited in this embodiment.
[0096] In one possible implementation, storage device 40 can store the received encoded video sent by source device 10, and destination device 20 can directly retrieve the encoded video from storage device 40. Under such conditions, storage device 40 can include any of a variety of distributed or locally accessed data storage media. For example, any of these distributed or locally accessed data storage media can be a hard disk drive, Blu-ray disc, digital versatile disc (DVD), compact disc read-only memory (CD-ROM), flash memory, volatile or non-volatile memory, or any other suitable digital storage media for storing encoded video.
[0097] In one possible implementation, storage device 40 may correspond to a file server or another intermediate storage device capable of storing the encoded video generated by source device 10, and destination device 20 may stream or download the video stored on storage device 40. The file server may be any type of server capable of storing and sending the encoded video to destination device 20. In one possible implementation, the file server may include a web server, a file transfer protocol (FTP) server, a network attached storage (NAS) device, or a local disk drive, etc. Destination device 20 may acquire the encoded video via any standard data connection (including an Internet connection). Any standard data connection may include a wireless channel (e.g., Wi-Fi connection), a wired connection (e.g., digital subscriber line (DSL), cable modem, etc.), or a combination of both suitable for acquiring the encoded video stored on a file server. The transmission of the encoded video from storage device 40 may be streaming, downloading, or a combination of both.
[0098] Figure 1 The implementation environment shown is only one possible implementation, and the technology of this application embodiment can be applied to more than just this. Figure 1 The source device 10 shown can encode video, and the destination device 20 can decode the encoded video. It can also be applied to other devices that can encode video and decode encoded video. This application embodiment does not specifically limit them.
[0099] exist Figure 1In the illustrated implementation environment, source device 10 includes a data source 120, an encoder 100, and an output interface 140. In some embodiments, the output interface 140 may include a modem / demodulator and / or a transmitter, wherein the transmitter may also be referred to as a transmitter. Data source 120 may include an image capture device (e.g., a camera, etc.), an archive containing previously captured video, a feed interface for receiving video from a video content provider, and / or a computer graphics system for generating video, or a combination of these sources of video.
[0100] Data source 120 can send video to encoder 100, which can encode the received video from data source 120 to obtain encoded video. The encoder can then send the encoded video to an output interface. In some embodiments, source device 10 directly sends the encoded video to destination device 20 via output interface 140. In other embodiments, the encoded video can also be stored on storage device 40 for later retrieval by destination device 20 for decoding and / or display.
[0101] exist Figure 1 In the illustrated implementation environment, destination device 20 includes an input interface 240, a decoder 200, and a display device 220. In some embodiments, the input interface 240 includes a receiver and / or a modem. The input interface 240 may receive encoded video via link 30 and / or from storage device 40, and then send it to the decoder 200, which may decode the received encoded video to obtain decoded video. The decoder may send the decoded video to the display device 220. The display device 220 may be integrated with destination device 20 or may be external to destination device 20. Generally, the display device 220 displays the decoded video. The display device 220 may be any type of display device, for example, a liquid crystal display (LCD), a plasma display, an organic light-emitting diode (OLED) display, or other types of display devices.
[0102] although Figure 1Not shown, but in some respects, encoder 100 and decoder 200 may be integrated with audio encoder and decoder respectively, and may include appropriate multiplexer-demultiplexer (MUX-DEMUX) units or other hardware and software for encoding both audio and video in a common data stream or separate data streams. In some embodiments, the MUX-DEMUX unit may conform to the ITU H.223 multiplexer protocol, or other protocols such as User Datagram Protocol (UDP), if applicable.
[0103] Encoder 100 and decoder 200 may each be any of the following circuits: one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, hardware, or any combination thereof. If the techniques of the embodiments of this application are implemented in part in software, the apparatus may store instructions for software in a suitable non-volatile computer-readable storage medium, and the instructions may be executed in hardware using one or more processors to implement the techniques of the embodiments of this application. Any of the foregoing (including hardware, software, combinations of hardware and software, etc.) may be considered as one or more processors. Each of encoder 100 and decoder 200 may be included in one or more encoders or decoders, either of which may be integrated as part of a combined encoder / decoder (encoder-decoder) in the respective apparatus.
[0104] In this application embodiment, encoder 100 may be generally referred to as an apparatus that “signals” or “sends” certain information to, for example, decoder 200. The terms “signals” or “sends” may generally refer to the transmission of syntax elements and / or other data for decoding encoded video. This transmission may occur in real-time or near real-time. Alternatively, this communication may occur after a period of time, for example, during encoding when syntax elements are stored in a computer-readable storage medium in the encoded bitstream, and the decoding apparatus may then retrieve the syntax elements at any time after they have been stored in this medium.
[0105] The video encoding and decoding method provided in this application embodiment can be applied to various scenarios. For example, in a smart city scenario, there are a large number of complex texture areas such as trees and grass in the captured images. Therefore, in order to improve the quality of texture areas in the reconstructed images, the video encoding and decoding method provided in this application embodiment can be used for smart city scenarios.
[0106] Please refer to Figure 2 , Figure 2 This is a schematic diagram of an exemplary implementation environment provided in this application embodiment. Taking a smart city scenario as an example, the implementation environment includes a data acquisition terminal 101 and a terminal device 201, and the data acquisition terminal 101 and the terminal device 201 are communicatively connected. This communication connection can be a wireless connection or a wired connection, and this application embodiment does not limit it in this way.
[0107] The acquisition terminal 101 can be the above Figure 1 The source device 10 in the implementation environment shown. The terminal device 201 can be the aforementioned. Figure 1 The destination device 20 in the implementation environment shown.
[0108] Alternatively, please refer to Figure 3 The acquisition terminal 101 is used to acquire video frames to obtain a video. For each video frame in the video, the acquisition terminal 101 determines a mask label for the video frame based on the attribute information of the video frame, including semantic category and / or texture features. The mask label of the video frame is used to distinguish between textured and non-textured regions in the video frame. Based on the mask label of the video frame, multiple coding blocks included in the video frame are encoded. Then, the acquisition terminal 101 writes the encoding results of the multiple coding blocks into the bitstream and transmits them to the terminal device 201 through the channel.
[0109] Terminal device 201 parses the bitstream transmitted by acquisition terminal 101 to obtain multiple reconstructed coding blocks. It determines the mask labels corresponding to each of these reconstructed coding blocks, which distinguish between textured and non-texture regions, and also distinguish the texture category to which the texture region belongs. Based on the mask labels corresponding to each reconstructed coding block belonging to a texture region, it determines the texture enhancement network corresponding to each reconstructed coding block belonging to a texture region from multiple texture enhancement networks. Each reconstructed coding block belonging to a texture region is input into its corresponding texture enhancement network to obtain multiple texture-enhanced coding blocks. Then, terminal device 201 concatenates the reconstructed coding blocks belonging to non-texture regions with the multiple texture-enhanced coding blocks to obtain reconstructed video frames.
[0110] Among them, the acquisition end 101 can be a camera, monitoring equipment, etc., and the terminal device 201 can be any electronic product that can interact with the user through one or more methods such as keyboard, touchpad, touch screen, remote control, voice interaction or handwriting device, such as personal computer (PC), mobile phone, smartphone, personal digital assistant (PDA), wearable device, handheld PC (PPC), tablet computer, smart car system, smart TV, smart speaker, etc.
[0111] Those skilled in the art should understand that the above-described acquisition terminal 101 and terminal device 201 are merely examples. Other existing or future devices that are applicable to the embodiments of this application should also be included within the scope of protection of the embodiments of this application, and are hereby incorporated by reference.
[0112] The video encoding and decoding method provided in the embodiments of this application will be described next. It should be noted that, in conjunction with... Figure 1 In the implementation environment shown, any of the video encoding methods described below can be performed by the encoder 100 in the source device 10. Figure 2 For example, any of the video encoding methods mentioned below can be Figure 2 The acquisition end 101 in the destination device 20 performs the decoding. Any of the video decoding methods described below can be performed by the decoder 200 in the destination device 20. Figure 2 For example, any of the video decoding methods mentioned below can be Figure 2 The terminal device 201 in the process is executed.
[0113] In addition, for a video segment, the encoding end can encode all the video frames in the video segment one by one, and the decoding end can also decode the video frames one by one. Therefore, the following explanation will take one video frame as an example.
[0114] It should be noted that the embodiments of this application determine the mask label of the video frame based on the attribute information of the video frame. Since the attribute information of the video frame includes semantic category and / or texture features, that is, there are three cases of the attribute information of the video frame, the video encoding and decoding method provided by the embodiments of this application will be introduced in several embodiments below.
[0115] Please refer to Figure 4 , Figure 4 This is a flowchart of a first video encoding method provided in an embodiment of this application. In this embodiment, the attribute information of the video frame includes semantic category and texture features. The method includes the following steps.
[0116] Step 401: Perform semantic segmentation on the video frame to be encoded to obtain a first semantic segmentation map. The first semantic segmentation map includes multiple semantic regions, and each semantic region corresponds to a semantic category.
[0117] In this embodiment, the video frame to be encoded is input into a semantic segmentation network to obtain a first semantic segmentation map. That is, the video frame is semantically segmented using the semantic segmentation network. Of course, other methods can also be used to semantically segment the video frame, and this embodiment does not limit this method.
[0118] Step 402: Based on the semantic categories corresponding to the multiple semantic regions and the texture features of the video frame, determine the mask label of the video frame. The mask label of the video frame is used to distinguish between textured regions and non-textured regions in the video frame, and to distinguish the texture category to which the textured regions in the video frame belong.
[0119] In some embodiments, mask labels corresponding to the multiple semantic regions can be determined based on the semantic categories corresponding to the multiple semantic regions and the texture features of the video frame. The mask label of the video frame is then determined based on the mask labels corresponding to the multiple semantic regions.
[0120] Since the method for determining the mask label for each of the multiple semantic regions is the same, we will now take one of the semantic regions as an example. That is, a semantic region is selected from the multiple semantic regions. If a first texture category corresponding to a first semantic category exists in the stored correspondence between semantic categories and texture categories, then the mask label for the selected semantic region is determined based on the first texture category, where the first semantic category is the semantic category corresponding to the selected semantic region. If the first texture category does not exist in the correspondence between semantic categories and texture categories, then the mask label for the selected semantic region is determined based on the texture features within the first image region, where the first image region is the image region corresponding to the selected semantic region in that video frame.
[0121] For some typical and special regions, these regions typically possess rich textures, such as grasslands, buildings, mountains, and plants. Therefore, embodiments of this application predetermine the semantic categories and texture categories of these regions and store the correspondence between semantic categories and texture categories. Thus, for a selected semantic region, if the stored correspondence between semantic categories and texture categories contains a first texture category corresponding to the first semantic category, it indicates that the selected semantic region is a textured region, and a typical and special textured region. Then, a mask label corresponding to the selected semantic region is determined based on the first texture category. If the stored correspondence between semantic categories and texture categories does not contain a first texture category, it indicates that the selected semantic region may be a non-textured region or a textured region, but not a typical and special textured region. In this case, it is necessary to determine the mask label corresponding to the selected semantic region based on the texture features within the first image region.
[0122] It should be noted that a texture category may correspond to one semantic category, and conversely, a texture category may correspond to multiple semantic categories. For example, the semantic categories of "trees" and "grass" correspond to the same texture category, namely "plants." Similarly, the semantic categories of "mountains" and "hills" correspond to the same texture category, namely "mountains."
[0123] Since the mask labels of this video frame are used not only to distinguish between textured and non-textured regions, but also to distinguish between texture categories of different textured regions, embodiments of this application can pre-determine the texture categories corresponding to some typical and special textured regions, as well as the mask labels corresponding to these texture categories, and then store the correspondence between texture categories and mask labels. Thus, when determining the mask label corresponding to the selected semantic region based on the first texture category, the mask label corresponding to the first texture category can be obtained from the correspondence between texture categories and mask labels, and this mask label can be determined as the mask label corresponding to the selected semantic region.
[0124] For example, typical and special texture areas include grassland, buildings, mountains, and plants. The correspondence between the determined texture categories and mask labels for these typical and special texture areas is shown in Table 1 below.
[0125] Table 1
[0126] Texture categories grassland architecture Mountain plant Mask label 2 3 4 5
[0127] It should be noted that the correspondence between texture categories and mask labels shown in Table 1 above is only an example. In practical applications, different correspondences can be determined according to different needs.
[0128] The process of determining the mask label corresponding to the selected semantic region based on the texture features within the first image region includes: acquiring the texture features corresponding to multiple local image regions within the first image region, wherein these multiple local image regions do not overlap; determining the texture similarity between the multiple local image regions and each of the multiple reference video frames (including textured video frames and non-textured video frames) based on the texture similarity; determining the mask label corresponding to the multiple local image regions based on the determined texture similarity; and determining the mask label corresponding to the selected semantic region based on the mask labels corresponding to the multiple local image regions.
[0129] It should be noted that the encoding end can extract the texture features of each local image region using any method, and this application embodiment does not limit this. Furthermore, this application embodiment does not limit the number and resolution of the plurality of reference video frames. For example, the plurality of reference video frames consists of 120 frames, including 60 textured video frames and 60 non-textured video frames, and each reference video frame has a resolution of 256*256. However, to improve the accuracy of the finally determined mask label, the plurality of reference video frames can be homogeneous images. Homogeneity means that the features (such as color, shape, size, height, distribution, etc.) of each part are the same.
[0130] After determining the texture similarity between the plurality of local image regions and each of the plurality of reference video frames, each local image region corresponds to a plurality of texture similarities, and these plurality of texture similarities correspond one-to-one with the plurality of reference video frames. Therefore, in some embodiments, for any local image region, the reference video frames corresponding to the first K texture similarities can be selected in descending order of texture similarity based on the plurality of texture similarities corresponding to the local image region, to obtain K reference video frames. The number of textured video frames and the number of non-textured video frames in the K reference video frames are determined. If the number of non-textured video frames is greater than the number of textured video frames, the local image region is determined to be a non-textured region, and the mask label corresponding to the local image region is determined to be a first value. If the number of textured video frames is greater than the number of non-textured video frames, the local image region is determined to be a textured region, and the mask label corresponding to the local image region is determined to be a second value.
[0131] Since the semantic categories described above can only identify typical and special texture regions, but not non-typical and non-special texture regions (also known as regular texture regions), this embodiment identifies regular texture regions through texture features. When identifying regular texture regions through texture features, if the number of textured video frames in the K reference video frames is greater than the number of non-textured video frames, it indicates that the local image region is a regular texture region. In this case, the mask label corresponding to the local image region can be directly determined as the second value, which is different from the mask label in the above correspondence between texture categories and mask labels. Of course, the above correspondence between texture categories and mask labels can also include the correspondence between texture categories and mask labels for regular texture regions. Thus, if the number of textured video frames in the K reference video frames is greater than the number of non-textured video frames, the texture category corresponding to the local image region can be determined to be a regular texture. Then, the mask label corresponding to the local image region is obtained from the above correspondence between texture categories and mask labels.
[0132] In the case where the correspondence between texture categories and mask labels also includes the correspondence between texture categories and mask labels for regular texture areas, the correspondence between texture categories and mask labels can be shown in Table 2 below.
[0133] Table 2
[0134] Texture categories conventional grassland architecture Mountain plant Mask label 1 2 3 4 5
[0135] It should be noted that the first value is used to indicate that the corresponding area is a non-textured area. Therefore, the first value is different from the mask label corresponding to the textured area. For example, the first value can be 0.
[0136] Additionally, K is a pre-set quantity, for example, K is 10. During application, the value of K can be adjusted according to different needs.
[0137] After identifying K reference video frames, it is necessary to determine whether the local image region is a textured region or a non-textured region based on the number of textured video frames and the number of non-textured video frames among the K reference video frames. Therefore, in some embodiments, K is an odd number. However, if the number of textured video frames and the number of non-textured video frames are equal, it indicates that the area of the textured region and the area of the non-textured region in the local image region are equal. Therefore, in other embodiments, in order not to degrade the encoding quality of the non-textured region, the local image region can be directly determined to be a non-textured region.
[0138] Since the selected semantic region includes multiple local image regions, indicating that the selected semantic region is homogeneous with these multiple local image regions, after determining the mask label corresponding to each local image region, the number of local image regions with mask labels of the first value and the number of local image regions with mask labels of the second value can be determined. If the number of local image regions with mask labels of the first value is greater than the number of local image regions with mask labels of the second value, then the mask label corresponding to the selected semantic region is determined to be the first value. If the number of local image regions with mask labels of the second value is greater than the number of local image regions with mask labels of the first value, then the mask label corresponding to the selected semantic region is determined to be the second value. That is, the mask label with the greater number among the multiple local image regions is taken as the mask label corresponding to the entire semantic region.
[0139] To avoid the number of local image regions with a mask label of the first value being equal to the number of local image regions with a mask label of the second value, in some embodiments, the number of these multiple local image regions is odd. However, if the number of local image regions with a mask label of the first value is equal to the number of local image regions with a mask label of the second value, it indicates that the area of the textured region and the area of the non-textured region in the selected semantic region are equal. Therefore, in other embodiments, in order not to degrade the encoding quality of the non-textured region, the mask label corresponding to the selected semantic region can be directly determined to be the first value.
[0140] It should be noted that the multiple local image regions can constitute the entire semantic region. Of course, the multiple local image regions can be a part of the entire semantic region. This application does not limit this.
[0141] In some embodiments, the mask label takes a value between 0 and 255.
[0142] Since the mask labels corresponding to each semantic region can distinguish between textured and non-textured regions, and also differentiate the texture category to which the textured region belongs, in some embodiments, the mask labels corresponding to the multiple semantic regions can be directly used as the mask labels of the video frame. However, to facilitate subsequent determination of whether each coding block in the multiple coding blocks included in the video frame belongs to a textured or non-textured region, in other embodiments, a simple discrimination can be performed on the mask labels corresponding to the multiple semantic regions to determine the mask label corresponding to each coding block, thereby using the mask labels corresponding to the multiple coding blocks as the mask labels of the video frame. That is, the mask labels of the video frame include the mask labels corresponding to the multiple semantic regions, or include the mask labels corresponding to the multiple coding blocks.
[0143] As an example, for any one of the multiple coding blocks, based on the mask labels corresponding to the multiple semantic regions, the number of pixels corresponding to each mask label within the coding block is counted. The mask label with the highest number of pixels is determined as the mask label corresponding to that coding block.
[0144] For example, please refer to Figure 5 , Figure 5 Figure (a) shows the video frame to be encoded. Semantic segmentation of this video frame yields the first semantic segmentation image as shown below. Figure 5 As shown in Figure (b), the first semantic segmentation map includes multiple semantic regions, each corresponding to a semantic category. Based on the semantic categories corresponding to these multiple semantic regions and the texture features of the video frame, mask labels corresponding to these multiple semantic regions are determined. Furthermore, the mask labels of the video frame determined based on the mask labels corresponding to these multiple semantic regions are as follows: Figure 5 As shown in Figure (c).
[0145] Step 403: Encode the mask label of the video frame and encode the multiple coding blocks included in the video frame.
[0146] When the mask label of the video frame includes mask labels corresponding to multiple coding blocks, the mask label of the video frame can be directly encoded into the bitstream, or the mask labels corresponding to the multiple coding blocks can be encoded into the bitstream in raster order.
[0147] In some embodiments, the mask label corresponding to each coding block can be encoded using exponential Golomb coding. Of course, in other embodiments, the mask label corresponding to each coding block can also be encoded in other ways.
[0148] In this embodiment, the multiple coding blocks can be encoded using conventional encoding methods, or they can be encoded based on the mask tags of the video frame. Of course, other methods can also be used to encode the multiple coding blocks, and this embodiment does not limit this approach.
[0149] The process of encoding multiple coding blocks based on the mask label of the video frame includes: determining the quantization parameters corresponding to each of the multiple coding blocks based on the mask label of the video frame, wherein the quantization parameters corresponding to the coding blocks belonging to the texture region are greater than the quantization parameters corresponding to the coding blocks belonging to the non-texture region; and encoding the multiple coding blocks based on the quantization parameters corresponding to each of the multiple coding blocks.
[0150] Based on the above description, the mask label of the video frame is used to distinguish between textured and non-textured regions. Moreover, the mask label of the video frame includes mask labels corresponding to multiple semantic regions or mask labels corresponding to multiple coding blocks. In either case, after determining the mask label of the video frame, it is possible to determine whether each coding block belongs to a textured or non-textured region based on the mask label of the video frame.
[0151] For example, when the mask labels of the video frame include mask labels corresponding to multiple semantic regions, for any one of the multiple coding blocks, based on the mask labels of the video frame, the number of pixels located within the coding block with a mask label of a first value is counted to obtain a first number. A ratio is determined between the first number and a second number, where the second number is the total number of pixels in the coding block. If the ratio is greater than or equal to a ratio threshold, the coding block is determined to belong to a non-texture region; if the ratio is less than the ratio threshold, the coding block is determined to belong to a texture region. That is, if the ratio is greater than or equal to the ratio threshold, it indicates that most of the area within the coding block is a non-texture region, and the coding block is determined to belong to a non-texture region. If the ratio is less than the ratio threshold, it indicates that most of the area within the coding block is a texture region, and the coding block is determined to belong to a texture region.
[0152] In this way, one coding block can be selected from the multiple coding blocks, and the quantization parameters corresponding to the selected coding block are determined according to the following operations until the quantization parameters corresponding to each coding block are determined: If the selected coding block is determined to belong to a texture region based on the mask label of the video frame, then the standard deviation of the pixel value corresponding to the selected coding block is determined. This standard deviation of the pixel value is used to indicate the texture complexity within the selected coding block. This standard deviation of the pixel value is multiplied by the maximum adjustable quantization parameter to obtain the first quantization parameter. The first quantization parameter is added to the second quantization parameter to obtain the quantization parameter corresponding to the selected coding block. The second quantization parameter is the quantization parameter corresponding to the coding block belonging to the non-texture region among the multiple coding blocks. If the selected coding block is determined to belong to a non-texture region based on the mask label of the video frame, then the quantization parameter corresponding to the selected coding block is determined to be the second quantization parameter.
[0153] In the case where the selected coding block belongs to the texture region, the determination of the quantization parameters corresponding to the selected coding block can also be expressed by the following formula (1).
[0154] QP new =QP old +QP adjust
[0155] QP adjust =QP max *σ i(1)
[0156] In the above formula (1), QP new QP is the quantization parameter corresponding to the selected coding block. old QP is the second quantization parameter. adjust QP is the first quantization parameter. max The maximum adjustable quantization parameter is preset, σ. i The standard deviation of pixel values corresponding to the selected coding block is represented by the average of the standard deviations of pixel values of non-overlapping 8*8 blocks within the selected coding block. It is the value after normalizing the maximum value of the standard deviations of pixel values corresponding to all coding blocks belonging to the texture region within the video frame.
[0157] As can be seen from the above content and formula (1), the adjustment range of the quantization parameter corresponding to the coding block belonging to the texture region is positively correlated with the standard deviation of the pixel value of the coding block. Since the standard deviation of the pixel value is used to represent the texture complexity within the coding block, the greater the texture complexity within the coding block, the greater the degree of occlusion to the human eye, the greater the signal distortion that can be introduced, and the more coding rate is saved.
[0158] It should be noted that the ratio threshold is preset, for example, 0.8. During application, this ratio threshold can be adjusted according to different needs. The first quantization parameter can be determined using the method described above. Alternatively, the first quantization parameter can also be preset, meaning it is a pre-defined quantization parameter that can be adjusted according to different needs.
[0159] Furthermore, for any video segment, there exists a target bitrate, which is the average bitrate after encoding the video segment. Since a video segment comprises multiple frames, the target bitrate allows us to determine the encoding bitrate of that specific frame, and thus, the second quantization parameter is determined based on that encoding bitrate. In other words, the second quantization parameter can be determined using conventional encoding methods.
[0160] Because textured areas are particularly rich in texture, encoding them using conventional encoding methods would consume a significant amount of bitrate. However, users are not sensitive to distortion or changes in textured areas. Therefore, in some embodiments, non-textured areas are encoded using conventional methods, while textured areas are encoded using higher quantization parameters. This reduces the encoding quality of textured areas, thereby lowering the bitrate consumed by textured areas.
[0161] Based on the above description, the quantization parameters of these multiple coding blocks may be different. Therefore, each coding block can be encoded according to its corresponding quantization parameters.
[0162] It should be noted that the encoding method of these multiple encoding blocks can be any encoding method, and this application embodiment does not limit it.
[0163] Step 404: Write the encoding results of the mask labels of the video frame and the encoding results of the multiple encoding blocks into the bitstream.
[0164] To improve the quality of texture regions in the reconstructed video frame at the decoding end, the encoding end can encode the mask tags of the video frame into the bitstream. This allows the decoding end to determine the mask tag corresponding to each reconstructed coding block based on the mask tag of the video frame. Then, based on the mask tag corresponding to each reconstructed coding block, the decoding end can determine the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region from multiple texture enhancement networks. Finally, by using the texture enhancement networks corresponding to each reconstructed coding block belonging to the texture region, texture enhancement is performed on each reconstructed coding block belonging to the texture region, thereby improving the quality of texture regions in the reconstructed video frame.
[0165] Because textured regions are particularly rich in texture, directly encoding these regions using conventional encoding methods would consume a significant amount of bitrate. However, the human eye is not sensitive to distortions or changes in these textured regions. Therefore, in this embodiment, the quantization parameters of the textured regions are increased to encode multiple coding blocks within the video frame, thereby reducing the bitrate occupied by the coding blocks belonging to the textured regions and ultimately reducing the overall bitrate of the video frame. This reduces the bitrate while maintaining the quality of the textured regions in the reconstructed video frame at the decoding end.
[0166] In addition, the embodiments of this application consider both the semantic and texture attributes of video frames, which can not only distinguish between typical and special texture regions, but also between regular texture regions, thereby improving the accuracy of texture classification and enabling adaptive texture enhancement for different texture categories in the future.
[0167] Please refer to Figure 6 , Figure 6 This is a flowchart of the first video decoding method provided in the embodiments of this application. The method includes the following steps.
[0168] Step 601: Parse the bitstream to obtain multiple reconstructed coding blocks and mask labels of the video frames to be reconstructed. The mask labels of the video frames to be reconstructed are used to distinguish between textured and non-textured regions, as well as to distinguish the texture category to which the textured regions belong.
[0169] Since the bitstream includes the encoding results of multiple coding blocks of the video frame and the encoding results of the mask labels of the video frame, the decoding end can parse the encoding results of these multiple coding blocks and the encoding results of the mask labels of the video frame in the bitstream to obtain multiple reconstructed coding blocks and the mask labels of the video frame to be reconstructed.
[0170] Based on the above description, these multiple coded blocks can be encoded using a conventional encoder, so the decoding end can also be decoded using a conventional decoder.
[0171] Step 602: Determine the mask labels corresponding to the multiple reconstructed coding blocks based on the mask labels of the video frames to be reconstructed. The mask labels are used to distinguish between textured regions and non-texture regions, and to distinguish the texture category to which the textured regions belong.
[0172] Based on the foregoing description, the mask labels of a video frame may include mask labels corresponding to multiple semantic regions, or they may include mask labels corresponding to multiple coded blocks. When the video frame mask labels include mask labels corresponding to multiple coded blocks, the decoder can directly determine the mask labels corresponding to the multiple reconstructed coded blocks from the video frame mask labels. When the video frame mask labels include mask labels corresponding to multiple semantic regions, the decoder can perform a simple discrimination based on the video frame mask labels to determine the mask labels corresponding to the multiple reconstructed coded blocks.
[0173] For a simple method of identification, please refer to the previous description; it will not be repeated here.
[0174] Step 603: Based on the mask labels corresponding to each reconstructed coding block belonging to the texture region in the multiple reconstructed coding blocks, determine the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region from the multiple texture enhancement networks.
[0175] To reduce the coding rate, the encoder increases the quantization parameters of the coding blocks belonging to the texture region, thereby reducing the coding quality of these blocks. However, to minimize distortion in the reconstructed texture region, the decoder needs to enhance the texture of each reconstructed coding block belonging to the texture region. Similarly, after encoding the coding blocks belonging to the texture region using conventional methods, the decoder also needs to enhance the texture of each reconstructed coding block belonging to the texture region to improve its quality.
[0176] In this embodiment, different texture categories correspond to different texture enhancement networks, and texture categories can be distinguished by the mask labels corresponding to the coding blocks. That is, different mask labels correspond to different texture enhancement networks. Therefore, after determining the mask labels corresponding to each reconstructed coding block, a corresponding texture enhancement network can be selected from the multiple texture enhancement networks based on the mask labels corresponding to each reconstructed coding block belonging to the texture region, so as to obtain the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region.
[0177] For example, these multiple texture enhancement networks include a grass texture enhancement network, a building texture enhancement network, a mountain texture enhancement network, a plant texture enhancement network, and a regular texture enhancement network. After determining the mask labels corresponding to each reconstructed coding block belonging to the texture region, it is possible to determine the texture enhancement network corresponding to each of these reconstructed coding blocks from these multiple texture enhancement networks.
[0178] Step 604: Input each of the reconstructed coding blocks belonging to the texture region into its corresponding texture enhancement network to obtain multiple texture enhancement coding blocks.
[0179] Since the purpose of this application embodiment is to improve the quality of textured regions, this application embodiment only needs to determine the texture enhancement network corresponding to each reconstructed coding block belonging to the textured region, and then perform texture enhancement, without needing to perform texture enhancement on the reconstructed coding blocks belonging to non-textured regions.
[0180] This application's embodiments design a generative adversarial network (GAN) that uses mask labels as a multi-model index to perform texture enhancement. The GAN includes a generator and a discriminator. The discriminator distinguishes between unencoded video frames and reconstructed video frames, and tries to classify reconstructed video frames as "fake" and unencoded video frames as "real." The generator, on the other hand, tries to "deceive" the discriminator by generating realistic images through adversarial learning.
[0181] Please refer to Figure 7 , Figure 7 This is a schematic diagram of a generator provided in an embodiment of this application. The generator uses a super-resolution generative adversarial network (SRGAN) as its basic architecture, removing the upsampling at the end of the network and subsequent layers. The generator includes two convolutional layers (Conv) and 12 cascaded residual blocks (Resblocks). Each Resblock includes two convolutional layers with 3x3 kernels and 48 channels.
[0182] Please refer to Figure 8 , Figure 8 This is a schematic diagram of a discriminator provided in an embodiment of this application. The discriminator adopts the structure of the Enhanced Super-Resolution Generative Adversarial Network (ESRGAN) in the video super-resolution field, including four discriminator blocks. Each discriminator block includes two sets of basic convolutional units, which include convolutional layers (Conv), batch normalization (BN) layers, and LeakyReLU (with leakage correction linear units, a typical activation function) layers. To save computation and reduce computational complexity, the second convolutional layer of each discriminator block downsamples the input features, reducing the feature size to 1 / 4 of the original.
[0183] In this embodiment of the application, the generator and the discriminator can be trained simultaneously, and the training loss of the generator consists of the following three parts:
[0184] (1) The mean square error (MSE) loss representing the signal fidelity is denoted as L. rec It is determined by the following formula (2).
[0185] L rec =MSE(x r ,x f (2)
[0186] Where, x r For the real samples used in network training, i.e., unencoded video frame samples, x f This is to generate samples, which are video frame samples reconstructed after texture enhancement.
[0187] (2) Calculate the perceptual loss for the feature domain distance, denoted as L. P It is determined by the following formula (3).
[0188] L P =VGG(x r ,x f (3)
[0189] Since the visual geometry group (VGG) is a high-performance feature extractor, this embodiment uses VGG loss as the perceptual loss for network training. That is, real and generated samples are input into a pre-trained VGG19 network, features are extracted through the Conv5_4 layer in the VGG19 network, and then the perceptual loss is calculated using these features.
[0190] (3) Countermeasure loss, denoted as L G It is determined by the following formula (4).
[0191]
[0192] In formula (4) above, D(x) r ) and D(x f E[D(x)] represents the value of the sample after passing through the discriminator. f E[D(x)] represents the expected value of multiple generated samples after passing through the discriminator. r [)] represents the expected value of multiple real samples after passing through the discriminator. Represents log(1-D(x)) of multiple real samples r ,x f The expected value of ) Represents the log(D(x) of multiple generated samples f ,x r The expected value of ).
[0193] In summary, the training loss of the generator is obtained by summing the above three losses according to their weights, and can be expressed by the following formula (5).
[0194] L G,total =μ rec L rec +μ p L P +μ GAN L G (5)
[0195] In formula (5) above, μ rec μ p μ GAN These are the weights corresponding to the three parts of loss mentioned above.
[0196] The training loss of the discriminator is denoted as L. D Furthermore, this training loss is consistent with the aforementioned adversarial loss L. G They are opposite and antagonistic, which can be represented by the following formula (6).
[0197]
[0198] It should be noted that the multiple texture enhancement networks involved in this application embodiment are generators in the aforementioned generative adversarial networks (GANs). These multiple texture enhancement networks include a conventional texture enhancement network and multiple typical and specific texture enhancement networks. For the conventional texture enhancement network, the aforementioned GAN can be trained using a dataset that includes texture regions. However, for the multiple typical and specific texture enhancement networks, multiple datasets corresponding one-to-one with the multiple typical and specific texture categories can be obtained. In this way, the aforementioned GAN can be trained separately using these multiple datasets, thereby obtaining multiple typical and specific texture enhancement networks.
[0199] Because the texture categories and patterns in these multiple datasets are relatively uniform, training the generative adversarial network (GAN) on these datasets makes it easier for the GAN to learn the characteristics of the datasets. In this case, the size of these multiple typical and specialized texture enhancement networks can be smaller than that of a conventional texture enhancement network. For example, it could include 8 Resblocks, with each Resblock having 20 channels in its convolutional layers.
[0200] After training the generator and discriminator using the methods described above, multiple texture enhancement networks can be obtained. Each reconstructed coding block belonging to a texture region is then input into its corresponding texture enhancement network to obtain multiple texture enhancement coding blocks. Alternatively, this can be understood as inputting a base reconstructed frame into multiple texture enhancement networks, where each reconstructed coding block's corresponding texture enhancement network performs texture enhancement on different reconstructed coding blocks within the base reconstructed frame to obtain a texture enhancement frame.
[0201] Step 605: Concatenate the reconstructed coding blocks belonging to non-texture regions among the multiple reconstructed coding blocks with the multiple texture enhancement coding blocks to obtain the reconstructed video frame.
[0202] To improve the quality of texture regions in the reconstructed video frames at the decoding end, the encoding end encodes the mask tags of the video frames into the bitstream. This allows the decoding end to determine the mask tag corresponding to each reconstructed coding block based on the mask tags of the video frames. Then, based on the mask tags corresponding to each coding block, the decoding end determines the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region from multiple texture enhancement networks. Finally, by using the texture enhancement networks corresponding to each reconstructed coding block belonging to the texture region, texture enhancement is performed on each reconstructed coding block belonging to the texture region, thereby improving the quality of texture regions in the reconstructed video frames.
[0203] Furthermore, since different texture categories correspond to different textures, embodiments of this application can select the corresponding texture enhancement network from the multiple texture enhancement networks based on the mask labels corresponding to each reconstructed coding block belonging to the texture region in the multiple reconstructed coding blocks, so as to obtain the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region, and then perform texture enhancement according to their respective texture enhancement networks, so as to make texture enhancement more targeted and ensure that the quality of the reconstructed video frame is optimal.
[0204] In combination with the above Figure 4 The encoding method shown and Figure 6 The decoding method shown below will be explained exemplarily in the following embodiments of this application.
[0205] Please refer to Figure 9 , Figure 9 This is an exemplary block diagram of a video encoding / decoding method provided in an embodiment of this application. Figure 9 In the encoding process, the encoder performs texture region discrimination on the video frame to identify textured and non-texture regions. Then, based on the texture region discrimination results, it determines the standard deviation of pixel values for each coding block belonging to the texture region within the multiple coding blocks of the video frame. This allows for the adjustment of the quantization parameters of the coding blocks belonging to the texture region. Furthermore, the texture region discrimination results can also be used to determine the mask label of the video frame. Finally, the encoder encodes these multiple coding blocks and the mask label of the video frame into the bitstream and transmits it to the decoder.
[0206] After receiving the bitstream transmitted from the encoding end, the decoding end parses the bitstream to obtain multiple reconstructed coding blocks and mask labels for video frames. Based on the mask labels of the video frames, the corresponding mask labels for these multiple reconstructed coding blocks are determined. Then, based on the mask labels corresponding to each reconstructed coding block belonging to the texture region, the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region is determined. After texture enhancement is performed through their respective texture enhancement networks, the texture-enhanced frame, i.e., the reconstructed video frame, can be determined.
[0207] Please refer to Figure 10 , Figure 10 This is a flowchart of a second video encoding method provided in an embodiment of this application. In this embodiment, the attribute information of the video frame includes texture features. The method includes the following steps.
[0208] Step 1001: Based on the texture features corresponding to the multiple coding blocks included in the video frame to be encoded, determine the mask labels corresponding to the multiple coding blocks respectively.
[0209] Since the mask labels for each of the multiple coding blocks are determined in the same way, one coding block can be selected from these multiple coding blocks, and the mask label corresponding to the selected coding block can be determined according to the following operations until the mask label corresponding to each coding block is determined: Obtain the texture features corresponding to multiple local image regions within the selected coding block, where these multiple local image regions do not overlap. Based on the texture features corresponding to these multiple local image regions, and the texture features corresponding to multiple stored reference video frames, determine the texture similarity between each of the multiple local image regions and each of the multiple reference video frames, which includes textured video frames and non-textured video frames. Based on the determined texture similarity, determine the mask labels corresponding to each of the multiple local image regions. Based on the mask labels corresponding to each of the multiple local image regions, determine the mask label corresponding to the selected coding block.
[0210] It should be noted that step 402 above determines the mask label corresponding to a semantic region by using texture features within the semantic region, while step 1001 determines the mask label corresponding to a coding block by using texture features within the coding block. The specific implementation methods are the same, and will not be described again in this embodiment.
[0211] Furthermore, based on the foregoing description, semantic categories can identify typical and special texture regions, but not regular texture regions. Therefore, while typical and special texture regions can be identified through semantic categories, regular texture regions can also be identified through texture features. In this embodiment, the attribute information of the video frame includes texture features but not semantic categories. Therefore, this embodiment can directly identify texture regions through texture features, but cannot classify them. That is, this embodiment cannot distinguish between typical and special texture regions from the identified texture regions. In this case, the mask label corresponding to the coded block is a first value or a second value. The first value is used to indicate that the corresponding coded block belongs to a non-texture region, and the second value is used to indicate that the corresponding coded block belongs to a texture region.
[0212] Mask labels are used to indicate whether the corresponding region is a textured region or a non-textured region. In some embodiments, the mask label value is a value between 0 and 255, for example, a first value of 0 and a second value of 1. Thus, after determining the mask label corresponding to each coded block, the mask labels corresponding to these multiple coded blocks are used as the mask labels for the video frame. That is, the mask label for the video frame includes the mask labels corresponding to each of the multiple coded blocks, and the video frame mask label includes binarized mask labels.
[0213] Step 1002: Use the mask labels corresponding to the multiple coding blocks as the mask labels of the video frame, encode the mask labels of the video frame, and encode the multiple coding blocks included in the video frame.
[0214] In the embodiments of this application, the mask labels corresponding to multiple coding blocks can be directly encoded into the bitstream, or the mask labels corresponding to the multiple coding blocks can be encoded into the bitstream in the order of the grating.
[0215] In some embodiments, the mask label corresponding to each coding block can be encoded using exponential Golomb coding. Of course, in other embodiments, the mask label corresponding to each coding block can also be encoded in other ways.
[0216] In this embodiment, the multiple coding blocks can be encoded using conventional encoding methods, or they can be encoded based on the mask labels corresponding to the multiple coding blocks. Of course, other methods can also be used to encode the multiple coding blocks, and this embodiment does not limit this approach.
[0217] The process of encoding multiple coding blocks based on mask labels includes: determining the quantization parameters corresponding to each coding block based on the mask labels, wherein the quantization parameters of coding blocks belonging to texture regions are greater than those of coding blocks belonging to non-texture regions; and encoding the multiple coding blocks based on their respective quantization parameters.
[0218] For any one of the multiple coding blocks, if the mask label corresponding to the coding block is a first value, it indicates that the coding block belongs to a non-texture region, and the quantization parameter corresponding to the coding block is determined as the second quantization parameter. If the mask label corresponding to the coding block is a second value, it indicates that the coding block belongs to a texture region, and the standard deviation of the pixel value corresponding to the coding block is determined. This standard deviation of the pixel value is used to indicate the texture complexity within the coding block. The standard deviation of the pixel value is multiplied by the maximum adjustable quantization parameter to obtain the first quantization parameter. The first quantization parameter is added to the second quantization parameter to obtain the quantization parameter corresponding to the coding block.
[0219] The content related to the first quantization parameter, and the method of encoding the coding block based on the quantization parameter corresponding to each coding block, has been explained in the previous text. Please refer to the relevant descriptions in the previous text for details, and they will not be repeated here.
[0220] Step 1003: Write the encoding results of the mask labels of the video frame and the encoding results of the multiple encoding blocks into the bitstream.
[0221] To improve the quality of texture regions in the reconstructed video frame at the decoding end, the encoding end can encode the mask tags of the video frame into the bitstream. This allows the decoding end to determine the mask tag corresponding to each reconstructed coding block based on the mask tag of the video frame. Then, based on the mask tag corresponding to each reconstructed coding block, the decoding end can determine the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region from multiple texture enhancement networks. Finally, by using the texture enhancement networks corresponding to each reconstructed coding block belonging to the texture region, texture enhancement is performed on each reconstructed coding block belonging to the texture region, thereby improving the quality of texture regions in the reconstructed video frame.
[0222] Because textured regions are particularly rich in texture, directly encoding these regions using conventional encoding methods would consume a significant amount of bitrate. However, the human eye is not sensitive to distortions or changes in these textured regions. Therefore, in this embodiment, the quantization parameters of the textured regions are increased to encode multiple coding blocks within the video frame, thereby reducing the bitrate occupied by the coding blocks belonging to the textured regions and ultimately reducing the overall bitrate of the video frame. This reduces the bitrate while maintaining the quality of the textured regions in the reconstructed video frame at the decoding end.
[0223] Please refer to Figure 11 , Figure 11 This is a flowchart of a second video decoding method provided in an embodiment of this application. The method includes the following steps.
[0224] Step 1101: Parse the bitstream to obtain multiple reconstructed coding blocks and mask labels for the video frames to be reconstructed. The mask labels for the video frames to be reconstructed are used to distinguish between textured and non-textured regions.
[0225] For an explanation of step 1101, please refer to the content in step 601; it will not be repeated here.
[0226] Step 1102: Perform semantic segmentation on the basic reconstructed frame to obtain a second semantic segmentation map. The basic reconstructed frame is a video frame obtained by splicing the multiple reconstructed coding blocks. The second semantic segmentation map includes multiple semantic regions, and each semantic region corresponds to a semantic category.
[0227] The method for semantic segmentation of the basic reconstructed frames is the same as the method for semantic segmentation of video frames described above. Please refer to the description above for details, which will not be repeated here.
[0228] Step 1103: Based on the mask labels of the video frames to be reconstructed and the semantic categories corresponding to the multiple semantic regions, determine the mask labels corresponding to the multiple semantic regions respectively.
[0229] In some embodiments, a semantic region is selected from the plurality of semantic regions, and the selected semantic region is processed according to the following operations until each semantic region has been processed: If a second texture category corresponding to a second semantic category exists in the stored correspondence between semantic categories and texture categories, then a mask label corresponding to the selected semantic region is determined based on the second texture category, where the second semantic category is the semantic category corresponding to the selected semantic region. If a second texture category does not exist in the correspondence between semantic categories and texture categories, then a mask label corresponding to the selected semantic region is determined based on the mask label of the video frame.
[0230] The method of determining the mask label corresponding to the selected semantic region based on the second texture category is similar to the method of determining the mask label corresponding to the selected semantic region based on the first texture category mentioned above. Please refer to the relevant description in step 402 above for details, which will not be repeated here.
[0231] If a second texture category exists in the stored correspondence between semantic categories and texture categories, it indicates that the selected semantic region is a typical or special texture region. In this case, the mask label corresponding to the selected semantic region can be determined based on the second texture category. If no second texture category exists in the stored correspondence between semantic categories and texture categories, it indicates that the selected semantic region may be a regular texture region or a non-texture region. In this case, the number of pixels within the selected semantic region with a mask label of the first value and the number of pixels with a mask label of the second value can be determined based on the mask label of the video frame. If the number of pixels with a mask label of the first value is greater than the number of pixels with a mask label of the second value, then the mask label corresponding to the selected semantic region is determined to be the first value; otherwise, the mask label corresponding to the selected semantic region is determined to be the second value.
[0232] Since the mask labels of video frames can only distinguish between textured and non-textured regions, but not between regions with different texture categories within a textured region, this embodiment of the application can also determine the mask labels corresponding to typical and special textured regions based on the semantic category corresponding to each semantic region in the second semantic segmentation map. After determining the mask labels corresponding to typical and special textured regions, the remaining textured regions are considered regular textured regions. In this way, not only can textured and non-textured regions be distinguished, but also the texture category to which the textured region belongs can be identified.
[0233] Step 1104: Based on the mask labels corresponding to the multiple semantic regions, determine the mask labels corresponding to the multiple reconstructed coding blocks. The mask labels are used to distinguish between texture regions and non-texture regions, and to distinguish the texture category to which the texture region belongs.
[0234] Since the mask label corresponding to each semantic region is used not only to distinguish between textured and non-textured regions, but also to distinguish the texture category to which the textured region belongs, the mask labels corresponding to these multiple semantic regions can be easily judged to determine the mask labels corresponding to these multiple reconstructed coding blocks respectively.
[0235] The simple method of identification is the same as that described above; please refer to the relevant descriptions above for details, which will not be repeated here.
[0236] Step 1105: Based on the mask labels corresponding to each reconstructed coding block belonging to the texture region in the multiple reconstructed coding blocks, determine the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region from the multiple texture enhancement networks.
[0237] For an explanation of step 1105, please refer to step 603; it will not be repeated here.
[0238] Step 1106: Input each of the reconstructed coding blocks belonging to the texture region into its corresponding texture enhancement network to obtain multiple texture enhancement coding blocks.
[0239] For an explanation of step 1106, please refer to step 604; it will not be repeated here.
[0240] Step 1107: Concatenate the reconstructed coding blocks belonging to non-texture regions among the multiple reconstructed coding blocks with the multiple texture enhancement coding blocks to obtain the reconstructed video frame.
[0241] Since the mask labels of video frames can only distinguish between textured and non-textured regions, but not between regions of different texture categories within a textured region, this embodiment of the application can also determine the mask labels corresponding to typical and special textured regions based on the semantic category corresponding to each semantic region in the second semantic segmentation map. In this way, the decoding end can not only distinguish between textured and non-textured regions, but also distinguish the texture category to which the textured region belongs. Then, based on the mask labels corresponding to these multiple semantic regions, it can determine the mask label corresponding to each reconstructed coding block. Furthermore, based on the mask labels corresponding to each coding block, it can determine the texture enhancement network corresponding to each reconstructed coding block belonging to the textured region from multiple texture enhancement networks. Thus, by using the texture enhancement networks corresponding to each reconstructed coding block belonging to the textured region, texture enhancement is performed on each reconstructed coding block belonging to the textured region, thereby improving the quality of the textured regions in the reconstructed video frame.
[0242] Furthermore, since different texture categories correspond to different textures, embodiments of this application can select the corresponding texture enhancement network from the multiple texture enhancement networks based on the mask labels corresponding to each reconstructed coding block belonging to the texture region in the multiple reconstructed coding blocks, so as to obtain the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region, and then perform texture enhancement according to their respective texture enhancement networks, so as to make texture enhancement more targeted and ensure that the quality of the reconstructed video frame is optimal.
[0243] Please refer to Figure 12 , Figure 12 This is a flowchart of a third video encoding method provided in an embodiment of this application. In this embodiment, the attribute information of the video frame includes semantic categories. The method includes the following steps.
[0244] Step 1201: Perform semantic segmentation on the video frame to be encoded to obtain a first semantic segmentation map. The first semantic segmentation map includes multiple semantic regions, and each semantic region corresponds to a semantic category.
[0245] For an explanation of step 1201, please refer to step 401; it will not be repeated here.
[0246] Step 1202: Use the semantic categories corresponding to the multiple semantic regions as the mask labels of the video frame, encode the mask labels of the video frame, and encode the multiple coding blocks included in the video frame.
[0247] Since the embodiments of this application use the semantic categories corresponding to the multiple semantic regions included in the first semantic segmentation map as the mask labels of the video frame, and based on the foregoing description, typical and special texture regions can be identified through semantic categories, the embodiments of this application can determine whether each semantic region belongs to a texture region or a non-texture region based on the semantic category corresponding to each semantic region.
[0248] Since the method for determining whether each semantic region belongs to a texture region or a non-texture region is the same, we will now use one semantic region as an example. That is, from among the multiple semantic regions, if a first texture category corresponding to a first semantic category exists in the stored correspondence between semantic categories and texture categories, then the selected semantic region is determined to belong to a texture region, and the first semantic category is the semantic category corresponding to the selected semantic region. If the first texture category does not exist in the correspondence between semantic categories and texture categories, then the selected semantic region is determined to belong to a non-texture region.
[0249] In this embodiment, the multiple coding blocks can be encoded using conventional encoding methods, or they can be encoded based on the mask tags of the video frame. Of course, other methods can also be used to encode the multiple coding blocks, and this embodiment does not limit this approach.
[0250] When encoding multiple coding blocks based on the mask labels of the video frame, after determining whether each semantic region belongs to a textured region or a non-textured region, the classification of each coding block can be easily determined. Next, the quantization parameters corresponding to these multiple coding blocks are determined, with the quantization parameters corresponding to coding blocks belonging to textured regions being greater than those corresponding to coding blocks belonging to non-textured regions. Based on the quantization parameters corresponding to each of these multiple coding blocks, encoding is then performed.
[0251] For any coded block, if the coded block belongs to a non-texture region, then the quantization parameter corresponding to the coded block is determined as the second quantization parameter. If the coded block belongs to a texture region, then the standard deviation of the pixel values corresponding to the coded block is determined, and this standard deviation of pixel values is used to indicate the texture complexity within the coded block. This standard deviation of pixel values is multiplied by the maximum adjustable quantization parameter to obtain the first quantization parameter. The first quantization parameter is added to the second quantization parameter to obtain the quantization parameter corresponding to the coded block.
[0252] For the simple discrimination method, please refer to the previous description. In addition, the relevant content of the first quantization parameter and the method of encoding the coding block based on the quantization parameter corresponding to each coding block have been explained in the previous text. Please refer to the relevant description in the previous text for details, and it will not be repeated here.
[0253] Step 1203: Write the encoding results of the mask labels of the video frame and the encoding results of the multiple encoding blocks into the bitstream.
[0254] To improve the quality of texture regions in the reconstructed video frame at the decoding end, the encoding end can encode the mask tags of the video frame into the bitstream. This allows the decoding end to determine the mask tag corresponding to each reconstructed coding block based on the mask tag of the video frame. Then, based on the mask tag corresponding to each reconstructed coding block, the decoding end can determine the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region from multiple texture enhancement networks. Finally, by using the texture enhancement networks corresponding to each reconstructed coding block belonging to the texture region, texture enhancement is performed on each reconstructed coding block belonging to the texture region, thereby improving the quality of texture regions in the reconstructed video frame.
[0255] Because textured regions are particularly rich in texture, directly encoding these regions using conventional encoding methods would consume a significant amount of bitrate. However, the human eye is not sensitive to distortions or changes in these textured regions. Therefore, in this embodiment, the quantization parameters of the textured regions are increased to encode multiple coding blocks within the video frame, thereby reducing the bitrate occupied by the coding blocks belonging to the textured regions and ultimately reducing the overall bitrate of the video frame. This reduces the bitrate while maintaining the quality of the textured regions in the reconstructed video frame at the decoding end.
[0256] Please refer to Figure 13 , Figure 13 This is a flowchart of a third video decoding method provided in an embodiment of this application. The method includes the following steps.
[0257] Step 1301: Parse the bitstream to obtain multiple reconstructed coding blocks and mask labels of the video frames to be reconstructed. The mask labels of the video frames to be reconstructed include semantic categories corresponding to multiple semantic regions.
[0258] For an explanation of step 1301, please refer to the content in step 601; it will not be repeated here.
[0259] Step 1302: Based on the semantic categories corresponding to the multiple semantic regions and the texture features of the base reconstructed frame, determine the mask labels corresponding to the multiple semantic regions. The base reconstructed frame is obtained by concatenating the multiple reconstructed coding blocks.
[0260] In some embodiments, a semantic region is selected from the plurality of semantic regions, and the mask label corresponding to the selected semantic region is determined according to the following operations until the mask label corresponding to each semantic region is determined: if a first texture category corresponding to a first semantic category exists in the stored correspondence between semantic categories and texture categories, then the mask label corresponding to the selected semantic region is determined based on the first texture category, where the semantic category is the semantic category corresponding to the selected semantic region. If a first texture category does not exist in the stored correspondence between semantic categories and texture categories, then the mask label corresponding to the selected semantic region is determined based on the texture features in a second image region, where the second image region is the image region corresponding to the selected semantic region in the base reconstruction frame.
[0261] The process of determining the mask label corresponding to the selected semantic region based on the texture features within the second image region includes: acquiring the texture features corresponding to multiple local image regions within the second image region, wherein these multiple local image regions do not overlap; determining the texture similarity between each of the multiple local image regions and each of the multiple reference video frames (including textured video frames and non-texture video frames) based on the determined texture similarity; determining the mask label corresponding to each of the multiple local image regions based on the determined texture similarity; and determining the mask label corresponding to the selected semantic region based on the mask labels corresponding to the multiple local image regions.
[0262] The method for determining the mask label corresponding to the selected semantic region based on the first texture category is described in step 402 above, and will not be repeated here.
[0263] Furthermore, the method of determining the mask label corresponding to the selected semantic region based on the texture features in the second image region is similar to the method of determining the mask label corresponding to the selected semantic region based on the texture features in the first image region in step 401 above. Please refer to the previous description for details, which will not be repeated here.
[0264] Step 1303: Based on the mask labels corresponding to the multiple semantic regions, determine the mask labels corresponding to the multiple reconstructed coding blocks.
[0265] Specifically, based on the mask labels corresponding to the multiple semantic regions, the mask labels corresponding to the multiple reconstructed coding blocks are determined through simple discrimination. The method for simple discrimination is described in the preceding text and will not be repeated here.
[0266] Step 1304: Based on the mask labels corresponding to each reconstructed coding block belonging to the texture region in the multiple reconstructed coding blocks, determine the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region from the multiple texture enhancement networks.
[0267] For an explanation of step 1304, please refer to step 603; it will not be repeated here.
[0268] Step 1305: Input each of the reconstructed coding blocks belonging to the texture region into its corresponding texture enhancement network to obtain multiple texture enhancement coding blocks.
[0269] For an explanation of step 1305, please refer to step 604; it will not be repeated here.
[0270] Step 1306: Concatenate the reconstructed coding blocks belonging to non-texture regions among the multiple reconstructed coding blocks with the multiple texture enhancement coding blocks to obtain the reconstructed video frame.
[0271] Since the encoding end encodes the semantic categories corresponding to the multiple semantic regions included in the first semantic segmentation map as mask labels for the video frames into the bitstream, after the decoding end parses the mask labels of the video frames, it can determine the mask label corresponding to each reconstructed coding block based on the semantic category corresponding to each semantic region in the multiple semantic regions and the texture features of the basic reconstructed frame. Then, based on the mask labels corresponding to each coding block, it can determine the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region from multiple texture enhancement networks. Thus, through the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region, texture enhancement is performed on each reconstructed coding block belonging to the texture region, thereby improving the quality of the texture region in the reconstructed video frame.
[0272] Furthermore, since different texture categories correspond to different textures, embodiments of this application can select the corresponding texture enhancement network from the multiple texture enhancement networks based on the mask labels corresponding to each reconstructed coding block belonging to the texture region in the multiple reconstructed coding blocks, so as to obtain the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region, and then perform texture enhancement according to their respective texture enhancement networks, so as to make texture enhancement more targeted and ensure that the quality of the reconstructed video frame is optimal.
[0273] Please refer to Figure 14 , Figure 14 This is a flowchart of the fourth video encoding method provided in this application embodiment. In this embodiment, the attribute information of the video frame includes semantic category and texture features. The method includes the following steps.
[0274] Step 1401: Perform semantic segmentation on the video frame to be encoded to obtain a first semantic segmentation map. The first semantic segmentation map includes multiple semantic regions, and each semantic region corresponds to a semantic category.
[0275] For an explanation of step 1401, please refer to the content in step 401; it will not be repeated here.
[0276] Step 1402: Based on the semantic categories corresponding to the multiple semantic regions and the texture features of the video frame, determine the mask label of the video frame. The mask label of the video frame is used to distinguish between textured regions and non-textured regions in the video frame, and to distinguish the texture category to which the textured regions in the video frame belong.
[0277] For an explanation of step 1402, please refer to the content in step 402; it will not be repeated here.
[0278] Step 1403: Encode the multiple coding blocks included in the video frame based on the mask label of the video frame.
[0279] For an explanation of step 1403, please refer to the content in step 403; it will not be repeated here.
[0280] Step 1404: Write the encoding results of the multiple encoding blocks into the bitstream.
[0281] Because texture regions are exceptionally rich in texture, directly encoding these regions using conventional encoding methods would consume a significant amount of bitrate. However, the human eye is not sensitive to distortions or changes in these texture regions. Therefore, in this embodiment, the quantization parameters of the texture regions are increased to encode multiple coding blocks within the video frame, thereby reducing the bitrate occupied by the coding blocks belonging to the texture regions and ultimately lowering the overall bitrate of the video frame. Furthermore, this embodiment considers both the semantic and texture attributes of the video frame, enabling the differentiation not only of typical and special texture regions but also of regular texture regions. This improves the accuracy of texture classification and allows for adaptive texture enhancement for different texture categories.
[0282] Please refer to Figure 15 , Figure 15 This is a flowchart of the fourth video decoding method provided in the embodiments of this application. The method includes the following steps.
[0283] Step 1501: Parse the bitstream to obtain multiple reconstructed coding blocks.
[0284] Step 1502: Perform semantic segmentation on the basic reconstructed frame to obtain a second semantic segmentation map. The basic reconstructed frame is a video frame obtained by splicing the multiple reconstructed coding blocks. The second semantic segmentation map includes multiple semantic regions, and each semantic region corresponds to a semantic category.
[0285] Step 1503: Based on the semantic categories corresponding to the multiple semantic regions and the texture features of the basic reconstructed frame, determine the mask labels corresponding to the multiple semantic regions.
[0286] The method for determining the mask labels corresponding to the multiple semantic regions based on their respective semantic categories and the texture features of the base reconstructed frame is described in step 1302 and will not be repeated here.
[0287] Step 1504: Based on the mask labels corresponding to the multiple semantic regions, determine the mask labels corresponding to the multiple reconstructed coding blocks.
[0288] The method for determining the mask labels corresponding to the multiple reconstructed coding blocks based on the mask labels corresponding to the multiple semantic regions is described in the previous text and will not be repeated here.
[0289] Step 1505: Based on the mask labels corresponding to each reconstructed coding block belonging to the texture region in the multiple reconstructed coding blocks, determine the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region from the multiple texture enhancement networks.
[0290] For an explanation of step 1505, please refer to step 603; it will not be repeated here.
[0291] Step 1506: Input each of the reconstructed coding blocks belonging to the texture region into its corresponding texture enhancement network to obtain multiple texture enhancement coding blocks.
[0292] For an explanation of step 1506, please refer to step 604; it will not be repeated here.
[0293] Step 1507: Concatenate the reconstructed coding blocks belonging to non-texture regions among the multiple reconstructed coding blocks with the multiple texture enhancement coding blocks to obtain the reconstructed video frame.
[0294] Since the encoding end does not encode the mask labels of the video frames into the bitstream, after the decoding end parses out multiple reconstructed coding blocks, it can determine the mask label corresponding to each reconstructed coding block based on the base reconstructed frame, in the same way as the encoding end. Then, based on the mask label corresponding to each reconstructed coding block, it can determine the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region from multiple texture enhancement networks. Thus, by using the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region, texture enhancement is performed on each reconstructed coding block belonging to the texture region, thereby improving the quality of the texture region in the reconstructed video frame.
[0295] Furthermore, since different texture categories correspond to different textures, embodiments of this application can select the corresponding texture enhancement network from the multiple texture enhancement networks based on the mask labels corresponding to each reconstructed coding block belonging to the texture region in the multiple reconstructed coding blocks, so as to obtain the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region, and then perform texture enhancement according to their respective texture enhancement networks, so as to make texture enhancement more targeted and ensure that the quality of the reconstructed video frame is optimal.
[0296] In combination with the above Figure 14 The encoding method shown and Figure 15 The decoding method shown below will be explained exemplarily in the following embodiments of this application.
[0297] Please refer to Figure 16 , Figure 16 This is an exemplary block diagram of a video encoding / decoding method provided in an embodiment of this application. Figure 9 In the process, the encoding end performs texture region discrimination on the video frame to identify textured and non-texture regions. Then, based on the texture region discrimination results, it determines the standard deviation of the pixel values corresponding to each coding block belonging to the texture region among the multiple coding blocks included in the video frame, and then adjusts the quantization parameters of the coding blocks belonging to the texture region among these multiple coding blocks. Finally, the encoding end encodes these multiple coding blocks into a bitstream and transmits it to the decoding end.
[0298] After receiving the bitstream transmitted from the encoding end, the decoding end parses the bitstream to obtain multiple reconstructed coding blocks. These multiple reconstructed coding blocks are then concatenated to obtain a basic reconstructed frame. Texture region discrimination is performed on the basic reconstructed frame to determine the mask labels corresponding to the multiple reconstructed coding blocks. Subsequently, based on the mask labels corresponding to each reconstructed coding block belonging to a texture region, the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region is determined. After texture enhancement is performed through the corresponding texture enhancement network, the texture-enhanced frame, i.e., the reconstructed video frame, can be determined.
[0299] The following is through Figure 17 and Figure 18 A brief introduction is given to the video encoding and decoding apparatus provided in the embodiments of this application. Figure 17 The video encoding apparatus shown is capable of performing the video encoding method provided in the embodiments described above. Figure 16 The video decoding device shown is capable of performing the video decoding method provided in the embodiments described above.
[0300] Figure 17 This is a schematic diagram of the structure of a video encoding device provided in an embodiment of this application. The video encoding device can be implemented as part or all of an encoding end device by software, hardware, or a combination of both. The encoding end device can be... Figure 1 The source device shown may be... Figure 2 The acquisition device shown. See also... Figure 17 The device includes: a tag determination module 1701, a first encoding module 1702, a second encoding module 1703, and a writing module 1704.
[0301] The label determination module 1701 is used to determine the mask label of the video frame based on the attribute information of the video frame to be encoded. The attribute information includes semantic category and / or texture features. The mask label of the video frame is used to distinguish textured regions and non-texture regions in the video frame.
[0302] The first encoding module 1702 is used to encode the mask tags of video frames;
[0303] The second encoding module 1703 is used to encode multiple encoding blocks included in a video frame;
[0304] The writing module 1704 is used to write the encoding results of the mask labels of the video frame and the encoding results of the multiple encoding blocks into the bitstream.
[0305] Optionally, the attribute information of the video frame includes semantic category and texture features;
[0306] The label determination module 1701 includes:
[0307] The first semantic segmentation submodule is used to perform semantic segmentation on video frames to obtain a first semantic segmentation map. The first semantic segmentation map includes multiple semantic regions, and each semantic region corresponds to a semantic category.
[0308] The first label determination submodule is used to determine the mask label of the video frame based on the semantic category corresponding to the multiple semantic regions and the texture features of the video frame. The mask label of the video frame is also used to distinguish the texture category to which the texture region in the video frame belongs.
[0309] Optionally, the first label determining submodule includes:
[0310] The first label determination unit is used to determine the mask labels corresponding to the multiple semantic regions based on the semantic categories corresponding to the multiple semantic regions and the texture features of the video frames.
[0311] The second label determination unit is used to determine the mask label of the video frame based on the mask labels corresponding to the multiple semantic regions respectively.
[0312] Optionally, the first label determining unit is specifically used for:
[0313] Select one semantic region from the multiple semantic regions, and determine the mask label corresponding to the selected semantic region by performing the following operations, until the mask label corresponding to each semantic region is determined:
[0314] If there is a first texture category corresponding to the first semantic category in the correspondence between the stored semantic categories and texture categories, then the mask label corresponding to the selected semantic region is determined based on the first texture category, and the first semantic category is the semantic category corresponding to the selected semantic region;
[0315] If the first texture category does not exist in the correspondence between the semantic category and the texture category, then the mask label corresponding to the selected semantic region is determined based on the texture features in the first image region. The first image region is the image region corresponding to the selected semantic region in the video frame.
[0316] Optionally, the first label determining unit is specifically used for:
[0317] The texture features corresponding to multiple local image regions within the first image region are obtained, and these multiple local image regions do not overlap;
[0318] Based on the texture features corresponding to the multiple local image regions and the texture features corresponding to the multiple stored benchmark video frames, the texture similarity between the multiple local image regions and each of the multiple benchmark video frames is determined. The multiple benchmark video frames include textured video frames and non-textured video frames.
[0319] Based on the determined texture similarity, the mask labels corresponding to the multiple local image regions are determined respectively;
[0320] Based on the mask labels corresponding to the multiple local image regions, the mask label corresponding to the selected semantic region is determined.
[0321] Optionally, the attribute information of the video frame includes texture features, and the mask label of the video frame includes the mask labels corresponding to the multiple coding blocks respectively;
[0322] The label determination module 1701 includes:
[0323] The second label determination submodule is used to determine the mask labels corresponding to the multiple coding blocks based on the texture features corresponding to the multiple coding blocks respectively.
[0324] Optionally, the second label determines the specific use of the submodule:
[0325] Select one coding block from the multiple coding blocks, and determine the mask label corresponding to the selected coding block by performing the following operations, until the mask label corresponding to each coding block is determined:
[0326] Obtain the texture features corresponding to multiple local image regions within the selected coding block, where these multiple local image regions do not overlap;
[0327] Based on the texture features corresponding to the multiple local image regions and the texture features corresponding to the multiple stored benchmark video frames, the texture similarity between the multiple local image regions and each of the multiple benchmark video frames is determined. The multiple benchmark video frames include textured video frames and non-textured video frames.
[0328] Based on the determined texture similarity, the mask labels corresponding to the multiple local image regions are determined respectively;
[0329] Based on the mask labels corresponding to the multiple local image regions, the mask label corresponding to the selected coding block is determined.
[0330] Optionally, the attribute information of the video frame includes semantic category;
[0331] The label determination module 1701 includes:
[0332] The second semantic segmentation submodule is used to perform semantic segmentation on video frames to obtain a first semantic segmentation map. The first semantic segmentation map includes multiple semantic regions, each semantic region corresponding to a semantic category. The mask label of the video frame includes the semantic categories corresponding to the multiple semantic regions respectively.
[0333] Optionally, the second encoding module 1703 includes:
[0334] The parameter determination submodule is used to determine the quantization parameters corresponding to the multiple coding blocks based on the mask labels of the video frames. The quantization parameters corresponding to the coding blocks belonging to the texture region are greater than the quantization parameters corresponding to the coding blocks belonging to the non-texture region.
[0335] The encoding submodule is used to encode the multiple encoding blocks based on the quantization parameters corresponding to each of the multiple encoding blocks.
[0336] Optionally, the parameter determination submodule is specifically used for:
[0337] Select one coding block from the multiple coding blocks, and determine the quantization parameters corresponding to the selected coding block according to the following operations, until the quantization parameters corresponding to each coding block are determined:
[0338] If the selected coding block is determined to belong to a texture region based on the mask label of the video frame, then the standard deviation of the pixel value corresponding to the selected coding block is determined. This standard deviation of the pixel value is used to indicate the texture complexity within the selected coding block.
[0339] The standard deviation of the pixel value is multiplied by the maximum adjustable quantization parameter to obtain the first quantization parameter;
[0340] The first quantization parameter is added to the second quantization parameter to obtain the quantization parameter corresponding to the selected coding block. The second quantization parameter is the quantization parameter corresponding to the coding block that belongs to the non-texture region among the multiple coding blocks.
[0341] To improve the quality of texture regions in the reconstructed video frames at the decoding end, the encoding end can encode the mask tags of the video frames into the bitstream. This allows the decoding end to determine the mask tag corresponding to each reconstructed coding block based on the mask tags of the video frames. Then, based on the mask tags corresponding to each reconstructed coding block, the decoding end can determine the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region from multiple texture enhancement networks. Finally, by using the texture enhancement networks corresponding to each reconstructed coding block belonging to the texture region, texture enhancement is performed on each reconstructed coding block belonging to the texture region, thereby improving the quality of texture regions in the reconstructed video frames.
[0342] Because textured regions are particularly rich in texture, directly encoding these regions using conventional encoding methods would consume a significant amount of bitrate. However, the human eye is not sensitive to distortions or changes in these textured regions. Therefore, in this embodiment, the quantization parameters of the textured regions are increased to encode multiple coding blocks within the video frame, thereby reducing the bitrate occupied by the coding blocks belonging to the textured regions and ultimately reducing the overall bitrate of the video frame. This reduces the bitrate while maintaining the quality of the textured regions in the reconstructed video frame at the decoding end.
[0343] It should be noted that the video encoding device provided in the above embodiments is only illustrated by the division of the above functional modules during video encoding. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the video encoding device and the video encoding method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0344] Figure 18 This is a schematic diagram of the structure of a video decoding device provided in an embodiment of this application. The video decoding device can be implemented as part or all of a decoding end device by software, hardware, or a combination of both. The decoding end device can be... Figure 1 The destination device shown may be... Figure 2 The terminal device shown. See also Figure 18 The device includes: a bitstream parsing module 1801, a tag determination module 1802, an enhancement network determination module 1803, a texture enhancement module 1804, and a splicing module 1805.
[0345] The bitstream parsing module 1801 is used to parse the bitstream to obtain multiple reconstructed coding blocks;
[0346] The label determination module 1802 is used to determine the mask labels corresponding to the plurality of reconstructed coding blocks respectively. The mask labels are used to distinguish between texture regions and non-texture regions, and to distinguish the texture category to which the texture region belongs.
[0347] The enhancement network determination module 1803 is used to determine the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region from multiple texture enhancement networks based on the mask labels corresponding to each reconstructed coding block belonging to the texture region in the multiple reconstructed coding blocks;
[0348] The texture enhancement module 1804 is used to input each of the reconstructed coding blocks belonging to the texture region into its respective texture enhancement network to obtain multiple texture enhancement coding blocks;
[0349] The splicing module 1805 is used to splice the reconstructed coding blocks belonging to the non-texture region among the multiple reconstructed coding blocks with the multiple texture enhancement coding blocks to obtain the reconstructed video frame.
[0350] Optionally, the label determination module 1802 includes:
[0351] The first bitstream parsing submodule is used to parse the bitstream to obtain the mask labels of the video frames to be reconstructed. The mask labels of the video frames to be reconstructed are used to distinguish between textured regions and non-texture regions, as well as to distinguish the texture category to which the texture regions belong.
[0352] The first label determination submodule is used to determine the mask labels corresponding to the multiple reconstructed coding blocks based on the mask labels of the video frames to be reconstructed.
[0353] Optionally, the label determination module 1802 includes:
[0354] The second bitstream parsing submodule is used to parse the bitstream to obtain the mask labels of the video frames to be reconstructed. The mask labels of the video frames to be reconstructed are used to distinguish between textured and non-textured regions.
[0355] The first semantic segmentation submodule is used to perform semantic segmentation on the basic reconstructed frame to obtain the second semantic segmentation map. The basic reconstructed frame is a video frame obtained by splicing the multiple reconstructed coding blocks. The second semantic segmentation map includes multiple semantic regions, and each semantic region corresponds to a semantic category.
[0356] The second label determination submodule is used to determine the mask labels corresponding to the multiple semantic regions based on the mask labels of the video frame to be reconstructed and the semantic categories corresponding to the multiple semantic regions respectively.
[0357] The third label determination submodule is used to determine the mask labels corresponding to the multiple reconstructed coding blocks based on the mask labels corresponding to the multiple semantic regions.
[0358] Optionally, the second label determines the specific use of the submodule:
[0359] Select one semantic region from the multiple semantic regions and process the selected semantic region according to the following operations until all semantic regions have been processed:
[0360] If there is a second texture category corresponding to the second semantic category in the correspondence between the stored semantic categories and texture categories, then the mask label corresponding to the selected semantic region is determined based on the second texture category, and the second semantic category is the semantic category corresponding to the selected semantic region;
[0361] If there is no second texture category in the correspondence between the semantic category and the texture category, the mask label corresponding to the selected semantic region is determined based on the mask label of the video frame.
[0362] Optionally, the label determination module 1802 includes:
[0363] The third bitstream parsing submodule is used to parse the bitstream to obtain the mask labels of the video frames to be reconstructed. The mask labels of the video frames to be reconstructed include semantic categories corresponding to multiple semantic regions.
[0364] The fourth label determination submodule is used to determine the mask labels corresponding to the multiple semantic regions based on the semantic categories corresponding to the multiple semantic regions and the texture features of the base reconstruction frame. The base reconstruction frame is obtained by concatenating the multiple reconstruction coding blocks.
[0365] The fifth label determination submodule is used to determine the mask labels corresponding to the multiple reconstructed coding blocks based on the mask labels corresponding to the multiple semantic regions.
[0366] Optionally, the label determination module 1802 includes:
[0367] The second semantic segmentation submodule is used to perform semantic segmentation on the basic reconstructed frame to obtain a second semantic segmentation map. The basic reconstructed frame is a video frame obtained by splicing the multiple reconstructed coding blocks. The second semantic segmentation map includes multiple semantic regions, and each semantic region corresponds to a semantic category.
[0368] The sixth label determination submodule is used to determine the mask labels corresponding to the multiple semantic regions based on the semantic categories corresponding to the multiple semantic regions and the texture features of the base reconstructed frame.
[0369] The seventh label determination submodule is used to determine the mask labels corresponding to the multiple reconstructed coding blocks based on the mask labels corresponding to the multiple semantic regions.
[0370] Optionally, the sixth tag determines the specific use of the submodule:
[0371] Select one semantic region from the multiple semantic regions, and determine the mask label corresponding to the selected semantic region by performing the following operations, until the mask label corresponding to each semantic region is determined:
[0372] If there is a second texture category corresponding to the second semantic category in the stored correspondence between semantic categories and texture categories, then the mask label corresponding to the selected semantic region is determined based on the second texture category, and the second semantic category is the semantic category corresponding to the selected semantic region;
[0373] If the second texture category does not exist in the correspondence between the semantic category and the texture category, then the mask label corresponding to the selected semantic region is determined based on the texture features in the second image region. The second image region is the image region corresponding to the selected semantic region in the basic reconstructed frame.
[0374] Optionally, the sixth tag determines the specific use of the submodule:
[0375] The texture features corresponding to multiple local image regions within the second image region are obtained, and these multiple local image regions do not overlap.
[0376] Based on the texture features corresponding to the multiple local image regions and the texture features corresponding to the multiple stored benchmark video frames, the texture similarity between the multiple local image regions and each of the multiple benchmark video frames is determined. The multiple benchmark video frames include textured video frames and non-textured video frames.
[0377] Based on the determined texture similarity, the mask labels corresponding to the multiple local image regions are determined respectively;
[0378] Based on the mask labels corresponding to the multiple local image regions, the mask label corresponding to the selected semantic region is determined.
[0379] After the decoder determines the mask label corresponding to each reconstructed coding block, it determines the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region from multiple texture enhancement networks based on the mask label corresponding to each coding block. Then, it performs texture enhancement on each reconstructed coding block belonging to the texture region through the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region, thereby improving the quality of the texture region in the reconstructed video frame.
[0380] Furthermore, since different texture categories correspond to different textures, embodiments of this application can select the corresponding texture enhancement network from the multiple texture enhancement networks based on the mask labels corresponding to each reconstructed coding block belonging to the texture region in the multiple reconstructed coding blocks, so as to obtain the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region, and then perform texture enhancement according to their respective texture enhancement networks, so as to make texture enhancement more targeted and ensure that the quality of the reconstructed video frame is optimal.
[0381] It should be noted that the video decoding device provided in the above embodiments is only illustrated by the division of the above functional modules during video decoding. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the video decoding device and the video decoding method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0382] Figure 19 This is a schematic block diagram of an encoding / decoding apparatus 1900 used in an embodiment of this application. The encoding / decoding apparatus 1900 may include a processor 1901, a memory 1902, and a bus system 1903. The processor 1901 and the memory 1902 are connected via the bus system 1903. The memory 1902 stores instructions, and the processor 1901 executes the instructions stored in the memory 1902 to perform various encoding or decoding methods described in the embodiments of this application. To avoid repetition, detailed descriptions are omitted here.
[0383] In this embodiment, the processor 1901 can be a central processing unit (CPU), or it can be other general-purpose processors, DSPs, ASICs, FPGAs, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0384] The memory 1902 may include a ROM device or a RAM device. Any other suitable type of storage device may also be used as memory 1902. Memory 1902 may include code and data 19021 accessed by processor 1901 using bus 1903. Memory 1902 may further include an operating system 19023 and an application program 19022, which includes at least one program that allows processor 1901 to execute the encoding or decoding methods described in the embodiments of this application. For example, application program 19022 may include applications 1 to N, which further include encoding or decoding applications (hereinafter referred to as encoding / decoding applications) that execute the encoding or decoding methods described in the embodiments of this application.
[0385] In addition to the data bus, the bus system 1903 may also include a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as bus system 1903 in the diagram.
[0386] Optionally, the codec device 1900 may also include one or more output devices, such as a display 1904. In one example, the display 1904 may be a tactile display that combines a display with a tactile unit capable of operatively sensing touch input. The display 1904 may be connected to the processor 1901 via a bus 1903.
[0387] It should be noted that the encoding / decoding device 1900 can execute the encoding method in the embodiments of this application, and can also execute the decoding method in the embodiments of this application.
[0388] Those skilled in the art will appreciate that the functionality described in conjunction with the various illustrative logic blocks, modules, and algorithmic steps disclosed herein can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functionality described by the various illustrative logic blocks, modules, and steps can be stored or transmitted as one or more instructions or codes on a computer-readable medium and executed by a hardware-based processing unit. The computer-readable medium may comprise a computer-readable storage medium, which corresponds to a tangible medium, such as a data storage medium, or a communication medium that includes any medium facilitating the transfer of a computer program from one place to another (e.g., based on a communication protocol). In this way, the computer-readable medium may substantially correspond to (1) a non-transitory tangible computer-readable storage medium, or (2) a communication medium, such as a signal or carrier wave. The data storage medium may be any available medium accessible by one or more computers or one or more processors to retrieve instructions, code, and / or data structures for implementing the techniques described in this application. A computer program product may comprise a computer-readable medium.
[0389] By way of example and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disc storage devices, magnetic disk storage devices or other magnetic storage devices, flash memory, or any other media that can be used to store desired program code in the form of instructions or data structures and is accessible by a computer. Furthermore, any connection is properly referred to as computer-readable media. For example, if instructions are transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of media. However, it should be understood that the computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other temporary media, but are specifically directed to non-temporary tangible storage media. As used herein, disks and optical discs include compact optical discs (CDs), laser optical discs, optical discs, DVDs, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs reproduce data optically using lasers. The combination of the above items should also be included in the scope of computer-readable media.
[0390] Instructions can be executed by one or more processors, such as digital signal processors (DSPs), general-purpose microprocessors, application-specific integrated circuits (ASICs), field-programmable arrays (FPGAs), or other equivalent integrated or discrete logic circuits. Therefore, the term "processor" as used herein can refer to any of the foregoing structures or any other structures suitable for implementing the techniques described herein. Furthermore, in some aspects, the functionality described in the various illustrative logic blocks, modules, and steps described herein can be provided within dedicated hardware and / or software modules configured for encoding and decoding, or incorporated into combined codecs. Moreover, the techniques can be fully implemented in one or more circuit or logic elements. In one example, the various illustrative logic blocks, units, and modules in the encoder and decoder can be understood as corresponding circuit devices or logic elements.
[0391] The techniques described in this application can be implemented in a wide variety of devices or apparatuses, including wireless handheld devices, integrated circuits (ICs), or a set of ICs (e.g., chipsets). The various components, modules, or units described in this application are intended to emphasize functional aspects of the apparatus for performing the disclosed techniques, but do not necessarily need to be implemented by different hardware units. In fact, as described above, the various units can be combined with suitable software and / or firmware within a codec hardware unit, or provided via interoperable hardware units (including one or more processors as described above).
[0392] In other words, the above embodiments can be implemented entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital versatile disc (DVD)), or a semiconductor medium (e.g., solid state disk (SSD)). It is worth noting that the computer-readable storage medium mentioned in the embodiments of this application can be a non-volatile storage medium; in other words, it can be a non-transient storage medium.
[0393] In some embodiments, an encoding end device is provided, the encoding end device including a memory and a processor;
[0394] The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory to implement the video encoding method described above.
[0395] In some embodiments, a decoding end device is provided, the decoding end device including a memory and a processor;
[0396] The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory to implement the video decoding method described above.
[0397] In some embodiments, a computer-readable storage medium is provided that stores instructions which, when executed on the computer, cause the computer to perform the steps of the method described above.
[0398] In some embodiments, a computer-readable storage medium is provided, comprising the bitstream obtained by the encoding method described above.
[0399] In some embodiments, a computer program is provided that, when executed, implements the methods described above.
[0400] It should be understood that "multiple" as mentioned herein refers to two or more. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. In addition, to facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first," "second," etc., are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and the terms "first," "second," etc., do not necessarily imply that they are different.
[0401] The above descriptions are embodiments provided in this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A video encoding method, characterized in that, The method includes: The mask label of the video frame is determined based on the attribute information of the video frame to be encoded. The attribute information includes semantic category and texture features. The mask label of the video frame is used to distinguish between textured regions and non-texture regions in the video frame, and to distinguish the texture category to which the textured regions in the video frame belong. The mask labels of the video frames are encoded; wherein, the mask labels of the video frames are used to determine the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region from multiple texture enhancement networks, and different texture categories of reconstructed coding blocks correspond to different texture enhancement networks; Based on the mask label of the video frame, the quantization parameters corresponding to the multiple coding blocks included in the video frame are determined respectively. Among the multiple coding blocks, the quantization parameters corresponding to the coding blocks belonging to the texture region are greater than the quantization parameters corresponding to the coding blocks belonging to the non-texture region. The multiple coding blocks are encoded based on the quantization parameters corresponding to each of the multiple coding blocks. The encoding results of the mask labels of the video frames and the encoding results of the multiple encoding blocks are written into the bitstream.
2. The method as described in claim 1, characterized in that, The process of determining the mask label of the video frame based on the attribute information of the video frame to be encoded includes: The video frames are semantically segmented to obtain a first semantic segmentation map, which includes multiple semantic regions, each of which corresponds to a semantic category. The mask label of the video frame is determined based on the semantic categories corresponding to the multiple semantic regions and the texture features of the video frame.
3. The method as described in claim 2, characterized in that, The step of determining the mask label of the video frame based on the semantic categories corresponding to the multiple semantic regions and the texture features of the video frame includes: Based on the semantic categories corresponding to the multiple semantic regions and the texture features of the video frames, mask labels corresponding to the multiple semantic regions are determined. The mask label of the video frame is determined based on the mask labels corresponding to the multiple semantic regions.
4. The method as described in claim 3, characterized in that, The step of determining the mask labels corresponding to the multiple semantic regions based on their respective semantic categories and the texture features of the video frames includes: Select one semantic region from the plurality of semantic regions, and determine the mask label corresponding to the selected semantic region by performing the following operations, until the mask label corresponding to each semantic region is determined: If there is a first texture category corresponding to the first semantic category in the correspondence between the stored semantic categories and texture categories, then the mask label corresponding to the selected semantic region is determined based on the first texture category, and the first semantic category is the semantic category corresponding to the selected semantic region; If the first texture category does not exist in the correspondence between the semantic category and the texture category, then the mask label corresponding to the selected semantic region is determined based on the texture features in the first image region, and the first image region is the image region corresponding to the selected semantic region in the video frame.
5. The method as described in claim 4, characterized in that, The step of determining the mask label corresponding to the selected semantic region based on the texture features within the first image region includes: The texture features corresponding to multiple local image regions within the first image region are obtained, wherein the multiple local image regions do not overlap; Based on the texture features corresponding to the multiple local image regions and the texture features corresponding to the multiple stored reference video frames, the texture similarity between the multiple local image regions and each of the multiple reference video frames is determined. The multiple reference video frames include textured video frames and non-textured video frames. Based on the determined texture similarity, the mask labels corresponding to the multiple local image regions are determined respectively; Based on the mask labels corresponding to the multiple local image regions, the mask label corresponding to the selected semantic region is determined.
6. The method as described in claim 1, characterized in that, The step of determining the quantization parameters corresponding to the multiple coded blocks included in the video frame based on the mask label of the video frame includes: Select one coding block from the plurality of coding blocks, and determine the quantization parameters corresponding to the selected coding block according to the following operations, until the quantization parameters corresponding to each coding block are determined: If the selected coding block is determined to belong to a texture region based on the mask label of the video frame, then the standard deviation of the pixel value corresponding to the selected coding block is determined, and the standard deviation of the pixel value is used to indicate the texture complexity within the selected coding block; The standard deviation of the pixel value is multiplied by the maximum adjustable quantization parameter to obtain the first quantization parameter; The first quantization parameter and the second quantization parameter are added together to obtain the quantization parameter corresponding to the selected coding block. The second quantization parameter is the quantization parameter corresponding to the coding block that belongs to the non-texture region among the plurality of coding blocks.
7. A video decoding method, characterized in that, The method includes: The bitstream is parsed to obtain multiple reconstructed coded blocks; Determine the mask labels corresponding to the plurality of reconstructed coding blocks respectively. The mask labels are used to distinguish between textured regions and non-texture regions, and to distinguish the texture category to which the textured regions belong. Based on the mask labels corresponding to each reconstructed coding block belonging to the texture region in the plurality of reconstructed coding blocks, the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region is determined from the plurality of texture enhancement networks, and different texture categories of reconstructed coding blocks correspond to different texture enhancement networks; Each reconstructed coding block belonging to the texture region in the plurality of reconstructed coding blocks is input into its corresponding texture enhancement network to obtain a plurality of texture enhancement coding blocks; The reconstructed coding blocks belonging to non-texture regions in the plurality of reconstructed coding blocks are concatenated with the plurality of texture enhancement coding blocks to obtain the reconstructed video frame.
8. The method as described in claim 7, characterized in that, Determining the mask labels corresponding to the plurality of reconstructed coding blocks includes: The bitstream is parsed to obtain the mask labels of the video frames to be reconstructed. The mask labels of the video frames to be reconstructed are used to distinguish between textured regions and non-texture regions, and to distinguish the texture category to which the texture regions belong. The mask labels corresponding to the plurality of reconstructed coding blocks are determined based on the mask labels of the video frames to be reconstructed.
9. The method as described in claim 7, characterized in that, Determining the mask labels corresponding to the plurality of reconstructed coding blocks includes: The bitstream is parsed to obtain the mask labels of the video frames to be reconstructed. The mask labels of the video frames to be reconstructed are used to distinguish between textured regions and non-textured regions. Semantic segmentation is performed on the basic reconstructed frame to obtain a second semantic segmentation map. The basic reconstructed frame is a video frame obtained by concatenating the multiple reconstructed coding blocks. The second semantic segmentation map includes multiple semantic regions, and each semantic region corresponds to a semantic category. Based on the mask labels of the video frame to be reconstructed and the semantic categories corresponding to the multiple semantic regions, the mask labels corresponding to the multiple semantic regions are determined respectively. Based on the mask labels corresponding to the multiple semantic regions, the mask labels corresponding to the multiple reconstructed coding blocks are determined.
10. The method as described in claim 9, characterized in that, The step of determining the mask labels corresponding to the multiple semantic regions based on the mask labels of the video frame to be reconstructed and the semantic categories corresponding to the multiple semantic regions includes: Select one semantic region from the plurality of semantic regions, and process the selected semantic region according to the following operations until all semantic regions have been processed: If there is a second texture category corresponding to the second semantic category in the correspondence between the stored semantic categories and texture categories, then the mask label corresponding to the selected semantic region is determined based on the second texture category, and the second semantic category is the semantic category corresponding to the selected semantic region; If the second texture category does not exist in the correspondence between the semantic category and the texture category, then the mask label corresponding to the selected semantic region is determined based on the mask label of the video frame.
11. The method as described in claim 7, characterized in that, Determining the mask labels corresponding to the plurality of reconstructed coding blocks includes: The bitstream is parsed to obtain the mask labels of the video frames to be reconstructed. The mask labels of the video frames to be reconstructed include semantic categories corresponding to multiple semantic regions. Based on the semantic categories corresponding to the multiple semantic regions and the texture features of the base reconstructed frame, the mask labels corresponding to the multiple semantic regions are determined. The base reconstructed frame is obtained by concatenating the multiple reconstructed coding blocks. Based on the mask labels corresponding to the multiple semantic regions, the mask labels corresponding to the multiple reconstructed coding blocks are determined.
12. The method as described in claim 7, characterized in that, Determining the mask labels corresponding to the plurality of reconstructed coding blocks includes: Semantic segmentation is performed on the basic reconstructed frame to obtain a second semantic segmentation map. The basic reconstructed frame is a video frame obtained by concatenating the multiple reconstructed coding blocks. The second semantic segmentation map includes multiple semantic regions, and each semantic region corresponds to a semantic category. Based on the semantic categories corresponding to the multiple semantic regions and the texture features of the base reconstructed frame, the mask labels corresponding to the multiple semantic regions are determined. Based on the mask labels corresponding to the multiple semantic regions, the mask labels corresponding to the multiple reconstructed coding blocks are determined.
13. The method as described in claim 12, characterized in that, The step of determining the mask labels corresponding to the multiple semantic regions based on their respective semantic categories and the texture features of the base reconstructed frame includes: Select one semantic region from the plurality of semantic regions, and determine the mask label corresponding to the selected semantic region by performing the following operations, until the mask label corresponding to each semantic region is determined: If there is a second texture category corresponding to the second semantic category in the correspondence between the stored semantic categories and texture categories, then the mask label corresponding to the selected semantic region is determined based on the second texture category, and the second semantic category is the semantic category corresponding to the selected semantic region; If the second texture category does not exist in the correspondence between the semantic category and the texture category, then the mask label corresponding to the selected semantic region is determined based on the texture features in the second image region, and the second image region is the image region corresponding to the selected semantic region in the basic reconstructed frame.
14. The method as described in claim 13, characterized in that, The step of determining the mask label corresponding to the selected semantic region based on the texture features within the second image region includes: The texture features corresponding to multiple local image regions within the second image region are obtained, wherein the multiple local image regions do not overlap; Based on the texture features corresponding to the multiple local image regions and the texture features corresponding to the multiple stored reference video frames, the texture similarity between the multiple local image regions and each of the multiple reference video frames is determined. The multiple reference video frames include textured video frames and non-textured video frames. Based on the determined texture similarity, the mask labels corresponding to the multiple local image regions are determined respectively; Based on the mask labels corresponding to the multiple local image regions, the mask label corresponding to the selected semantic region is determined.
15. A video encoding device, characterized in that, The device includes: The label determination module is used to determine the mask label of the video frame based on the attribute information of the video frame to be encoded. The attribute information includes semantic category and texture features. The mask label of the video frame is used to distinguish between textured regions and non-texture regions in the video frame, and to distinguish the texture category to which the textured regions in the video frame belong. The first encoding module is used to encode the mask labels of the video frame; wherein, the mask labels of the video frame are used to determine the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region from multiple texture enhancement networks, and different texture categories of reconstructed coding blocks correspond to different texture enhancement networks; The second encoding module is used to determine the quantization parameters corresponding to the multiple encoding blocks included in the video frame based on the mask label of the video frame, wherein the quantization parameters corresponding to the encoding blocks belonging to the texture region are greater than the quantization parameters corresponding to the encoding blocks belonging to the non-texture region; and to encode the multiple encoding blocks based on the quantization parameters corresponding to the multiple encoding blocks. The writing module is used to write the encoding results of the mask tags of the video frame and the encoding results of the multiple encoding blocks into the bitstream.
16. The apparatus as claimed in claim 15, characterized in that, The label determination module includes: The first semantic segmentation submodule is used to perform semantic segmentation on the video frame to obtain a first semantic segmentation map. The first semantic segmentation map includes multiple semantic regions, and each semantic region corresponds to a semantic category. The first label determination submodule is used to determine the mask label of the video frame based on the semantic categories corresponding to the multiple semantic regions and the texture features of the video frame.
17. The apparatus as claimed in claim 16, characterized in that, The first tag determination submodule includes: The first label determination unit is used to determine the mask labels corresponding to the multiple semantic regions based on the semantic categories corresponding to the multiple semantic regions and the texture features of the video frame. The second label determination unit is used to determine the mask label of the video frame based on the mask labels corresponding to the plurality of semantic regions respectively.
18. The apparatus as claimed in claim 17, characterized in that, The first tag determining unit is specifically used for: Select one semantic region from the plurality of semantic regions, and determine the mask label corresponding to the selected semantic region by performing the following operations, until the mask label corresponding to each semantic region is determined: If there is a first texture category corresponding to the first semantic category in the correspondence between the stored semantic categories and texture categories, then the mask label corresponding to the selected semantic region is determined based on the first texture category, and the first semantic category is the semantic category corresponding to the selected semantic region; If the first texture category does not exist in the correspondence between the semantic category and the texture category, then the mask label corresponding to the selected semantic region is determined based on the texture features in the first image region, and the first image region is the image region corresponding to the selected semantic region in the video frame.
19. The apparatus as claimed in claim 18, characterized in that, The first tag determining unit is specifically used for: The texture features corresponding to multiple local image regions within the first image region are obtained, wherein the multiple local image regions do not overlap; Based on the texture features corresponding to the multiple local image regions and the texture features corresponding to the multiple stored reference video frames, the texture similarity between the multiple local image regions and each of the multiple reference video frames is determined. The multiple reference video frames include textured video frames and non-textured video frames. Based on the determined texture similarity, the mask labels corresponding to the multiple local image regions are determined respectively; Based on the mask labels corresponding to the multiple local image regions, the mask label corresponding to the selected semantic region is determined.
20. The apparatus as claimed in claim 15, characterized in that, The second encoding module is specifically used for: Select one coding block from the plurality of coding blocks, and determine the quantization parameters corresponding to the selected coding block according to the following operations, until the quantization parameters corresponding to each coding block are determined: If the selected coding block is determined to belong to a texture region based on the mask label of the video frame, then the standard deviation of the pixel value corresponding to the selected coding block is determined, and the standard deviation of the pixel value is used to indicate the texture complexity within the selected coding block; The standard deviation of the pixel value is multiplied by the maximum adjustable quantization parameter to obtain the first quantization parameter; The first quantization parameter and the second quantization parameter are added together to obtain the quantization parameter corresponding to the selected coding block. The second quantization parameter is the quantization parameter corresponding to the coding block that belongs to the non-texture region among the plurality of coding blocks.
21. A video decoding device, characterized in that, The device includes: The bitstream parsing module is used to parse the bitstream to obtain multiple reconstructed coding blocks; The label determination module is used to determine the mask labels corresponding to the plurality of reconstructed coding blocks respectively. The mask labels are used to distinguish between texture regions and non-texture regions, and to distinguish the texture category to which the texture region belongs. The enhancement network determination module is used to determine the texture enhancement network corresponding to each reconstructed coding block belonging to the texture region from multiple texture enhancement networks based on the mask labels corresponding to each reconstructed coding block belonging to the texture region in the multiple reconstructed coding blocks, and different texture enhancement networks are corresponding to reconstructed coding blocks of different texture categories. The texture enhancement module is used to input each reconstructed coding block belonging to the texture region from the plurality of reconstructed coding blocks to their respective texture enhancement networks to obtain a plurality of texture enhancement coding blocks; The splicing module is used to splice the reconstructed coding blocks belonging to non-texture regions among the multiple reconstructed coding blocks with the multiple texture enhancement coding blocks to obtain the reconstructed video frame.
22. The apparatus as claimed in claim 21, characterized in that, The label determination module includes: The first bitstream parsing submodule is used to parse the bitstream to obtain the mask labels of the video frames to be reconstructed. The mask labels of the video frames to be reconstructed are used to distinguish between textured regions and non-texture regions, and to distinguish the texture category to which the texture regions belong. The first label determination submodule is used to determine the mask labels corresponding to the plurality of reconstructed coding blocks based on the mask labels of the video frames to be reconstructed.
23. The apparatus as claimed in claim 21, characterized in that, The label determination module includes: The second bitstream parsing submodule is used to parse the bitstream to obtain the mask labels of the video frames to be reconstructed. The mask labels of the video frames to be reconstructed are used to distinguish between textured regions and non-textured regions. The first semantic segmentation submodule is used to perform semantic segmentation on the basic reconstructed frame to obtain a second semantic segmentation map. The basic reconstructed frame is a video frame obtained by splicing the multiple reconstructed coding blocks. The second semantic segmentation map includes multiple semantic regions, and each semantic region corresponds to a semantic category. The second label determination submodule is used to determine the mask labels corresponding to the multiple semantic regions based on the mask labels of the video frame to be reconstructed and the semantic categories corresponding to the multiple semantic regions respectively. The third label determination submodule is used to determine the mask labels corresponding to the multiple reconstructed coding blocks based on the mask labels corresponding to the multiple semantic regions respectively.
24. The apparatus as claimed in claim 23, characterized in that, The second tag determination submodule is specifically used for: Select one semantic region from the plurality of semantic regions, and process the selected semantic region according to the following operations until all semantic regions have been processed: If there is a second texture category corresponding to the second semantic category in the correspondence between the stored semantic categories and texture categories, then the mask label corresponding to the selected semantic region is determined based on the second texture category, and the second semantic category is the semantic category corresponding to the selected semantic region; If the second texture category does not exist in the correspondence between the semantic category and the texture category, then the mask label corresponding to the selected semantic region is determined based on the mask label of the video frame.
25. The apparatus as claimed in claim 21, characterized in that, The label determination module includes: The third bitstream parsing submodule is used to parse the bitstream to obtain the mask labels of the video frames to be reconstructed. The mask labels of the video frames to be reconstructed include semantic categories corresponding to multiple semantic regions. The fourth label determination submodule is used to determine the mask labels corresponding to the multiple semantic regions based on the semantic categories corresponding to the multiple semantic regions and the texture features of the base reconstruction frame. The base reconstruction frame is obtained by concatenating the multiple reconstruction coding blocks. The fifth label determination submodule is used to determine the mask labels corresponding to the multiple reconstructed coding blocks based on the mask labels corresponding to the multiple semantic regions respectively.
26. The apparatus as claimed in claim 21, characterized in that, The label determination module includes: The second semantic segmentation submodule is used to perform semantic segmentation on the basic reconstructed frame to obtain a second semantic segmentation map. The basic reconstructed frame is a video frame obtained by splicing the multiple reconstructed coding blocks. The second semantic segmentation map includes multiple semantic regions, and each semantic region corresponds to a semantic category. The sixth label determination submodule is used to determine the mask labels corresponding to the multiple semantic regions based on the semantic categories corresponding to the multiple semantic regions and the texture features of the base reconstructed frame. The seventh label determination submodule is used to determine the mask labels corresponding to the multiple reconstructed coding blocks based on the mask labels corresponding to the multiple semantic regions respectively.
27. The apparatus as claimed in claim 26, characterized in that, The sixth label determination submodule is specifically used for: Select one semantic region from the plurality of semantic regions, and determine the mask label corresponding to the selected semantic region by performing the following operations, until the mask label corresponding to each semantic region is determined: If there is a second texture category corresponding to the second semantic category in the correspondence between the stored semantic categories and texture categories, then the mask label corresponding to the selected semantic region is determined based on the second texture category, and the second semantic category is the semantic category corresponding to the selected semantic region; If the second texture category does not exist in the correspondence between the semantic category and the texture category, then the mask label corresponding to the selected semantic region is determined based on the texture features in the second image region, and the second image region is the image region corresponding to the selected semantic region in the basic reconstructed frame.
28. The apparatus as claimed in claim 27, characterized in that, The sixth label determination submodule is specifically used for: The texture features corresponding to multiple local image regions within the second image region are obtained, wherein the multiple local image regions do not overlap; Based on the texture features corresponding to the multiple local image regions and the texture features corresponding to the multiple stored reference video frames, the texture similarity between the multiple local image regions and each of the multiple reference video frames is determined. The multiple reference video frames include textured video frames and non-textured video frames. Based on the determined texture similarity, the mask labels corresponding to the multiple local image regions are determined respectively; Based on the mask labels corresponding to the multiple local image regions, the mask label corresponding to the selected semantic region is determined.
29. An encoding terminal device, characterized in that, The encoding device includes a memory and a processor; The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory to implement the video encoding method according to any one of claims 1-6.
30. A decoding device, characterized in that, The decoding device includes a memory and a processor; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the video decoding method according to any one of claims 7-14.
31. A computer-readable storage medium, characterized in that, The storage medium stores instructions that, when executed on the computer, cause the computer to perform the steps of the method described in any one of claims 1-14.
32. A computer-readable storage medium, characterized in that, The storage medium stores a computer program and a bitstream, and when the computer program is executed by a processor, it implements the encoding method as described in any one of claims 1-6 to generate the bitstream.
33. A computer program product, characterized in that, The computer program product includes instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-14.
Citation Information
Patent Citations
Quantized optimization method used for high-efficiency video coding
CN103945220A
Method for encoding and decoding free viewpoint videos
US20050117019A1
Classifying and controlling encoding quality for textured, dark smooth and smooth video content
US20090245587A1
Video compression through motion warping using learning-based motion segmentation
US20190261016A1
Method and system for image processing
WO2006131866A2
