Code division method and device, equipment and storage medium

By obtaining the encoding type and information of the target image frame and using the pre-trained model to predict the division depth, the problem of high consumption of existing encoding division time is solved, and the encoding speed and efficiency are improved.

CN119135893APending Publication Date: 2024-12-13BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411311840.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The existing encoding division method takes a lot of time, resulting in a low encoding speed.

Method used

By obtaining the target coded frame type and target encoding information of the target image frame, the pre-trained target partition prediction model is used to perform division depth prediction, and the target partition depth value of the reference code block in the target image frame is quickly determined, thereby achieving fast and efficient coding Block division.

Benefits of technology

While ensuring coding quality, it significantly improves the coding speed and achieves fast and efficient coding division.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119135893A_ABST
    Figure CN119135893A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a code division method and device, equipment and a storage medium. The method comprises the following steps: acquiring a target coding frame type corresponding to a target image frame; determining target coding information based on the target coding frame type; performing division depth prediction based on a target division prediction model corresponding to the target coding frame type and the target coding information to obtain a target division depth value corresponding to a reference coding block in the target image frame, the target division prediction model is obtained by training in advance based on sample coding information corresponding to a sample image frame and a label division depth value corresponding to a reference coding block in the sample image frame, and the label division depth value is determined based on an actual coding block division result of the sample image frame; and determining a target coding block division result corresponding to the target image frame based on the target division depth value. Through the technical scheme of the embodiment of the invention, rapid and efficient code division can be realized, and the coding speed is improved while the coding quality is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to computer technology, and in particular to a coding division method, apparatus, device and storage medium. Background Art

[0002] With the rapid development of computer technology, it is often necessary to encode image frames based on coding methods such as High Efficiency Video Coding (HEVC) to reduce storage space and transmission costs.

[0003] During the encoding process, the image frame needs to be divided into multiple coding blocks, and pixel compression processing is performed on each coding block. At present, when dividing the coding, the division methods of the image frame are usually traversed and enumerated based on multiple coding block sizes to obtain the optimal coding block division result.

[0004] However, in the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0005] The existing coding division method takes a lot of time and greatly reduces the coding speed. Summary of the invention

[0006] The embodiments of the present invention provide a coding division method, apparatus, device and storage medium to achieve fast and efficient coding division, thereby improving the coding speed while ensuring the coding quality.

[0007] In a first aspect, an embodiment of the present invention provides a coding division method, including:

[0008] Obtaining a target encoding frame type corresponding to a target image frame to be encoded;

[0009] Based on the target coding frame type, determining target coding information corresponding to the target image frame;

[0010] Based on the target partition prediction model corresponding to the target coding frame type and the target coding information, a partition depth prediction is performed on the target image frame to obtain a target partition depth value corresponding to a reference coding block in the target image frame, wherein the target partition prediction model is pre-trained based on sample coding information corresponding to a sample image frame and a label partition depth value corresponding to a reference coding block in the sample image frame, and the label partition depth value is determined based on an actual coding block partition result of the sample image frame;

[0011] Based on the target division depth value, a target coding block division result corresponding to the target image frame is determined.

[0012] In a second aspect, an embodiment of the present invention further provides a coding division device, including:

[0013] A target coding frame type acquisition module is used to acquire a target coding frame type corresponding to a target image frame to be encoded;

[0014] A target coding information determination module, used to determine the target coding information corresponding to the target image frame based on the target coding frame type;

[0015] a partition depth prediction module, configured to perform a partition depth prediction on the target image frame based on a target partition prediction model corresponding to the target coding frame type and the target coding information, and obtain a target partition depth value corresponding to a reference coding block in the target image frame, wherein the target partition prediction model is pre-trained based on sample coding information corresponding to a sample image frame and a label partition depth value corresponding to a reference coding block in the sample image frame, and the label partition depth value is determined based on an actual coding block partition result of the sample image frame;

[0016] The division result determination module is used to determine the target coding block division result corresponding to the target image frame based on the target division depth value.

[0017] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0018] one or more processors;

[0019] A memory for storing one or more programs;

[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the coding division method provided by any embodiment of the present invention.

[0021] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a coding division method as provided in any embodiment of the present invention.

[0022] One embodiment of the above invention has the following advantages or beneficial effects:

[0023] By determining the target coding information matching the target image frame based on the target coding frame type corresponding to the target image frame to be encoded, and performing a division depth prediction on the target image frame based on the target division prediction model and the target coding information corresponding to the target coding frame type, the target division depth value corresponding to the reference coding block in the target image frame can be quickly obtained, and the target coding block division result corresponding to the target image frame can be determined at one time based on the target division depth value, thereby achieving fast and efficient coding division. Among them, the target division prediction model is pre-trained based on the sample coding information corresponding to the sample image frame and the label division depth value corresponding to the reference coding block in the sample image frame, and the label division depth value is determined based on the actual coding block division result of the sample image frame, so that the trained target division prediction model can be used to ensure the coding quality while performing fast and efficient coding division, thereby improving the coding speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0025] Figure 1 is a flow chart of a coding division method provided by an embodiment of the present invention;

[0026] Figure 2 is an example diagram of a brightness component of an image frame involved in an embodiment of the present invention;

[0027] Figure 3 is an example diagram of two methods for determining a label partition depth value according to an embodiment of the present invention;

[0028] Figure 4 is a diagram showing an example of a network architecture of a target partition prediction model according to an embodiment of the present invention;

[0029] Figure 5 is an example diagram of a network architecture of another target partition prediction model involved in an embodiment of the present invention;

[0030] Figure 6 This is an example diagram of a network architecture of a target partition prediction model during training according to an embodiment of the present invention;

[0031] Figure 7 is a flowchart of another coding division method provided by an embodiment of the present invention;

[0032] Figure 8is an example diagram of a spatial consistency adjustment process involved in an embodiment of the present invention;

