P-skip macroblock decision method, encoding method and related apparatus

By calculating the sum of the small-range, local-range, and large-range motions of the macroblock to be decided within the current frame image, it is determined whether it is a P-SKIP macroblock, which solves the problem of insufficient decision accuracy in the prior art and achieves higher decision accuracy.

CN119788848BActive Publication Date: 2026-07-21AMLOGIC (CHENG DU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AMLOGIC (CHENG DU) CO LTD
Filing Date
2023-10-08
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

The accuracy of P-SKIP macroblock decision-making in existing technologies still needs to be improved.

Method used

By acquiring the macroblock to be judged within the current frame image, and calculating the sum of motion in the small range, local range, and large range based on the absolute error between the pixels and the previous frame image, it is determined whether the macroblock is a P-SKIP macroblock.

Benefits of technology

It improves the accuracy of P-SKIP macroblock decision-making and reduces the interference of noise on the decision-making process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119788848B_ABST
    Figure CN119788848B_ABST
Patent Text Reader

Abstract

The application discloses a P-SKIP macro block decision method, an encoding method and related equipment. The P-SKIP macro block decision method is based on a total motion sum of micro range motion, a total motion sum of local range motion and a total motion sum of large range motion of a macro block to be decided, and determines whether the macro block to be decided is a P-SKIP macro block, so that the accuracy of P-SKIP macro block decision can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing, and more particularly to a P-SKIP macroblock decision method, encoding method, and related equipment. Background Technology

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

[0003] P-SKIP macroblocks, also known as COPY macroblocks, are a special type of P-macroblock in the H.264 coding standard. They do not have pixel residuals or motion vector residuals, and pixel prediction values ​​can be directly obtained from motion vectors (MV). When a macroblock to be encoded is determined to be a P-SKIP macroblock, the encoder uses a skip mode to encode the P-SKIP macroblock, which helps to reduce the coding rate and coding time.

[0004] However, the accuracy of P-SKIP macroblock decisions 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, encoding method and related equipment, which is beneficial to improving the accuracy of P-SKIP macroblock decision.

[0006] To address the aforementioned problems, this invention provides a P-SKIP macroblock decision method, comprising: acquiring a macroblock to be decided within a current frame image; acquiring the total motion sum of minute-range motions of the macroblock to be decided based on the sum of absolute errors between pixel values ​​in the macroblock to be decided and corresponding pixel values ​​in a corresponding macroblock in a previous frame image; performing a first expansion process on the macroblock to be decided within the current frame image to acquire a first expanded block; dividing the first expanded block into multiple sub-expanded blocks; and determining the total motion sum of pixel values ​​between the sub-expanded blocks and corresponding first image blocks in the previous frame image based on the pixel values ​​of the sub-expanded blocks and corresponding first image blocks in the previous frame image. The difference between the means is used to obtain the total local motion sum of the macroblock to be decided; the macroblock to be decided is subjected to a second expansion process in the current frame image to obtain a second expanded block, which is larger than the first expanded block; based on the absolute error of the pixels between the second expanded block and the corresponding second image block in the previous frame image, the total large-scale motion sum of the macroblock to be decided is obtained; based on the total small-scale motion sum, the total local motion sum, and the total large-scale motion sum of the macroblock to be decided, it is determined whether the macroblock to be decided is a P-SKIP macroblock.

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

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

[0009] Optionally, dividing the first extension block into multiple sub-extension blocks includes: dividing the first extension block into four equal sub-extension blocks.

[0010] Optionally, obtaining the total motion sum of the local range motion of the macroblock to be decided based on the differences between the average pixel values ​​of the pixels of the multiple sub-expansion blocks and the first image block of the previous frame image includes: obtaining image blocks in the previous frame image that correspond one-to-one with the sub-expansion blocks in the first expansion block, and respectively serving as the first image blocks; obtaining the difference between the average pixel value of the pixels in the sub-expansion blocks and the average pixel value of the pixels in the corresponding first image block; if the difference between the average pixel value of the sub-expansion blocks and the average pixel value of the pixels in the corresponding first image block is greater than or equal to a preset second difference threshold, then the motion prediction value of the sub-expansion block is recorded as a third value; if the difference between the average pixel value of the sub-expansion blocks and the average pixel value of the pixels in the corresponding first image block is less than the second difference threshold, then the motion prediction value of the sub-expansion blocks is recorded as a fourth value, the fourth value being different from the third value; obtaining the sum of the motion prediction values ​​of the sub-expansion blocks in the first expansion block as the total motion sum of the local range motion of the macroblock to be decided.

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

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

[0013] Optionally, after obtaining the second extended block, and before obtaining the total motion sum of the large-range motion of the macroblock to be decided based on the absolute error 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 the first downsampled block and the second downsampled block;

[0014] In the step of obtaining the total motion sum of the large-scale motion of the macroblock to be decided based on the sum of absolute errors of the pixel values ​​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 decided is obtained based on the sum of absolute errors of the pixel values ​​between the pixel values ​​of the first downsampling block and the corresponding pixel values ​​of the second downsampling block.

[0015] Optionally, determining whether the macroblock to be decided is a P-SKIP macroblock based on the sum of motion of its small-range motion, the sum of motion of its local-range motion, and the sum of motion of its large-range motion includes:

[0016] If the total motion of the small-range motion is greater than a preset first decision threshold, the total motion of the local-range motion is less than a preset second decision threshold, and the total motion 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 decided 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 decided 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 motions is greater than the preset tenth decision threshold, the total motion sum of the local-range motions is less than the preset eleventh decision threshold, and the total motion sum of the large-range motions is less than the preset twelfth decision threshold, then the macroblock to be decided 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, this embodiment of the invention also provides a P-SKIP macroblock decision module, comprising: a first acquisition submodule, adapted to acquire a macroblock to be decided within the current frame image; a second acquisition submodule, adapted to acquire the total motion sum of the minute-range motion of the macroblock to be decided based on the absolute error between the pixel values ​​of the pixels in the macroblock to be decided and the corresponding pixels in the corresponding macroblock in the previous frame image; a first expansion submodule, adapted to perform a first expansion processing on the macroblock to be decided within the current frame image to acquire a first expansion block; a division processing submodule, adapted to divide the first expansion block into multiple sub-expansion blocks; and a third acquisition submodule, adapted to acquire the total motion sum of the minute-range motion of the macroblock to be decided based on the absolute error between the pixel values ​​of the pixels in the macroblock to be decided and the corresponding pixels in the corresponding macroblock in the previous frame image. The first module is used to obtain the total local motion sum of the macroblock to be decided by taking the difference between the average pixel values ​​of the pixels in the current frame image. The second module is adapted to perform a second expansion process on the macroblock to be decided within the current frame image to obtain a second expansion block, which is larger than the first expansion block. The fourth module is adapted to obtain the total large-scale motion sum of the macroblock to be decided based on the absolute error between the second expansion block and the corresponding second image block in the previous frame image. The fifth module is adapted to determine whether the macroblock to be decided is a P-SKIP macroblock based on the total small-scale motion sum, the total local motion sum, and the total large-scale motion sum of the macroblock to be decided.

[0021] Accordingly, embodiments of the present invention also provide an encoding method, comprising: using the P-SKIP macroblock decision method as described in any of the above claims to determine whether the macroblock to be decided in the current frame image is a P-SKIP macroblock; when the macroblock to be decided in the current frame image is determined to be a P-SKIP macroblock, encoding the macroblock to be decided is performed using a skip mode.

[0022] Accordingly, embodiments of the present invention also provide an encoding apparatus, including: a P-SKIP macroblock decision module, adapted to determine whether a macroblock to be decided in the current frame image is a P-SKIP macroblock using the P-SKIP macroblock decision method as described in any of the above claims; and an encoding module, adapted to encode the macroblock to be decided in a skip mode when it is determined that the macroblock to be decided in the current frame image is a P-SKIP macroblock.

[0023] Accordingly, embodiments of the present invention also provide a chip, wherein the chip integrates a P-SKIP macroblock decision module as described above or an encoding device as described above.

[0024] Accordingly, embodiments of the present invention also provide an electronic device, including 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 above or the encoding method as described above.

[0025] Accordingly, embodiments of the present invention also provide a storage medium storing one or more computer instructions, the one or more computer instructions being used to implement the P-SKIP macroblock decision encoding method as described above.

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

[0027] The P-SKIP macroblock determination method of this invention includes: acquiring a macroblock to be determined in the current frame image; acquiring the total motion sum of the micro-range motion of the macroblock to be determined based on the sum of absolute errors between the pixel values ​​of the pixels in the macroblock to be determined and the corresponding pixels in the corresponding macroblock in the previous frame image; performing a first expansion process on the macroblock to be determined in the current frame image to acquire a first expansion block; dividing the first expansion block into multiple sub-expansion blocks; acquiring the total motion sum of the local range motion of the macroblock to be determined based on the differences between the average pixel values ​​of the pixels of the multiple sub-expansion blocks and the corresponding first image blocks in the previous frame image; performing a second expansion process on the macroblock to be determined in the current frame image to acquire a second expansion block, wherein the second expansion block is larger than the first expansion block; acquiring the total motion sum of the large range motion of the macroblock to be determined based on the sum of absolute errors between the pixels of the second expansion block and the corresponding second image blocks in the previous frame image; and 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.

[0028] The P-SKIP macroblock decision method of this invention determines whether the macroblock to be decided 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 to be decided. It can determine the motion attributes of the macroblock to be decided by successively increasing motion intensity in the small-range, local-range, and large-range, thereby reducing the interference of noise on P-SKIP macroblock decision and thus helping to improve the accuracy of P-SKIP macroblock decision. Attached Figure Description

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

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

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

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

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

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

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

[0036] Figure 8 This is a schematic diagram of the structure of an embodiment of the P-SKIP macroblock decision module provided in this invention;

[0037] Figure 9 This is a flowchart illustrating an encoding method according to an embodiment of the present invention;

[0038] Figure 10 This is a schematic diagram of the structure of an encoding device according to an embodiment of the present invention;

[0039] Figure 11 This is a schematic diagram of an optional hardware structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

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

[0041] To address the technical problem, the P-SKIP macroblock decision method of this invention includes: acquiring a macroblock to be decided within the current frame image; acquiring the total motion sum of minute-range motions of the macroblock to be decided based on the absolute error between the pixel values ​​of the pixels in the macroblock to be decided and the corresponding pixels in the corresponding macroblock in the previous frame image; performing a first expansion process on the macroblock to be decided within the current frame image to acquire a first expanded block; dividing the first expanded block into multiple sub-expanded blocks; and based on the pixel average of the pixels between the multiple sub-expanded blocks and the corresponding first image blocks in the previous frame image. The difference between values ​​is used to obtain the total local motion sum of the macroblock to be decided; a second expansion process is performed on the macroblock to be decided within the current frame image to obtain a second expanded block, which is larger than the first expanded block; based on the absolute error of the pixels between the second expanded block and the corresponding second image block in the previous frame image, the total large-scale motion sum of the macroblock to be decided is obtained; based on the total small-scale motion sum, the total local motion sum, and the total large-scale motion sum of the macroblock to be decided, it is determined whether the macroblock to be decided is a P-SKIP macroblock.

[0042] The P-SKIP macroblock decision method of this invention determines whether the macroblock to be decided 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 to be decided. It can determine the motion attributes of the macroblock to be decided by successively increasing motion intensity in the small-range, local-range, and large-range, thereby reducing the interference of noise on P-SKIP macroblock decision and thus helping to improve the accuracy of P-SKIP macroblock decision.

[0043] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0044] Figure 1 This is a schematic flowchart of an embodiment of the P-SKIP macroblock decision method provided by the present invention. See also... Figure 1 A P-SKIP macroblock decision method may specifically include the following steps:

[0045] Step S110: Obtain the macroblock to be decided within the current frame image;

[0046] Step S120: Based on the sum of absolute errors between the pixel values ​​of the pixels in the macroblock to be decided and the corresponding pixels in the corresponding macroblock in the previous frame image, obtain the total motion sum of the minute range of motion of the macroblock to be decided;

[0047] Step S130: Perform a first expansion process on the macroblock to be decided within the current frame image to obtain a first expanded block;

[0048] Step S140: Divide the first expansion block into multiple sub-expansion blocks;

[0049] Step S150: Based on the difference between the pixel average values ​​of the pixels between the multiple sub-extended blocks and the corresponding first image blocks in the previous frame image, obtain the total local range motion of the macroblock to be decided;

[0050] Step S160: Perform a second expansion process on the macroblock to be decided within the current frame image to obtain a second expanded block, wherein the second expanded block is larger than the first expanded block;

[0051] Step S170: Based on the sum of absolute errors between the pixel values ​​of the pixels in the second extended block and the corresponding pixels of the second image block in the previous frame image, obtain the total motion sum of the large-scale motion of the macroblock to be decided;

[0052] Step S180: Based on the sum of the small-range motions, the sum of the local-range motions, and the sum of the large-range motions of the macroblock to be decided, determine whether the macroblock to be decided is a P-SKIP macroblock.

[0053] Please see Figure 1 Execute step S110 to obtain the macroblock to be decided in the current frame image.

[0054] The macroblock to be judged within the current frame image is obtained, which provides a basis for subsequently obtaining 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 to be judged.

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

[0056] In this embodiment, the current frame image is first divided into multiple macroblocks (MBs), and then each macroblock in the current frame image is traversed in a preset order, and the current macroblock that has been traversed is taken as the macroblock to be decided.

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

[0058] Figure 2This diagram illustrates the macroblock to be decided within the current frame and its corresponding macroblock within the previous frame. Please refer to the reference. Figure 1 and Figure 2 Step S120 is executed, based on the sum of absolute errors between the pixel values ​​of the pixels in the macroblock 100 to be decided and the corresponding pixels in the corresponding macroblock 200 in the previous frame image, to obtain the total motion of the small range of motion of the macroblock 100 to be decided.

