P-SKIP macro block judgment method, coding method and related equipment

By conducting multi-level motion intensity analysis on the decision macroblock, the problem of low judgment accuracy of P-SKIP macroblock in the prior art is solved, and higher judgment accuracy is achieved.

CN119788848AActive Publication Date: 2025-04-08AMLOGIC (CHENG DU) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311298808.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-08
Publication Date
2025-04-08
Estimated Expiration
2043-10-08

AI Technical Summary

Technical Problem

In the prior art, the accuracy of the P-SKIP macroblock judgment is low, and it is difficult to effectively identify the P-SKIP macroblock.

Method used

By obtaining the macroblock to be judged in the current frame image, calculating the absolute error sum of the pixel values ​​between the macroblocks corresponding to the previous frame image, and calculating the sum of the small range motion. Then, the macroblock to be judged is expanded, divided into sub-expanded blocks and larger-range expansion blocks, and the sum of local range and large-range motion is calculated. Based on these motion sums, it is determined whether the macroblock to be judged is a P-SKIP macroblock.

Benefits of technology

Through multi-level motion intensity analysis, noise interference is reduced and the accuracy of P-SKIP macroblock judgment is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119788848A_ABST
    Figure CN119788848A_ABST
Patent Text Reader

Abstract

A P-SKIP macro block judgment method, a coding method and related devices, the P-SKIP macro block judgment method judges whether a macro block to be judged is a P-SKIP macro block based on the total motion sum of micro-range motion, the total motion sum of local-range motion and the total motion sum of large-range motion of the macro block to be judged, and can improve the accuracy of P-SKIP macro block judgment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and in particular to a P-SKIP macroblock decision method, a coding method and related equipment. Background Art

[0002] Mode selection is the core of video coding. Specifically, in the video coding standard, in order to simplify the coding and compression process of the current frame image, after the obtained frame image is divided into multiple macroblocks, different coding modes are executed for different types of macroblocks to perform coding and compression processing.

[0003] P-SKIP macroblock, also known as COPY macroblock, is a special type of macroblock in P macroblock in H.264 coding standard. It has no pixel residual and motion vector residual, and can directly obtain pixel prediction value through motion vector (MV). When a macroblock to be encoded is determined to be a P-SKIP macroblock, the encoder uses skip mode to encode the P-SKIP macroblock, which will help reduce the encoding bit rate and reduce encoding time.

[0004] However, the accuracy of P-SKIP macroblock decision still needs to be improved. Summary of the invention

[0005] The problem solved by the embodiments of the present invention is to provide a P-SKIP macroblock decision method, a coding method and related equipment, which are beneficial to improving the accuracy of P-SKIP macroblock decision.

[0006] To solve the above problem, an embodiment of the present invention provides a P-SKIP macroblock decision method, comprising: obtaining a macroblock to be decided in a current frame image; obtaining a total motion sum of a small range motion of the macroblock to be decided based on the absolute error sum of pixel values ​​between pixel points in the macroblock to be decided and corresponding pixel points in a corresponding macroblock in a previous frame image; performing a first extension process on the macroblock to be decided in the current frame image to obtain a first extension block; dividing the first extension block into a plurality of sub-extension blocks; and obtaining a total motion sum of a small range motion of the macroblock to be decided based on the absolute error sum of pixel values ​​between the pixel points in the macroblock to be decided and the corresponding pixel points in the corresponding macroblock in the previous frame image. The difference between the mean values ​​is used to obtain the total motion sum of the local range motion of the macroblock to be determined; the second extension processing is performed on the macroblock to be determined in the current frame image to obtain a second extension block, and the second extension block is larger than the first extension block; based on the absolute error sum of the pixel points between the second extension block and the corresponding second image block in the previous frame image, the total motion sum of the large range motion of the macroblock to be determined is obtained; based on the total motion sum of the micro range motion, the total motion sum of the local range motion and the total motion sum of the large range motion of the macroblock to be determined, it is determined whether the macroblock to be determined is a P-SKIP macroblock.

[0007] Optionally, the method of obtaining the total motion sum of the small-range motion of the macroblock to be determined based on the sum of absolute errors of the pixel values ​​between the pixel points in the macroblock to be determined and the corresponding pixel points in the corresponding macroblock in the previous frame image includes: obtaining the sum of absolute errors of the pixel values ​​between the pixel points in the macroblock to be determined and the corresponding pixel points in the corresponding macroblock; if the sum of absolute errors of the pixel values ​​between the pixel points in the macroblock to be determined and the corresponding pixel points in the corresponding macroblock is greater than or equal to a preset first difference threshold, recording the motion prediction value of the pixel points in the macroblock to be determined as a first value; if the sum of absolute errors of the pixel values ​​between the pixel points in the macroblock to be determined and the corresponding pixel points in the corresponding macroblock is less than the first difference threshold, recording the motion prediction value of the pixel points in the macroblock to be determined as a second value, which is different from the first value; obtaining the sum of the motion prediction values ​​of the pixel points in the macroblock to be determined as the total motion sum of the small-range motion.

[0008] Optionally, performing a first expansion process on the macroblock to be decided in the current frame image to obtain a first extended block includes: taking the macroblock to be decided as the center, obtaining (2N-1)*(2N-1) macroblocks arranged in an array in the current frame image as the first extended block, where N is a positive integer greater than 1.

[0009] Optionally, dividing the first extension block into a plurality of sub-extension blocks includes: dividing the first extension block equally into four sub-extension blocks.

[0010] Optionally, the acquiring the total motion sum of the local range motion of the macroblock to be determined based on the difference between the pixel average values ​​of the pixels of the plurality of sub-extended blocks and the first image block of the previous frame image comprises: acquiring image blocks corresponding to the sub-extended blocks in the first extended block in the previous frame image, respectively, as the first image blocks; acquiring the difference between the pixel average value of the pixels in the sub-extended blocks and the pixel average value of the pixels in the corresponding first image block; if the difference between the pixel average value of the sub-extended blocks and the pixel average value of the pixels in the corresponding first image block is greater than or equal to a preset second difference threshold, recording the motion prediction value of the sub-extended blocks as a third value; if the difference between the pixel average value of the sub-extended blocks and the pixel average value of the pixels in the corresponding first image block is less than the second difference threshold, recording the motion prediction value of the sub-extended blocks as a fourth value, the fourth value being different from the third value; and acquiring the sum of the motion prediction values ​​of the sub-extended blocks in the first extended block as the total motion sum of the local range motion of the macroblock to be determined.

[0011] Optionally, performing a second expansion on the macroblock to be decided in the current frame image to obtain a second extended block includes: taking the macroblock to be decided as the center, obtaining (2M-1)*(2M-1) macroblocks arranged in an array in the current frame image as the second extended block, where M is a positive integer greater than N.

[0012] Optionally, the method of obtaining the total motion sum of the large-scale motion of the macroblock to be determined based on the sum of absolute errors of the pixel points between the second extended block and the corresponding second image block in the previous frame image includes: obtaining the sum of absolute errors of pixel values ​​between the pixel points of the second extended block and the corresponding pixel points of the second image block; if the sum of absolute errors of pixel values ​​between the pixel points of the second extended block and the corresponding pixel points of the second image block is greater than or equal to a preset third difference threshold, recording the motion prediction value of the pixel points in the second extended block as a fifth value; if the sum of absolute errors of pixel values ​​between the pixel points of the second extended block and the corresponding pixel points of the second image block is less than the third difference threshold, recording the motion prediction value of the pixel points in the second extended block as a sixth value, which is different from the fifth value; and obtaining the sum of the motion prediction values ​​of the pixel points in the second extended block as the total motion sum of the large-scale motion.

[0013] Optionally, after obtaining the second extended block and before obtaining the total motion sum of the large-scale motion of the macroblock to be determined based on the sum of absolute errors of the pixel points between the second extended block and the corresponding second image block in the previous frame image, the method further includes: performing downsampling processing on the second extended block and the second image block respectively to obtain a first downsampling block and a second downsampling block;

[0014] In the step of obtaining the total motion sum of the large-scale motion of the macroblock to be determined based on the sum of absolute errors of pixel points between the second extended block and the corresponding second image block in the previous frame image, the total motion sum of the large-scale motion of the macroblock to be determined is obtained based on the sum of absolute errors of pixel values ​​between the pixel points of the first down-sampling block and the corresponding pixel points of the second down-sampling block.

[0015] Optionally, the determining whether the macroblock to be determined is a P-SKIP macroblock based on the total motion sum of the micro-range motion, the total motion sum of the local-range motion, and the total motion sum of the large-range motion of the macroblock to be determined comprises:

[0016] If the total motion sum of the small range motion is greater than a preset first decision threshold, the total motion sum of the local range motion is less than a preset second decision threshold, and the total motion sum of the large range motion is less than a preset third decision threshold, then the macroblock to be decided is determined to be a P-SKIP macroblock;

[0017] If the total motion sum of the small range motion is greater than a preset fourth decision threshold, the total motion sum of the local range motion is less than a preset fifth decision threshold, and the total motion sum of the large range motion is less than a preset sixth decision threshold, then the macroblock to be determined is determined to be a P-SKIP macroblock; the fourth decision threshold is greater than the first decision threshold, the fifth decision threshold is greater than the second decision threshold, and the sixth decision threshold is less than the third decision threshold;

[0018] If the total motion sum of the small range motion is greater than the preset seventh decision threshold, the total motion sum of the local range motion is less than the preset eighth decision threshold, and the total motion sum of the large range motion is less than the preset ninth decision threshold, then the macroblock to be determined is determined to be a P-SKIP macroblock; the seventh decision threshold is greater than the fourth decision threshold, the eighth decision threshold is greater than the fifth decision threshold, and the ninth decision threshold is less than the sixth decision threshold;