[0033] Fig. 9 It is a structural schematic diagram of a coding division device provided by an embodiment of the present invention;

[0034] Fig.10 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0035] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0036] Figure 1 This is a flowchart of a coding division method provided by an embodiment of the present invention. This embodiment is applicable to the case where the image frame is divided into coding blocks during the encoding process of the image frame. The method can be executed by a coding division device, which can be implemented by software and / or hardware and integrated in an electronic device. Figure 1 As shown, the method specifically comprises the following steps:

[0037] S110 , obtaining a target coding frame type corresponding to a target image frame to be encoded.

[0038] Among them, the target image frame may refer to the image frame that needs to be encoded currently. The image frame may refer to a frame in a video or a separate image. In a real-time communication scenario, the target image frame may refer to the image frame to be encoded in the real-time communication video. The real-time communication scenario may be, but is not limited to, live broadcast, remote video conferencing or cloud gaming. The target coding frame type refers to the coding frame type that matches the target image frame, that is, the coding frame that the target image frame needs to be encoded into. The target coding frame type may include an intra-frame coding frame or an inter-frame coding frame. The intra-frame coding frame only needs to refer to the block coding in the frame, without reference to other frames. The inter-frame coding frame needs to refer to other frames for coding. For example, the intra-frame coding frame may refer to a key frame (ie, an I frame) or an instant decoding refresh frame (ie, an IDR frame). The inter-frame coding frame may refer to a forward prediction coding frame (ie, a P frame) or a bidirectional prediction coding frame (ie, a B frame). Among them, the forward prediction coding frame needs to refer to the previous frame of the current frame for coding generation. The bidirectional prediction coding frame needs to refer to the previous frame and the next frame of the current frame for coding generation.

[0039] Specifically, when encoding the target image frame using an encoder, the target encoding frame type that the target image frame needs to be encoded into can be determined based on any existing method, so as to accurately encode and divide the target image frame based on the obtained target encoding frame type.

[0040] S120. Determine target coding information corresponding to the target image frame based on the target coding frame type.

[0041] The target coding information may refer to information required for reference when coding the target image frame. For example, the target coding information may include the brightness component of the target image frame, or may include the brightness component of the target reference frame in addition to the brightness component of the target image frame. The brightness component refers to the brightness information in the color image frame, which can reflect the brightness change of the image frame, such as Figure 2 As shown. The target reference frame refers to other image frames that are referenced when the target image frame is encoded. For example, when the target encoding frame type is a P frame, the target reference frame may refer to the previous frame of the target image frame. When the target encoding frame type is a B frame, the target reference frame may refer to the previous frame and the next frame of the target image frame. Different target encoding frame types correspond to different target encoding information.

[0042] Exemplarily, S120 may include: if the target coding frame type is an intra-frame coding frame, determining the brightness component of the target image frame as the target coding information corresponding to the target image frame; if the target coding frame type is an inter-frame coding frame, determining the brightness component of the target image frame and the brightness component of the target reference frame as the target coding information corresponding to the target image frame.

[0043] Specifically, when the target coding frame type is an intra-frame coding frame, only the current frame information needs to be referenced when encoding the target image frame, and the target coding information is determined to include the brightness component of the target image frame. When the target coding frame type is an inter-frame coding frame, in addition to referring to the current frame information, other frames need to be referenced when encoding the target image frame, and the target coding information is determined to include the brightness component of the target image frame and the brightness component of the reference image frame.

[0044] Exemplarily, when the target coding frame type is an inter-frame coding frame, the target coding information also includes the quantization parameter information of the target image frame. Among them, the quantization parameter information (Quantizer Parameter, QP) is pre-set for the target image frame, and is used to adjust the details of the target image frame, and ultimately achieve the effect of adjusting the picture quality. For example, the larger the QP, the larger the area in which the encoded image is assigned with a pixel value. If the number of different pixel values ​​in the image is larger, the larger the storage space required, but the larger the QP, the worse and less clear the encoded image quality will be, so the quantization parameter information will also affect the encoding effect of the inter-frame coding frame, so when the inter-frame coding frame, the target coding information includes not only the brightness component of the target image frame and the brightness component of the reference image frame, but also the quantization parameter information, so as to further improve the encoding quality.

[0045] S130. Based on the target partition prediction model and target coding information corresponding to the target coding frame type, perform partition depth prediction on the target image frame to obtain a target partition depth value corresponding to a reference coding block in the target image frame, wherein the target partition prediction model is pre-trained based on sample coding information corresponding to the sample image frame and a label partition depth value corresponding to the reference coding block in the sample image frame, and the label partition depth value is determined based on an actual coding block partition result of the sample image frame.

[0046] Among them, the target partition prediction model can be an intra-frame partition prediction model corresponding to an intra-frame coded frame or an inter-frame partition prediction model corresponding to an inter-frame coded frame. The intra-frame partition prediction model is a network model used to predict the partition depth value of the reference coding block in the target image frame based on the target coding information corresponding to the intra-frame coded frame. The inter-frame partition prediction model is a network model used to predict the partition depth value of the reference coding block in the target image frame based on the target coding information corresponding to the inter-frame coded frame. The coding block refers to a partial area divided in the image frame. The reference coding block refers to a coding block with a preset size after initial partitioning. The reference coding block refers to an initial partition unit. The reference coding block corresponds to the partition depth value one by one. The partition depth value may refer to the depth value of the reference coding block in the coding tree. For example, starting from the 64×64 coding block, the partition result may have 4 sizes of coding blocks of 64×64, 32×32, 16×16 and 8×8, and their partition depth values ​​are 0, 1, 2 and 3 respectively. The preset size of the reference coding block can be used to characterize the coding block size represented by a partition depth value, which can be set in advance based on business needs. For example, the preset size of the reference coding block can be 16×16 or 8×8, etc. The target partition prediction model can initially partition the target image frame based on the preset size, obtain each reference coding block with a preset size, and predict the target partition depth value of each reference coding block based on the target coding information.