[0059] Based on the absolute error between the pixel values ​​of the pixels in the macroblock 100 to be decided and the corresponding pixels in the corresponding macroblock 200 in the previous frame image, the total motion of the macroblock 100 within a small range is obtained, thereby providing a reference for determining whether the macroblock to be decided is a P-SKIP macroblock by the motion intensity of the macroblock 100.

[0060] In this embodiment, the corresponding macroblock 200 of the macroblock 100 to be decided is obtained in the previous frame image based on its position coordinates. Specifically, the macroblock in the previous frame image that is at the same position as the macroblock 100 to be decided is taken as the corresponding macroblock 200 of the macroblock 100 to be decided.

[0061] In other embodiments, the macroblock to be decided can also be matched with macroblocks in the previous frame image to obtain macroblocks in the previous frame image that match the macroblock to be decided, and these macroblocks are used as the corresponding macroblocks of the macroblock to be decided.

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

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

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

[0065] In this embodiment, the sum of absolute differences (SAD) of pixel values ​​between the pixels in the macroblock to be decided 100 and the corresponding pixels in the corresponding macroblock 200 is calculated using the following formula:

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

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

[0068] As can be seen from the above formula (1), when the macroblock to be decided belongs to a static region, the pixel value change between the pixel point in the macroblock to be decided 100 and the corresponding pixel point in the corresponding macroblock 200 is small. Accordingly, the absolute error between the pixel point in the macroblock to be decided 100 and the corresponding pixel point in the corresponding macroblock 200 will be less than the preset first difference threshold.

[0069] Conversely, when the macroblock 100 to be decided belongs to a dynamic region, the pixel values ​​of the pixels in the macroblock 100 to be decided and the corresponding pixels in the corresponding macroblock 200 vary greatly. Accordingly, the sum of the absolute errors of the pixel values ​​between the pixels in the macroblock 100 to be decided and the corresponding pixels in the corresponding macroblock 200 will be greater than or equal to the first difference threshold.

[0070] Therefore, if the sum of the absolute errors of pixel values ​​between the pixels in the macroblock 100 to be decided and the corresponding pixels in the corresponding macroblock 200 is greater than or equal to a preset first difference threshold, the motion prediction value of the pixels in the macroblock 100 to be decided is recorded as a first value. If the sum of the absolute errors of pixel values ​​between the pixels in the macroblock 100 to be decided and the corresponding pixels in the corresponding macroblock 200 is less than the first difference threshold, the motion prediction value of the pixels in the macroblock 100 to be decided is recorded as a second value. Thus, by summing the motion prediction values ​​of the pixels in the macroblock 100 to be decided, that is, summing the total motion of the macroblock 100 within a small range, it is possible to determine whether the macroblock 100 to be decided has more pixels belonging to static regions or more pixels belonging to dynamic regions.

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

[0072] It is understandable that the more pixels belonging to the dynamic region in the macroblock 100 to be decided, the greater the value of the total motion sum of the small-range motion of the macroblock 100 to be decided; and the more pixels belonging to the static region in the macroblock 100 to be decided, the smaller the value of the total motion sum of the small-range motion of the macroblock 100 to be decided.

[0073] Therefore, the larger the value of the total motion sum of the minute-range motions of the macroblock 100 to be decided, the more pixels belonging to the dynamic region in the macroblock 100 to be decided can be determined; the smaller the value of the total motion sum of the minute-range motions of the macroblock 100 to be decided, the more pixels belonging to the static region in the macroblock 100 to be decided can be determined.

[0074] In other embodiments, the first value may also be less than the second value. Accordingly, the more pixels belonging to the dynamic region in the macroblock to be decided, the smaller the total value of the motion sum of the small-range motions of the macroblock to be decided; the more pixels belonging to the static region in the macroblock to be decided, the larger the total value of the motion sum of the small-range motions of the macroblock to be decided.

[0075] In this embodiment, the larger the value of the total motion sum of the minute-range motions of the macroblock to be decided, the more pixels belonging to the static region in the macroblock to be decided can be determined; the smaller the value of the total motion sum of the minute-range motions of the macroblock to be decided, the more pixels belonging to the dynamic region in the macroblock to be decided can be determined.

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

[0077] It should be noted that, for video surveillance scenarios using IP cameras, when the camera position is fixed, the more vigorous the movement of moving objects within the monitored area, the larger the pixel value difference between the pixels in the macroblock 100 to be decided and the corresponding pixels in the corresponding macroblock 200, and the larger the first difference threshold, which helps to improve the accuracy of motion state recognition of pixels in the macroblock 100 to be decided. Conversely, the more gentle the movement of moving objects within the monitored area, the smaller the pixel value difference between the pixels in the macroblock 100 to be decided and the corresponding pixels in the corresponding macroblock 200, and the smaller the first difference threshold, which helps to improve the accuracy of motion state recognition of pixels in the macroblock 100 to be decided.

[0078] Figure 3 This diagram illustrates the positional relationship between the macroblock to be decided and the first extended block in an embodiment of the present invention. Please refer to the reference. Figures 1 to 3 Step S130 is executed, in which the macroblock 100 to be decided is subjected to a first expansion process within the current frame image to obtain a first expansion block 300.

[0079] Within the current frame image, the macroblock 100 to be decided is subjected to a first expansion process to obtain a first expansion block 300. This provides a basis for subsequently dividing the first expansion block 300 into multiple sub-expansion blocks and obtaining the total local range motion of the macroblock 100 to be decided based on the difference between the pixel average values ​​of the pixels of the multiple sub-expansion blocks and the corresponding first image blocks in the previous frame image.

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

[0081] See Figure 3 Taking N=2 as an example, with the macroblock to be decided 100 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 extension block 300 includes the macroblock to be decided 100, a macroblock 101 located at the upper left corner of the macroblock to be decided 100, a macroblock 102 located directly above the macroblock to be decided 100, a macroblock 103 located at the upper right corner of the macroblock to be decided 100, a macroblock 104 located to the right of the macroblock to be decided 100, a macroblock 105 located at the lower right corner of the macroblock to be decided 100, a macroblock 106 located directly below the macroblock to be decided 100, a macroblock 107 located at the lower left corner of the macroblock to be decided 100, and a macroblock 108 located to the left of the macroblock to be decided 100.