[0019] If the total motion sum of the small range motion is greater than the preset tenth decision threshold, the total motion sum of the local range motion is less than the preset eleventh decision threshold, and the total motion sum of the large range motion is less than the preset twelfth decision threshold, then the macroblock to be judged is determined to be a P-SKIP macroblock; the tenth decision threshold is greater than the seventh decision threshold, the eleventh decision threshold is greater than the eighth decision threshold, and the twelfth decision threshold is less than the ninth decision threshold.

[0020] Accordingly, the embodiment of the present invention further provides a P-SKIP macroblock decision module, comprising: a first acquisition submodule, adapted to acquire a macroblock to be decided in a current frame image; a second acquisition submodule, adapted to acquire a total motion sum of a micro-range motion of the macroblock to be decided based on a sum of absolute errors of pixel values ​​between pixel points in the macroblock to be decided and corresponding pixel points in a corresponding macroblock in a previous frame image; a first extension submodule, adapted to perform a first extension processing on the macroblock to be decided in the current frame image to acquire a first extension block; a division processing submodule, adapted to divide the first extension block into a plurality of sub-extension blocks; a third acquisition submodule, adapted to acquire a total motion sum of a micro-range motion of the macroblock to be decided based on a sum of absolute errors of pixel values ​​between the pixel points in the macroblock to be decided and corresponding pixel points in a corresponding macroblock in a previous frame image; a difference between the pixel average values ​​of the pixels between the first and second image blocks, and obtaining the total motion sum of the local range motion of the macroblock to be determined; a second extension submodule, adapted to perform a second extension process on the macroblock to be determined in the current frame image to obtain a second extension block, wherein the second extension block is larger than the first extension block; a fourth acquisition submodule, adapted to obtain the total motion sum of the large range motion of the macroblock to be determined based on the absolute error sum of the pixels between the second extension block and the corresponding second image block in the previous frame image; a decision submodule, adapted to determine whether the macroblock to be determined is a P-SKIP macroblock based on the total motion sum of the micro range motion, the total motion sum of the local range motion and the total motion sum of the large range motion of the macroblock to be determined.

[0021] Correspondingly, an embodiment of the present invention also provides an encoding method, comprising: using a P-SKIP macroblock judgment method as described in any of the above items to determine whether the macroblock to be judged in the current frame image is a P-SKIP macroblock; when it is determined that the macroblock to be judged in the current frame image is a P-SKIP macroblock, using a skip mode to encode the macroblock to be judged.

[0022] Correspondingly, an embodiment of the present invention also provides an encoding device, including: a P-SKIP macroblock judgment module, suitable for using the P-SKIP macroblock judgment method as described in any of the above items to determine whether the macroblock to be judged in the current frame image is a P-SKIP macroblock; an encoding module, suitable for using a skip mode to encode the macroblock to be judged when it is determined that the macroblock to be judged in the current frame image is a P-SKIP macroblock.

[0023] Correspondingly, an embodiment of the present invention further provides a chip, on which the P-SKIP macroblock decision module as described above or the encoding device as described above is integrated.

[0024] Correspondingly, an embodiment of the present invention also provides an electronic device, comprising at least one memory and at least one processor, wherein the memory stores one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the P-SKIP macroblock determination method as described in any one of the above or the encoding method as described above.

[0025] Correspondingly, an embodiment of the present invention further provides a storage medium storing one or more computer instructions, wherein the one or more computer instructions are used to implement the P-SKIP macroblock decision as described in any one of the above items and the encoding method as described in the above item.

[0026] Compared with the prior art, the technical solution of the embodiment of the present invention has the following advantages:

[0027] The P-SKIP macroblock decision method of the embodiment of the present invention comprises: obtaining a macroblock to be decided in a current frame image; obtaining a total motion sum of a small range motion of the macroblock to be decided based on the absolute error sum of pixel values ​​between a pixel point in the macroblock to be decided and a corresponding pixel point in a corresponding macroblock in a previous frame image; performing a first extension process on the macroblock to be decided in the current frame image to obtain a first extension block; dividing the first extension block into a plurality of sub-extension blocks; obtaining a total motion sum of a local range motion of the macroblock to be decided based on a difference between pixel average values ​​of pixel points between the plurality of sub-extension blocks and a corresponding first image block in the previous frame image; performing a second extension process on the macroblock to be decided in the current frame image to obtain a second extension block, the second extension block being larger than the first extension block; obtaining a total motion sum of a large range motion of the macroblock to be decided based on the absolute error sum of pixel points between the second extension block and a corresponding second image block in the previous frame image; and determining whether the macroblock to be decided is a P-SKIP macroblock based on the total motion sum of a small range motion, the total motion sum of a local range motion and the total motion sum of a large range motion of the macroblock to be decided.

[0028] The P-SKIP macroblock determination method of the embodiment of the present invention determines whether the macroblock to be determined is a P-SKIP macroblock based on the total motion sum of the micro-range motion, the total motion sum of the local range motion and the total motion sum of the large-range motion of the macroblock to be determined. The motion attribute of the macroblock to be determined can be determined at the motion intensities of the micro-range, the local range and the large range that increase successively, thereby reducing the interference of noise points on the P-SKIP macroblock determination, which correspondingly helps to improve the accuracy of the P-SKIP macroblock determination. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a flow chart of an embodiment of a P-SKIP macroblock decision method provided by the technical solution of the present invention;

[0030] Figure 2 It is a schematic diagram of the macroblock to be determined in the current frame image and the corresponding macroblock in the previous frame image;

[0031] Figure 3 is a schematic diagram of the positional relationship between the macroblock to be determined and the first extended block in an embodiment of the present invention;

[0032] Figure 4 Yes Figure 3 A schematic diagram showing that the first extension block in is divided into four sub-extension blocks;

[0033] Figure 5 is a schematic diagram of dividing a first image block in a previous frame into four first image blocks;

[0034] Figure 6 is a schematic diagram of the positional relationship between the macroblock to be determined and the second extended block in an embodiment of the present invention;

[0035] Figure 7 is a schematic diagram of a second extended block and a corresponding second image block;

[0036] Figure 8 It is a structural diagram of an embodiment of a P-SKIP macroblock decision module provided by an embodiment of the present invention;

[0037] Fig. 9 is a schematic flow chart of an encoding method in an embodiment of the present invention;

[0038] Fig.10 is a schematic structural diagram of an encoding device in an embodiment of the present invention;

[0039] Fig.11 It is a schematic diagram of an optional hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0040] As can be seen from the background technology, the decision accuracy of the current P-SKIP macroblock still needs to be improved.

[0041] In order to solve the technical problem, the P-SKIP macroblock decision method of the embodiment of the present invention includes: obtaining a macroblock to be decided in a current frame image; obtaining the total motion sum of a small range of motion of the macroblock to be decided based on the absolute error sum of the pixel values ​​between the pixel points in the macroblock to be decided and the corresponding pixel points in the corresponding macroblock in the previous frame image; performing a first expansion processing on the macroblock to be decided in the current frame image to obtain a first expansion block; dividing the first expansion block into a plurality of sub-expansion blocks; and calculating the total motion sum of a small range of motion of the macroblock to be decided based on the absolute error sum of the pixel values ​​between the pixel points in the macroblock to be decided and the corresponding pixel points in the corresponding macroblock in the previous frame image. The difference between the values ​​is used to obtain the total motion sum of the local range motion of the macroblock to be determined; the second extension processing is performed on the macroblock to be determined in the current frame image to obtain a second extension block, and the second extension block is larger than the first extension block; based on the absolute error sum of the pixel points between the second extension block and the corresponding second image block in the previous frame image, the total motion sum of the large range motion of the macroblock to be determined is obtained; based on the total motion sum of the micro range motion, the total motion sum of the local range motion and the total motion sum of the large range motion of the macroblock to be determined, it is determined whether the macroblock to be determined is a P-SKIP macroblock.

[0042] The P-SKIP macroblock determination method of the embodiment of the present invention determines whether the macroblock to be determined is a P-SKIP macroblock based on the total motion sum of the micro-range motion, the total motion sum of the local range motion and the total motion sum of the large-range motion of the macroblock to be determined. The motion attribute of the macroblock to be determined can be determined at the motion intensities of the micro-range, the local range and the large range that increase successively, thereby reducing the interference of noise points on the P-SKIP macroblock determination, which correspondingly helps to improve the accuracy of the P-SKIP macroblock determination.

[0043] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0044] Figure 1 1 is a flow chart of an embodiment of a P-SKIP macroblock decision method provided by the technical solution of the present invention. Figure 1 A P-SKIP macroblock decision method may specifically include the following steps:

[0045] Step S110: obtaining a macroblock to be determined in the current frame image;

[0046] Step S120: obtaining the total motion sum of the micro-range motion of the macroblock to be determined based on the sum of absolute errors of the pixel values ​​between the pixel points in the macroblock to be determined and the corresponding pixel points in the corresponding macroblock in the previous frame image;

[0047] Step S130: performing a first expansion process on the macroblock to be determined in the current frame image to obtain a first expanded block;

[0048] Step S140: Divide the first extension block into a plurality of sub-extension blocks;

[0049] Step S150: obtaining the total motion sum of the local range motion of the macroblock to be determined based on the difference between the pixel average values ​​of the pixel points between the plurality of sub-extended blocks and the corresponding first image block in the previous frame image;

[0050] Step S160: performing a second expansion process on the macroblock to be determined in the current frame image to obtain a second expanded block, where the second expanded block is larger than the first expanded block;

[0051] Step S170: obtaining a total motion sum of a large-scale motion of the macroblock to be determined based on the sum of absolute errors of pixel values ​​between the pixel points in the second extended block and the corresponding pixel points in the corresponding second image block in the previous frame image;

[0052] Step S180: Determine whether the macroblock to be determined is a P-SKIP macroblock based on the total motion sum of the micro-range motion, the total motion sum of the local-range motion and the total motion sum of the large-range motion of the macroblock to be determined.

[0053] See also Figure 1 , execute step S110 to obtain the macroblock to be determined in the current frame image.

