Motion information acquisition method and device, electronic equipment and storage medium
By downsampling and motion prediction processing of the video frames to be encoded, more effective candidate motion information is obtained, which solves the problem of low video coding accuracy in the existing technology and achieves higher video coding accuracy.
Patent Information
- Application Number
- CN202310113563.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-28
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2043-01-28
AI Technical Summary
In existing technologies, when determining candidate motion information of image blocks in a video frame to be encoded, the number of such information obtained is relatively small, resulting in low video encoding accuracy.
By downsampling the video frames to be encoded, the target image block corresponding to the current image block is determined, and the adjustment information for the target image block is obtained. Motion prediction processing is then performed based on the target image block and the adjustment information to update the candidate motion information set of the current image block.
This enriches the set of candidate motion information for each image block in the video frame to be encoded, improves the accuracy of video coding, and avoids the problem of insufficient candidate motion information caused by only considering specific spatial and temporal locations of image blocks.
Smart Images

Figure CN116112664B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of video coding, and particularly relates to a motion information acquisition method and device, electronic equipment and storage medium. BACKGROUND
[0002] With the development of video coding technology, inter-frame prediction technology appears; the inter-frame prediction technology mainly determines the motion information of an image block in a to-be-coded video frame through the idea of motion estimation, and then realizes the coding processing of the to-be-coded video frame according to the motion information of the image block in the to-be-coded video frame.
[0003] In the related art, when the motion information of an image block in a to-be-coded video frame is determined, candidate motion information of the image block in the to-be-coded video frame needs to be determined first, such as the candidate motion information of the image block is obtained from a spatial specific position and a temporal specific position of the image block. However, the number of the candidate motion information obtained through the above manner is small, which affects the accurate determination of the final motion information of the image block, thereby resulting in low video coding accuracy. SUMMARY
[0004] The present disclosure provides a motion information acquisition method, device, electronic equipment and storage medium to at least solve the problem of low video coding accuracy in the related art. The technical solutions of the present disclosure are as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a motion information acquisition method is provided, comprising:
[0006] determining a target image block corresponding to a current image block in a to-be-coded video frame from a target video frame of the to-be-coded video frame; the target video frame of the to-be-coded video frame is obtained by performing down-sampling processing on the to-be-coded video frame;
[0007] obtaining adjustment information for the target image block;
[0008] performing motion prediction processing based on the target image block and the adjustment information to obtain candidate motion information of the current image block;
[0009] updating an initial candidate motion information set of the current image block according to the candidate motion information of the current image block to obtain a target candidate motion information set of the current image block; the target candidate motion information set is used for coding processing of the current image block.
[0010] In an exemplary embodiment, the performing motion prediction processing based on the target image block and the adjustment information to obtain the candidate motion information of the current image block comprises:
[0011] In a case that the adjustment information is adjustment position information, an adjustment image block of the target image block is determined from the target video frame of the to-be-encoded video frame according to the target image block and the adjustment position information, as a candidate image block corresponding to the current image block;
[0012] Obtaining motion information of the candidate image block;
[0013] Obtaining candidate motion information of the current image block according to the motion information of the candidate image block.
[0014] In an example embodiment, the obtaining motion information of the candidate image block comprises:
[0015] Obtaining a reference video frame of the to-be-encoded video frame; the reference video frame is a previous video frame of the to-be-encoded video frame;
[0016] Determining a reference image block matched with the candidate image block from a target video frame of the reference video frame; the target video frame of the reference video frame is obtained by performing the downsampling processing on the reference video frame;
[0017] Obtaining motion information of the candidate image block according to displacement information between the reference image block and the candidate image block.
[0018] In an example embodiment, the obtaining candidate motion information of the current image block according to the motion information of the candidate image block comprises:
[0019] Magnifying the motion information of the candidate image block to obtain magnified motion information of the candidate image block; a magnification multiple of the motion information of the candidate image block is the same as the multiple of the downsampling;
[0020] Confirming the magnified motion information of the candidate image block as the candidate motion information of the current image block.
[0021] In an example embodiment, the determining the adjustment image block of the target image block from the target video frame of the to-be-encoded video frame according to the target image block and the adjustment position information comprises:
[0022] Obtaining current position information of the target image block in the target video frame;
[0023] Fusing the current position information and the adjustment position information to obtain adjustment image block position information of the target image block;
[0024] Determining the adjustment image block of the target image block from the target video frame of the to-be-encoded video frame according to the adjustment image block position information.
[0025] In an example embodiment, the motion prediction processing based on the target image block and the adjustment information to obtain the candidate motion information of the current image block further includes:
[0026] In a case that the adjustment information is adjustment motion information, obtaining the enlarged motion information of the target image block;
[0027] adjusting the enlarged motion information of the target image block according to the adjustment motion information to obtain target motion information of the target image block;
[0028] confirming the target motion information of the target image block as the candidate motion information of the current image block.
[0029] In an example embodiment, the obtaining the adjustment information for the target image block includes:
[0030] obtaining preset adjustment information;
[0031] confirming the preset adjustment information as the adjustment information for the target image block.
[0032] According to a second aspect of the embodiments of the present disclosure, a motion information obtaining device is provided, which includes:
[0033] an image determining unit configured to determine a target image block corresponding to a current image block in a to-be-encoded video frame from a target video frame of the to-be-encoded video frame; the target video frame of the to-be-encoded video frame is obtained by performing down-sampling processing on the to-be-encoded video frame;
[0034] an information obtaining unit configured to obtain adjustment information for the target image block;
[0035] an information determining unit configured to perform motion prediction processing based on the target image block and the adjustment information to obtain candidate motion information of the current image block;
[0036] an information updating unit configured to update an initial candidate motion information set of the current image block according to the candidate motion information of the current image block to obtain a target candidate motion information set of the current image block; the target candidate motion information set is used for encoding processing of the current image block.
[0037] In an example embodiment, the information determining unit is further configured to perform, in a case that the adjustment information is adjustment position information, determining an adjusted image block of the target image block from the target video frame of the video frame to be encoded according to the target image block and the adjustment position information, as a candidate image block corresponding to the current image block; obtaining motion information of the candidate image block; and obtaining the candidate motion information of the current image block according to the motion information of the candidate image block.
[0038] In an example embodiment, the information determining unit is further configured to perform obtaining a reference video frame of the video frame to be encoded; the reference video frame being a previous video frame of the video frame to be encoded; determining a reference image block matched with the candidate image block from a target video frame of the reference video frame; the target video frame of the reference video frame being obtained by performing the downsampling processing on the reference video frame; and obtaining the motion information of the candidate image block according to displacement information between the reference image block and the candidate image block.
[0039] In an example embodiment, the information determining unit is further configured to perform amplifying the motion information of the candidate image block to obtain amplified motion information of the candidate image block; the amplification multiple of the motion information of the candidate image block being the same as the multiple of the downsampling; and confirming the amplified motion information of the candidate image block as the candidate motion information of the current image block.
[0040] In an example embodiment, the information determining unit is further configured to perform obtaining current position information of the target image block in the target video frame; performing fusion processing on the current position information and the adjustment position information to obtain adjusted image block position information of the target image block; and determining an adjusted image block of the target image block from the target video frame of the video frame to be encoded according to the adjusted image block position information.
[0041] In an example embodiment, the information determining unit is further configured to perform, in a case that the adjustment information is adjustment motion information, obtaining amplified motion information of the target image block; adjusting the amplified motion information of the target image block according to the adjustment motion information to obtain target motion information of the target image block; and confirming the target motion information of the target image block as the candidate motion information of the current image block.
[0042] In an example embodiment, the information obtaining unit is further configured to perform obtaining preset adjustment information; and confirming the preset adjustment information as the adjustment information for the target image block.
[0043] According to a third aspect of embodiments of the present disclosure, an electronic device is provided, comprising:
[0044] a processor;
[0045] a memory for storing the processor-executable instructions;
[0046] The processor is configured to execute the instructions to implement the motion information acquisition method according to any one of the preceding embodiments.
[0047] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the motion information acquisition method according to any one of the preceding embodiments.
[0048] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided. The computer program product includes instructions. When the instructions are executed by a processor of an electronic device, the electronic device is enabled to perform the motion information acquisition method according to any one of the preceding embodiments.
[0049] The embodiments of the present disclosure provide at least the following beneficial effects:
[0050] By performing down-sampling processing on the to-be-encoded video frame, a target video frame of the to-be-encoded video frame is obtained, and a target image block corresponding to the current image block in the to-be-encoded video frame is determined from the target video frame of the to-be-encoded video frame. Then, adjustment information for the target image block is obtained. Next, motion prediction processing is performed based on the target image block and the adjustment information to obtain candidate motion information of the current image block. Finally, the initial candidate motion information set of the current image block is updated according to the candidate motion information of the current image block to obtain a target candidate motion information set of the current image block. The target candidate motion information set is used for encoding processing of the current image block. In this way, on the basis of the initial candidate motion information set of the current image block in the to-be-encoded video frame, the target image block corresponding to the current image block in the to-be-encoded video frame and the adjustment information relative to the target image block are comprehensively considered, more effective candidate motion information can be obtained for the current image block, the candidate motion information set of each image block in the to-be-encoded video frame is enriched, the possibility of obtaining more accurate motion information for each image block is provided, subsequent video encoding is more accurate, and therefore the video encoding accuracy is improved. The defect that the video encoding accuracy is low due to the fact that only the spatial specific position and the temporal specific position of the image block are considered to obtain less candidate motion information is avoided.
[0051] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and are not limiting to the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0052] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the present disclosure and, together with the description, further serve to explain the principles of the present disclosure and, do not limit the present disclosure in any inappropriable way.
[0053] Figure 1 is a flowchart of a motion information acquisition method according to an example embodiment.
[0054] Figure 2 is a schematic diagram of a current image block and a target image block according to an example embodiment.
[0055] Figure 3 is a schematic diagram of a spatial reference map according to an example embodiment.
[0056] Figure 4 is a schematic diagram of a temporal reference map according to an example embodiment.
[0057] Figure 5 is a flowchart of a method of acquiring candidate motion information of a current image block according to an example embodiment.
[0058] Figure 6 is a schematic diagram of a candidate image block according to an example embodiment.
[0059] Figure 7 is a flowchart of another method of acquiring candidate motion information of a current image block according to an example embodiment.
[0060] Figure 8 is a flowchart of another motion information acquisition method according to an example embodiment.
[0061] Figure 9 is a block diagram of a motion information acquisition apparatus according to an example embodiment.
[0062] Figure 10 is a block diagram of an electronic device according to an example embodiment. DETAILED DESCRIPTION
[0063] In order for those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings.
[0064] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation described in the following exemplary embodiments does not represent all implementations consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0065] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, analyzed data, etc.) involved in the present disclosure are all information and data authorized by the user or authorized by all parties.
[0066] Figure 1 is a flowchart of a motion information acquisition method according to an exemplary embodiment, as shown in Figure 1 The motion information acquisition method is used in a terminal; it can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is realized through interaction between the terminal and the server. In the present exemplary embodiment, the method includes the following steps:
[0067] In step S110, a target image block corresponding to a current image block in a to-be-encoded video frame is determined from a target video frame of the to-be-encoded video frame; the target video frame of the to-be-encoded video frame is obtained by down-sampling the to-be-encoded video frame.
[0068] Among them, the to-be-encoded video frame refers to a video frame that needs to be encoded, such as a video frame in a live video, a video frame in a short video, etc.
[0069] Among them, by splitting the to-be-encoded video frame, a plurality of image blocks can be obtained, and the image size of each image block is the same; for example, if the image size of the to-be-encoded video frame is 160x160, the to-be-encoded video frame can be split into 400 8x8 image blocks. The current image block in the to-be-encoded video frame refers to the image block in the to-be-encoded video frame that needs to be encoded, specifically a PU (Prediction Unit, encoding unit).
[0070] The target video frame of the to-be-encoded video frame refers to a video frame obtained after down-sampling processing of the to-be-encoded video frame, such as a low-resolution video frame. The down-sampling processing is used to reduce the image size of the to-be-encoded video frame, for example, the image size of the to-be-encoded video frame is 160x160, and the down-sampling multiple is 2, so that the image size of the target video frame is 80x80.
[0071] The target image block refers to an image block corresponding to the current image block in the to-be-encoded video frame in the target video frame of the to-be-encoded video frame. The position information of the target image block can be determined according to the position information, width, height and down-sampling multiple of the current image block. For example, referring to Figure 2 The left image refers to the to-be-encoded video frame, and the right image refers to the target video frame. The current image block A corresponds to the target image block A'. It should be noted that the image size of the target image block is the same as that of the current image block.
[0072] Specifically, the terminal acquires a video frame in a video as a to-be-encoded video frame; splits the to-be-encoded video frame according to a preset image size to obtain a plurality of image blocks; simultaneously, performs down-sampling processing on the to-be-encoded video frame to obtain a down-sampled image as a target video frame of the to-be-encoded video frame; acquires position information, width and height of a current image block in the to-be-encoded video frame, and determines target image block position information in the target video frame according to the position information, width, height and down-sampling multiple of the current image block in the to-be-encoded video frame; and determines a corresponding target image block from the target video frame according to the target image block position information as a target image block corresponding to the current image block in the to-be-encoded video frame.
[0073] It should be noted that the position information of the current image block in the to-be-encoded video frame refers to pixel coordinates, for example, for a 720x1280 image, the coordinate range is (0, 0) to (719, 1279). The target image block position information in the target video frame refers to the number of 8x8 size coding blocks, for example, for a 720x1280 image, there are 90 and 160 coding blocks in the horizontal and vertical directions respectively, so the coordinate range is (0, 0) to (89, 159).
[0074] For example, the terminal down-samples the to-be-encoded video frame to half of the original (i.e., the down-sampling multiple is 2) to obtain the target video frame of the to-be-encoded video frame, and then determines the target image block position information (the horizontal position information of the target image block in the target video frame, the vertical position information of the target image block in the target video frame) according to the following formula:
[0075] The horizontal position information of the target image block in the target video frame=(the horizontal position information of the current image block in the to-be-encoded video frame+the width of the current image block / 2) / 16.
[0076] vertical position information of the target image block in the target video frame = (vertical position information of the current image block in the video frame to be encoded + height of the current image block / 2) / 16;
[0077] Finally, the terminal determines the target image block corresponding to the current image block in the video frame to be encoded from the target video frame according to the horizontal position information and the vertical position information of the target image block in the target video frame.
[0078] In step S120, adjustment information for the target image block is obtained.
[0079] The adjustment information refers to adjustment position information, and the adjustment position information refers to adjustment position information for current position information of the target image block and is pre-set and mainly includes horizontal adjustment position information and vertical adjustment position information. It should be noted that the horizontal adjustment position information and the vertical adjustment position information both refer to adjustment position information ranges. For example, the horizontal adjustment position information is [-x1, x2] and the vertical adjustment position information is [-y1, y2]. x1, y1, x2 and y2 are all positive integers.
[0080] It should be noted that the adjustment information involved in the present disclosure can also refer to adjustment motion information. The adjustment motion information refers to adjustment motion information for the enlarged motion information of the target image block and is pre-set and mainly includes horizontal adjustment motion information and vertical adjustment motion information. It should be noted that the horizontal adjustment motion information and the vertical adjustment motion information both refer to adjustment motion information ranges. For example, the horizontal adjustment motion information is [-x1, x2] and the vertical adjustment motion information is [-y1, y2]. x1, y1, x2 and y2 are all positive integers.
[0081] Specifically, the terminal obtains pre-set adjustment information such as pre-set adjustment position information or pre-set adjustment motion information from the database and takes the pre-set adjustment information as the adjustment information for the target image block.
[0082] In step S130, motion prediction processing is performed based on the target image block and the adjustment information to obtain candidate motion information of the current image block.
[0083] The motion information refers to a motion vector (MV). The candidate motion information of the current image block refers to a candidate motion vector of the current image block and is used to describe the motion state of the current image block.
[0084] Specifically, in the case that the adjustment information refers to the adjustment position information, the terminal determines an adjustment image block of the target image block from the target video frame of the to-be-encoded video frame according to the current position information (current horizontal position information, current vertical position information) of the target image block and the adjustment position information (including horizontal adjustment position information and vertical adjustment position information); and obtains the enlarged motion information of the adjustment image block as the candidate motion information of the current image block according to the inter-frame prediction algorithm. The position information of the adjustment image block is (current horizontal position information + horizontal adjustment position information, current vertical position information + vertical adjustment position information).
[0085] For example, assuming that x1, y1, x2, and y2 are all equal to 3, the number of the determined adjustment image blocks is 48, and the number of the newly added candidate motion information of the current image block is also 48.
[0086] Further, in the case that the adjustment information refers to the adjustment motion information, the terminal can also obtain the enlarged motion information of the target image block according to the inter-frame prediction algorithm, and adjust the enlarged motion information of the target image block by using the adjustment motion information to obtain the target motion information of the target image block as the candidate motion information of the current image block.
[0087] For example, the enlarged motion information of the target image block can be obtained in the following manner: the terminal determines a reference video frame of the to-be-encoded video frame from the video, such as the previous video frame of the to-be-encoded video frame; performs down-sampling processing on the reference video frame to obtain a down-sampled image as a target video frame of the reference video frame; identifies an image block with the largest matching degree with the target image block from a preset image search range in the target video frame of the reference video frame as a reference image block matched with the target image block; obtains the displacement information between the reference image block and the target image block, and takes the displacement information between the reference image block and the target image block as the motion information of the target image block; and enlarges the motion information of the target image block as the enlarged motion information of the target image block.
[0088] In step S140, the initial candidate motion information set of the current image block is updated according to the candidate motion information of the current image block to obtain a target candidate motion information set of the current image block; and the target candidate motion information set is used for encoding processing of the current image block.
[0089] The initial candidate motion information set of the current image block includes 7 candidate motion information, which are the enlarged motion information of the target image block, the motion information (generally 5) obtained based on the spatial specific position (such as the spatial reference blocks a0, a1, b0, b1, and b2 in FIG. 1) of the current image block, and the motion information obtained based on the temporal specific position (such as the temporal reference blocks c0, c1, d0, d1, and d2 in FIG. 1) of the current image block. Figure 3 Figure 4 motion information (generally 1) obtained from the spatial reference block H) of the current image block. In actual scenarios, the initial candidate motion information set refers to an MVCs List (MV candidates List, motion estimation motion vector candidate list)
[0090] Specifically, the terminal obtains an initial candidate motion information set of a current image block from a database in which a plurality of image blocks are stored; adds a candidate motion information of the current image block to the initial candidate motion information set of the current image block to obtain a target candidate motion information set of the current image block; and encodes the current image block according to the target candidate motion information set of the current image block to obtain an encoded image block of the current image block.
[0091] For example, assuming that the initial candidate motion information set of the current image block includes 7 motion information, the number of candidate motion information of the current image block is 48, and the candidate motion information of the current image block is not repeated in the initial candidate motion information set, the target candidate motion information set includes a total of 55 motion information.
[0092] Further, the motion information in the initial candidate motion information set of the current image block is obtained by referring to Figure 3 the terminal determines spatial motion information of the current image block according to motion information of the spatial reference blocks a0, a1, b0, b1, b2 of the current image block, as motion information obtained based on a spatial specific position of the current image block; and referring to Figure 4 the terminal obtains temporal motion information of the current image block from a position H of a corresponding reference video frame, as motion information obtained based on a temporal specific position of the current image block.
[0093] In the motion information acquisition method, the target video frame of the to-be-encoded video frame is obtained by performing down-sampling processing on the to-be-encoded video frame, and the target image block corresponding to the current image block in the to-be-encoded video frame is determined from the target video frame of the to-be-encoded video frame; then the adjustment information for the target image block is acquired; then the motion prediction processing is performed based on the target image block and the adjustment information to obtain the candidate motion information of the current image block; finally, the initial candidate motion information set of the current image block is updated according to the candidate motion information of the current image block to obtain the target candidate motion information set of the current image block; the target candidate motion information set is used for encoding processing of the current image block. In this way, on the basis of the initial candidate motion information set of the current image block in the to-be-encoded video frame, the target image block corresponding to the current image block in the to-be-encoded video frame and the adjustment information relative to the target image block are comprehensively considered, more effective candidate motion information of the current image block can be acquired, the candidate motion information set of each image block in the to-be-encoded video frame is enriched, the possibility of acquiring more accurate motion information for each image block is provided, the subsequent video encoding is more accurate, the video encoding accuracy is improved, and the defect that the video encoding accuracy is low due to that only the spatial specific position and the time specific position of the image block are considered to obtain less candidate motion information is avoided.
[0094] In an example embodiment, as shown in FIG. 13, the step S130 of performing the motion prediction processing based on the target image block and the adjustment information to obtain the candidate motion information of the current image block can be implemented by the following steps. Figure 5
[0095] In step S510, in the case that the adjustment information is the adjustment position information, the adjustment image block of the target image block is determined from the target video frame of the to-be-encoded video frame according to the target image block and the adjustment position information, as the candidate image block corresponding to the current image block.
[0096] The adjustment image block of the target image block refers to the image block obtained by adjusting the current position information of the target image block in the target video frame of the to-be-encoded video frame.
[0097] The current image block in the to-be-encoded video frame can correspond to multiple candidate image blocks in the target video frame in addition to the target image block in the target video frame.
[0098] In step S520, the motion information of the candidate image block is acquired.
[0099] The motion information of the candidate image block refers to the motion vector of the candidate image block, which is also obtained by the inter-frame prediction algorithm.
[0100] In step S530, candidate motion information of the current image block is obtained according to the motion information of the candidate image block.
[0101] Specifically, the terminal adjusts the current position information of the target image block in the target video frame of the to-be-encoded video frame according to the adjustment position information relative to the target image block, to obtain an adjusted image block of the target image block as a candidate image block corresponding to the current image block; the motion information of the candidate image block is predicted according to the inter-frame prediction algorithm; and the motion information of the candidate image block is enlarged to obtain enlarged motion information of the candidate image block as the candidate motion information of the current image block.
[0102] For example, referring to Figure 6 , the current position information of the target image block A' is (block_x, block_y), the horizontal adjustment position information in the adjustment position information is [-x1, x2], and the vertical adjustment position information is [-y1, y2], so the candidate image block corresponding to the current image block is an image block in a rectangular region surrounded by (block_x-x1, block_y-y1) to (block_x+x2, block_y+y2) except the target image block A', and assuming that x1, y1, x2, and y2 are all equal to 3 at this time, there are a total of 48 candidate image blocks; the enlarged motion information of the 48 candidate image blocks is taken as the candidate motion information of the current image block.
[0103] The technical scheme provided by the embodiments of the present disclosure comprehensively considers the target image block corresponding to the current image block in the to-be-encoded video frame and the adjustment position information relative to the target image block, can obtain more effective candidate motion information for the current image block, thereby enriching the candidate motion information set of the current image block, providing the possibility of obtaining more accurate motion information for the current image block, and making the subsequent video encoding more accurate.
[0104] In an example embodiment, the step S520 of obtaining the motion information of the candidate image block specifically includes the following content: obtaining a reference video frame of the to-be-encoded video frame; the reference video frame is a previous video frame of the to-be-encoded video frame; determining a reference image block matched with the candidate image block from a target video frame of the reference video frame; the target video frame of the reference video frame is obtained by performing down-sampling processing on the reference video frame; and obtaining the motion information of the candidate image block according to the displacement information between the reference image block and the candidate image block.
[0105] The reference video frame of the to-be-encoded video frame specifically refers to a previous video frame of the to-be-encoded video frame.
[0106] The target video frame of the reference video frame refers to a video frame obtained by performing down-sampling processing on the reference video frame.
[0107] wherein the reference image block matched with the candidate image block refers to an image block in the target video frame of the reference video frame that has the greatest similarity with the candidate image block.
[0108] Specifically, the terminal determines the reference video frame of the to-be-encoded video frame from the video; performs down-sampling processing on the reference video frame to obtain a down-sampled image as the target video frame of the reference video frame; identifies, from a preset image search range in the target video frame of the reference video frame, an image block having the greatest matching degree with the candidate image block as the reference image block matched with the candidate image block; and obtains the displacement information between the reference image block and the candidate image block, and takes the displacement information between the reference image block and the candidate image block as the motion information of the candidate image block.
[0109] For example, assuming that the position information of the candidate image block B in the target video frame of the to-be-encoded video frame is (x, y), and the position information of the reference image block B' in the target video frame of the reference video frame is (x', y'), the motion information of the candidate image block is
[0110] The technical solution provided by the embodiments of the present disclosure first determines the reference image block matched with the candidate image block from the target video frame of the reference video frame, and then obtains the motion information of the candidate image block according to the displacement information between the reference image block and the candidate image block, which comprehensively considers the reference image block matched with the candidate image block in the target video frame of the reference video frame, ensures that the obtained motion information is more accurate, and thus improves the determination accuracy of the motion information of the candidate image block.
[0111] In an example embodiment, the step S530 of obtaining the candidate motion information of the current image block according to the motion information of the candidate image block specifically includes the following contents: magnifying the motion information of the candidate image block to obtain magnified motion information of the candidate image block; the magnification multiple of the motion information of the candidate image block is the same as the down-sampling multiple; and taking the magnified motion information of the candidate image block as the candidate motion information of the current image block.
[0112] wherein the motion information of the candidate image block includes a horizontal component of a motion vector and a vertical component of the motion vector; and the magnifying of the motion information of the candidate image block refers to magnifying both the horizontal component of the motion vector and the vertical component of the motion vector.
[0113] Specifically, the terminal determines the magnification multiple of the motion information of the candidate image block according to the down-sampling multiple; magnifies the motion information of the candidate image block according to the magnification multiple of the motion information of the candidate image block to obtain magnified motion information of the candidate image block; and takes the magnified motion information of the candidate image block as the candidate motion information of the current image block.
[0114] For example, assuming that the motion information of the candidate image block is (MVLowres.x, MVLowres.y), the enlarged motion information (MVlr.x, MVlr.y) of the candidate image block can be obtained by the following formulas:
[0115] MVlr.x = MVLowres.x × magnification factor;
[0116] MVlr.y = MVLowres.y × magnification factor.
[0117] The technical solution provided by the embodiments of the present disclosure first uses the same magnification factor as the down-sampling factor to enlarge the motion information of the candidate image block, and then confirms the obtained enlarged motion information of the candidate image block as the candidate motion information of the current image block, which is beneficial to improve the determination accuracy of the candidate motion information of the current image block and avoids the defect that directly confirming the motion information of the candidate image block as the candidate motion information of the current image block leads to a low determination accuracy of the candidate motion information of the current image block.
[0118] In an exemplary embodiment, the step S510 of determining the adjustment image block of the target image block from the target video frame of the to-be-encoded video frame according to the target image block and the adjustment position information specifically includes the following contents: obtaining the current position information of the target image block in the target video frame; fusing the current position information and the adjustment position information to obtain the adjustment image block position information of the target image block; and determining the adjustment image block of the target image block from the target video frame of the to-be-encoded video frame according to the adjustment image block position information.
[0119] The adjustment image block position information of the target image block refers to the position information corresponding to the adjustment image block of the target image block.
[0120] Specifically, the terminal obtains the position information of the target image block in the target video frame of the to-be-encoded video frame as the current position information of the target image block; adds the current position information of the target image block in the target video frame and the adjustment position information to obtain the adjustment image block position information of the target image block; and takes the image block corresponding to the adjustment image block position information in the target video frame of the to-be-encoded video frame as the adjustment image block of the target image block.
[0121] For example, referring to the following formula: Figure 6, the current position information of the target image block A' in the target video frame is (block_x, block_y), the horizontal adjustment position information in the adjustment position information is [-x1, x2], and the vertical adjustment position information is [-y1, y2], so that the adjusted image block position information of the target image block is (block_x-x1, block_y-y1), (block_x-x1, block_y-y1+1), (block_x-x1, block_y-y1+2)……(block_x+x2, block_y+y2). It should be noted that the adjusted image block position information does not include (block_x, block_y).
[0122] The technical solution provided by the embodiments of the present disclosure first fuses the current position information and the adjustment position information of the target image block in the target video frame to obtain the adjusted image block position information of the target image block, and then determines the adjusted image block of the target image block from the target video frame of the to-be-encoded video frame as the candidate image block of the current image block according to the adjusted image block position information. In this way, the current position information and the adjustment position information of the target image block in the target video frame are used to determine more effective candidate image blocks, which facilitates the subsequent acquisition of more effective candidate motion information, thereby improving the accuracy of video encoding and avoiding the defects of low video encoding accuracy caused by the limitation to the spatial reference block and the temporal reference block.
[0123] In an exemplary embodiment, as shown in Figure 7 The step S130 of performing motion prediction processing based on the target image block and the adjustment information to obtain the candidate motion information of the current image block can also be implemented by the following steps.
[0124] In step S710, in the case where the adjustment information is adjustment motion information, the enlarged motion information of the target image block is obtained.
[0125] In step S720, the enlarged motion information of the target image block is adjusted according to the adjustment motion information to obtain the target motion information of the target image block.
[0126] The adjustment motion information includes horizontal adjustment motion information and vertical adjustment motion information, for example, the horizontal adjustment motion information is [-x1, x2], and the vertical adjustment motion information is [-y1, y2]; wherein x1, x2, y1, y2 are all positive integers.
[0127] The target motion information refers to the motion information obtained by adjusting the enlarged motion information of the target image block.
[0128] In step S730, the target motion information of the target image block is determined as the candidate motion information of the current image block.
[0129] Specifically, in the case that the adjustment information is the adjustment motion information, the terminal predicts the motion information of the target image block according to the inter-frame prediction algorithm, and magnifies the motion information of the target image block, for example, by 2 times, to obtain the magnified motion information of the target image block; the magnified motion information of the target image block is fused with the adjustment motion information to adjust the magnified motion information of the target image block, so as to obtain the target motion information of the target image block; and the target motion information of the target image block is determined as the candidate motion information of the current image block.
[0130] For example, assuming that the magnified motion information of the target image block is (MVlr.x, MVlr.y), the horizontal adjustment motion information in the adjustment motion information is [-x1, x2], and the vertical adjustment motion information is [-y1, y2], the target motion information of the target image block is (MVlr.x+a, MVlr.y+b), wherein a is in the range of [-x1, x2], b is in the range of [-y1, y2], x1, x2, y1, and y2 are positive integers; by traversing all values of a and b, [(x2+x1+1)×(y2+y1+1)–1] candidate motion information can be obtained. It should be noted that the target motion information of the target image block does not include (MVlr.x, MVlr.y).
[0131] The technical scheme provided by the embodiments of the present disclosure comprehensively considers the magnified motion information of the target image block corresponding to the current image block in the to-be-encoded video frame and the adjustment motion information of the magnified motion information of the target image block, can obtain more effective candidate motion information for the current image block, thereby enriching the candidate motion information set of each image block in the to-be-encoded video frame, providing the possibility of obtaining more accurate motion information for each image block, making the subsequent video encoding more accurate, thereby improving the video encoding accuracy, and avoiding the defect that only considering the spatial specific position and the temporal specific position of the image block leads to less candidate motion information and lower video encoding accuracy.
[0132] In an exemplary embodiment, the step S120 of obtaining the adjustment information for the target image block specifically includes the following contents: obtaining preset adjustment information; and determining the preset adjustment information as the adjustment information for the target image block.
[0133] The preset adjustment information refers to preset adjustment position information or preset adjustment motion information. The preset adjustment position information includes preset horizontal adjustment position information and preset vertical adjustment position information. The preset horizontal adjustment position information is [-x1, x2], and the preset vertical adjustment position information is [-y1, y2]. x1, x2, y1 and y2 are all positive integers. For example, x1, x2, y1 and y2 are all 2. The preset adjustment motion information includes preset horizontal adjustment motion information and preset vertical adjustment motion information. The preset horizontal motion position information is [-x1, x2], and the preset vertical adjustment motion information is [-y1, y2]. x1, x2, y1 and y2 are all positive integers. For example, x1, x2, y1 and y2 are all 2.
[0134] Specifically, the terminal obtains the preset adjustment information from the local database, and identifies the preset adjustment information as adjustment information relative to the target image block.
[0135] Further, after obtaining the target candidate motion information set of the current image block, the terminal can further obtain the final motion information of the current image block through the following steps.
[0136] Step one: the terminal first attempts to perform motion compensation, and selects the motion information MV1' with the minimum rate-distortion cost (cost1) from the target candidate motion information set (such as MVCs List) based on the rate-distortion optimization method. The calculation formula of the rate-distortion cost (cost1) is as follows:
[0137] cost1=sad+λ×bits(MVdelta);
[0138] MVdelta=MV-MVP;
[0139] Wherein, MV refers to the candidate motion information in the target candidate motion information set, Mvp refers to the best motion information in the advanced motion information prediction list AMVP, MVdelta refers to the difference between MV and Mvp, bits(MVdelta) represents the number of bits consumed when encoding MVdelta, λ is a constant specified by the encoder, and sad refers to the sum of absolute values between the prediction image block constructed by using MV and the original image block.
[0140] The advanced motion information prediction list AMVP is constructed by the following method: referring to Figure 3 , the terminal obtains Figure 3Two candidate motion information are selected from the five spatial reference blocks, such as one candidate motion information is selected from the motion information corresponding to the spatial reference block a0 and the spatial reference block a1, and one candidate motion information is selected from the motion information corresponding to the spatial reference block b0, the spatial reference block b1 and the spatial reference block b2; the spatial candidate list is constructed according to the two selected candidate motion information, and the same candidate motion information in the spatial candidate list is merged. Figure 4 The terminal obtains the corresponding candidate motion information from the position H of the corresponding reference video frame, and constructs the temporal candidate list according to the obtained candidate motion information. For the spatial candidate list and the temporal candidate list, if the number of candidate motion information is greater than two, the first two candidate motion information are reserved, and if the number of candidate motion information is less than two, (0, 0) is supplemented, and finally two candidate motion information are obtained, which are MV0 and MV1. The advanced motion information prediction list AMVP is constructed according to the candidate motion information MV0 and the candidate motion information MV1, that is, the candidate motion information MV0 and the candidate motion information MV1 are included in the advanced motion information prediction list AMVP.
[0141] The best motion information MVP in the advanced motion information prediction list AMVP is determined by the following method: the prediction pixel blocks Y1 and Y2 of the current image block are constructed by using the candidate motion information MV0 and the candidate motion information MV1 respectively, and the SAD (sum of absolute error) is calculated with the original pixel block Z corresponding to the current image block, and the calculation formula is as follows:
[0142]
[0143] Wherein, Y represents the prediction pixel block, Z represents the original pixel block corresponding to the current image block, W and H represent the width and height of the current image block respectively, (i, j) is the coordinate of the pixel point in the current image block, and abs represents the absolute value.
[0144] Through the above formula, the absolute error sum SAD1 corresponding to the candidate motion information MV0 and the absolute error sum SAD2 corresponding to the candidate motion information MV1 can be calculated; if SAD1 < SAD2, MV0 is selected as the best motion information MVP, otherwise, MV1 is selected as the best motion information MVP.
[0145] Step two: the terminal takes the best motion information MVP in the advanced motion information prediction list AMVP as the starting motion information search, and then searches a motion information MV2' with the smallest rate distortion cost (cost2) according to the given integer pixel search interval.
[0146] Step three: the terminal compares cost1 and cost2, if cost1<cost2, selects MV1' as the search starting MV of the sub-pixel; otherwise, selects MV2' as the search starting MV of the sub-pixel.
[0147] Step four: the terminal performs a sub-pixel motion search using the search starting MV obtained in step three; after the sub-pixel motion search is completed, the final motion information of the current image block is obtained.
[0148] The technical solution provided by the embodiments of the present disclosure is to first obtain preset adjustment information, and then confirm the preset adjustment information as adjustment information relative to the target image block, which is beneficial to subsequently obtaining more and more effective candidate motion information according to the target image block and the adjustment information, thereby enriching the candidate motion information set of each image block in the to-be-encoded video frame, providing a possibility for obtaining more accurate motion information, and avoiding the defect that the obtained candidate motion information is less due to only considering the spatial specific position and the temporal specific position of the image block.
[0149] Figure 8 is a flowchart of another motion information obtaining method according to an exemplary embodiment, as shown in Figure 8 , the motion information obtaining method is used in a terminal, and includes the following steps:
[0150] In step S810, a target image block corresponding to a current image block in a to-be-encoded video frame is determined from a target video frame of the to-be-encoded video frame; the target video frame of the to-be-encoded video frame is obtained by performing down-sampling processing on the to-be-encoded video frame.
[0151] In step S820, preset adjustment information is obtained; and the preset adjustment information is confirmed as adjustment information for the target image block.
[0152] In step S830, in a case where the adjustment information is adjustment position information, current position information of the target image block in the target video frame is obtained; the current position information and the adjustment position information are fused to obtain adjustment image block position information of the target image block; and the adjustment image block of the target image block is determined from the target video frame of the to-be-encoded video frame as a candidate image block corresponding to the current image block according to the adjustment image block position information.
[0153] In step S840, a reference video frame of the to-be-encoded video frame is obtained; the reference video frame is a previous video frame of the to-be-encoded video frame; a reference image block matched with the candidate image block is determined from a target video frame of the reference video frame; the target video frame of the reference video frame is obtained by performing down-sampling processing on the reference video frame; and motion information of the candidate image block is obtained according to displacement information between the reference image block and the candidate image block.
[0154] In step S850, the motion information of the candidate image block is up-scaled to obtain up-scaled motion information of the candidate image block; the up-scaling factor of the motion information of the candidate image block is the same as the down-scaling factor; and the up-scaled motion information of the candidate image block is determined as the candidate motion information of the current image block.
[0155] In step S860, in the case that the adjustment information is the adjustment motion information, the up-scaled motion information of the target image block is obtained; the up-scaled motion information of the target image block is adjusted according to the adjustment motion information to obtain the target motion information of the target image block; and the target motion information of the target image block is determined as the candidate motion information of the current image block.
[0156] In step S870, the initial candidate motion information set of the current image block is updated according to the candidate motion information of the current image block to obtain a target candidate motion information set of the current image block; and the target candidate motion information set is used for encoding processing of the current image block.
[0157] In the motion information obtaining method, on the basis of the initial candidate motion information set of the current image block in the to-be-encoded video frame, the target image block corresponding to the current image block in the to-be-encoded video frame and the adjustment information relative to the target image block are comprehensively considered to obtain more effective candidate motion information for the current image block, thereby enriching the candidate motion information set of each image block in the to-be-encoded video frame, providing a possibility of obtaining more accurate motion information for each image block, making the subsequent video encoding more accurate, thereby improving the video encoding accuracy, and avoiding the defect that the video encoding accuracy is low due to the fact that only the spatial specific position and the temporal specific position of the image block are considered to obtain less candidate motion information.
[0158] In order to more clearly illustrate the motion information obtaining method provided by the embodiments of the present disclosure, the motion information obtaining method is specifically described below with reference to one specific embodiment. In one embodiment, the present disclosure further provides an optimization method for obtaining candidate motion vectors for a prediction unit, mainly adding more candidate motion vectors to the MVCs List, and the adding manner includes the following two manners:
[0159] The first manner is to obtain N candidate motion vectors through the position information of the target image block corresponding to the current image block in the to-be-encoded video frame. For example, referring to Figure 6The corresponding position of the current image block A in the target video frame of the video frame to be encoded is the gray block A' in the figure; in addition to adding the enlarged motion vector of the target image block to the MVCs List, the terminal also adds the scaled motion vector of the candidate image block corresponding to the condition [(x2+x1+1) x (y2+y1+1)-1] in the rectangular region surrounded by (block_x-x1, block_y-y1) to (block_x+x2, block_y+y2) to the MVCs List, wherein x1, y1, x2, and y2 are positive integers. If x1, y1, x2, and y2 are all equal to 3 at this time, the motion vectors corresponding to 48 candidate image blocks are scaled and added to the MVCs List.
[0160] The second method is to adjust the motion vector corresponding to the position information (block_x, block_y) of the target image block A' and add it to the MVCs List. For example, the enlarged motion vector of the target image block is (MVlr.x, MVlr.y), and an offset a and b are added to the horizontal component MVlr.x and the vertical component MVlr.y of the enlarged motion vector, respectively, that is, (MVlr+a, MVlr+b); wherein the value range of a is [-x1, x2], the value range of b is [-y1, y2], and x1, x2, y1, and y2 are positive integers. After each image block obtains the motion vector (MVlr.x, MVlr.y), the motion vector (MVlr.x, MVlr.y) needs to be adjusted, and all values of a and b are traversed to obtain [(x2+x1+1) x (y2+y1+1)-1] candidate motion vectors, and finally these candidate motion vectors are added to the MVCs List.
[0161] The above optimization method for obtaining candidate motion vectors for a prediction unit uses the enlarged motion vector of the target image block to construct more effective candidate motion vectors for the current image block, which can enrich the candidate motion vector set of each image block in the video frame to be encoded, thereby further improving the video encoding efficiency.
[0162] It should be understood that although each step in the flowchart involved in the above-described embodiments is shown in sequence according to the arrow, the steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other orders. Moreover, at least some of the steps in the flowchart involved in the above-described embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time but can be executed at different times, and the execution order of the steps or stages is not necessarily sequential but can be round-robin or alternating with at least some of the other steps or the steps or stages in the other steps.
[0163] It can be understood that the same / similar parts between the above-described embodiments of the method in the specification can be mutually referred to, and each embodiment focuses on the differences from other embodiments, and the related parts can be referred to the description of other method embodiments.
[0164] Based on the same inventive concept, the embodiments of the disclosure also provide a motion information acquisition device for implementing the above-mentioned motion information acquisition method.
[0165] Figure 9 is a block diagram of a motion information acquisition device according to an exemplary embodiment. Referring to Figure 9 The device includes an image determination unit 910, an information acquisition unit 920, an information determination unit 930, and an information update unit 940.
[0166] The image determination unit 910 is configured to determine a target image block corresponding to a current image block in a to-be-encoded video frame from a target video frame of the to-be-encoded video frame, wherein the target video frame of the to-be-encoded video frame is obtained by down-sampling the to-be-encoded video frame.
[0167] The information acquisition unit 920 is configured to acquire adjustment information for the target image block.
[0168] The information determination unit 930 is configured to perform motion prediction processing based on the target image block and the adjustment information to obtain candidate motion information of the current image block.
[0169] The information update unit 940 is configured to update an initial candidate motion information set of the current image block according to the candidate motion information of the current image block to obtain a target candidate motion information set of the current image block, wherein the target candidate motion information set is used for encoding processing of the current image block.
[0170] In an example embodiment, the information determining unit 930 is further configured to perform, in a case that the adjustment information is adjustment position information, determining an adjusted image block of the target image block from the target video frame of the to-be-encoded video frame according to the target image block and the adjustment position information, as the candidate image block corresponding to the current image block; obtaining the motion information of the candidate image block; and obtaining the candidate motion information of the current image block according to the motion information of the candidate image block.
[0171] In an example embodiment, the information determining unit 930 is further configured to perform obtaining a reference video frame of the to-be-encoded video frame; the reference video frame being a previous video frame of the to-be-encoded video frame; determining a reference image block matched with the candidate image block from a target video frame of the reference video frame; the target video frame of the reference video frame being obtained by performing down-sampling processing on the reference video frame; and obtaining the motion information of the candidate image block according to the displacement information between the reference image block and the candidate image block.
[0172] In an example embodiment, the information determining unit 930 is further configured to perform performing up-scaling on the motion information of the candidate image block to obtain the up-scaled motion information of the candidate image block; the up-scaling multiple of the motion information of the candidate image block being the same as the down-sampling multiple; and confirming the up-scaled motion information of the candidate image block as the candidate motion information of the current image block.
[0173] In an example embodiment, the information determining unit 930 is further configured to perform obtaining current position information of the target image block in the target video frame; performing fusion processing on the current position information and the adjustment position information to obtain adjusted image block position information of the target image block; and determining the adjusted image block of the target image block from the target video frame of the to-be-encoded video frame according to the adjusted image block position information.
[0174] In an example embodiment, the information determining unit 930 is further configured to perform, in a case that the adjustment information is adjustment motion information, obtaining the up-scaled motion information of the target image block; adjusting the up-scaled motion information of the target image block according to the adjustment motion information to obtain target motion information of the target image block; and confirming the target motion information of the target image block as the candidate motion information of the current image block.
[0175] In an example embodiment, the information obtaining unit 920 is further configured to perform obtaining preset adjustment information; and confirming the preset adjustment information as the adjustment information for the target image block.
[0176] As to the apparatus in the above-mentioned embodiments, the specific manners in which various modules perform operations have been described in details in the embodiments about the method, and thus will not be described in details here.
[0177] Each of the modules in the motion information acquisition apparatus described above can be implemented in whole or in part by software, hardware, or a combination thereof. The modules described above can be embedded in a processor in the computer device in hardware form or independent of the processor in the computer device, or can be stored in a memory in the computer device in software form to be invoked by the processor to perform the operations corresponding to each of the modules.
[0178] Figure 10 FIG. 1 is a block diagram of an electronic device 1000 for performing a motion information acquisition method according to an exemplary embodiment. The electronic device 1000 can be, for example, a mobile phone, a computer, a digital broadcasting terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like.
[0179] Referring to Figure 10 The electronic device 1000 can include one or more of the following components: a processing component 1002, a memory 1004, a power supply component 1006, a multimedia component 1008, an audio component 1010, an input / output (I / O) interface 1012, a sensor component 1014, and a communication component 1016.
[0180] The processing component 1002 generally controls the overall operations of the electronic device 1000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1002 can include one or more processors 1020 to execute instructions to complete all or part of steps of the methods described above. In addition, the processing component 1002 can include one or more modules to facilitate the interaction between the processing component 1002 and other components. For example, the processing component 1002 can include a multimedia module to facilitate the interaction between the multimedia component 1008 and the processing component 1002.
[0181] The memory 1004 is configured to store various types of data to support operations of the electronic device 1000. Examples of these data include instructions for any application or method operating on the electronic device 1000, contact data, phonebook data, messages, pictures, videos, and the like. The memory 1004 can be implemented by any type of volatile or non-volatile memory devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disc, optical disc, or graphene memory.
[0182] The power supply component 1006 supplies power for various components of the electronic device 1000. The power supply component 1006 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 1000.
[0183] The multimedia component 1008 includes a screen providing an interface between the electronic device 1000 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense a touch, a slide and a gesture on the touch panel. The touch sensor can not only sense a boundary of a touching or a sliding action, but also detect duration and pressure related to the touching or sliding action. In some embodiments, the multimedia component 1008 includes a front camera and / or a rear camera. When the electronic device 1000 is in an operating mode, such as a capture mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.
[0184] The audio component 1010 is configured to output and / or input an audio signal. For example, the audio component 1010 includes a microphone (MIC) configured to receive an external audio signal when the electronic device 1000 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 1004 or transmitted via the communication component 1016. In some embodiments, the audio component 1010 also includes a speaker for outputting an audio signal.
[0185] The I / O interface 1012 provides an interface between the processing component 1002 and a peripheral interface module, which can be a keypad, a click wheel, buttons, and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0186] The sensor component 1014 includes one or more sensors for providing status assessments for various aspects of the electronic device 1000. For example, the sensor component 1014 can detect an open / closed position of the electronic device 1000, relative positioning of components, such as a display and a keypad of the electronic device 1000, a change in position of the electronic device 1000 or a component of the electronic device 1000, presence or absence of user contact with the electronic device 1000, orientation or acceleration / deceleration / g-force and temperature of the electronic device 1000. The sensor component 1014 can include an interface to a proximity sensor configured to detect presence of a nearby object without any physical touch. The sensor component 1014 can further include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 1014 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0187] The communication component 1016 is configured to facilitate wired or wireless communication between the electronic device 1000 and other devices. The electronic device 1000 can access a wireless network based on a communication standard, such as WiFi, a operator network, such as 2G, 3G, 4G, or 5G, or a combination thereof. In an example embodiment, the communication component 1016 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an example embodiment, the communication component 1016 can further include a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) techniques, infrared data association (IrDA) techniques, ultra-wideband (UWB) techniques, Bluetooth (BT) techniques, and other techniques.
[0188] In an example embodiment, the electronic device 1000 can be implemented using one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements, for performing the above-described methods.
[0189] In an example embodiment, a computer-readable storage medium, such as the memory 1004 including instructions stored thereon, is also provided, which can be executed by the processor 1020 of the electronic device 1000 to perform the above-described methods. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, etc.
[0190] In an example embodiment, a computer program product is also provided, which includes instructions executable by the processor 1020 of the electronic device 1000 to perform the above method.
[0191] It should be noted that the above-described apparatus, electronic device, computer readable storage medium, computer program product and the like according to the method embodiments can also include other implementation manners, and the specific implementation manners can be referred to the description of the related method embodiments, which will not be repeated here.
[0192] Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the concepts disclosed herein. The disclosure is intended to cover any variations, uses or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice in the art to which the disclosure pertains. The specification and examples are to be regarded as illustrative only, and the true scope and spirit of the disclosure are indicated by the appended claims.
[0193] It should be understood that the present disclosure is not limited to the precise structures herein described and illustrated in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the claims that follow.
Claims
1. A method for acquiring motion information, characterized in that, include: From the target video frame of the video frame to be encoded, determine the target image block corresponding to the current image block in the video frame to be encoded; the target video frame of the video frame to be encoded is obtained by downsampling the video frame to be encoded. Obtain adjustment information for the target image patch; the adjustment information includes adjustment position information or adjustment motion information; When the adjustment information is adjustment position information, based on the adjustment position information relative to the target image block, the current position information of the target image block in the target video frame of the video frame to be encoded is adjusted to obtain the adjusted image block of the target image block, which is used as the candidate image block corresponding to the current image block; the motion information of the candidate image block is predicted according to the inter-frame prediction algorithm; the motion information of the candidate image block is magnified to obtain the magnified motion information of the candidate image block, which is used as the candidate motion information of the current image block; When the adjustment information is the motion information, the magnified motion information of the target image block is obtained; The motion information of the target image block and the magnified motion information of the target image block are fused together to adjust the magnified motion information of the target image block and obtain the target motion information of the target image block, which serves as the candidate motion information of the current image block. Based on the candidate motion information of the current image block, the initial candidate motion information set of the current image block is updated to obtain the target candidate motion information set of the current image block; the target candidate motion information set is used to encode the current image block.
2. The method according to claim 1, characterized in that, The motion information of the predicted candidate image patch includes: Obtain a reference video frame for the video frame to be encoded; the reference video frame is the previous video frame of the video frame to be encoded. From the target video frame of the reference video frame, a reference image block matching the candidate image block is determined; the target video frame of the reference video frame is obtained by the downsampling process of the reference video frame. The motion information of the candidate image block is obtained based on the displacement information between the reference image block and the candidate image block.
3. The method according to claim 1, characterized in that, The step of amplifying the motion information of the candidate image block to obtain amplified motion information of the candidate image block, which is then used as the candidate motion information of the current image block, includes: The motion information of the candidate image block is magnified to obtain the magnified motion information of the candidate image block; the magnification factor of the motion information of the candidate image block is the same as the downsampling factor; The magnified motion information of the candidate image block is confirmed as the candidate motion information of the current image block.
4. The method according to claim 1, characterized in that, The step of adjusting the current position information of the target image block in the target video frame of the video frame to be encoded, based on the adjustment position information relative to the target image block, to obtain an adjusted image block of the target image block, includes: Obtain the current position information of the target image block in the target video frame; The current position information and the adjusted position information are fused together to obtain the adjusted image block position information of the target image block; Based on the adjusted image block position information, the adjusted image block of the target image block is determined from the target video frame of the video frame to be encoded.
5. The method according to any one of claims 1 to 4, characterized in that, The step of obtaining adjustment information for the target image patch includes: Obtain preset adjustment information; The preset adjustment information is confirmed as adjustment information for the target image block.
6. A motion information acquisition device, characterized in that, include: The image determination unit is configured to determine, from the target video frame of the video frame to be encoded, a target image block corresponding to the current image block in the video frame to be encoded; the target video frame is obtained by downsampling the video frame to be encoded. The information acquisition unit is configured to acquire adjustment information for the target image patch; the adjustment information includes adjustment position information or adjustment motion information. The information determination unit is configured to, when the adjustment information is adjustment position information, adjust the current position information of the target image block in the target video frame of the video frame to be encoded according to the adjustment position information relative to the target image block, to obtain an adjusted image block of the target image block as a candidate image block corresponding to the current image block; predict the motion information of the candidate image block according to the inter-frame prediction algorithm; and amplify the motion information of the candidate image block to obtain the amplified motion information of the candidate image block as the candidate motion information of the current image block. The information determination unit is further configured to perform the following actions when the adjustment information is adjustment motion information: acquiring magnified motion information of the target image block; performing fusion processing on the adjustment motion information and the magnified motion information of the target image block to adjust the magnified motion information of the target image block, thereby obtaining the target motion information of the target image block as the candidate motion information of the current image block; The information update unit is configured to update the initial candidate motion information set of the current image block according to the candidate motion information of the current image block, so as to obtain the target candidate motion information set of the current image block; the target candidate motion information set is used to encode the current image block.
7. The apparatus according to claim 6, characterized in that, The information determination unit is further configured to amplify the motion information of the candidate image block to obtain amplified motion information of the candidate image block; the amplification factor of the motion information of the candidate image block is the same as the downsampling factor; and the amplified motion information of the candidate image block is confirmed as the candidate motion information of the current image block.
8. The apparatus according to claim 6, characterized in that, The information determination unit is further configured to perform the following operations: acquiring the current position information of the target image block in the target video frame; fusing the current position information and the adjustment position information to obtain the adjustment image block position information of the target image block; and determining the adjustment image block of the target image block from the target video frame of the video frame to be encoded based on the adjustment image block position information.
9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the motion information acquisition method as described in any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the motion information acquisition method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Motion estimating method and device thereof
CN108702512A