WO2022143078A1 - Video automatic motion compensation method, apparatus, and device, and storage medium - Google Patents

Video automatic motion compensation method, apparatus, and device, and storage medium Download PDF

Info

Publication number
WO2022143078A1
WO2022143078A1 PCT/CN2021/136774 CN2021136774W WO2022143078A1 WO 2022143078 A1 WO2022143078 A1 WO 2022143078A1 CN 2021136774 W CN2021136774 W CN 2021136774W WO 2022143078 A1 WO2022143078 A1 WO 2022143078A1
Authority
WO
WIPO (PCT)
Prior art keywords
frame
inter
motion
video
frames
Prior art date
Application number
PCT/CN2021/136774
Other languages
French (fr)
Chinese (zh)
Inventor
郑蒙帅
田超
Original Assignee
深圳创维-Rgb电子有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳创维-Rgb电子有限公司 filed Critical 深圳创维-Rgb电子有限公司
Publication of WO2022143078A1 publication Critical patent/WO2022143078A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/142Detection of scene cut or scene change
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/57Motion estimation characterised by a search window with variable size or shape
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/583Motion compensation with overlapping blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/14Picture signal circuitry for video frequency region
    • H04N5/144Movement detection

Definitions

  • the present application relates to the field of video motion compensation, and in particular, to a video automatic motion compensation method, system, device and storage medium.
  • the motion compensation gear in the menu of the existing TV needle cannot be automatically adapted in some pictures.
  • the fixed mode only one set of motion compensation parameters is fixed, resulting in too strong or too weak motion compensation parameters in some special pictures, so the picture is broken, jittered, delayed and other problems, affecting the user experience.
  • Embodiments of the present application provide a video automatic motion compensation method, system, device, and storage medium, which aim to solve the problem that the existing motion compensation method cannot be automatically adapted in some pictures, which affects user experience.
  • the embodiment of the present application provides a video automatic motion compensation method, which is used in a video playback device, and the method includes:
  • the frame rate is greater than the first set threshold, based on the inter-frame correlation between two adjacent frames in each group of the video, it is judged whether there is a scene change in the two adjacent frames;
  • the The base group consists of the video frame images contained per second;
  • the video is motion compensated based on the inter-frame motion speed and the inter-frame correlation.
  • the method further includes: when the frame rate is less than or equal to the first set threshold, not performing motion compensation on the two adjacent frames.
  • determining whether a scene change occurs in the two adjacent frames based on the inter-frame correlation between two adjacent frames in each group of the video includes:
  • performing motion compensation on the video based on the inter-frame motion speed and the inter-frame correlation includes:
  • the motion compensation frame interpolation is performed at the position of the frame to be inserted.
  • the sorting of the inter-frame motion speed and the inter-frame correlation includes:
  • the inter-frame motion speed is obtained according to the block motion vector and the inter-block correlation, and the obtained inter-frame motion speed is sorted.
  • the determining the position of the frame to be inserted based on the sorted inter-frame correlation and the inter-frame motion speed includes:
  • the position of the frame to be inserted is determined according to the motion speed sorting and the accuracy sorting.
  • the step of performing motion-compensated frame interpolation at the position of the frame to be inserted based on the block motion vector between corresponding macroblocks of two adjacent frames in the group and the interpolation frame further includes: :
  • the motion-compensated matching gear includes a first gear and a second gear; or the motion-compensated matching gear includes a first gear, a second gear, and a third gear.
  • the similarity between the adjacent inter-frame motion speeds is calculated by the following formula:
  • v i represents any frame in the group
  • v i , v i+1 represent the respective motion speeds of two adjacent frames
  • M represents the total number of frames in a group
  • S i,i+1 represent the adjacent frames Similarity between motion speeds.
  • the inter-frame correlation is the correlation between two adjacent frames in the group, and is calculated by the following formula:
  • f t and f t+1 respectively represent two adjacent frames in a group; E[f t ] and D[f t ] represent the mean and variance of frame pixel values, respectively; ⁇ t represents the adjacent frame in the group The degree of correlation between two frames, the two adjacent frames include positive or negative numbers; ⁇ t represents the absolute value of ⁇ t ; M represents the total number of frames in a group.
  • frame interpolation is performed using bidirectional overlapping block motion compensation.
  • the block motion vector between corresponding macroblocks of two adjacent frames in the group and the inter-block correlation between corresponding macroblocks between frames are sequentially obtained, and the block motion vector
  • the inter-frame motion speed is obtained in combination with the inter-block correlation degree, and the obtained inter-frame motion speed is sorted, including:
  • Motion estimation is performed on two adjacent frames f t and f t+1 by using the diamond search method
  • the present application also proposes a video automatic motion compensation device, the device comprising:
  • a first acquisition module used to acquire the video played by the video playback device
  • a detection module for detecting the frame rate of the video
  • a judgment module configured to judge whether the two adjacent frames appear based on the inter-frame correlation between the adjacent two frames in each group of the video when the frame rate is greater than the first set threshold Scene change; the group is composed of video frame images contained per second;
  • a second acquiring module configured to acquire the inter-frame motion speed between the adjacent frames in which the scene transition occurs in the group when the scene transition occurs in the two adjacent frames
  • a motion compensation module configured to perform motion compensation on the video based on the inter-frame motion speed and the inter-frame correlation.
  • the present application also proposes a video automatic motion compensation device, the device includes a processor, a memory electrically connected to the processor, and a video automatic motion compensation program stored on the memory and executable on the processor ; the steps of implementing the video automatic motion compensation method when the video automatic motion compensation program is executed by the processor.
  • the present application also proposes a computer-readable storage medium, where one or more programs are stored in the computer-readable storage medium, and the one or more programs can be executed by one or more processors to realize the video Steps in an automatic motion compensation method.
  • the video played by the video playback device is acquired; the frame rate of the video is then detected, and if the frame rate is greater than the first set threshold, the frame rate of each group of the video is The inter-frame correlation between two adjacent frames, to determine whether scene changes occur in the two adjacent frames; the base group is composed of video frame images included per second; if scene changes occur in the two adjacent frames, Then, the inter-frame motion speed between adjacent frames in which scene change occurs in the group is acquired, and motion compensation is performed on the video based on the inter-frame motion speed and the inter-frame correlation.
  • the speed of the motion of the object is judged based on the combination of the inter-frame motion speed and the inter-frame correlation, and the motion compensation gear is automatically adapted according to the number of frames inserted through motion compensation.
  • the present application matches the corresponding motion compensation matching gear according to whether the picture is in a motion state and the degree of the motion state.
  • the appropriate motion compensation gear is automatically matched to improve the viewer's experience.
  • FIG. 1 is a hardware framework diagram of an embodiment of an automatic video motion compensation device of the present application
  • FIG. 2 is a flowchart of an embodiment of a video automatic motion compensation method of the present application
  • FIG. 3 is a flowchart of an embodiment of step 300 in FIG. 2;
  • FIG. 4 is a flowchart of an embodiment of step 340 in FIG. 3;
  • FIG. 5 is a flowchart of another embodiment of step 300 in FIG. 2;
  • FIG. 6 is a flowchart of another embodiment of the automatic video motion compensation method of the present application.
  • FIG. 7 is a schematic block diagram of an embodiment of the video automatic motion compensation apparatus of the present application.
  • Fig. 8a and Fig. 8b respectively represent the schematic diagrams of the large diamond and the small diamond in the diamond search method in this application;
  • FIG. 9 shows a schematic diagram of bidirectional overlapping block motion compensation in the present application.
  • the motion compensation gear in the menu of the existing TV needle cannot be automatically adapted in some pictures.
  • the fixed mode only one set of motion compensation parameters is fixed, resulting in too strong or too weak motion compensation parameters in some special pictures, so the picture is broken, jittered, delayed and other problems, affecting the user experience.
  • the present application proposes a video automatic motion compensation method, system, device and storage medium.
  • the automatic video motion compensation device may include: a processor 1001 , such as a CPU, a memory 1005 , a user interface 1003 , a network interface 1004 , and a communication bus 1002 .
  • the communication bus 1002 is used to realize the connection and communication between these components.
  • the user interface 1003 may include an input unit such as a keyboard, and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
  • the network interface 1004 may optionally include a wireless interface (eg, a WI-FI interface).
  • the memory 1005 may be high-speed RAM memory, or may be non-volatile memory, such as disk memory.
  • the memory 1005 may also be a storage device independent of the aforementioned processor 1001 .
  • the structure of the automatic video motion compensation device shown in FIG. 1 does not constitute a limitation on the automatic video motion compensation device, and may include more or less components than those shown in the figure, or combine some components, or Different component arrangements.
  • the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module and a video automatic motion compensation program.
  • the operating system is a program that manages and controls the hardware and software resources of the automatic video motion compensation device, and supports the operation of the automatic video motion compensation program and other software or programs.
  • the network interface 1004 is mainly used for the background server, and performs data communication with the background server; the processor 1001 can be used to call the video automatic motion compensation program stored in the memory 1005, and execute the above The steps of the video automatic motion compensation method.
  • the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and execute the method including:
  • the frame rate is greater than the first set threshold, based on the inter-frame correlation between two adjacent frames in each group of the video, it is judged whether there is a scene change in the two adjacent frames;
  • the The base group consists of the video frame images contained per second;
  • the video is motion compensated based on the inter-frame motion speed and the inter-frame correlation.
  • the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and execute the method including:
  • the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and execute the method including:
  • the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and execute the method including:
  • the motion compensation frame interpolation is performed at the position of the frame to be inserted.
  • the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and execute the method including:
  • the inter-frame motion speed is obtained according to the block motion vector and the inter-block correlation, and the obtained inter-frame motion speed is sorted.
  • the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and execute the method including:
  • the determining the position of the frame to be inserted based on the sorted inter-frame correlation and the inter-frame motion speed includes:
  • the position of the frame to be inserted is determined according to the motion speed sorting and the accuracy sorting.
  • the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and execute the method including:
  • the step of performing motion-compensated frame interpolation at the position to be inserted based on the block motion vector between the corresponding macroblocks of two adjacent frames in the group and the interpolation frame further includes:
  • the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and execute the method including:
  • the motion-compensated matching gear includes a first gear and a second gear; or the motion-compensated matching gear includes a first gear, a second gear, and a third gear.
  • the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and the execution of the method includes: wherein, the similarity between the adjacent inter-frame motion speeds is determined by: Calculated by the following formula:
  • v i represents any frame in the group
  • v i , v i+1 represent the respective motion speeds of two adjacent frames
  • M represents the total number of frames in a group
  • S i,i+1 represent the adjacent frames Similarity between motion speeds.
  • the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and executing the method includes: wherein, the inter-frame correlation is between two adjacent frames in the group.
  • the degree of correlation is calculated by the following formula:
  • f t and f t+1 respectively represent two adjacent frames in a group; E[f t ] and D[f t ] represent the mean and variance of frame pixel values, respectively; ⁇ t represents the adjacent frame in the group The degree of correlation between two frames, the two adjacent frames include positive or negative numbers; ⁇ t represents the absolute value of ⁇ t ; M represents the total number of frames in a group.
  • the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and the execution of the method includes: wherein, frame interpolation is performed using bidirectional overlapping block motion compensation.
  • the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and executing the method includes: wherein the sequentially obtaining macroblocks corresponding to two adjacent frames in the group The inter-block correlation between the block motion vector and the inter-frame corresponding macroblock, the block motion vector and the inter-block correlation are combined to obtain the inter-frame motion speed, and the obtained inter-frame motion speed Sort by including:
  • Motion estimation is performed on two adjacent frames f t and f t+1 by using the diamond search method
  • the video automatic motion compensation device of the present application obtains the video played by the video playback device; then detects the frame rate of the video, and when the frame rate is greater than the first set threshold
  • the inter-frame correlation between two adjacent frames in the group to determine whether scene changes occur in the two adjacent frames;
  • the base group is composed of video frame images contained in every second; when the two adjacent frames appear scene changes is obtained, the inter-frame motion speed between adjacent frames where scene changes occur in the group are acquired, and motion compensation is performed on the video based on the inter-frame motion speed and the inter-frame correlation.
  • the speed of the motion of the object is judged based on the combination of the inter-frame motion speed and the inter-frame correlation, and the motion compensation gear is automatically adapted according to the number of frames inserted through motion compensation.
  • the present application matches the corresponding motion compensation matching gear according to whether the picture is in a motion state and the degree of the motion state. When the TV is used to watch sports content, the appropriate motion compensation gear is automatically matched to improve the viewer's experience.
  • the automatic video motion compensation method is used in a video playback device, and the automatic video motion compensation method includes the following steps:
  • the playback device includes various devices having the function of playing video, such as a playback device, a TV, a computer, a smart phone, a tablet computer, etc.
  • a playback device such as a TV, a computer, a smart phone, a tablet computer, etc.
  • This embodiment mainly takes a TV as an example for illustration.
  • the frame rate of the video can be obtained from the configuration file of the video, where the frame rate refers to the number of video frame images displayed by the TV per second.
  • the base group consists of video frame images contained per second.
  • the frame rate of the video is 24FPS, which means that the displayed video frame image is 24 frames per second. Then 24 frames of video frame images form a group.
  • the first set threshold here can be set according to the actual situation. For example, the first set threshold can be set to 24 frames/second. If it is detected that the frame rate of the video played by the playback device is higher than 24 frames/second, it is further based on The inter-frame correlation between two adjacent frames in each group of the video is used to determine whether a scene change occurs in the two adjacent frames. It should be understood that the specific numerical values of the first set threshold listed here are only for those skilled in the art to better understand the technical solutions of the embodiments of the present application, and should not be construed as limitations on the first set thresholds of this embodiment.
  • the inter-frame correlation is used to describe the degree of correlation between two adjacent frames in a group, that is, the inter-frame correlation determines whether a scene change occurs in this group. For example, the video frame images of the previous frame and the next frame are different, it is considered that a scene change has occurred, and the previous frame is similar to the next frame, and the scene is considered to be in no scene change.
  • the inter-frame correlation is shown in Equation 1:
  • f t and f t+1 represent two adjacent frames in a group
  • E[f t ] and D[f t ] represent the mean and variance of frame pixel values, respectively
  • ⁇ t represents the adjacent frame in the group The degree of correlation between two frames, including positive or negative numbers
  • ⁇ t represents the absolute value of ⁇ t
  • M represents the total number of frames in a group.
  • f t and f t+1 appearing below have the same meaning as f t and f t +1 in this paragraph, and both represent two adjacent frames in a group.
  • step S300 specifically includes:
  • the inter-frame motion speed between adjacent frames in which the scene change occurs is further obtained.
  • the rate of change between frames is faster, it proves that the picture is in a state of motion, to prevent frame loss of the picture, and it is necessary to insert frames for motion compensation.
  • the video is motion compensated based on the inter-frame motion speed and the inter-frame correlation.
  • step S500 further includes:
  • Step S510 specifically includes:
  • the inter-frame correlations within the group obtained in step S200 are sorted.
  • S513 Acquire the inter-frame motion speed according to the block motion vector and the inter-block correlation degree, and sort the acquired inter-frame motion speed.
  • step S513 includes the following subdivision steps:
  • S5131 Perform motion estimation on two adjacent frames f t and f t+1 , and adopt a diamond search method with better performance in block matching search.
  • the search pattern of the diamond search method is neither too large nor too small.
  • the large diamond (as shown in Figure 8a) has a large search step, which can be used for rough positioning, so that the search process will not fall into local optimum, and the small diamond (as shown in Figure 8b) ) is used for accurate positioning to obtain more precise matching points.
  • the block matching algorithm obtains the block motion vector between corresponding macroblocks between two adjacent frames.
  • step S520 includes the following subdivision steps:
  • S523 Acquire the motion speed ranking of the video frame images and the accuracy ranking of the motion speed between frames.
  • the determination of the positions of the frames to be inserted can be realized in two steps. First, combine the sorted inter-frame correlation and inter-frame motion speed, and select two frames with fast inter-frame speed and small inter-frame correlation as the frame insertion position; If the requirements are met, go to the next step directly, otherwise continue to select the frame insertion position: calculate the similarity S between the motion speeds between two adjacent frames, as shown in the following formula 2. From the two inter-frame motion speeds v i , v i+1 with larger similarity S i,i+ 1, select the two frames corresponding to the larger speed to perform frame insertion until the number of frame insertion positions reaches the requirement.
  • Formula 2 i represents any frame in the group, vi and vi +1 represent the respective motion speeds of two adjacent frames, M represents the total number of frames in a group, and S i,i+1 represent the adjacent frames Similarity between motion speeds.
  • FIG. 9 shows a schematic diagram of bidirectional overlapping block motion compensation, in which the solid line represents the N ⁇ N original matching, B represents the current block, and N1-N8 represent the surrounding blocks of the current block; the dotted line block is the above nine
  • the blocks are (N+2w) ⁇ (N+2w) extended blocks formed by extending the center by w widths in the upward, downward, left, and right directions respectively.
  • frames can be inserted in two cases, as follows:
  • step 540 it further includes:
  • the motion compensation matching gear includes a second gear consisting of a first gear and a second gear, or a third gear consisting of a first gear, a second gear and a third gear.
  • the first gear may be a high gear, corresponding to a larger number of interpolated frames; the second gear may be a low gear, corresponding to a smaller number of inserted frames.
  • the high level indicates that more interpolated frames are required to perform motion compensation on the video picture than the low level.
  • the matching gears can also be set to the first gear, the second gear and the third gear.
  • the first gear may be a high gear
  • the second gear may be a middle gear
  • the second gear may be a low gear. As shown in Table 1 below:
  • the present application can also use the traditional frame interpolation method to determine the frame interpolation position according to the weight parameter of each frame in the group, and obtain the interpolation frame by linearly summing two adjacent frames.
  • the present application obtains the video played by the video playback device; and then detects the frame rate of the video, when the frame rate is greater than the first set threshold, then based on the two adjacent frames in each group of the video
  • the inter-frame correlation between the two adjacent frames is used to determine whether there is a scene change in the two adjacent frames; the group is composed of video frame images contained in every second; when the two adjacent frames have scene changes, the The inter-frame motion speed between adjacent frames where scene changes occur in the group, and motion compensation is performed on the video based on the inter-frame motion speed and the inter-frame correlation.
  • the speed of the motion of the object is judged based on the combination of the inter-frame motion speed and the inter-frame correlation, and the motion compensation gear is automatically adapted according to the number of frames inserted through motion compensation.
  • the present application matches the corresponding motion compensation matching gear according to whether the picture is in a motion state and the degree of the motion state.
  • the appropriate motion compensation gear is automatically matched to improve the viewer's experience.
  • the present application also proposes a second embodiment, which is based on the first embodiment.
  • the frame rate is less than or equal to the first set threshold, for example, less than 24 frames per second, at this time, due to the long interval between adjacent frames, it is easy to add video frames that did not appear in the original video if frame interpolation is performed. Causes the picture to be broken, further aggravates the possibility of screen jitter, delay and other problems, affecting the user experience. Therefore, when the video frame rate is less than the first set threshold, motion compensation is not performed. This step can avoid frame insertion when the video is at a low frame rate, prevent problems such as screen breakage, jitter, and delay, and improve user experience.
  • the first set threshold for example, less than 24 frames per second
  • steps S100 to S300 are the same as those of the steps S100 to S300 in the embodiment corresponding to FIG. 2 .
  • steps S100 to S300 please refer to the descriptions of the steps S100 to S300 .
  • the present application also proposes a video automatic motion compensation device, including: an acquisition module 101, a detection module 102, a frame insertion module 103, a second acquisition module 104 and a motion compensation module 105, wherein:
  • the first acquisition module 101 is used to acquire the video played by the video playback device
  • the detection module 102 is used to detect the frame rate of the video
  • the judging module 103 is configured to judge whether the two adjacent frames appear based on the inter-frame correlation between the adjacent two frames in each group of the video when the frame rate is greater than the first set threshold Scene change; the group is composed of video frame images contained per second;
  • the second acquiring module 104 is configured to acquire the inter-frame motion speed between the adjacent frames in which the scene transition occurs in the group when the scene transition occurs in the two adjacent frames;
  • the motion compensation module 105 is configured to perform motion compensation on the video based on the inter-frame motion speed and the inter-frame correlation.
  • the present application also proposes a computer-readable storage medium, where one or more programs are stored in the computer-readable storage medium, and the one or more programs can be executed by one or more processors to realize the video Steps in an automatic motion compensation method.
  • the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions
  • the apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
  • any reference signs placed between parentheses shall not be construed as limiting the claim.
  • the word “comprising” does not exclude the presence of elements or steps not listed in a claim.
  • the word “a” or “an” preceding an element does not preclude the presence of a plurality of such elements.
  • the present application may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware.
  • the use of the words first, second, and third, etc. do not denote any order. These words can be interpreted as names.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Television Systems (AREA)