[0054] Obtain the macroblock to be determined in the current frame image, so as to obtain the total motion sum of the micro-range motion, the total motion of the local range motion and the total motion sum of the large-range motion of the macroblock to be determined, thereby providing a basis for the subsequent determination of whether the macroblock to be determined is a P-SKIP macroblock.

[0055] In this embodiment, the current frame image is a video image.

[0056] In this embodiment, the current frame image is first divided into a plurality of macro blocks (Macro Block, MB), and then each macro block in the current frame image is traversed in a preset order, and the traversed current macro block is used as the macro block to be determined.

[0057] In the multiple macroblocks obtained by dividing the current frame image, each of the macroblocks includes multiple pixels, and the multiple pixels are arranged in an array. In this embodiment, the size of the macroblock is W*L, and W and L are both integers greater than or equal to 1. In other words, each macroblock includes W*L pixels.

[0058] Figure 2A schematic diagram showing the macroblocks to be determined in the current frame image and the corresponding macroblocks in the previous frame image is shown. Figure 1 and Figure 2 , execute step S120, and obtain the total motion sum of the small range motion of the macroblock 100 to be determined based on the absolute error sum of the pixel values ​​between the pixel points in the macroblock 100 to be determined and the corresponding pixel points in the corresponding macroblock 200 in the previous frame image.

[0059] Based on the sum of absolute errors of pixel values ​​between pixel points in the macroblock 100 to be determined and corresponding pixel points in the corresponding macroblock 200 in the previous frame image, the total motion sum of the small-range motion of the macroblock 100 to be determined is obtained, thereby providing a reference for the subsequent determination of whether the macroblock to be determined is a P-SKIP macroblock through the motion intensity of the macroblock 100 to be determined.

[0060] In this embodiment, the corresponding macroblock 200 of the macroblock to be determined 100 is obtained in the previous frame image according to the position coordinates. Specifically, the macroblock in the previous frame image at the same position as the macroblock to be determined 100 is used as the corresponding macroblock 200 of the macroblock to be determined 100.

[0061] In other embodiments, the macroblock to be determined can be matched with the macroblock in the previous frame image to obtain the macroblock in the previous frame image that matches the macroblock to be determined as the corresponding macroblock of the macroblock to be determined.

[0062] As an example, the similarity between the macroblock to be determined and the macroblock in the previous frame image is calculated, and the macroblock in the previous frame image with the maximum similarity to the macroblock to be determined is used as the corresponding macroblock of the macroblock to be determined.

[0063] In this embodiment, based on the sum of absolute errors of pixel values ​​between the pixel points in the macroblock to be determined 100 and the corresponding pixel points in the corresponding macroblock 200 in the previous frame image, the step of obtaining the total motion sum of the small range motion of the macroblock to be determined 100 includes: obtaining the sum of absolute errors of pixel values ​​between the pixel points in the macroblock to be determined 100 and the corresponding pixel points in the corresponding macroblock 200; if the sum of absolute errors of pixel values ​​between the pixel points in the macroblock to be determined 100 and the corresponding pixel points in the corresponding macroblock 200 is greater than or equal to a preset first difference threshold, recording the motion prediction value of the pixel points in the macroblock to be determined 100 as a first value; if the sum of absolute errors of pixel values ​​between the pixel points in the macroblock to be determined 100 and the corresponding pixel points in the corresponding macroblock 200 is less than the first difference threshold, recording the motion prediction value of the pixel points in the macroblock to be determined 100 as a second value, which is different from the first value; obtaining the sum of the motion prediction values ​​of the pixel points in the macroblock to be determined 100 as the total motion sum of the small range motion.

[0064] In this embodiment, the pixels in the macroblock to be determined 100 correspond one to one with the pixels in the corresponding macroblock 200. Similar to obtaining the corresponding macroblock 200 of the macroblock to be determined 100 in the previous frame image, the pixels in the corresponding macroblock 200 that are at the same position as the pixels in the macroblock to be determined 100 are used as the corresponding pixels of the pixels in the macroblock to be determined 100.

[0065] In this embodiment, the following formula is used to calculate and obtain the sum of absolute differences (SAD) of pixel values ​​between the pixel points in the macroblock to be determined 100 and the corresponding pixel points in the corresponding macroblock 200:

[0066] Diff(i,j)=|F N (i,j)-F N-1 (i,j)| (1)

[0067] Wherein, Diff(i,j) represents the absolute error sum of the pixel values ​​between the pixel point (i,j) in the macroblock to be determined and the corresponding pixel point (i,j) in the corresponding macroblock, and F N (i, j) represents the pixel value of the pixel point (i, j) in the macroblock to be determined, F N-1 (i, j) represents the pixel value of the corresponding pixel point (i, j) in the corresponding macroblock.

[0068] It can be seen from the above formula (1) that when the macroblock to be determined belongs to a static area, the change in pixel value between the pixel points in the macroblock to be determined 100 and the corresponding pixel points in the corresponding macroblock 200 is small, and accordingly, the sum of the absolute errors of the pixel values ​​between the pixel points in the macroblock to be determined 100 and the corresponding pixel points in the corresponding macroblock 200 will be less than the preset first difference threshold.

[0069] On the contrary, when the macroblock to be determined 100 belongs to a dynamic area, the change in pixel values ​​between the pixel points in the macroblock to be determined 100 and the corresponding pixel points in the corresponding macroblock 200 is large. Accordingly, the sum of the absolute errors of the pixel values ​​between the pixel points in the macroblock to be determined 100 and the corresponding pixel points in the corresponding macroblock 200 will be greater than or equal to the first difference threshold.

[0070] Therefore, when the sum of the absolute errors of the pixel values ​​between the pixel points in the macroblock 100 to be determined and the corresponding pixel points in the corresponding macroblock 200 is greater than or equal to the preset first difference threshold, the motion prediction value of the pixel points in the macroblock 100 to be determined is recorded as the first value, and when the sum of the absolute errors of the pixel values ​​between the pixel points in the macroblock 100 to be determined and the corresponding pixel points in the corresponding macroblock 200 is less than the first difference threshold, the motion prediction value of the pixel points in the macroblock 100 to be determined is recorded as the second value, so that it is possible to determine whether the majority of the pixel points in the macroblock 100 to be determined belong to the static area or the dynamic area through the sum of the motion prediction values ​​of the pixel points in the macroblock 100 to be determined, that is, the total motion sum of the small-range motion of the macroblock 100 to be determined.

[0071] In this embodiment, the first value is greater than the second value. Accordingly, the maximum value of the total motion sum of the micro-range motion of the macroblock to be determined 100 is W*L*S1, and the minimum value of the total motion sum of the micro-range motion of the macroblock to be determined 100 is W*L*S2. Wherein, S1 represents the first value, and S2 represents the second value.

[0072] It can be understood that, when the number of pixel points belonging to the dynamic area in the macroblock to be decided 100 is greater, the value of the total motion sum of the small-range motion of the macroblock to be decided 100 is greater; when the number of pixel points belonging to the static area in the macroblock to be decided 100 is greater, the value of the total motion sum of the small-range motion of the macroblock to be decided 100 is smaller.

[0073] Therefore, when the value of the total motion sum of the small-range motion of the macroblock 100 to be determined is larger, it can be determined that more pixel points in the macroblock 100 to be determined belong to the dynamic area; when the value of the total motion sum of the small-range motion of the macroblock 100 to be determined is smaller, it can be determined that more pixel points in the macroblock 100 to be determined belong to the static area.

[0074] In other embodiments, the first value can also be smaller than the second value. Accordingly, when the number of pixels belonging to the dynamic area in the macroblock to be determined is greater, the value of the total motion sum of the small range motion of the macroblock to be determined is smaller; when the number of pixels belonging to the static area in the macroblock to be determined is greater, the value of the total motion sum of the small range motion of the macroblock to be determined is larger.

[0075] In this embodiment, when the value of the total motion sum of the small-range motion of the macroblock to be determined is larger, it can be determined that more pixel points in the macroblock to be determined belong to the static area; when the value of the total motion sum of the small-range motion of the macroblock to be determined is smaller, it can be determined that more pixel points in the macroblock to be determined belong to the dynamic area.

[0076] The first difference threshold can be set according to actual needs. Specifically, the first difference threshold can be set according to application scenarios.

[0077] It should be pointed out that, for video surveillance scenarios using an IP Camera, when the IP Camera is in a fixed position, the more violent the movement of the moving object in the monitoring area, the greater the difference in pixel value between the pixel points in the macroblock 100 to be determined and the corresponding pixel points in the corresponding macroblock 200, and the first difference threshold is correspondingly larger, which is conducive to improving the accuracy of identifying the motion state of the pixel points in the macroblock 100 to be determined; the more gentle the movement of the moving object in the monitoring area, the smaller the difference in pixel value between the pixel points in the macroblock 100 to be determined and the corresponding pixel points in the corresponding macroblock 200, and the first difference threshold is correspondingly smaller, which is conducive to improving the accuracy of identifying the motion state of the pixel points in the macroblock 100 to be determined.

[0078] Figure 3 A schematic diagram showing the positional relationship between the macroblock to be determined and the first extended block in an embodiment of the present invention is shown. Figures 1 to 3 , execute step S130, perform a first expansion process on the macroblock 100 to be determined in the current frame image, and obtain a first expanded block 300.

[0079] A first expansion process is performed on the macroblock to be determined 100 in the current frame image to obtain a first extended block 300, so as to subsequently divide the first extended block 300 into a plurality of sub-extended blocks, and based on the difference between the pixel average values ​​of the pixel points of the plurality of sub-extended blocks and the corresponding first image blocks in the previous frame image, a basis is provided for obtaining the total motion sum of the local range motion of the macroblock to be determined 100.

[0080] In this embodiment, the step of performing a first expansion processing on the macroblock to be determined 100 in the current frame image to obtain a first extended block 300 includes: taking the macroblock to be determined 100 as the center, obtaining (2N-1)*(2N-1) macroblocks arranged in an array in the current frame image as the first extended block 300, where N is a positive integer greater than 1.

