Video processing method and device, electronic equipment, storage medium and program product

By performing rate-distortion processing on each coding unit block in the video frame, the filter parameter value with the minimum rate-distortion cost is determined, which solves the problem that deblocking filtering in the existing technology cannot guarantee objective coding performance and improves the overall effect of video coding.

CN115103199BActive Publication Date: 2026-03-31BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-16
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In existing video coding standards, although deblocking filtering algorithms improve the subjective quality of images, they cannot guarantee objective coding performance and cannot effectively solve the problem of discontinuity at coding block boundaries.

Method used

By performing rate-distortion processing on each coding unit block in the video frame, the target filtering parameter values ​​are determined to minimize the rate-distortion cost. The video frame is then encoded based on these parameter values, refining the filtering parameters to the coding unit level.

Benefits of technology

It improves the coding performance of deblocking filtering, enhances the objective quality of video coding, and ensures the continuity of coding block boundaries and the overall coding effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115103199B_ABST
    Figure CN115103199B_ABST
Patent Text Reader

Abstract

The present disclosure provides a video processing method, device, electronic equipment, computer readable storage medium and computer program product, relating to the technical field of video processing. The method comprises: obtaining a to-be-processed video frame, and determining a plurality of coding unit blocks contained in the to-be-processed video frame; performing rate-distortion processing on each coding unit block respectively to obtain a target filtering parameter value corresponding to each coding unit block, the target filtering parameter value being a parameter value that makes the corresponding coding unit block have a minimum rate-distortion cost; and performing encoding processing on the to-be-processed video frame according to the determined plurality of target filtering parameter values. The present disclosure refines the deblocking filtering parameter of the video frame from the sequence level or the frame level to the coding unit level, and the target filtering parameter value has the minimum rate-distortion cost, which can further improve the coding performance of deblocking filtering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of video processing technology, and in particular to a video processing method, video processing apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology

[0002] Video encoding refers to the method of converting a video file in one format into another using compression technology. During video encoding, because the transform quantization encoding processes of each encoding block are independent and the encoding parameters used differ, the encoding errors of each encoding block may also vary after compression. These differences lead to discontinuities at the boundaries of adjacent blocks, resulting in visually observable block artifacts.

[0003] Current video standards typically employ deblocking filtering (DBF) to address block artifacts. However, DBF works by using filtering criteria based on statistical laws and prior knowledge, along with corresponding filter templates for each criterion, to filter the boundary pixels of the reconstructed image coding blocks. While DBF can effectively improve the subjective quality of an image, it cannot guarantee the objective coding performance of the algorithm. Summary of the Invention

[0004] This disclosure provides a video processing method, video processing apparatus, electronic device, computer-readable storage medium, and computer program product to at least solve the problem in related technologies where deblocking filtering of video frames is usually performed at the frame level, which cannot guarantee the objective coding performance of deblocking filtering. The technical solution of this disclosure is as follows:

[0005] According to a first aspect of the present disclosure, a video processing method is provided, comprising: acquiring a video frame to be processed; determining a plurality of coding unit blocks contained in the video frame to be processed; performing rate-distortion processing on each of the coding unit blocks to obtain target filtering parameter values ​​corresponding to each coding unit block, wherein the target filtering parameter values ​​are parameter values ​​that minimize the rate-distortion cost of the corresponding coding unit block; and encoding the video frame to be processed according to the determined plurality of target filtering parameter values.

[0006] In an exemplary embodiment of this disclosure, the step of performing rate-distortion processing on each of the coding unit blocks to obtain target filter parameter values ​​corresponding to each coding unit block includes: performing rate-distortion processing on each of the coding unit blocks to obtain initial filter parameter values ​​corresponding to each coding unit block; obtaining associated filter parameter values ​​corresponding to each coding unit block, wherein the associated filter parameter values ​​are filter parameter values ​​corresponding to associated coding unit blocks that have an association relationship with the coding unit blocks; and determining the target filter parameter values ​​corresponding to each coding unit block based on the associated filter parameter values ​​and the initial filter parameter values.

[0007] In an exemplary embodiment of this disclosure, the step of performing rate-distortion processing on each of the coding unit blocks to obtain initial filter parameter values ​​corresponding to each coding unit block includes: obtaining a current coding unit block from a plurality of coding unit blocks; determining the filter parameters used in the rate-distortion processing, obtaining the parameter value range of the filter parameters, the parameter value range including a plurality of filter parameter values; determining the rate-distortion cost of the current coding unit block under each of the filter parameter values; taking the minimum value of the plurality of rate-distortion costs as the current rate-distortion cost; and taking the filter parameter value corresponding to the current rate-distortion cost as the initial filter parameter value.

[0008] In one exemplary embodiment of this disclosure, determining the rate-distortion cost of the current coding unit block under each of the filtering parameter values ​​includes: acquiring the original block data corresponding to the current coding unit block; performing deblocking filtering on the current coding unit block based on each of the filtering parameter values ​​to obtain multiple filtered block data; comparing the original block data with the multiple filtered block data respectively to determine the filtering distortion loss value of the current coding unit block under each of the filtering parameter values; determining the bitrate consumption value of the current coding unit block; and determining the rate-distortion cost under each of the filtering parameter values ​​based on the bitrate consumption value and the multiple filtering distortion loss values.

[0009] In an exemplary embodiment of this disclosure, determining the corresponding target filter parameter value for each of the coding unit blocks based on the associated filter parameter value and the initial filter parameter value includes: obtaining a current coding unit block from a plurality of coding unit blocks; if the current coding unit block has an associated coding unit block, determining the associated rate distortion cost of the associated coding unit block under the associated filter parameter value; determining the target filter parameter value based on the comparison result between the current rate distortion cost and the associated rate distortion cost; if the current coding unit block does not have an associated coding unit block, using the initial filter parameter value as the target filter parameter value.

[0010] In one exemplary embodiment of this disclosure, the number of associated coding unit blocks is one. Determining the target filtering parameter value based on the comparison between the current rate-distortion cost and the associated rate-distortion cost includes: obtaining the parameter multiplexing flag corresponding to the current coding unit block; if the current rate-distortion cost is less than or equal to the associated rate-distortion cost, then using the initial filtering parameter value as the target filtering parameter value and configuring the parameter multiplexing flag as a non-multiplexed flag; if the current rate-distortion cost is greater than the associated rate-distortion cost, then using the associated filtering parameter value as the target filtering parameter value and configuring the parameter multiplexing flag as a multiplexed flag.

[0011] In one exemplary embodiment of this disclosure, the number of associated coding unit blocks is multiple. Determining the target filtering parameter value based on the comparison result of the current rate-distortion cost and the associated rate-distortion cost includes: obtaining the parameter multiplexing flag corresponding to the current coding unit block; determining the minimum value of the current rate-distortion cost and the multiple associated rate-distortion costs; if the minimum value is the current rate-distortion cost, then the initial filtering parameter value is used as the target filtering parameter value, and the parameter multiplexing flag is configured as a non-multiplexed flag; if the minimum value is one of the multiple associated rate-distortion costs, then the associated filtering parameter value corresponding to the minimum associated rate-distortion cost is used as the target filtering parameter value, and the parameter multiplexing flag is set as a multiplexed flag.

[0012] In one exemplary embodiment of this disclosure, determining the plurality of coding unit blocks contained in the video frame to be processed includes: determining the video frame size and block step size of the video frame to be processed; and dividing the video frame to be processed according to the video frame size and the block step size to obtain the plurality of coding unit blocks.

[0013] In one exemplary embodiment of this disclosure, the step of encoding the video frame to be processed according to the determined plurality of target filter parameter values ​​includes: determining the parameter source of each target filter parameter value; determining the filter parameter value to be written according to the parameter source; and writing the filter parameter value to be written to the video bitstream corresponding to the video frame to be processed, so as to encode the video frame to be processed.