Abstract

Disclosed are a video automatic motion compensation method, apparatus, and device, and a storage medium. The method comprises: when the frame rate of a video played by a video playing device is greater than a first set threshold, determining, on the basis of the inter-frame correlation between two adjacent frames in each base group of the video, whether a scene transformation occurs between the two adjacent frames; when a scene transformation occurs between the two adjacent frames, acquiring an inter-frame motion speed between the adjacent frames; and performing motion compensation on the video on the basis of the inter-frame motion speed and the inter-frame correlation.

Description

视频自动运动补偿方法、装置、设备及存储介质Video automatic motion compensation method, device, device and storage medium
优先权信息priority information
本申请要求于2020年12月28日申请的、申请号为202011588510.7的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on December 28, 2020 with application number 202011588510.7, the entire contents of which are incorporated herein by reference.
技术领域technical field
本申请涉及视频运动补偿领域,尤其涉及一种视频自动运动补偿方法、系统、设备及存储介质。The present application relates to the field of video motion compensation, and in particular, to a video automatic motion compensation method, system, device and storage medium.
背景技术Background technique
随着电视机的行业发展,电视机正在变得越发智能化和人性化,具体体现在例如电视机的图像模式越来越丰富。现在电视机中往往设置多种图像模式,多种图像模式包括鲜艳、标准、体育、影院等,这些模式下会对应设计一些定制化的参数来满足用户需求。例如:清晰度、对比度、色彩、降噪、运动补偿等。然而这些可调参数也会分不同的水平。如:强、中、低等。以运动补偿为例,运动补偿是通过芯片和算法预估物体运动的轨迹,最终补偿出视频源中本身没有的画面,达到画面更为流畅的目的。体育模式下大多数是以运动画面为主,自然对应运动补偿要求较强。但是在标准模式播放源类型杂乱。With the development of the television industry, televisions are becoming more and more intelligent and humanized, which is embodied in, for example, that the image modes of televisions are becoming more and more abundant. Now TVs are often set with a variety of image modes, including vivid, standard, sports, cinema, etc. In these modes, some customized parameters will be designed to meet user needs. For example: sharpness, contrast, color, noise reduction, motion compensation, etc. However, these tunable parameters can also be divided into different levels. Such as: strong, medium, low and so on. Taking motion compensation as an example, motion compensation estimates the trajectory of object motion through chips and algorithms, and finally compensates for the picture that is not in the video source itself, so as to achieve a smoother picture. In sports mode, most of them are based on motion pictures, which naturally require strong motion compensation. But in standard mode playback source type is messy.
但是现有的电视机针的菜单中运动补偿档位在一些画面无法自动适配。在固定模式下只对应固定一组运动补偿参数,导致一些特殊画面下运动补偿参数过强或过弱,故而画面发生破碎、抖动、延迟等问题,影响用户体验。However, the motion compensation gear in the menu of the existing TV needle cannot be automatically adapted in some pictures. In the fixed mode, only one set of motion compensation parameters is fixed, resulting in too strong or too weak motion compensation parameters in some special pictures, so the picture is broken, jittered, delayed and other problems, affecting the user experience.
上述内容仅用于辅助理解本申请的技术方案,并不代表承认上述内容是现有技术。The above content is only used to assist the understanding of the technical solutions of the present application, and does not mean that the above content is the prior art.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种视频自动运动补偿方法、系统、设备及存储介质,旨在解决现有运动补偿方法在一些画面无法自动适配,影响用户体验的问题。Embodiments of the present application provide a video automatic motion compensation method, system, device, and storage medium, which aim to solve the problem that the existing motion compensation method cannot be automatically adapted in some pictures, which affects user experience.
本申请实施例提供了一种视频自动运动补偿方法,用于视频播放设备,所述方法包括:The embodiment of the present application provides a video automatic motion compensation method, which is used in a video playback device, and the method includes:
获取所述视频播放设备播放的视频;Obtain the video played by the video playback device;
检测所述视频的帧率;detecting the frame rate of the video;
当所述帧率大于第一设定阈值时,则基于所述视频的每个基群内相邻两帧之间的帧间相关度,判断所述相邻两帧是否出现场景变换;所述基群由每秒包含的视频帧图像组成;When the frame rate is greater than the first set threshold, based on the inter-frame correlation between two adjacent frames in each group of the video, it is judged whether there is a scene change in the two adjacent frames; the The base group consists of the video frame images contained per second;
当所述相邻两帧出现场景变换时,则获取所述基群内发生场景变换的相邻帧之间的帧间运动速度;以及When a scene change occurs in the two adjacent frames, obtaining the inter-frame motion speed between the adjacent frames in which the scene change occurs in the group; and
基于所述帧间运动速度和所述帧间相关度对所述视频进行运动补偿。The video is motion compensated based on the inter-frame motion speed and the inter-frame correlation.
在一些实施例中,还包括:当所述帧率小于或等于所述第一设定阈值时,则不对所述相邻两帧进行运动补偿。In some embodiments, the method further includes: when the frame rate is less than or equal to the first set threshold, not performing motion compensation on the two adjacent frames.
在一些实施例中,所述基于所述视频的每个基群内相邻两帧之间的帧间相关度,判断所述相邻两帧是否出现场景变换,包括:In some embodiments, determining whether a scene change occurs in the two adjacent frames based on the inter-frame correlation between two adjacent frames in each group of the video includes:
当所述基群内相邻两帧中的后一帧视频帧图像的帧间相关度小于或等于第二设定阈值时,则判断所述相邻两帧出现场景变换;When the inter-frame correlation of the next frame of video frame image in the two adjacent frames in the group is less than or equal to the second set threshold, then it is judged that the two adjacent frames have scene change;
当所述基群内相邻两帧中的后一帧视频帧图像的帧间相关度大于第二设定阈值时,则判断所述相邻两帧不出现场景变换。When the inter-frame correlation of the next video frame image in the two adjacent frames in the group is greater than the second set threshold, it is determined that there is no scene change in the two adjacent frames.
在一些实施例中,基于所述帧间运动速度和所述帧间相关度对所述视频进行运动补偿,包括:In some embodiments, performing motion compensation on the video based on the inter-frame motion speed and the inter-frame correlation includes:
分别对所述帧间运动速度和所述帧间相关度进行排序;Sorting the inter-frame motion speed and the inter-frame correlation respectively;
基于排序后的所述帧间相关度和所述帧间运动速度确定待插帧位置;Determine the position of the frame to be inserted based on the sorted inter-frame correlation and the inter-frame motion speed;
在所述场景变换的位置获得内插帧;obtaining an interpolated frame at the location of the scene change;
基于基群内相邻两帧对应宏块之间的块运动矢量和所述内插帧,在所述待插帧位置处进行运动补偿插帧。Based on the block motion vector between the corresponding macroblocks of two adjacent frames in the group and the interpolation frame, the motion compensation frame interpolation is performed at the position of the frame to be inserted.
在一些实施例中,所述分别对所述帧间运动速度和所述帧间相关度进行排序,包括:In some embodiments, the sorting of the inter-frame motion speed and the inter-frame correlation, respectively, includes:
依次获取所述基群内相邻两帧之间的帧间相关度,并对求取的帧间相关度进行排序;Obtaining the inter-frame correlation between two adjacent frames in the group in turn, and sorting the obtained inter-frame correlation;
依次获得所述基群内相邻两帧对应宏块之间的块运动矢量和帧间对应宏块之间的块间相关度;Obtaining the block motion vector between the corresponding macroblocks of two adjacent frames in the group and the inter-block correlation between the corresponding macroblocks between the frames in turn;
根据所述块运动矢量和所述块间相关度获取帧间运动速度,并对获取的所述帧间运动速度进行排序。The inter-frame motion speed is obtained according to the block motion vector and the inter-block correlation, and the obtained inter-frame motion speed is sorted.
在一些实施例中,所述基于排序后的所述帧间相关度和所述帧间运动速度确定待插帧位置,包括:In some embodiments, the determining the position of the frame to be inserted based on the sorted inter-frame correlation and the inter-frame motion speed includes:
基于排序后的帧间相关度和帧间运动速度判断视频帧图像的运动快慢;Determine the motion speed of the video frame image based on the sorted inter-frame correlation and inter-frame motion speed;
根据相邻的帧间运动速度之间的相似度确定所求帧间运动速度的精确度;获取视频帧图像的运动快慢排序和帧间运动速度的精确度排序;Determine the accuracy of the required inter-frame motion speed according to the similarity between the adjacent inter-frame motion speeds; obtain the motion speed sorting of the video frame images and the accuracy sorting of the inter-frame motion speeds;
根据所述运动快慢排序和所述精确度排序确定待插帧的位置。The position of the frame to be inserted is determined according to the motion speed sorting and the accuracy sorting.
在一些实施例中,所述基于基群内相邻两帧对应宏块之间的块运动矢量和所述内插帧,在所述待插帧位置处进行运动补偿插帧的步骤之后还包括:In some embodiments, the step of performing motion-compensated frame interpolation at the position of the frame to be inserted based on the block motion vector between corresponding macroblocks of two adjacent frames in the group and the interpolation frame further includes: :
计算运动补偿插帧的数量;基于所述运动补偿插帧的数量确定运动补偿匹配档位。Calculate the number of motion-compensated interpolated frames; determine the motion-compensated matching gear based on the number of motion-compensated interpolated frames.
在一些实施例中,所述运动补偿匹配档位包括第一档位和第二档位;或者所述运动补偿匹配档位包括第一档位、第二档位和第三档位。In some embodiments, the motion-compensated matching gear includes a first gear and a second gear; or the motion-compensated matching gear includes a first gear, a second gear, and a third gear.
在一些实施例中,所述相邻的帧间运动速度之间的相似度,由以下公式计算得出:In some embodiments, the similarity between the adjacent inter-frame motion speeds is calculated by the following formula:
Figure PCTCN2021136774-appb-000001
Figure PCTCN2021136774-appb-000001
i表示基群内任一帧,v i,v i+1表示两个相邻帧各自的运动速度,M表示一个基群内的总帧数,S i,i+1表示相邻的帧间运动速度之间的相似度。 i represents any frame in the group, v i , v i+1 represent the respective motion speeds of two adjacent frames, M represents the total number of frames in a group, S i,i+1 represent the adjacent frames Similarity between motion speeds.
在一些实施例中,所述帧间相关度是基群内相邻两帧之间的相关程度,由以下公式计算得出:In some embodiments, the inter-frame correlation is the correlation between two adjacent frames in the group, and is calculated by the following formula:
Figure PCTCN2021136774-appb-000002
Figure PCTCN2021136774-appb-000002
t=1,2,...,M-1;t=1,2,...,M-1;
γ t=|ρ t| γ t = |ρ t |
其中,f t和f t+1分别代表一个基群内相邻的两帧;E[f t]与D[f t]分别表示帧像素值的均值和方差;ρ t表示基群内相邻两帧之间的相关程度,所述相邻两帧包括正数或负数;γ t表示ρ t的绝对值;M表示一个基群内的总帧数。 Among them, f t and f t+1 respectively represent two adjacent frames in a group; E[f t ] and D[f t ] represent the mean and variance of frame pixel values, respectively; ρ t represents the adjacent frame in the group The degree of correlation between two frames, the two adjacent frames include positive or negative numbers; γ t represents the absolute value of ρ t ; M represents the total number of frames in a group.
在一些实施例中,其中,采用双向重叠块运动补偿进行插帧。In some embodiments, frame interpolation is performed using bidirectional overlapping block motion compensation.
在一些实施例中,其中,所述依次获得所述基群内相邻两帧对应宏块之间的块运动矢量和帧间对应宏块之间的块间相关度,将所述块运动矢量和所述块间相关度结合求得帧间运动速度,并对求取的帧间运动速度进行排序,包括:In some embodiments, the block motion vector between corresponding macroblocks of two adjacent frames in the group and the inter-block correlation between corresponding macroblocks between frames are sequentially obtained, and the block motion vector The inter-frame motion speed is obtained in combination with the inter-block correlation degree, and the obtained inter-frame motion speed is sorted, including:
采用菱形搜索法对相邻两帧f t和f t+1进行运动估计; Motion estimation is performed on two adjacent frames f t and f t+1 by using the diamond search method;
对相邻两帧f t和f t+1进行宏块划分,并计算对应宏块之间的相对系数绝对值,作为块间相关度; Perform macroblock division on two adjacent frames f t and f t+1 , and calculate the absolute value of the relative coefficient between the corresponding macroblocks as the inter-block correlation;
基于对应宏块间的块运动矢量和块间相关度,采用掐尾法去掉块间相关度大于0.9的宏块的块运动矢量;Based on the block motion vector and the inter-block correlation between the corresponding macroblocks, adopt the tail-pinching method to remove the block motion vector of the macroblock whose inter-block correlation is greater than 0.9;
对相邻两帧内剩余宏块的块运动矢量求均值,作为相邻两帧f t和f t+1之间的运动速度vt,t=1,2,…,M-1;其中f t和f t+1分别代表一个基群内相邻的两帧;M表示一个基群内的总帧数; Calculate the average value of the block motion vectors of the remaining macroblocks in the adjacent two frames, as the motion speed vt between the adjacent two frames f t and f t+1 , t=1,2,...,M-1; where f t and f t+1 respectively represent two adjacent frames in a group; M represents the total number of frames in a group;
对基群内M个帧依次重复进行上述三步,得到M-1个帧间运动速度;Repeat the above three steps for M frames in the base group in turn to obtain M-1 inter-frame motion speeds;
对求取的所述帧间运动速度按照从大到小排序。Sort the obtained motion speed between frames in descending order.
本申请还提出一种视频自动运动补偿装置,所述装置包括:The present application also proposes a video automatic motion compensation device, the device comprising:
第一获取模块,用于获取所述视频播放设备播放的视频;a first acquisition module, used to acquire the video played by the video playback device;
检测模块,用于检测所述视频的帧率;a detection module for detecting the frame rate of the video;
判断模块,用于当所述帧率大于第一设定阈值时,则基于所述视频的每个基群内相邻两帧之间的帧间相关度,判断所述相邻两帧是否出现场景变换;所述基群由每秒包含的视频帧图像组成;A judgment module, configured to judge whether the two adjacent frames appear based on the inter-frame correlation between the adjacent two frames in each group of the video when the frame rate is greater than the first set threshold Scene change; the group is composed of video frame images contained per second;
第二获取模块,用于当所述相邻两帧出现场景变换时,则获取所述基群内发生场景变换的相邻帧之间的帧间运动速度;以及a second acquiring module, configured to acquire the inter-frame motion speed between the adjacent frames in which the scene transition occurs in the group when the scene transition occurs in the two adjacent frames; and
运动补偿模块,用于基于所述帧间运动速度和所述帧间相关度对所述视频进行运动补偿。A motion compensation module, configured to perform motion compensation on the video based on the inter-frame motion speed and the inter-frame correlation.
本申请还提出一种视频自动运动补偿设备,所述设备包括处理器、与所述处理器电连接的存储器及存储在所述存储器上并可在所述处理器上运行的视频自动运动补偿程序;所述视频自动运动补偿程序被所述处理器执行时实现所述的视频自动运动补偿方法的步骤。The present application also proposes a video automatic motion compensation device, the device includes a processor, a memory electrically connected to the processor, and a video automatic motion compensation program stored on the memory and executable on the processor ; the steps of implementing the video automatic motion compensation method when the video automatic motion compensation program is executed by the processor.
本申请还提出一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现所述的视频自动运动补偿方法中的步骤。The present application also proposes a computer-readable storage medium, where one or more programs are stored in the computer-readable storage medium, and the one or more programs can be executed by one or more processors to realize the video Steps in an automatic motion compensation method.
本申请实施例通过获取所述视频播放设备播放的视频;再检测所述视频的帧率,若当所述帧率大于第一设定阈值时,则基于所述视频的每个基群内相邻两帧之间的帧间相关度,判断所述相邻两帧是否出 现场景变换;所述基群由每秒包含的视频帧图像组成;若当所述相邻两帧出现场景变换时,则获取所述基群内发生场景变换的相邻帧之间的帧间运动速度,基于所述帧间运动速度和所述帧间相关度对所述视频进行运动补偿。本实施例基于帧间运动速度和帧间相关度相结合的方法判断物体运动的快慢,通过运动补偿插帧,依据插帧数量,自动适配运动补偿档位。本申请根据画面是否处于运动状态以及运动状态的程度匹配到相应的运动补偿匹配档位。在应用电视机来观看运动内容时自动匹配到合适的运动补偿档位,提高观看者的体验感。In this embodiment of the present application, the video played by the video playback device is acquired; the frame rate of the video is then detected, and if the frame rate is greater than the first set threshold, the frame rate of each group of the video is The inter-frame correlation between two adjacent frames, to determine whether scene changes occur in the two adjacent frames; the base group is composed of video frame images included per second; if scene changes occur in the two adjacent frames, Then, the inter-frame motion speed between adjacent frames in which scene change occurs in the group is acquired, and motion compensation is performed on the video based on the inter-frame motion speed and the inter-frame correlation. In this embodiment, the speed of the motion of the object is judged based on the combination of the inter-frame motion speed and the inter-frame correlation, and the motion compensation gear is automatically adapted according to the number of frames inserted through motion compensation. The present application matches the corresponding motion compensation matching gear according to whether the picture is in a motion state and the degree of the motion state. When the TV is used to watch sports content, the appropriate motion compensation gear is automatically matched to improve the viewer's experience.
附图说明Description of drawings
图1为本申请的视频自动运动补偿设备的一实施例的硬件框架图;1 is a hardware framework diagram of an embodiment of an automatic video motion compensation device of the present application;
图2为本申请的视频自动运动补偿方法的一实施例的流程框图;2 is a flowchart of an embodiment of a video automatic motion compensation method of the present application;
图3为图2中步骤300的一实施例的流程框图;FIG. 3 is a flowchart of an embodiment of step 300 in FIG. 2;
图4为图3中步骤340的一实施例的流程框图;FIG. 4 is a flowchart of an embodiment of step 340 in FIG. 3;
图5为图2中步骤300的另一实施例的流程框图;FIG. 5 is a flowchart of another embodiment of step 300 in FIG. 2;
图6为本申请的视频自动运动补偿方法的另一实施例的流程框图;6 is a flowchart of another embodiment of the automatic video motion compensation method of the present application;
图7为本申请的视频自动运动补偿装置的一实施例的模块示意图;FIG. 7 is a schematic block diagram of an embodiment of the video automatic motion compensation apparatus of the present application;
图8a和图8b分别表示本申请中的菱形搜索法中的大菱形和小菱形的示意图;Fig. 8a and Fig. 8b respectively represent the schematic diagrams of the large diamond and the small diamond in the diamond search method in this application;
图9表示本申请中的双向重叠块运动补偿的示意图。FIG. 9 shows a schematic diagram of bidirectional overlapping block motion compensation in the present application.
具体实施方式Detailed ways
为了更好的理解上述技术方案,下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。For better understanding of the above technical solutions, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be more thoroughly understood, and will fully convey the scope of the present disclosure to those skilled in the art.
随着电视机的行业发展,电视机正在变得越发智能化和人性化,具体体现在例如电视机的图像模式越来越丰富。现在电视机中往往设置多种图像模式,多种图像模式包括鲜艳、标准、体育、影院等,这些模式下会对应设计一些定制化的参数来满足用户需求。例如:清晰度、对比度、色彩、降噪、运动补偿等。然而这些可调参数也会分不同的水平。如:强、中、低等。以运动补偿为例,运动补偿是通过芯片和算法预估物体运动的轨迹,最终补偿出视频源中本身没有的画面,达到画面更为流畅的目的。体育模式下大多数是以运动画面为主,自然对应运动补偿要求较强。但是在标准模式播放源类型杂乱。With the development of the television industry, televisions are becoming more and more intelligent and humanized, which is embodied in, for example, that the image modes of televisions are becoming more and more abundant. Now TVs are often set with a variety of image modes, including vivid, standard, sports, cinema, etc. In these modes, some customized parameters will be designed to meet user needs. For example: sharpness, contrast, color, noise reduction, motion compensation, etc. However, these tunable parameters can also be divided into different levels. Such as: strong, medium, low and so on. Taking motion compensation as an example, motion compensation estimates the trajectory of object motion through chips and algorithms, and finally compensates for the picture that is not in the video source itself, so as to achieve a smoother picture. In sports mode, most of them are based on motion pictures, which naturally require strong motion compensation. But in standard mode playback source type is messy.
但是现有的电视机针的菜单中运动补偿档位在一些画面无法自动适配。在固定模式下只对应固定一组运动补偿参数,导致一些特殊画面下运动补偿参数过强或过弱,故而画面发生破碎、抖动、延迟等问题,影响用户体验。However, the motion compensation gear in the menu of the existing TV needle cannot be automatically adapted in some pictures. In the fixed mode, only one set of motion compensation parameters is fixed, resulting in too strong or too weak motion compensation parameters in some special pictures, so the picture is broken, jittered, delayed and other problems, affecting the user experience.
因此,当前需要解决现有运动补偿方法在一些画面无法自动适配,影响用户体验的问题。鉴于此,本申请提出一种视频自动运动补偿方法、系统、设备及存储介质。Therefore, it is currently necessary to solve the problem that the existing motion compensation method cannot automatically adapt to some pictures, which affects the user experience. In view of this, the present application proposes a video automatic motion compensation method, system, device and storage medium.
请参照图1,下面介绍一种视频自动运动补偿设备,该视频自动运动补偿设备可以包括:处理器1001,例如CPU,存储器1005,用户接口1003,网络接口1004,通信总线1002。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括输入单元比如键盘(Keyboard),可选用户接 口1003还可以包括标准的有线接口、无线接口。网络接口1004可选包括无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。Referring to FIG. 1 , an automatic video motion compensation device is described below. The automatic video motion compensation device may include: a processor 1001 , such as a CPU, a memory 1005 , a user interface 1003 , a network interface 1004 , and a communication bus 1002 . Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include an input unit such as a keyboard, and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a wireless interface (eg, a WI-FI interface). The memory 1005 may be high-speed RAM memory, or may be non-volatile memory, such as disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001 .
本领域技术人员可以理解,图1中出示的视频自动运动补偿设备结构并不构成对视频自动运动补偿设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the structure of the automatic video motion compensation device shown in FIG. 1 does not constitute a limitation on the automatic video motion compensation device, and may include more or less components than those shown in the figure, or combine some components, or Different component arrangements.
如图1所示,作为一种计算机存储介质的存储器1005中可以包括操作系统、网络通信模块、用户接口模块以及视频自动运动补偿程序。其中,操作系统是管理和控制视频自动运动补偿设备硬件和软件资源的程序,支持视频自动运动补偿程序以及其它软件或程序的运行。As shown in FIG. 1 , the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module and a video automatic motion compensation program. The operating system is a program that manages and controls the hardware and software resources of the automatic video motion compensation device, and supports the operation of the automatic video motion compensation program and other software or programs.
在图1所示的视频自动运动补偿设备中,网络接口1004主要用于后台服务器,与后台服务器进行数据通信;处理器1001可以用于调用存储器1005中存储的视频自动运动补偿程序,并执行如上所述的视频自动运动补偿方法的步骤。In the video automatic motion compensation device shown in FIG. 1, the network interface 1004 is mainly used for the background server, and performs data communication with the background server; the processor 1001 can be used to call the video automatic motion compensation program stored in the memory 1005, and execute the above The steps of the video automatic motion compensation method.
在一实施例中,处理器1001可以用于调用存储器1005中存储的视频自动运动补偿程序,并执行以所述方法包括:In one embodiment, the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and execute the method including:
获取所述视频播放设备播放的视频;Obtain the video played by the video playback device;
检测所述视频的帧率;detecting the frame rate of the video;
当所述帧率大于第一设定阈值时,则基于所述视频的每个基群内相邻两帧之间的帧间相关度,判断所述相邻两帧是否出现场景变换;所述基群由每秒包含的视频帧图像组成;When the frame rate is greater than the first set threshold, based on the inter-frame correlation between two adjacent frames in each group of the video, it is judged whether there is a scene change in the two adjacent frames; the The base group consists of the video frame images contained per second;
当所述相邻两帧出现场景变换时,则获取所述基群内发生场景变换的相邻帧之间的帧间运动速度;以及When a scene change occurs in the two adjacent frames, obtaining the inter-frame motion speed between the adjacent frames in which the scene change occurs in the group; and
基于所述帧间运动速度和所述帧间相关度对所述视频进行运动补偿。The video is motion compensated based on the inter-frame motion speed and the inter-frame correlation.
在一实施例中,处理器1001可以用于调用存储器1005中存储的视频自动运动补偿程序,并执行以所述方法包括:In one embodiment, the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and execute the method including:
还包括:当所述帧率小于或等于所述第一设定阈值时,则不对所述相邻两帧进行运动补偿。It also includes: when the frame rate is less than or equal to the first set threshold, not performing motion compensation on the two adjacent frames.
在一实施例中,处理器1001可以用于调用存储器1005中存储的视频自动运动补偿程序,并执行以所述方法包括:In one embodiment, the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and execute the method including:
所述基于所述视频的每个基群内相邻两帧之间的帧间相关度,判断所述相邻两帧是否出现场景变换,包括:Described based on the inter-frame correlation between two adjacent frames in each group of the video, judging whether there is a scene change in the two adjacent frames, including:
当所述基群内相邻两帧中的后一帧视频帧图像的帧间相关度小于或等于第二设定阈值时,则判断所述相邻两帧出现场景变换;When the inter-frame correlation of the next frame of video frame image in the two adjacent frames in the group is less than or equal to the second set threshold, then it is judged that the two adjacent frames have scene change;
当所述基群内相邻两帧中的后一帧视频帧图像的帧间相关度大于第二设定阈值时,则判断所述相邻两帧不出现场景变换。When the inter-frame correlation of the next video frame image in the two adjacent frames in the group is greater than the second set threshold, it is determined that there is no scene change in the two adjacent frames.
在一实施例中,处理器1001可以用于调用存储器1005中存储的视频自动运动补偿程序,并执行以所述方法包括:In one embodiment, the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and execute the method including:
分别对所述帧间运动速度和所述帧间相关度进行排序;Sorting the inter-frame motion speed and the inter-frame correlation respectively;
基于排序后的所述帧间相关度和所述帧间运动速度确定待插帧位置;Determine the position of the frame to be inserted based on the sorted inter-frame correlation and the inter-frame motion speed;
在所述场景变换的位置获得内插帧;obtaining an interpolated frame at the location of the scene change;
基于基群内相邻两帧对应宏块之间的块运动矢量和所述内插帧,在所述待插帧位置处进行运动补偿插帧。Based on the block motion vector between the corresponding macroblocks of two adjacent frames in the group and the interpolation frame, the motion compensation frame interpolation is performed at the position of the frame to be inserted.
在一实施例中,处理器1001可以用于调用存储器1005中存储的视频自动运动补偿程序,并执行以所述方法包括:In one embodiment, the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and execute the method including:
依次获取所述基群内相邻两帧之间的帧间相关度,并对求取的帧间相关度进行排序;Obtaining the inter-frame correlation between two adjacent frames in the group in turn, and sorting the obtained inter-frame correlation;
依次获得所述基群内相邻两帧对应宏块之间的块运动矢量和帧间对应宏块之间的块间相关度;Obtaining the block motion vector between the corresponding macroblocks of two adjacent frames in the group and the inter-block correlation between the corresponding macroblocks between the frames in turn;
根据所述块运动矢量和所述块间相关度获取帧间运动速度,并对获取的所述帧间运动速度进行排序。The inter-frame motion speed is obtained according to the block motion vector and the inter-block correlation, and the obtained inter-frame motion speed is sorted.
在一实施例中,处理器1001可以用于调用存储器1005中存储的视频自动运动补偿程序,并执行以所述方法包括:In one embodiment, the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and execute the method including:
所述基于排序后的所述帧间相关度和所述帧间运动速度确定待插帧位置,包括:The determining the position of the frame to be inserted based on the sorted inter-frame correlation and the inter-frame motion speed includes:
基于排序后的帧间相关度和帧间运动速度判断视频帧图像的运动快慢;Determine the motion speed of the video frame image based on the sorted inter-frame correlation and inter-frame motion speed;
根据相邻的帧间运动速度之间的相似度确定所求帧间运动速度的精确度;获取视频帧图像的运动快慢排序和帧间运动速度的精确度排序;Determine the accuracy of the required inter-frame motion speed according to the similarity between the adjacent inter-frame motion speeds; obtain the motion speed sorting of the video frame images and the accuracy sorting of the inter-frame motion speeds;
根据所述运动快慢排序和所述精确度排序确定待插帧的位置。The position of the frame to be inserted is determined according to the motion speed sorting and the accuracy sorting.
在一实施例中,处理器1001可以用于调用存储器1005中存储的视频自动运动补偿程序,并执行以所述方法包括:In one embodiment, the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and execute the method including:
所述基于基群内相邻两帧对应宏块之间的块运动矢量和所述内插帧,在所述待插帧位置处进行运动补偿插帧的步骤之后还包括:The step of performing motion-compensated frame interpolation at the position to be inserted based on the block motion vector between the corresponding macroblocks of two adjacent frames in the group and the interpolation frame further includes:
计算运动补偿插帧的数量;基于所述运动补偿插帧的数量确定运动补偿匹配档位。Calculate the number of motion-compensated interpolated frames; determine the motion-compensated matching gear based on the number of motion-compensated interpolated frames.
在一实施例中,处理器1001可以用于调用存储器1005中存储的视频自动运动补偿程序,并执行以所述方法包括:In one embodiment, the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and execute the method including:
所述运动补偿匹配档位包括第一档位和第二档位;或者所述运动补偿匹配档位包括第一档位、第二档位和第三档位。The motion-compensated matching gear includes a first gear and a second gear; or the motion-compensated matching gear includes a first gear, a second gear, and a third gear.
在一实施例中,处理器1001可以用于调用存储器1005中存储的视频自动运动补偿程序,并执行以所述方法包括:其中,所述相邻的帧间运动速度之间的相似度,由以下公式计算得出:In one embodiment, the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and the execution of the method includes: wherein, the similarity between the adjacent inter-frame motion speeds is determined by: Calculated by the following formula:
Figure PCTCN2021136774-appb-000003
Figure PCTCN2021136774-appb-000003
i表示基群内任一帧,v i,v i+1表示两个相邻帧各自的运动速度,M表示一个基群内的总帧数,S i,i+1表示相邻的帧间运动速度之间的相似度。 i represents any frame in the group, v i , v i+1 represent the respective motion speeds of two adjacent frames, M represents the total number of frames in a group, S i,i+1 represent the adjacent frames Similarity between motion speeds.
在一实施例中,处理器1001可以用于调用存储器1005中存储的视频自动运动补偿程序,并执行以所述方法包括:其中,所述帧间相关度是基群内相邻两帧之间的相关程度,由以下公式计算得出:In one embodiment, the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and executing the method includes: wherein, the inter-frame correlation is between two adjacent frames in the group. The degree of correlation is calculated by the following formula:
Figure PCTCN2021136774-appb-000004
Figure PCTCN2021136774-appb-000004
t=1,2,...,M-1;t=1,2,...,M-1;
γ t=|ρ t| γ t = |ρ t |
其中,f t和f t+1分别代表一个基群内相邻的两帧;E[f t]与D[f t]分别表示帧像素值的均值和方差;ρ t表示基群内相邻两帧之间的相关程度,所述相邻两帧包括正数或负数;γ t表示ρ t的绝对值;M表示一个基群内的总帧数。 Among them, f t and f t+1 respectively represent two adjacent frames in a group; E[f t ] and D[f t ] represent the mean and variance of frame pixel values, respectively; ρ t represents the adjacent frame in the group The degree of correlation between two frames, the two adjacent frames include positive or negative numbers; γ t represents the absolute value of ρ t ; M represents the total number of frames in a group.
在一实施例中,处理器1001可以用于调用存储器1005中存储的视频自动运动补偿程序,并执行以所述方法包括:其中,采用双向重叠块运动补偿进行插帧。In one embodiment, the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and the execution of the method includes: wherein, frame interpolation is performed using bidirectional overlapping block motion compensation.
在一实施例中,处理器1001可以用于调用存储器1005中存储的视频自动运动补偿程序,并执行以所述方法包括:其中,所述依次获得所述基群内相邻两帧对应宏块之间的块运动矢量和帧间对应宏块之间的块间相关度,将所述块运动矢量和所述块间相关度结合求得帧间运动速度,并对求取的帧间运动速度进行排序,包括:In one embodiment, the processor 1001 may be configured to call the video automatic motion compensation program stored in the memory 1005, and executing the method includes: wherein the sequentially obtaining macroblocks corresponding to two adjacent frames in the group The inter-block correlation between the block motion vector and the inter-frame corresponding macroblock, the block motion vector and the inter-block correlation are combined to obtain the inter-frame motion speed, and the obtained inter-frame motion speed Sort by including:
采用菱形搜索法对相邻两帧f t和f t+1进行运动估计; Motion estimation is performed on two adjacent frames f t and f t+1 by using the diamond search method;
对相邻两帧f t和f t+1进行宏块划分,并计算对应宏块之间的相对系数绝对值,作为块间相关度; Perform macroblock division on two adjacent frames f t and f t+1 , and calculate the absolute value of the relative coefficient between the corresponding macroblocks as the inter-block correlation;
基于对应宏块间的块运动矢量和块间相关度,采用掐尾法去掉块间相关度大于0.9的宏块的块运动矢量;Based on the block motion vector and the inter-block correlation between the corresponding macroblocks, adopt the tail-pinching method to remove the block motion vector of the macroblock whose inter-block correlation is greater than 0.9;
对相邻两帧内剩余宏块的块运动矢量求均值,作为相邻两帧f t和f t+1之间的运动速度vt,t=1,2,…,M-1;其中f t和f t+1分别代表一个基群内相邻的两帧;M表示一个基群内的总帧数; Calculate the average value of the block motion vectors of the remaining macroblocks in the adjacent two frames, as the motion speed vt between the adjacent two frames f t and f t+1 , t=1,2,...,M-1; where f t and f t+1 respectively represent two adjacent frames in a group; M represents the total number of frames in a group;
对基群内M个帧依次重复进行上述三步,得到M-1个帧间运动速度;Repeat the above three steps for M frames in the base group in turn to obtain M-1 inter-frame motion speeds;
对求取的所述帧间运动速度按照从大到小排序。Sort the obtained motion speed between frames in descending order.
本申请的视频自动运动补偿设备通过获取所述视频播放设备播放的视频;再检测所述视频的帧率,当所述帧率大于第一设定阈值时,则基于所述视频的每个基群内相邻两帧之间的帧间相关度,判断所述相邻两帧是否出现场景变换;所述基群由每秒包含的视频帧图像组成;当所述相邻两帧出现场景变换时,则获取所述基群内发生场景变换的相邻帧之间的帧间运动速度,基于所述帧间运动速度和所述帧间相关度对所述视频进行运动补偿。本实施例基于帧间运动速度和帧间相关度相结合的方法判断物体运动的快慢,通过运动补偿插帧,依据插帧数量,自动适配运动补偿档位。本申请根据画面是否处于运动状态以及运动状态的程度匹配到相应的运动补偿匹配档位。在应用电视机来观看运动内容时自动匹配到合适的运动补偿档位,提高观看者的体验感。The video automatic motion compensation device of the present application obtains the video played by the video playback device; then detects the frame rate of the video, and when the frame rate is greater than the first set threshold The inter-frame correlation between two adjacent frames in the group, to determine whether scene changes occur in the two adjacent frames; the base group is composed of video frame images contained in every second; when the two adjacent frames appear scene changes is obtained, the inter-frame motion speed between adjacent frames where scene changes occur in the group are acquired, and motion compensation is performed on the video based on the inter-frame motion speed and the inter-frame correlation. In this embodiment, the speed of the motion of the object is judged based on the combination of the inter-frame motion speed and the inter-frame correlation, and the motion compensation gear is automatically adapted according to the number of frames inserted through motion compensation. The present application matches the corresponding motion compensation matching gear according to whether the picture is in a motion state and the degree of the motion state. When the TV is used to watch sports content, the appropriate motion compensation gear is automatically matched to improve the viewer's experience.
请参照图2,基于上述视频自动运动补偿设备硬件架构,下面提出本申请的视频自动运动补偿方法的实施例一,视频自动运动补偿方法用于视频播放设备,视频自动运动补偿方法包括以下步骤:Please refer to FIG. 2 , based on the hardware architecture of the above-mentioned automatic video motion compensation equipment, the first embodiment of the automatic video motion compensation method of the present application is proposed below. The automatic video motion compensation method is used in a video playback device, and the automatic video motion compensation method includes the following steps:
S100、获取所述视频播放设备播放的视频。S100. Acquire the video played by the video playing device.
具体地,所述播放设备包括各种具备播放视频功能的设备,例如播放设备、电视、电脑、智能手机、平板电脑等,本实施例主要以电视进行举例说明。Specifically, the playback device includes various devices having the function of playing video, such as a playback device, a TV, a computer, a smart phone, a tablet computer, etc. This embodiment mainly takes a TV as an example for illustration.
S200、检测所述视频的帧率。S200. Detect the frame rate of the video.
S300、当所述帧率大于第一设定阈值时,则基于所述视频的每个基群内相邻两帧之间的帧间相关度,判断所述相邻两帧是否出现场景变换;所述基群由每秒包含的视频帧图像组成。S300, when the frame rate is greater than the first set threshold, then based on the inter-frame correlation between two adjacent frames in each group of the video, determine whether there is a scene change in the two adjacent frames; The population consists of video frame images contained per second.
具体地,可以从视频的配置文件中得到视频的帧率,这里的帧率指的是电视每秒显示视频帧图像的数量。基群由每秒包含的视频帧图像组成。例如,视频的帧率是24FPS,即表示每秒显示的视频帧图像为24帧。那么24帧视频帧图像则组成一个基群。Specifically, the frame rate of the video can be obtained from the configuration file of the video, where the frame rate refers to the number of video frame images displayed by the TV per second. The base group consists of video frame images contained per second. For example, the frame rate of the video is 24FPS, which means that the displayed video frame image is 24 frames per second. Then 24 frames of video frame images form a group.
若确定帧率大于第一设定阈值,为了提高显示视频的流畅度,应该对视频进行运动补偿。这里的第一设定阈值可以根据实际的情况设置,例如可以将第一设定阈值设定为24帧/秒,若检测到播放设备播放的视频的帧率高于24帧/秒则进一步基于所述视频的每个基群内相邻两帧之间的帧间相关度,判断所述相邻两帧是否出现场景变换。应理解,这里列举的第一设定阈值的具体数值只是为了所属领域技术人员更好地理解本申请实施例的技术方案,不应该理解为对本实施例的第一设定阈值的限制。If it is determined that the frame rate is greater than the first set threshold, in order to improve the fluency of the displayed video, motion compensation should be performed on the video. The first set threshold here can be set according to the actual situation. For example, the first set threshold can be set to 24 frames/second. If it is detected that the frame rate of the video played by the playback device is higher than 24 frames/second, it is further based on The inter-frame correlation between two adjacent frames in each group of the video is used to determine whether a scene change occurs in the two adjacent frames. It should be understood that the specific numerical values of the first set threshold listed here are only for those skilled in the art to better understand the technical solutions of the embodiments of the present application, and should not be construed as limitations on the first set thresholds of this embodiment.
需要说明的是,帧间相关度用于描述基群内相邻两帧之间的相关程度,即,帧间相关度判断这个基群中是否发生场景变换。例如前一帧与后一帧视频帧图像不相同,则认为发生场景变换,前一帧与后一帧画面类似,则认为场景处于未发生场景变换。帧间相关度如公式1所示:It should be noted that the inter-frame correlation is used to describe the degree of correlation between two adjacent frames in a group, that is, the inter-frame correlation determines whether a scene change occurs in this group. For example, the video frame images of the previous frame and the next frame are different, it is considered that a scene change has occurred, and the previous frame is similar to the next frame, and the scene is considered to be in no scene change. The inter-frame correlation is shown in Equation 1:
Figure PCTCN2021136774-appb-000005
Figure PCTCN2021136774-appb-000005
公式1:
Figure PCTCN2021136774-appb-000006
Formula 1:
Figure PCTCN2021136774-appb-000006
式中f t和f t+1分别代表一个基群内相邻的两帧,E[f t]与D[f t]分别表示帧像素值的均值和方差;ρ t表示基群内相邻两帧之间的相关程度,包括正数或负数;γ t表示ρ t的绝对值;M表示一个基群内的总帧数。 In the formula, f t and f t+1 represent two adjacent frames in a group, E[f t ] and D[f t ] represent the mean and variance of frame pixel values, respectively; ρ t represents the adjacent frame in the group The degree of correlation between two frames, including positive or negative numbers; γ t represents the absolute value of ρ t ; M represents the total number of frames in a group.
应理解,下文出现的f t和f t+1与本段的f t和f t+1的含义相同,均表示一个基群内相邻的两帧。 It should be understood that f t and f t+1 appearing below have the same meaning as f t and f t +1 in this paragraph, and both represent two adjacent frames in a group.
具体地,在一些实施例中,步骤S300具体包括:Specifically, in some embodiments, step S300 specifically includes:
S310、当所述基群内相邻两帧中的后一帧视频帧图像的帧间相关度小于或等于第二设定阈值时,则判断所述相邻两帧出现场景变换。S310. When the inter-frame correlation of the next video frame image in the two adjacent frames in the group is less than or equal to the second set threshold, determine that the two adjacent frames have scene change.
S320、当所述基群内相邻两帧中的后一帧视频帧图像的帧间相关度大于第二设定阈值时,则判断所述相邻两帧不出现场景变换。S320. When the inter-frame correlation of the video frame image of the next frame in the two adjacent frames in the group is greater than the second set threshold, determine that there is no scene change in the two adjacent frames.
帧间相关度越小,说明前一帧与后一帧之间的区别越大,进一步说明视频中的画面处于快速变化的运动状态,此时发生了场景变换。需要对视频进行运动补偿以丰富补偿出视频源中本身没有的画面,达到画面更为流畅的目的。若帧间相关度较大,则说明没有发生场景变换。The smaller the correlation between frames, the greater the difference between the previous frame and the next frame, which further indicates that the picture in the video is in a rapidly changing motion state, and a scene change occurs at this time. It is necessary to perform motion compensation on the video to enrich and compensate the pictures that are not in the video source itself, so as to achieve the purpose of smoother pictures. If the inter-frame correlation is relatively large, it means that no scene change has occurred.
可以理解的,帧间相关程度γ t取值在0~1范围内变动,γ t=0-0.3表示相邻两帧相关程度低,即有可能发生了场景变换;帧间相关度γ t=0.3-0.9表示相邻两帧相关程度普通,即有可能两帧间的运动速度比较大;帧间相关度γ t=0.9-1.0表示相邻两帧相关程度极高,即有可能两帧间的运动速度比较小或者无 运动。所以第二设定阈值可设置为T=0.3,同样应理解,这里列举的第二设定阈值的具体数值只是为了所属领域技术人员更好地理解本申请实施例的技术方案,不应该理解为对本实施例的第二设定阈值的限制。 It can be understood that the value of the inter-frame correlation degree γ t varies in the range of 0 to 1, and γ t = 0-0.3 indicates that the correlation degree of two adjacent frames is low, that is, a scene change may have occurred; the inter-frame correlation degree γ t = 0.3-0.9 means that the degree of correlation between two adjacent frames is normal, that is, it is possible that the motion speed between the two frames is relatively large; the degree of inter-frame correlation γ t = 0.9-1.0 means that the degree of correlation between two adjacent frames is extremely high, that is, it is possible that the two frames are closely related. The movement speed is relatively small or no movement. Therefore, the second set threshold can be set to T=0.3. It should also be understood that the specific values of the second set threshold listed here are only for those skilled in the art to better understand the technical solutions of the embodiments of the present application, and should not be understood as Restriction on the second set threshold of this embodiment.
S400、当所述相邻两帧出现场景变换时,则获取所述基群内发生场景变换的相邻帧之间的帧间运动速度。S400. When a scene change occurs in the two adjacent frames, obtain the inter-frame motion speed between the adjacent frames in the group where the scene change occurs.
S500、基于所述帧间运动速度和所述帧间相关度对所述视频进行运动补偿。S500. Perform motion compensation on the video based on the inter-frame motion speed and the inter-frame correlation.
当出现场景变换时,为了进一步获知电视播放画面变化的快慢,进一步获取发生场景变换的相邻帧之间的帧间运动速度。当帧间变化的速率越快证明画面处于运动状态,防止画面失帧,需要插帧进行运动补偿。基于所述帧间运动速度和所述帧间相关度对所述视频进行运动补偿。When a scene change occurs, in order to further know the change speed of the TV playing picture, the inter-frame motion speed between adjacent frames in which the scene change occurs is further obtained. When the rate of change between frames is faster, it proves that the picture is in a state of motion, to prevent frame loss of the picture, and it is necessary to insert frames for motion compensation. The video is motion compensated based on the inter-frame motion speed and the inter-frame correlation.
具体地,在一些实施例中,请参照图3,步骤S500进一步包括:Specifically, in some embodiments, referring to FIG. 3 , step S500 further includes:
S510、分别对所述帧间运动速度和所述帧间相关度进行排序。S510. Sort the inter-frame motion speed and the inter-frame correlation degree respectively.
步骤S510具体包括:Step S510 specifically includes:
S511、依次获取所述基群内相邻两帧之间的帧间相关度,并对所述帧间相关度进行排序。S511. Acquire the inter-frame correlations between two adjacent frames in the group in sequence, and sort the inter-frame correlations.
具体地,对步骤S200中求得的基群内的帧间相关度进行排序。Specifically, the inter-frame correlations within the group obtained in step S200 are sorted.
S512、依次获得所述基群内相邻两帧对应宏块之间的块运动矢量和帧间对应宏块之间的块间相关度。S512. Obtain block motion vectors between corresponding macroblocks of two adjacent frames in the group and the inter-block correlation between corresponding macroblocks between frames in sequence.
S513、根据所述块运动矢量和所述块间相关度获取帧间运动速度,并对获取的所述帧间运动速度进行排序。S513: Acquire the inter-frame motion speed according to the block motion vector and the inter-block correlation degree, and sort the acquired inter-frame motion speed.
在一些实施例中,具体地,步骤S513包括如下细分步骤:In some embodiments, specifically, step S513 includes the following subdivision steps:
S5131、对相邻两帧f t和f t+1进行运动估计,采用块匹配搜索中性能较好的菱形搜索法。菱形搜索法的搜索模式既不太大也不太小,大菱形(如图8a)搜索步长大,可用于粗定位,从而使搜索过程不会陷入局部最优中,小菱形(如图8b)则用于准确定位,获得更加精确的匹配点。块匹配算法得到相邻两帧间对应宏块之间的块运动矢量。 S5131. Perform motion estimation on two adjacent frames f t and f t+1 , and adopt a diamond search method with better performance in block matching search. The search pattern of the diamond search method is neither too large nor too small. The large diamond (as shown in Figure 8a) has a large search step, which can be used for rough positioning, so that the search process will not fall into local optimum, and the small diamond (as shown in Figure 8b) ) is used for accurate positioning to obtain more precise matching points. The block matching algorithm obtains the block motion vector between corresponding macroblocks between two adjacent frames.
S5132、对相邻两帧f t和f t+1进行宏块划分,并计算对应宏块之间的相对系数绝对值,作为块间相关度,其计算公式及意义与帧间相关度相同。 S5132. Perform macroblock division on two adjacent frames f t and f t+1 , and calculate the absolute value of the relative coefficient between the corresponding macroblocks as the inter-block correlation, the calculation formula and meaning of which are the same as the inter-frame correlation.
S5133、基于对应宏块间的块运动矢量和块间相关度,采用掐尾法去掉块间相关度大于0.9的宏块的块运动矢量。S5133. Based on the block motion vector and the inter-block correlation between the corresponding macroblocks, adopt a tail pinch method to remove the block motion vector of the macroblock whose inter-block correlation is greater than 0.9.
S5134、对相邻两帧内剩余宏块的块运动矢量求均值,作为相邻两帧f t和f t+1之间的运动速度vt,t=1,2,…,M-1;其中f t和f t+1分别代表一个基群内相邻的两帧;M表示一个基群内的总帧数。 S5134. Calculate the mean value of the block motion vectors of the remaining macroblocks in the adjacent two frames, as the motion speed vt between the adjacent two frames f t and f t+1 , t=1, 2, . . . , M-1; wherein f t and f t+1 respectively represent two adjacent frames in a group; M represents the total number of frames in a group.
S5135、对基群内M个帧依次重复进行上述三步,最终得到M-1个帧间运动速度。S5135: Repeat the above three steps for M frames in the base group in sequence, and finally obtain M-1 inter-frame motion speeds.
S5136、对求取的所述帧间运动速度按照从大到小排序。S5136. Sort the obtained motion speed between frames in descending order.
S520、基于排序后的所述帧间相关度和所述帧间运动速度确定待插帧位置。S520. Determine the position of the frame to be inserted based on the sorted inter-frame correlation and the inter-frame motion speed.
在一些实施例中,具体地,请参照图4,步骤S520包括如下细分步骤:In some embodiments, specifically, referring to FIG. 4 , step S520 includes the following subdivision steps:
S521、基于排序后的帧间相关度和帧间运动速度判断视频帧图像的运动快慢。S521. Determine the motion speed of the video frame image based on the sorted inter-frame correlation and the inter-frame motion speed.
S522、根据相邻的帧间运动速度之间的相似度确定所求帧间运动速度的精确度。S522. Determine the accuracy of the obtained inter-frame motion speed according to the similarity between adjacent inter-frame motion speeds.
S523、获取视频帧图像的运动快慢排序和帧间运动速度的精确度排序。S523: Acquire the motion speed ranking of the video frame images and the accuracy ranking of the motion speed between frames.
S524、根据所述运动快慢排序和所述精确度排序确定待插帧的位置。S524. Determine the position of the frame to be inserted according to the motion speed sorting and the accuracy sorting.
为了提高待插帧位置的精确性,确定所有待插帧的位置,可通过两步实现插帧位置的确定。首先结合排序后的帧间相关度和帧间运动速度,选取帧间速度快同时帧间相关度较小的两帧间为插帧位置;然后判断此时插帧数目是否已达到要求N-M个,达到要求则直接进行下一步,否则继续选取插帧位置:计算相邻的两个帧间运动速度之间的相似度S,如下公式2所示。在相似度S i,i+1较大的两个帧间运动速度v i,v i+1中选取较大的速度所对应的两帧间进行插帧,直至插帧位置数目达到要求。 In order to improve the accuracy of the positions of the frames to be inserted, and to determine the positions of all the frames to be inserted, the determination of the positions of the frames to be inserted can be realized in two steps. First, combine the sorted inter-frame correlation and inter-frame motion speed, and select two frames with fast inter-frame speed and small inter-frame correlation as the frame insertion position; If the requirements are met, go to the next step directly, otherwise continue to select the frame insertion position: calculate the similarity S between the motion speeds between two adjacent frames, as shown in the following formula 2. From the two inter-frame motion speeds v i , v i+1 with larger similarity S i,i+ 1, select the two frames corresponding to the larger speed to perform frame insertion until the number of frame insertion positions reaches the requirement.
公式2:
Figure PCTCN2021136774-appb-000007
i表示基群内任一帧,v i,v i+1表示两个相邻帧各自的运动速度,M表示一个基群内的总帧数,S i,i+1表示相邻的帧间运动速度之间的相似度。
Formula 2:
Figure PCTCN2021136774-appb-000007
i represents any frame in the group, vi and vi +1 represent the respective motion speeds of two adjacent frames, M represents the total number of frames in a group, and S i,i+1 represent the adjacent frames Similarity between motion speeds.
S530、在所述场景变换的位置获得内插帧。S530. Obtain an interpolated frame at the position of the scene transition.
当f t和f t+1两帧间相关度γ t≤T(即第二设定阈值)时认为两帧间发生了场景检测,同时通过前帧复制获得内插帧。 When the correlation between ft and ft +1 is γ t ≤T (ie, the second set threshold), it is considered that scene detection occurs between the two frames, and the interpolated frame is obtained by copying the previous frame.
S540、基于基群内相邻两帧对应宏块之间的块运动矢量和所述内插帧,在所述待插帧位置处进行运动补偿插帧。S540. Based on the block motion vector between the corresponding macroblocks of two adjacent frames in the group and the interpolation frame, perform motion compensation frame interpolation at the position of the frame to be inserted.
对上述步骤S330得到的待插帧位置进行插帧,为了有效的解决块匹配运动估计带来的块效应和空洞问题,采用二倍帧率提升中常用的双向重叠块运动补偿进行插帧,如图9所示,图9表示双向重叠块运动补偿示意图,其中,实线代表的是N×N原始的匹配,B代表是当前块,N1-N8代表当前块周围块;虚线块是以上面九个块为中心分别向上、下、左、右四个方向扩展w个宽度形成的(N+2w)×(N+2w)的扩展块。The position of the frame to be inserted obtained in the above-mentioned step S330 is inserted, and in order to effectively solve the block effect and the hole problem caused by the block matching motion estimation, the bidirectional overlapping block motion compensation commonly used in the double frame rate improvement is used to insert the frame, such as As shown in FIG. 9, FIG. 9 shows a schematic diagram of bidirectional overlapping block motion compensation, in which the solid line represents the N×N original matching, B represents the current block, and N1-N8 represent the surrounding blocks of the current block; the dotted line block is the above nine The blocks are (N+2w)×(N+2w) extended blocks formed by extending the center by w widths in the upward, downward, left, and right directions respectively.
根据原帧率M与提升后帧率N的关系,可分两种情况插帧,具体如下According to the relationship between the original frame rate M and the improved frame rate N, frames can be inserted in two cases, as follows:
a.M<N<2*M时,比如M=15,N=24,即将15帧/秒的视频提升到24帧/秒,此时需要找到9个插帧位置。按照上述步骤依次寻找,然后在插帧位置处以二倍提升中常用插帧法插入一帧即可。a. When M<N<2*M, for example, M=15, N=24, that is, the video of 15 frames/second is increased to 24 frames/second, and 9 frame insertion positions need to be found at this time. Follow the above steps to find them in turn, and then insert a frame at the position of the frame insertion by using the frame insertion method commonly used in double boosting.
b.2*M<N时,比如M=24,N=60,即将24帧/秒的视频提升到60帧/秒,此时需要插入36帧。在这种情况下,依旧按照上述步骤寻找12个(N-2*M)个插帧位置,然后在寻找到的插帧位置处以三倍提升中常用插帧法插入两个内插帧,而在其他邻帧之间以二倍提升中常用插帧法插入一个内插帧。b. When 2*M<N, for example, M=24, N=60, that is, the video of 24 frames/second is increased to 60 frames/second, and 36 frames need to be inserted at this time. In this case, still follow the above steps to find 12 (N-2*M) interpolated frame positions, and then insert two interpolated frames at the found interpolated frame positions by the common interpolated frame method in triple boosting, and An interpolated frame is inserted between other adjacent frames with a double boosting method.
请参照图5,步骤540之后还包括:Referring to FIG. 5 , after step 540, it further includes:
S550、计算运动补偿插帧的数量;基于所述运动补偿插帧的数量确定运动补偿匹配档位。S550. Calculate the number of motion compensation interpolation frames; determine the motion compensation matching gear based on the number of motion compensation interpolation frames.
具体地,运动补偿匹配档位包括第一档位和第二档位组成的二级档位,或者第一档位、第二档位和第三档位组成的三级档位。具体地,第一档位可以是高档位,对应较多的插帧数量;第二档位可以是低档位,对应较少的插帧数量。高档位表示相比低档位需要更多的插帧进行对视频画面进行运动补偿。为了丰富匹配档位,还可以将匹配档位设置为第一档位、第二档位和第三档位。此时第一档位可以是高档位,第二档位可以是中档位,第二档位可以是低档位。如下表1所示:Specifically, the motion compensation matching gear includes a second gear consisting of a first gear and a second gear, or a third gear consisting of a first gear, a second gear and a third gear. Specifically, the first gear may be a high gear, corresponding to a larger number of interpolated frames; the second gear may be a low gear, corresponding to a smaller number of inserted frames. The high level indicates that more interpolated frames are required to perform motion compensation on the video picture than the low level. In order to enrich the matching gears, the matching gears can also be set to the first gear, the second gear and the third gear. At this time, the first gear may be a high gear, the second gear may be a middle gear, and the second gear may be a low gear. As shown in Table 1 below:
插帧数量number of frames 55 1010 2020
           