[0081] See also Figure 3 Taking N equal to 2 as an example, taking the macroblock 100 to be determined as the center, 3*3 macroblocks arranged in an array are obtained in the current frame image as the first extended block 300.

[0082] Specifically, the first extended block 300 includes the macroblock 100 to be decided, a macroblock 101 located at the upper left corner of the macroblock 100 to be decided, a macroblock 102 located directly above the macroblock 100 to be decided, a macroblock 103 located at the upper right corner of the macroblock 100 to be decided, a macroblock 104 located at the right side of the macroblock 100 to be decided, a macroblock 105 located at the lower right corner of the macroblock 100 to be decided, a macroblock 106 located directly below the macroblock 100 to be decided, a macroblock 107 located at the lower left corner of the macroblock 100 to be decided, and a macroblock 108 located on the left side of the macroblock 100 to be decided.

[0083] The value of N can be even larger. It is understandable that if the value of N is larger, the first expansion block 300 will be correspondingly larger; if the value of N is smaller, the first expansion block 300 will be correspondingly smaller.

[0084] It should be noted that, in the case where the macroblock 100 to be determined is located in the edge area of ​​the current frame image, when the first expansion process is performed on the macroblock 100 to be determined in the current frame image, the size of the image block located in the corresponding position area of ​​the macroblock 100 to be determined in the current frame image may be smaller than the size of the macroblock 100 to be determined. At this time, the image block is discarded, and only the macroblock with the same size as the macroblock 100 to be determined and located in the corresponding position area of ​​the macroblock 100 to be determined is retained, and together with the macroblock 100 to be determined, the first expansion block 300 is formed.

[0085] It should also be pointed out that when the macroblock is rectangular and the first expansion processing is performed on the macroblock to be decided 100 in the current frame image, if the size of the image block located in the corresponding position area of ​​the macroblock to be decided 100 in the current frame image is smaller than the size of the macroblock to be decided 100 and the image block is discarded, the macroblock to be decided 100 is taken as the center and the first expansion processing is performed on the macroblock to be decided 100 in the current frame image. After discarding the image blocks whose sizes are smaller than the size of the macroblock to be decided 100, the first expanded block 100 is still rectangular.

[0086] In this embodiment, with the macroblock to be decided 100 as the center, (2N-1)*(2N-1) macroblocks arranged in an array are obtained in the current frame image as the first extended block 300, N is a positive integer greater than 1, and accordingly, the first extended block 300 is larger than the macroblock to be decided 100 and includes the macroblock to be decided 100.

[0087] Figure 4 Shows the Figure 3 The first expansion block in is divided into four sub-expansion blocks. Please refer to Figures 1 to 4 , execute step S140 to divide the first extension block 300 into multiple sub-extension blocks 301~30n.

[0088] The first extended block 300 is divided into a plurality of sub-extended blocks 301-30n, so as to provide a basis for subsequently obtaining the total motion sum of the local range motion of the macroblock 100 to be determined based on the difference between the pixel average values ​​of the pixel points between the plurality of sub-extended blocks 301-30n and the corresponding first image blocks in the previous frame image.

[0089] In this embodiment, the first extension block 300 is equally divided into a plurality of sub-extension blocks. In other words, the sizes of the plurality of sub-extension blocks 301 to 30n obtained by dividing the first extension block 300 are all the same.

[0090] See also Figure 4 , taking n equal to 4 as an example, the first extension block 300 is equally divided into four sub-extension blocks 301-304.

[0091] In other embodiments, the first extension block can be divided into more or fewer sub-extension blocks, and those skilled in the art can select them according to actual needs without limitation.

[0092] In other embodiments, the first extended block may be unequally divided into a plurality of sub-extended blocks. In other words, at least two of the plurality of sub-extended blocks obtained by division are different.

[0093] Figure 5A schematic diagram showing how a first image block in a previous frame is divided into four first image blocks. Figures 1 to 5 , execute step S150, and obtain the total motion sum of the local range motion of the macroblock 100 to be determined based on the difference between the pixel average values ​​of the pixel points between the multiple sub-extended blocks 30k and the corresponding first image block 40k in the previous frame image.

[0094] Based on the difference between the pixel average values ​​of the pixel points between the multiple sub-extended blocks 30k and the corresponding first image blocks 40k in the previous frame image, the total motion sum of the local range motion of the macroblock to be determined 100 is obtained, so that the motion strength of the multiple sub-extended blocks 301~30n obtained by dividing the first extended block 300 centered on the macroblock to be determined 100 provides a reference for the subsequent determination of whether the macroblock to be determined is a P-SKIP macroblock.

[0095] See also Figure 5 As an implementation, the four sub-extended blocks 301-304 obtained by dividing the first extended block 300 respectively have corresponding first image blocks 401-404 in the previous frame image, that is, there is a one-to-one correspondence between the sub-extended blocks 301-304 and the first image blocks 401-404.

[0096] In this embodiment, an image block having the same position coordinates as the sub-extended block 30k is obtained in the previous frame image as the first image block 40k corresponding to the sub-extended block 30k, where k is an integer greater than or equal to 1 and less than or equal to n.

[0097] Specifically, image blocks having the same position coordinates as the sub-extended blocks 30k may be directly obtained in the previous frame image according to the position coordinates of the sub-extended blocks 30k in the current frame as the first image blocks 40k corresponding to the sub-extended blocks 30k.

[0098] Alternatively, it is also possible to first determine a corresponding image block 400 having the same position coordinates as the first extended block 300, and divide the corresponding image block 400 into a plurality of sub-image blocks in the same manner as dividing the first extended block 300 into a plurality of sub-extended blocks 301-30n, so that the sub-extended blocks 301-30n in the first extended block 300 correspond one-to-one to the sub-image blocks in the corresponding image block 400, and then obtain the sub-image blocks corresponding to the sub-extended blocks 301-30n from the corresponding image block 400 as the first image blocks 401-40n corresponding to the sub-extended blocks.

[0099] In other embodiments, the sub-extended block can be matched with an image block in a previous frame image to obtain a macroblock in the previous frame image that matches the sub-extended block as the corresponding first image block.

[0100] In this embodiment, based on the difference between the pixel average values ​​of the pixels of the plurality of sub-extended blocks 301 to 30n and the corresponding first image blocks 401 to 40n in the previous frame image, the step of obtaining the total motion sum of the local range motion of the macroblock to be determined 100 includes: obtaining the difference between the pixel average value of the pixels in the sub-extended block 30k and the pixel average value of the pixels in the corresponding first image block 40k; if the difference between the pixel average value of the pixels in the sub-extended block 30k and the pixel average value of the pixels in the corresponding first image block 40k is If the difference between the pixel average value of the pixels in the sub-extended block 30k and the pixel average value of the pixels in the corresponding first image block 40k is less than the second difference threshold, the motion prediction value of the sub-extended block 30k is recorded as a fourth value, which is different from the third value. The sum of the motion prediction values ​​of the sub-extended blocks 301 to 30n in the first extended block is obtained as the total motion sum of the local range motion of the macroblock 100 to be determined.

[0101] It can be understood that when the sub-extended block 30k belongs to the static area, the change in pixel value between the pixel points in the sub-extended block 30k and the corresponding pixel points in the first image block 40k is small, and the change between the pixel average value of the pixel points in the sub-extended block 30k and the pixel average value of the pixel points in the first image block 40k is also correspondingly small. Accordingly, the difference between the pixel average value of the pixel points in the sub-extended block 30k and the pixel average value of the pixel points in the first image block 40k will be smaller than the preset second difference threshold.

[0102] On the contrary, when the sub-extended block 30k belongs to the dynamic area, the change in pixel values ​​between the pixels in the sub-extended block 30k and the corresponding pixels in the first image block 40k is relatively large, and the change between the pixel average value of the pixels in the sub-extended block 30k and the pixel average value of the pixels in the first image block 40k is also correspondingly relatively large. Accordingly, the difference between the pixel average value of the pixels in the sub-extended block 30k and the pixel average value of the pixels in the first image block 40k will be greater than or about the second difference threshold.

[0103] When the difference between the pixel average value of the pixels in the sub-extended block 30k and the pixel average value of the pixels in the corresponding first image block 40k is greater than or about the second difference threshold, the motion prediction value of the sub-extended block 30k is recorded as the third value, and when the difference between the pixel average value of the pixels in the sub-extended block 30k and the pixel average value of the pixels in the corresponding first image block 40k is less than the second difference threshold, the motion prediction value of the sub-extended block 30k is recorded as the fourth value, so that it is possible to determine whether there are more sub-extended blocks 30k belonging to the static area or more sub-extended blocks 30k belonging to the dynamic area in the first extended block 300 through the sum of the motion prediction values ​​of the multiple sub-extended blocks 301~30n in the first extended block 300, that is, the total motion sum of the local range motion of the macroblock 100 to be determined.

[0104] Accordingly, the maximum value of the total motion sum of the local range motion of the to-be-determined macroblock 100 is n*S3, and the minimum value of the total motion sum of the micro range motion of the to-be-determined macroblock 100 is n*S4. Wherein, S3 represents the third value, and S4 represents the fourth value.

[0105] It can be understood that, when the number of sub-extended blocks 30k belonging to the dynamic area in the first extended block 300 is more, the value of the total motion sum of the local range motion of the macroblock 100 to be determined is larger; conversely, when the number of sub-extended blocks 30k belonging to the static area in the first extended block 300 is more, the value of the total motion sum of the local range motion of the macroblock 100 to be determined is smaller.

[0106] Therefore, when the value of the total motion sum of the local range motion of the macroblock 100 to be determined is larger, it can be determined that more sub-extended blocks 30k belong to the dynamic area in the first extended block 300; when the value of the total motion sum of the local range motion of the macroblock 100 to be determined is smaller, it can be determined that more sub-extended blocks 30k belong to the static area in the first extended block 300.

