Data processing method and video coding method

By dynamically calculating motion block matching parameters and adjusting motion block partitioning, the problem of decreased motion estimation accuracy in existing technologies is solved, achieving accurate matching and efficient filtering in the video encoding process.

CN121691670APending Publication Date: 2026-03-17阿里巴巴(上海)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511622238.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-06
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

When dealing with complex dynamic scenes, existing technologies suffer from decreased motion estimation accuracy, leading to motion block matching errors and filtering performance degradation, making it difficult to accurately reflect the true changing characteristics of motion blocks.

Method used

By determining the target video frame and the reference video frame, dynamic attribute data is calculated to dynamically adjust the motion block matching parameters, and motion block segmentation and filtering tasks are performed to achieve accurate matching and improve the accuracy of temporal filtering.

Benefits of technology

It improves the accuracy of motion block matching and temporal filtering in the video encoding process, and reduces the complexity of subsequent video frame encoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121691670A_ABST
    Figure CN121691670A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and a video coding method. The data processing method comprises the following steps: determining a target video frame and a reference video frame associated with the target video frame; and calculating dynamic attribute data according to at least one motion block region contained in the reference video frame, and ensuring that the dynamic attribute data can express the dynamic change condition of the motion block in the reference video frame. And determining a motion block matching parameter corresponding to the reference video frame based on the dynamic attribute data to realize dynamic calculation of the motion block matching parameter. And determining a target motion block in the target video frame based on the motion block matching parameter, and determining a plurality of candidate motion blocks in the reference video frame, thereby realizing motion block division on the target video frame and the reference video frame according to the motion block matching parameter obtained by real-time calculation. And determining a reference motion block matched with the target motion block in the plurality of candidate motion blocks to realize accurate matching of the reference motion block, and subsequently executing a filtering task corresponding to the target video frame based on the reference motion block.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of computer technology, and in particular to data processing methods and video encoding methods. Background Technology

[0002] Video technology is widely used in communications, entertainment, education, media, and healthcare, profoundly changing people's lifestyles. From video software, live streaming, and online courses to video conferencing and immersive video, video-related applications have permeated every aspect of human life. In video applications, storage and transmission are two key issues. During video encoding and processing, temporal filtering and motion compensation are crucial for improving compression efficiency and video quality.

[0003] In existing technologies, motion information is typically estimated by analyzing pixel changes between consecutive video frames, and motion block matching and segmentation are performed based on fixed parameters. However, when dealing with complex dynamic scenes, these methods often fail to accurately reflect the true changing characteristics of motion blocks, resulting in a significant decrease in motion estimation accuracy, leading to matching errors and degraded filtering performance. Therefore, a more effective data processing method is urgently needed to address these problems. Summary of the Invention

[0004] In view of the above, embodiments of this specification provide a data processing method. One or more embodiments of this specification also relate to a video encoding method, a data processing apparatus, a video encoding apparatus, a computing device, a computer-readable storage medium, and a computer program product, to address the technical deficiencies existing in the prior art.

[0005] According to a first aspect of the embodiments of this specification, a data processing method is provided, comprising: Determine the target video frame and the reference video frame associated with the target video frame; Dynamic attribute data is calculated based on at least one motion block region contained in the reference video frame, and motion block matching parameters corresponding to the reference video frame are determined based on the dynamic attribute data. Based on the motion block matching parameters, a target motion block is determined in the target video frame, and multiple candidate motion blocks are determined in the reference video frame; A reference motion block matching the target motion block is determined from multiple candidate motion blocks, and a filtering task corresponding to the target video frame is performed based on the reference motion block.

[0006] According to a second aspect of the embodiments of this specification, a video encoding method is provided, applied at an encoding end, comprising: In the initial video, a target video frame and a reference video frame associated with the target video frame are identified; Dynamic attribute data is calculated based on at least one motion block region contained in the reference video frame, and motion block matching parameters corresponding to the reference video frame are determined based on the dynamic attribute data. Based on the motion block matching parameters, a target motion block is determined in the target video frame, and multiple candidate motion blocks are determined in the reference video frame; A reference motion block matching the target motion block is determined from multiple candidate motion blocks, and a filtering task corresponding to the target video frame is performed based on the reference motion block to obtain the target filtered video frame. The target filtered video frame is encoded to obtain the target video corresponding to the initial video.

[0007] According to a third aspect of the embodiments of this specification, a data processing apparatus is provided, comprising: The first determining module is configured to determine a target video frame and a reference video frame associated with the target video frame; The calculation module is configured to calculate dynamic attribute data based on at least one motion block region contained in the reference video frame, and determine motion block matching parameters corresponding to the reference video frame based on the dynamic attribute data. The second determining module is configured to determine a target motion block in the target video frame based on the motion block matching parameters, and to determine a plurality of candidate motion blocks in the reference video frame. The execution module is configured to determine a reference motion block that matches the target motion block from among a plurality of candidate motion blocks, and to perform a filtering task corresponding to the target video frame based on the reference motion block.

[0008] According to a fourth aspect of the embodiments of this specification, a video encoding apparatus is provided, applied at an encoding end, comprising: The first determining module is configured to determine a target video frame and a reference video frame associated with the target video frame in the initial video. The calculation module is configured to calculate dynamic attribute data based on at least one motion block region contained in the reference video frame, and determine motion block matching parameters corresponding to the reference video frame based on the dynamic attribute data. The second determining module is configured to determine a target motion block in the target video frame based on the motion block matching parameters, and to determine a plurality of candidate motion blocks in the reference video frame. The execution module is configured to determine a reference motion block that matches the target motion block from among multiple candidate motion blocks, and to perform a filtering task corresponding to the target video frame based on the reference motion block to obtain the target filtered video frame; The encoding module is configured to encode the target filtered video frame to obtain the target video corresponding to the initial video.

[0009] According to a fifth aspect of the embodiments of this specification, a computing device is provided, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the above-described data processing method.

[0010] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of the data processing method described above.

[0011] According to a seventh aspect of the embodiments of this specification, a computer program product is provided, including a computer program or instructions that, when executed by a processor, implement the steps of the data processing method described above.

[0012] This specification provides a data processing method according to one embodiment, which involves determining a target video frame and a reference video frame associated with the target video frame. Dynamic attribute data is calculated based on at least one motion block region contained in the reference video frame to ensure that the dynamic attribute data can express the dynamic changes of the motion blocks in the reference video frame. Motion block matching parameters corresponding to the reference video frame are determined based on the dynamic attribute data, realizing the dynamic calculation of the motion block matching parameters. A target motion block is determined in the target video frame based on the motion block matching parameters, and multiple candidate motion blocks are determined in the reference video frame, realizing motion block segmentation of the target and reference video frames according to the motion block matching parameters obtained in real time. A reference motion block matching the target motion block is determined from the multiple candidate motion blocks, achieving accurate matching of the reference motion block. Subsequently, filtering tasks corresponding to the target video frame are performed based on the reference motion block, improving the accuracy of temporal filtering and reducing the complexity of subsequent video frame encoding. Attached Figure Description

