Video compression processing method, device, equipment and storage medium

CN118590648BActive Publication Date: 2026-10-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310252492.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-03
Publication Date
2026-10-27
Estimated Expiration
2043-03-03

AI Technical Summary

Technical Problem

若任意图像/视频都采用固定的量化块进行量化处理,显然无法满足不同场景内容的图像/视频编码性能

Benefits of technology

[0049]本申请实施例中,获取视频数据,若视频数据满足量化参数深度的自适应配置条件,则可以为视频数据开启量化参数深度关联的自适应配置算法,进而可以获取视频数据中的待编码图像帧对应的图像信息特征,该图像信息特征可以包括待编码图像帧的场景复杂度信息、第一偏移方差变化信息以及第二偏移方差变化信息等。通过图像信息特征可以自适应设置待编码图像帧对应的量化参数深度,即可以自适应选择待编码图像帧中的量化块的尺寸,可以增强量化块的尺寸配置的灵活性,进而可以提高视频数据的压缩性能。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118590648B_ABST
    Figure CN118590648B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a video compression processing method, device and equipment and a storage medium. The method comprises: if video data meets adaptive configuration conditions of quantization parameter depth, obtaining image information features corresponding to a to-be-encoded image frame in the video data; if the to-be-encoded image frame belongs to a first type of scene and is neither an I frame nor an unreferenced frame, determining a deviation variance comparison result according to first deviation variance change information and second deviation variance change information in the image information features; if the deviation variance comparison result is less than a deviation variance comparison threshold and an intra prediction cost is within a target cost range, setting a quantization parameter depth of the to-be-encoded image frame as first identification information; and if the deviation variance comparison result is greater than or equal to the deviation variance comparison threshold and the intra prediction cost is not within the target cost range, setting the quantization parameter depth as second identification information. The embodiments of the present application can improve video compression performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video compression processing, and more particularly to a video compression processing method, apparatus, device, and storage medium. Background Technology

[0002] With the rapid development of computer technology, the scale of image data is increasing, and the demand for image and video compression is also growing. Current image / video compression technologies can quantize the transformed image using methods such as Fourier transform, and then encode the quantized image to obtain the compressed image / video.

[0003] Current image / video compression technologies divide the quantization portion of an image or video into fixed-size quantization blocks, obtain the quantization parameters of each macroblock within the quantization block, use these parameters to calculate the quantization parameter offset of the quantization block, and encode the quantization parameter offset into the bitstream for transmission. If every image / video uses fixed quantization blocks for quantization processing, it is clearly insufficient to meet the image / video encoding performance requirements of different scenarios. Summary of the Invention

[0004] The technical problem to be solved by the embodiments of this application is to provide a video compression processing method, apparatus, device and storage medium that can improve the compression performance of video data.

[0005] One embodiment of this application provides a video compression processing method, including:

[0006] If the video data meets the adaptive configuration conditions of the quantization parameter depth, then the image information features corresponding to the image frame to be encoded in the video data are obtained; the quantization parameter depth is used to characterize the quantization block size in the image frame to be encoded.

[0007] If the scene complexity information contained in the image information features indicates that the image frame to be encoded belongs to the first type of scene, and the image frame to be encoded does not belong to the key frame or unreferenced frame in the video data, then the offset variance comparison result corresponding to the image frame to be encoded is determined according to the first offset variance change information and the second offset variance change information contained in the image information features; the first offset variance change information and the second offset variance change information are used to characterize the variance change information of the quantization parameter offset values ​​in the quantization blocks of different sizes contained in the image frame to be encoded.

[0008] If the offset variance comparison result is less than the offset variance comparison threshold, and the image information features indicate that the intra-prediction cost corresponding to the image frame to be encoded is within the target cost range, then the quantization parameter depth corresponding to the image frame to be encoded is set to the first identifier information, and the image frame to be encoded is encoded according to the first identifier information; the target cost range includes the range between the intra-cost threshold of the second type of scene and the intra-cost threshold of the first type of scene.

[0009] If the offset variance comparison result is greater than or equal to the offset variance comparison threshold, or if the image information features indicate that the intra-frame prediction cost corresponding to the image frame to be encoded is not within the target cost range, then the quantization parameter depth corresponding to the image frame to be encoded is set to the second identifier information, and the image frame to be encoded is encoded according to the second identifier information.

[0010] One embodiment of this application provides a video compression processing apparatus, including:

[0011] The image information acquisition module is used to acquire video data. If the video data meets the adaptive configuration conditions of the quantization parameter depth, the image information features corresponding to the image frame to be encoded in the video data are acquired. The quantization parameter depth is used to characterize the quantization block size in the image frame to be encoded.

[0012] The comparison result determination module is used to determine the offset variance comparison result corresponding to the image frame to be encoded based on the first offset variance change information and the second offset variance change information contained in the image information features if the scene complexity information contained in the image information features indicates that the image frame to be encoded belongs to the first type of scene and the image frame to be encoded does not belong to the key frame and unreferenced frame in the video data. The first offset variance change information and the second offset variance change information are used to characterize the variance change information of the quantization parameter offset values ​​in quantization blocks of different sizes contained in the image frame to be encoded.

[0013] The first setting module is used to set the quantization parameter depth of the image frame to be encoded to the first identification information if the offset variance comparison result is less than the offset variance comparison threshold and the image information features indicate that the intra-prediction cost corresponding to the image frame to be encoded is within the target cost range, and then encode the image frame to be encoded according to the first identification information; the target cost range includes the range between the intra-cost threshold of the second type of scene and the intra-cost threshold of the first type of scene.

[0014] The second setting module is used to set the quantization parameter depth of the image frame to be encoded to the second identification information if the offset variance comparison result is greater than or equal to the offset variance comparison threshold, or if the image information features indicate that the intra-frame prediction cost corresponding to the image frame to be encoded is not within the target cost range, and then encode the image frame to be encoded according to the second identification information.

[0015] The device also includes:

[0016] The resolution acquisition module is used to acquire resolution information of video data;

[0017] A configuration condition determination module is used to determine whether the video data meets the adaptive configuration condition of the quantization parameter depth if the resolution information is less than or equal to the resolution threshold; and,

[0018] It is also used to determine if the resolution information is greater than the resolution threshold, and to set a fixed quantization parameter depth for all image frames contained in the video data.

[0019] Specifically, if the video data meets the adaptive configuration conditions of the quantization parameter depth, the image information acquisition module acquires the image information features corresponding to the image frame to be encoded in the video data, including:

[0020] The image group acquisition unit is used to acquire the image frame sequence corresponding to the video data if the video data meets the adaptive configuration conditions of the quantization parameter depth, and divide the image frame sequence into one or more image groups according to the temporal order of the image frames contained in the video data.

[0021] The hierarchical information acquisition unit is used to determine the image frame to be encoded from the image frame sequence, determine the image group to which the image frame to be encoded belongs as the target image group, and obtain the image hierarchical information corresponding to the image frame to be encoded based on the reference relationship between the image frames in the target image group.

[0022] The complexity information acquisition unit is used to acquire the intra-frame prediction cost and intra-frame prediction mode ratio corresponding to the image frame to be encoded. Based on the intra-frame prediction cost and intra-frame prediction mode ratio, the scene complexity information corresponding to the image frame to be encoded is acquired. The intra-frame prediction mode ratio is used to characterize the proportion of the target mode used in the inter-frame prediction of the image frame to be encoded.

[0023] The offset change information acquisition unit is used to acquire the quantization parameter offset value corresponding to the quantization block in the image frame to be encoded, acquire the quantization parameter offset change information corresponding to the image frame to be encoded based on the quantization parameter offset value, and determine the image layer information, scene complexity information and quantization parameter offset change information as the image information features corresponding to the image to be encoded.

[0024] The hierarchical information acquisition unit obtains the image hierarchical information corresponding to the image frame to be encoded based on the reference relationship between image frames in the target image group, including:

[0025] Obtain the reference relationships between image frames in the target image group, and determine the number of times the image frame to be encoded is referenced in the target image group based on the reference relationships;

[0026] The image layer information corresponding to the image frame to be encoded is determined based on the number of times the image frame to be referenced.

[0027] The complexity information acquisition unit obtains scene complexity information corresponding to the image frame to be encoded based on the intra-frame prediction cost and the proportion of intra-frame prediction modes, including:

[0028] If the intra-frame prediction cost is less than the intra-frame cost threshold for the first type of scene, and the proportion of intra-frame prediction modes is greater than the target parameter value, then the scene complexity information corresponding to the image frame to be encoded is determined to be the second type of scene.

[0029] If the intra-frame prediction cost is less than the intra-frame cost threshold for the second type of scene, then the scene complexity information corresponding to the image frame to be encoded is determined to be the second type of scene.

[0030] If the intra-frame prediction cost is greater than the inter-frame cost threshold for the third type of scene, then the scene complexity information corresponding to the image frame to be encoded is determined to be the third type of scene.

[0031] If the image frame to be encoded does not belong to the second type of scene and does not belong to the third type of scene, then the scene complexity information corresponding to the image frame to be encoded is determined to be the first type of scene.

[0032] The offset change information acquisition unit acquires the quantization parameter offset value corresponding to the quantization block in the image frame to be encoded, and obtains the quantization parameter offset change information corresponding to the image frame to be encoded based on the quantization parameter offset value, including:

[0033] If the quantization block in the image frame to be encoded is of the first size, then obtain the quantization parameter offset value corresponding to one or more coding units contained in the quantization block of the first size in the image frame to be encoded, and determine the first offset variance corresponding to the quantization block of the first size based on the quantization parameter offset value corresponding to one or more coding units contained in the quantization block of the first size.

[0034] If the quantization block in the image frame to be encoded is of the second size, then obtain the quantization parameter offset value corresponding to one or more coding units contained in the quantization block of the second size in the image frame to be encoded, and determine the second offset variance corresponding to the quantization block of the second size based on the quantization parameter offset value corresponding to one or more coding units contained in the quantization block of the second size.

[0035] The variance of the first offset variance is determined as the first offset variance change information, the variance of the second offset variance is determined as the second offset variance change information, and the first offset variance change information and the second offset variance change information are determined as the quantization parameter offset change information corresponding to the image frame to be encoded.

[0036] The offset change information acquisition unit determines the first offset variance corresponding to the quantization block of the first size based on the quantization parameter offset values ​​corresponding to one or more encoding units contained in the quantization block of the first size, including:

[0037] The average quantization parameter offset value corresponding to the quantization block of the first size in the image frame to be encoded is determined based on the quantization parameter offset value corresponding to one or more coding units contained in the quantization block of the first size.

[0038] The first offset variance corresponding to the first-size quantization block is determined based on the mean quantization parameter offset, the number of coding units contained in the first-size quantization block, and the quantization parameter offset values ​​corresponding to one or more coding units contained in the first-size quantization block.

[0039] The device also includes:

[0040] The third setting module is used to set the quantization parameter depth corresponding to the image frame to be encoded to the first identification information if the image frame to be encoded is a key frame in the video data, or if the scene complexity information in the image information features indicates that the image frame to be encoded belongs to the third type of scene, and then encode the image frame to be encoded according to the first identification information.

[0041] The fourth setting module is used to set the quantization parameter depth corresponding to the image frame to be encoded to the second identifier information if the scene complexity information in the image information features indicates that the image frame to be encoded belongs to the second type of scene, or the image level information in the image information features is the top level, and then encode the image frame to be encoded according to the second identifier information.

[0042] The first setting module encodes the image frame to be encoded based on the first identification information, including:

[0043] Based on the first identification information, a quarter region of the coding tree unit in the image frame to be encoded is determined as the target quantization block; the target quantization block includes one or more coding units in the coding tree unit;

[0044] Obtain the quantization parameter offset values ​​corresponding to one or more coding units contained in the target quantization block, encode the quantization parameter offset values ​​corresponding to one or more coding units contained in the target quantization block in the image frame to be encoded, and obtain the encoded image frame.

[0045] This application provides a computer device, including: a processor and a memory;

[0046] The aforementioned memory is used to store computer programs, and the aforementioned processor is used to invoke the aforementioned computer programs to execute the steps in the aforementioned method.

[0047] One embodiment of this application provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, perform the steps in the method described above.

[0048] One embodiment of this application provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the above-described method.