[0107] In other embodiments, the third value can also be smaller than the fourth value. Accordingly, when there are more sub-extended blocks belonging to the static area in the first extended block, the value of the total motion sum of the local range motion of the macroblock to be determined is larger; when there are more sub-extended blocks belonging to the dynamic area in the first extended block, the value of the total motion sum of the local range motion of the macroblock to be determined is smaller.

[0108] In this embodiment, when the value of the total motion sum of the local range motion of the macroblock to be determined is larger, it can be determined that more sub-extended blocks belong to the static area in the first extended block; when the value of the total motion sum of the local range motion of the macroblock to be determined is smaller, it can be determined that more sub-extended blocks belong to the dynamic area in the first extended block.

[0109] The second difference threshold can be set according to actual needs. Specifically, the second difference threshold can be set according to application scenarios.

[0110] The second difference threshold may be implemented according to the aforementioned description of the first difference threshold, which will not be described in detail here.

[0111] Figure 6 FIG. 1 is a schematic diagram showing the positional relationship between the macroblock to be determined and the second extended block in an embodiment of the present invention. Figures 1 to 6 , execute step S160, perform a second expansion process on the macroblock 100 to be determined in the current frame image, and obtain a second expansion block 500, wherein the second expansion block 500 is larger than the first expansion block 300.

[0112] The macroblock to be determined 100 is subjected to a second expansion process in the current frame image to obtain a second expansion block 500, thereby providing a basis for subsequently obtaining the total motion sum of a large range of motion of the macroblock to be determined 100 based on the absolute error sum of pixel points between the second expansion block 500 and the corresponding second image block in the previous frame image.

[0113] In this embodiment, the step of performing a second expansion on the macroblock to be determined 100 in the current frame image with the macroblock to be determined 100 as the center to obtain a second extended block 500 includes: taking the macroblock to be determined 100 as the center, obtaining (2M-1)*(2M-1) macroblocks arranged in an array in the current frame image as the second extended block, where M is a positive integer greater than N.

[0114] See also Figure 6 Taking M equal to 3 as an example, taking the macroblock 100 to be determined as the center, 5*5 macroblocks arranged in an array are obtained in the current frame image as the second extended block 500.

[0115] Specifically, the second extended block 500 includes not only the first extended block 300, that is, the to-be-determined macroblock 100 and macroblocks 101-108, but also the macroblock 109 located at the upper left corner of the macroblock 101, the macroblock 110 located directly above the macroblock 101, the macroblock 111 located directly above the macroblock 102, the macroblock 112 located directly above the macroblock 103, the macroblock 113 located at the upper right corner of the macroblock 103, and the macroblock 114 located on the right side of the macroblock 103. , macroblock 115 located on the right side of macroblock 104, macroblock 116 located on the right side of macroblock 105, macroblock 117 located at the lower right corner of macroblock 105, macroblock 118 located directly below macroblock 105, macroblock 119 located directly below macroblock 106, macroblock 120 located directly below macroblock 107, macroblock 121 located at the lower left corner of macroblock 107, macroblock 122 located on the left side of macroblock 107, macroblock 123 located on the left side of macroblock 108, and macroblock 124 located on the left side of macroblock 101.

[0116] Combined with reference Figure 3 and Figure 6 It can be seen that the second expansion block 500 is larger than the first expansion block 300 , and the second expansion block 500 includes the first expansion block 300 .

[0117] For other contents of the second expansion block 500 , please refer to the corresponding contents in the first expansion block 300 , which will not be described in detail.

[0118] Figure 7 A schematic diagram of a second extended block and a corresponding second image block is shown. Figures 1 to 7 , execute step S170, and obtain the total motion sum of the large-scale motion of the macroblock 100 to be determined based on the absolute error sum of the pixel values ​​between the pixel points in the second extended block 500 and the corresponding pixel points in the corresponding second image block 600 in the previous frame image.

[0119] Based on the sum of absolute errors of pixel values ​​between the pixel points in the second extended block 500 and the corresponding pixel points in the corresponding second image block 600 in the previous frame image, the total motion sum of the large-scale motion of the macroblock to be determined 100 is obtained, thereby providing a reference for the subsequent determination of whether the macroblock to be determined 100 is a P-SKIP macroblock through the motion intensity of the second extended block 500 centered on the macroblock to be determined 100.

[0120] In this embodiment, an image block located at the same position as the second extended block 500 is acquired in the previous frame image as the second image block 600 corresponding to the second extended block 500 .

[0121] In other embodiments, the second extended block can be matched with an image block in a previous frame image to obtain a macroblock in the previous frame image that matches the second extended block as a second image block corresponding to the second extended block.

[0122] As an example, the similarity between the second extended block 500 and the image block in the previous frame image is calculated, and the image block in the previous frame image whose similarity with the second extended block 500 is greater than a preset threshold is used as the second image block 600 corresponding to the second extended block 500.

[0123] In this embodiment, the step of obtaining the total motion sum of the large-scale motion of the macroblock 100 to be determined based on the sum of absolute errors of pixel values ​​between the pixels in the second extended block 500 and the corresponding pixels in the second image block 600 in the previous frame image includes: obtaining the sum of absolute errors of pixel values ​​between the pixels in the second extended block 500 and the corresponding pixels in the second image block 600; if the sum of absolute errors of pixel values ​​between the pixels in the second extended block 500 and the corresponding pixels in the second image block 600 is greater than or equal to a preset third difference threshold, recording the motion prediction value of the pixel in the second extended block 500 as a fifth value; if the sum of absolute errors of pixel values ​​between the pixels in the second extended block 500 and the corresponding pixels in the second image block 600 is less than the third difference threshold, recording the motion prediction value of the pixel in the second extended block 500 as a sixth value, which is different from the fifth value; and obtaining the sum of the motion prediction values ​​of the pixels in the second extended block 500 as the total motion sum of the large-scale motion.

[0124] In this embodiment, the pixels in the second extended block 500 correspond one-to-one to the pixels in the second image block 600. Specifically, the pixels in the previous frame image that have the same position coordinates as the pixels in the second extended block 500 are used as the corresponding pixels of the pixels in the second extended block 500.

[0125] Regarding the sum of absolute errors of pixel values ​​between the pixel points of the second extended block 500 and the corresponding pixel points of the second image block 600, please refer to the aforementioned description of the sum of absolute errors of pixel values ​​between the pixel points in the to-be-determined macroblock 100 and the corresponding pixel points in the corresponding macroblock 200, and no further details will be given.

[0126] Similarly, when the second extended block 500 belongs to a static area, the change in pixel values ​​between the pixels in the second extended block 500 and the corresponding pixels in the corresponding second image block 600 in the previous frame image is small, and accordingly, the sum of absolute errors in pixel values ​​between the pixels in the second extended block 500 and the corresponding pixels in the corresponding second image block 600 will be less than a preset third difference threshold.

[0127] On the contrary, when the second extended block 500 belongs to a dynamic area, the change in pixel values ​​between the pixel points in the second extended block 500 and the corresponding pixel points in the corresponding second image block 600 in the previous frame image is large, and accordingly, the sum of absolute errors of pixel values ​​between the pixel points in the second extended block 500 and the corresponding pixel points in the corresponding second image block 600 will be greater than or equal to the third difference threshold.

[0128] Therefore, when the sum of absolute errors of pixel values ​​between the pixels in the second extended block 500 and the corresponding pixels in the second image block 600 in the previous frame image is greater than or equal to the preset third difference threshold, the motion prediction value of the pixels in the second extended block 500 is recorded as the fifth value, and when the sum of absolute errors of pixel values ​​between the pixels in the second extended block 500 and the corresponding pixels in the second image block 600 in the previous frame image is less than the third difference threshold, the motion prediction value of the pixels in the second extended block 500 is recorded as the sixth value, so that it is possible to determine whether more pixels in the second extended block 500 belong to the static area or the dynamic area through the sum of the motion prediction values ​​of the pixels in the second extended block 500, that is, the total motion sum of the large-scale motion of the macroblock 100 to be determined.

[0129] In this embodiment, the fifth value is greater than the sixth value. Accordingly, the maximum value of the total motion sum of the large-scale motion of the macroblock 100 to be determined is W*L*(2M-1)*(2M-1)*S5, and the minimum value of the total motion sum of the large-scale motion of the macroblock 100 to be determined is W*L*(2M-1)*(2M-1)*S6. Among them, S5 represents the fifth value, and S6 represents the sixth value.

[0130] It can be understood that, when the number of pixel points belonging to the dynamic area in the second extended block 500 is greater, the value of the total motion sum of the large-scale motion of the macroblock to be determined 100 is greater; when the number of pixel points belonging to the static area in the second extended block 500 is greater, the value of the total motion sum of the large-scale motion of the macroblock to be determined 100 is smaller.

[0131] Therefore, when the value of the total motion sum of the large-scale motion of the macroblock 100 to be determined is larger, it is possible to determine that more pixel points of the second extended block 500 belong to the dynamic area; and when the value of the total motion sum of the large-scale motion of the macroblock 100 to be determined is smaller, it is possible to determine that more pixel points of the second extended block 500 belong to the static area.

[0132] In other embodiments, the fifth value can also be smaller than the sixth value. Accordingly, when the number of pixels in the second extended block belonging to the dynamic area is greater, the value of the total motion sum of the large-scale motion of the macroblock to be determined is smaller; when the number of pixels in the second extended block belonging to the static area is greater, the value of the total motion sum of the large-scale motion of the macroblock to be determined is greater.

[0133] Accordingly, in this embodiment, when the value of the total motion sum of the large-scale motion of the macroblock to be determined is smaller, it is possible to determine that more pixel points in the second extended block belong to the dynamic area; and when the value of the total motion sum of the large-scale motion of the macroblock to be determined is larger, it is possible to determine that more pixel points in the second extended block belong to the static area.

[0134] The third difference threshold can be set according to actual needs. The third difference threshold can be implemented according to the above description of the first difference threshold, which will not be repeated here.