[0013] Figure 1 This is a flowchart illustrating a data processing method provided in one embodiment of this specification; Figure 2 This is a schematic diagram of motion block partitioning for a data processing method provided in one embodiment of this specification; Figure 3 This is a schematic diagram of the motion estimation process of a data processing method provided in one embodiment of this specification; Figure 4 This is a flowchart illustrating the processing procedure of a data processing method provided in one embodiment of this specification. Figure 5 This is a flowchart illustrating a video encoding method provided in one embodiment of this specification; Figure 6 This is a schematic diagram of the structure of a data processing apparatus provided in one embodiment of this specification; Figure 7 This is a schematic diagram of the structure of a video encoding device provided in one embodiment of this specification; Figure 8 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0014] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0015] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0016] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0017] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0018] The technical solutions provided in this application can employ deep learning models with relatively large parameter scales. However, this large model is merely an example; this application does not limit the number of model parameters supported by the deep learning model used, aiming to meet actual needs. The deep learning models involved in this application can be artificial intelligence-based language models (LM) or multimodal models (MM).

[0019] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0020] MCTF (Motion Compensated Temporal Filter): A video encoding preprocessing technique that effectively reduces the bitrate of video encoding and optimizes encoding performance by enhancing the correlation between content between frames.

[0021] Motion estimation: The process of searching for the matching block with the smallest error to the current block within a specified range of reference video frames. The error is measured by the SSE (Skip Separation) of pixels between the current block and its reference block (the matching block in the reference video frame). This process can output the SSE value between the current block and each matching block in the reference video frame, as well as the MV (Motion Value) describing the positional offset between them.

[0022] SSE: Sum of Squared Errors, is a metric used to measure the matching difference between two image blocks. It represents the sum of the squares of all pixel errors between the coded block and its reference block. The smaller the SSE value, the more similar the two blocks are, and the more accurate the prediction.

[0023] MV: Motion Vector, motion information between the current frame and a reference video frame, representing the horizontal and vertical offset from the reference video frame to the current frame.

[0024] Bitrate (or bit depth): The number of encoded bits per unit of time, i.e., the ratio of the number of bits in the video stream to the playback time. For the same original video, a lower bitrate after encoding indicates a more significant compression effect and a more effective removal of information redundancy.

[0025] Distortion: The difference between the original video signal and the reconstructed video signal after encoding, transmission, and decoding.

[0026] Basic motion estimation block: The smallest processing unit for motion search and block matching in the current frame, such as an 8×8 pixel image block. Let the size of the basic motion estimation block be N×M, where N and M are the width and height of the basic motion estimation block, respectively, in integer pixels. All pixels in each basic motion estimation block within an image block share one MV.

[0027] Basic motion vector storage block: The smallest storage block for motion vectors in the current frame. A basic motion estimation block spatially corresponds to multiple basic motion vector storage blocks, each independently recording the motion vectors within its own storage block. Let the size of the basic motion vector storage block be X×Y, where X and Y are the width and height of the storage block, respectively, in integer pixels. The width and height of the basic motion estimation block are integer multiples of X and Y, respectively.

[0028] Motion field: A matrix formed by the spatial layout of the MVs in the storage blocks of each basic motion vector in the current frame.

[0029] MV Analysis Window: A local spatial region in the motion field containing the MVs of multiple adjacent basic motion estimation blocks. The MVs within the MV analysis window can be used to evaluate the motion consistency within the corresponding spatial region.

[0030] To address the aforementioned technical problems, this specification provides a data processing method, a video encoding method, a data processing apparatus, a video encoding apparatus, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.

[0031] Video is not only an important tool for information transmission, but it also makes communication more vivid and persuasive. Video technology is widely used in communication, entertainment, education, publicity, and healthcare, profoundly changing people's lifestyles. From video software, live streaming, and online courses to video conferencing and immersive video, video-related applications have permeated every aspect of human life. Storage and transmission are two key issues in video applications. Because raw video files are massive in size, they typically occupy a large amount of storage space. Therefore, to optimize storage and transmission efficiency, videos are usually encoded to remove redundant information, thereby reducing the data volume. Video encoding plays an indispensable role in the modern digital environment; by compressing video files, it makes them easier to store, transmit, and process, thus significantly improving user experience and resource utilization.

[0032] MCTF (Motion Coding Tolerance) is a key technology in encoders. It utilizes filtering to remove noise while enhancing the temporal correlation between adjacent frames, thereby effectively reducing the bitrate and improving coding performance. It mainly consists of two stages: motion estimation and motion compensation. In MCTF, the frame to be processed can use up to four frames before and after it as reference video frames. The motion estimation stage performs an integer-pixel search on the reference video frames using a basic motion estimation block size of 16×16, followed by a sub-pixel search using 8×8 blocks as units, finding the best matching block with the smallest error in each reference video frame. The motion compensation stage uses 8×8 blocks as processing units, performing a weighted average calculation on each unit and all its corresponding compensation blocks to obtain the filtered pixel value, which is then used in subsequent encoding processes.

[0033] In fact, the use of different reference video frames in the MCTF process produces different coding effects. In scenes with stable visuals and smooth motion, the content of reference video frames is mostly similar, and using more reference video frames can reduce the bitrate, thereby improving coding efficiency. However, if the content of the reference video frames differs significantly from that of the frame to be processed, using these reference video frames for weighting during motion compensation may introduce significant distortion, thus reducing coding efficiency. Furthermore, the basic motion estimation block size also affects the matching accuracy of motion estimation, and consequently significantly impacts video compression performance. Theoretically, for video frames with relatively consistent motion across different areas of the frame, a larger basic motion estimation block size should be chosen; conversely, if there are significant differences in motion between areas, the size should be appropriately reduced. Therefore, it is necessary to adaptively select the filtering reference video frames and the basic motion estimation block size based on the motion characteristics of the video frame.

[0034] In traditional MCTF technology, the temporal filtering reference video frame and the basic motion estimation block size are typically fixed. To address this issue, this specification proposes an embodiment that adaptively selects the reference video frame based on frame-level motion estimation error and adaptively adjusts the basic motion estimation block size based on spatial motion consistency. This scheme further improves video coding performance based on the original MCTF technology.

[0035] See Figure 1 , Figure 1 A flowchart of a data processing method according to an embodiment of this specification is shown, which specifically includes the following steps.

[0036] Step 102: Determine the target video frame and the reference video frame associated with the target video frame.

[0037] Specifically, the target video frame can be a video frame contained in the initial video from any field such as communication, entertainment, education, publicity, and medicine. The target video frame is the video frame to be filtered and encoded. MCTF technology can be used to filter the target video frame, performing motion-compensated temporal filtering, before proceeding with video frame encoding. The target video frame and reference video frames originate from the same initial video; that is, the target video frame is the video frame in the initial video that is determined to be filtered and encoded, and the reference video frames are the video frames in the initial video that are adjacent to the target video frame. The number of reference video frames can be set according to actual needs. They can be selected from the initial video according to the order of the video frames, choosing the preceding and following video frames of the target video frame as reference video frames.

[0038] Based on this, for the initial video, the target video frame to be filtered and encoded, as well as the reference video frames associated with the target video frame, are determined. The reference video frames can be selected sequentially according to the arrangement order of the video frames in the initial video, and a set number of reference video frames can be selected.

[0039] In practical applications, filtering and encoding operations can be performed frame by frame on the initial video. Each video frame in the initial video can be used as a target video frame for subsequent filtering and encoding operations. This embodiment takes any one video frame in the initial video as the target video frame as an example to illustrate the motion estimation, motion compensation, and filtering operations on the target video frame.