[0049] In this embodiment, video data is acquired. If the video data meets the adaptive configuration conditions for quantization parameter depth, an adaptive configuration algorithm associated with quantization parameter depth can be enabled for the video data. This allows the acquisition of image information features corresponding to the image frames to be encoded in the video data. These image information features may include scene complexity information, first offset variance change information, and second offset variance change information of the image frames to be encoded. By using these image information features, the quantization parameter depth corresponding to the image frames to be encoded can be adaptively set, meaning the size of the quantization blocks in the image frames to be encoded can be adaptively selected. This enhances the flexibility of quantization block size configuration and thus improves the compression performance of the video data. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 This is a schematic diagram of a network architecture provided in this application;

[0052] Figure 2 A schematic diagram illustrating the structure of a quantization group in an image frame according to an embodiment of this application;

[0053] Figure 3 This is a flowchart illustrating a video compression processing method provided in an embodiment of this application. Figure 1 ;

[0054] Figure 4 This is a flowchart illustrating a video compression processing method provided in an embodiment of this application. Figure 2 ;

[0055] Figure 5 This is a schematic diagram of the hierarchical structure of an image group in video data provided in an embodiment of this application;

[0056] Figure 6This is a schematic diagram of interpolation processing for a target basic block in a target image, provided in another embodiment of this application.

[0057] Figure 7 This is a schematic diagram of the structure of a video compression processing device provided in an embodiment of this application;

[0058] Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0059] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0060] This application relates to cloud technology. Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Cloud technology is a general term encompassing network technology, information technology, integration technology, management platform technology, and application technology based on cloud computing business models. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can only be achieved through cloud computing.

[0061] Understandably, cloud technology is widely used in scenarios such as healthcare, security, and cloud gaming. Cloud gaming, also known as gaming on demand, is an online gaming technology based on cloud computing. Cloud gaming technology enables thin client devices with relatively limited graphics processing and data processing capabilities to run high-quality games. In cloud gaming, the game does not run on the player's gaming terminal but on a cloud server. The cloud server renders the game scene as a video and audio stream, which is then transmitted to the player's gaming terminal via the network. The player's gaming terminal does not need powerful graphics processing and data processing capabilities; it only needs basic streaming media playback capabilities and the ability to receive player input commands and send them to the cloud server. Before transmitting the cloud game's video and audio streams to the player's gaming terminal, the cloud server can use the video compression processing scheme provided in this application to compress the cloud game's video and audio streams, obtaining compressed video and audio streams, which can then be transmitted to the player's gaming terminal.

[0062] Please see Figure 1 , Figure 1 This is a schematic diagram of a network architecture provided in an embodiment of this application, such as... Figure 1 As shown, the network architecture may include server 10a and a terminal cluster, which may include one or more terminal devices; the number of terminal devices included in the terminal cluster is not limited here. Figure 1 As shown, the terminal cluster may specifically include terminal device 10b, terminal device 10c, terminal device 10d, and terminal device 10e, etc.; wherein, terminal device 10b, terminal device 10c, terminal device 10d, and terminal device 10e can all be connected to server 10a via network, so that each terminal device can interact with the server via network connection.

[0063] It is understandable that server 10a can refer to a device used to provide backend services for video / image data. For example, server 10a can refer to a backend device that performs encoding and decoding processing on video / image data. Each terminal device can refer to a user-facing electronic device, or a device used to provide frontend services for video / image data. For example, a terminal device can refer to an electronic device used to render and play video / image data. Application clients, such as audio / video playback clients, short video clients, live streaming clients, and game clients, can be installed on terminal devices to play image data.

[0064] The terminal devices in the terminal cluster can include, but are not limited to: smartphones, tablets, laptops, PDAs, mobile internet devices (MIDs), wearable devices (such as smartwatches and smart bracelets), smart voice interaction devices, smart home appliances (such as smart TVs), in-vehicle devices, virtual reality (VR) devices (such as VR headsets and VR glasses), aircraft, and other electronic devices that support image data playback. Server 10a can be a single physical server, a server cluster or distributed system consisting of at least two physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. This application does not limit this. The terminal devices and server 10a can be directly or indirectly connected via wired or wireless communication. The number of terminal devices and servers can be one or at least two; this application does not limit this.

[0065] In the embodiments of this application, Figure 1 The terminal device 10b shown is used as an example for description. For an encoding standard that encodes video / image data in units of macroblocks (MB), the terminal device 10b can receive the encoded bitstream generated by the encoder of the encoding standard sent by the server 10a, and use the decoder of the encoding standard to decode the encoded bitstream to obtain the decoded video / image data. The encoding standard may include, but is not limited to, Advanced Video Coding (H.264 / AVC), High Efficiency Video Coding (H.265 / HEVC), Versatile Video Coding (H.266 / VVC), or other compression protocols. For ease of understanding, this embodiment uses the H.265 encoding standard as an example to describe the video data compression process.

[0066] The H.265 coding standard employs a block-level quantization parameter (QP) adjustment technique in its quantization section. This block-level QP adjustment technique can adjust the QP using pre-analysis information, i.e., by calculating the quantization parameter offset (QPoffset). This block-level QP adjustment technique can include, but is not limited to, adaptive quantization (AQ) algorithms and Cutree algorithms.

[0067] The main function of the AQ algorithm is to balance the bit allocation process between simple and complex regions within an image frame. Depending on the calculation method, it can be divided into three modes in the H.265 coding standard: variance mode, variance adaptive mode, and offset variance adaptive mode. It should be noted that the image frame involved in the embodiments of this application can be any image to be encoded, or any image frame from the video data to be encoded; this application does not limit this.

[0068] (1) Variance mode: The quantization parameter QP of each macroblock (which can be 16*16) within an image frame can be dynamically calculated using variance. The calculation process is as follows:

[0069] ① Calculate the AQ strength (which can be denoted as strength), which is strength = aq_strength * 1.0397. Here, aq_strength refers to a parameter used to balance compression ratio and quality; the lower the value of aq_strength, the more the balance between compression ratio and quality will lean towards quality, resulting in a larger compressed image file size but improved image quality; conversely, the higher the value of aq_strength, the more the balance between compression ratio and quality will lean towards compression ratio, resulting in a smaller compressed image file size but reduced image quality.

[0070] ② Calculate the variance of each macroblock within the image frame in units of 16*16 (for example, the variance of the current macroblock within the image frame can be denoted as energy). i The variance energy i It can be shown in the following formula (1):

[0071]

[0072]

[0073] energy i =ssd i -sum i / 256 (1)

[0074] Among them, energy i a represents the variance of the current macroblock (e.g., the i-th macroblock) in an image frame. jl This represents the element in the j-th row and l-th column of the i-th macroblock, sum. i SSD represents the sum of all elements in the i-th macroblock. i This represents the sum of squares of all elements in the i-th macroblock.

[0075] ③ It can be based on variance energy i Calculate the quantization parameter offset for each macroblock within an image frame, such as the quantization parameter offset QP for the i-th macroblock. δi It can be shown in the following formula (2):

[0076] QP δi =strength*(log2energy) i -14.427) (2)

[0077] (2) Variance Adaptive Mode: It can traverse all macroblocks in an image frame once and collect some intermediate parameters. These intermediate parameters may include, but are not limited to: the variance of each macroblock in the image frame, the intensity of each macroblock in the image frame, and the average quantization parameter shift corresponding to the entire image frame. Using these intermediate parameters, the quantization parameter offset corresponding to each macroblock in the image frame can be calculated, and the average offset corresponding to the image frame can be calculated. Then, the quantization parameter offset of the current macroblock can be calculated by the deviation between each macroblock in the image frame and the average offset of the entire image frame.

[0078] (3) Offset Variance Adaptive Mode: On the basis of the variance adaptive mode, offset intensity can be added to adjust the offset of the quantization parameter obtained above.

[0079] As can be seen from the calculation process of the above variance mode, variance adaptive mode and offset variance adaptive mode, the larger the variance of the current macroblock in the image frame, the more complex the content of the current macroblock is. The quantization parameter offset (which can be denoted as QP offset) calculated from this is also larger. In the process of encoding the image frame, the number of bits allocated to the current macroblock will also be reduced. This can achieve the shift of bits from complex regions to simple regions, which can improve the encoding performance.

[0080] The Cutree algorithm adjusts the quantization parameters of the current macroblock based on the information it contributes to future image frames (frames following the current one in the encoding order) during inter-frame prediction. In other words, the more information the current macroblock contributes to subsequent image frames, the higher its importance, and the higher its encoding quality should be, thus reducing its quantization parameters. Conversely, the less information the current macroblock contributes, the lower its importance, and the lower its encoding quality should be, thus increasing its quantization parameters.

[0081] It's important to note that the contribution of the current macroblock to future image frames needs to be inferred from the future image frames to determine how much information originates from the current macroblock. Since the future image frames haven't been encoded yet, this needs to be predicted using lookahead. Lookahead can estimate the encoding cost of a certain number of uncoded image frames by performing fast motion estimation. The lookahead process yields estimated values ​​for relevant parameters of the uncoded image frames. These parameters may include, but are not limited to: the frame type of the uncoded image frames, the type and motion vector of each macroblock, and the costs of intra-frame and inter-frame coding. These estimated values ​​can be used to calculate the quantization parameter offset (QP offset) of the Cutree algorithm.

[0082] It is understood that, in the embodiments of this application, the aforementioned AQ algorithm and Cutree algorithm are only two examples of calculating the quantization parameter offset (QP offset) during the encoding process of video data. Other algorithms (e.g., the mbtree algorithm) can also be used to calculate the quantization parameter offset during the encoding process of video data, and this application does not limit this.

[0083] The H.265 coding standard defines a highly flexible quantization parameter control mechanism. This mechanism introduces the concept of a quantization group (QG, also known as a quantization block). It stipulates that a coding tree unit (CTU) can contain one or more fixed-size QGs. All coding units (CUs) with non-zero coefficients within the same QG share a single quantization parameter. Different QGs can use different quantization parameters. The quantization parameters of different QGs are obtained by superimposing the quantization parameter offsets (QP offsets) obtained from the AQ algorithm and the ctree algorithm onto the frame-level QP. Through this quantization parameter control mechanism, the encoder can perform rate control more flexibly.

[0084] In this context, a Coding Tree Unit (CTU) can be considered a macroblock in the coding standard. The size of a CTU can include, but is not limited to, 16*16, 32*32, and 64*64. For ease of understanding, this embodiment uses a CTU of 64*64 as an example. A CTU can contain one luma coding tree block and two chroma coding tree blocks at the same location, along with some corresponding syntax elements. A Coding Unit (CU) is a leaf node in a quadtree partitioned with a CTU as the root node. The CU is the basic unit of predictive coding, and its size can include, but is not limited to, 8*8, 16*16, 32*32, and 64*64.

[0085] A quantization group (QG) refers to dividing an image frame into square pixel blocks of a fixed size (e.g., N*N). The size N can be specified by the Picture Parameter Set (PPS). The size of the QG can be between the size of the largest CU and the smallest CU (inclusive). The size of the largest CU can be considered the size of the Coding Tree Unit (CTU). The size of the QG can be represented by the Delta Quantization Parameter depth (Dqp depth). When Dqp depth is set to 0, the size of the QG is the same as the size of the CTU. When Dqp depth is set to 1, the size of the QG is the leaf node of the CTU after quadtree partitioning, such as a quarter of the CTU's area.

[0086] Please see Figure 2 , Figure 2 A schematic diagram illustrating the structure of a quantization group in an image frame according to an embodiment of this application. For example... Figure 2 Image frame 20a shown is the current image frame to be encoded in the video data (i.e., the image frame to be encoded). When the quantization parameter depth (Dqp depth) corresponding to image frame 20a is set to 1, the quantization group QG is one-quarter of the coding tree unit (CTU). For example... Figure 2 As shown, assuming image frame 20a includes 6 coding tree units (CTUs), the boundaries of these CTUs are as follows: Figure 2 As shown by the thick solid line, if the size of a coding tree unit (CTU) is 64*64, then the size of a quantization group (QG) can be 32*32. The boundary of the quantization group (QG) is as follows: Figure 2 As shown by the thin solid lines, the division method of the coding unit (CU) in the coding tree unit (CTU) can be as follows: Figure 2 As shown by the dashed lines in the image. It is understandable that... Figure 2 The thick solid lines, thin solid lines, and dashed lines shown are merely examples of one style combination for distinguishing the coding tree unit (CTU), quantization group (QG), and coding unit (CU).