[0135] In another embodiment, after obtaining the second extended block, and before obtaining the total motion sum of the large-scale motion of the macroblock to be determined based on the sum of absolute errors of pixel values ​​between pixel points in the second extended block and corresponding pixel points in the corresponding second image block in the previous frame image, the P-SKIP macroblock determination method further includes: downsampling the second extended block and the second image block respectively to obtain a first downsampling block and a second downsampling block.

[0136] Correspondingly, in the step of obtaining the total motion sum of the large-scale motion of the macroblock to be determined 100 based on the sum of absolute errors of the pixel values ​​between the pixel points in the second extended block and the corresponding pixel points in the corresponding second image block in the previous frame image, the total motion sum of the large-scale motion of the macroblock to be determined is obtained based on the sum of absolute errors of the pixel values ​​between the pixel points in the first down-sampling block and the corresponding pixel points in the second down-sampling block.

[0137] In this embodiment, the first down-sampling block and the second down-sampling block have the same size as the macroblock to be determined. In other examples, the sizes of the first down-sampling block and the second down-sampling block can also be larger or smaller than the size of the macroblock to be determined 100, which is not limited here.

[0138] By downsampling the second extended block and the second image block to obtain the first downsampling block and the second downsampling block, it can help reduce the subsequent data processing volume, and correspondingly help improve the acquisition speed of the total motion sum of the large-range motion of the macroblock to be determined, thereby facilitating the acquisition speed of the P-SKIP macroblock.

[0139] Please continue to see Figure 1 , execute step S180, and determine whether the macroblock 100 to be determined is a P-SKIP macroblock based on the total motion sum of the small range motion, the total motion sum of the local range motion, and the total motion sum of the large range motion of the macroblock 100 to be determined.

[0140] In this embodiment, the step of determining whether the macroblock to be determined 100 is a P-SKIP macroblock based on the total motion sum of the micro-range motion, the total motion sum of the local range motion, and the total motion sum of the large range motion of the macroblock to be determined 100 includes the following situations:

[0141] The first case is that if the total motion sum of the small range motion is greater than the preset first decision threshold, the total motion sum of the local range motion is less than the preset second decision threshold, and the total motion sum of the large range motion is less than the preset third decision threshold, then the macroblock 100 to be decided is determined to be a P-SKIP macroblock.

[0142] In this embodiment, the total motion sum of the micro-range motion is greater than the preset first decision threshold, indicating that the number of pixel points belonging to the static area in the macroblock 100 to be decided is small, while the number of pixel points belonging to the dynamic area is large.

[0143] In this embodiment, the total motion sum of the local range motion is less than the preset second decision threshold, indicating that the number of sub-extended blocks belonging to the static area in the first extended block 300 is large, while the number of sub-extended blocks belonging to the dynamic area is small.

[0144] In this embodiment, the total motion sum of the large-range motion is less than the preset third decision threshold, indicating that the number of pixel points belonging to the static area in the second extended block 500 is large, while the number of pixel points belonging to the dynamic area is small.

[0145] In summary, when the total motion sum of the micro-range motion is greater than the preset first decision threshold, the total motion sum of the local range motion is less than the preset second decision threshold, and the total motion sum of the large range motion is less than the preset third decision threshold, although from the perspective of the total motion sum of the micro-range motion, the possibility that the macroblock 100 to be determined belongs to the dynamic area is relatively large, from the perspective of the total motion sum of the local range motion and the total motion sum of the large range motion, the possibility that the macroblock 100 to be determined belongs to the static area is relatively large. At this time, the macroblock 100 to be determined can be a P-SKIP macroblock.

[0146] The second case is that if the total motion sum of the micro-range motion is greater than the preset fourth decision threshold, the total motion sum of the local range motion is less than the preset fifth decision threshold, and the total motion sum of the large-range motion is less than the preset sixth decision threshold, then the macroblock 100 to be determined is determined to be a P-SKIP macroblock; the fourth decision threshold is greater than the first decision threshold, the fifth decision threshold is greater than the second decision threshold, and the sixth decision threshold is less than the third decision threshold;

[0147] In this embodiment, the total motion sum of the small range motion is greater than the preset fourth decision threshold, and the fourth decision threshold is greater than the first decision threshold. Compared with the first case, the number of pixel points belonging to the static area in the macroblock 100 to be decided is smaller, and the number of pixel points belonging to the dynamic area is greater.

[0148] In this embodiment, when the total motion sum of the local range motion is less than the preset fifth decision threshold, and the fifth decision threshold is greater than the second decision threshold, compared with the first case, the number of sub-extended blocks 30k belonging to the static area in the first extended block 300 is smaller, and the number of sub-extended blocks 30k belonging to the dynamic area is greater.

[0149] In this embodiment, the total motion sum of the large-range motion is less than the preset sixth decision threshold, and the sixth decision threshold is less than the third decision threshold. Compared with the first case, the number of pixel points belonging to the static area in the second extended block 500 is more, and the number of pixel points belonging to the dynamic area is less.

[0150] Therefore, when the total motion sum of the small range motion is greater than the preset fourth decision threshold, the total motion sum of the local range motion is less than the preset fifth decision threshold, and the total motion sum of the large range motion is less than the preset sixth decision threshold, compared with the first case, although the possibility that the macroblock to be determined 100 belongs to the dynamic area is increased in terms of the total motion sum of the small range motion and the total motion sum of the local range motion, the possibility that the macroblock to be determined 100 belongs to the static area is still relatively large in terms of the total motion sum of the large range motion. At this time, the macroblock to be determined 100 can be a P-SKIP macroblock.

[0151] The third situation is that if the total motion sum of the small range motion is greater than the preset seventh decision threshold, the total motion sum of the local range motion is less than the preset eighth decision threshold, and the total motion sum of the large range motion is less than the preset ninth decision threshold, then the macroblock 100 to be judged is determined to be a P-SKIP macroblock; the seventh decision threshold is greater than the fourth decision threshold, the eighth decision threshold is greater than the fifth decision threshold, and the ninth decision threshold is less than the sixth decision threshold.

[0152] In this embodiment, the total motion sum of the small range motion is greater than the preset seventh decision threshold, and the seventh decision threshold is greater than the fourth decision threshold. Compared with the second case, the number of pixel points belonging to the static area in the macroblock 100 to be decided is smaller, and the number of pixel points belonging to the dynamic area is greater.

[0153] In this embodiment, when the total motion sum of the local range motion is less than the preset eighth decision threshold, and the eighth decision threshold is greater than the fifth decision threshold, compared with the second case, the number of sub-extended blocks 30k belonging to the static area in the first extended block 300 is smaller, and the number of sub-extended blocks 30k belonging to the dynamic area is greater.

[0154] In this embodiment, the total motion sum of the large-range motion is less than the preset ninth decision threshold, and the ninth decision threshold is less than the sixth decision threshold. Compared with the second case, the number of pixel points belonging to the static area in the second extended block 500 is greater, and the number of pixel points belonging to the dynamic area is less.

[0155] Accordingly, when the total motion sum of the micro-range motion is greater than the preset fourth decision threshold, the total motion sum of the local range motion is less than the preset fifth decision threshold, and the total motion sum of the large range motion is less than the preset sixth decision threshold, compared with the second case, although the possibility that the macroblock 100 to be determined belongs to the dynamic area increases from the perspective of the total motion sum of the micro-range motion and the total motion sum of the local range motion, the possibility that the macroblock 100 to be determined belongs to the static area is still relatively large from the perspective of the total motion sum of the large range motion. At this time, the macroblock 100 to be determined can be a P-SKIP macroblock.

[0156] The fourth situation is that if the total motion sum of the small range motion is greater than the preset tenth decision threshold, the total motion sum of the local range motion is less than the preset eleventh decision threshold, and the total motion sum of the large range motion is less than the preset twelfth decision threshold, then the macroblock 100 to be judged is determined to be a P-SKIP macroblock; the tenth decision threshold is greater than the seventh decision threshold, the eleventh decision threshold is greater than the eighth decision threshold, and the twelfth decision threshold is less than the ninth decision threshold.

[0157] In this embodiment, the total motion sum of the small range motion is greater than the preset tenth decision threshold, and the tenth decision threshold is greater than the seventh decision threshold. Compared with the third case, the number of pixel points belonging to the static area in the macroblock 100 to be decided is further reduced, and the number of pixel points belonging to the dynamic area is further increased.

[0158] In this embodiment, when the total motion sum of the local range motion is less than the preset eleventh decision threshold, and the eleventh decision threshold is greater than the eighth decision threshold, compared with the third case, the number of sub-extended blocks 30k belonging to the static area in the first extended block 300 is further reduced, and the number of sub-extended blocks 30k belonging to the dynamic area is further increased.

[0159] In this embodiment, the total motion sum of the large-range motion is less than the preset ninth decision threshold, and the twelfth decision threshold is less than the ninth decision threshold. Compared with the third case, the number of pixels belonging to the static area in the second extended block is further increased, while the number of pixels belonging to the dynamic area is further reduced.

[0160] Accordingly, when the total motion sum of the micro-range motion is greater than the preset tenth decision threshold, the total motion sum of the local range motion is less than the preset eleventh decision threshold, and the total motion sum of the large range motion is less than the preset twelfth decision threshold, compared with the third case, although the possibility that the macroblock 100 to be determined belongs to the dynamic area is further increased from the perspective of the total motion sum of the micro-range motion and the total motion sum of the local range motion, the possibility that the macroblock 100 to be determined belongs to the dynamic area is still relatively large from the perspective of the total motion sum of the large range motion. At this time, the macroblock 100 to be determined can still be a P-SKIP macroblock.

[0161] In this embodiment, in other situations except the above four situations, it can be determined that the macroblock to be determined 100 is not a P-SKIP macroblock.

[0162] The first decision threshold, the second decision threshold, the third decision threshold, the fourth decision threshold, the fifth decision threshold, the sixth decision threshold, the seventh decision threshold, the eighth decision threshold, the ninth decision threshold, the tenth decision threshold, the eleventh decision threshold, and the twelfth decision threshold can be set according to actual needs.