[0047] Among them, the sample image frame can be an existing image frame used for training the model. The sample coding information is also determined based on the target coding frame type corresponding to the sample image frame. The determination process is the same as the determination process of the target coding information, which will not be repeated here. The label partition depth value may refer to the actual partition depth value corresponding to the reference coding block in the sample image frame. The actual coding block partition result is the coding block partition result when the coding quality of the sample image frame is optimal, so as to ensure the coding partition quality of the target partition prediction model. The label partition depth value corresponding to each reference coding block in the sample image frame can be determined based on the preset size of the reference coding block and the actual coding block partition result of the sample image frame. For example, see Figure 3 Two determination methods are given. The first determination method is that when the preset size of the reference coding block is 16×16, the 32×32 coding block in the actual coding block division result is divided into 4 16×16 reference coding blocks and the label division depth value corresponding to each reference coding block is determined to be 1, the 16×16 coding block in the actual coding block division result is directly used as the reference coding block and the label division depth value is determined to be 2, and the 4 8×8 coding blocks in the actual coding block division result are merged into 1 16×16 reference coding block and the label division depth value is determined to be 3, so as to obtain the label division depth value corresponding to each 16×16 reference coding block in the sample image frame. The second determination method is that when the preset size of the reference coding block is 8×8, the 32×32 coding block in the actual coding block division result is divided into 16 8×8 reference coding blocks and the label division depth value corresponding to each reference coding block is determined to be 1, the 16×16 coding block is divided into 4 8×8 reference coding blocks and the label division depth value corresponding to each reference coding block is determined to be 3, and the 8×8 coding block in the actual coding block division result is directly used as the reference coding block and the label division depth value is determined to be 3, so as to obtain the label division depth value corresponding to each 8×8 reference coding block in the sample image frame.

[0048] It should be noted that, since 64×64 coding blocks do not appear in actual coding division, only the division depth values ​​of three sizes, 32×32, 16×16 and 8×8, are marked in the sample image frame. The number of label division depth values ​​obtained by the first determination method mentioned above is less than the number of label division depth values ​​obtained by the second determination method. Therefore, using the first determination method for model training can further simplify the model network complexity and further improve the model's division prediction speed. For example, when the preset size of the reference coding block is 16×16, for an image frame with a resolution of 720×1280, the annotation size of the division depth of the entire image is (720 / 16)×(1280 / 16), and each 16×16 reference coding block is represented by a label division depth value.

[0049] Specifically, supervised model training can be performed in advance based on the sample coding information corresponding to the sample image frame under each coding frame type and the label partition depth value corresponding to the reference coding block in the sample image frame to obtain a partition prediction model corresponding to each coding frame type after the training, such as an intra-frame partition prediction model and an inter-frame partition prediction model. In actual application, based on the partition prediction model corresponding to each coding frame type obtained in advance through training, a target partition prediction model corresponding to the target coding frame type is determined, and the target coding information can be input into the target partition prediction model to predict the partition depth value of each reference coding block in the target image frame, and the predicted target partition depth value is output, thereby obtaining the target partition depth value corresponding to each reference coding block in the target image frame.

[0050] Exemplarily, before inputting the target coding information into the target partition prediction model, it may also include: based on a preset size of the reference coding block, pixel padding of the brightness component in the target coding information to obtain a brightness component with a preset image size, and inputting the filled brightness component into the target partition prediction model to predict the partition depth.

[0051] Specifically, in traditional coding, the division result of each coding block will be affected by the division result of the surrounding coding blocks, and will also be affected by whether there are coding blocks around. In order to simulate the division logic in the traditional coding process as much as possible, before the division prediction of each image frame, the brightness component of the image frame is padded with pixels in the four directions of up, down, left and right. For example, the padded pixel value is 114, so that the padding width in each direction is 16. For example, the image resolution of the 720×1280 image after padding becomes 752×1312, and the 16×16 small blocks with all values ​​of 114 represent the non-existent coding blocks. The accuracy of the coding division can be further guaranteed by pixel padding of the brightness component.

[0052] S140 . Determine a target coding block division result corresponding to the target image frame based on the target division depth value.

[0053] Among them, the target division depth value can be used to characterize the division relationship between the reference coding block and the target coding block that is finally divided. For example, the target division depth value can be used to characterize whether the target coding block is obtained by merging the reference coding blocks, or the target coding block is obtained by dividing the reference coding block, or the reference coding block is directly used as the target coding block. The target coding block division result corresponding to the target image frame includes multiple target coding blocks that are finally divided in the target image frame. For example, the target division depth value may include: a first depth value, a second depth value, or a third depth value. Among them, the first depth value (such as 1) is used to characterize the need to merge the reference coding blocks in the divided area (such as the area of ​​2×2 reference coding blocks) into one target coding block. The second depth value (such as 2) is used to characterize the reference coding block as the target coding block that is finally divided. The third depth value (such as 3) is used to characterize the need to divide the reference coding block into multiple target coding blocks again.

[0054] Specifically, based on the target division depth value corresponding to each reference coding block in the target image frame, all reference coding blocks in the target image frame are processed to obtain the target coding block division result corresponding to the target image frame at one time. It should be noted that the process of determining the target coding block division result based on the target division depth value and the process of determining the label division depth value based on the actual coding block division result are mutually inverse processes, which can refer to the above description.

[0055] For example, when the preset size of the reference coding block is 16×16, if the target division depth value corresponding to a reference coding block in the target image frame is the first depth value 1, the reference coding block and the surrounding 2×2 reference coding blocks are merged into a target coding block that is finally divided into 32×32. If the target division depth value corresponding to the reference coding block is the second depth value 2, the reference coding block is used as the target coding block for the final division without further division. If the target division depth value corresponding to the reference coding block is the third depth value 3, the reference coding block is further divided into 2×2 8×8 target coding blocks.