[0014] In an exemplary embodiment of this disclosure, determining the parameter source of each of the target filter parameter values ​​includes: obtaining the parameter multiplexing identifier of the coding unit block; the parameter multiplexing identifier includes a first identifier and a second identifier; if both the first identifier and the second identifier are unmultiplexed identifiers, then the parameter source is determined to be its own source; if the first identifier is a multiplexed identifier and the second identifier is an unmultiplexed identifier, then the parameter source is determined to be a first associated source; if the first identifier is an unmultiplexed identifier and the second identifier is a multiplexed identifier, then the parameter source is determined to be a second associated source.

[0015] In an exemplary embodiment of this disclosure, the step of determining the filter parameter value to be written based on the parameter source and writing the filter parameter value to be written to the video bitstream corresponding to the video frame to be processed includes: determining the coding unit block whose parameter source is itself as the unit block to be written; determining the target filter parameter value corresponding to the unit block to be written as the filter parameter value to be written; and writing the filter parameter value to be written to the corresponding position in the video bitstream.

[0016] According to a second aspect of the present disclosure, a video processing apparatus is provided, comprising: a coding block determination module configured to acquire a video frame to be processed and determine a plurality of coding unit blocks contained in the video frame to be processed; a filter value determination module configured to perform rate-distortion processing on each of the coding unit blocks to obtain target filter parameter values ​​corresponding to each coding unit block, wherein the target filter parameter values ​​are parameter values ​​that minimize the rate-distortion cost of the corresponding coding unit block; and a video encoding module configured to perform encoding processing on the video frame to be processed according to the determined plurality of target filter parameter values.

[0017] In one exemplary embodiment of this disclosure, the filter value determination module includes a target value determination module, which is configured to perform rate-distortion processing on each of the coding unit blocks to obtain initial filter parameter values ​​corresponding to each coding unit block; obtain associated filter parameter values ​​corresponding to each coding unit block, wherein the associated filter parameter values ​​are filter parameter values ​​corresponding to associated coding unit blocks that have an association relationship with the coding unit blocks; and determine the target filter parameter values ​​corresponding to each of the coding unit blocks based on the associated filter parameter values ​​and the initial filter parameter values.

[0018] In an exemplary embodiment of this disclosure, the target value determination module includes an initial value determination unit, which is configured to perform: obtaining a current coding unit block from a plurality of coding unit blocks; determining the filtering parameters used in the rate-distortion processing, obtaining a parameter value range of the filtering parameters, the parameter value range including a plurality of filtering parameter values; determining the rate-distortion cost of the current coding unit block under each of the filtering parameter values; taking the minimum value of the plurality of rate-distortion costs as the current rate-distortion cost; and taking the filtering parameter value corresponding to the current rate-distortion cost as the initial filtering parameter value.

[0019] In an exemplary embodiment of this disclosure, the initial value determination unit includes a distortion cost determination subunit, which is configured to perform: acquiring the original block data corresponding to the current coding unit block; performing deblocking filtering on the current coding unit block based on each of the filtering parameter values ​​to obtain multiple filtered block data; comparing the original block data with the multiple filtered block data respectively to determine the filtering distortion loss value of the current coding unit block under each of the filtering parameter values; determining the bitrate consumption value of the current coding unit block; and determining the rate distortion cost under each of the filtering parameter values ​​based on the bitrate consumption value and the multiple filtering distortion loss values.

[0020] In an exemplary embodiment of this disclosure, the target value determination module includes a target value determination unit, which is configured to perform: obtaining a current coding unit block from a plurality of coding unit blocks; if the current coding unit block has an associated coding unit block, determining the association rate distortion cost of the associated coding unit block under the association filter parameter value; determining the target filter parameter value based on a comparison between the current rate distortion cost and the association rate distortion cost; and if the current coding unit block does not have an associated coding unit block, using the initial filter parameter value as the target filter parameter value.

[0021] In one exemplary embodiment of this disclosure, the number of associated coding unit blocks is one, and the target value determination unit includes a first determination subunit, which is configured to perform: obtaining the parameter multiplexing flag corresponding to the current coding unit block; if the current rate distortion cost is less than or equal to the associated rate distortion cost, then using the initial filter parameter value as the target filter parameter value and configuring the parameter multiplexing flag as a non-multiplexed flag; if the current rate distortion cost is greater than the associated rate distortion cost, then using the associated filter parameter value as the target filter parameter value and configuring the parameter multiplexing flag as a multiplexed flag.

[0022] In an exemplary embodiment of this disclosure, the number of associated coding unit blocks is multiple, and the target value determination unit includes a second determination subunit. The second determination subunit is configured to perform: obtaining the parameter multiplexing flag corresponding to the current coding unit block; determining the minimum value of the current rate distortion cost and the multiple associated rate distortion costs; if the minimum value is the current rate distortion cost, then using the initial filter parameter value as the target filter parameter value and configuring the parameter multiplexing flag as a non-multiplexed flag; if the minimum value is one of the multiple associated rate distortion costs, then using the associated filter parameter value corresponding to the minimum associated rate distortion cost as the target filter parameter value and setting the parameter multiplexing flag as a multiplexed flag.

[0023] In one exemplary embodiment of this disclosure, the coding block determination module includes a coding block determination unit, which is configured to perform: determining the video frame size and block step size of the video frame to be processed; and dividing the video frame to be processed according to the video frame size and the block step size to obtain a plurality of coding unit blocks.

[0024] In one exemplary embodiment of this disclosure, the video encoding module includes a video encoding unit configured to perform: determining the parameter source of each of the target filter parameter values; determining the filter parameter value to be written according to the parameter source; and writing the filter parameter value to be written to the video bitstream corresponding to the video frame to be processed, so as to encode the video frame to be processed.

[0025] In an exemplary embodiment of this disclosure, the video encoding unit includes a parameter source determination subunit, which is configured to perform: obtaining a parameter multiplexing identifier bit of the encoding unit block; the parameter multiplexing identifier bit includes a first identifier bit and a second identifier bit; if both the first identifier bit and the second identifier bit are unmultiplexed identifiers, then the parameter source is determined to be its own source; if the first identifier bit is a multiplexed identifier and the second identifier bit is an unmultiplexed identifier, then the parameter source is determined to be a first associated source; if the first identifier bit is an unmultiplexed identifier and the second identifier bit is a multiplexed identifier, then the parameter source is determined to be a second associated source.

[0026] In one exemplary embodiment of this disclosure, the video encoding unit includes a video encoding subunit, which is configured to perform: determining the encoding unit block whose parameters originate from itself as the unit block to be written; determining the target filter parameter value corresponding to the unit block to be written as the filter parameter value to be written; and writing the filter parameter value to be written to the corresponding position of the video bitstream.

[0027] According to a third aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement the video processing method described in any of the preceding claims.

[0028] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided, wherein when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the video processing method described in any of the preceding claims.

[0029] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program / instructions, characterized in that the computer program / instructions, when executed by a processor, implement the video processing method described in any one of the above claims.

[0030] The technical solutions provided by the embodiments of this disclosure offer at least the following beneficial effects: On the one hand, when performing deblocking filtering on video frames, refining the filtering parameters from the sequence level or frame level to the coding unit level can further improve the coding performance of deblocking filtering. On the other hand, using the parameter values ​​that minimize the rate-distortion cost of the coding unit block as the target filtering parameter values ​​can effectively improve the coding performance of deblocking filtering.

[0031] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0032] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0033] Figure 1 This is a flowchart illustrating a video processing method according to an exemplary embodiment.

[0034] Figure 2 This is a schematic diagram illustrating a video frame division and DBF filtering order according to an exemplary embodiment.

[0035] Figure 3 This is a flowchart illustrating, according to an exemplary embodiment, the determination of the rate-distortion cost of the current coding unit block at a certain parameter value.

[0036] Figure 4 This is a flowchart illustrating, according to an exemplary embodiment, the determination of the target filtering parameter value of the current coding unit block when the number of associated coding unit blocks is one.