[0087] like Figure 2 As shown, the coding tree unit 20b in image frame 20a may include four quantization groups QG (including quantization group 20c). Multiple coding units (including coding unit 20d) can be obtained by quadtree partitioning the coding tree unit 20b. It is understood that within an image frame, the quantization group QG has a fixed size, such as... Figure 2The size of the quantization group QG shown is one-quarter of the coding tree unit (CTU). The coding units (CUs) contained in each coding tree unit (CTU) in image frame 20a are adaptively divided according to the video content in the video data. A coding tree unit (CTU) can be divided into multiple coding units (CUs), so a quantization group QG can contain one or more coding units (CUs).

[0088] The syntax elements related to quantization parameters in the coding standard technical document may include: using the syntax element cu_qp_delta_enabled_flag to specify whether quantization parameters are allowed to be adjusted at the coding unit level. If the syntax element cu_qp_delta_enabled_flag specifies that quantization parameters are allowed to be adjusted at the coding unit, then the syntax element diff_cu_qp_delta_depth can be used to specify the size of the quantization group QG. In this embodiment, Dqp depth (quantization parameter depth) can be used to specify the size of the quantization group QG.

[0089] Optionally, when the Dqp depth in the Image Parameter Set (PPS) is configured to 0, it means that the size of the quantization group QG in the image frame is the same as the size of the coding tree unit (CTU) in the image frame. That is, the quantization parameter offset (QP offset) of the quantization group QG can be applied to all coding units (CUs) within the coding tree unit (CTU) and encoded into the bitstream for transmission. For example, if the lookahead uses a 16*16 macroblock size to calculate the QP offset, then during the actual encoding process of the image frame, the average value of the 16 16*16 macroblock QP offsets can be calculated in a 64*64-size coding tree unit (CTU) layer as the actual encoded QP offset of the current quantization group QG, and the QP offset used in all coding units (CUs) within the quantization group QG is consistent with the actual encoded QP offset of that quantization group QG. Similarly, when Dqpdepth in PPS is configured to 1, it means that the size of the quantization group QG in the image frame is one-quarter of the size of the coding tree unit CTU in the image frame. For example, if the size of the quantization group QG is 32*32, then the QP offset can be applied to all coding units CU within the 32*32 quantization group QG, and the average of the four 16*16 macroblock QP offsets is calculated as the actual coding QP offset of the current quantization group QG.

[0090] In current coding standards, existing Dqp schemes can improve the coding performance of video data. However, a fixed Dqp depth configuration limits the performance of QP adjustment techniques such as AQ and Cutree algorithms, and may even lead to performance loss in some simple sequences. This fixed Dqp depth configuration applies to all image frames in the entire video data. For example, for simple scene image frames in video data, their quantization parameters (QP) vary relatively uniformly. If the size of the quantization group QG set by the Dqp depth is too small, it will consume too much bitrate and fail to achieve better performance. Similarly, for complex scene image frames in video data, their QP varies significantly. If the size of the quantization group QG set by the Dqp depth is too large, it will be impossible to achieve better performance based on the actual QP offset changes. The video compression processing scheme proposed in this application mainly focuses on the quantization part of video data during the encoding process. Specifically, it can adaptively configure the Dqp depth according to the scene complexity of each image frame in the video data, or it can adaptively configure the Dqp depth according to the temporal hierarchy importance of the image frames in the video data. For high-resolution video data, where block-level pixel changes are less, the adaptive mode of quantization parameters can be turned off. In other words, for video data with different image information, the Dqp depth can be adaptively configured for each image frame in the video data, thereby adaptively selecting an appropriate quantization block (quantization group) size. This can enhance the flexibility of quantization block size configuration and thus improve the compression performance of video data.

[0091] Furthermore, it should be noted that the network architecture described in the embodiments of this application is for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and does not constitute a limitation on the technical solutions of the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0092] Please see Figure 3 , Figure 3 This is a flowchart illustrating a video compression processing method provided in an embodiment of this application. Figure 1 Understandably, this video compression method can be performed by a computer device, which can provide... Figure 1 The terminal cluster shown can be executed by any terminal device, or it can be... Figure 1 The server 10a shown; wherein, the video compression processing method may include the following steps:

[0093] Step S101: Obtain video data. If the video data meets the adaptive configuration conditions of the quantization parameter depth, then obtain the image information features corresponding to the image frame to be encoded in the video data. The quantization parameter depth is used to characterize the quantization block size in the image frame to be encoded.

[0094] Specifically, the process involves acquiring the video data to be encoded. This video data can include, but is not limited to, live video data from scenarios such as live sports events, live games, and live conferences; short videos of daily life, food, and film clips; and film and television video data. During the encoding process, pre-analysis can be used to obtain the quantization parameter offsets of the coding units (CUs) contained within the quantization blocks (also known as quantization groups, QGs) of each image frame in the video data.

[0095] The resolution information of the video data to be encoded is obtained. If the resolution information of the video data is less than or equal to the resolution threshold, it can be determined that the video data meets the adaptive configuration conditions of the quantization parameter depth (Dqp depth), that is, the Dqp depth adaptive mode is enabled (or it can be considered as an adaptive Dqp depth selection algorithm). If the resolution information of the video data is greater than the resolution threshold, it can be determined that the video data does not meet the adaptive configuration conditions of the Dqp depth, that is, the Dqp depth adaptive mode can be disabled, and a fixed Dqp depth is set for all image frames contained in the video data. That is, this fixed Dqp depth can be applied to all image frames in the video data. Here, the quantization parameter depth can be used to characterize the size of the quantization block in the current image frame in the video data. The quantization block here can be the aforementioned quantization group QG. The resolution threshold can be set according to actual needs. For example, the resolution threshold can be set to 1920*1080. Here, the value 1920 represents the width in the resolution threshold, and the value 1080 represents the height in the resolution threshold. For example, if the resolution information (Width+Height) of the video data is greater than (1920+1080), then the Dqp depth adaptive mode can be turned off; if the resolution information (Width+Height) of the video data is less than or equal to (1920+1080), then the Dqp depth adaptive mode can be turned on.

[0096] In one or more embodiments, if the Dqp depth adaptive mode is determined to be enabled during the encoding process of video data, the current image frame to be encoded can be determined according to the encoding order of image frames in the video data, and the image information features corresponding to the image frame to be encoded can be obtained. The image information features may include the frame type, image layer information, scene complexity information, quantization parameter offset change information, or other image information corresponding to the image frame to be encoded. This application does not limit the type of information included in the image information features. The frame type can be an I-frame (Intra-coded frames, or keyframes), a B-frame (Bi-directional predicted frames), or a P-frame (Predictive-coded frames). Image layer information can be used to characterize the importance of the image frame to be encoded. This importance is determined by the number of times the image frame to be encoded is referenced. The smaller the image layer corresponding to the image frame to be encoded, the stronger its importance and the more times it is referenced; conversely, the larger the image layer corresponding to the image frame to be encoded, the weaker its importance and the fewer times it is referenced. Scene complexity information can be used to characterize the texture features of the image frame to be encoded. This scene complexity information can include a first type of scene (also known as a normal scene), a second type of scene (also known as a simple scene), and a third type of scene (also known as a complex scene). Quantization parameter offset change information (also known as QP offset change information) can be used to characterize the changes in the quantization parameter offset (QP offset) calculated during the pre-analysis process of the image frame to be encoded. This quantization parameter offset change information can be the QP offset variance, or the variance of the QP offset variance, etc.

[0097] Step S102: If the scene complexity information contained in the image information features indicates that the image frame to be encoded belongs to the first type of scene, then based on the first offset variance change information and the second offset variance change information contained in the image information features, and the image frame to be encoded does not belong to the key frame and unreferenced frame in the video data, the offset variance comparison result corresponding to the image frame to be encoded is determined; the first offset variance change information and the second offset variance change information are used to characterize the variance change information of the quantization parameter offset values ​​in the quantization blocks of different sizes contained in the image frame to be encoded.

[0098] Specifically, if the image frame to be encoded is neither a keyframe nor an unreferenced frame in the video data, and the scene complexity information in the image information features indicates that the image frame to be encoded belongs to the first type of scene, then the intra-frame prediction cost (which can be denoted as intra) of the image frame in the pre-analysis can be used as a basis for encoding. costThe quantization parameter depth (Dqp depth) is determined by the QP offset change information in the image information features. The intra-frame prediction cost is... cost This can refer to the cost of intra-frame prediction calculated during pre-analysis of the image frame to be encoded. cost It can also be used as a factor to determine the scene complexity information corresponding to the image frame to be encoded; a key frame can refer to an I-frame in the image frame sequence corresponding to the video data; an unreferenced frame can refer to a B-frame that is not referenced during the encoding process of the video data.

[0099] QP offset change information may include first offset variance change information and second offset variance change information. These two information are used to characterize the variance change information of quantization parameter offset values ​​in quantization blocks of different sizes contained in the image frame to be encoded. For example, the first offset variance change information may be the variance of the quantization parameter offset values ​​in a quantization block of a first size in the pre-analysis of the image frame to be encoded, and the second offset variance change information may be the variance of the quantization parameter offset values ​​in a quantization block of a second size in the pre-analysis of the image frame to be encoded. The first size may refer to the size of the quantization block when the Dqp depth of the image frame to be encoded is set to 0 in the pre-analysis; in this case, the first size may be the size of the coding tree unit (CTU) within the image frame to be encoded. The second size may refer to the size of the quantization block when the Dqp depth of the image frame to be encoded is set to 1 in the pre-analysis; in this case, the second size may be one-quarter of the size of the coding tree unit (CTU) within the image frame to be encoded.

[0100] Furthermore, the ratio between the first offset variance change information and the second offset variance change information contained in the image information features can be determined as the offset variance comparison result corresponding to the image frame to be encoded.

[0101] Step S103: If the offset variance comparison result is less than the offset variance comparison threshold, and the image information features indicate that the intra-prediction cost corresponding to the image frame to be encoded is within the target cost range, then the quantization parameter depth corresponding to the image frame to be encoded is set to the first identification information, and the image frame to be encoded is encoded according to the first identification information; the target cost range includes the range between the intra-cost threshold of the second type of scene and the intra-cost threshold of the first type of scene.

[0102] Specifically, the intra-frame cost threshold for the first type of scene (normal scene) and the intra-frame cost threshold for the second type of scene (simple scene) can be obtained, and the intra-frame cost threshold for the first type of scene is denoted as intra. th1 The intra-frame cost threshold for the second type of scene is denoted as intra.th0 Furthermore, the target cost range can be determined based on the intra-frame cost threshold of the first type of scenario and the intra-frame cost threshold of the second type of scenario. This target cost range can be denoted as [intra...]. th0 ,intra th1 In other words, the target cost range refers to the range between the intra-frame cost threshold for the second type of scenario and the intra-frame cost threshold for the first type of scenario. Wherein, intra... th0 and intra th1 The settings can be based on the video content in the video data, or they can be based on experience; this application does not limit the settings in this regard.

[0103] If the offset variance comparison result is less than the offset variance comparison threshold, and the intra-prediction cost corresponding to the frame to be encoded is within the target cost range (i.e., intra...), then... th0 ≤intra cost <intra th1 If so, the Dqp depth corresponding to the image frame to be encoded can be set as the first identifier information; then, based on the first identifier information, a quarter region of the coding tree unit in the image frame to be encoded can be determined as the target quantization block (which can be understood as the quantization block of the image frame to be encoded in the actual encoding). The target quantization block may include one or more coding units divided from the coding tree unit in the image frame to be encoded; obtain the quantization parameter offset value corresponding to one or more coding units contained in the target quantization block, and encode the quantization parameter offset value corresponding to one or more coding units contained in the target quantization block in the image frame to be encoded to obtain the encoded image frame.

[0104] The offset variance contrast threshold can be a resolution-related threshold, which can be set according to actual needs. The first identifier information can be the character "1", thus determining that the size of the target quantization block in the actual encoding of the image frame to be encoded is one-quarter of the size of the coding tree unit (CTU). The QP offset of the target quantization block within the image frame to be encoded is obtained through the aforementioned AQ algorithm and QP adjustment techniques such as Cutree. This QP offset is applicable to all coding units (CUs) contained in the current target quantization block. The QP offset of the target quantization block can be encoded into the bitstream and transmitted to the decoding device. In other words, the encoded image frame can include the encoded QP offset.