匹配档位match gear Low middle high
表1Table 1
当然本申请还可通过传统插帧方式,根据基群内每一帧的权重参数决定插帧位置,采用对相邻两帧线性求和获得内插帧。Of course, the present application can also use the traditional frame interpolation method to determine the frame interpolation position according to the weight parameter of each frame in the group, and obtain the interpolation frame by linearly summing two adjacent frames.
本申请通过获取所述视频播放设备播放的视频;再检测所述视频的帧率,当所述帧率大于第一设定阈值时,则基于所述视频的每个基群内相邻两帧之间的帧间相关度,判断所述相邻两帧是否出现场景变换;所述基群由每秒包含的视频帧图像组成;当所述相邻两帧出现场景变换时,则获取所述基群内发生场景变换的相邻帧之间的帧间运动速度,基于所述帧间运动速度和所述帧间相关度对所述视频进行运动补偿。本实施例基于帧间运动速度和帧间相关度相结合的方法判断物体运动的快慢,通过运动补偿插帧,依据插帧数量,自动适配运动补偿档位。本申请根据画面是否处于运动状态以及运动状态的程度匹配到相应的运动补偿匹配档位。在应用电视机来观看运动内容时自动匹配到合适的运动补偿档位,提高观看者的体验感。The present application obtains the video played by the video playback device; and then detects the frame rate of the video, when the frame rate is greater than the first set threshold, then based on the two adjacent frames in each group of the video The inter-frame correlation between the two adjacent frames is used to determine whether there is a scene change in the two adjacent frames; the group is composed of video frame images contained in every second; when the two adjacent frames have scene changes, the The inter-frame motion speed between adjacent frames where scene changes occur in the group, and motion compensation is performed on the video based on the inter-frame motion speed and the inter-frame correlation. In this embodiment, the speed of the motion of the object is judged based on the combination of the inter-frame motion speed and the inter-frame correlation, and the motion compensation gear is automatically adapted according to the number of frames inserted through motion compensation. The present application matches the corresponding motion compensation matching gear according to whether the picture is in a motion state and the degree of the motion state. When the TV is used to watch sports content, the appropriate motion compensation gear is automatically matched to improve the viewer's experience.
基于同一发明构思,请参照图6,本申请还提出实施例二,实施例二建立在实施例一的基础之上。Based on the same inventive concept, please refer to FIG. 6 , the present application also proposes a second embodiment, which is based on the first embodiment.
实施例二Embodiment 2
本实施例的视频自动运动补偿方法包括:The video automatic motion compensation method of this embodiment includes:
S100、获取所述视频播放设备播放的视频;S100, acquiring the video played by the video playback device;
S200、检测所述视频的帧率;S200, detecting the frame rate of the video;
S300、当所述帧率大于第一设定阈值时,则基于所述视频的每个基群内相邻两帧之间的帧间相关度,判断所述相邻两帧是否出现场景变换;所述基群由每秒包含的视频帧图像组成;S300, when the frame rate is greater than the first set threshold, then based on the inter-frame correlation between two adjacent frames in each group of the video, determine whether there is a scene change in the two adjacent frames; The group consists of video frame images contained per second;
S330、当所述帧率小于或等于所述第一设定阈值时,则不对所述相邻两帧进行运动补偿。S330. When the frame rate is less than or equal to the first set threshold, do not perform motion compensation on the two adjacent frames.
当所述帧率小于或等于第一设定阈值时,例如小于24帧/秒,此时由于相邻帧之间的间隔较长,如果进行插帧添加原来视频中未出现的视频帧画面容易造成画面破碎,进一步加重画面发生抖动、延迟等问题的可能,影响用户体验。因此,在视频帧率小于第一设定阈值时,则不进行运动补偿。该步骤可避免视频处于低帧率时进行插帧,防止出现画面破碎、抖动、延迟等问题,提稿用户体验。When the frame rate is less than or equal to the first set threshold, for example, less than 24 frames per second, at this time, due to the long interval between adjacent frames, it is easy to add video frames that did not appear in the original video if frame interpolation is performed. Causes the picture to be broken, further aggravates the possibility of screen jitter, delay and other problems, affecting the user experience. Therefore, when the video frame rate is less than the first set threshold, motion compensation is not performed. This step can avoid frame insertion when the video is at a low frame rate, prevent problems such as screen breakage, jitter, and delay, and improve user experience.
S400、当所述相邻两帧出现场景变换时,则获取所述基群内发生场景变换的相邻帧之间的帧间运动速度。S400. When a scene change occurs in the two adjacent frames, obtain the inter-frame motion speed between the adjacent frames in the group where the scene change occurs.
S500、基于所述帧间运动速度和所述帧间相关度对所述视频进行运动补偿。S500. Perform motion compensation on the video based on the inter-frame motion speed and the inter-frame correlation.
上述步骤S100至步骤S300的具体实施原理及方式与对应图2的实施例中的步骤S100至步骤S300一致,具体可参见步骤S100至步骤S300的描述。The specific implementation principles and manners of the above steps S100 to S300 are the same as those of the steps S100 to S300 in the embodiment corresponding to FIG. 2 . For details, please refer to the descriptions of the steps S100 to S300 .
请参照图7,本申请还提出一种视频自动运动补偿装置,包括:获取模块101,检测模块102,插帧模块103,第二获取模块104和运动补偿模块105,其中:Please refer to FIG. 7 , the present application also proposes a video automatic motion compensation device, including: an acquisition module 101, a detection module 102, a frame insertion module 103, a second acquisition module 104 and a motion compensation module 105, wherein:
第一获取模块101用于获取所述视频播放设备播放的视频;The first acquisition module 101 is used to acquire the video played by the video playback device;
检测模块102用于检测所述视频的帧率;The detection module 102 is used to detect the frame rate of the video;
判断模块103用于当所述帧率大于第一设定阈值时,则基于所述视频的每个基群内相邻两帧之间的 帧间相关度,判断所述相邻两帧是否出现场景变换;所述基群由每秒包含的视频帧图像组成;The judging module 103 is configured to judge whether the two adjacent frames appear based on the inter-frame correlation between the adjacent two frames in each group of the video when the frame rate is greater than the first set threshold Scene change; the group is composed of video frame images contained per second;
第二获取模块104用于当所述相邻两帧出现场景变换时,则获取所述基群内发生场景变换的相邻帧之间的帧间运动速度;以及The second acquiring module 104 is configured to acquire the inter-frame motion speed between the adjacent frames in which the scene transition occurs in the group when the scene transition occurs in the two adjacent frames; and
运动补偿模块105用于基于所述帧间运动速度和所述帧间相关度对所述视频进行运动补偿。The motion compensation module 105 is configured to perform motion compensation on the video based on the inter-frame motion speed and the inter-frame correlation.
其中,视频自动运动补偿装置的各个功能模块实现的步骤可参照本申请视频自动运动补偿方法的各个实施例,此处不再赘述。Wherein, for the steps implemented by each functional module of the video automatic motion compensation device, reference may be made to the various embodiments of the video automatic motion compensation method of the present application, which will not be repeated here.
本申请还提出一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现所述的视频自动运动补偿方法中的步骤。The present application also proposes a computer-readable storage medium, where one or more programs are stored in the computer-readable storage medium, and the one or more programs can be executed by one or more processors to realize the video Steps in an automatic motion compensation method.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by those skilled in the art, the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.
应当注意的是,在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的部件或步骤。位于部件之前的单词“一”或“一个”不排除存在多个这样的部件。本申请可以借助于包括有若干不同部件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that, in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not preclude the presence of a plurality of such elements. The present application may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. do not denote any order. These words can be interpreted as names.
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。While the preferred embodiments of the present application have been described, additional changes and modifications to these embodiments may occur to those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiment and all changes and modifications that fall within the scope of this application.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims (15)

  1. 一种视频自动运动补偿方法,应用于视频播放设备,其包括:A video automatic motion compensation method, applied to a video playback device, includes:
    获取所述视频播放设备播放的视频;Obtain the video played by the video playback device;
    检测所述视频的帧率;detecting the frame rate of the video;
    当所述帧率大于第一设定阈值时,则基于所述视频的每个基群内相邻两帧之间的帧间相关度,判断所述相邻两帧是否出现场景变换;所述基群由每秒包含的视频帧图像组成;When the frame rate is greater than the first set threshold, based on the inter-frame correlation between two adjacent frames in each group of the video, it is judged whether there is a scene change in the two adjacent frames; the The base group consists of the video frame images contained per second;
    当所述相邻两帧出现场景变换时,则获取所述基群内发生场景变换的相邻帧之间的帧间运动速度;以及When a scene change occurs in the two adjacent frames, obtaining the inter-frame motion speed between the adjacent frames in which the scene change occurs in the group; and
    基于所述帧间运动速度和所述帧间相关度对所述视频进行运动补偿。The video is motion compensated based on the inter-frame motion speed and the inter-frame correlation.
  2. 根据权利要求1所述的方法,其还包括:当所述帧率小于或等于所述第一设定阈值时,则不对所述相邻两帧进行运动补偿。The method according to claim 1, further comprising: when the frame rate is less than or equal to the first set threshold, not performing motion compensation on the two adjacent frames.
  3. 根据权利要求1所述的方法,其中,所述基于所述视频的每个基群内相邻两帧之间的帧间相关度,判断所述相邻两帧是否出现场景变换,包括:The method according to claim 1, wherein the determining whether a scene change occurs in the two adjacent frames based on the inter-frame correlation between two adjacent frames in each group of the video comprises:
    当所述基群内相邻两帧中的后一帧视频帧图像的帧间相关度小于或等于第二设定阈值时,则判断所述相邻两帧出现场景变换;When the inter-frame correlation of the next frame of video frame image in the two adjacent frames in the group is less than or equal to the second set threshold, then it is judged that the two adjacent frames have scene change;
    当所述基群内相邻两帧中的后一帧视频帧图像的帧间相关度大于第二设定阈值时,则判断所述相邻两帧不出现场景变换。When the inter-frame correlation of the next video frame image in the two adjacent frames in the group is greater than the second set threshold, it is determined that there is no scene change in the two adjacent frames.
  4. 根据权利要求1所述的方法,其中,所述基于所述帧间运动速度和所述帧间相关度对所述视频进行运动补偿,包括:The method according to claim 1, wherein the performing motion compensation on the video based on the inter-frame motion speed and the inter-frame correlation comprises:
    分别对所述帧间运动速度和所述帧间相关度进行排序;Sorting the inter-frame motion speed and the inter-frame correlation respectively;
    基于排序后的所述帧间相关度和所述帧间运动速度确定待插帧位置;Determine the position of the frame to be inserted based on the sorted inter-frame correlation and the inter-frame motion speed;
    在所述场景变换的位置获得内插帧;obtaining an interpolated frame at the location of the scene change;
    基于基群内相邻两帧对应宏块之间的块运动矢量和所述内插帧,在所述待插帧位置处进行运动补偿插帧。Based on the block motion vector between the corresponding macroblocks of two adjacent frames in the group and the interpolation frame, the motion compensation frame interpolation is performed at the position of the frame to be inserted.
  5. 根据权利要求4所述的方法,其中,所述分别对所述帧间运动速度和所述帧间相关度进行排序,包括:The method according to claim 4, wherein the sorting of the inter-frame motion speed and the inter-frame correlation respectively comprises:
    依次获取所述基群内相邻两帧之间的帧间相关度;Obtaining the inter-frame correlation between two adjacent frames in the group in turn;
    对求取的帧间相关度进行排序;Sort the obtained inter-frame correlation;
    依次获得所述基群内相邻两帧对应宏块之间的块运动矢量和帧间对应宏块之间的块间相关度;Obtaining the block motion vector between the corresponding macroblocks of two adjacent frames in the group and the inter-block correlation between the corresponding macroblocks between the frames in turn;
    根据所述块运动矢量和所述块间相关度获取帧间运动速度,并对获取的所述帧间运动速度进行排序。The inter-frame motion speed is obtained according to the block motion vector and the inter-block correlation, and the obtained inter-frame motion speed is sorted.
  6. 根据权利要求4所述的方法,其中,所述基于排序后的所述帧间相关度和所述帧间运动速度确定待插帧位置,包括:The method according to claim 4, wherein the determining the position of the frame to be inserted based on the sorted inter-frame correlation and the inter-frame motion speed comprises:
    基于排序后的帧间相关度和帧间运动速度判断视频帧图像的运动快慢;Determine the motion speed of the video frame image based on the sorted inter-frame correlation and inter-frame motion speed;
    根据相邻的帧间运动速度之间的相似度确定所求帧间运动速度的精确度;Determine the accuracy of the requested inter-frame motion speed according to the similarity between adjacent inter-frame motion speeds;
    获取视频帧图像的运动快慢排序和帧间运动速度的精确度排序;Obtain the motion speed sorting of video frame images and the accuracy sorting of motion speed between frames;
    根据所述运动快慢排序和所述精确度排序确定待插帧的位置。The position of the frame to be inserted is determined according to the motion speed sorting and the accuracy sorting.
  7. 根据权利要求4所述的方法,其中,所述基于基群内相邻两帧对应宏块之间的块运动矢量和所述内插帧,在所述待插帧位置处进行运动补偿插帧的步骤之后还包括:The method according to claim 4, wherein the motion-compensated frame interpolation is performed at the position of the frame to be inserted based on the block motion vector between corresponding macroblocks of two adjacent frames in the group and the interpolation frame The steps also include:
    计算运动补偿插帧的数量;Calculate the number of motion-compensated frames;
    基于所述运动补偿插帧的数量确定运动补偿匹配档位。A motion-compensated matching gear is determined based on the number of motion-compensated interpolation frames.
  8. 根据权利要求7所述的方法,其中,所述运动补偿匹配档位包括第一档位和第二档位;或者所述运动补偿匹配档位包括第一档位、第二档位和第三档位组成的三级档位。8. The method of claim 7, wherein the motion-compensated matching gear includes a first gear and a second gear; or the motion-compensated matching gear includes a first gear, a second gear, and a third gear The three-level gear is composed of gears.
  9. 根据权利要求6所述的方法,其中,所述相邻的帧间运动速度之间的相似度,由以下公式计算得出:The method according to claim 6, wherein the similarity between the adjacent inter-frame motion speeds is calculated by the following formula:
    Figure PCTCN2021136774-appb-100001
    Figure PCTCN2021136774-appb-100001
    i表示基群内任一帧,v i,v i+1表示两个相邻帧各自的运动速度,M表示一个基群内的总帧数,S i,i+1表示相邻的帧间运动速度之间的相似度。 i represents any frame in the group, v i , v i+1 represent the respective motion speeds of two adjacent frames, M represents the total number of frames in a group, S i,i+1 represent the adjacent frames Similarity between motion speeds.
  10. 根据权利要求1所述的方法,其中,所述帧间相关度是基群内相邻两帧之间的相关程度,由以下公式计算得出:The method according to claim 1, wherein the inter-frame correlation is the correlation between two adjacent frames in the group, and is calculated by the following formula:
    Figure PCTCN2021136774-appb-100002
    Figure PCTCN2021136774-appb-100002
    t=1,2,...,M-1;t=1,2,...,M-1;
    γ t=|ρ t| γ t = |ρ t |
    其中,f t和f t+1分别代表一个基群内相邻的两帧;E[f t]与D[f t]分别表示帧像素值的均值和方差;ρ t表示基群内相邻两帧之间的相关程度,所述相邻两帧包括正数或负数;γ t表示ρ t的绝对值;M表示一个基群内的总帧数。 Among them, f t and f t+1 respectively represent two adjacent frames in a group; E[f t ] and D[f t ] represent the mean and variance of frame pixel values, respectively; ρ t represents the adjacent frame in the group The degree of correlation between two frames, the two adjacent frames include positive or negative numbers; γ t represents the absolute value of ρ t ; M represents the total number of frames in a group.
  11. 根据权利要求4所述的方法,其中,采用双向重叠块运动补偿进行插帧。5. The method of claim 4, wherein frame interpolation is performed using bidirectional overlapping block motion compensation.
  12. 根据权利要求5所述的方法,其中,所述依次获得所述基群内相邻两帧对应宏块之间的块运动矢量和帧间对应宏块之间的块间相关度,根据所述块运动矢量和所述块间相关度获取帧间运动速度,并对获取的所述帧间运动速度进行排序,包括:The method according to claim 5, wherein the step of sequentially obtaining the block motion vector between corresponding macroblocks of two adjacent frames in the group and the inter-block correlation between corresponding macroblocks between frames, according to the Obtain the inter-frame motion speed from the block motion vector and the inter-block correlation degree, and sort the acquired inter-frame motion speed, including:
    采用菱形搜索法对相邻两帧f t和f t+1进行运动估计; Motion estimation is performed on two adjacent frames f t and f t+1 by using the diamond search method;
    对相邻两帧f t和f t+1进行宏块划分,并计算对应宏块之间的相对系数绝对值,作为块间相关度; Perform macroblock division on two adjacent frames f t and f t+1 , and calculate the absolute value of the relative coefficient between the corresponding macroblocks as the inter-block correlation;
    基于对应宏块间的块运动矢量和块间相关度,采用掐尾法去掉块间相关度大于0.9的宏块的块运动矢量;Based on the block motion vector and the inter-block correlation between the corresponding macroblocks, adopt the tail-pinching method to remove the block motion vector of the macroblock whose inter-block correlation is greater than 0.9;
    对相邻两帧内剩余宏块的块运动矢量求均值,作为相邻两帧f t和f t+1之间的运动速度vt,t=1,2,…,M-1;其中f t和f t+1分别代表一个基群内相邻的两帧;M表示一个基群内的总帧数; Calculate the average value of the block motion vectors of the remaining macroblocks in the adjacent two frames, as the motion speed vt between the adjacent two frames f t and f t+1 , t=1,2,...,M-1; where f t and f t+1 respectively represent two adjacent frames in a group; M represents the total number of frames in a group;
    对基群内M个帧依次重复进行上述三步,得到M-1个帧间运动速度;Repeat the above three steps for M frames in the base group in turn to obtain M-1 inter-frame motion speeds;
    对求取的所述帧间运动速度按照从大到小排序。Sort the obtained inter-frame motion speeds in descending order.
  13. 一种视频自动运动补偿装置,其包括:A video automatic motion compensation device, comprising:
    第一获取模块,用于获取所述视频播放设备播放的视频;a first acquisition module, configured to acquire the video played by the video playback device;
    检测模块,用于检测所述视频的帧率;a detection module for detecting the frame rate of the video;
    判断模块,用于当所述帧率大于第一设定阈值时,则基于所述视频的每个基群内相邻两帧之间的帧间相关度,判断所述相邻两帧是否出现场景变换;所述基群由每秒包含的视频帧图像组成;A judgment module, configured to judge whether the two adjacent frames appear based on the inter-frame correlation between the adjacent two frames in each group of the video when the frame rate is greater than the first set threshold scene change; the group consists of video frame images contained per second;
    第二获取模块,用于当所述相邻两帧出现场景变换时,则获取所述基群内发生场景变换的相邻帧之间的帧间运动速度;以及a second acquiring module, configured to acquire the inter-frame motion speed between the adjacent frames in which the scene transition occurs in the group when the scene transition occurs in the two adjacent frames; and
    运动补偿模块,用于基于所述帧间运动速度和所述帧间相关度对所述视频进行运动补偿。A motion compensation module, configured to perform motion compensation on the video based on the inter-frame motion speed and the inter-frame correlation.
  14. 一种视频自动运动补偿设备,其包括处理器、与所述处理器电连接的存储器及存储在所述存储器上并可在所述处理器上运行的视频自动运动补偿程序;所述视频自动运动补偿程序被所述处理器执行时实现如权利要求1至12中任一项所述的视频自动运动补偿方法的步骤。A video automatic motion compensation device, comprising a processor, a memory electrically connected to the processor, and a video automatic motion compensation program stored on the memory and running on the processor; the video automatic motion The compensation program, when executed by the processor, implements the steps of the video automatic motion compensation method as claimed in any one of claims 1 to 12.
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如权利要求1至12中任一项所述的视频自动运动补偿方法中的步骤。A computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to realize the invention as claimed in claims 1 to 12 The steps in any one of the video automatic motion compensation methods.
PCT/CN2021/136774 2020-12-28 2021-12-09 Video automatic motion compensation method, apparatus, and device, and storage medium WO2022143078A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011588510.7 2020-12-28
CN202011588510.7A CN112788337A (en) 2020-12-28 2020-12-28 Video automatic motion compensation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022143078A1 true WO2022143078A1 (en) 2022-07-07