[0040] Furthermore, considering that selecting a fixed number of 4 video frames as reference frames in MCTF is insufficient to adapt to dynamic changes in video content, thus limiting encoding efficiency, a preset video frame threshold can be used to select reference video frames to reduce bitrate, improve encoding efficiency, and adapt to dynamic changes in video content. The specific implementation is as follows: The target video frame is determined in the initial video; a preset video frame threshold is determined, and a preceding video frame sequence and a following video frame sequence associated with the target video frame are determined in the initial video; a preceding video frame is determined in the preceding video frame sequence according to the video frame threshold, and a following video frame is determined in the following video frame sequence; the preceding video frame and the following video frame are used as the reference video frame associated with the target video frame.

[0041] Specifically, the initial video is the video to be filtered and encoded, containing at least two video frames. The video frame threshold is a threshold set for the number of selectable reference video frames. The video frame threshold can be any integer greater than 4; a smaller threshold value results in better performance for complex motion sequences, while a larger value results in better performance for simple motion sequences. The video frame threshold can be 16. The preceding video frame sequence associated with the target video frame is the video frames in the initial video that precede the target video frame, and the following video frame sequence associated with the target video frame is the video frames in the initial video that follow the target video frame. The video frame threshold indicates the number of video frames selected from the preceding and following video frame sequences, respectively. With a video frame threshold of 16, 16 frames need to be selected from the preceding video frame sequence as preceding video frames, and 16 frames need to be selected from the following video frame sequence as following video frames. These 32 selected video frames are then used as reference video frames.

[0042] Based on this, the target video frame to be filtered and encoded is determined in the initial video. A preset video frame threshold is determined, and the preceding and following video frame sequences associated with the target video frame are determined in the initial video. Starting from the target video frame, video frames arranged chronologically before the target video frame form the preceding video frame sequence, and video frames arranged after the target video frame form the following video frame sequence. Based on the video frame threshold, preceding video frames with numerical values ​​matching the threshold are selected from the preceding video frame sequence, and following video frames with numerical values ​​matching the threshold are selected from the following video frame sequence. These preceding and following video frames are used as reference video frames associated with the target video frame, allowing subsequent motion estimation and motion compensation to be performed on the target video frame based on these reference video frames. Motion estimation can be performed frame-by-frame for multiple reference video frames. Starting from the target video frame, the preceding video frames are traversed forward, and then the following video frames are traversed backward, performing motion estimation frame by frame.

[0043] The selection criteria for reference video frames can also include video frame content. That is, video frames with spatiotemporal similarity to the target video frame are selected from the preceding and following video frame sequences as reference video frames. The number of reference video frames can be based on a video frame threshold, that is, the number of reference video frames should not exceed twice the reference video frame threshold.

[0044] For example, the initial video needs to be filtered and encoded before it can be played. Before performing temporal filtering on the initial video, motion estimation and motion compensation need to be performed frame by frame. Starting with the target video frame to be filtered in the initial video, and constrained by a video frame threshold, reference video frames are selected both forward and backward in the initial video. If the initial video contains 40 frames, the target video frame is the 20th frame in the initial video, and the video frame threshold is 16, then frames 4-19 can be selected as the preceding video frames from the sequence of preceding frames (1-19), and frames 21-36 can be selected as the following video frames from the sequence of following frames (21-40). The preceding and following video frames constitute the reference video frames. When extracting reference video frames from preceding and following video frame sequences, reference video frames can also be selected based on motion estimation errors. By analyzing the motion estimation errors of each frame in the preceding and following video frame sequences, the differences in pixel content between different frames are evaluated, and reference video frames that are more similar to the target video frame are selected, thus achieving adaptive selection of reference video frames.

[0045] In summary, by adaptively selecting reference video frames in the initial video based on video frame thresholds, considering both the number of video frames and their content, the efficiency of subsequent video frame filtering and encoding can be improved.

[0046] Step 104: Calculate dynamic attribute data based on at least one motion block region contained in the reference video frame, and determine the motion block matching parameters corresponding to the reference video frame based on the dynamic attribute data.

[0047] Specifically, after determining the target video frame and the reference video frame associated with it, dynamic attribute data can be calculated based on at least one motion block region contained in the reference video frame. Then, motion block matching parameters corresponding to the reference video frame are determined based on the dynamic attribute data. Here, the motion block region refers to the motion block region obtained by dividing the reference video frame into motion blocks. For example... Figure 2 As shown, Figure 2The motion field in the reference video frame is a matrix formed by the spatial layout of the motion vectors (MVs) in each basic motion vector storage block. Dividing each basic motion vector storage block in the reference video frame yields at least one motion block region, each of which serves as an MV analysis window. Dynamic attribute data refers to the attribute data obtained through dynamic calculation for at least one motion block region. This dynamic attribute data represents or reflects the degree of difference in MVs between different basic motion vector storage blocks within each motion block region of the reference video frame, the spatial consistency of motion within the corresponding spatial region, and the changes in pixel content within the motion block region. The motion block matching parameters corresponding to the reference video frame represent the motion block matching size, corresponding to the basic motion estimation block size in MCTF. The motion block matching parameters are used during motion estimation, performing motion estimation according to the dynamically calculated motion block matching parameters.

[0048] Based on this, after determining the target video frame and the reference video frame associated with the target video frame, the dynamic attribute data corresponding to the reference video frame is calculated based on at least one motion block region contained in the reference video frame, and the motion block matching parameters corresponding to the reference video frame are dynamically determined based on the dynamic attribute data, which are then used for subsequent motion estimation based on the motion block matching parameters.

[0049] Furthermore, considering that the motion field corresponding to the reference video frame contains multiple basic motion vector storage blocks, i.e., motion blocks, each with different attributes, the dynamic attribute data of each motion block region can be extracted to obtain the dynamic attribute data corresponding to the reference video frame. The specific implementation is as follows: The reference video frame is divided into at least one motion block region, and the dynamic attribute data of the region corresponding to the at least one motion block region is calculated respectively; the dynamic attribute data of the region corresponding to the at least one motion block region is used as the dynamic attribute data.

[0050] Specifically, the size of the moving block region can be set to positive integers such as 256 or 384 according to actual needs. Region dynamic attribute data refers to the attribute data obtained by dynamically calculating the attributes of the moving block region. This dynamic attribute data includes, but is not limited to, motion offset parameters and view parameters. Motion offset parameters include the mean horizontal displacement, variance horizontal displacement, mean vertical displacement, and variance vertical displacement. View parameters can be the mean pixel value of the pixel block corresponding to each moving block in the moving block region, as well as the mean pixel value and variance of the mean pixel values ​​corresponding to all moving blocks in the moving block region.

[0051] Based on this, the reference video frame is divided into at least one motion block region according to a preset size, and the motion offset parameters and view parameters corresponding to each of the at least one motion block region are calculated as dynamic attribute data. The dynamic attribute data corresponding to each of the at least one motion block region is then used as the dynamic attribute data.

[0052] Continuing with the previous example, such as Figure 2 As shown, Figure 2 The motion field in the reference video frame is a matrix formed by the spatial layout of the motion vectors (MVs) in each basic motion vector storage block. Dividing each basic motion vector storage block in the reference video frame yields at least one motion block region. Each motion block region is an MV analysis window, and the size of the MV analysis window can be set to a positive integer such as 256 or 384, with an upper limit equal to the width or height of the target video frame. The motion offset parameters and view parameters corresponding to each of the at least one motion block region are calculated as dynamic attribute data. This dynamic attribute data is then used as the dynamic attribute data of the reference video frame.

[0053] In summary, using the regional dynamic attribute data corresponding to at least one moving block region as dynamic attribute data improves the accuracy of dynamic attribute data extraction.