[0163] Specifically, according to different application scenarios, the first decision threshold, the second decision threshold, the third decision threshold, the fourth decision threshold, the fifth decision threshold, the sixth decision threshold, the seventh decision threshold, the eighth decision threshold, the ninth decision threshold, the tenth decision threshold, the eleventh decision threshold, and the twelfth decision threshold can be set with different numerical values.

[0164] For example, for video surveillance scenarios, when the movement of moving objects in the monitoring area is relatively violent, the difference in pixel values ​​between the pixel points in the macroblock to be determined and the corresponding pixel points in the corresponding macroblock 200 is usually large, and the first decision threshold to the twelfth decision threshold are correspondingly large, which is beneficial to improving the accuracy of P-SKIP macroblock recognition; when the movement of moving objects in the monitoring area is relatively gentle, the difference in pixel values ​​between the pixel points in the macroblock to be determined 100 and the corresponding pixel points in the corresponding macroblock 200 is generally small, and the first decision threshold to the twelfth decision threshold are correspondingly large or small, which is beneficial to improving the accuracy of P-SKIP macroblock recognition.

[0165] Correspondingly, an embodiment of the present invention further provides a P-SKIP macroblock decision module.

[0166] Figure 8 FIG. 2 shows a schematic diagram of a structure of a P-SKIP macroblock decision module provided in an embodiment of the present invention. Figure 8A P-SKIP macroblock decision module includes: a first acquisition submodule 810, adapted to acquire a macroblock to be decided in a current frame image; a second acquisition submodule 820, adapted to acquire a total motion sum of a small range motion of the macroblock to be decided based on the absolute error sum of pixel values ​​between the pixel points in the macroblock to be decided and the corresponding pixel points in the corresponding macroblock in the previous frame image; a first extension submodule 830, adapted to perform a first extension process on the macroblock to be decided in the current frame image to acquire a first extension block; a division processing submodule 840, adapted to divide the first extension block into a plurality of sub-extension blocks; a third acquisition submodule 850, adapted to acquire a total motion sum of a small range motion of the macroblock to be decided based on the absolute error sum of pixel values ​​between the pixel points in the macroblock to be decided and the corresponding pixel points in the corresponding macroblock in the previous frame image; a first expansion submodule 830, adapted to perform a first expansion ... expansion submodule 850, adapted to acquire a total motion sum of a small range motion of the macroblock to be decided based on the absolute error sum of pixel values ​​between the pixel points in the macroblock to be decided and the corresponding pixel points in the corresponding macroblock in the previous frame image; a first expansion submodule 830, adapted to perform a first expansion process on the macroblock to be decided in the The difference between the means is used to obtain the total motion sum of the local range motion of the macroblock to be determined; the second extension submodule 860 is suitable for performing a second extension process on the macroblock to be determined in the current frame image to obtain a second extension block, and the second extension block is larger than the first extension block; the fourth acquisition submodule 870 is suitable for obtaining the total motion sum of the large-scale motion of the macroblock to be determined based on the absolute error sum of the pixel values ​​between the pixel points in the second extension block and the corresponding pixel points of the corresponding second image block in the previous frame image; the judgment submodule 880 is suitable for determining whether the macroblock to be determined is a P-SKIP macroblock based on the total motion sum of the micro-range motion, the total motion sum of the local range motion and the total motion sum of the large-scale motion of the macroblock to be determined.

[0167] The P-SKIP macroblock decision module in the embodiment of the present invention can be used to execute the aforementioned P-SKIP macroblock decision method, or other functional modules can be used to execute the aforementioned P-SKIP macroblock decision method. For the P-SKIP macroblock decision method, please refer to the detailed description of the aforementioned part, which will not be repeated here.

[0168] Accordingly, an embodiment of the present invention also provides an encoding method.

[0169] Fig. 9 FIG. 1 is a flow chart showing a coding method in an embodiment of the present invention. Fig. 9 , a coding method comprising the following steps:

[0170] Step S910: using the P-SKIP macroblock determination method to determine whether the macroblock to be determined in the current frame image is a P-SKIP macroblock;

[0171] Step S920: When it is determined that the macroblock to be determined in the current frame image is a P-SKIP macroblock, the macroblock to be determined is encoded in skip mode.

[0172] In this embodiment, when it is determined that the macroblock to be determined in the current frame image is a P-SKIP macroblock, the steps of rate-distortion optimization (RDO) and mode selection of the encoder can be skipped, and the macroblock to be determined is encoded using the skip mode.

[0173] Accordingly, when it is determined that the macroblock to be determined in the current frame image is a non-P-SKIP macroblock, the rate-distortion optimization and mode selection module of the encoder uses a coding mode corresponding to the macroblock type to which the macroblock to be determined belongs, except for the skip mode, to encode the macroblock to be determined. Among them, other coding modes corresponding to the macroblock type to which the macroblock to be determined belongs include inter-frame mode, intra-frame mode, etc.

[0174] Correspondingly, an embodiment of the present invention further provides a coding device.

[0175] Fig.10 FIG. 1 is a schematic diagram showing the structure of an encoding device in an embodiment of the present invention. Fig.10 A coding device includes: a P-SKIP macroblock decision module 1001, suitable for using the P-SKIP macroblock decision method as described to determine whether the macroblock to be decided in the current frame image is a P-SKIP macroblock: a coding module 1002, suitable for using the skip mode to encode the macroblock to be decided when it is determined that the macroblock to be decided in the current frame image is a P-SKIP macroblock.

[0176] The encoding device in the embodiment of the present invention can be used to execute the aforementioned encoding method, or other devices can be used to execute the aforementioned encoding method. For the encoding method, please refer to the detailed description of the aforementioned part, which will not be repeated here.

[0177] Accordingly, an embodiment of the present invention further provides a chip on which the P-SKIP macroblock decision module or coding device is integrated. The P-SKIP macroblock decision module or coding device is described in the corresponding parts above and will not be described again.

[0178] Accordingly, an embodiment of the present invention further provides an electronic device, comprising at least one memory and at least one processor, wherein the memory stores one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the P-SKIP macroblock decision method or encoding method. The P-SKIP macroblock decision method or the encoding method is described in the corresponding parts above, and will not be described here.

[0179] Accordingly, an embodiment of the present invention further provides a storage medium, wherein the storage medium stores one or more computer instructions, wherein the one or more computer instructions are used to implement the P-SKIP macroblock decision method or encoding method. The P-SKIP macroblock decision method or encoding method is described in the corresponding part above, and will not be described again here.

[0180] An optional hardware structure of the electronic device provided by the embodiment of the present invention can be as follows Fig.11 As shown, it includes: at least one processor 01, at least one communication interface 02, at least one memory 03 and at least one communication bus 04.

[0181] In the embodiment of the present invention, the number of the processor 01 , the communication interface 02 , the memory 03 , and the communication bus 04 is at least one, and the processor 01 , the communication interface 02 , and the memory 03 communicate with each other through the communication bus 04 .

[0182] The communication interface 02 may be an interface of a communication module for network communication, such as an interface of a GSM module.

[0183] The processor 01 may be a central processing unit CPU, or an application specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention.

[0184] The memory 03 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), as an example, at least one disk memory.

[0185] The memory 03 stores one or more computer instructions, and the one or more computer instructions are executed by the processor 01 to implement the P-SKIP macroblock determination method or encoding method described in the embodiment of the present invention.

[0186] It should be noted that the above-mentioned terminal device may also include other devices (not shown) that may not be necessary for understanding the contents disclosed in the embodiments of the present invention; given that these other devices may not be necessary for understanding the contents disclosed in the embodiments of the present invention, the embodiments of the present invention will not introduce them one by one.

[0187] An embodiment of the present invention further provides a storage medium, wherein the storage medium stores one or more computer instructions, and the one or more computer instructions are used to implement the P-SKIP macroblock decision method or encoding method described in the embodiment of the present invention.

[0188] The above-mentioned embodiments of the present invention are combinations of elements and features of the present invention. Unless otherwise mentioned, the elements or features may be considered as optional. Each element or feature may be put into practice without being combined with other elements or features. In addition, the embodiments of the present invention may be constructed by combining some elements and / or features. The order of operations described in the embodiments of the present invention may be rearranged. Some constructions of any one embodiment may be included in another embodiment, and may be replaced by the corresponding construction of another embodiment. It is obvious to those skilled in the art that claims that do not have a clear reference relationship to each other in the attached claims may be combined into embodiments of the present invention, or may be included as new claims in the amendment after submitting this application.

[0189] The embodiments of the present invention may be implemented by various means as an example hardware, firmware, software or a combination thereof. In a hardware configuration, the method according to the exemplary embodiment of the present invention may be implemented by 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), processors, controllers, microcontrollers, microprocessors, etc.

[0190] In a firmware or software configuration, the embodiments of the present invention may be implemented in the form of modules, procedures, functions, etc. The software code may be stored in a memory unit and executed by a processor. The memory unit is located inside or outside the processor and may send data to and receive data from the processor via various known means.

[0191] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

[0192] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the scope defined by the claims.

Claims

1. A P-SKIP macroblock decision method, characterized in that: include: Obtain the macroblock to be determined in the current frame image; Based on the absolute error sum of the pixel values ​​between the pixel points in the macroblock to be determined and the corresponding pixel points in the corresponding macroblock in the previous frame image, the total motion sum of the micro-range motion of the macroblock to be determined is obtained; Performing a first expansion process on the macroblock to be determined in the current frame image to obtain a first expanded block; Dividing the first extension block into a plurality of sub-extension blocks; Based on the difference between the pixel average values ​​of the pixel points between the plurality of sub-extended blocks and the corresponding first image block in the previous frame image, obtaining the total motion sum of the local range motion of the macroblock to be determined; Performing a second extension process on the macroblock to be determined in the current frame image to obtain a second extended block, where the second extended block is larger than the first extended block; Obtaining a total motion sum of a large-scale motion of the macroblock to be determined based on a sum of absolute errors of pixel values ​​between pixel points in the second extended block and corresponding pixel points in the corresponding second image block in the previous frame image; Based on the total motion sum of the micro-range motion, the total motion sum of the local-range motion and the total motion sum of the large-range motion of the macroblock to be determined, it is determined whether the macroblock to be determined is a P-SKIP macroblock.