Family

ID=75753115

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/136774 WO2022143078A1 (en) 2020-12-28 2021-12-09 Video automatic motion compensation method, apparatus, and device, and storage medium

Country Status (2)

Country Link
CN (1) CN112788337A (en)
WO (1) WO2022143078A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116896654A (en) * 2023-09-11 2023-10-17 腾讯科技(深圳)有限公司 Video processing method and related device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112788337A (en) * 2020-12-28 2021-05-11 深圳创维-Rgb电子有限公司 Video automatic motion compensation method, device, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101867759A (en) * 2010-05-19 2010-10-20 西安交通大学 Self-adaptive motion compensation frame frequency promoting method based on scene detection
CN102665061A (en) * 2012-04-27 2012-09-12 中山大学 Motion vector processing-based frame rate up-conversion method and device
US20140056354A1 (en) * 2012-08-21 2014-02-27 Mediatek Inc. Video processing apparatus and method
CN105828106A (en) * 2016-04-15 2016-08-03 山东大学苏州研究院 Non-integral multiple frame rate improving method based on motion information
CN106375772A (en) * 2016-08-29 2017-02-01 北京小米移动软件有限公司 Video playing method and device
CN107707916A (en) * 2017-09-30 2018-02-16 河海大学 A kind of frame per second transfer algorithm based on scene change detecte
CN112788337A (en) * 2020-12-28 2021-05-11 深圳创维-Rgb电子有限公司 Video automatic motion compensation method, device, equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110536153A (en) * 2018-05-23 2019-12-03 视联动力信息技术股份有限公司 A kind of playback method and server of video data
CN111050149A (en) * 2019-12-24 2020-04-21 苏州乐梦光电科技有限公司 Video processing method, device and equipment for projection system and storage medium
CN111541940B (en) * 2020-04-30 2022-04-08 深圳创维-Rgb电子有限公司 Motion compensation method and device for display equipment, television and storage medium
CN111641828B (en) * 2020-05-16 2022-03-18 Oppo广东移动通信有限公司 Video processing method and device, storage medium and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101867759A (en) * 2010-05-19 2010-10-20 西安交通大学 Self-adaptive motion compensation frame frequency promoting method based on scene detection
CN102665061A (en) * 2012-04-27 2012-09-12 中山大学 Motion vector processing-based frame rate up-conversion method and device
US20140056354A1 (en) * 2012-08-21 2014-02-27 Mediatek Inc. Video processing apparatus and method
CN105828106A (en) * 2016-04-15 2016-08-03 山东大学苏州研究院 Non-integral multiple frame rate improving method based on motion information
CN106375772A (en) * 2016-08-29 2017-02-01 北京小米移动软件有限公司 Video playing method and device
CN107707916A (en) * 2017-09-30 2018-02-16 河海大学 A kind of frame per second transfer algorithm based on scene change detecte
CN112788337A (en) * 2020-12-28 2021-05-11 深圳创维-Rgb电子有限公司 Video automatic motion compensation method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116896654A (en) * 2023-09-11 2023-10-17 腾讯科技(深圳)有限公司 Video processing method and related device
CN116896654B (en) * 2023-09-11 2024-01-30 腾讯科技(深圳)有限公司 Video processing method and related device