[0054] Furthermore, each target motion block region contains multiple target motion blocks. When calculating the dynamic attribute data of the region, the calculation can be performed on each target motion block individually, as specifically implemented below: Identify at least one target motion block contained in the target motion block region; calculate the motion offset parameters and view parameters of the at least one target motion block, and calculate the region view parameters corresponding to the target motion block region based on the view parameters of the at least one target motion block; use the motion offset parameters and view parameters of the at least one target motion block, and the region view parameters as the region dynamic attribute data.

[0055] Specifically, the motion offset parameters of the target moving block include the mean horizontal displacement, the variance horizontal displacement, the mean vertical displacement, and the variance vertical displacement. The horizontal displacement is the horizontal motion offset, and the vertical displacement is the vertical motion offset. The view parameters are the mean pixel value of the pixel block corresponding to each target moving block. The region view parameters corresponding to the target moving block region are the mean pixel value and the variance pixel value of all target moving blocks within the target moving block region.

[0056] Based on this, at least one target moving block is identified within the target moving block region. The mean and variance of the horizontal and vertical motion offsets of the at least one target moving block are calculated as motion offset parameters. The mean pixel value of the pixel blocks corresponding to each of the at least one target moving block is calculated as view parameters. Further, based on the view parameters of the at least one target moving block, the region view parameters corresponding to the target moving block region are calculated, i.e., the mean and variance of the mean pixel values ​​corresponding to all target moving blocks in the target moving block region. The motion offset parameters and view parameters of the at least one target moving block, along with the region view parameters, are used as region dynamic attribute data.

[0057] Continuing with the previous example, such as Figure 2 As shown, Figure 2 One of the MV analysis windows is used as the target motion block region. For the target motion blocks (basic motion vector storage blocks) contained within the target motion block region, the mean value of the horizontal motion offset is calculated. (See formula (1) below) and variance (See formula (2) below), and calculate the mean value of the vertical displacement. (See formula (3) below) and variance (See formula (4) below) to obtain the motion offset parameters. Calculate the pixel mean of the pixel block corresponding to the target moving block. Furthermore, the mean pixel value corresponding to the MV analysis window is calculated based on the mean pixel value of all target moving blocks within the MV analysis window. (See formula (5) below) and pixel mean variance (See formula (6) below) to obtain the view parameters and area view parameters.

[0058]

[0059] in, is the horizontal motion offset of the i-th basic motion vector storage block in the MV view window, and N is the number of basic motion vector storage blocks in the MV analysis window.

[0060]

[0061] in, This represents the vertical motion offset of the i-th basic motion vector storage block in the MV view window. Horizontal displacement variance. (Variance of horizontal displacement) and variance of vertical displacement The variance of the vertical motion offset can measure the degree of difference in MV between different basic motion vector storage blocks within the current MV analysis window, thereby reflecting the spatial consistency of motion within the corresponding spatial region of the MV analysis window. and The smaller the value, the more consistent the motion changes within the current region, thus allowing for the selection of larger basic motion estimation blocks.

[0062]

[0063] Among them, pixel mean variance It can be used to infer the spatial variation trend of pixel texture within the current MV analysis window. A larger value indicates that the pixel content in the current area has changed significantly. Even if the horizontal and vertical displacement variances are also large, a larger basic motion estimation block is still selected.

[0064] In summary, by using the motion offset parameters and view parameters of at least one target moving block, as well as the region view parameters, as region dynamic attribute data, and collecting and calculating data from the dimensions of motion offset and pixel values, the matching degree between the region dynamic attribute data and the target moving block region can be improved.

[0065] Furthermore, the matching parameters for the moving block can be determined by comparing the preset region parameters and dynamic attribute data, as well as by comparing the moving block parameters and the preset region parameters. The specific implementation is as follows: By comparing the preset region parameters and the dynamic attribute data, the region motion block matching parameters corresponding to the at least one motion block region are determined; the motion block parameters are calculated based on the region motion block matching parameters corresponding to the at least one motion block region, and the motion block matching parameters are determined by comparing the motion block parameters with the preset region parameters.

[0066] Specifically, the preset region parameters include custom parameters such as thr1, thr2, thr3, and thr4, as well as optional basic motion estimation block sizes such as size1 and size2. The region motion block matching parameters corresponding to at least one motion block region are the basic motion estimation block sizes selected in size1 and size2, which are dynamically calculated and compared to determine the basic motion estimation block sizes corresponding to the motion block regions. The motion block parameters are the basic motion estimation block sizes that integrate at least one motion block region, and the calculated basic motion estimation block size is the analysis window scale of size1.

[0067] Based on this, by comparing preset region parameters and dynamic attribute data, region motion block matching parameters corresponding to at least one motion block region are determined, and the basic motion estimation block size is determined. Motion block parameters are calculated based on the region motion block matching parameters corresponding to at least one motion block region. These motion block parameters are the basic motion estimation block size integrating at least one motion block region, and the calculated basic motion estimation block size is the analysis window scale of size1. The motion block matching parameters are determined by comparing the motion block parameters with the preset region parameters.

[0068] Following the previous example, the preset region parameters include custom parameters such as thr1, thr2, thr3, and thr4, as well as optional basic motion estimation block sizes such as size1 and size2. The basic motion estimation block size within the MV analysis window is determined from multiple optional basic motion estimation block sizes (including size1 and size2) using the following formula (7). (Regional motion block matching parameters). By integrating all MV analysis windows, the basic motion estimation block size of the current reference video frame is determined. That is, by combining all MV analysis windows, we can count the number of analysis windows N1 with a basic motion estimation block size of size1 and the total number of analysis windows N. total Calculate the proportion of the analysis window with a basic motion estimation block size of size1. The basic motion estimation block size of the reference video frame is determined from several optional basic motion estimation block sizes (including size1 and size2). . It can be calculated using the following formula (8). Further calculation of the block size (moving block matching parameters) is then performed. ,in = / 2. Here, size1 is greater than size2. Size1 and size2 can be set to any two positive integers smaller than the MV analysis window size, such as size1=64, size2=32, or size1=32, size2=16. The thresholds thr1, thr2, and thr3 used to determine the degree of motion consistency between different spatial regions can be set to any positive numbers, such as 25, 10000, and 7000 respectively; thr4 can be set to any number between [0,1], such as 0.35 to 0.5.

[0069]

[0070]

[0071] In summary, by comparing the moving block parameters with the preset region parameters, the moving block matching parameters are determined, enabling dynamic calculation of the moving block matching parameters and improving their usability.

[0072] Step 106: Determine the target motion block in the target video frame based on the motion block matching parameters, and determine multiple candidate motion blocks in the reference video frame.

[0073] Specifically, after calculating dynamic attribute data based on at least one motion block region contained in the reference video frame and determining the motion block matching parameters corresponding to the reference video frame based on the dynamic attribute data, a target motion block can be determined in the target video frame based on the motion block matching parameters, and multiple candidate motion blocks can be determined in the reference video frame. The target motion block is obtained by sampling in the target video frame according to the motion block matching parameters, and correspondingly, the candidate motion blocks are obtained by sampling in the reference video frame according to the motion block matching parameters. Sampling the target and reference video frames constitutes a step in the motion estimation process. Motion integer-pixel matching is performed simultaneously with sampling to achieve motion block matching.

[0074] Based on this, after calculating dynamic attribute data based on at least one motion block region contained in the reference video frame and determining the motion block matching parameters corresponding to the reference video frame based on the dynamic attribute data, the target motion block is determined in the target video frame based on the motion block matching parameters, and multiple candidate motion blocks are determined in the reference video frame. This enables downsampling of the target video frame and the reference video frame based on the motion block matching parameters, followed by motion integer pixel search, thereby achieving motion block matching and completing motion estimation.