[0056] The technical solution of this embodiment determines the target coding information matching the target image frame based on the target coding frame type corresponding to the target image frame to be encoded, and performs a division depth prediction on the target image frame based on the target division prediction model and the target coding information corresponding to the target coding frame type, so that the target division depth value corresponding to the reference coding block in the target image frame can be quickly obtained, and the target coding block division result corresponding to the target image frame can be determined at one time based on the target division depth value, thereby realizing fast and efficient coding division. Among them, the target division prediction model is pre-trained based on the sample coding information corresponding to the sample image frame and the label division depth value corresponding to the reference coding block in the sample image frame, and the label division depth value is determined based on the actual coding block division result of the sample image frame, so that the trained target division prediction model can be used to ensure the coding quality while performing fast and efficient coding division, thereby improving the coding speed.

[0057] On the basis of the above-mentioned technical solutions, when the target coding information corresponding to each coding frame type only includes the same type of information, the partition prediction model corresponding to each coding frame type has the same network architecture, but the specific network weight values ​​are different, which need to be determined based on model training. For example, when the target coding information corresponding to the intra-frame coding frame and the target coding information corresponding to the inter-frame coding frame only include the brightness component, the intra-frame partition prediction model and the inter-frame partition prediction model have the same network architecture, but the specific network weight values ​​are different. Exemplarily, the partition prediction model corresponding to each coding frame type can include: a feature extraction sub-model, a semantic segmentation sub-model and a partition prediction sub-model. The information flow processing process in the partition prediction model corresponding to each coding frame type is the same. The target partition prediction model determined from the partition prediction model corresponding to each coding frame type may also include: a feature extraction sub-model, a semantic segmentation sub-model and a partition prediction sub-model.

[0058] Among them, the feature extraction submodel is used to extract low-level features of the image from the brightness component, such as contour features, edge features, texture features, and shape features. The semantic segmentation submodel can be used to extract target features in the image. For example, the semantic segmentation submodel can include multiple parallel ASPP (Atrous spatial pyramid pooling, hollow spatial convolution pooling pyramid) modules to extract features of targets of different scales and further improve the accuracy of segmentation prediction. For example, the semantic segmentation submodel consists of 4 parallel ASPP modules, each ASPP module corresponds to a different convolution rate, so as to obtain a larger receptive field and extract more contextual information. The partition prediction submodel can be a classification network model for predicting the partition depth value. For example, the partition prediction submodel can be obtained by connecting the convolution layer and the pooling layer in the neural network in series. The partition prediction submodel uses a depth-separable convolution instead of a conventional convolution layer to increase the calculation speed.

[0059] For example, see Figure 4 , S130 may include: inputting the target coding information into the feature extraction sub-model for feature extraction to obtain first feature information; inputting the first feature information into the semantic segmentation sub-model for semantic feature extraction to obtain second feature information; splicing the target coding information, the first feature information and the second feature information, and inputting the spliced ​​target feature information into the partition prediction sub-model to predict the partition depth of the target image frame; based on the output of the partition prediction sub-model, obtaining the target partition depth value corresponding to the reference coding block in the target image frame.

[0060] Specifically, when the target partition prediction model is an intra-frame partition prediction model, the brightness component of the target image frame is input into the feature extraction submodel for feature extraction to obtain the first feature information, and the first feature information is input into the semantic segmentation submodel for feature extraction of different scales to obtain the second feature information. The brightness component of the target image frame, the first feature information, and the second feature information are spliced ​​(i.e., feature concatenation), and the spliced ​​target feature information is input into the partition prediction submodel for partition depth prediction to obtain the target partition depth value corresponding to each reference coding block in the target image frame and output. Alternatively, when the target partition prediction model is an inter-frame partition prediction model, the brightness component of the target image frame and the brightness component of the target reference frame are spliced ​​and input into the feature extraction submodel for feature extraction to obtain the first feature information, and the first feature information is input into the semantic segmentation submodel for feature extraction of different scales to obtain the second feature information. The brightness component of the target image frame, the brightness component of the target reference frame, the first feature information and the second feature information are spliced ​​(i.e., feature concatenation), and the spliced ​​target feature information is input into the partition prediction sub-model to perform partition depth prediction of the target image frame, and the target partition depth value corresponding to each reference coding block in the target image frame is obtained and output.

[0061] On the basis of the above technical solutions, when the target coding frame type is an inter-frame coding frame, and the target coding information includes not only the brightness component of the target image frame and the brightness component of the target reference frame, but also the quantization parameter information of the target image frame, the target partition prediction model is an inter-frame partition prediction model. At this time, the target partition prediction model includes not only the feature extraction sub-model, the semantic segmentation sub-model and the partition prediction sub-model, but also: a quantization coding sub-model, such as Figure 5 shown.

[0062] Among them, the quantization parameter information is a constant matrix, and each value on the matrix represents the quantization value of each reference coding block in the target image frame. There are 52 possible quantization values, with a maximum of 51 and a minimum of 0. The quantization coding sub-model can be used to one-hot encode or normalize the input quantization parameter information. Compared with the one-hot encoding method, the quantization coding sub-model can obtain higher prediction speed and accuracy by using normalization. For exactly the same target image frame and reference image frame, if the given quantization parameter information is different, the corresponding inter-frame division results will also be different.

[0063] Exemplarily, inputting the spliced ​​target feature information into the partition prediction sub-model to perform partition depth prediction of the target image frame may include: inputting the quantization parameter information of the target image frame into the quantization coding sub-model for information encoding to obtain third feature information; superimposing the spliced ​​target feature information and the third feature information, and inputting the superimposed target feature information into the partition prediction sub-model to perform partition depth prediction of the target image frame.