Also Published As

Publication number Publication date
CN112788337A (en) 2021-05-11

Similar Documents

Publication Publication Date Title
WO2022143078A1 (en) Video automatic motion compensation method, apparatus, and device, and storage medium
US10452919B2 (en) Detecting segments of a video program through image comparisons
CN106303157B (en) Video noise reduction processing method and video noise reduction processing device
WO2021244440A1 (en) Method, apparatus, and system for adjusting image quality of television, and television set
CN101674448B (en) Video signal processing device, video signal processing method
WO2021073066A1 (en) Image processing method and apparatus
WO2023160617A9 (en) Video frame interpolation processing method, video frame interpolation processing device, and readable storage medium
JP2011041275A (en) Image processing method, data processing method, computer readable medium, and data processing apparatus
WO2018000676A1 (en) Method and device for configuring image mode
CN113613083A (en) Video playing method, device, equipment and computer readable storage medium
US20120274845A1 (en) Image processing device and method, and program
US20120008692A1 (en) Image processing device and image processing method
CN110312133A (en) Image processing method and device
US20230058707A1 (en) Methods, systems, and media for selecting video formats for adaptive video streaming
CN108074248B (en) OSD automatic detection method and device based on image content
JP5015089B2 (en) Frame rate conversion device, frame rate conversion method, television receiver, frame rate conversion program, and recording medium recording the program
CN113784221A (en) Video playing method, device, equipment and computer readable storage medium
CN112565909A (en) Video playing method and device, electronic equipment and readable storage medium
US8405767B2 (en) Image processing device
JP2008098938A (en) Pull-down sequence detection program and pull-down sequence detector
CN111836055B (en) Image processing device and image block matching method based on image content for MEMC
CN113596578B (en) Video processing method and device, electronic equipment and computer readable storage medium
US9544613B2 (en) Local detection model (LDM) for recursive motion estimation
CN115035151B (en) Method and device for detecting comb distortion, computer equipment and storage medium
US20240214443A1 (en) Methods, systems, and media for selecting video formats for adaptive video streaming

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21913819

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21913819

Country of ref document: EP

Kind code of ref document: A1