[0105] Step S104: If the offset variance comparison result is greater than or equal to the offset variance comparison threshold, or if the image information features indicate that the intra-frame prediction cost corresponding to the image frame to be encoded is not within the target cost range, then the quantization parameter depth corresponding to the image frame to be encoded is set to the second identifier information, and the image frame to be encoded is encoded according to the second identifier information.

[0106] Specifically, if the offset variance comparison result is greater than or equal to the offset variance comparison threshold, or if the intra-prediction cost corresponding to the image frame to be encoded is not within the target cost range (i.e., intra...), then... cost <intra th0 Or intra cost >intra th1 If so, the Dqp depth corresponding to the image frame to be encoded can be set as the second identifier information; then, based on the second identifier information, the coding tree unit in the image frame to be encoded can be used as the target quantization block in the actual encoding of the image frame to be encoded. The target quantization block may include one or more coding units divided from the coding tree unit in the image frame to be encoded; obtain the quantization parameter offset value corresponding to one or more coding units contained in the target quantization block, and encode the quantization parameter offset value corresponding to one or more coding units contained in the target quantization block in the image frame to be encoded to obtain the encoded image frame.

[0107] The second identification information can be the character "0"; the QP offset of the target quantization block in the image frame to be encoded is obtained through the aforementioned AQ algorithm and QP adjustment techniques such as cutree. At this time, the QP offset is applicable to all coding units (CUs) contained in the current target quantization block, that is, all coding units (CUs) contained in a coding tree unit (CTU); the QP offset of the target quantization block can be encoded into the bitstream and transmitted to the decoding device. In other words, the encoded image frame can include the encoded QP offset.

[0108] It should be noted that this application uses Dqp depth as the first identifier (e.g., the character "1") and Dqp depth as the second identifier (e.g., the character "0") as examples to describe adaptive decision-making for Dqp depth. It should be understood that other configurations can be added to the adaptive Dqp depth mode, such as adding a third identifier (e.g., the character "2") to the aforementioned configuration. This allows for adaptive decision-making between Dqp depth = 1, Dqp depth = 0, and Dqp depth = 2. For example, when Dqp depth = 2, it can be represented as the size of the quantization block in the image frame to be encoded being one-sixteenth of the size of the coding tree unit (CTU). That is, a coding tree unit (CTU) can include 16 quantization blocks. This application does not limit the configuration of Dqp depth.

[0109] In this embodiment, video data is acquired. If the video data meets the adaptive configuration conditions for quantization parameter depth, an adaptive configuration algorithm associated with quantization parameter depth can be enabled for the video data. This allows the acquisition of image information features corresponding to the image frames to be encoded in the video data. These image information features may include scene complexity information, first offset variance change information, and second offset variance change information of the image frames to be encoded. By using these image information features, the quantization parameter depth corresponding to the image frames to be encoded can be adaptively set, meaning the size of the quantization blocks in the image frames to be encoded can be adaptively selected. This enhances the flexibility of quantization block size configuration and thus improves the compression performance of the video data.

[0110] Please see Figure 4 , Figure 4 This is a flowchart illustrating a video compression processing method provided in an embodiment of this application. Figure 2 Understandably, this video compression method can be performed by a computer device, which can provide... Figure 1 The terminal cluster shown can be executed by any terminal device, or it can be... Figure 1 The server 10a shown; wherein, the video compression processing method may include the following steps:

[0111] Step S201: Obtain video data and the resolution information of the video data.

[0112] Specifically, the resolution of the video data determines whether DQP depth adaptive mode (also known as adaptive DQP depth selection algorithm) needs to be enabled for that video data. Therefore, after obtaining the video data to be encoded, the resolution information of the video data can be obtained. This resolution information can include width and height.

[0113] Step S202: Determine if the resolution information is greater than the resolution threshold.

[0114] Specifically, the algorithm can determine the relationship between the resolution information corresponding to the video data and the resolution threshold. If the resolution information of the video data is greater than the resolution threshold, then proceed to step S203; if the resolution information of the video data is less than or equal to the resolution threshold, then proceed to steps S204 to S209. The resolution threshold can be a high resolution, such as 1920*1080.

[0115] Step S203: Set a fixed quantization parameter depth for all image frames contained in the video data.

[0116] Specifically, if the resolution of the video data is greater than a pre-set resolution threshold, it can be determined that the video data does not meet the adaptive configuration conditions for Dqp depth. Therefore, the adaptive Dqp depth mode can be disabled for this video data, and a fixed Dqp depth can be set for all image frames contained in the video data. In other words, the fixed Dqp depth set here applies to all image frames in the video data. For example, assuming the video data to be encoded includes 10 image frames, and a fixed Dqp depth is set for this video data (such as setting Dqp depth to 1, where the character "1" can serve as the first identifier), then all 10 image frames contained in the video data can be encoded using Dqp depth = 1.

[0117] Step S204: Determine the image group to which the image frame to be encoded belongs as the target image group, and obtain the image layer information corresponding to the image frame to be encoded based on the reference relationship between the image frames in the target image group.

[0118] Specifically, if the resolution of the video data is less than or equal to a pre-set resolution threshold, it can be determined that the video data meets the adaptive configuration conditions for Dqp depth. The adaptive Dqp depth mode can then be enabled for this video data, meaning the Dqp depth of each image frame in the video data can be adaptively set. After enabling the adaptive Dqp depth mode, image information features corresponding to the video data can be obtained. These image information features may include, but are not limited to: the frame type corresponding to each video frame in the video data, image layer information, scene complexity information, quantization parameter offset change information, or other image information.

[0119] For ease of understanding, the following description uses any image frame to be encoded (hereinafter referred to as the image frame to be encoded) in video data as an example. The process of obtaining the image layer information corresponding to the image frame to be encoded may include, but is not limited to: obtaining the image frame sequence corresponding to the video data; dividing the image frame sequence into one or more Group of Pictures (GOPs) according to the temporal order of the image frames contained in the video data; then determining the image frame to be encoded from the image frame sequence; determining the image group to which the image frame to be encoded belongs as the target image group; and obtaining the image layer information corresponding to the image frame to be encoded based on the reference relationship between the image frames in the target image group. The structure of the image group reflects the dependencies referenced by the current image frame (the image frame to be encoded) during encoding. Once the size (or length) of the image group in the video data is determined, the hierarchical structure of each image group is also determined. Each image group can be viewed as a set of consecutive frames in the video data, i.e., a set of pictures in the image frame sequence corresponding to the video data. The first image frame of each image group can be an I-frame, which ensures that each image group can be decoded independently without referencing other image frames. The image hierarchy information corresponding to the image frame to be encoded can be represented as the temporal hierarchy of the image frame to be encoded in its target image group. Optionally, the process of determining the image hierarchy information corresponding to the image frame to be encoded based on the reference relationship can include: obtaining the reference relationship between image frames in the target image group, determining the number of times the image frame to be encoded is referenced in the target image group based on the reference relationship, and determining the image hierarchy information corresponding to the image frame to be encoded based on the number of times the image frame to be encoded is referenced.

[0120] Please see Figure 5 , Figure 5 This is a schematic diagram of the hierarchical structure of an image group in video data provided in an embodiment of this application; this embodiment of the application describes the hierarchical structure of the image group using an image group size of 8 as an example. Figure 5 The target image group 30a shown may include eight consecutive image frames, such as frame B1, frame B2, ..., frame B7, and GPB (Generalized P and B picture, generalized B frame); the display order of the image frames included in the target image group 30a can be as follows: Figure 5 The image sequence number (pic_order_cnt, POC) in area 30b is shown. The smaller the image sequence number corresponding to an image frame, the earlier the image frame is displayed. The encoding order (CodedOrder) of each image frame contained in the target image group 30a during the encoding process can be as follows: Figure 5The encoding sequence number in region 30c shown indicates that the smaller the encoding sequence number of the image frame, the earlier the encoding order of that image frame. For example... Figure 5 The arrows shown can be used to represent the reference relationship (also known as the dependency relationship) between various image frames. The current image frame depends on the image frame pointed to by the arrow. Image frames located at the same horizontal position are at the same temporal level (for example, frames B2 and B6 in target image group 30a are at the same temporal level). The lower the temporal level of an image frame, the stronger its reference value, indicating that the image frame is more important. For example, the reference value of an image frame at temporal level 0 is stronger than that of an image frame at temporal level 1, and the reference value of an image frame at temporal level 1 is stronger than that of an image frame at temporal level 2, and so on.

[0121] For example, the GPB frame with a display order of 8 has an encoding order of 1 in target picture group 30a. The GPB frame can be considered the most important picture frame in target picture group 30a, and its temporal level is temporal level 0 (which can be denoted as level=0). See also... Figure 5 The I-frame or GPB frames of another image group shown are encoded; the B4 frame, which is displayed in sequence 4, is encoded in sequence 2 in target image group 30a. The temporal level of the B4 frame is temporal level 1 (which can be denoted as level=1). Encoding is performed after the GPB frames in target image group 30a are encoded. Refer to [reference needed]. Figure 5 The I-frame, the GPB frame of another image group, and the GPB frame of the target image group 30a are encoded. The importance of frame B4 is second only to the GPB frame. Similarly, frame B2 (display order 2) and frame B6 (display order 6) can be encoded with reference to frame B4 and the GPB frame. The temporal level of frames B2 and B6 is temporal level 2 (can be denoted as level=2), and its importance is second only to frame B4. The remaining image frames in the target image group 30a (frames B1, B3, B5, and B7) are located at temporal level 3 (can be denoted as level=3). Temporal level level=3 is the highest temporal level in the target image group 30a. At this time, temporal level level=3 can also be called the top level. Image frames in the target image group 30a that are at the top level can be called unreferenced frames. When the image frame to be encoded is any image frame in the target image group 30a, the image layer information corresponding to the image frame to be encoded can be obtained according to the temporal layer of the image frame to be encoded in the target image group 30a.

[0122] Understandably, the smaller the temporal level of an image frame, the more important it is, the more times it is referenced, and the better the coding performance can provide better reference for image frames at other temporal levels; conversely, the larger the temporal level of an image frame, the weaker its importance, such as... Figure 5 As shown, in the target image group 30a with a size of 8, the image frames with a temporal level of level=3 have the weakest importance. It should be noted that... Figure 5 The target image group 30a shown is only an example in the embodiments of this application (except for the first image frame which is an I-frame, all other image frames can be B-frames, and these B-frames can be encoded with reference to the encoded image frames). The embodiments of this application do not limit the size and structure of the image group.

[0123] Step S205: Obtain scene complexity information corresponding to the image frame to be encoded based on the intra-frame prediction cost and the proportion of intra-frame prediction modes.

[0124] Specifically, computer equipment can obtain the intra-prediction cost (which can be denoted as intra) corresponding to the image frame to be encoded. cost ) and the proportion of intra-prediction modes (which can be denoted as DC) ratio The scene complexity information corresponding to the image frame to be encoded is obtained based on the intra-frame prediction cost and the intra-frame prediction mode ratio. The scene complexity information can be determined based on the intra-frame prediction method, inter-frame prediction method, and cost calculated during pre-analysis. The prediction mode ratio characterizes the proportion of the target mode used in the inter-frame prediction of the image frame to be encoded. The target mode can be the DC mode, which calculates the average value of the reference pixels to the left and above the current Transform Unit (TU). The DC mode is typically applicable to large flat areas. Optionally, the intra-frame prediction mode ratio involved in this embodiment can also be other modes (e.g., planner mode), which will not be elaborated here.

[0125] Among them, if the intra-frame prediction cost is intra cost Less than the intra-cost threshold for the first type of scene (which can be denoted as intra) th1 ), and the intra-frame prediction mode ratio DC ratio If the value is greater than the target parameter value (which can be set according to actual needs, such as 0.8; this application does not limit the value of the target parameter), then the scene complexity information corresponding to the image frame to be encoded is determined to be a second type of scene; if the intra-frame prediction cost .... cost Less than the intra-cost threshold for the second type of scenario (which can be denoted as intra) th0If the scene complexity information corresponding to the image frame to be encoded is determined to be the second type of scene, then the intra-frame prediction cost is determined to be... cost The inter-frame cost threshold (which can be denoted as complex) is greater than that of the third type of scene. th If the scene complexity information corresponding to the image frame to be encoded is determined to be the third type of scene, then the scene complexity information corresponding to the image frame to be encoded is determined to be the first type of scene.