[0075] Furthermore, after determining the motion block matching parameters, motion estimation can be performed on the target video frame and the reference video frame based on the motion block matching parameters. Downsampling is then performed on the target video frame and the reference video frame respectively, as specifically implemented as follows: The target video frame is divided according to the motion block matching parameters to obtain the target motion block, and the reference video frame is divided according to the motion block matching parameters to obtain multiple candidate motion blocks.

[0076] Specifically, dividing the target video frame and the reference video frame according to the motion block matching parameters essentially involves downsampling both the target and reference video frames according to the motion block matching parameters. The motion block matching parameters represent the basic motion estimation block size for downsampling the target and reference video frames.

[0077] Based on this, the target video frame and the reference video frame are downsampled according to the motion block matching parameters. This allows the target video frame to be divided according to the motion block matching parameters to obtain the target motion block, and the reference video frame to be divided according to the motion block matching parameters to obtain multiple candidate motion blocks. After downsampling the target video frame and the initial video frame based on the motion block matching parameters, motion integer pixel search can be performed to complete motion estimation.

[0078] Continuing with the previous example, such as Figure 3 As shown, the motion estimation process employs a pyramid search method. First, the frame to be filtered (target video frame) and its corresponding reference video frame (reference video frame) are downsampled by 1 / 2 and 1 / 4 respectively. Following an ascending resolution order, the best matching block (MV) at the next higher resolution is used as the search starting point. Based on the determined motion block matching parameters (i.e., the optimal size of the basic motion estimation block is the basic motion estimation block size), integer-pixel motion searches are performed on the 1 / 4 downsampled, 1 / 2 downsampled, and original resolution frames respectively, thus achieving motion block matching. The MV analysis window size can be set to positive integers such as 256 or 384, with an upper limit equal to the width or height of the target video frame.

[0079] In summary, by dividing the target video frame and the reference video frame according to the motion block matching parameters, downsampling of both the target and reference video frames is achieved, thus gradually completing motion estimation.

[0080] Step 108: Determine a reference motion block that matches the target motion block from among multiple candidate motion blocks, and perform the filtering task corresponding to the target video frame based on the reference motion block.

[0081] Specifically, after determining the target motion block in the target video frame based on the motion block matching parameters, and determining multiple candidate motion blocks in the reference video frame, a reference motion block matching the target motion block can be determined from the multiple candidate motion blocks. The filtering task corresponding to the target video frame is then performed based on the reference motion block. The reference motion block matching the target motion block is the motion block that is similar to the target motion block in the pixel dimension. The filtering task corresponding to the target video frame is a weighted filtering task, which performs weighted filtering based on the pixel values ​​of the reference motion block.

[0082] Based on this, after determining the target moving block in the target video frame based on the motion block matching parameters, and determining multiple candidate moving blocks in the reference video frame, a reference moving block that matches the target moving block in the pixel dimension is determined from the multiple candidate moving blocks. The filtering task corresponding to the target video frame is then performed based on the reference moving block, and weighted filtering is performed based on the pixel values ​​of the reference moving block to complete the weighted filtering of the target video frame. This process is repeated, and subsequently, video frames in the initial video that follow the target video frame can be selected as the target video frame, and steps 102-108 above can be executed until the weighted filtering of all video frames in the initial video is completed, at which point video encoding can begin.

[0083] Furthermore, during motion estimation, when determining the reference motion block that matches the target motion block, the difference value between the target motion block and multiple candidate motion blocks can be calculated one by one. The smaller the difference value, the higher the similarity between the two motion blocks. The specific implementation is as follows: By calculating the difference between the target motion block and each of the multiple candidate motion blocks, the reference motion block that matches the target motion block is determined from the multiple candidate motion blocks.

[0084] Specifically, the difference between the target moving block and each of the multiple candidate moving blocks can be SSE, which is the sum of squares of the pixel errors between the target moving block and the candidate moving blocks.

[0085] Based on this, the difference value between the target moving block and each of the multiple candidate moving blocks is calculated. The difference value between the target moving block and each candidate moving block can represent the similarity between the target moving block and each candidate moving block. The candidate moving block with the smaller difference value is selected as the reference moving block to match the target moving block.

[0086] Following the previous example, during the motion search process, the difference between the target motion block and each candidate motion block can be calculated step by step, and the candidate motion block with the smaller difference value can be selected as the reference motion block.

[0087] In summary, by calculating the difference between the target motion block and each of the multiple candidate motion blocks, a reference motion block matching the target motion block is determined from among the multiple candidate motion blocks, thus improving the efficiency of subsequent video coding.

[0088] Furthermore, after determining the reference moving block that matches the target moving block, error scaling and motion compensation can be performed to reduce distortion in subsequent filtering processes. The specific implementation is as follows: The video frame motion error between the target video frame and the reference video frame is calculated based on the motion errors corresponding to at least two target motion blocks; if the video frame motion error is greater than the motion error threshold, the filtering task corresponding to the target video frame is performed based on the reference motion block.

[0089] Specifically, when performing motion estimation on a target video frame, considering that the target video frame contains at least two target moving blocks, motion block matching and motion error calculation need to be performed on each target moving block. The motion error is referred to as SSE. The video frame motion error can be obtained by scaling the sum of the motion errors corresponding to at least two target moving blocks. The motion error threshold is a preset threshold used to determine whether subsequent reference video frames need to be skipped.

[0090] Based on this, the video frame motion error between the target video frame and the reference video frame is calculated according to the motion errors corresponding to at least two target motion blocks. Specifically, the motion errors corresponding to at least two target motion blocks are summed at the frame level, and then error scaling is performed to obtain the video frame motion error. If the video frame motion error exceeds a motion error threshold, a filtering task corresponding to the target video frame is performed based on the reference motion block. The motion error threshold can be the product of the error value between the target video frame and its nearest neighbor reference video frame, and a relative threshold used to measure the "degree of content difference".

[0091] Continuing with the previous example, motion estimation is performed on each basic motion estimation block (target motion block) to obtain... Frame-level summation is performed to obtain the motion error (error) between the target video frame and each reference video frame for motion estimation, where... Motion estimation using basic motion estimation blocks of different sizes will result in varying errors in the final calculations. Therefore, an error scaling operation is required. The scaled error... The calculation formula is shown in the following formula (9):

[0092] in, This represents the error after magnification. `scale` is a customizable parameter that can be set to any number greater than 0, such as 0.25. After obtaining the error between the reference video frame and the target video frame, it is determined whether the content difference between the reference and target video frames is too large. This is done separately for the preceding and following reference video frames. If the motion estimation process for the subsequent reference video frame is skipped, then motion estimation for that reference video frame is skipped; otherwise, motion estimation continues for the next reference video frame. This represents the error between the current reference video frame and the target video frame. The target video frame represents the error between itself and its nearest reference video frame. The `ratio` parameter is a threshold parameter used to control the reference video frame selection strategy during motion estimation. Its function is to determine whether to skip the motion estimation process of a certain reference video frame; it is also a relative threshold used to measure the "degree of content difference" and can be set to any number greater than 0, such as 25. Subsequently, weighted filtering can be performed using pixel values ​​from the best-matching block (reference motion block) of the reference video frame, in 8x8 blocks.

[0093] In summary, when the motion error of a video frame exceeds the motion error threshold, the filtering task corresponding to the target video frame is performed based on the reference motion block to achieve error scaling and motion compensation, thereby reducing distortion during the filtering process.