[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 larger accordingly; if the value of N is smaller, the first expansion block 300 will be smaller accordingly.

[0084] It should be noted that when the macroblock 100 to be decided is located in the edge region of the current frame image, during the first expansion processing of the macroblock 100 to be decided within the current frame image, the size of the image block located in the corresponding position region of the macroblock 100 to be decided within the current frame image may be smaller than the size of the macroblock 100 to be decided. In this case, the image block is discarded, and only the macroblock with the same size as the macroblock 100 to be decided and located in the corresponding position region of the macroblock 100 to be decided is retained, which together with the macroblock 100 to be decided constitutes the first expansion block 300.

[0085] It should also be noted that when the macroblock is rectangular and the macroblock 100 to be decided is subjected to the first expansion process within the current frame image, if the size of the image block located in the corresponding position area of ​​the macroblock 100 to be decided within the current frame image is smaller than the size of the macroblock 100 to be decided, and the image block is discarded, since the macroblock 100 to be decided is centered on the macroblock 100 to be decided, the first expansion block 100 is still rectangular after discarding the image block smaller than the size of the macroblock 100 to be decided.

[0086] In this embodiment, taking 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, where N is a positive integer greater than 1. Accordingly, the first extended block 300 is greater than the macroblock to be decided 100 and includes the macroblock to be decided 100.

[0087] Figure 4 It shows that Figure 3 The diagram shows the first expansion block divided into four sub-expansion blocks. Please refer to the reference. Figures 1 to 4 Then, in step S140, the first extension block 300 is divided into multiple sub-extension blocks 301 to 30n.

[0088] The first extended block 300 is divided into multiple sub-extended blocks 301 to 30n, which provides a basis for obtaining the total local range motion of the macroblock 100 to be decided based on the difference between the pixel average value of the pixels of the multiple sub-extended blocks 301 to 30n and the corresponding first image block in the previous frame image.

[0089] In this embodiment, the first expansion block 300 is divided into multiple sub-expansion blocks. In other words, the multiple sub-expansion blocks 301 to 30n obtained by dividing the first expansion block 300 are all the same size.

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

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

[0092] In other embodiments, the first expansion block can be non-uniformly divided into multiple sub-expansion blocks; in other words, at least two of the resulting multiple sub-expansion blocks are different.

[0093] Figure 5This diagram illustrates how the first image block in the previous frame is divided into four first image blocks. Please refer to the reference. Figures 1 to 5 In step S150, based on the difference between the pixel average values ​​of the pixels between the multiple sub-extended blocks 30k and the corresponding first image block 40k in the previous frame image, the total local range motion of the macroblock 100 to be decided is obtained.

[0094] Based on the differences between the average pixel values ​​of the pixels of the multiple sub-extended blocks 30k and the corresponding first image block 40k in the previous frame image, the total local range motion of the macroblock 100 to be decided is obtained. Thus, the motion intensity of the multiple sub-extended blocks 301 to 30n obtained by dividing the macroblock 100 to be decided by the first extended block 300 centered on the macroblock 100 to be decided provides a reference for subsequently determining whether the macroblock to be decided is a P-SKIP macroblock.

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

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

[0097] Specifically, based on the position coordinates of each sub-expansion block 30k in the current frame, an image block with the same position coordinates as each sub-expansion block 30k can be obtained in the previous frame image and used as the first image block 40k corresponding to the sub-expansion block 30k.

[0098] Alternatively, one can first determine the corresponding image block 400 that has the same position coordinates as the first expansion block 300, and divide the corresponding image block 400 into multiple sub-image blocks in the same way as dividing the first expansion block 300 into multiple sub-expansion blocks 301 to 30n, so that the sub-expansion blocks 301 to 30n in the first expansion block 300 correspond one-to-one with the sub-image blocks in the corresponding image block 400. Then, the sub-image blocks corresponding to the sub-expansion blocks 301 to 30n are obtained from the corresponding image block 400 and used as the first image blocks 401 to 40n corresponding to the sub-expansion blocks.

[0099] In other embodiments, the sub-expansion block can also be matched with image blocks in the previous frame to obtain macroblocks in the previous frame that match the sub-expansion block, which are then used as the corresponding first image blocks.

[0100] In this embodiment, the step of obtaining the total local range motion of the macroblock 100 to be decided based on the differences between the average pixel values ​​of the pixels in the sub-expansion blocks 301-30n and the corresponding first image blocks 401-40n in the previous frame image includes: obtaining the difference between the average pixel value of the pixels in the sub-expansion block 30k and the average pixel value of the pixels in the corresponding first image block 40k; if the difference between the average pixel value of the pixels in the sub-expansion block 30k and the average pixel value of the pixels in the corresponding first image block 40k is... If the motion prediction value of the sub-extended block 30k is greater than or equal to a preset second difference threshold, then the motion prediction value of the sub-extended block 30k is recorded as the third value; if the difference between the average pixel value of the pixels in the sub-extended block 30k and the average pixel value of the pixels in the corresponding first image block 40k is less than the second difference threshold, then the motion prediction value of the sub-extended block 30k is recorded as the 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 decided.

[0101] It is understandable that when the sub-expansion block 30k belongs to a static region, the pixel value change between the pixels in the sub-expansion block 30k and the corresponding pixels in the first image block 40k is small, and the change between the average pixel value of the pixels in the sub-expansion block 30k and the average pixel value of the pixels in the first image block 40k is also relatively small. Accordingly, the difference between the average pixel value of the pixels in the sub-expansion block 30k and the average pixel value of the pixels in the first image block 40k will be less than the preset second difference threshold.

[0102] Conversely, when the sub-expansion block 30k belongs to a dynamic region, the pixel value of the pixel in the sub-expansion block 30k and the corresponding pixel in the first image block 40k varies greatly, and the average pixel value of the pixel in the sub-expansion block 30k and the average pixel value of the pixel in the first image block 40k also varies greatly. Accordingly, the difference between the average pixel value of the pixel in the sub-expansion block 30k and the average pixel value of the pixel in the first image block 40k will be greater than or about the second difference threshold.

[0103] If the difference between the average pixel value of the pixels in the sub-expansion block 30k and the average pixel 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-expansion block 30k is recorded as a third value. If the difference between the average pixel value of the pixels in the sub-expansion block 30k and the average pixel 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-expansion block 30k is recorded as a fourth value. Thus, by summing the motion prediction values ​​of the multiple sub-expansion blocks 301 to 30n in the first expansion block 300, that is, the total motion sum of the local range motion of the macroblock to be decided 100, it can be determined whether there are more sub-expansion blocks 30k belonging to the static region or more sub-expansion blocks 30k belonging to the dynamic region in the first expansion block 300.

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

[0105] It is understandable that the more sub-extension blocks 30k belonging to the dynamic region within the first extension block 300, the greater the value of the total motion sum of the local range of the macroblock 100 to be decided; conversely, the more sub-extension blocks 30k belonging to the static region within the first extension block 300, the smaller the value of the total motion sum of the local range of the macroblock 100 to be decided.

[0106] Therefore, the larger the value of the total motion sum of the local range of the macroblock 100 to be decided, the more sub-extension blocks 30k belonging to the dynamic region within the first extension block 300 can be determined; the smaller the value of the total motion sum of the local range of the macroblock 100 to be decided, the more sub-extension blocks 30k belonging to the static region within the first extension block 300 can be determined.

[0107] In other embodiments, the third value may also be less than the fourth value. Correspondingly, the more sub-extension blocks belonging to the static region within the first extension block, the greater the sum of the local range motions of the macroblock to be decided; conversely, the more sub-extension blocks belonging to the dynamic region within the first extension block, the smaller the sum of the local range motions of the macroblock to be decided.

[0108] In this embodiment, the larger the value of the total motion sum of the local range of the macroblock to be decided, the more sub-extended blocks belonging to the static region within the first extended block can be determined; the smaller the value of the total motion sum of the local range of the macroblock to be decided, the more sub-extended blocks belonging to the dynamic region within the first extended block can be determined.

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

[0110] The second difference threshold can be implemented according to the aforementioned description of the first difference threshold, and will not be repeated here.

[0111] Figure 6 This diagram illustrates the positional relationship between the macroblock to be decided and the second extended block in an embodiment of the present invention. Please refer to the reference. Figures 1 to 6 Step S160 is executed, in which the macroblock 100 to be decided is subjected to a second expansion process in the current frame image to obtain a second expansion block 500, the second expansion block 500 being greater than the first expansion block 300.

[0112] The macroblock 100 to be decided is subjected to a second expansion process within the current frame image to obtain a second expansion block 500. This provides a basis for subsequently obtaining the total motion of the macroblock 100 with a large range of motion based on the absolute error 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 of the macroblock 100 to be decided within the current frame image with the macroblock 100 to be decided as the center to obtain a second expansion block 500 includes: obtaining (2M-1)*(2M-1) macroblocks arranged in an array within the current frame image with the macroblock 100 to be decided as the center, as the second expansion block, where M is a positive integer greater than N.

[0114] See Figure 6 Taking M equals 3 as an example, with the macroblock to be decided 100 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, i.e., the macroblock 100 to be decided and macroblocks 101-108, but also macroblock 109 located at the upper left corner of macroblock 101, macroblock 110 located directly above macroblock 101, macroblock 111 located directly above macroblock 102, macroblock 112 located directly above macroblock 103, macroblock 113 located at the upper right corner of macroblock 103, and macroblock 114 located to the right of macroblock 103. Macroblock 115 is located to the right of macroblock 104. Macroblock 116 is located to the right of macroblock 105. Macroblock 117 is located at the lower right corner of macroblock 105. Macroblock 118 is located directly below macroblock 105. Macroblock 119 is located directly below macroblock 106. Macroblock 120 is located directly below macroblock 107. Macroblock 121 is located at the lower left corner of macroblock 107. Macroblock 122 is located to the left of macroblock 107. Macroblock 123 is located to the left of macroblock 108. Macroblock 124 is located to the left of macroblock 101.

[0116] 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 content in the second extension block 500, please refer to the corresponding content in the first extension block 300 for execution, and will not be repeated here.

[0118] Figure 7 A schematic diagram of the second extended block and its corresponding second image block is shown. Please refer to the reference. Figures 1 to 7 Step S170 is executed, based on the sum of absolute errors between the pixel values ​​of the pixels in the second extended block 500 and the corresponding pixels of the second image block 600 in the previous frame image, to obtain the total motion of the macroblock 100 to be decided over a wide range.

[0119] Based on the absolute error between the pixel values ​​of the pixels in the second extended block 500 and the corresponding pixels in the second image block 600 in the previous frame, the total motion of the macroblock 100 to be decided is obtained. Thus, the motion intensity of the second extended block 500 centered on the macroblock 100 to be decided can provide a reference for determining whether the macroblock 100 to be decided is a P-SKIP macroblock.

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

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

[0122] As an example, the similarity between the second extended block 500 and the image blocks in the previous frame image is calculated, and the image blocks in the previous frame image with a similarity greater than a preset threshold with the second extended block 500 are taken 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 decided based on the sum of absolute errors between the pixel values ​​of 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 between the pixel values ​​of the pixels in the second extended block 500 and the corresponding pixels in the second image block 600; if the sum of absolute errors between the pixel values ​​of 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, then the motion prediction value of the pixels in the second extended block 500 is recorded as a fifth value; if the sum of absolute errors between the pixel values ​​of 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, then the motion prediction value of the pixels in the second extended block 500 is recorded as a sixth value, the sixth value being different from the fifth value; 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 expansion block 500 correspond one-to-one with 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 expansion block 500 are taken as the corresponding pixels in the second expansion block 500.

[0125] Regarding the absolute error between the pixel values ​​of the second extended block 500 and the corresponding pixel values ​​of the second image block 600, please refer to the aforementioned description of the absolute error between the pixel values ​​of the pixel values ​​of the macroblock to be decided 100 and the corresponding pixel values ​​of the corresponding macroblock 200, and will not be repeated here.

[0126] Similarly, when the second extended block 500 belongs to a static region, the pixel value change between the pixel point in the second extended block 500 and the corresponding pixel point in the corresponding second image block 600 in the previous frame image is small. Accordingly, the absolute error between the pixel point in the second extended block 500 and the corresponding pixel point in the corresponding second image block 600 will be less than the preset third difference threshold.

[0127] Conversely, when the second extended block 500 belongs to a dynamic region, the pixel values ​​of the pixels in the second extended block 500 and the corresponding pixels in the second image block 600 in the previous frame image change significantly. Consequently, the absolute error between the pixel values ​​of the pixels in the second extended block 500 and the corresponding pixels in the second image block 600 will be greater than or equal to the third difference threshold.

[0128] Therefore, if the sum of the 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 a preset third difference threshold, the motion prediction value of the pixels in the second extended block 500 is recorded as the fifth value. If the sum of the 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. Thus, by summing 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 decided, it can be determined whether there are more pixels belonging to the static region or more pixels belonging to the dynamic region in the second extended block 500.

[0129] In this embodiment, the fifth value is greater than the sixth value. Correspondingly, the maximum value of the total motion sum of the large-scale motion of the macroblock 100 to be decided 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 decided is W*L*(2M-1)*(2M-1)*S6. Wherein, S5 represents the fifth value, and S6 represents the sixth value.

[0130] It is understandable that the more pixels belonging to the dynamic region within the second extended block 500, the greater the total motion sum of the large-scale motion of the macroblock 100 to be decided; conversely, the more pixels belonging to the static region within the second extended block 500, the smaller the total motion sum of the large-scale motion of the macroblock 100 to be decided.

[0131] Therefore, the larger the value of the total motion sum of the large-scale motion of the macroblock 100 to be decided, the more pixels of the second extended block 500 that can be determined to belong to the dynamic region; the smaller the value of the total motion sum of the large-scale motion of the macroblock 100 to be decided, the more pixels of the second extended block 500 that can be determined to belong to the static region.

[0132] In other embodiments, the fifth value may also be less than the sixth value. Correspondingly, the more pixels the second extended block belongs to the dynamic region, the smaller the total motion sum of the large-scale motion of the macroblock to be decided; conversely, the more pixels the second extended block belongs to the static region, the larger the total motion sum of the large-scale motion of the macroblock to be decided.

[0133] Accordingly, in this embodiment, the smaller the value of the total motion sum of the large-scale motion of the macroblock to be decided, the more pixels belonging to the dynamic region within the second extended block can be determined; the larger the value of the total motion sum of the large-scale motion of the macroblock to be decided, the more pixels belonging to the static region within the second extended block can be determined.

[0134] The third difference threshold can be set according to actual needs. The third difference threshold can be implemented based on the aforementioned description of the first difference threshold, and 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 decided based on the absolute error between the pixel values ​​of the pixels in the second extended block and the corresponding pixels of the second image block in the previous frame image, the P-SKIP macroblock decision method further includes: performing downsampling processing on the second extended block and the second image block respectively to obtain a first downsampled block and a second downsampled block.

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

[0137] In this embodiment, the first downsampling block and the second downsampling block have the same size as the macroblock to be decided. In other instances, the sizes of the first downsampling block and the second downsampling block may also be larger or smaller than the size of the macroblock to be decided 100, and this is not limited here.

[0138] By downsampling the second extended block and the second image block to obtain the first downsampled block and the second downsampled block, the amount of subsequent data processing can be reduced, which in turn helps to improve the acquisition speed of the total motion sum of the large-scale motion of the macroblock to be decided, thereby benefiting the acquisition speed of P-SKIP macroblocks.

[0139] Please continue reading Figure 1 Step S180 is executed, based on the sum of the small-range motion, the sum of the local-range motion, and the sum of the large-range motion of the macroblock 100 to be decided, to determine whether the macroblock 100 to be decided is a P-SKIP macroblock.

[0140] In this embodiment, the step of determining whether the macroblock 100 to be decided is a P-SKIP macroblock based on the sum of small-range motions, the sum of local-range motions, and the sum of large-range motions of the macroblock 100 to be decided includes the following scenarios:

[0141] In the first case, 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 100 to be decided is determined to be a P-SKIP macroblock.

[0142] In this embodiment, if the total motion of the micro-range motion is greater than the preset first decision threshold, it indicates that the number of pixels belonging to the static region within the macroblock 100 to be decided is small, while the number of pixels belonging to the dynamic region is large.

[0143] In this embodiment, if the total motion of the local area is less than the preset second decision threshold, it indicates that there are more sub-extension blocks belonging to the static region and fewer sub-extension blocks belonging to the dynamic region in the first extension block 300.

[0144] In this embodiment, if the total motion of the large-scale motion is less than the preset third decision threshold, it indicates that there are more pixels belonging to the static region within the second extension block 500, while there are fewer pixels belonging to the dynamic region.

[0145] In summary, when the total sum of motion in the minute range is greater than a preset first decision threshold, the total sum of motion in the local range is less than a preset second decision threshold, and the total sum of motion in the large range is less than a preset third decision threshold, although the macroblock 100 to be decided is more likely to belong to a dynamic region in terms of the total sum of motion in the minute range, it is relatively more likely to belong to a static region in terms of the total sum of motion in the local range and the total sum of motion in the large range. In this case, the macroblock 100 to be decided can be classified as a P-SKIP macroblock.

[0146] The second scenario is that if the total motion sum of the small-range motions is greater than a preset fourth decision threshold, the total motion sum of the local-range motions is less than a preset fifth decision threshold, and the total motion sum of the large-range motions is less than a preset sixth decision threshold, then the macroblock 100 to be decided 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 of the micro-range motion is greater than a preset fourth decision threshold, and the fourth decision threshold is greater than the first decision threshold. Compared with the first case, the number of pixels belonging to the static region in the macroblock 100 to be decided is less, while the number of pixels belonging to the dynamic region is more.

[0148] In this embodiment, when the total motion of the local range 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-extension blocks 30k belonging to the static region in the first extension block 300 is less, while the number of sub-extension blocks 30k belonging to the dynamic region is more.

[0149] In this embodiment, the total motion of the large-scale 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 pixels belonging to the static region in the second extension block 500 is greater, while the number of pixels belonging to the dynamic region is less.

[0150] Therefore, when the total motion sum of the small-range motions is greater than a preset fourth decision threshold, the total motion sum of the local-range motions is less than a preset fifth decision threshold, and the total motion sum of the large-range motions is less than a preset sixth decision threshold, compared to the first case, although the probability that the macroblock 100 to be decided belongs to a dynamic region increases in terms of the total motion sum of the small-range motions and the total motion sum of the local-range motions, the probability that the macroblock 100 to be decided belongs to a static region in terms of the total motion sum of the large-range motions is still relatively high. In this case, the macroblock 100 to be decided can be a P-SKIP macroblock.

[0151] The third scenario is that if the total motion sum of the small-range motions is greater than a preset seventh decision threshold, the total motion sum of the local-range motions is less than a preset eighth decision threshold, and the total motion sum of the large-range motions is less than a preset ninth decision threshold, then the macroblock 100 to be decided 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 of the micro-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 pixels belonging to the static region in the macroblock 100 to be decided is less, while the number of pixels belonging to the dynamic region is more.

[0153] In this embodiment, when the total motion of the local range 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-extension blocks 30k belonging to the static region in the first extension block 300 is less, while the number of sub-extension blocks 30k belonging to the dynamic region is more.

[0154] In this embodiment, the total motion of the large-scale 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 pixels belonging to the static region in the second extension block 500 is greater, while the number of pixels belonging to the dynamic region is less.

[0155] Accordingly, when the total sum of motion in the minute-range motion is greater than a preset fourth decision threshold, the total sum of motion in the local-range motion is less than a preset fifth decision threshold, and the total sum of motion in the large-range motion is less than a preset sixth decision threshold, compared to the second case, although the probability that the macroblock 100 to be decided belongs to a dynamic region increases in terms of the total sum of motion in the minute-range motion and the total sum of motion in the local-range motion, the probability that the macroblock 100 to be decided belongs to a static region in terms of the total sum of motion in the large-range motion is still relatively high. In this case, the macroblock 100 to be decided can be a P-SKIP macroblock.

[0156] The fourth scenario is that if the total motion sum of the small-range motions is greater than the preset tenth decision threshold, the total motion sum of the local-range motions is less than the preset eleventh decision threshold, and the total motion sum of the large-range motions is less than the preset twelfth decision threshold, then the macroblock 100 to be decided 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 of the micro-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 pixels belonging to the static region in the macroblock 100 to be decided is further reduced, while the number of pixels belonging to the dynamic region is further increased.

[0158] In this embodiment, when the total motion of the local range 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-extension blocks 30k belonging to the static region in the first extension block 300 is further reduced, while the number of sub-extension blocks 30k belonging to the dynamic region is further increased.

[0159] In this embodiment, the total motion of the large-scale 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 region in the second extended block further increases, while the number of pixels belonging to the dynamic region further decreases.

[0160] Correspondingly, when the total sum of motion in the minute range is greater than a preset tenth decision threshold, the total sum of motion in the local range is less than a preset eleventh decision threshold, and the total sum of motion in the large range is less than a preset twelfth decision threshold, compared to the third case, although the probability that the macroblock 100 to be decided belongs to a dynamic region is further increased in terms of the total sum of motion in the minute range and the total sum of motion in the local range, the probability that the macroblock 100 to be decided belongs to a dynamic region is still relatively high in terms of the total sum of motion in the large range. In this case, the macroblock 100 to be decided can still be classified as a P-SKIP macroblock.

[0161] In this embodiment, in cases other than the four situations mentioned above, it can be determined that the macroblock 100 to be decided 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, depending on the application scenario, different values ​​can be set for 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.

[0164] For example, in video surveillance scenarios, when the movement of objects within the monitored area is relatively rapid, the pixel value difference between the pixels in the macroblock to be decided and the corresponding pixels in the corresponding macroblock 200 is usually large, and the first decision threshold to the twelfth decision threshold is correspondingly larger, which helps to improve the accuracy of P-SKIP macroblock recognition. When the movement of objects within the monitored area is relatively gentle, the pixel value difference between the pixels in the macroblock to be decided and the corresponding pixels in the corresponding macroblock 200 is generally small, and the first decision threshold to the twelfth decision threshold is correspondingly larger and smaller, which helps to improve the accuracy of P-SKIP macroblock recognition.

[0165] Accordingly, embodiments of the present invention also provide a P-SKIP macroblock decision module.

[0166] Figure 8 A schematic diagram of a P-SKIP macroblock decision module is also provided in an embodiment of the present invention. See also Figure 8A P-SKIP macroblock decision module includes: a first acquisition submodule 810, adapted to acquire a macroblock to be decided within the current frame image; a second acquisition submodule 820, adapted to acquire the total motion sum of minute-range motions of the macroblock to be decided based on the absolute error between the pixel values ​​of the pixels in the macroblock to be decided and the corresponding pixels 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 within the current frame image to acquire a first expansion block; a division processing submodule 840, which divides the first expansion block into multiple sub-expansion blocks; and a third acquisition submodule 850, adapted to acquire the total motion sum of minute-range motions of the macroblock to be decided based on the absolute error between the pixel values ​​of the pixels in the multiple sub-expansion blocks and the corresponding first image blocks in the previous frame image. The difference between the means is used to obtain the total motion sum of the local range of the macroblock to be decided; the second expansion submodule 860 is adapted to perform a second expansion process on the macroblock to be decided in the current frame image to obtain a second expansion block, the second expansion block being larger than the first expansion block; the fourth acquisition submodule 870 is adapted to obtain the total motion sum of the large range of the macroblock to be decided based on the absolute error between the pixel values ​​of the pixels in the second expansion block and the corresponding pixels of the corresponding second image block in the previous frame image; the decision submodule 880 is adapted to determine whether the macroblock to be decided is a P-SKIP macroblock based on the total motion sum of the small range of motion, the total motion sum of the local range of motion, and the total motion sum of the large range of motion of the macroblock to be decided.

[0167] The P-SKIP macroblock decision module in this embodiment of the 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 a detailed description of the P-SKIP macroblock decision method, please refer to the foregoing section; it will not be repeated here.

[0168] Accordingly, embodiments of the present invention also provide an encoding method.

[0169] Figure 9 A flowchart illustrating an encoding method according to an embodiment of the present invention is shown. See also Figure 9 An encoding method comprising the following steps:

[0170] Step S910: Use the P-SKIP macroblock decision method to determine whether the macroblock to be decided in the current frame image is a P-SKIP macroblock;

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

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

[0173] Accordingly, when the macroblock to be decided in the current frame is determined to be a non-P-SKIP macroblock, the encoder's rate-distortion optimization and mode selection module uses an encoding mode other than the skip mode that corresponds to the macroblock type to which the macroblock to be decided belongs to encode the macroblock. Other encoding modes corresponding to the macroblock type to which the macroblock to be decided belongs include inter-frame mode, intra-frame mode, etc.

[0174] Accordingly, embodiments of the present invention also provide an encoding device.

[0175] Figure 10 A schematic diagram of an encoding device according to an embodiment of the present invention is shown. See also Figure 10 An encoding apparatus includes: a P-SKIP macroblock decision module 1001, adapted to determine whether a macroblock to be decided in the current frame image is a P-SKIP macroblock using the P-SKIP macroblock decision method as described above; and an encoding module 1002, adapted to encode the macroblock to be decided in a skip mode 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 this embodiment of the invention can be used to execute the aforementioned encoding method, or other devices can be used to execute the aforementioned encoding method. For a detailed description of the encoding method, please refer to the foregoing section; it will not be repeated here.

[0177] Accordingly, embodiments of the present invention also provide a chip, on which the aforementioned P-SKIP macroblock decision module or encoding device is integrated. The P-SKIP macroblock decision module or encoding device is described in the foregoing relevant sections and will not be repeated here.

[0178] Accordingly, embodiments of the present invention also provide an electronic device, including at least one memory and at least one processor. 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 are described in the foregoing corresponding sections and will not be repeated here.

[0179] Accordingly, embodiments of the present invention also provide a storage medium storing one or more computer instructions, which 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 foregoing relevant sections and will not be repeated here.

[0180] An optional hardware structure for the electronic device provided in this embodiment of the invention can be as follows: Figure 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 this embodiment of the invention, the number of processor 01, communication interface 02, memory 03 and communication bus 04 is at least one, and processor 01, communication interface 02 and memory 03 communicate with each other through communication bus 04.

[0182] Communication interface 02 can be an interface for a communication module used for network communication, such as the interface of a GSM module.

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

[0184] Memory 03 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device as an example.

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

[0186] It should be noted that the aforementioned terminal device may also include other devices (not shown) that may not be essential to understanding the content disclosed in the embodiments of the present invention; given that these other devices may not be essential for understanding the content disclosed in the embodiments of the present invention, the embodiments of the present invention will not describe them one by one.

[0187] This invention also provides a storage medium storing one or more computer instructions, which are used to implement the P-SKIP macroblock decision method or encoding method described in this invention.

[0188] The embodiments of the present invention described above are combinations of elements and features of the present invention. Unless otherwise stated, the elements or features described are optional. Individual elements or features may be practiced without combination with other elements or features. Furthermore, 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 embodiment may be included in another embodiment and may be replaced by corresponding constructions of another embodiment. It will be apparent to those skilled in the art that claims in the appended claims that are not expressly referenced to each other may be combined to form embodiments of the present invention, or may be included as new claims in amendments made after the filing of this application.

[0189] Embodiments of the present invention can be implemented by various means, including, as examples, hardware, firmware, software, or combinations thereof. In hardware configurations, the method according to exemplary embodiments of the present invention can 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 firmware or software configuration, embodiments of the present invention can be implemented in the form of modules, processes, functions, etc. Software code can be stored in a memory unit and executed by a processor. The memory unit is located inside or outside the processor and can 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 make or use the invention. Various modifications to these embodiments will be readily 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 invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is accorded the widest scope consistent with the principles and novel features disclosed herein.

[0192] While the present invention has been disclosed above, it is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of the invention; therefore, the scope of protection of the present invention should be determined by the scope defined in the claims.

Claims

1. A P-SKIP macroblock decision method, characterized in that, include: Obtain the macroblock to be decided within the current frame image; Based on the absolute error between the pixel values ​​of the pixels in the macroblock to be decided and the corresponding pixels in the corresponding macroblock in the previous frame image, the total motion of the micro-range motion of the macroblock to be decided is obtained. The macroblock to be decided is subjected to a first expansion process within the current frame image to obtain a first expanded block; Divide the first expansion block into multiple sub-expansion blocks; Based on the difference between the pixel average value of the pixels of the multiple sub-extended blocks and the corresponding first image block in the previous frame image, the total local range motion of the macroblock to be decided is obtained; Within the current frame image, the macroblock to be decided is subjected to a second expansion process to obtain a second expanded block, which is larger than the first expanded block. Based on the absolute error between the pixel values ​​of the pixels in the second extended block and the corresponding pixels of the second image block in the previous frame, the total motion of the macroblock to be decided is obtained. Based on the sum of the small-range motions, the sum of the local-range motions, and the sum of the large-range motions of the macroblock to be decided, the determination of whether the macroblock to be decided is a P-SKIP macroblock includes: If the total motion of the small-range motion is greater than a preset first decision threshold, the total motion of the local-range motion is less than a preset second decision threshold, and the total motion 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 decided 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 decided 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 motions is greater than the preset tenth decision threshold, the total motion sum of the local-range motions is less than the preset eleventh decision threshold, and the total motion sum of the large-range motions is less than the preset twelfth decision threshold, then the macroblock to be decided 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.

2. The P-SKIP macroblock decision method as described in claim 1, characterized in that, The step of obtaining the total motion sum of the minute-range motion of the macroblock to be decided based on the sum of absolute errors between the pixel values ​​of the pixels in the macroblock to be decided and the corresponding pixels in the corresponding macroblock in the previous frame image includes: Obtain the sum of absolute errors between pixel values ​​in the macroblock to be decided and corresponding pixel values ​​in the corresponding macroblock; If the sum of the absolute errors of the pixel values ​​between the pixel in the macroblock to be decided and the corresponding pixel in the corresponding macroblock is greater than or equal to a preset first difference threshold, then the motion prediction value of the pixel in the macroblock to be decided is recorded as the first value. If the sum of the absolute errors of the pixel values ​​between the pixel in the macroblock to be decided and the corresponding pixel in the corresponding macroblock is less than the first difference threshold, then the motion prediction value of the pixel in the macroblock to be decided is recorded as the second value, which is different from the first value. The sum of the motion prediction values ​​of the pixels in the macroblock to be decided is obtained as the total motion sum of the small-range motion.

3. The P-SKIP macroblock decision method as described in claim 1, characterized in that, The step of performing a first expansion process on the macroblock to be decided within the current frame image to obtain a first expanded block includes: Centered on the macroblock to be decided, obtain (2N-1)*(2N-1) macroblocks arranged in an array within the current frame image, which serve as the first extended block, where N is a positive integer greater than 1.

4. The P-SKIP macroblock decision method as described in claim 1, characterized in that, The step of dividing the first extended block into multiple sub-extended blocks includes: The first expansion block is divided into four sub-expansion blocks.

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

6. The P-SKIP macroblock decision method as described in claim 1, characterized in that, The step of performing a second expansion process on the macroblock to be decided within the current frame image to obtain a second expanded block includes: Centered on the macroblock to be decided, obtain (2M-1)*(2M-1) macroblocks arranged in an array within the current frame image, which serve as the second extended block, where M is a positive integer greater than N.

7. The P-SKIP macroblock decision method as described in claim 1, characterized in that, The step of obtaining the total motion sum of the large-scale motion of the macroblock to be decided based on the sum of absolute errors of pixels between the second extended block and the corresponding second image block in the previous frame includes: Obtain the sum of absolute errors in pixel values ​​between the pixels of the second extended block and the corresponding pixels of the second image block; If the absolute error between the pixel values ​​of the second extended block and the corresponding pixel values ​​of the second image block is greater than or equal to a preset third difference threshold, then the motion prediction value of the pixel in the second extended block is recorded as the fifth value. If the sum of the absolute errors of the pixel values ​​between the pixels of the second extended block and the corresponding pixels of the second image block is less than the third difference threshold, then the motion prediction value of the pixel in the second extended block is recorded as the sixth value, which 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 as described in 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 decided based on the absolute error 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 the first downsampling block and the second downsampling block; In the step of obtaining the total motion sum of the large-scale motion of the macroblock to be decided based on the sum of absolute errors of the pixel values ​​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 decided is obtained based on the sum of absolute errors of the pixel values ​​between the pixel values ​​of the first downsampling block and the corresponding pixel values ​​of the second downsampling block.

9. A P-SKIP macroblock decision module, characterized in that, include: The first acquisition submodule is adapted to acquire the macroblock to be decided within the current frame image; The second acquisition submodule is adapted to acquire the total motion of the small-range motion of the macroblock to be decided based on the absolute error between the pixel values ​​of the pixels in the macroblock to be decided and the corresponding pixels in the corresponding macroblock in the previous frame image. The first extension submodule is adapted to perform a first extension process on the macroblock to be decided within the current frame image to obtain the first extension block; Divide the first extended block into multiple sub-extended blocks by dividing the processing sub-modules; The third acquisition submodule is adapted to acquire the total local range motion of the macroblock to be decided based on the difference between the pixel average value of the pixels between the multiple sub-extended blocks and the corresponding first image block in the previous frame image; The second extension submodule is adapted to perform a second extension process on the macroblock to be decided within the current frame image to obtain a second extension block, wherein the second extension block is larger than the first extension block. The fourth acquisition submodule is adapted to acquire the total motion sum of the large-scale motion of the macroblock to be decided based on the absolute error between the second extended block and the corresponding second image block in the previous frame image. The decision submodule is adapted to determine whether the macroblock to be decided is a P-SKIP macroblock based on the sum of small-range motions, the sum of local-range motions, and the sum of large-range motions of the macroblock to be decided, including: If the total motion of the small-range motion is greater than a preset first decision threshold, the total motion of the local-range motion is less than a preset second decision threshold, and the total motion 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 decided 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 decided 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 motions is greater than the preset tenth decision threshold, the total motion sum of the local-range motions is less than the preset eleventh decision threshold, and the total motion sum of the large-range motions is less than the preset twelfth decision threshold, then the macroblock to be decided 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. An encoding method, characterized in that, include: The P-SKIP macroblock decision method as described in any one of claims 1-8 is used to determine whether the macroblock to be decided in the current frame image is a P-SKIP macroblock; When the macroblock to be decided in the current frame image is determined to be a P-SKIP macroblock, the macroblock to be decided is encoded using the skip mode.

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

12. A chip, characterized in that, The chip integrates the P-SKIP macroblock decision module as described in claim 9 or the encoding device as described in claim 11.

13. An electronic device, characterized in that, It includes at least one memory and at least one processor, the memory storing 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-8 or the encoding method as described in claim 10.

14. A storage medium, characterized in that, The storage medium stores one or more computer instructions, which are executed by a processor to implement the P-SKIP macroblock decision as described in any one of claims 1-8. The encoding method as described in claim 10.