[0126] Understandably, based on the texture feature information of each image frame in the video data, the scene complexity information corresponding to each image frame can be divided into three types: Type I scene (also known as a normal scene), Type II scene (also known as a simple scene), and Type III scene (also known as a complex scene). Image frames belonging to Type II scenes have relatively flat content and minimal texture variation; image frames belonging to Type III scenes exhibit greater texture variation and more complex details; if an image frame belongs to neither Type II nor Type III scenes, it can be determined that it belongs to Type I scene. The intra-prediction cost (intra) corresponding to the image frame to be encoded is... cost Intra-frame cost threshold compared to the first type of scene th1 Intra-prediction mode ratio DC ratio Intra-frame cost threshold for the second type of scenario th0 Inter-frame cost threshold for the third type of scenario (complex) th The relationship between them can be shown in the following formula (3):

[0127]

[0128] Where scene represents the scene complexity information corresponding to the image frame to be encoded, with a value of 0 indicating the second type of scene (simple scene), which is typically a flat content area; intra th0 Intra represents the intra-frame cost threshold for simple scenes. th1 This represents the intra-frame cost threshold for a simple scene with minimal texture content, i.e., the intra-frame cost threshold for Type I scenes (normal scenes); dc ratio This indicates the proportion of intra-frame prediction in the image frame to be encoded using DC mode; the value 0.8 represents the above target parameter value. A value of 2 indicates the third type of scene (complex scene). th This represents the inter-frame cost threshold for complex scenes; a value of 1 represents a normal scene (Type I scene) other than simple or complex scenes.

[0129] It is understood that the values ​​0, 1, and 2 in the above formula (3) are merely examples used in this application to represent simple, complex, and ordinary scenarios in sequence. This application does not limit the specific identifiers used to represent simple, complex, and ordinary scenarios. For example, a0 can be used to represent simple scenarios, a1 can be used to represent ordinary scenarios, a2 can be used to represent complex scenarios, or other characters can be used.

[0130] Step S206: Obtain the quantization parameter offset change information corresponding to the quantization block in the image frame to be encoded.

[0131] Specifically, the quantization parameter offset value (which can be denoted as QPoffset) corresponding to the quantization block in the image frame to be encoded can be obtained. Then, based on the quantization parameter offset value, the quantization parameter offset change information corresponding to the image frame to be encoded can be obtained. This quantization parameter offset change information, along with the previously obtained image layer information and scene complexity information, can be used to determine the image information features corresponding to the image frame to be encoded. The quantization parameter offset value can be calculated using lookahead, and this value is obtained in units of lookahead macroblocks (for ease of understanding, a 16*16 macroblock is used as an example). During the actual encoding process of the image frame to be encoded, encoding can be performed using the set quantization parameter depth (which can be denoted as Dqp depth) and a fixed CU (coding unit) size QP offset. Therefore, the variance of the QPoffset in the CU size can be calculated to reflect the fluctuation of the quantization parameters of the current CU.

[0132] For example, assuming the size of a coding tree unit (CTU) is 64*64, if the quantization parameter depth (Dqp depth) is set to the second identifier information (e.g., the character "0") during the pre-analysis of the image frame to be encoded, then the size of the quantization block in the image frame to be encoded can be determined to be 64*64. Furthermore, the variance of the quantization parameter offset (QPoffset) in the 64*64 CTU can be calculated to obtain the first offset variance, which can be denoted as qpoffset. var64 If the quantization parameter depth (Dqp depth) is set to the first identifier information (e.g., the character "1") during the pre-analysis of the image frame to be encoded, then the size of the quantization block in the image frame to be encoded can be determined to be 32*32. Furthermore, the variance of the quantization parameter offset (QP offset) in the 32*32 CU can be calculated to obtain the second offset variance, which can be denoted as qpoffset. var32By comparing the first offset variance and the second offset variance, a suitable quantization parameter depth configuration for the image frame to be encoded is obtained. When the variance change is small, the current CU configuration can be used, where the quantization parameter offset change is small, which better matches its texture characteristics and has better encoding performance. Since the quantization parameter depth (Dqp depth) is configured at the frame level, the variance of the block-level offset variance is calculated based on the block-level variance to obtain the frame-level quantization parameter offset change information (which can also be considered as the change information of the first offset variance and the second offset variance).

[0133] In one or more embodiments, if the quantization block in the image frame to be encoded has a first size (e.g., 64*64), then the quantization parameter offset values ​​corresponding to one or more coding units contained in the quantization block of the first size in the image frame to be encoded are obtained, and a first offset variance corresponding to the quantization block of the first size is determined based on the quantization parameter offset values ​​corresponding to one or more coding units contained in the quantization block of the first size. More specifically, determining the first offset variance corresponding to the quantization block of the first size based on the quantization parameter offset values ​​corresponding to one or more coding units contained in the quantization block of the first size includes: based on the quantization parameter offset values ​​corresponding to one or more coding units contained in the quantization block of the first size, the mean quantization parameter offset value (which can be denoted as qpoffset) corresponding to the quantization block of the first size in the image frame to be encoded can be determined. ave64 Furthermore, based on the mean quantization parameter offset, the number of coding units contained in the first-size quantization block, and the quantization parameter offset values ​​corresponding to one or more coding units contained in the first-size quantization block, the first offset variance corresponding to the first-size quantization block can be determined. The calculation process for this first offset variance can be shown in the following formula (4):

[0134]

[0135] Among them, qpoffset var64 The first offset variance is represented by qpoffset, which is the quantization parameter offset variance of the quantization block (QG) of the first size. ij qpoffset represents the quantization parameter offset value of different coding units (the coding units located in the i-th row and j-th column of the quantization block of the first size) within the current quantization block. ave64 This represents the mean quantization parameter offset values ​​(i.e., the average quantization parameter offset) of all coding units in the first-size quantization block. It is calculated by comparing the quantization parameter offset value of each coding unit with the mean (qpoffset). ave64 This allows us to calculate the first offset variance corresponding to each quantization block of the first size.

[0136] Optionally, if the quantization block in the image frame to be encoded is of a second size (e.g., 32*32), the quantization parameter offset values ​​corresponding to one or more coding units contained in the quantization block of the second size in the image frame to be encoded can be obtained. Based on the quantization parameter offset values ​​corresponding to one or more coding units contained in the quantization block of the second size, the second offset variance corresponding to the quantization block of the second size can be determined. The calculation process of the second offset variance is similar to the calculation process of the first offset variance described above. The calculation process of the second offset variance can be shown in the following formula (5):

[0137]

[0138] Among them, qpoffset var32 The second offset variance, i.e., the quantization parameter offset variance of the second-sized quantization block (QG), is represented by qpoffset in formula (5). ij qpoffset represents the quantization parameter offset value of a different coding unit (the coding unit located in the i-th row and j-th column of the quantization block of the second size) within the current quantization block of the second size. ave32 This represents the mean of the quantization parameter offsets of all coding units in the second-sized quantization block, calculated by dividing the quantization parameter offset of each coding unit by the mean (qpoffset). ave32 This allows us to calculate the second offset variance corresponding to each second-size quantization block.

[0139] Furthermore, the variance of the first offset variance can be determined as the first offset variance change information, and the variance of the second offset variance can be determined as the second offset variance change information. The first offset variance change information and the second offset variance change information can be determined as the quantization parameter offset change information corresponding to the image frame to be encoded. That is, the quantization parameter offset change information can include the first offset variance change information and the second offset variance change information. The calculation process of the first offset variance change information can be shown in the following formula (6):

[0140]

[0141] Among them, in formula (6) This represents the first offset variance (qpoffset) in the quantization block of the first size contained in the image frame to be encoded. var64 The variance of the first offset variance, i.e., the change information of the first offset variance; This represents the first offset variance (qpoffset) in the quantization block of the first size contained in the image frame to be encoded. var64 The mean of h 64 w represents the height of the quantization block of the first size. 64 This indicates the width of the quantization block of the first size.

[0142] The calculation process for the second offset variance change information can be shown in the following formula (7):

[0143]

[0144] Among them, in formula (7) This represents the second offset variance (qpoffset) in the second-sized quantization block contained in the image frame to be encoded. var32 The variance of the second offset variance, i.e., the information on the change in the second offset variance; This represents the second offset variance (qpoffset) in the second-sized quantization block contained in the image frame to be encoded. var32 The mean of h 32 w represents the height of the second-sized quantization block. 32 This indicates the width of the quantization block of the second size.

[0145] Step S207: Determine whether the image frame to be encoded is a keyframe in the video data or belongs to the third type of scene.

[0146] Specifically, this application embodiment describes the adaptive configuration process of the quantization parameter depth by taking the adaptive selection between the first identification information (e.g., Dqp detph=1) and the second identification information (e.g., Dqp detph=0) as an example.

[0147] If the image frame to be encoded is detected to be a keyframe in the video data, or if the scene complexity information in the image information features indicates that the image frame to be encoded belongs to the third type of scene (complex scene), then the quantization parameter depth corresponding to the image frame to be encoded is set to the first identification information, such as Dqp detph = 1, and then the image frame to be encoded can be encoded according to the first identification information. In other words, for the image frame to be encoded that belongs to the complex scene in the video data, and for the image frame to be encoded that belongs to the I-frame (keyframe) in the video data, the quantization parameter depth corresponding to the image frame to be encoded can be set to the first identification information, that is, the size of the quantization block of the image frame to be encoded in the encoding process is the second size (such as 32*32). The quantization parameter depth configuration process when the image frame to be encoded is an I-frame or belongs to the complex scene can be as shown in the following formula (8):

[0148] Dqp depth=1,slice type =I or scene=2 (8)

[0149] Among them, slice in formula (8) typeThis indicates the frame type of the image frame to be encoded. It's understandable that complex scenes have complex texture variations and large fluctuations in the quantization parameter offset (QP offset). Therefore, encoding units within the second-sized quantization block can be selected for quantization parameter encoding, thereby improving the encoding accuracy of the image frame. I-frames are of paramount importance in encoding; setting the quantization parameter depth as the primary identifier allows for better encoding and provides a better reference for subsequent image groups.

[0150] Step S208: Determine if the image layer information is the top layer or if the image frame to be encoded belongs to the second type of scene.

[0151] Specifically, if the scene complexity information in the image information features indicates that the image frame to be encoded belongs to the second type of scene (simple scene), or if the image level information in the image information features is the top level, then the quantization parameter depth corresponding to the image frame to be encoded is set to the second identifier information, such as Dqp detph = 0. Then, the image frame to be encoded can be encoded according to the second identifier information. The temporal level indicated by the top level will also be different depending on the size of the image group. For example, ... Figure 5 As shown, when the size of the image group is 8, the temporal level indicated by the top layer is level=3. The image frame at the top layer can refer to the unreferenced frame in the image group (or the top B frame in the image group).

[0152] For image frames to be encoded in simple scenes in video data, and for unencoded image frames belonging to image groups in video data, the quantization parameter depth corresponding to the image frame to be encoded can be set to the second identification information, that is, the size of the quantization block of the image frame to be encoded in the encoding process is the first size (e.g., 64*64). Among them, the quantization parameter depth configuration process when the image frame to be encoded is an unreferenced frame of an image group or when the image frame to be encoded belongs to a simple scene can be as shown in the following formula (9):

[0153] Dqp depth=0, level=3 or scene=0 (9)

[0154] In formula (9), level = 3 indicates that the image frame to be encoded is an unreferenced frame in an image group of size 8, that is, formula (9) assumes that the size of the image group in the video data is 8. It can be understood that the texture of a simple scene is relatively flat and the fluctuation of the quantization parameter offset (QP offset) is small. Therefore, the coding unit in the quantization block of the first size (such as 64*64) can be selected for quantization parameter encoding, thereby improving the encoding effectiveness of the image frame to be encoded. The temporal level of the unreferenced frame in the image group is the largest temporal level in the image group and will not be referenced by other image frames. Setting the quantization parameter depth to the second identification information can be effectively encoded and can save bit rate.