[0064] Specifically, see Figure 5 When the target partition prediction model is an inter-frame partition prediction model, the quantization parameter information of the target image frame is input into the quantization coding sub-model for information encoding to obtain the third feature information. The brightness component of the target image frame, the brightness component of the target reference frame, the first feature information output by the feature extraction sub-model, and the second feature information output by the semantic segmentation sub-model are spliced ​​(i.e., feature concatenation) to obtain the spliced ​​target feature information. The target feature information and the third feature information are superimposed (i.e., feature addition), and the superimposed target feature information is input into the partition prediction sub-model for partition depth prediction, and the target partition depth value corresponding to each reference coding block in the target image frame is obtained and output. By using the quantization coding sub-model to encode the input quantization parameter information, the accuracy of the inter-frame partition prediction can be further improved.

[0065] On the basis of the above technical solutions, the target partition prediction model is pre-trained based on the sample coding information corresponding to the sample image frame and the label partition depth value and label coding mode corresponding to the reference coding block in the sample image frame. When training the target partition prediction model, the target partition prediction model also includes: a mode prediction sub-model, which is used to predict the coding mode based on the spliced ​​target feature information or the superimposed target feature information.

[0066] Among them, the label coding mode may refer to the coding mode used by the reference coding block when the coding quality is optimal. The coding mode refers to the way of compressing the pixel values ​​in the reference coding block. For example, the coding mode may be a vertical mode or a horizontal mode, etc. The horizontal mode is to represent each row of pixel values ​​in the reference coding block with one pixel value. The vertical mode means that each column of pixel values ​​in the reference coding block is represented by one pixel value, such as averaging all pixel values ​​in the same column, and the obtained mean represents the entire pixel value of the reference coding block, thereby saving storage space and transmission costs.

[0067] Specifically, when training the partition prediction model corresponding to each coding frame type, a mode prediction sub-model can be added to the partition prediction model to predict the coding mode while predicting the depth, and the predicted coding mode is used as an auxiliary loss for model training, thereby improving the prediction effect of the partition depth. For example, see Figure 6 , when training the target partition prediction model, the input information of the pattern prediction sub-mode and the partition prediction sub-model is the same, both of which are the spliced ​​target feature information. The training process of the target partition prediction model is specifically as follows: the sample coding information corresponding to the sample image frame is input into the target partition prediction model to be trained for partition depth prediction and coding mode prediction, and the sample partition depth value and sample coding mode corresponding to each reference coding block in the sample image frame are obtained and output. Based on the loss function, the training error is determined according to the sample partition depth value, sample coding mode, label partition depth value and label coding mode corresponding to each reference coding block, and the training error is back-propagated to the target partition prediction model to be trained, and the network weights in the target partition prediction model to be trained are adjusted until the preset convergence conditions are reached, such as when the number of iterations is equal to the preset number, or the training error changes tend to be stable, the training is determined to be over, and the target partition prediction model is obtained. Similarly, when training such as Figure 5 When the target partition prediction model is shown, the input information of the mode prediction sub-mode and the partition prediction sub-model is also the same, which is the superimposed target feature information. The training process can refer to the above description. By introducing the prediction of the coding mode when training the model, the prediction accuracy of the partition depth can be further improved, and the coding effect can be further improved.

[0068] Exemplarily, after the training of the target partition prediction model is completed, the pattern prediction sub-model in the target partition prediction model can be deleted so that only the partition prediction sub-model can be used to predict the partition depth. Alternatively, the pattern prediction sub-model can be retained so that the target partition prediction model can be used to simultaneously predict the partition depth value and the encoding mode, thereby further improving the encoding speed.

[0069] Figure 7 This is a flowchart of another coding division method provided by an embodiment of the present invention. Based on the above embodiments, this embodiment optimizes the step of "determining the target coding block division result corresponding to the target image frame based on the target division depth value". The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.

[0070] See also Figure 7 Another coding division method provided in this embodiment specifically includes the following steps:

[0071] S210: Obtain a target coding frame type corresponding to a target image frame to be encoded.

[0072] S220: Determine target coding information corresponding to the target image frame based on the target coding frame type.

[0073] S230 . Based on the target partition prediction model and target coding information corresponding to the target coding frame type, perform partition depth prediction on the target image frame to obtain a target partition depth value corresponding to a reference coding block in the target image frame.

[0074] S240: Based on the spatial consistency adjustment method of the partition depth value, adjust the target partition depth value so that the adjusted target partition depth value meets the spatial consistency.

[0075] The spatial consistency adjustment method is determined in advance based on the position restriction information of each segmentation depth value in the image frame, so that the segmentation result can meet the purpose of spatial consistency.

[0076] Specifically, when the target partition prediction model is used to predict the partition depth value corresponding to each reference coding block in the target image frame, the limitation of spatial consistency is not considered, such as all the partition depth values ​​in a partition area are the same, or a certain depth value cannot exist alone in the partition area, etc. After obtaining the target partition depth value corresponding to each reference coding block in the target image frame, it is necessary to detect whether the target partition depth value corresponding to each reference coding block satisfies the spatial consistency. If not, it is necessary to adjust the target partition depth value using the spatial consistency adjustment method so that all the adjusted target partition depth values ​​satisfy the spatial consistency, thereby further improving the accuracy of the coding partition.

[0077] Exemplarily, S240 may include: determining the number of target reference coding blocks in each divided area in the target image frame; based on the number of target reference coding blocks corresponding to each divided area, adjusting the target division depth value corresponding to the reference coding block in each divided area so that the adjusted target division depth value satisfies spatial consistency.

[0078] Each partitioned area includes a first number of reference coding blocks, such as a partitioned area consisting of a neighborhood area of ​​2×2 reference coding blocks. The target partitioned depth value corresponding to the target reference coding block is a first depth value. The first depth value is used to characterize the need to merge the reference coding blocks within the partitioned area into one coding block. For example, the first depth value is 1, which characterizes the need to merge 2×2 reference coding blocks into one final partitioned target coding block.