[0037] Figure 5This is a flowchart illustrating, according to an exemplary embodiment, the determination of the target filtering parameter value of the current coding unit block when there are multiple associated coding unit blocks.

[0038] Figure 6 This is a block diagram illustrating a video processing apparatus according to an exemplary embodiment.

[0039] Figure 7 A block diagram of an electronic device according to an exemplary embodiment of the present disclosure is shown schematically. Detailed Implementation

[0040] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0041] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0042] To address the block artifacts in video coding caused by the independent transform quantization processes of each coding block and the differences in the coding parameters used, existing video coding standards employ the Deep Beam Filter (DBF) method. However, because the filtering criteria and templates of the DBF algorithm are based on prior statistical rules, and rate-distortion optimization is not introduced during the filtering process, while the DBF algorithm can filter the boundary pixels of the reconstructed image coding blocks, it is difficult to guarantee the objective coding performance of the algorithm.

[0043] Based on this, the present disclosure provides a video processing method, a video processing apparatus, an electronic device, a computer-readable storage medium, and a computer program product.

[0044] Figure 1 This is a flowchart illustrating a video processing method according to an exemplary embodiment, such as... Figure 1As shown, the video processing method is used in a computer device. The computer device described in this disclosure may include mobile terminal devices such as mobile phones, tablets, laptops, PDAs, and personal digital assistants (PDAs), as well as fixed terminal devices such as desktop computers. This exemplary embodiment illustrates the application of the method to a computer device; it is understood that the method can also be applied to a server, and further to a system including both a computer device and a server, and implemented through the interaction between the computer device and the server. Specifically, it includes the following steps:

[0045] Step S110: Obtain the video frame to be processed and determine the multiple coding unit blocks contained in the video frame to be processed;

[0046] Step S120: Rate distortion processing is performed on each coding unit block to obtain the target filtering parameter value corresponding to each coding unit block. The target filtering parameter value is the parameter value that minimizes the rate distortion cost of the corresponding coding unit block.

[0047] Step S130: Encode the video frame to be processed according to the determined multiple target filtering parameter values.

[0048] According to the video processing method disclosed herein, on the one hand, when performing deblocking filtering on video frames, refining the filtering parameters from the sequence level or frame level to the coding unit level can further improve the coding performance of deblocking filtering. On the other hand, using the parameter values ​​that minimize the rate-distortion cost of the coding unit block as the target filtering parameter values ​​can effectively improve the coding performance of deblocking filtering.

[0049] The video processing method in this example embodiment will be further explained below.

[0050] In step S110, the video frame to be processed is obtained, and the multiple coding unit blocks contained in the video frame to be processed are determined.

[0051] In some exemplary embodiments of this disclosure, the video frame to be processed can be a video frame in a video to be encoded, and the video to be encoded can be composed of multiple video frames to be processed. The encoding unit block can be an encoding unit obtained by dividing the video frame to be processed into blocks.

[0052] Currently, when encoding video, deblocking filtering can be used to address the blockiness issue. The filtering parameters in the DBF algorithm can be used to adjust the filtering strength. These parameters are typically sequence-level or frame-level, meaning an entire sequence or frame in the video uses the same filtering parameter value. However, the image texture within a video frame sequence is highly complex, making it difficult to guarantee optimal filtering for every frame or even any single image block within a frame. Therefore, this embodiment proposes determining corresponding filtering parameters for each coding unit block (LCU block) during DBF processing of video frames to perform deblocking filtering on the video frames.

[0053] Before determining the corresponding filtering parameters for each coding unit block, all coding unit blocks contained in the video frame to be processed can be determined first. The coding unit block can usually be the largest coding unit (LCU) obtained after dividing the video frame to be processed.

[0054] In one exemplary embodiment of this disclosure, the video frame size and block step size of the video frame to be processed are determined; the video frame to be processed is divided according to the video frame size and block step size to obtain multiple coding unit blocks.

[0055] The video frame size can be the image size corresponding to the video frame to be processed, and the video frame size can be represented by the corresponding length and width in pixels. The block step size can be a predefined block size. For example, commonly used LCU sizes can include: 128x128, 64x64, 32x32, and 16x16, etc., all in units of 1 pixel.

[0056] Before segmenting the video frame to be processed, the segmentation step size, i.e., the LCU segmentation size, can be predefined in the encoder. For the acquired video frame to be processed, the corresponding video frame size can be determined first, and then the video frame to be processed can be evenly divided into several non-overlapping LCU blocks using the predefined segmentation step size (i.e., the size of one LCU) as the unit. (Reference) Figure 2 , Figure 2 This is a schematic diagram illustrating video frame division and DBF filtering order according to an exemplary embodiment. For example, Figure 2 The video frame to be processed has a width of 1280 pixels and a height of 1024 pixels. The LCU size predefined in the encoder is 128x128 pixels. Therefore, the video frame to be processed can be divided into 10*8=80 LCUs. After dividing the video frame to be processed into multiple coding unit blocks, the parameter values ​​used by DBF can be determined at the coding unit block level.

[0057] In step S120, rate-distortion processing is performed on each coding unit block to obtain the target filtering parameter value corresponding to each coding unit block. The target filtering parameter value is the parameter value that minimizes the rate-distortion cost of the corresponding coding unit block.

[0058] In some exemplary embodiments of this disclosure, rate-distortion processing, also known as rate-distortion optimization (RDO), is a method for improving the quality of compressed video. Rate-distortion processing refers to the process of optimizing the amount of distortion (video quality loss) for the amount of data (rate) required for video encoding. The target filter parameter value can be the filter parameter value used in the current coding unit block during video encoding.

[0059] After identifying all coding unit blocks (LCCs) in the video frame to be processed, rate-distortion processing can be performed on each LCC to determine the target filter parameter value corresponding to that LCC. The determined target filter parameter value minimizes the rate-distortion cost for each LCC, enabling the encoding of the video frame to be processed using the determined target filter parameter value.

[0060] In some exemplary embodiments of this disclosure, rate-distortion processing is performed on each coding unit block to obtain the initial filter parameter value corresponding to each coding unit block; the associated filter parameter value corresponding to each coding unit block is obtained, and the associated filter parameter value is the filter parameter value corresponding to the associated coding unit block that has an association relationship with the coding unit block; the target filter parameter value corresponding to each coding unit block is determined according to the associated filter parameter value and the initial filter parameter value of each coding unit block.

[0061] The initial filter parameter values ​​can be the filter parameter values ​​determined after processing the coding unit block using rate-distortion optimization, which achieve the optimal filtering effect for the coding unit block. The associated filter parameter values ​​can be the filter parameter values ​​corresponding to coding unit blocks that have a specific association with the current coding unit block. The associated coding unit block can be a coding unit block that has a specific association with the current coding unit block.

[0062] When determining the target filter parameter values ​​for each coding unit block, rate-distortion optimization can be performed on the coding unit block first to obtain initial filter parameter values. Additionally, the associated filter parameter values ​​corresponding to that coding unit block can be obtained, and the parameter value that minimizes the rate-distortion cost between the initial and associated filter parameter values ​​can be used as the target filter parameter value. Since the determined target filter parameter values ​​minimize the rate-distortion cost for each coding unit block, using these determined target filter parameter values ​​to encode the video frames to be processed can improve the coding performance of the DBF algorithm.

[0063] When determining the initial filter parameter values ​​for each coding unit block, rate-distortion optimization can be introduced into the DBF algorithm. Since DBF includes two filtering methods—strong filtering and ordinary filtering—and ordinary filtering further includes two filtering methods, the difference between strong filtering and the two ordinary filtering methods lies in their corresponding filter coefficients. The DBF algorithm typically introduces a deblocking filter threshold control parameter (TC parameter) and a deblocking filter adjust parameter (Beta parameter) to adjust the filtering strength of the DBF.