[0094] This specification provides a data processing method according to one embodiment, which involves determining a target video frame and a reference video frame associated with the target video frame. Dynamic attribute data is calculated based on at least one motion block region contained in the reference video frame to ensure that the dynamic attribute data can express the dynamic changes of the motion blocks in the reference video frame. Motion block matching parameters corresponding to the reference video frame are determined based on the dynamic attribute data, realizing the dynamic calculation of the motion block matching parameters. A target motion block is determined in the target video frame based on the motion block matching parameters, and multiple candidate motion blocks are determined in the reference video frame, realizing motion block segmentation of the target and reference video frames according to the motion block matching parameters obtained in real time. A reference motion block matching the target motion block is determined from the multiple candidate motion blocks, achieving accurate matching of the reference motion block. Subsequently, filtering tasks corresponding to the target video frame are performed based on the reference motion block, improving the accuracy of temporal filtering and reducing the complexity of subsequent video frame encoding.

[0095] The following is in conjunction with the appendix Figure 4 Taking the data processing method provided in this specification in the application of video encoding as an example, the data processing method will be further explained. Among other things, Figure 4 A flowchart illustrating the processing procedure of a data processing method according to an embodiment of this specification is shown, specifically including the following steps.

[0096] Step 402: Determine the target video frame in the initial video, determine the preset video frame threshold, and determine the preceding and following video frame sequences associated with the target video frame in the initial video.

[0097] Step 404: Determine the preceding video frame in the preceding video frame sequence and the following video frame in the following video frame sequence based on the video frame threshold, and use the preceding and following video frames as reference video frames associated with the target video frame.

[0098] In practical applications, the initial video can be the video to be encoded, and the target video frame can be any video frame to be encoded. Before encoding the target video frame, motion estimation is required. A crucial step in motion estimation is determining the reference video frames. The video frame threshold is used to select an appropriate number of reference video frames from the initial video. The target video frame can be any frame in the initial video; it may or may not have preceding or succeeding video frames. This embodiment uses any frame to be processed in the initial video as the target video frame (e.g., the 9th frame in the initial video). The video frames preceding the target video frame in the initial video are the preceding video frame sequence, and the video frames following the target video frame are the succeeding video frame sequence. The preset video frame threshold can be any integer greater than 4. When the video frame threshold is 4, four video frames are taken from the position of the target video frame in the preceding video frame sequence, preceding the target video frame. Similarly, four video frames are taken from the position of the target video frame in the succeeding video frame sequence, succeeding the target video frame. The preceding and following video frames together form the reference video frame. The order of subsequent motion estimation can be: starting from the target video frame (the video frame to be processed), traversing backwards through the preceding video frames, and then traversing backwards through the subsequent video frames.

[0099] Step 406: Divide the reference video frame into at least one motion block region, and calculate the region dynamic attribute data corresponding to each of the at least one motion block region.

[0100] Step 408: Use the dynamic attribute data of the region corresponding to at least one moving block region as the dynamic attribute data of the reference video frame.

[0101] The reference video frame contains multiple basic motion vector storage blocks. These blocks can be divided into at least one motion block region, which constitutes a motion vector analysis window. For each MV analysis window, dynamic attribute data is calculated. This data includes the variance and mean of the horizontal displacement of the MV obtained from motion estimation within the MV analysis window, the variance and mean of the vertical displacement, the mean pixel value of the pixel block corresponding to each basic motion vector storage block, and the mean and variance of the pixel values ​​of all pixel blocks corresponding to each basic motion vector storage block within the MV analysis window, calculated based on the mean pixel values ​​of the pixel blocks corresponding to each basic motion vector storage block.

[0102] Step 410: By comparing the preset region parameters and dynamic attribute data, determine the region motion block matching parameters corresponding to at least one motion block region.

[0103] In practical applications, preset region parameters include custom parameters such as thr1, thr2, thr3, and thr4, as well as optional basic motion estimation block sizes such as size1 and size2. For a given MV analysis window, the optimal size of the basic motion estimation block within that window can be determined based on the preset region parameters and the region's dynamic attribute data; that is, the region motion block matching parameters. For example, when both the vertical and horizontal displacement variances are less than or equal to thr1, size1 is the optimal size for the basic motion estimation block; when the variance of the mean pixel value of all basic motion vector storage blocks corresponding to the pixel blocks within the MV analysis window is greater than thr3 and the horizontal displacement variance is greater than or equal to thr2, size1 is the optimal size for the basic motion estimation block; when the variance of the mean pixel value of all basic motion vector storage blocks corresponding to the pixel blocks within the MV analysis window is greater than thr3 and the vertical displacement variance is greater than or equal to thr2, size1 is the optimal size for the basic motion estimation block; otherwise, size2 is the optimal size for the basic motion estimation block.

[0104] Step 412: Calculate the motion block parameters of the reference video frame based on the region motion block matching parameters corresponding to at least one motion block region, and determine the motion block matching parameters by comparing the motion block parameters with the preset region parameters.

[0105] Based on all MV analysis windows, the optimal size for the basic motion estimation block is: Number of analysis windows and the total number of analysis windows The optimal size for calculating the basic motion estimation block is: Analysis window ratio From several optional basic motion estimation block sizes (including size1 and size2), the optimal size of the basic motion estimation block for the reference video frame is determined. .For example, When the value is greater than thr4, size1 is the optimal size for the basic motion estimation block; otherwise, size2 is the optimal size for the basic motion estimation block. Calculate the block size. , . and All of these are moving block matching parameters.

[0106] Step 414: Sample the target video frame to obtain the target motion block, and sample the reference video frame to obtain the candidate motion block. Search and match the candidate motion block based on the motion block matching parameters and the target motion block to obtain the reference motion block that matches the target motion block.

[0107] The motion estimation process employs a pyramid search method. First, the frame to be filtered and its corresponding reference video frame are downsampled by 1 / 2 and 1 / 4 respectively. Then, following the order of resolution from smallest to largest, the best matching block MV at the next higher resolution is used as the starting point for the search. To estimate the block size for basic motion, integer-pixel motion searches are performed on 1 / 4 downsampled, 1 / 2 downsampled, and original resolution frames to achieve block matching. Then, the best matching block MV at the original resolution is used as the starting point for the search. To estimate the block size for basic motion, a pixel-wise search is performed at the original resolution to obtain the final best-matching block (reference motion block), and the SSE of each block with the best-matching block.

[0108] Step 416: Calculate the video frame motion error between the target video frame and the reference video frame based on the motion error corresponding to the target moving block.

[0109] Step 418: If the motion error of the video frame is greater than the motion error threshold, perform the filtering task corresponding to the target video frame based on the reference motion block.

[0110] The SSE obtained from motion estimation for each basic motion estimation block is summed at the frame level to obtain the motion estimation error between the video frame to be processed and each reference video frame. Motion estimation using basic motion estimation blocks of different sizes will result in some differences in the final calculated error, thus requiring an error scaling operation. After obtaining the error between the reference video frame and the video frame to be processed, it is determined whether the content difference between the reference video frame and the video frame to be processed is too large. For both the forward and backward reference video frames, the motion error is evaluated separately. If the motion error of the video frame is greater than the motion error threshold, the filtering task corresponding to the target video frame is executed based on the reference motion block corresponding to the target video frame; otherwise, motion estimation continues for the next reference video frame until the filtering task is completed.