[0079] Specifically, for each divided area in the target image frame, based on the target divided depth value corresponding to each reference coding block in the divided area, the number of target reference coding blocks whose target divided depth value is the first depth value is counted in the divided area. Whether the target divided depth value in the divided area needs to be adjusted and the specific adjustment method can be determined based on the number of target reference coding blocks, so that the adjusted divided area has spatial consistency. By taking the divided area as a unit, spatial consistency adjustment can be performed more quickly and accurately.

[0080] It should be noted that in addition to the first depth value, the target partition depth value may also be a second depth value and a third depth value. The second depth value (such as 2) is used to characterize that the reference coding block is the target coding block for the final partition. The third depth value (such as 3) is used to characterize that the reference coding block needs to be divided into multiple target coding blocks again. When the target partition depth value is the second depth value and the third depth value, it satisfies the spatial consistency itself and does not need to be adjusted. When the target partition depth value is the first depth value, it needs to be adjusted based on other target partition depth values ​​in the partition area where it is located so that the partition area satisfies the spatial consistency, and thus it is necessary to count the number of target reference coding blocks in each partition area whose target partition depth value is the first depth value. For example, the limitation of spatial consistency is: when the preset size of the reference coding block is 16×16, if the target division depth value corresponding to a reference coding block is the first depth value 1, it means that the reference coding block should be located in the 32×32 coding block divided in the division result, and thus the target division depth values ​​corresponding to the other three reference coding blocks in the 2×2 division area where the reference coding block is located need to be adjusted to 1, so as to satisfy the final division result that 2×2 16×16 reference coding blocks constitute 1 32×32 coding block.

[0081] Exemplarily, based on the number of target reference coding blocks corresponding to each divided area, the target division depth value corresponding to the reference coding block in each divided area is adjusted so that the adjusted target division depth value satisfies spatial consistency, which may include: if the number of target reference coding blocks corresponding to the current divided area is one, adjusting the target division depth value corresponding to the target reference coding block to the second depth value; if the number of target reference coding blocks corresponding to the current divided area is less than the first number and greater than or equal to the second number, adjusting the target division depth value corresponding to the remaining reference coding blocks except the target reference coding block in the current divided area to the first depth value.

[0082] The second depth value is used to characterize that the reference coding block is the target coding block for the final division. The second number may refer to half of the first number. For example, the first number is 4 and the second number may be 2.

[0083] Specifically, each divided area in the target image frame can be adjusted as the current divided area. In the case where there is only one target reference coding block in the current divided area, since the first depth value cannot exist alone, that is, the prediction result of the target reference coding block is wrong, the target divided depth value corresponding to the target reference coding block can be adjusted from the first depth value 1 to the second depth value 2, such as Figure 8 In the case where there are at least the second number of target reference coding blocks in the current partition area, it indicates that all reference coding blocks in the current partition area need to be merged. At this time, the target partition depth values ​​corresponding to the remaining reference coding blocks in the current partition area except the target reference coding block can also be adjusted to the first depth value 1, so that the target partition depth values ​​of all reference coding blocks in the current partition area are the first depth value 1, such as Figure 8 If the number of target reference coding blocks corresponding to the current partition area is zero, that is, there is no target reference coding block in the current partition area, no adjustment is required.

[0084] S250 . Determine a target coding block division result corresponding to the target image frame based on the adjusted target division depth value.

[0085] Specifically, based on the target division depth value corresponding to each reference coding block that satisfies spatial consistency, all reference coding blocks in the target image frame are processed to more accurately obtain the target coding block division result corresponding to the target image frame. Figure 8 After spatial consistency adjustment, if the target partition depth value corresponding to the reference coding block is the first depth value 1, the reference coding block and the surrounding 2×2 reference coding blocks are merged into a target coding block that is finally partitioned into 32×32. If the target partition depth value corresponding to the reference coding block is the second depth value 2, the reference coding block is used as the target coding block for the final partition without further partitioning. If the target partition depth value corresponding to the reference coding block is the third depth value 3, the reference coding block is further divided into 2×2 8×8 target coding blocks.

[0086] The technical solution of this embodiment adjusts the target division depth value through a spatial consistency adjustment method based on the division depth value, so that the adjusted target division depth value satisfies the spatial consistency, and based on the adjusted target division depth value, the target coding block division result corresponding to the target image frame can be determined more accurately, thereby further improving the accuracy of the coding division.

[0087] The following is an embodiment of the coding division device provided in an embodiment of the present invention. The device and the coding division methods of the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the coding division device, please refer to the embodiment of the above-mentioned coding division method.

[0088] Fig. 9 Schematic diagram of a coding division device provided by an embodiment of the present invention. This embodiment is applicable to the case where the coding blocks are divided into the coding blocks during the coding process of the image frame. Fig. 9 As shown, the device specifically includes: a target coding frame type acquisition module 310, a target coding information determination module 320, a division depth prediction module 330 and a division result determination module 340.

[0089] Among them, the target coding frame type acquisition module 310 is used to obtain the target coding frame type corresponding to the target image frame to be encoded; the target coding information determination module 320 is used to determine the target coding information corresponding to the target image frame based on the target coding frame type; the division depth prediction module 330 is used to perform division depth prediction on the target image frame based on the target division prediction model corresponding to the target coding frame type and the target coding information, and obtain the target division depth value corresponding to the reference coding block in the target image frame, wherein the target division prediction model is pre-trained based on the sample coding information corresponding to the sample image frame and the label division depth value corresponding to the reference coding block in the sample image frame, and the label division depth value is determined based on the actual coding block division result of the sample image frame; the division result determination module 340 is used to determine the target coding block division result corresponding to the target image frame based on the target division depth value.