[0064] Specifically, in the DBF algorithm, the beta and tc parameters jointly control the selection of the filtering method between strong filtering and normal filtering. For example, if normal filtering is selected, it determines which of the two normal filtering methods is used. Furthermore, the tc value also controls the maximum absolute value of the filter compensation. For instance, if the value of pixel A in the image before filtering is 100, and the value of pixel A in the image after filtering is 150, but the tc value controls the maximum pixel offset to be 20, then the filtered pixel value will be readjusted from 150 to 120. In this embodiment, by performing rate-distortion processing on each coding unit block separately, the initial filtering parameter values ​​corresponding to each coding unit block are determined, i.e., the optimal tc and beta parameter values.

[0065] In one exemplary embodiment of this disclosure, a current coding unit block is obtained from a plurality of coding unit blocks; the filtering parameters used for rate-distortion processing are determined, and the parameter value range of the filtering parameters is obtained, the parameter value range including a plurality of filtering parameter values; the rate-distortion cost of the current coding unit block under each filtering parameter value is determined; the minimum value of the plurality of rate-distortion costs is taken as the current rate-distortion cost; and the filtering parameter value corresponding to the current rate-distortion cost is taken as the initial filtering parameter value.

[0066] Here, "current coding unit block" can be the coding unit block currently undergoing rate-distortion processing. "Filtering parameters" can be the parameters used for deblocking filtering of the video frame to be processed; for example, filtering parameters can include tc and beta parameters. "Parameter value range" can be the numerical range corresponding to the specific values ​​of the filtering parameters. "Filtering parameter value" can be the specific numerical value corresponding to the filtering parameters. "Rate-distortion cost" can be the distortion cost determined after rate-distortion optimization processing of each coding unit block in the video frame to be processed. "Current rate-distortion cost" can be the rate-distortion cost corresponding to the current coding unit block.

[0067] Continue to refer to Figure 2 In actual encoding, DBF processing performs filtering on a per-LCU basis, such as... Figure 1As shown by the middle arrow, the DBF processing method can filter LCU blocks separately from left to right and from top to bottom. The same order can be used when performing rate-distortion processing on the coding unit blocks contained in the video frame to be processed. One of the identified coding unit blocks is selected as the current coding unit block, and the pre-determined filtering parameters used for rate-distortion processing of the current coding block, namely the tc parameter and the beta parameter, are obtained.

[0068] Obtain the value ranges for the `tc` and `beta` parameters. For example, the value range for the `tc` parameter could be [min_tc_value, max_tc_value], and the value range for the `beta` parameter could be [min_beta_value, max_beta_value]. Here, `min_beta_value` and `min_tc_value` can be the minimum values ​​of the `beta` and `tc` parameters set in the deblocking filter standard; for example, `min_beta_value` and `min_tc_value` can be set to 0 and 0 respectively. Similarly, `max_beta_value` and `max_tc_value` can be the maximum values ​​of the `beta` and `tc` parameters set in the deblocking filter standard; for example, `max_beta_value` and `max_tc_value` can be set to 6 and 6 respectively. The determined parameter value ranges include the specific values ​​of multiple `beta` and `tc` parameters.

[0069] After determining all possible values ​​for the tc and beta parameters, the rate-distortion cost of the current coding unit block can be calculated for each parameter value. Then, the minimum value among the calculated rate-distortion costs is determined as the current rate-distortion cost, and the filter parameter values ​​used for the current rate-distortion cost are used as the initial filter parameter values ​​for the current coding unit block. Through this process, rate-distortion processing can be performed on each coding unit block in the video frame to be processed.

[0070] In one exemplary embodiment of this disclosure, the original block data corresponding to the current coding unit block is obtained; the current coding unit block is deblocked based on each filtering parameter value to obtain multiple filtered block data; the original block data is compared with the multiple filtered block data to determine the filtering distortion loss value of the current coding unit block under each filtering parameter value; the bitrate consumption value of the current coding unit block is determined, and the rate distortion cost under each filtering parameter value is determined based on the bitrate consumption value and the multiple filtering distortion loss values.

[0071] Here, the original block data can be the relevant data corresponding to the current coding unit block before deblocking filtering. The filtered block data can be the relevant data corresponding to the current coding unit block after deblocking filtering. The filtering distortion loss value can be the loss value of image pixels after filtering the current coding unit block. The bitrate consumption value can be the consumption value generated when writing the filtering parameter values ​​into the video bitstream.

[0072] After determining all possible values ​​for the ta and beta parameters, the rate-distortion cost of the current coding unit block under each parameter value can be calculated, thus determining the current rate-distortion cost. (Reference) Figure 3 , Figure 3 This is a flowchart illustrating, according to an exemplary embodiment, the determination of the rate-distortion cost of the current coding unit block at a certain parameter value. In step S310, the original block data corresponding to the current coding unit block is obtained. Since both the beta parameter and the ta parameter correspond to multiple parameter values, i and j can be used to represent different beta parameter values ​​and ta parameter values, respectively. When beta = i and tc = j, the original block data can be represented by Y(i,j).

[0073] In step S320, deblocking filtering is performed on the current coding unit block based on each filtering parameter value to obtain multiple filtered block data. When beta = i and tc = j, after deblocking filtering on the current coding unit block using this filtering parameter value, the corresponding filtered block data Y'(i,j) is obtained.

[0074] In step S330, the original block data is compared with multiple filter block data to determine the filtering distortion loss value of the current coding unit block under each filtering parameter value. After determining the original block data and the filter block data, the filtering distortion loss value dist corresponding to the current coding block when beta = i and tc = j can be further determined, as shown in Formula 1.

[0075]

[0076] Where W and H are the width and height of the current coding unit block (LCU), respectively; (i,j) are the coordinates within the LCU block; Y and Y' are the original block data and the filtered block data, respectively, i.e., the pixel values ​​before and after DBF filtering. According to Equation 1, the filtering distortion loss value dist can be the sum and variance between the pixels before and after filtering in the current LCU.

[0077] In step S340, the bitrate consumption value of the current coding unit block is determined, and the rate-distortion cost under each filtering parameter value is determined based on the bitrate consumption value and multiple filtering distortion loss values. After determining the filtering distortion loss values, the bitstream consumption value (rate) corresponding to the current coding unit block can be further determined. The bitstream consumption value can be determined by the bitrate estimation function bitEstimateFunc() predefined in the encoder, i.e., rate = bitEstimateFunc(value). Here, value is a natural number, and bitEstimateFunc() is a user-defined bitrate estimation function in the encoder. The function's purpose is to estimate the number of bits (rate) consumed in writing that value into the bitstream for a given natural number value.

[0078] After determining the filtering distortion loss value and the bit rate consumption value when beta = i and tc = j, the rate distortion cost corresponding to the current coding unit block can be determined based on them, as shown in Formula 2.

[0079] cost=dist+lambda*rate (formula 2)

[0080] Where cost can be the rate-distortion cost corresponding to the current LCU when beta = i and tc = j; dist can be the filter distortion loss value corresponding to the current LCU when beta = i and tc = j; lambda can be a pre-set constant, which is usually specified by specific encoding parameters in the encoder; rate can be the bitstream consumption value corresponding to the current LCU when beta = i and tc = j.

[0081] Through the above processing method, the rate-distortion cost corresponding to each coding unit block under different parameter values ​​can be determined. The minimum cost value (best_cost) among the determined rate-distortion costs is used as the filter parameter value, thus determining the optimal beta and tc values ​​for each coding unit block, denoted as best_beta and best_tc, respectively. The determined best_beta and best_tc values ​​for each coding unit block need to be written into the bitstream for video encoding. Considering that encoding beta and tc values ​​for each LCU would consume too much bitrate, and considering the correlation between the current LCU and surrounding LCUs, this embodiment proposes a parameter merging method to save bitrate and further improve encoding performance.