[0111] In summary, the data processing method provided in this embodiment is applied to motion estimation before video frame filtering. During the MCTF process, the motion estimation error of each reference video frame is weighted at the frame level and error scaling is performed. The degree of content difference between the reference video frame and the frame to be processed is determined. Based on the degree of content difference, in the motion compensation stage, reference video frames with similar content are preferentially selected for temporal filtering, thereby minimizing distortion during the MCTF process and reducing coding complexity. Furthermore, leveraging the similarity between motion fields of temporally adjacent frames, the motion field of the reference video frame with completed motion estimation is used to analyze the motion consistency of different spatial regions in the current reference video frame, thus adaptively determining the optimal size of the basic motion estimation block for the current reference video frame. Using the adjacent frame motion field method enables more accurate pixel block content matching during the MCTF motion estimation process, improving the accuracy of temporal filtering.

[0112] Figure 5 A flowchart of a video encoding method according to an embodiment of this specification is shown. The video encoding method is applied at the encoding end and specifically includes the following steps.

[0113] Step 502: Determine the target video frame and the reference video frame associated with the target video frame in the initial video; Step 504: Calculate dynamic attribute data based on at least one motion block region contained in the reference video frame, and determine the motion block matching parameters corresponding to the reference video frame based on the dynamic attribute data; Step 506: Determine a target motion block in the target video frame based on the motion block matching parameters, and determine multiple candidate motion blocks in the reference video frame; Step 508: Determine a reference motion block that matches the target motion block from among multiple candidate motion blocks, and perform the filtering task corresponding to the target video frame based on the reference motion block to obtain the target filtered video frame; Step 510: Encode the target filtered video frame to obtain the target video corresponding to the initial video.

[0114] In practical applications, after determining the initial video, the encoding end can filter the initial video before encoding it. Before filtering, it is necessary to identify the target video frame and the associated reference video frame within the initial video, and then perform motion estimation on the target video frame. Before motion estimation, the motion estimation block size, i.e., the motion block matching parameter, needs to be determined. Dynamic attribute data is calculated based on at least one motion block region contained in the reference video frame to ensure that the dynamic attribute data can express the dynamic changes of the motion blocks in the reference video frame. The motion block matching parameter corresponding to the reference video frame is determined based on the dynamic attribute data, realizing the dynamic calculation of the motion block matching parameter. Based on the motion block matching parameter, the target motion block is determined in the target video frame, and multiple candidate motion blocks are determined in the reference video frame, realizing motion block partitioning of the target and reference video frames according to the motion block matching parameter obtained in real time. The reference motion block that matches the target motion block is determined from the multiple candidate motion blocks, realizing accurate matching of the reference motion block. Subsequently, the filtering task corresponding to the target video frame is performed based on the reference motion block to obtain the target filtered video frame. By encoding the target filtered video frames, the target video corresponding to the initial video can be obtained, which improves the accuracy of temporal filtering and reduces the complexity of video frame encoding.

[0115] Corresponding to the above method embodiments, this specification also provides data processing apparatus embodiments. Figure 6 A schematic diagram of the structure of a data processing apparatus according to one embodiment of this specification is shown. Figure 6 As shown, the device includes: The first determining module 602 is configured to determine a target video frame and a reference video frame associated with the target video frame. The calculation module 604 is configured to calculate dynamic attribute data based on at least one motion block region contained in the reference video frame, and determine motion block matching parameters corresponding to the reference video frame based on the dynamic attribute data. The second determining module 606 is configured to determine a target motion block in the target video frame based on the motion block matching parameters, and to determine a plurality of candidate motion blocks in the reference video frame. The execution module 608 is configured to determine a reference motion block that matches the target motion block among the plurality of candidate motion blocks, and to perform a filtering task corresponding to the target video frame based on the reference motion block.

[0116] In an optional embodiment, the first determining module 602 is further configured to: The target video frame is determined in the initial video; Determine a preset video frame threshold, and determine the preceding and following video frame sequences associated with the target video frame in the initial video; The preceding video frame is determined in the preceding video frame sequence based on the video frame threshold, and the subsequent video frame is determined in the subsequent video frame sequence. The preceding video frame and the following video frame are used as reference video frames associated with the target video frame.

[0117] In an optional embodiment, the computing module 604 is further configured to: The reference video frame is divided into at least one motion block region, and the dynamic attribute data of the region corresponding to the at least one motion block region is calculated respectively; The dynamic attribute data of the regions corresponding to the at least one moving block region shall be used as the dynamic attribute data.

[0118] In an optional embodiment, the computing module 604 is further configured to: Identify at least one target motion block contained within the target motion block region; Calculate the motion offset parameters and view parameters of the at least one target moving block, and calculate the region view parameters corresponding to the region of the target moving block based on the view parameters of the at least one target moving block; The motion offset parameters and view parameters of the at least one target moving block, as well as the region view parameters, are used as the region dynamic attribute data.

[0119] In an optional embodiment, the computing module 604 is further configured to: By comparing the preset region parameters and the dynamic attribute data, the region motion block matching parameters corresponding to the at least one motion block region are determined. The motion block parameters are calculated based on the region motion block matching parameters corresponding to the at least one motion block region, and the motion block matching parameters are determined by comparing the motion block parameters with the preset region parameters.

[0120] In an optional embodiment, the second determining module 606 is further configured to: The target video frame is divided according to the motion block matching parameters to obtain the target motion block, and the reference video frame is divided according to the motion block matching parameters to obtain multiple candidate motion blocks.

[0121] In an optional embodiment, the execution module 608 is further configured to: By calculating the difference between the target motion block and each of the multiple candidate motion blocks, the reference motion block that matches the target motion block is determined from the multiple candidate motion blocks.

[0122] In an optional embodiment, the execution module 608 is further configured to: The video frame motion error between the target video frame and the reference video frame is calculated based on the motion errors corresponding to at least two target motion blocks; If the motion error of the video frame is greater than the motion error threshold, the filtering task corresponding to the target video frame is performed based on the reference motion block.

[0123] This specification provides a data processing apparatus in one embodiment that determines a target video frame and a reference video frame associated with the target video frame. Dynamic attribute data is calculated based on at least one motion block region contained in the reference video frame to ensure that the dynamic attribute data can express the dynamic changes of motion blocks in the reference video frame. Motion block matching parameters corresponding to the reference video frame are determined based on the dynamic attribute data, realizing the dynamic calculation of motion block matching parameters. A target motion block is determined in the target video frame based on the motion block matching parameters, and multiple candidate motion blocks are determined in the reference video frame, realizing motion block segmentation of the target and reference video frames according to the motion block matching parameters obtained in real time. A reference motion block matching the target motion block is determined from the multiple candidate motion blocks, achieving accurate matching of the reference motion block. Subsequently, filtering tasks corresponding to the target video frame are performed based on the reference motion block, improving the accuracy of temporal filtering and reducing the complexity of subsequent video frame encoding.

[0124] The above is an illustrative scheme of a data processing apparatus according to this embodiment. It should be noted that the technical solution of this data processing apparatus and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the data processing apparatus, please refer to the description of the technical solution of the data processing method described above.