[0090] The technical solution of this embodiment determines the target coding information matching the target image frame based on the target coding frame type corresponding to the target image frame to be encoded, and performs a division depth prediction on the target image frame based on the target division prediction model and the target coding information corresponding to the target coding frame type, so that the target division depth value corresponding to the reference coding block in the target image frame can be quickly obtained, and the target coding block division result corresponding to the target image frame can be determined at one time based on the target division depth value, thereby realizing fast and efficient coding division. Among them, the target division prediction model is pre-trained based on the sample coding information corresponding to the sample image frame and the label division depth value corresponding to the reference coding block in the sample image frame, and the label division depth value is determined based on the actual coding block division result of the sample image frame, so that the trained target division prediction model can be used to ensure the coding quality while performing fast and efficient coding division, thereby improving the coding speed.

[0091] Optionally, the target coding information determination module 320 is specifically configured to:

[0092] If the target coding frame type is an intra-frame coding frame, the brightness component of the target image frame is determined as the target coding information corresponding to the target image frame; if the target coding frame type is an inter-frame coding frame, the brightness component of the target image frame and the brightness component of the target reference frame are determined as the target coding information corresponding to the target image frame.

[0093] Optionally, when the target coding frame type is an inter-frame coding frame, the target coding information further includes quantization parameter information of the target image frame.

[0094] Optionally, the target partition prediction model includes: a feature extraction sub-model, a semantic segmentation sub-model and a partition prediction sub-model;

[0095] The depth prediction module 330 is divided into:

[0096] A first feature information acquisition unit, used for inputting the target coding information into the feature extraction sub-model to perform feature extraction and obtain first feature information;

[0097] A second feature information acquisition unit, used for inputting the first feature information into the semantic segmentation sub-model to extract semantic features and obtain second feature information;

[0098] A partition depth prediction unit, used for splicing the target coding information, the first feature information and the second feature information, and inputting the spliced ​​target feature information into the partition prediction sub-model to perform partition depth prediction of the target image frame;

[0099] The target partition depth value acquisition unit is used to obtain the target partition depth value corresponding to the reference coding block in the target image frame based on the output of the partition prediction sub-model.

[0100] Optionally, when the target coding frame type is an inter-frame coding frame, and the target coding information further includes quantization parameter information of the target image frame, the target partition prediction model further includes: a quantization coding sub-model;

[0101] Divide the depth prediction unit, specifically for:

[0102] The quantization parameter information of the target image frame is input into the quantization coding sub-model for information encoding to obtain the third feature information; the spliced ​​target feature information and the third feature information are superimposed, and the superimposed target feature information is input into the segmentation prediction sub-model to perform segmentation depth prediction of the target image frame.

[0103] Optionally, the target partition prediction model is obtained by pre-training based on sample coding information corresponding to a sample image frame and a label partition depth value and a label coding mode corresponding to a reference coding block in the sample image frame;

[0104] When training the target partition prediction model, the target partition prediction model further includes: a mode prediction sub-model, and the mode prediction sub-model is used to predict the coding mode based on the spliced ​​target feature information or the superimposed target feature information.

[0105] Optionally, the division result determination module 340 includes:

[0106] A spatial consistency adjustment unit, configured to adjust the target partition depth value based on the spatial consistency adjustment method of the partition depth value, so that the adjusted target partition depth value satisfies the spatial consistency;

[0107] The division result determining unit is used to determine the target coding block division result corresponding to the target image frame based on the adjusted target division depth value.

[0108] Optionally, the spatial consistency adjustment unit includes:

[0109] a target reference coding block quantity determination subunit, configured to determine the target reference coding block quantity in each divided area in the target image frame, wherein each divided area includes a first number of reference coding blocks, and a target division depth value corresponding to the target reference coding block is a first depth value, and the first depth value is used to indicate that the reference coding blocks in the divided area need to be merged into one coding block;

[0110] The spatial consistency adjustment subunit is used to adjust the target partition depth value corresponding to the reference coding block in each partition area based on the number of target reference coding blocks corresponding to each partition area, so that the adjusted target partition depth value meets the spatial consistency.

[0111] Optionally, the spatial consistency adjustment subunit is specifically used to: if the number of target reference coding blocks corresponding to the current divided area is one, then adjust the target division depth value corresponding to the target reference coding block to a second depth value, and the second depth value is used to characterize that the reference coding block is the target coding block of the final division; if the number of target reference coding blocks corresponding to the current divided area is less than the first number and greater than or equal to the second number, then adjust the target division depth values ​​corresponding to the remaining reference coding blocks in the current divided area except the target reference coding block to the first depth value.

[0112] The coding division device provided in the embodiment of the present invention can execute the coding division method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the coding division method.

[0113] It is worth noting that in the embodiment of the above-mentioned coding division device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0114] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Fig.10 A block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention is shown. Fig.10 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0115] like Fig.10 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0116] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0117] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0118] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory 30 (RAM) and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Fig.10 not shown, usually called a "hard drive"). Although Fig.10Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0119] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0120] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0121] The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, such as implementing a coding division method step provided by any embodiment of the present invention.

[0122] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the coding division method provided by any embodiment of the present invention.

[0123] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the coding division method provided in any embodiment of the present invention are implemented. The method includes:

[0124] Obtaining a target encoding frame type corresponding to a target image frame to be encoded;

[0125] Based on the target coding frame type, determining target coding information corresponding to the target image frame;

[0126] Based on the target partition prediction model corresponding to the target coding frame type and the target coding information, a partition depth prediction is performed on the target image frame to obtain a target partition depth value corresponding to a reference coding block in the target image frame, wherein the target partition prediction model is pre-trained based on sample coding information corresponding to a sample image frame and a label partition depth value corresponding to a reference coding block in the sample image frame, and the label partition depth value is determined based on an actual coding block partition result of the sample image frame;

[0127] Based on the target division depth value, a target coding block division result corresponding to the target image frame is determined.