[0082] In other words, before determining whether to encode the filter parameter values ​​(i.e., beta and tc values) of the current coding unit block, the associated filter parameter values ​​corresponding to each coding unit block can be obtained first. It is then determined whether the determined associated filter parameter values ​​can be reused by the coding unit block. If the associated filter parameter values ​​can be reused by the coding unit block, they are used as the target filter parameter values. If the associated filter parameter values ​​cannot be reused by the coding unit block, the initial filter parameter values ​​are used as the target filter parameter values.

[0083] In one exemplary embodiment of this disclosure, a current coding unit block is obtained from a plurality of coding unit blocks; if the current coding unit block has an associated coding unit block, the correlation rate distortion cost of the associated coding unit block under the correlation filter parameter value is determined; based on the comparison result between the current rate distortion cost and the correlation rate distortion cost, the target filter parameter value is determined; if the current coding unit block does not have an associated coding unit block, the initial filter parameter value is used as the target filter parameter value.

[0084] Among them, the correlation rate distortion cost can be the distortion cost obtained after rate distortion optimization processing of the correlation coding unit block.

[0085] Before determining the target filter parameter values, a coding unit block can be selected as the current coding unit block, and it can be determined whether the current coding unit block has any associated coding unit blocks. (Continue to refer to...) Figure 2 , Figure 2 The arrows indicate the processing order of DBF filtering on the coded unit blocks in the video frame to be processed, starting from... Figure 2 As can be seen from the diagram, in this embodiment, DBF filtering of multiple coding unit blocks is performed in a left-to-right and top-to-bottom order. The filtering parameter values ​​on the left and top of a coding unit block are obtained before the DBF filtering is determined for that coding unit block.

[0086] In this embodiment, the upper and left adjacent coding unit blocks of the current coding unit block can be considered as associated coding unit blocks. For the current coding unit block, if the current coding unit block is an associated coding unit block, the association rate-distortion cost of the associated coding unit block under the association filter parameter value is determined. For example, if both the left and upper LCUs of the current coding unit block exist, the corresponding association rate-distortion costs for each can be obtained and denoted as cost_left and cost_up, respectively. The determined association rate-distortion cost is compared with the current rate-distortion cost to obtain the comparison result, and the target filter parameter value is determined based on the comparison result.

[0087] If the current coding unit block has no associated coding unit block—for example, the first coding unit block in the video frame to be processed that undergoes DBF processing—there is no associated unit block; or, for example, the coding unit block in the first row of the video frame to be processed has no adjacent coding unit block above it, and the coding unit block in the first column of the video frame to be processed has no adjacent coding unit block to its left—then the associated filter parameter value corresponding to the current coding unit block will be NULL. Therefore, the initial filter parameter value of the current coding unit block can be used as the target filter parameter value. The specific calculation process of the initial filter parameter value has been explained in the rate-distortion processing process and will not be repeated here.

[0088] It will be readily understood by those skilled in the art that an associated coding unit block can also be a coding unit block that has other associated relationships with the current coding unit block. For example, an associated coding unit block can be a coding block that is diagonally adjacent to the current coding unit block on its upper left, or it can be a coding block that is diagonally adjacent to the current coding unit block on its upper right. All of the above situations fall within the protection scope of this disclosure. In addition, when the DBF processing order of the video frames to be processed changes, the method for determining the associated coding unit block can also change accordingly. All of the above technical solutions are within the protection scope of this disclosure.

[0089] In one exemplary embodiment of this disclosure, the number of associated coding unit blocks is one. The target filtering parameter value is determined based on a comparison between the current rate-distortion cost and the associated rate-distortion cost, including: obtaining the parameter multiplexing flag corresponding to the current coding unit block; if the current rate-distortion cost is less than or equal to the associated rate-distortion cost, then the initial filtering parameter value is used as the target filtering parameter value, and the parameter multiplexing flag is configured as an unused flag; if the current rate-distortion cost is greater than the associated rate-distortion cost, then the associated filtering parameter value is used as the target filtering parameter value, and the parameter multiplexing flag is configured as a multiplexed flag.

[0090] The parameter reuse flag can be used to indicate whether the current coding unit block reuses the filter parameter values ​​from the associated coding unit block. The unreused flag can be used to indicate that the current coding unit block does not reuse the filter parameter values ​​from the associated coding unit block. The reused flag can be used to indicate that the current coding unit block reuses the filter parameter values ​​from the associated coding unit block.

[0091] If the current coding unit block has only one associated coding unit block, it can be done through Figure 4 The processing steps shown determine the target filter parameter values. (Reference) Figure 4 In step S410, the parameter multiplexing flag corresponding to the current coding unit block is obtained. The parameter multiplexing flag can be used to indicate whether the current coding unit block can reuse the filter parameter values ​​in the associated coding unit block.

[0092] In step S420, if the current rate-distortion cost is less than or equal to the correlation rate-distortion cost, the initial filtering parameter value is used as the target filtering parameter value, and the parameter reuse flag is configured as a non-reuse flag. `lefLcuAvail` and `UpLcuAvail` represent whether the LCU to the left and above the current LCU exist, respectively. For example, if the LCU to the left of the current LCU exists but the LCU above it does not, the beta and tc parameter values ​​of the left LCU can be reused for filtering, and the correlation rate-distortion cost `cost_left` is calculated. If `min(cost_left, best_cost) = best_cost`, it means that the current LCU does not reuse the beta and tc parameter values ​​of the left LCU. Therefore, the determined initial filtering parameter value can be used as the target filtering parameter value, and the parameter reuse flag `merge_left_flag` is set to 0.

[0093] If the LCU above the current LCU exists but the LCU to the left does not, then the beta and tc parameter values ​​of the above LCU are reused for filtering, and the correlation rate distortion cost, cost_up, is calculated. If min(cost_up, best_cost) = best_cost, it means that the current LCU does not reuse the beta and tc parameter values ​​of the above LCU. Therefore, the determined initial filtering parameter values ​​can be used as the target filtering parameter values, and the parameter reuse flag merge_up_flag is set to 0. Through the above processing steps, it can be determined whether the current coding unit block needs to reuse parameters.

[0094] In step S430, if the current rate-distortion cost is greater than the correlation rate-distortion cost, then the correlation filter parameter value is used as the target filter parameter value, and the parameter reuse flag is configured as a reuse flag. If the LCU to the left of the current LCU exists and the LCU above it does not exist, and min(cost_left, best_cost) = cost_left, it means that the current LCU can reuse the beta parameter value and tc parameter value of the left LCU, that is, the correlation filter parameter value is used as the target filter parameter value, and the parameter reuse flag merge_left_flag is set to 1.

[0095] If the LCU above the current LCU exists and the LCU to the left does not exist, and min(cost_up, best_cost) = cost_up, it means that the current LCU can reuse the beta parameter value and tc parameter value of the LCU above it. That is, the correlation filter parameter value is used as the target filter parameter value, and the parameter reuse flag merge_up_flag is set to 1.

[0096] In one exemplary embodiment of this disclosure, there are multiple associated coding unit blocks. The target filtering parameter value is determined based on a comparison between the current rate-distortion cost and the associated rate-distortion cost. This includes: obtaining the parameter multiplexing flag corresponding to the current coding unit block; determining the minimum value between the current rate-distortion cost and the multiple associated rate-distortion costs; if the minimum value is the current rate-distortion cost, then the initial filtering parameter value is used as the target filtering parameter value, and the parameter multiplexing flag is configured as an unused flag; if the minimum value is one of the multiple associated rate-distortion costs, then the associated filtering parameter value corresponding to the minimum associated rate-distortion cost is used as the target filtering parameter value, and the parameter multiplexing flag is set as a multiplexed flag.

[0097] If the current coding unit block has multiple associated coding unit blocks, it can be done through Figure 5 The processing steps shown determine the target filter parameter values. (Reference) Figure 5 In step S510, the parameter multiplexing flag corresponding to the current coding unit block is obtained.