[0125] Corresponding to the above method embodiments, this specification also provides embodiments of video encoding apparatus. Figure 7 A schematic diagram of a video encoding apparatus according to one embodiment of this specification is shown. Figure 7 As shown, a video encoding device is used at the encoding end, and the device includes: The first determining module 702 is configured to determine a target video frame and a reference video frame associated with the target video frame in the initial video. The calculation module 704 is configured to calculate dynamic attribute data based on at least one motion block region contained in the reference video frame, and determine motion block matching parameters corresponding to the reference video frame based on the dynamic attribute data. The second determining module 706 is configured to determine a target motion block in the target video frame based on the motion block matching parameters, and to determine a plurality of candidate motion blocks in the reference video frame. The execution module 708 is configured to determine a reference motion block that matches the target motion block among a plurality of candidate motion blocks, and to perform a filtering task corresponding to the target video frame based on the reference motion block to obtain the target filtered video frame. The encoding module 710 is configured to encode the target filtered video frame to obtain the target video corresponding to the initial video.

[0126] This specification provides a video encoding apparatus in one embodiment. After determining an initial video, the encoding end can filter the initial video before encoding it. Before filtering the initial video, a target video frame and a reference video frame associated with the target video frame need to be determined in the initial video, and motion estimation is then performed on the target video frame. Before performing motion estimation, the motion estimation block size, i.e., the motion block matching parameter, needs to be determined. Dynamic attribute data is calculated based on at least one motion block region contained in the reference video frame to ensure that the dynamic attribute data can express the dynamic changes of the motion blocks in the reference video frame. The motion block matching parameter corresponding to the reference video frame is determined based on the dynamic attribute data, realizing the dynamic calculation of the motion block matching parameter. Based on the motion block matching parameter, a target motion block is determined in the target video frame, and multiple candidate motion blocks are determined in the reference video frame, realizing motion block division of the target video frame and the reference video frame according to the motion block matching parameter obtained in real time. A reference motion block matching the target motion block is determined from the multiple candidate motion blocks, realizing accurate matching of the reference motion block. Subsequently, the filtering task corresponding to the target video frame is performed based on the reference motion block to obtain the target filtered video frame. By encoding the target filtered video frames, the target video corresponding to the initial video can be obtained, which improves the accuracy of temporal filtering and reduces the complexity of video frame encoding.

[0127] The above is an illustrative scheme of a video encoding device according to this embodiment. It should be noted that the technical solution of this video encoding device and the technical solution of the video encoding method described above belong to the same concept. For details not described in detail in the technical solution of the video encoding device, please refer to the description of the technical solution of the video encoding method described above.

[0128] Figure 8 A structural block diagram of a computing device 800 according to one embodiment of this specification is shown. The components of the computing device 800 include, but are not limited to, a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and a database 850 is used to store data.

[0129] The computing device 800 also includes an access device 840, which enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 840 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC) interface.

[0130] In one embodiment of this specification, the above-described components of the computing device 800 and Figure 8 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 8 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0131] The computing device 800 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 800 can also be a mobile or stationary server.

[0132] The processor 820 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above-described data processing method.

[0133] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the data processing method described above.

[0134] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described data processing method.

[0135] The above is an illustrative embodiment of a computer-readable storage medium. It should be noted that the technical solution of this storage medium and the technical solution of the data processing method described above belong to the same concept. Details not described in detail in the technical solution of the storage medium can be found in the description of the technical solution of the data processing method described above.

[0136] An embodiment of this specification also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described data processing method.

[0137] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the data processing method described above.

[0138] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0139] The computer program / instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.

[0140] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0141] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0142] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A data processing method, comprising: determining a target video frame and a reference video frame associated with the target video frame; calculating dynamic attribute data according to at least one motion block region contained in the reference video frame, and determining motion block matching parameters corresponding to the reference video frame based on the dynamic attribute data; determining a target motion block in the target video frame and a plurality of candidate motion blocks in the reference video frame based on the motion block matching parameters; determining a reference motion block matching the target motion block from the plurality of candidate motion blocks, and performing a filtering task corresponding to the target video frame based on the reference motion block. 2.The data processing method of claim 1, wherein the determining a target video frame and a reference video frame associated with the target video frame comprises: determining the target video frame in an initial video; determining a preset video frame threshold, and determining a sequence of preceding video frames and a sequence of subsequent video frames associated with the target video frame in the initial video; determining a preceding video frame in the sequence of preceding video frames and a subsequent video frame in the sequence of subsequent video frames according to the video frame threshold; and determining the preceding video frame and the subsequent video frame as the reference video frame associated with the target video frame. 3.The data processing method of claim 1, wherein the calculating dynamic attribute data according to at least one motion block region contained in the reference video frame comprises: dividing the reference video frame into at least one motion block region, and calculating region dynamic attribute data corresponding to the at least one motion block region respectively; and determining the region dynamic attribute data corresponding to the at least one motion block region respectively as the dynamic attribute data. 4.The data processing method of claim 3, wherein the calculating region dynamic attribute data corresponding to any one target motion block region in the at least one motion block region comprises: determining at least one target motion block contained in the target motion block region; calculating motion offset parameters and view parameters of the at least one target motion block, and calculating region view parameters corresponding to the target motion block region based on the view parameters of the at least one target motion block; and determining the motion offset parameters and the view parameters of the at least one target motion block, and the region view parameters as the region dynamic attribute data. 5.The data processing method of claim 1, wherein the determining motion block matching parameters corresponding to the reference video frame based on the dynamic attribute data comprises: determining region motion block matching parameters corresponding to the at least one motion block region respectively by comparing preset region parameters and the dynamic attribute data; calculating motion block parameters based on the region motion block matching parameters corresponding to the at least one motion block region respectively, and determining the motion block matching parameters by comparing the motion block parameters and the preset region parameters. 6.The data processing method of claim 1, wherein the determining a target motion block in the target video frame and a plurality of candidate motion blocks in the reference video frame based on the motion block matching parameters comprises: ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ According to the motion block matching parameter, the target video frame is divided to obtain the target motion block, and the reference video frame is divided according to the motion block matching parameter to obtain a plurality of candidate motion blocks.

7. The data processing method of claim 1, wherein the determining a reference motion block matching the target motion block from the plurality of candidate motion blocks comprises: determining the reference motion block matching the target motion block from the plurality of candidate motion blocks by calculating a difference value between the target motion block and each candidate motion block.

8. The data processing method of claim 1, wherein when there are at least two target motion blocks, after the determining a reference motion block matching the target motion block from the plurality of candidate motion blocks, the method further comprises: calculating a video frame motion error between the target video frame and the reference video frame according to motion errors corresponding to the at least two target motion blocks, respectively; when the video frame motion error is greater than a motion error threshold, performing a filtering task corresponding to the target video frame based on the reference motion block.

9. A video encoding method applied to an encoding end, comprising: determining a target video frame in an initial video and a reference video frame associated with the target video frame; calculating dynamic attribute data according to at least one motion block region contained in the reference video frame, and determining a motion block matching parameter corresponding to the reference video frame based on the dynamic attribute data; determining a target motion block in the target video frame based on the motion block matching parameter, and determining a plurality of candidate motion blocks in the reference video frame; determining a reference motion block matching the target motion block from the plurality of candidate motion blocks, and performing a filtering task corresponding to the target video frame based on the reference motion block to obtain a target filtered video frame; encoding the target filtered video frame to obtain a target video corresponding to the initial video.

10. A computing device, comprising: a memory and a processor; the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions, and the computer executable instructions, when executed by the processor, implement steps of the method of any one of claims 1 to 9.

11. A computer readable storage medium storing computer executable instructions, and the computer executable instructions, when executed by a processor, implement steps of the method of any one of claims 1 to 9.

12. A computer program product comprising a computer program or instructions, and the computer program or instructions, when executed by a processor, implement steps of the method of any one of claims 1 to 9.