[0128] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0129] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0130] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0131] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0132] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0133] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A coding division method, characterized in that: include: Obtaining a target encoding frame type corresponding to a target image frame to be encoded; Based on the target coding frame type, determining target coding information corresponding to the target image frame; Based on the target partition prediction model corresponding to the target coding frame type and the target coding information, a partition depth prediction is performed on the target image frame to obtain a target partition depth value corresponding to a reference coding block in the target image frame, wherein the target partition prediction model is pre-trained based on sample coding information corresponding to a sample image frame and a label partition depth value corresponding to a reference coding block in the sample image frame, and the label partition depth value is determined based on an actual coding block partition result of the sample image frame; Based on the target division depth value, a target coding block division result corresponding to the target image frame is determined.

2. The method according to claim 1, characterized in that The determining, based on the target coding frame type, target coding information corresponding to the target image frame includes: If the target coding frame type is an intra-frame coding frame, the brightness component of the target image frame is determined as the target coding information corresponding to the target image frame; If the target coding frame type is an inter-frame coding frame, the brightness component of the target image frame and the brightness component of the target reference frame are determined as target coding information corresponding to the target image frame.

3. The method according to claim 2, characterized in that When the target coding frame type is an inter-frame coding frame, the target coding information further includes quantization parameter information of the target image frame.

4. The method according to claim 1, characterized in that The target partition prediction model includes: a feature extraction sub-model, a semantic segmentation sub-model and a partition prediction sub-model; The step of performing a partition depth prediction on the target image frame based on the target partition prediction model corresponding to the target coding frame type and the target coding information to obtain a target partition depth value corresponding to a reference coding block in the target image frame includes: Inputting the target coding information into the feature extraction sub-model to perform feature extraction to obtain first feature information; Inputting the first feature information into the semantic segmentation sub-model to extract semantic features to obtain second feature information; Splicing the target coding information, the first feature information and the second feature information, and inputting the spliced ​​target feature information into the segmentation prediction sub-model to perform segmentation depth prediction of the target image frame; Based on the output of the partition prediction sub-model, a target partition depth value corresponding to the reference coding block in the target image frame is obtained.

5. The method according to claim 4, characterized in that When the target coding frame type is an inter-frame coding frame, and the target coding information also includes quantization parameter information of the target image frame, the target partition prediction model further includes: a quantization coding sub-model; The step of inputting the spliced ​​target feature information into the segmentation prediction sub-model to perform segmentation depth prediction of the target image frame includes: Inputting the quantization parameter information of the target image frame into the quantization coding sub-model for information coding to obtain third feature information; The spliced ​​target feature information and the third feature information are superimposed, and the superimposed target feature information is input into the segmentation prediction sub-model to perform segmentation depth prediction of the target image frame.

6. The method according to claim 4 or 5, characterized in that: The target partition prediction model is obtained by training in advance based on sample coding information corresponding to the sample image frame and a label partition depth value and a label coding mode corresponding to a reference coding block in the sample image frame; When training the target partition prediction model, the target partition prediction model further includes: a mode prediction sub-model, and the mode prediction sub-model is used to predict the coding mode based on the spliced ​​target feature information or the superimposed target feature information.

7. The method according to claim 1, characterized in that The determining, based on the target division depth value, a target coding block division result corresponding to the target image frame includes: Based on the spatial consistency adjustment method of the partition depth value, the target partition depth value is adjusted so that the adjusted target partition depth value satisfies the spatial consistency; Based on the adjusted target division depth value, a target coding block division result corresponding to the target image frame is determined.

8. The method according to claim 7, characterized in that The spatial consistency adjustment method based on the partition depth value adjusts the target partition depth value so that the adjusted target partition depth value satisfies the spatial consistency, including: Determine the number of target reference coding blocks in each divided area in the target image frame, wherein each divided area includes a first number of reference coding blocks, and a target division depth value corresponding to the target reference coding block is a first depth value, and the first depth value is used to indicate that the reference coding blocks in the divided area need to be merged into one coding block; Based on the number of target reference coding blocks corresponding to each divided area, the target division depth value corresponding to the reference coding block in each divided area is adjusted so that the adjusted target division depth value meets the spatial consistency.

9. The method according to claim 8, characterized in that The step of adjusting the target partition depth value corresponding to the reference coding block in each partition area based on the number of target reference coding blocks corresponding to each partition area so that the adjusted target partition depth value satisfies the spatial consistency includes: If the number of target reference coding blocks corresponding to the current partition area is one, adjusting the target partition depth value corresponding to the target reference coding block to a second depth value, where the second depth value is used to indicate that the reference coding block is a target coding block for final partitioning; If the number of target reference coding blocks corresponding to the current partition area is less than the first number and greater than or equal to the second number, the target partition depth values ​​corresponding to the remaining reference coding blocks in the current partition area except the target reference coding block are adjusted to the first depth value.

10. A coding division device, characterized in that: include: A target coding frame type acquisition module is used to acquire a target coding frame type corresponding to a target image frame to be encoded; A target coding information determination module, used to determine the target coding information corresponding to the target image frame based on the target coding frame type; a partition depth prediction module, configured to perform a partition depth prediction on the target image frame based on a target partition prediction model corresponding to the target coding frame type and the target coding information, and obtain a target partition depth value corresponding to a reference coding block in the target image frame, wherein the target partition prediction model is pre-trained based on sample coding information corresponding to a sample image frame and a label partition depth value corresponding to a reference coding block in the sample image frame, and the label partition depth value is determined based on an actual coding block partition result of the sample image frame; The division result determination module is used to determine the target coding block division result corresponding to the target image frame based on the target division depth value.

11. An electronic device, characterized in that: The electronic device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the coding division method as described in any one of claims 1 to 9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the coding division method as described in any one of claims 1 to 9 is implemented.

Citation Information

Cited By

  • Coding partitioning method and apparatus, device, and storage medium

    WO2026061207A1