[0098] In step S520, the minimum value of the current rate-distortion cost and multiple associated rate-distortion costs is determined. In this embodiment, if both the upper LCU and the left LCU of the current coding unit block exist, the beta parameter value and tc parameter value of the left and upper LCUs can be reused sequentially for filtering, and the associated rate-distortion costs cost_left and cost_up can be calculated. The determined multiple associated rate-distortion costs are compared with the current rate-distortion cost, and the minimum rate-distortion cost is determined.

[0099] In step S530, if the minimum value is the current rate distortion cost, then the initial filter parameter value is used as the target filter parameter value, and the parameter reuse flag is configured as the unreused flag. For example, if min(cost_left, cost_up, best_cost) = best_cost, it means that the current LCU does not reuse the beta parameter value and tc parameter value of the associated LCU. Therefore, the parameter reuse flags merge_left_flag and merge_up_flag are both set to 0.

[0100] In step S540, if the minimum value is one of multiple correlation rate distortion costs, then the correlation filter parameter value corresponding to the minimum correlation rate distortion cost is taken as the target filter parameter value, and the parameter reuse flag is set to the reuse flag. For example, if min(cost_left, cost_up, best_cost) = cost_left, it means that the current LCU reuses the beta parameter value and tc parameter value of the left LCU. Therefore, the parameter reuse flag merge_left_flag is set to 1 and merge_up_flag is set to 0. If min(cost_left, cost_up, best_cost) = cost_up, it means that the current LCU reuses the beta parameter value and tc parameter value of the upper LCU. Therefore, the parameter reuse flag merge_left_flag is set to 0 and merge_up_flag is set to 1.

[0101] As shown in the above processing steps, when calculating cost_left and cost_right, it is unnecessary to calculate the bitrate consumption of beta and tc, because the beta and tc values ​​have already been calculated by the left LCU or the upper LCU. If the current LCU needs to reuse these two values ​​from one of the LCUs, it does not need to recompile these two values; it can be reused directly. However, the current LCU must first calculate best_cost, then compare best_cost with cost_left and cost_right, and obtain the comparison result. Through the above processing steps, it can be determined whether the current coding unit block needs to reuse parameters.

[0102] In step S130, the video frame to be processed is encoded according to the determined multiple target filtering parameter values.

[0103] In one exemplary embodiment of this disclosure, after determining the target filter parameter value corresponding to each coding unit block, the video frame to be processed can be encoded according to the target filter parameter value corresponding to each coding unit block to obtain the corresponding encoded file.

[0104] In one exemplary embodiment of this disclosure, the parameter source of each target filter parameter value is determined; the filter parameter value to be written is determined according to the parameter source, and the filter parameter value to be written is written to the video bitstream corresponding to the video frame to be processed, so as to encode the video frame to be processed.

[0105] The parameter source can be the specific source of the target filter parameter values. The filter parameter values ​​to be written can be the filter parameter values ​​to be written into the video stream. The video stream can be the data flow used by the video file per unit time, that is, the bitstream used when transmitting the video. Encoding processing can be the process of encoding the video to be processed to generate the corresponding encoded file.

[0106] Before encoding, the source of the target filter parameter values ​​for each coding unit block can be obtained. Specifically, the parameter source can be determined through the parameter multiplexing flag corresponding to that coding unit block. After determining the source of each target filter parameter value, the filter parameter values ​​to be written into the video stream can be identified and used as the filter parameter values ​​to be written. The filter parameter values ​​to be written are then written into the video stream corresponding to the video frame to be processed, for encoding of that video frame.

[0107] In an exemplary embodiment of this disclosure, a parameter multiplexing identifier bit of an encoding unit block is obtained; the parameter multiplexing identifier bit includes a first identifier bit and a second identifier bit; if both the first identifier bit and the second identifier bit are unmultiplexed identifiers, the parameter source is determined to be its own source; if the first identifier bit is a multiplexed identifier and the second identifier bit is an unmultiplexed identifier, the parameter source is determined to be a first associated source; if the first identifier bit is an unmultiplexed identifier and the second identifier bit is a multiplexed identifier, the parameter source is determined to be a second associated source.

[0108] The first flag bit can be a flag indicating whether the current coding unit block reuses the filter parameter value of the associated coding unit block at the first associated position. The second flag bit can be a flag indicating whether the current coding unit block reuses the filter parameter value of the associated coding unit block at the second associated position. "Self-source" can indicate that the filter parameter value of the current coding unit block is determined through a rate-distortion processing procedure. "First associated source" can indicate that the filter parameter value of the current coding unit block originates from the filter parameter value of the associated coding unit block at the first associated position. "Second associated source" can indicate that the filter parameter value of the current coding unit block originates from the filter parameter value of the associated coding unit block at the second associated position.

[0109] The source of parameters for a coding unit block can be determined using parameter multiplexing flags. The specific values ​​of the first and second flags in the parameter multiplexing flags are obtained. In this embodiment, the first flag can be an indicator of whether to multiplex the filter parameter values ​​of the left LCU, denoted as `merge_left_flag`. The second flag can be an indicator of whether to multiplex the filter parameter values ​​of the upper LCU, denoted as `merge_up_flag`.

[0110] If both the first and second flag bits of the current coding unit block are unreused, then the current LCU does not reuse the filter parameter values. Therefore, the parameter source can be determined as its own source, and the determined target filter parameter values ​​can be written into the video stream. Here, `merge_left_flag = 0` can indicate that the current LCU does not have a left LCU, or that the current LCU does not reuse the filter parameter values ​​of the left LCU. Similarly, `merge_up_flag = 0` can indicate that the current LCU does not have an upper LCU, or that the current LCU does not reuse the filter parameter values ​​of the upper LCU.

[0111] If the first flag of the current coding unit block is a multiplexed flag and the second flag is an unmultiplexed flag, then the current LCU multiplexes the filter parameter values ​​of the LCU to its left, and determines the parameter source as the first associated source. If the first flag of the current coding unit block is an unmultiplexed flag and the second flag is a multiplexed flag, then the current LCU multiplexes the filter parameter values ​​of the LCU above it, and determines the parameter source as the second associated source. If the parameter multiplexing flag of the current LCU is not 0, then the current LCU does not need to encode the beta parameter value and tc parameter value in the video bitstream to save bitstream consumption.

[0112] In one exemplary embodiment of this disclosure, a coding unit block whose parameter source is itself is determined as a unit block to be written; the target filter parameter value corresponding to the unit block to be written is determined as a filter parameter value to be written; and the filter parameter value to be written is written to the corresponding position in the video bitstream.

[0113] The unit block to be written can be a coding unit block in the video bitstream where the filter parameter values ​​are to be written. The corresponding position in the video bitstream can be the writing position of the filter parameter values ​​of a certain coding unit block in the video bitstream, which can be determined according to the corresponding position of the coding unit block in the video frame to be processed.

[0114] After determining the parameter source of each coding unit block, coding unit blocks whose parameter source is themselves can be selected as the unit blocks to be written. The target filter parameter values ​​corresponding to the unit blocks to be written are then determined as the filter parameter values ​​to be written, namely the beta parameter value and the tc parameter value to be written. Both the beta parameter value and the tc parameter value can be obtained using Context-based Adaptive Binary Arithmetic Coding (CABAC), bypass coding mode, and exponential Golomb coding.

[0115] Since the coding unit block has corresponding position information in the video frame to be processed, during the parameter writing process, the parameter values ​​to be written can also be written to the corresponding positions in the video bitstream according to the position information for video encoding. For example, during the encoding process, a matrix can be used to represent the writing positions of different parameter values. After adopting the above processing, it is not necessary to write the beta parameter value and tc parameter value of DBF into the sequence and frame level.