[0155] Step S209: Determine that the offset variance comparison result is less than the offset variance comparison threshold, and that the intra-frame prediction cost corresponding to the image frame to be encoded is within the target cost range.

[0156] Specifically, when the image frame to be encoded belongs to a simple scene (first type scene) or a complex scene (third type scene), the quantization parameter depth can be adaptively set according to the descriptions in steps S207 and S208 above. Then, when the image frame to be encoded belongs to a normal scene (first type scene), the ratio between the first offset variance change information calculated by the above formula (6) and the second offset variance change information calculated by the above formula (7) can be determined as the offset variance comparison result corresponding to the image frame to be encoded. The relationship between the offset variance comparison result, the first offset variance change information and the second offset variance change information can be shown in the following formula (10):

[0157]

[0158] In formula (10), var frac This indicates the result of the offset variance comparison. If an offset variance comparison result var is detected, then... frac The variance is less than the offset contrast threshold, and the intra-prediction cost corresponding to the frame to be encoded is within the target cost range. th0 ≤intra cost <intra th1 If the quantization parameter depth corresponding to the image frame to be encoded is set to the first identifier information, then the size of the quantization block of the image frame to be encoded during the encoding process is the second size (e.g., 32*32). The offset variance comparison threshold is a resolution-related threshold and can be set according to actual needs; this application does not limit it. Optionally, if the offset variance comparison result var is detected... frac Greater than or equal to the offset variance contrast threshold (frac) th), or the intra-prediction cost corresponding to the image frame to be encoded is not within the target cost range (intra cost <intra th0 Or intra cost >intra th1 The quantization parameter depth corresponding to the image frame to be encoded can be set as the second identifier information, that is, the size of the quantization block of the image frame to be encoded in the encoding process is the first size (such as 64*64). Among them, the quantization parameter depth configuration process when the image frame to be encoded belongs to a normal scene can be as shown in the following formula (11):

[0159]

[0160] Among them, c th This represents a resolution-related threshold, which can be set empirically. The intra-frame cost threshold for a normal scene (Type I scene) in Equation (11) is... th1 This can be compared with the intra-frame cost threshold for ordinary scenes in the aforementioned formula (3). th1 They can be different or the same. It is understood that the intra-frame cost threshold (intra) for the second type of scenario (simple scenario) in this application embodiment... th0 Intra-frame cost threshold for ordinary scenes th1 And the inter-frame cost threshold for complex scenes th Adjustments can be made according to the actual coding situation, and this application does not impose any restrictions on this.

[0161] In one or more embodiments, when the image frame to be encoded belongs to a normal scene (first type scene), for some texture content that is simple and the intra-frame prediction cost is low, cost For relatively small image frames to be encoded in ordinary scenes, if the intra-prediction cost of the image frame to be encoded is less than the intra-cost threshold for simple scenes... th0 Then the quantization parameter depth corresponding to the image frame to be encoded can be set to the second identifier information, such as Dqp detph = 0; the intra-frame cost threshold is intra th0 Thresholds can be configured empirically. Specifically, the intra-prediction cost of the image frame to be encoded in a normal scene is less than the intra-cost threshold (intra). th0 The process of configuring the quantization parameter depth in the case of [condition] can be shown in the following formula (12):

[0162] Dqp depth=0,intra cost <intra th0 (12)

[0163] Optionally, for image frames to be encoded that belong to other common scenes (i.e., whose intra-prediction cost is greater than or equal to the intra-cost threshold), th0 The quantization parameter depth can be determined based on the frame-level quantization parameter offset variance change (i.e., quantization parameter offset change information). For example, the first offset variance change information can be calculated according to formula (10). Second offset variance change information The comparison results between the two (i.e., the offset variance comparison results) are used to adaptively configure the quantization parameter depth based on these offset variance comparison results. Specifically, for image frames in ordinary scenes, the intra-prediction cost is greater than or equal to the intra-cost threshold. th0 The process of configuring the quantization parameter depth in the case of [condition] can be shown in the following formula (13):

[0164]

[0165] In other words, the aforementioned formula (11) can be divided into two cases: formula (12) and formula (13). For the image frame to be encoded in a normal scene, the quantization parameter depth corresponding to the image frame to be encoded can be adaptively set based on formula (12). If the image frame to be encoded does not meet the conditions in formula (12), the quantization parameter depth corresponding to the image frame to be encoded can be adaptively set based on formula (13).

[0166] Please see Figure 6 , Figure 6 This is a schematic diagram illustrating an adaptive decision-making process based on the depth of quantization parameters provided in an embodiment of this application. For example... Figure 6 As shown, after obtaining the video data to be encoded, the lookahead algorithm can be used to obtain the Group of Pictures (GOP) structure in the video data, and the image layer information corresponding to each different frame type in the GOP can be obtained based on the GOP structure. In the pre-analysis of the video data, the AQ or Cutree algorithm can be used to calculate the quantization parameter offset (QP offset) of the coding units contained in the quantization block of the current image frame (the image frame to be encoded). Furthermore, by using intra-frame prediction, inter-frame prediction, and cost in the pre-analysis, scene decision-making can be performed on the image frame to be encoded in the video data to obtain the scene complexity information corresponding to the image frame to be encoded. Based on the quantization parameter offset (QP offset) calculated by the AQ or Cutree algorithm, the quantization parameter offset change information corresponding to the image frame to be encoded can be calculated (which may include the QP offset variance and the variance of the QP offset variance, etc.).

[0167] The resolution information corresponding to the video data is obtained. If the resolution information is greater than the resolution threshold, the video data is determined to be high-resolution video. The Dqp depth (quantization parameter depth) adaptive mode is then disabled for this video data, and the Dqp depth corresponding to all image frames in the video data is set to a fixed configuration parameter. If the resolution information is less than or equal to the resolution threshold, the Dqp depth adaptive mode is enabled for this video data, and Dqp depth adaptive decisions are made for the image frames to be encoded in the video data.

[0168] The Dqp depth adaptive decision for the image frame to be encoded in the video data may include, but is not limited to: determining whether the frame type of the image frame to be encoded is an I-frame, or determining whether the image frame to be encoded belongs to a complex scene (third type scene); if the image frame to be encoded is an I-frame (i.e., slice) type =), or if the image frame to be encoded belongs to a complex scene (i.e., scene=2), then the Dqp depth corresponding to the image frame to be encoded can be set to 1 (first identification information). If the image frame to be encoded is neither an I-frame nor belongs to a complex scene, then it can be further determined whether the image level information of the image frame to be encoded is the top level (e.g., level=3 in an image group of size 8, in which case the image frame to be encoded with level=3 is an unreferenced frame in the image group), or whether the image frame to be encoded belongs to a simple scene (i.e., scene=0); if the temporal level of the image frame to be encoded in its target image group is level=3 (i.e., the image frame to be encoded is an unreferenced frame), or the image frame to be encoded belongs to a simple scene, then the Dqp depth corresponding to the image frame to be encoded can be set to 1.

[0169] If the image frame to be encoded is neither an unreferenced frame in the image group nor belongs to a simple scene, then the intra-prediction cost of the image frame to be encoded can be determined. cost Is it less than the intra-frame cost threshold for simple scenarios? th0 If the image frame to be encoded satisfies intra cost <ntra th0 Then, the Dqpdepth corresponding to the image frame to be encoded can be set to 0 (second identifier information). If the image frame to be encoded does not satisfy intra cost <ntra th0 Then, the intra-frame cost threshold can be determined. th0 Is it less than the intra-frame cost threshold for normal scenes? th1 ), and the offset variance comparison result (var) calculated by formula (10) frac Is it less than the offset variance comparison threshold (frac)?th If the image frame to be encoded satisfies intra cost <ntra th1 And r frac <rac th If so, the Dqp depth corresponding to the image frame to be encoded can be set to 1; if the image frame to be encoded does not satisfy intra cost <ntra th1 And r frac <frac th Then the Dqpdepth corresponding to the image frame to be encoded can be set to 0.

[0170] In one or more embodiments, to verify the performance of the proposed Dqp depth adaptive configuration scheme in the field of video compression, multiple test sequences with different resolutions can be used to test the Dqp depth adaptive configuration scheme and the existing fixed Dqp depth configuration schemes (Dqp depth=0 configuration scheme, Dqp depth=1 configuration scheme). The test effects of different Dqp depth configuration schemes are evaluated using metrics such as PSNR (peak signal to noise ratio), SSIM (structural similarity index), VMAF (Video Multi-Method Assessment Fusion), and speed-up. Among them, the test sequence types with different resolutions used to test different Dqp depth configuration schemes may include, but are not limited to: test sequence B (Class B), test sequence C (Class C), test sequence D (Class D), test sequence E (Class E), test sequence F (Class F), low resolution test sequence (LOWRES), 720p resolution test sequence (Short720p), 540p resolution test sequence (Short540p), movie test sequence (Movie), game test sequence (Game), short video test sequence (Show), music video test sequence (Music Video), sports test sequence (Sport), MSU test sequence, 10-bit test sequence (10-bit video), and badcase test sequence, etc.; class B, class C, class D, class E, and class F are the standard test sequence groups for testing compression performance.

[0171] Understandably, a higher PSNR between two image frames indicates greater similarity. SSIM calculates a decimal between -1 and 1; a result of 1 indicates that the two compared image frames are data-similar. VMAF can include, but is not limited to, the following three metrics: visual quality fidelity (VIF), detail loss measure (DLM), and temporal motion measure / mean correlated position pixel difference (TI). VIF and DLM are spatial domain metrics used to represent features within a single image frame; TI is temporal domain metrics used to represent the correlation between multiple image frames. The fusion calculation of these features can be predicted using a trained Support Vector Machine (SVM). A negative BD-rate value indicates that, under the same PSNR conditions, the bitrate is reduced and compression performance is improved. A positive BD-rate value indicates that the bitrate is increased and performance is decreased.

[0172] The test results between the proposed adaptive Dqp depth configuration scheme and the fixed Dqp depth configuration scheme (Dqp depth = 0) are shown in Table 1 below, and the test results between the proposed adaptive Dqp depth configuration scheme and the fixed Dqp depth configuration scheme (Dqp depth = 1) are shown in Table 2 below. As can be seen from Tables 1 and 2 below, compared with the existing fixed Dqp depth configuration scheme, the proposed adaptive Dqp depth configuration scheme can improve compression performance by 0.5% to 1.2% while maintaining a basically unchanged speed, demonstrating a significant improvement in compression performance.

[0173] Table 1

[0174]

[0175]

[0176] Table 2

[0177] Test sequence B -0.60% 1.08% -1.01% -0.47% Test sequence C -0.20% 1.04% -0.25% -1.44% Test sequence D -0.13% 0.55% -0.31% 0.29% Test sequence E -0.13% 0.43% -0.13% -0.51% Test sequence F 0.26% 0.98% 0.33% 1.79% Low-resolution test sequence -0.69% 0.35% -1.16% -1.39% 720p resolution test sequence -0.31% 0.48% -1.21% 0.21% 540p resolution test sequence -0.27% 0.14% -0.67% -0.23% Movie test sequence -0.68% 0.09% -1.30% -0.41% Game Test Sequence -0.34% 1.01% -0.54% -0.50% Short video test sequence -0.92% 0.71% -1.81% 0.18% Music short film test sequence -1.26% -0.14% -1.29% 0.62% Exercise test sequence -1.01% 0.61% -1.90% 0.00% MSU test sequence -0.72% 0.08% -1.52% -0.14% 10-bit test sequence -0.66% 0.19% -1.36% -0.85% Abnormal test sequence -0.45% 0.35% -1.23% 0.47% mean -0.59% 0.40% -1.15% -0.15%

[0178] In this embodiment, video data is acquired. If the video data meets the adaptive configuration conditions for quantization parameter depth, an adaptive configuration algorithm for quantization parameter depth association can be enabled for the video data. This allows the acquisition of image information features corresponding to the image frames to be encoded in the video data. These image information features may include scene complexity information, first offset variance change information, and second offset variance change information of the image frames to be encoded. The quantization parameter depth corresponding to the image frames to be encoded can be adaptively set through these image information features, meaning the size of the quantization blocks in the image frames to be encoded can be adaptively selected. This enhances the flexibility of quantization block size configuration and improves the compression performance of the video data. Furthermore, for high-resolution video data, the pixel changes of the coding tree units within the image frames are relatively small, allowing the adaptive decision algorithm for quantization parameter depth to be skipped. For image frames that are not referenced, keyframes, and top-level image frames (top-level B-frames), the quantization parameter depth can be directly configured, improving video data compression performance while minimizing the complexity of adaptive selection.