2. The P-SKIP macroblock decision method according to claim 1, characterized in that: The step of obtaining the total motion sum of the micro-range motion of the macroblock to be determined based on the absolute error sum of the pixel values ​​between the pixel points in the macroblock to be determined and the corresponding pixel points in the corresponding macroblock in the previous frame image comprises: Obtaining the sum of absolute errors of pixel values ​​between a pixel point in the macroblock to be determined and a corresponding pixel point in the corresponding macroblock; If the sum of absolute errors of pixel values ​​between the pixel point in the macroblock to be determined and the corresponding pixel point in the corresponding macroblock is greater than or equal to a preset first difference threshold, the motion prediction value of the pixel point in the macroblock to be determined is recorded as a first value; If the sum of absolute errors of pixel values ​​between a pixel point in the macroblock to be determined and a corresponding pixel point in the corresponding macroblock is less than the first difference threshold, the motion prediction value of the pixel point in the macroblock to be determined is recorded as a second value, and the second value is different from the first value; The sum of the motion prediction values ​​of the pixels in the macroblock to be determined is obtained as the total motion sum of the micro-range motion.

3. The P-SKIP macroblock decision method according to claim 1, characterized in that: The step of performing a first extension process on the macroblock to be determined in the current frame image to obtain a first extended block includes: Taking the macroblock to be determined as the center, (2N-1)*(2N-1) macroblocks arranged in an array are obtained in the current frame image as the first extended block, where N is a positive integer greater than 1.

4. The P-SKIP macroblock decision method according to claim 1, characterized in that: The step of dividing the first extension block into a plurality of sub-extension blocks comprises: The first extended block is equally divided into four sub-extended blocks.

5. The P-SKIP macroblock decision method according to claim 1, characterized in that: The step of obtaining the total motion sum of the local range motion of the macroblock to be determined based on the difference between the pixel average values ​​of the pixel points between the plurality of sub-extended blocks and the corresponding first image block in the previous frame image comprises: Obtaining a difference between a pixel average value of pixels in the sub-extended block and a pixel average value of pixels in the corresponding first image block; If the difference between the average pixel value of the sub-extended block and the average pixel value of the corresponding pixel points in the first image block is greater than or equal to a preset second difference threshold, the motion prediction value of the sub-extended block is recorded as a third value; If the difference between the average value of pixels of the sub-extended block and the average value of pixels in the corresponding first image block is less than the second difference threshold, the motion prediction value of the sub-extended block is recorded as a fourth value, and the fourth value is different from the third value; The sum of the motion prediction values ​​of the sub-extended blocks in the first extended block is obtained as the total motion sum of the local range motion of the macroblock to be determined.

6. The P-SKIP macroblock decision method according to claim 1, characterized in that: The step of performing a second extension process on the macroblock to be determined in the current frame image to obtain a second extended block includes: Taking the macroblock to be determined as the center, (2M-1)*(2M-1) macroblocks arranged in an array are obtained in the current frame image as the second extended block, where M is a positive integer greater than N.

7. The P-SKIP macroblock decision method according to claim 1, characterized in that: The step of obtaining the total motion sum of the large-scale motion of the macroblock to be determined based on the absolute error sum of the pixel points between the second extended block and the corresponding second image block in the previous frame image includes: Obtaining a sum of absolute errors of pixel values ​​between pixel points of the second extended block and corresponding pixel points of the second image block; If the sum of absolute errors of pixel values ​​between a pixel point of the second extended block and a corresponding pixel point of the second image block is greater than or equal to a preset third difference threshold, the motion prediction value of the pixel point in the second extended block is recorded as a fifth value; If the sum of absolute errors of pixel values ​​between the pixel points of the second extended block and the corresponding pixel points of the second image block is less than the third difference threshold, the motion prediction value of the pixel points in the second extended block is recorded as a sixth value, and the sixth value is different from the fifth value; The sum of the motion prediction values ​​of the pixels in the second extended block is obtained as the total motion sum of the large-scale motion.

8. The P-SKIP macroblock decision method according to claim 7, characterized in that: After obtaining the second extended block and before obtaining the total motion sum of the large-scale motion of the macroblock to be determined based on the absolute error sum of the pixel points between the second extended block and the corresponding second image block in the previous frame image, the method further includes: performing downsampling processing on the second extended block and the second image block respectively to obtain a first downsampling block and a second downsampling block; In the step of obtaining the total motion sum of the large-scale motion of the macroblock to be determined based on the sum of absolute errors of pixel points between the second extended block and the corresponding second image block in the previous frame image, the total motion sum of the large-scale motion of the macroblock to be determined is obtained based on the sum of absolute errors of pixel values ​​between the pixel points of the first down-sampling block and the corresponding pixel points of the second down-sampling block.

9. The P-SKIP macroblock decision method according to claim 1, characterized in that: The determining whether the macroblock to be determined is a P-SKIP macroblock based on the total motion sum of the micro-range motion, the total motion sum of the local range motion and the total motion sum of the large range motion of the macroblock to be determined comprises: If the total motion sum of the small range motion is greater than a preset first decision threshold, the total motion sum of the local range motion is less than a preset second decision threshold, and the total motion sum of the large range motion is less than a preset third decision threshold, then the macroblock to be decided is determined to be a P-SKIP macroblock; If the total motion sum of the small range motion is greater than a preset fourth decision threshold, the total motion sum of the local range motion is less than a preset fifth decision threshold, and the total motion sum of the large range motion is less than a preset sixth decision threshold, then the macroblock to be determined is determined to be a P-SKIP macroblock; the fourth decision threshold is greater than the first decision threshold, the fifth decision threshold is greater than the second decision threshold, and the sixth decision threshold is less than the third decision threshold; If the total motion sum of the small range motion is greater than the preset seventh decision threshold, the total motion sum of the local range motion is less than the preset eighth decision threshold, and the total motion sum of the large range motion is less than the preset ninth decision threshold, then the macroblock to be determined is determined to be a P-SKIP macroblock; the seventh decision threshold is greater than the fourth decision threshold, the eighth decision threshold is greater than the fifth decision threshold, and the ninth decision threshold is less than the sixth decision threshold; If the total motion sum of the small range motion is greater than the preset tenth decision threshold, the total motion sum of the local range motion is less than the preset eleventh decision threshold, and the total motion sum of the large range motion is less than the preset twelfth decision threshold, then the macroblock to be judged is determined to be a P-SKIP macroblock; the tenth decision threshold is greater than the seventh decision threshold, the eleventh decision threshold is greater than the eighth decision threshold, and the twelfth decision threshold is less than the ninth decision threshold.

10. A P-SKIP macroblock decision module, characterized in that: include: A first acquisition submodule, adapted to acquire a macroblock to be determined in a current frame image; A second acquisition submodule is adapted to acquire a total motion sum of a micro-range motion of the macroblock to be determined based on a sum of absolute errors of pixel values ​​between a pixel point in the macroblock to be determined and a corresponding pixel point in a corresponding macroblock in a previous frame of image; A first expansion submodule, adapted to perform a first expansion process on the macroblock to be determined in the current frame image to obtain a first expanded block; A division processing submodule, dividing the first extension block into a plurality of sub-extension blocks; A third acquisition submodule is adapted to acquire the total motion sum of the local range motion of the macroblock to be determined based on the difference between the pixel average values ​​of the pixel points between the plurality of sub-extended blocks and the corresponding first image block in the previous frame image; A second expansion submodule is adapted to perform a second expansion process on the macroblock to be determined in the current frame image to obtain a second expansion block, wherein the second expansion block is larger than the first expansion block; A fourth acquisition submodule, adapted to acquire a total motion sum of a large-scale motion of the macroblock to be determined based on a sum of absolute errors of pixels between the second extended block and a corresponding second image block in a previous frame of image; The decision submodule is adapted to determine whether the macroblock to be decided is a P-SKIP macroblock based on the total motion sum of the micro-range motion, the total motion sum of the local range motion and the total motion sum of the large range motion of the macroblock to be decided.

11. A coding method, characterized in that: include: Adopting the P-SKIP macroblock determination method as described in any one of claims 1 to 9 to determine whether the macroblock to be determined in the current frame image is a P-SKIP macroblock; When it is determined that the macroblock to be determined in the current frame image is a P-SKIP macroblock, the macroblock to be determined is encoded in skip mode.

12. A coding device, characterized in that: include: The P-SKIP macroblock decision module is adapted to use the P-SKIP macroblock decision method as described in any one of claims 1 to 9 to determine whether the macroblock to be decided in the current frame image is a P-SKIP macroblock: The encoding module is adapted to use a skip mode to encode the macroblock to be determined when it is determined that the macroblock to be determined in the current frame image is a P-SKIP macroblock.

13. A chip, characterized in that: The chip is integrated with the P-SKIP macroblock decision module as claimed in claim 10 or the encoding device as claimed in claim 12.

14. An electronic device, characterized in that: It includes at least one memory and at least one processor, wherein the memory stores one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the P-SKIP macroblock decision method as described in any one of claims 1 to 9 or the encoding method as described in claim 11.

15. A storage medium, characterized in that: The storage medium stores one or more computer instructions, and the one or more computer instructions are used to implement the P-SKIP macroblock decision as described in any one of claims 1-9. The encoding method as claimed in claim 11.

Citation Information

Patent Citations

  • Movement pre-estimation method used for monitoring scene

    CN104754333A

  • Macro block type judgment method and device, image processing chip and electronic equipment

    CN112437305A

  • Static identification area detection method and module, chip, electronic equipment and medium

    CN113870303A

  • Method and system for skip mode detection

    US20080247466A1

  • Code rate control method and apparatus, image acquisition device, and readable storage medium

    US20230232014A1