[0116] In summary, the process involves acquiring the video frame to be processed and identifying the multiple coding unit blocks contained within it. Rate-distortion processing is then applied to each coding unit block to obtain the target filtering parameter values ​​corresponding to each block. These target filtering parameters are those that minimize the rate-distortion cost for the corresponding coding unit block. The video frame is then encoded based on these determined target filtering parameter values. On one hand, refining the filtering parameters from the sequence or frame level to the coding unit level during deblocking filtering can further improve the coding performance of deblocking filtering. On the other hand, determining the target filtering parameter values ​​based on the initial and associated filtering parameter values ​​of each coding unit block enables parameter reuse. Furthermore, determining the filtering parameter values ​​for each coding unit block through parameter reuse can further reduce bitrate.

[0117] Figure 6 This is a block diagram of a video processing apparatus according to an exemplary embodiment. (Refer to...) Figure 6 The video processing device 600 may include an encoding block determination module 610, a filter value determination module 620, and a video encoding module 630.

[0118] Specifically, the coding block determination module 610 is configured to acquire the video frame to be processed and determine the multiple coding unit blocks contained in the video frame to be processed; the filter value determination module 620 is configured to perform rate-distortion processing on each coding unit block to obtain the target filter parameter value corresponding to each coding unit block, wherein the target filter parameter value is the parameter value that minimizes the rate-distortion cost of the corresponding coding unit block; and the video encoding module 630 is configured to encode the video frame to be processed according to the determined multiple target filter parameter values.

[0119] In one exemplary embodiment of this disclosure, the filter value determination module includes a target value determination module, which is configured to perform rate-distortion processing on each of the coding unit blocks to obtain initial filter parameter values ​​corresponding to each coding unit block; obtain associated filter parameter values ​​corresponding to each coding unit block, wherein the associated filter parameter values ​​are filter parameter values ​​corresponding to associated coding unit blocks that have an association relationship with the coding unit blocks; and determine the target filter parameter values ​​corresponding to each of the coding unit blocks based on the associated filter parameter values ​​and the initial filter parameter values.

[0120] In one exemplary embodiment of this disclosure, the target value determination module includes an initial value determination unit, which is configured to perform: obtaining a current coding unit block from a plurality of coding unit blocks; determining the filtering parameters used for rate-distortion processing, obtaining the parameter value range of the filtering parameters, the parameter value range including a plurality of filtering parameter values; determining the rate-distortion cost of the current coding unit block under each filtering parameter value; taking the minimum value of the plurality of rate-distortion costs as the current rate-distortion cost; and taking the filtering parameter value corresponding to the current rate-distortion cost as the initial filtering parameter value.

[0121] In one exemplary embodiment of this disclosure, the initial value determination unit includes a distortion cost determination subunit, which is configured to perform: obtaining the original block data corresponding to the current coding unit block; performing deblocking filtering on the current coding unit block based on each filtering parameter value to obtain multiple filtered block data; comparing the original block data with the multiple filtered block data respectively to determine the filtering distortion loss value of the current coding unit block under each filtering parameter value; determining the bitrate consumption value of the current coding unit block, and determining the rate-distortion cost under each filtering parameter value based on the bitrate consumption value and the multiple filtering distortion loss values.

[0122] In one exemplary embodiment of this disclosure, the target value determination module includes a target value determination unit, which is configured to perform: obtaining a current coding unit block from a plurality of coding unit blocks; if the current coding unit block has an associated coding unit block, determining the association rate-distortion cost of the associated coding unit block under the association filter parameter value; determining a target filter parameter value based on the comparison result between the current rate-distortion cost and the association rate-distortion cost; if the current coding unit block does not have an associated coding unit block, using the initial filter parameter value as the target filter parameter value.

[0123] In one exemplary embodiment of this disclosure, the number of associated coding unit blocks is one, and the target value determination unit includes a first determination subunit. The first determination subunit is configured to perform: obtaining the parameter multiplexing flag corresponding to the current coding unit block; if the current rate distortion cost is less than or equal to the associated rate distortion cost, then the initial filter parameter value is used as the target filter parameter value, and the parameter multiplexing flag is configured as an unused flag; if the current rate distortion cost is greater than the associated rate distortion cost, then the associated filter parameter value is used as the target filter parameter value, and the parameter multiplexing flag is configured as a multiplexed flag.

[0124] In one exemplary embodiment of this disclosure, there are multiple associated coding unit blocks, and the target value determination unit includes a second determination subunit. The second determination subunit is configured to perform the following: obtaining the parameter multiplexing flag corresponding to the current coding unit block; determining the minimum value of the current rate distortion cost and multiple associated rate distortion costs; if the minimum value is the current rate distortion cost, then the initial filter parameter value is used as the target filter parameter value, and the parameter multiplexing flag is configured as an unused flag; if the minimum value is one of the multiple associated rate distortion costs, then the associated filter parameter value corresponding to the minimum associated rate distortion cost is used as the target filter parameter value, and the parameter multiplexing flag is set as a multiplexed flag.

[0125] In one exemplary embodiment of this disclosure, the coding block determination module includes a coding block determination unit, which is configured to perform: determining the video frame size and block step size of the video frame to be processed; and dividing the video frame to be processed according to the video frame size and block step size to obtain multiple coding unit blocks.

[0126] In one exemplary embodiment of this disclosure, the video encoding module includes a video encoding unit configured to perform: determining the parameter source of each target filter parameter value; determining the filter parameter value to be written according to the parameter source; and writing the filter parameter value to be written to the video bitstream corresponding to the video frame to be processed, so as to encode the video frame to be processed.

[0127] In an exemplary embodiment of this disclosure, the video encoding unit includes a parameter source determination subunit, which is configured to perform: obtaining parameter multiplexing flags of the encoding unit block; the parameter multiplexing flags include a first flag and a second flag; if both the first flag and the second flag are unmultiplexed flags, the parameter source is determined to be its own source; if the first flag is a multiplexed flag and the second flag is an unmultiplexed flag, the parameter source is determined to be a first associated source; if the first flag is an unmultiplexed flag and the second flag is a multiplexed flag, the parameter source is determined to be a second associated source.

[0128] In one exemplary embodiment of this disclosure, the video coding unit includes a video coding subunit, which is configured to perform: determining a coding unit block whose parameter source is itself as a unit block to be written; determining the target filter parameter value corresponding to the unit block to be written as a filter parameter value to be written; and writing the filter parameter value to be written to the corresponding position in the video bitstream.

[0129] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0130] The following is for reference. Figure 7 To describe an electronic device 700 according to such an embodiment of the present disclosure. Figure 7 The electronic device 700 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0131] like Figure 7 As shown, the electronic device 700 is manifested in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, a bus 730 connecting different system components (including storage unit 720 and processing unit 710), and a display unit 740.

[0132] The storage unit stores program code that can be executed by the processing unit 710, causing the processing unit 710 to perform the steps described in the "Exemplary Methods" section above, according to various exemplary embodiments of this disclosure.

[0133] Storage unit 720 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 721 and / or cache memory 722, and may further include a read-only memory (ROM) 723.

[0134] Storage unit 720 may include a program / utility 724 having a set (at least one) program module 725, such program module 725 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0135] Bus 730 can represent one or more of several types of bus structures, including memory cell bus or memory cell controller, peripheral bus, graphics acceleration port, processing unit, or local bus using any of the multiple bus structures.

[0136] Electronic device 700 can also communicate with one or more external devices 770 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 700, and / or with any device that enables electronic device 700 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 750. Furthermore, electronic device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 760. As shown, network adapter 760 communicates with other modules of electronic device 700 via bus 730. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0137] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, which can be executed by a processor of the device to perform the video processing method described above. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0138] In an exemplary embodiment, a computer program product is also provided, including a computer program / instructions, characterized in that the computer program / instructions, when executed by a processor, implement the video processing method described in any one of the preceding embodiments.