[0179] Please see Figure 7 This is a schematic diagram of a video compression processing apparatus provided in an embodiment of this application. The aforementioned video compression processing apparatus can be a computer program (including program code) running on a computer device; for example, the video compression processing apparatus is an application software. This apparatus can be used to execute the corresponding steps in the method provided in the embodiments of this application. Figure 7 As shown, the video compression processing device 1 may include: an image information acquisition module 11, a comparison result determination module 12, a first setting module 13, and a second setting module 14;

[0180] The image information acquisition module 11 is used to acquire video data. If the video data meets the adaptive configuration conditions of the quantization parameter depth, the image information features corresponding to the image frame to be encoded in the video data are acquired. The quantization parameter depth is used to characterize the quantization block size in the image frame to be encoded.

[0181] The comparison result determination module 12 is used to determine the offset variance comparison result corresponding to the image frame to be encoded based on the first offset variance change information and the second offset variance change information contained in the image information features if the scene complexity information contained in the image information features indicates that the image frame to be encoded belongs to the first type of scene. The first offset variance change information and the second offset variance change information are used to characterize the variance change information of the quantization parameter offset values ​​in quantization blocks of different sizes contained in the image frame to be encoded.

[0182] The first setting module 13 is used to set the quantization parameter depth corresponding to the image frame to be encoded to the first identification information if the offset variance comparison result is less than the offset variance comparison threshold and the image information features indicate that the intra-prediction cost corresponding to the image frame to be encoded is within the target cost range, and then encode the image frame to be encoded according to the first identification information; the target cost range includes the range between the intra-cost threshold of the second type of scene and the intra-cost threshold of the first type of scene.

[0183] The second setting module 14 is used to set the quantization parameter depth of the image frame to be encoded to the second identification information if the offset variance comparison result is greater than or equal to the offset variance comparison threshold, or if the image information features indicate that the intra-frame prediction cost corresponding to the image frame to be encoded is not within the target cost range, and then encode the image frame to be encoded according to the second identification information.

[0184] In one or more embodiments, the video compression processing apparatus 1 further includes: a ratio acquisition module 15 and a configuration condition determination module 16;

[0185] The resolution acquisition module 15 is used to acquire the resolution information of the video data;

[0186] The configuration condition determination module 16 is used to determine whether the video data meets the adaptive configuration condition of the quantization parameter depth if the resolution information is less than or equal to the resolution threshold; and,

[0187] It is also used to determine if the resolution information is greater than the resolution threshold, and to set a fixed quantization parameter depth for all image frames contained in the video data.

[0188] In one or more embodiments, if the video data satisfies the adaptive configuration condition of the quantization parameter depth, the image information acquisition module 11 acquires the image information features corresponding to the image frame to be encoded in the video data, including:

[0189] The image group acquisition unit 111 is used to acquire the image frame sequence corresponding to the video data if the video data meets the adaptive configuration conditions of the quantization parameter depth, and divide the image frame sequence into one or more image groups according to the temporal order of the image frames contained in the image frame sequence in the video data.

[0190] The hierarchical information acquisition unit 112 is used to determine the image frame to be encoded from the image frame sequence, determine the image group to which the image frame to be encoded belongs as the target image group, and obtain the image hierarchical information corresponding to the image frame to be encoded according to the reference relationship between the image frames in the target image group.

[0191] The complexity information acquisition unit 113 is used to acquire the intra-frame prediction cost and intra-frame prediction mode ratio corresponding to the image frame to be encoded, and to acquire the scene complexity information corresponding to the image frame to be encoded based on the intra-frame prediction cost and intra-frame prediction mode ratio; the intra-frame prediction mode ratio is used to characterize the proportion of the target mode used in the inter-frame prediction of the image frame to be encoded.

[0192] The offset change information acquisition unit 114 is used to acquire the quantization parameter offset value corresponding to the quantization block in the image frame to be encoded, acquire the quantization parameter offset change information corresponding to the image frame to be encoded based on the quantization parameter offset value, and determine the image layer information, scene complexity information and quantization parameter offset change information as the image information features corresponding to the image to be encoded.

[0193] In one or more embodiments, the hierarchical information acquisition unit 112 acquires the image hierarchical information corresponding to the image frame to be encoded based on the reference relationship between image frames in the target image group, including:

[0194] Obtain the reference relationships between image frames in the target image group, and determine the number of times the image frame to be encoded is referenced in the target image group based on the reference relationships;

[0195] The image layer information corresponding to the image frame to be encoded is determined based on the number of times the image frame to be referenced.

[0196] In one or more embodiments, the complexity information acquisition unit 113 acquires scene complexity information corresponding to the image frame to be encoded based on the intra-frame prediction cost and the proportion of intra-frame prediction modes, including:

[0197] If the intra-frame prediction cost is less than the intra-frame cost threshold for the first type of scene, and the proportion of intra-frame prediction modes is greater than the target parameter value, then the scene complexity information corresponding to the image frame to be encoded is determined to be the second type of scene.

[0198] If the intra-frame prediction cost is less than the intra-frame cost threshold for the second type of scene, then the scene complexity information corresponding to the image frame to be encoded is determined to be the second type of scene.

[0199] If the intra-frame prediction cost is greater than the inter-frame cost threshold for the third type of scene, then the scene complexity information corresponding to the image frame to be encoded is determined to be the third type of scene.

[0200] If the image frame to be encoded does not belong to the second type of scene and does not belong to the third type of scene, then the scene complexity information corresponding to the image frame to be encoded is determined to be the first type of scene.

[0201] In one or more embodiments, the offset change information acquisition unit 114 acquires the quantization parameter offset value corresponding to the quantization block in the image frame to be encoded, and acquires the quantization parameter offset change information corresponding to the image frame to be encoded based on the quantization parameter offset value, including:

[0202] If the quantization block in the image frame to be encoded is of the first size, then obtain the quantization parameter offset value corresponding to one or more coding units contained in the quantization block of the first size in the image frame to be encoded, and determine the first offset variance corresponding to the quantization block of the first size based on the quantization parameter offset value corresponding to one or more coding units contained in the quantization block of the first size.

[0203] If the quantization block in the image frame to be encoded is of the second size, then obtain the quantization parameter offset value corresponding to one or more coding units contained in the quantization block of the second size in the image frame to be encoded, and determine the second offset variance corresponding to the quantization block of the second size based on the quantization parameter offset value corresponding to one or more coding units contained in the quantization block of the second size.

[0204] The variance of the first offset variance is determined as the first offset variance change information, the variance of the second offset variance is determined as the second offset variance change information, and the first offset variance change information and the second offset variance change information are determined as the quantization parameter offset change information corresponding to the image frame to be encoded.

[0205] In one or more embodiments, the offset change information acquisition unit 114 determines the first offset variance corresponding to the quantization block of the first size based on the quantization parameter offset values ​​corresponding to one or more encoding units included in the quantization block of the first size, including:

[0206] The average quantization parameter offset value corresponding to the quantization block of the first size in the image frame to be encoded is determined based on the quantization parameter offset value corresponding to one or more coding units contained in the quantization block of the first size.

[0207] The first offset variance corresponding to the first-size quantization block is determined based on the mean quantization parameter offset, the number of coding units contained in the first-size quantization block, and the quantization parameter offset values ​​corresponding to one or more coding units contained in the first-size quantization block.

[0208] In one or more embodiments, the video compression processing device 1 may further include: a third setting module 17 and a fourth setting module 18;

[0209] The third setting module 17 is used to set the quantization parameter depth corresponding to the image frame to be encoded to the first identification information if the image frame to be encoded is a key frame in the video data, or if the scene complexity information in the image information features indicates that the image frame to be encoded belongs to the third type of scene, and then encode the image frame to be encoded according to the first identification information.

[0210] The fourth setting module 18 is used to set the quantization parameter depth corresponding to the image frame to be encoded to the second identification information if the scene complexity information in the image information features indicates that the image frame to be encoded belongs to the second type of scene, or the image level information in the image information features is the top level, and then encode the image frame to be encoded according to the second identification information.

[0211] The first setting module 13 performs encoding processing on the image frame to be encoded based on the first identification information, including:

[0212] Based on the first identification information, a quarter region of the coding tree unit in the image frame to be encoded is determined as the target quantization block; the target quantization block includes one or more coding units in the coding tree unit;

[0213] Obtain the quantization parameter offset values ​​corresponding to one or more coding units contained in the target quantization block, encode the quantization parameter offset values ​​corresponding to one or more coding units contained in the target quantization block in the image frame to be encoded, and obtain the encoded image frame.

[0214] According to one embodiment of this application, the steps involved in the image processing method described above can be performed by... Figure 7 The video compression processing device 1 shown is used to perform this operation. For example, Figure 3 The step S101 shown can be performed by Figure 7 The image information acquisition module shown is used to perform this task. Figure 3 The step S102 shown can be performed by Figure 7 The comparison results shown indicate that the module will be executed. Figure 3 The step S103 shown can be performed by Figure 7 The first settings module shown is used to execute this. Figure 3 The step S104 shown can be performed by Figure 7 The second settings module shown is used to perform actions, etc.

[0215] According to one embodiment of this application, Figure 7The various modules in the video compression processing apparatus 1 shown can be individually or entirely combined into one or more units, or one or more of these units can be further divided into at least two functionally smaller sub-units to achieve the same operation without affecting the technical effects of the embodiments of this application. The above modules are based on logical functional division. In practical applications, the function of one module can also be implemented by at least two units, or the function of at least two modules can be implemented by one unit. In other embodiments of this application, the video compression processing apparatus 1 may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by at least two units.

[0216] In this embodiment, video data is acquired. If the video data meets the adaptive configuration conditions for quantization parameter depth, an adaptive configuration algorithm for quantization parameter depth association can be enabled for the video data. This allows the acquisition of image information features corresponding to the image frames to be encoded in the video data. These image information features may include scene complexity information, first offset variance change information, and second offset variance change information of the image frames to be encoded. The quantization parameter depth corresponding to the image frames to be encoded can be adaptively set through these image information features, meaning the size of the quantization blocks in the image frames to be encoded can be adaptively selected. This enhances the flexibility of quantization block size configuration and improves the compression performance of the video data. Furthermore, for high-resolution video data, the pixel changes of the coding tree units within the image frames are relatively small, allowing the adaptive decision algorithm for quantization parameter depth to be skipped. For image frames that are not referenced, keyframes, and top-level image frames (top-level B-frames), the quantization parameter depth can be directly configured, improving video data compression performance while minimizing the complexity of adaptive selection.

[0217] Please see Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 8 As shown, the computer device 1000 may include a processor 1001, a network interface 1004, and a memory 1005. Furthermore, the computer device 1000 may also include a user interface 1003 and at least one communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as Wi-Fi). I -F I Interface). The memory 1005 can be a high-speed RAM or a non-volatile memory. i(e.g., memory), such as at least one disk storage device. Optionally, memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. For example... Figure 8 As shown, the memory 1005, which is a computer-readable storage medium, may include an operating system, a network communication module, a media content interface module, and a device control application.

[0218] exist Figure 8 In the computer device 1000 shown, the network interface 1004 provides network communication functions; while the user interface 1003 is mainly used to provide an interface for inputting media content.

[0219] Understandably, processor 1001 can be used to call device-defined applications stored in memory 1005 to achieve:

[0220] If the video data meets the adaptive configuration conditions of the quantization parameter depth, then the image information features corresponding to the image frame to be encoded in the video data are obtained; the quantization parameter depth is used to characterize the quantization block size in the image frame to be encoded.

[0221] If the scene complexity information contained in the image information features indicates that the image frame to be encoded belongs to the first type of scene, then the offset variance comparison result corresponding to the image frame to be encoded is determined according to the first offset variance change information and the second offset variance change information contained in the image information features; the first offset variance change information and the second offset variance change information are used to characterize the variance change information of the quantization parameter offset values ​​in the quantization blocks of different sizes contained in the image frame to be encoded.