[0139] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0140] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method of video processing, the method comprising: The method comprises the following steps: acquiring a to-be-processed video frame, determining a plurality of coding unit blocks contained in the to-be-processed video frame, the plurality of coding unit blocks being obtained by dividing the to-be-processed video frame according to a video frame size of the to-be-processed video frame and a block step; respectively performing rate-distortion processing on each of the coding unit blocks to obtain a target filter parameter value corresponding to each of the coding unit blocks, the target filter parameter value being a parameter value that makes the corresponding coding unit block have a minimum rate-distortion cost, the target filter parameter value being determined according to an initial filter parameter value corresponding to each of the coding unit blocks and an associated filter parameter value, the associated filter parameter value being a filter parameter value corresponding to an associated coding unit block having an association relationship with the coding unit block; performing encoding processing on the to-be-processed video frame according to the plurality of determined target filter parameter values; the step of respectively performing rate-distortion processing on each of the coding unit blocks to obtain a target filter parameter value corresponding to each of the coding unit blocks comprises the following steps: respectively performing rate-distortion processing on each of the coding unit blocks to obtain an initial filter parameter value corresponding to each of the coding unit blocks; acquiring an associated filter parameter value corresponding to each of the coding unit blocks; determining a target filter parameter value corresponding to each of the coding unit blocks according to the associated filter parameter value and the initial filter parameter value of each of the coding unit blocks; the step of determining a target filter parameter value corresponding to each of the coding unit blocks according to the associated filter parameter value and the initial filter parameter value of each of the coding unit blocks comprises the following steps: acquiring a current coding unit block from the plurality of coding unit blocks; if the current coding unit block has an associated coding unit block, determining an associated rate-distortion cost of the associated coding unit block under the associated filter parameter value; determining the target filter parameter value according to a comparison result of a current rate-distortion cost and the associated rate-distortion cost; if the current coding unit block does not have an associated coding unit block, taking the initial filter parameter value as the target filter parameter value.

2. The method of claim 1, wherein, the step of respectively performing rate-distortion processing on each of the coding unit blocks to obtain an initial filter parameter value corresponding to each of the coding unit blocks comprises the following steps: acquiring a current coding unit block from the plurality of coding unit blocks; determining a filter parameter used in the rate-distortion processing, acquiring a parameter value interval of the filter parameter, the parameter value interval comprising a plurality of filter parameter values; determining a rate-distortion cost of the current coding unit block under each of the filter parameter values; taking a minimum value of the plurality of rate-distortion costs as a current rate-distortion cost; taking a filter parameter value corresponding to the current rate-distortion cost as the initial filter parameter value.

3. The method of claim 2, wherein, the step of determining a rate-distortion cost of the current coding unit block under each of the filter parameter values comprises the following steps: acquiring original block data corresponding to the current coding unit block; performing deblocking filtering processing on the current coding unit block based on each of the filter parameter values to obtain a plurality of filtered block data; comparing the original block data with the plurality of filtered block data respectively to determine a filtering distortion loss value of the current coding unit block under each of the filter parameter values; determining a rate-distortion cost of each of the filter parameter values according to a code rate consumption value of the current coding unit block and a plurality of the filter distortion loss values.

4. The method of claim 1, wherein, The number of the associated coding unit blocks is one, and the determining of the target filter parameter value according to a comparison result of the current rate-distortion cost and the associated rate-distortion cost comprises: obtaining a parameter multiplexing identification bit corresponding to the current coding unit block; if the current rate-distortion cost is less than or equal to the associated rate-distortion cost, taking the initial filter parameter value as the target filter parameter value, and configuring the parameter multiplexing identification bit as an un-multiplexed identification; if the current rate-distortion cost is greater than the associated rate-distortion cost, taking the associated filter parameter value as the target filter parameter value, and configuring the parameter multiplexing identification bit as a multiplexed identification.

5. The method of claim 1, wherein, The number of the associated coding unit blocks is multiple, and the determining of the target filter parameter value according to a comparison result of the current rate-distortion cost and the associated rate-distortion cost comprises: obtaining a parameter multiplexing identification bit corresponding to the current coding unit block; determining a minimum value of the current rate-distortion cost and a plurality of the associated rate-distortion costs; if the minimum value is the current rate-distortion cost, taking the initial filter parameter value as the target filter parameter value, and configuring the parameter multiplexing identification bit as an un-multiplexed identification; if the minimum value is one of the plurality of the associated rate-distortion costs, taking an associated filter parameter value corresponding to the minimum associated rate-distortion cost as the target filter parameter value, and configuring the parameter multiplexing identification bit as a multiplexed identification.

6. The method of claim 1, wherein, The encoding processing of the to-be-processed video frame according to the determined plurality of the target filter parameter values comprises: determining a parameter source of each of the target filter parameter values; determining a to-be-written filter parameter value according to the parameter source, and writing the to-be-written filter parameter value into a video bitstream corresponding to the to-be-processed video frame to perform the encoding processing on the to-be-processed video frame.

7. The method of claim 6, wherein, The determining of the parameter source of each of the target filter parameter values comprises: obtaining a parameter multiplexing identification bit of the coding unit block; the parameter multiplexing identification bit comprises a first identification bit and a second identification bit; if both the first identification bit and the second identification bit are un-multiplexed identifications, determining that the parameter source is a self source; if the first identification bit is a multiplexed identification and the second identification bit is an un-multiplexed identification, determining that the parameter source is a first associated source; if the first identification bit is an un-multiplexed identification and the second identification bit is a multiplexed identification, determining that the parameter source is a second associated source.

8. The method of claim 6, wherein, The determining of the to-be-written filter parameter value according to the parameter source and the writing of the to-be-written filter parameter value into the video bitstream corresponding to the to-be-processed video frame comprise: determining a coding unit block with the self source as a to-be-written unit block; determining a target filter parameter value corresponding to the to-be-written unit block as the to-be-written filter parameter value; writing the to-be-written filter parameter value into a corresponding position of the video bitstream.

9. A video processing apparatus, comprising: ​ The coding block determination module is configured to perform obtaining a to-be-processed video frame, and determining a plurality of coding unit blocks contained in the to-be-processed video frame, the plurality of coding unit blocks being obtained by dividing the to-be-processed video frame according to a video frame size of the to-be-processed video frame and a block step length; The filter value determination module is configured to perform rate-distortion processing on each of the coding unit blocks respectively, to obtain a target filter parameter value corresponding to each of the coding unit blocks, the target filter parameter value being a parameter value that makes the corresponding coding unit block have a minimum rate-distortion cost, and the target filter parameter value being determined according to an initial filter parameter value corresponding to each of the coding unit blocks and an associated filter parameter value, the associated filter parameter value being a filter parameter value corresponding to an associated coding unit block having an association relationship with the coding unit block; The video coding module is configured to perform coding processing on the to-be-processed video frame according to the plurality of determined target filter parameter values. The filter value determination module is further configured to perform rate-distortion processing on each of the coding unit blocks respectively, to obtain an initial filter parameter value corresponding to each of the coding unit blocks. An associated filter parameter value corresponding to each of the coding unit blocks is obtained. A target filter parameter value corresponding to each of the coding unit blocks is determined according to the associated filter parameter value and the initial filter parameter value of the coding unit block. The target filter parameter value corresponding to each of the coding unit blocks is determined according to the associated filter parameter value and the initial filter parameter value of the coding unit block, including: A current coding unit block is obtained from the plurality of coding unit blocks. If the current coding unit block has an associated coding unit block, an associated rate-distortion cost of the associated coding unit block under the associated filter parameter value is determined. The target filter parameter value is determined according to a comparison result of a current rate-distortion cost and the associated rate-distortion cost. If the current coding unit block does not have an associated coding unit block, the initial filter parameter value is taken as the target filter parameter value.

10. An electronic device, comprising: Including: A processor; A memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the video processing method of any one of claims 1-8.

11. A computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the video processing method of any one of claims 1-8.

12. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instructions are executed by the processor to implement the video processing method of any one of claims 1-8.

Citation Information

Patent Citations

  • Image filtering method, device and equipment and storage medium

    CN111866507A

  • Optimization of Deblocking Filter Parameters

    US20140321552A1