[0222] If the offset variance comparison result is less than the offset variance comparison threshold, and the image information features indicate that the intra-prediction cost corresponding to the image frame to be encoded is within the target cost range, then the quantization parameter depth corresponding to the image frame to be encoded is set to the first identifier information, and the image frame to be encoded is encoded according to the first identifier information; the target cost range includes the range between the intra-cost threshold of the second type of scene and the intra-cost threshold of the first type of scene.

[0223] If the offset variance comparison result is greater than or equal to the offset variance comparison threshold, or if the image information features indicate that the intra-frame prediction cost corresponding to the image frame to be encoded is not within the target cost range, then the quantization parameter depth corresponding to the image frame to be encoded is set to the second identifier information, and the image frame to be encoded is encoded according to the second identifier information.

[0224] It should be understood that the computer device 1000 described in the embodiments of this application can execute the foregoing text. Figure 3 , Figure 4 as well as Figure 6The description of the video compression processing method in any of the corresponding embodiments can also be performed as described above. Figure 7 The description of the video compression processing apparatus 1 in the corresponding embodiment will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated.

[0225] Furthermore, it should be noted that this application embodiment also provides a computer-readable storage medium, which stores a computer program executed by the aforementioned video compression processing device 1. The computer program includes program instructions, and when the processor executes the program instructions, it can execute the aforementioned... Figure 3 , Figure 4 as well as Figure 6 The description of the video compression processing method in any corresponding embodiment is already provided, and therefore will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer-readable storage medium embodiments related to this application, please refer to the description of the method embodiments of this application.

[0226] As an example, the above program instructions can be deployed and executed on a single computer device, or deployed and executed on at least two computer devices located in one location, or executed on at least two computer devices distributed in at least two locations and interconnected by a communication network. At least two computer devices distributed in at least two locations and interconnected by a communication network can form a blockchain network.

[0227] The aforementioned computer-readable storage medium can be the video compression processing apparatus provided in any of the foregoing embodiments or the internal storage unit of the aforementioned computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart memory card (SMC), secure digital card (SD) card, flash card, etc., provided on the computer device. Furthermore, the computer-readable storage medium may include both internal storage units and external storage devices of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0228] Furthermore, it should be noted that this application also provides a computer program product or computer program, which may include computer instructions, which may be stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor may execute the computer instructions, causing the computer device to perform the aforementioned actions. Figure 3 , Figure 4 as well as Figure 6 The description of the point cloud processing method in any corresponding embodiment is already provided, and therefore will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer program products or computer program embodiments involved in this application, please refer to the description of the method embodiments of this application.

[0229] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different media content, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.

[0230] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.

[0231] The methods and related apparatuses provided in this application are described with reference to the method flowcharts and / or structural diagrams provided in this application. Specifically, each block of the method flowchart and / or structural diagram, as well as combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to create a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the process. Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 A process or multiple processes and / or structures illustrate the steps of the functions specified in one or more boxes.

[0232] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A video compression processing method, characterized in that, include: Acquire video data; if the video data satisfies the adaptive configuration condition of the quantization parameter depth, then acquire the image information features corresponding to the image frame to be encoded in the video data. The quantization parameter depth is used to characterize the quantization block size in the image frame to be encoded; If the scene complexity information contained in the image information features indicates that the image frame to be encoded belongs to a first type of scene, and the image frame to be encoded does not belong to a keyframe or an unreferenced frame in the video data, then the offset variance comparison result corresponding to the image frame to be encoded is determined according to the first offset variance change information and the second offset variance change information contained in the image information features; the first offset variance change information represents the variance of the first offset variance in the quantization block of the first size contained in the image frame to be encoded, and the second offset variance change information represents the variance of the second offset variance in the quantization block of the second size contained in the image frame to be encoded; If the offset variance comparison result is less than the offset variance comparison threshold, and the image information feature indicates that the intra-frame prediction cost corresponding to the image frame to be encoded is within the target cost range, then the quantization parameter depth corresponding to the image frame to be encoded is set to the first identification information, and the image frame to be encoded is encoded according to the first identification information. The target cost range includes the range between the intra-frame cost threshold of the second type of scenario and the intra-frame cost threshold of the first type of scenario; If the offset variance comparison result is greater than or equal to the offset variance comparison threshold, or if the image information feature indicates that the intra-frame prediction cost corresponding to the image frame to be encoded is not within the target cost range, then the quantization parameter depth corresponding to the image frame to be encoded is set to the second identification information, and the image frame to be encoded is encoded according to the second identification information.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the resolution information of the video data; If the resolution information is less than or equal to the resolution threshold, then the video data is determined to meet the adaptive configuration conditions of the quantization parameter depth. If the resolution information is greater than the resolution threshold, it is determined that the video data does not meet the adaptive configuration conditions for the quantization parameter depth, and a fixed quantization parameter depth is set for all image frames contained in the video data.

3. The method according to claim 1, characterized in that, If the video data satisfies the adaptive configuration condition of the quantization parameter depth, then the image information features corresponding to the image frame to be encoded in the video data are obtained, including: If the video data satisfies the adaptive configuration condition of the quantization parameter depth, then the image frame sequence corresponding to the video data is obtained, and the image frame sequence is divided into one or more image groups according to the temporal order of the image frames contained in the video data. The image frame to be encoded is determined from the image frame sequence, the image group to which the image frame to be encoded belongs is determined as the target image group, and the image layer information corresponding to the image frame to be encoded is obtained according to the reference relationship between the image frames in the target image group. Obtain the intra-frame prediction cost and intra-frame prediction mode ratio corresponding to the image frame to be encoded. Based on the intra-frame prediction cost and the intra-frame prediction mode ratio, obtain the scene complexity information corresponding to the image frame to be encoded. The intra-frame prediction mode ratio is used to characterize the proportion of the target mode used in the inter-frame prediction of the image frame to be encoded. The quantization parameter offset value corresponding to the quantization block in the image frame to be encoded is obtained. The quantization parameter offset change information corresponding to the image frame to be encoded is obtained based on the quantization parameter offset value. The image layer information, the scene complexity information and the quantization parameter offset change information are determined as the image information features corresponding to the image to be encoded.

4. The method according to claim 3, characterized in that, The step of obtaining the image layer information corresponding to the image frame to be encoded based on the reference relationship between image frames in the target image group includes: Obtain the reference relationship between image frames in the target image group, and determine the number of times the image frame to be encoded is referenced in the target image group based on the reference relationship; The image layer information corresponding to the image frame to be encoded is determined based on the number of times the image frame to be encoded is referenced.

5. The method according to claim 3, characterized in that, The step of obtaining the scene complexity information corresponding to the image frame to be encoded based on the intra-frame prediction cost and the intra-frame prediction mode ratio includes: If the intra-frame prediction cost is less than the intra-frame cost threshold of the first type of scene, and the intra-frame prediction mode ratio is greater than the target parameter value, then the scene complexity information corresponding to the image frame to be encoded is determined to be the second type of scene. If the intra-frame prediction cost is less than the intra-frame cost threshold for the second type of scene, then the scene complexity information corresponding to the image frame to be encoded is determined to be the second type of scene. If the intra-frame prediction cost is greater than the inter-frame cost threshold of the third type of scene, then the scene complexity information corresponding to the image frame to be encoded is determined to be the third type of scene. If the image frame to be encoded does not belong to the second type of scene and does not belong to the third type of scene, then the scene complexity information corresponding to the image frame to be encoded is determined to be the first type of scene.

6. The method according to claim 3, characterized in that, The step of obtaining the quantization parameter offset value corresponding to the quantization block in the image frame to be encoded, and obtaining the quantization parameter offset change information corresponding to the image frame to be encoded based on the quantization parameter offset value, includes: If the quantization block in the image frame to be encoded is of the first size, then obtain the quantization parameter offset value corresponding to one or more coding units contained in the quantization block of the first size in the image frame to be encoded, and determine the first offset variance corresponding to the quantization block of the first size based on the quantization parameter offset value corresponding to one or more coding units contained in the quantization block of the first size. If the quantization block in the image frame to be encoded is of the second size, then obtain the quantization parameter offset value corresponding to one or more coding units contained in the quantization block of the second size in the image frame to be encoded, and determine the second offset variance corresponding to the quantization block of the second size based on the quantization parameter offset value corresponding to one or more coding units contained in the quantization block of the second size. The variance of the first offset variance is determined as the first offset variance change information, the variance of the second offset variance is determined as the second offset variance change information, and the first offset variance change information and the second offset variance change information are determined as the quantization parameter offset change information corresponding to the image frame to be encoded.

7. The method according to claim 6, characterized in that, Determining the first offset variance corresponding to the quantization block of the first size based on the quantization parameter offset values ​​corresponding to one or more coding units contained in the quantization block of the first size includes: The average quantization parameter offset value corresponding to the quantization block of the first size in the image frame to be encoded is determined based on the quantization parameter offset value corresponding to one or more coding units contained in the quantization block of the first size. The first offset variance corresponding to the quantization block of the first size is determined based on the mean quantization parameter offset, the number of coding units contained in the quantization block of the first size, and the quantization parameter offset value corresponding to one or more coding units contained in the quantization block of the first size.

8. The method according to claim 1, characterized in that, The method further includes: If the image frame to be encoded is a keyframe in the video data, or if the scene complexity information in the image information features indicates that the image frame to be encoded belongs to a third type of scene, then the quantization parameter depth corresponding to the image frame to be encoded is set to the first identification information, and the image frame to be encoded is encoded according to the first identification information.

9. The method according to claim 1, characterized in that, The method further includes: If the scene complexity information in the image information features indicates that the image frame to be encoded belongs to the second type of scene, or the image level information in the image information features is the top level, then the quantization parameter depth corresponding to the image frame to be encoded is set to the second identification information, and the image frame to be encoded is encoded according to the second identification information.

10. The method according to claim 1, characterized in that, The step of encoding the image frame to be encoded according to the first identification information includes: Based on the first identification information, a quarter region of the coding tree unit in the image frame to be encoded is determined as the target quantization block; the target quantization block includes one or more coding units in the coding tree unit; Obtain the quantization parameter offset values ​​corresponding to one or more coding units contained in the target quantization block, and encode the quantization parameter offset values ​​corresponding to one or more coding units contained in the target quantization block in the image frame to be encoded to obtain the encoded image frame.

11. A video compression processing apparatus, characterized in that, include: The image information acquisition module is used to acquire video data. If the video data meets the adaptive configuration conditions of the quantization parameter depth, the image information features corresponding to the image frame to be encoded in the video data are acquired. The quantization parameter depth is used to characterize the quantization block size in the image frame to be encoded; The comparison result determination module is used to determine the offset variance comparison result corresponding to the image frame to be encoded based on the first offset variance change information and the second offset variance change information contained in the image information features if the scene complexity information contained in the image information features indicates that the image frame to be encoded belongs to a first type of scene, and the image frame to be encoded does not belong to the keyframe and unreferenced frame in the video data; the first offset variance change information represents the variance of the first offset variance in the quantization block of the first size contained in the image frame to be encoded, and the second offset variance change information represents the variance of the second offset variance in the quantization block of the second size contained in the image frame to be encoded. The first setting module is used to set the quantization parameter depth corresponding to the image frame to be encoded to the first identification information if the offset variance comparison result is less than the offset variance comparison threshold and the image information feature indicates that the intra-frame prediction cost corresponding to the image frame to be encoded is within the target cost range, and then encode the image frame to be encoded according to the first identification information. The target cost range includes the range between the intra-frame cost threshold of the second type of scenario and the intra-frame cost threshold of the first type of scenario; The second setting module is used to set the quantization parameter depth corresponding to the image frame to be encoded to the second identification information if the offset variance comparison result is greater than or equal to the offset variance comparison threshold, and the image information feature indicates that the intra-frame prediction cost corresponding to the image frame to be encoded is not within the target cost range, and then encode the image frame to be encoded according to the second identification information.

12. A computer device, characterized in that, include: Processor and memory; The processor is connected to a memory; the memory is used to store program code, and the processor is used to call the program code to execute the method as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1 to 10.

14. A computer program product, characterized in that, Includes a computer program / instruction that, when executed by a processor, implements the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Method for adaptively quantizing dead zone in video coding

    CN113395518A

  • Image coding method and device, equipment and storage medium

    CN113766226A