Video adaptive coding method and device based on dynamic information, equipment and medium
By integrating the motion state information acquisition function in the ISP, the image is divided and the encoding strategy is determined, and the encoding effect and inefficiency caused by the separation of ISP and video encoder in the prior art is solved, and efficient and economical video adaptive encoding is achieved.
Patent Information
- Application Number
- CN202411994331.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-06
AI Technical Summary
In the prior art, the image signal processor (ISP) works independently from the video encoder, and cannot optimize the encoding process according to the specific characteristics of the image content, resulting in low encoding effects and inefficiency in dynamic or complex scenarios.
By integrating the motion state information acquisition function in the ISP, the image is divided into regions, and the encoding strategies of different image areas are determined based on the motion state information, thereby realizing adaptive encoding.
Improves coding effect and efficiency, simplifies the coding process, saves coding costs without adding additional hardware.
Smart Images

Figure CN119946261A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of video image coding, and in particular to a video adaptive coding method and apparatus based on dynamic information, and a computer device and a computer-readable storage medium thereof. Background Art
[0002] In the field of video processing and encoding, ISP (Image Signal Processor) and video encoder are two key components, which together determine the final quality and compression efficiency of video content. ISP is used to pre-process the original image data captured from the camera (including color correction, noise reduction, sharpening, etc.) to generate images suitable for viewing. The video encoder is used to compress the image data processed by the ISP so as to store and transmit the image data. One of the key steps in the video encoding process is quantization, and the quantization result determines the balance between video quality and compression rate. At present, the ISP and the video encoder work independently. Therefore, when encoding, the video encoder can only passively accept the image data output by the ISP, and cannot optimize the encoding process according to the specific characteristics of the image content. Especially in dynamic or complex scenes, this working mode of separating the ISP from the video encoder cannot perform different encoding processing on different images, thereby reducing the encoding effect and encoding efficiency. Therefore, how to improve the encoding effect and video encoding efficiency has become an urgent problem to be solved. Summary of the invention
[0003] The present application provides a video adaptive encoding method and device based on dynamic information, aiming to improve encoding effect and video encoding efficiency.
[0004] In a first aspect, the present application provides a video adaptive encoding method based on dynamic information, the video adaptive encoding method comprising:
[0005] Based on a preset image unit, the current frame image is divided to obtain at least one image region;
[0006] Acquiring regional motion state information corresponding to the image region, and dividing each image region in the current frame image into a first image region and / or a second image region based on the motion state information;
[0007] Determine, in a preset strategy table, a first encoding strategy corresponding to the first image area and / or a second encoding strategy corresponding to the second image area;
[0008] Based on a first encoding strategy corresponding to the first image region and / or a second encoding strategy corresponding to the second image region, adaptive encoding is performed on each image region in the current frame image.
[0009] In a second aspect, the present application further provides a video adaptive encoding device based on dynamic information, comprising:
[0010] An image region division module, used to divide the current frame image based on a preset image unit to obtain at least one image region;
[0011] An image region classification module, used for acquiring regional motion state information corresponding to the image region, and dividing each image region in the current frame image into a first image region and / or a second image region based on the motion state information;
[0012] A regional strategy determination module, used to determine a first encoding strategy corresponding to the first image region and / or a second encoding strategy corresponding to the second image region in a preset strategy table;
[0013] The image adaptive coding module is used to adaptively encode each image area in the current frame image based on a first coding strategy corresponding to the first image area and / or a second coding strategy corresponding to the second image area.
[0014] In a third aspect, the present application also provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the above-mentioned dynamic information-based adaptive video encoding method when executing the computer program.
[0015] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the video adaptive encoding method based on dynamic information as described above.
[0016] The present application discloses a video adaptive encoding method based on dynamic information, wherein the video adaptive encoding method divides the current frame image based on preset image units to obtain at least one image area; obtains regional motion state information corresponding to the image area, and divides each image area in the current frame image into a first image area and / or a second image area based on the motion state information; determines the first encoding strategy corresponding to the first image area and / or the second encoding strategy corresponding to the second image area in a preset strategy table; and adaptively encodes each image area in the current frame image based on the first encoding strategy corresponding to the first image area and / or the second encoding strategy corresponding to the second image area. In the above manner, the present application classifies the image area based on the motion state information of the image, and then adopts different encoding strategies for different image areas. Thus, the motion state information of the image is used to realize the adaptive encoding of each regional image, which not only improves the encoding effect and encoding efficiency, but also does not require the addition of additional hardware, simplifies the encoding process, and saves encoding costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 is a schematic flow chart of a video adaptive encoding method based on dynamic information provided by the first embodiment of the present application;
[0019] Figure 2 is a schematic flow chart of a video adaptive encoding method based on dynamic information provided by the second embodiment of the present application;
[0020] Figure 3 A schematic block diagram of a video adaptive encoding device based on dynamic information provided in an embodiment of the present application;
[0021] Figure 4 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0023] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0024] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0025] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0026] The embodiment of the present application provides a video adaptive encoding method based on dynamic information. The video adaptive encoding method based on dynamic information can be applied to a server. The server can be an independent server or a server cluster.
[0027] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0028] See also Figure 1 , Figure 1 It is a schematic flow chart of a video adaptive encoding method based on dynamic information provided in an embodiment of the present application.
[0029] like Figure 1 As shown, the video adaptive encoding method based on dynamic information specifically includes steps S101 to S104.
[0030] S101, dividing the current frame image based on a preset image unit to obtain at least one image region;
[0031] In order to solve the problem that the working mode of ISP and video encoder is separated and different images cannot be encoded differently, resulting in poor encoding effect and low encoding efficiency. This embodiment adds image preprocessing function in advance, directly integrates motion state information acquisition function in ISP, and significantly optimizes the image processing process without adding additional hardware. It also classifies the image region based on the motion state information of the image, and then adopts different encoding strategies for different image regions. In this way, the motion state information of the image is used to realize adaptive encoding of images in each region, and high-efficiency and high-precision image encoding is realized.
[0032] Specifically, the ISP divides each frame of the image based on a preset image unit in advance. The preset image unit may be a 4x4 rectangular block, such as dividing a 1920x1080 image into 480x270 4x4 rectangular blocks, each rectangular block corresponding to 2bit motion state information, and a 1920x1080 image corresponding to 480x270x2bit motion state information. The ISP saves the motion state information of the 4x4 rectangular block to the memory, so as to provide the motion state information to the video encoder in the subsequent intelligent encoding.
[0033] The motion state information contains the motion state value corresponding to each pixel of each frame image. The motion state value represents the static state, instantaneous state and motion state of the pixel. For example, the motion state value is 0, 1 and 2, representing the static state, instantaneous state and motion state respectively.
[0034] S102, obtaining regional motion state information corresponding to the image region, and dividing each image region in the current frame image into a first image region and / or a second image region based on the motion state information;
[0035] In this embodiment, the ISP obtains the original image data from the camera and performs image preprocessing, that is, the motion state parameters corresponding to each pixel in the image area can be estimated in advance according to the relevant algorithm and the two frames of images corresponding to the same image area, and the motion state parameters corresponding to all pixels in all images can be obtained in sequence. Then, based on the macroblock of size 4x4, the motion state information corresponding to each macroblock in the memory is obtained. Each frame of the image processed by the ISP is used as the input image information of the video encoder. During the encoding process, the video encoder classifies the image area based on the motion state information provided by the ISP and the motion state information of the macroblock, and divides each image area into the first image area and / or the second image area.
[0036] Further, the dividing each image area in the current frame image into a first image area and / or a second image area based on the motion state information specifically includes:
[0037] Dividing the image area according to a preset division rule to divide the image area into a preset number of image blocks;
[0038] In the regional motion state information, image block motion state information corresponding to each image block is obtained;
[0039] Determining the category of each image block in the image area based on the motion state information of each image block, wherein the category of the image block includes a static block, a transient block, and a motion block;
[0040] Among the preset number of image blocks, counting the number of first image blocks corresponding to the static blocks, the number of second image blocks corresponding to the instantaneous blocks, and the number of third image blocks corresponding to the motion blocks;
[0041] Based on the first number of image blocks, the second number of image blocks, and the third number of image blocks, a region type corresponding to the image region is determined, and the region type is the first image region or the second image region.
[0042] Exemplarily, the determining the region type corresponding to the image region based on the number of the first image blocks, the number of the second image blocks, and the number of the third image blocks specifically includes:
[0043] Acquire a first ratio of the number of the first image blocks to the preset number, and when the first ratio is not less than a preset ratio threshold, determine that the region type corresponding to the image region is the first image region;
[0044] When the first ratio is smaller than the preset ratio threshold, it is determined that the region type corresponding to the image region is the second image region.
[0045] In this embodiment, the preset division rule can be to divide the image based on the actually required image block size, such as performing intelligent encoding with N×N macroblocks, where N=16 or 32 or 64, then there are M×M motion information in the N×N macroblock, where M=N / 4.
[0046] Exemplarily, the determining of the category of each image block in the image area based on the motion state information of each image block, wherein the category of the image block includes a static block, an instantaneous block, and a motion block, specifically includes:
[0047] Determine the image block in the image region whose motion state information is 0 as the static block;
[0048] Determine an image block in the image region whose motion state information is 1 as the instantaneous block;
[0049] An image block with motion state information of 2 in the image area is determined as the motion block.
[0050] Specifically, the ISP provides the video encoder with the motion state information of the above image blocks, that is, the image blocks with motion state information of 0 are static blocks, the image blocks with motion state information of 1 are instantaneous blocks, and the image blocks with motion state information of 2 are motion blocks. The video encoder can perform adaptive intelligent encoding on 16x16, 32x32, and 64x64 macroblocks according to the above image block motion state information.
[0051] Specifically, among the preset number of image blocks, the number of first image blocks corresponding to the static blocks, the number of second image blocks corresponding to the instantaneous blocks, and the number of third image blocks corresponding to the motion blocks are counted;
[0052] For example, among M×M motion state information, the number of first image blocks corresponding to 0 (static block) is x, the number of second image blocks corresponding to 1 (instantaneous) is y, and the number of third image blocks corresponding to 2 (motion) is z, then x+y+z=M×M.
[0053] Based on the proportion of the number of static blocks in the entire image area or based on the number of static blocks, the area type corresponding to the image area is determined. For example, if the number of static blocks exceeds a preset number threshold, the image area is the first image area, otherwise it is the second image area; if the proportion of the number of static blocks in the entire image area exceeds a preset ratio threshold, the image area is the first image area, otherwise it is the second image area.
[0054] It can be understood that the proportion of the number of static blocks in the entire image area and the sum of the proportions of the instantaneous blocks and the motion blocks in the entire image area is 1. Therefore, if the proportion of the instantaneous blocks and the motion blocks in the entire image area is less than a preset value, the image area is the first image area, otherwise it is the second image area.
[0055] S103. Determine, in a preset strategy table, a first encoding strategy corresponding to the first image area and / or a second encoding strategy corresponding to the second image area;
[0056] In this embodiment, the first image area is a background area, and the second image area includes a trailing area and a motion area. 0 represents a static state, indicating that the image of the block is a static block, and the static block is used to represent the background area of the image; 1 represents an instantaneous state, indicating that the image of the block is an instantaneous block, and the instantaneous block is used to represent the trailing area of the image; 2 represents a motion state, indicating that the image of the block is a motion block, and the motion block is used to represent the motion area of the image. The preset strategy table includes a Skip encoding strategy corresponding to the background area, and an adaptive encoding strategy corresponding to the instantaneous block area and the motion block area, that is, based on the target quantization parameter QP (Quantization Parameters, quantization parameters), the motion area and the trailing area in the image are encoded.
[0057] S104: Based on a first encoding strategy corresponding to the first image region and / or a second encoding strategy corresponding to the second image region, adaptively encode each image region in the current frame image.
[0058] In this embodiment, the first image area is an image area with relatively rich static blocks. The video encoder adopts the Skip encoding strategy for encoding. An image with relatively rich static blocks is generally a background area of an image, and the pixel change of this part of the image is small. The Skip encoding strategy is adopted in this area, which can not only ensure good image quality, but also save bit rate, so as to provide better encoding services for the key areas of the image.
[0059] The second image area is an image area with relatively rich motion blocks and instantaneous blocks. The video encoder further dynamically adjusts the QP (Quantization Parameters) corresponding to the image area according to the ratio of motion blocks to instantaneous blocks in the image area, and encodes the image area according to the adjusted QP. The image with relatively rich motion blocks is generally the motion area of the image. This part of the image is the key area of the whole frame image, and sufficient encoding quality needs to be guaranteed. Therefore, this part of the image needs to be dynamically encoded according to the target QP to improve the encoding quality of the image. The image area with relatively rich instantaneous blocks is generally the trailing area of the image. The trailing area is more likely to be noticed by the human eye, so it needs to have a higher encoding quality than the background area and the motion area. The adjustment strength of the quantization parameters of the trailing area is greater than that of the motion area, thereby effectively reducing the mosaic situation of the image trailing area and improving the image quality. Therefore, after receiving the image processed by the ISP, the video encoder reads the motion state information of the image during the encoding process, and dynamically adjusts the quantization parameters corresponding to the motion area and the trailing area in the image according to the motion state information, and performs bit rate control, thereby avoiding bit rate waste or video quality degradation.
[0060] The present embodiment discloses a video adaptive encoding method based on dynamic information, wherein the video adaptive encoding method divides the current frame image based on preset image units to obtain at least one image area; obtains regional motion state information corresponding to the image area, and divides each image area in the current frame image into a first image area and / or a second image area based on the motion state information; determines the first encoding strategy corresponding to the first image area and / or the second encoding strategy corresponding to the second image area in a preset strategy table; and adaptively encodes each image area in the current frame image based on the first encoding strategy corresponding to the first image area and / or the second encoding strategy corresponding to the second image area. In the above manner, the present application classifies the image area based on the motion state information of the image, and then adopts different encoding strategies for different image areas. Thus, the motion state information of the image is used to realize the adaptive encoding of each regional image, which not only improves the encoding effect and encoding efficiency, but also does not require the addition of additional hardware, simplifies the encoding process, and saves encoding costs.
[0061] See also Figure 2 , Figure 2 It is a schematic flow chart of a video adaptive encoding method based on dynamic information provided in an embodiment of the present application.
[0062] like Figure 2 As shown, step S103 specifically includes:
[0063] Step S1031, when the graphic area is the second image area, obtaining a target area ratio corresponding to a moving image area and a trailing image area in the second image area, wherein the moving image area is an image area corresponding to a moving block, and the trailing image area is an image area corresponding to an instantaneous block;
[0064] Step S1032, based on the target area ratio, adaptively adjusting the quantization parameter corresponding to the second image area to obtain a target quantization parameter corresponding to the second image area;
[0065] Step S1033: Generate the second encoding strategy based on the target quantization parameter.
[0066] Exemplarily, the first image area includes a background area, and the step S103 further includes:
[0067] Determine the area corresponding to the static block in the image area as the background area;
[0068] A Skip encoding strategy is obtained in the preset strategy table as the first encoding strategy, so as to encode the background area in the current frame image based on the Skip encoding strategy.
[0069] Exemplarily, the second image area includes a trailing area and a motion area, and the step S103 further includes:
[0070] Determine the area corresponding to the instantaneous block in the image area as the trailing area;
[0071] Determine an area corresponding to the motion block in the image area as the motion area;
[0072] Obtain the preset adjustment rules in the preset strategy table, and generate a target quantization parameter based on the area ratio corresponding to the trailing area and the motion area and the preset adjustment rules as the second encoding strategy, so as to adaptively adjust the trailing area and the motion area in the current frame image based on the target quantization parameter.
[0073] In this embodiment, it is assumed that the intelligent encoding is performed with a macroblock of size N×N, where N=16 or 32 or 64, then there are M×M motion information in the N×N macroblock, where M=N / 4. Assuming that among the M×M motion information, the number of 0s (static blocks) is x, the number of 1s (transient blocks) is y, and the number of 2s (motion blocks) is z, then x+y+z=M×M.
[0074] (1) For image areas with rich static information, generally the background area of the image, the video encoder adopts the Skip coding mode. The Skip coding strategy is used to encode the background area with small pixel value changes, which can not only ensure good image quality but also save bit rate, thereby providing more coding resources for image coding of key areas of the image. For example, when the number of x in M×M reaches the preset threshold A (background area threshold), that is, x≧A, the corresponding N×N macroblock will be forced to use the Skip coding strategy for image coding.
[0075] (2) For image areas with rich instantaneous information and motion information, generally the motion area and trailing area of the image, both of which are key areas of the image, the video encoder further dynamically adjusts the QP (Quantization Parameters) of the corresponding image area according to the ratio of the motion area to the instantaneous area, and performs adaptive encoding based on the adjusted QP.
[0076] Improving the quality of the moving area can improve the subjective quality of the image. As for the trailing area, these areas are more easily noticed by the human eye than the moving area, so the trailing area requires higher encoding quality than the moving area, that is, the adjustment of the quantization parameters of the trailing area is greater than that of the moving area, thereby effectively reducing the mosaic situation in the trailing area of the image. Assuming that the number of x in M×M does not reach the preset threshold A, the QP adaptive adjustment is performed by the following formula:
[0077]
[0078] Among them, B and C are adjustable QP parameters. B and C are negative numbers, which are used to reduce QP. B is used to represent the impact of instantaneous blocks on quantization parameters, and C is used to represent the impact of motion blocks on quantization parameters. Since the quality of the trailing area is more important than that of the motion area, B <C<0。
[0079] Specifically, when there are more instantaneous blocks, y is larger (i.e., y is greater than z), the proportion of QP calculation result B is larger, and the QP calculation result is closer to B; when there are more motion blocks, z is larger (i.e., y is not greater than z), the proportion of C in the QP calculation formula is larger, and the QP calculation result is closer to C. B is smaller than C and is a negative number, for example, B takes the value of -4 and C takes the value of -2, then when there are more instantaneous blocks, the QP calculation result is closer to B and takes the value of -4; when there are more motion blocks, the QP calculation result is closer to C and takes the value of -2. The smaller the QP, the higher the image encoding quality, so that the whole frame image with more instantaneous blocks can be encoded with higher quality.
[0080] In this embodiment, compared with the traditional video encoder, the ISP in this embodiment obtains the motion state information of each image area in the image during the encoding process, so that the video encoder can perform video encoding based on the motion state information of the image processed by the ISP, thereby using the specific information of the image (i.e., the motion state information) to achieve adaptive encoding of the image. Based on the motion state information of the image, the encoding strategy and quantization parameters of the background area, motion area, and trailing area of the image are adjusted, which can further improve the image quality of the motion area and the trailing area while ensuring that the background image part has sufficient encoding effect. Thereby improving the overall image quality of the image and bringing a higher quality visual experience to the user.
[0081] See also Figure 3 , Figure 3 The embodiment of the present application provides a schematic block diagram of a video adaptive encoding device based on dynamic information, and the video adaptive encoding device based on dynamic information is used to execute the aforementioned video adaptive encoding method based on dynamic information. The video adaptive encoding device based on dynamic information can be configured on a server.
[0082] like Figure 3 As shown, the video adaptive encoding device 300 based on dynamic information includes:
[0083] An image region division module 301 is used to divide the current frame image based on a preset image unit to obtain at least one image region;
[0084] An image region classification module 302 is used to obtain regional motion state information corresponding to the image region, and divide each image region in the current frame image into a first image region and / or a second image region based on the motion state information;
[0085] A regional strategy determination module 303, configured to determine, in a preset strategy table, a first encoding strategy corresponding to the first image region and / or a second encoding strategy corresponding to the second image region;
[0086] The image adaptive coding module 304 is used to adaptively encode each image region in the current frame image based on the first coding strategy corresponding to the first image region and / or the second coding strategy corresponding to the second image region.
[0087] Furthermore, the image region classification module 302 specifically includes:
[0088] An image block division unit, configured to divide the image region into a preset number of image blocks according to a preset division rule;
[0089] A motion information acquisition unit, configured to acquire image block motion state information corresponding to each image block from the regional motion state information;
[0090] An image block classification unit, configured to determine a category of each image block in the image region based on motion state information of each image block, wherein the categories of the image blocks include static blocks, instantaneous blocks, and motion blocks;
[0091] an image block number counting unit, configured to count the number of first image blocks corresponding to the static blocks, the number of second image blocks corresponding to the instantaneous blocks, and the number of third image blocks corresponding to the motion blocks among the preset number of image blocks;
[0092] A region type classification unit is used to determine a region type corresponding to the image region based on the first image block number, the second image block number, and the third image block number, the region type being the first image region or the second image region.
[0093] Furthermore, the regional strategy determination module 303 specifically includes:
[0094] an area ratio calculation unit, configured to obtain a target area ratio corresponding to a moving image area and a trailing image area in the second image area when the graphic area is the second image area, the moving image area being an image area corresponding to a moving block, and the trailing image area being an image area corresponding to an instantaneous block;
[0095] a quantization parameter adjustment unit, configured to adaptively adjust the quantization parameter corresponding to the second image area based on the target area ratio, so as to obtain a target quantization parameter corresponding to the second image area;
[0096] A quantization strategy generating unit is used to generate the second encoding strategy based on the target quantization parameter.
[0097] Furthermore, the image block classification unit specifically includes:
[0098] A static block determination subunit, configured to determine an image block in the image region whose motion state information is 0 as the static block;
[0099] An instantaneous block determination subunit, configured to determine an image block in the image region whose motion state information is 1 as the instantaneous block;
[0100] The motion block determination subunit is used to determine the image block with motion state information of 2 in the image area as the motion block.
[0101] Further, the first image area includes a background area, and the area strategy determination module 303 specifically includes:
[0102] A background area determination unit, configured to determine an area corresponding to the static block in the image area as the background area;
[0103] A static strategy determination unit is used to obtain a Skip encoding strategy from the preset strategy table as the first encoding strategy, so as to encode the background area in the current frame image based on the Skip encoding strategy.
[0104] Further, the second image area includes a trailing area and a motion area, and the area strategy determination module 303 specifically includes:
[0105] A trailing region determining unit, configured to determine a region corresponding to the instantaneous block in the image region as the trailing region;
[0106] a motion region determining unit, configured to determine a region corresponding to the motion block in the image region as the motion region;
[0107] A quantization parameter generation unit is used to obtain a preset adjustment rule in the preset strategy table, and generate a target quantization parameter as the second encoding strategy based on the area ratio corresponding to the trailing area and the motion area and the preset adjustment rule, so as to adaptively adjust the trailing area and the motion area in the current frame image based on the target quantization parameter.
[0108] Furthermore, the area type classification unit specifically includes:
[0109] A first region determination subunit is configured to obtain a first ratio of the number of the first image blocks to the preset number, and when the first ratio is not less than a preset ratio threshold, determine that the region type corresponding to the image region is the first image region;
[0110] The second region determining subunit is configured to determine that the region type corresponding to the image region is the second image region when the first ratio is less than the preset ratio threshold.
[0111] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0112] The above-mentioned device can be implemented in the form of a computer program. Figure 4 Runs on the computer device shown.
[0113] See also Figure 4 , Figure 4 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0114] See also Figure 4 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0115] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any video adaptive encoding method based on dynamic information.
[0116] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0117] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any video adaptive encoding method based on dynamic information.
[0118] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0119] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0120] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0121] Based on a preset image unit, the current frame image is divided to obtain at least one image region;
[0122] Acquiring regional motion state information corresponding to the image region, and dividing each image region in the current frame image into a first image region and / or a second image region based on the motion state information;
[0123] Determine, in a preset strategy table, a first encoding strategy corresponding to the first image area and / or a second encoding strategy corresponding to the second image area;
[0124] Based on a first encoding strategy corresponding to the first image region and / or a second encoding strategy corresponding to the second image region, adaptive encoding is performed on each image region in the current frame image.
[0125] In one embodiment, when the processor implements dividing each image area in the current frame image into the first image area and / or the second image area based on the motion state information, it is used to implement:
[0126] Dividing the image area according to a preset division rule to divide the image area into a preset number of image blocks;
[0127] In the regional motion state information, image block motion state information corresponding to each image block is obtained;
[0128] Determining the category of each image block in the image area based on the motion state information of each image block, wherein the category of the image block includes a static block, a transient block, and a motion block;
[0129] Among the preset number of image blocks, counting the number of first image blocks corresponding to the static blocks, the number of second image blocks corresponding to the instantaneous blocks, and the number of third image blocks corresponding to the motion blocks;
[0130] Based on the first number of image blocks, the second number of image blocks, and the third number of image blocks, a region type corresponding to the image region is determined, and the region type is the first image region or the second image region.
[0131] In one embodiment, when the processor implements the determination of the first encoding strategy corresponding to the first image area and / or the second encoding strategy corresponding to the second image area in the preset strategy table, it is configured to implement:
[0132] When the graphic area is the second image area, obtaining a target area ratio corresponding to a motion image area and a trailing image area in the second image area, wherein the motion image area is an image area corresponding to a motion block, and the trailing image area is an image area corresponding to an instantaneous block;
[0133] Based on the target area ratio, adaptively adjusting the quantization parameter corresponding to the second image area to obtain a target quantization parameter corresponding to the second image area;
[0134] Based on the target quantization parameter, the second encoding strategy is generated.
[0135] In one embodiment, when the processor implements the step of determining the category of each image block in the image area based on the motion state information of each image block, where the category of the image block includes a static block, an instantaneous block, and a motion block, the processor is configured to implement:
[0136] Determine the image block in the image region whose motion state information is 0 as the static block;
[0137] Determine an image block in the image region whose motion state information is 1 as the instantaneous block;
[0138] An image block with motion state information of 2 in the image area is determined as the motion block.
[0139] In one embodiment, when the processor implements that the first image area includes a background area, and determines in a preset strategy table the first encoding strategy corresponding to the first image area and / or the second encoding strategy corresponding to the second image area, it is configured to implement:
[0140] Determine the area corresponding to the static block in the image area as the background area;
[0141] A Skip encoding strategy is obtained in the preset strategy table as the first encoding strategy, so as to encode the background area in the current frame image based on the Skip encoding strategy.
[0142] In one embodiment, when the processor implements that the second image area includes a trailing area and a motion area, and determines in the preset strategy table the first encoding strategy corresponding to the first image area and / or the second encoding strategy corresponding to the second image area, it is used to implement:
[0143] Determine the area corresponding to the instantaneous block in the image area as the trailing area;
[0144] Determine an area corresponding to the motion block in the image area as the motion area;
[0145] Obtain the preset adjustment rules in the preset strategy table, and generate a target quantization parameter based on the area ratio corresponding to the trailing area and the motion area and the preset adjustment rules as the second encoding strategy, so as to adaptively adjust the trailing area and the motion area in the current frame image based on the target quantization parameter.
[0146] In one embodiment, when the processor implements the determining of the region type corresponding to the image region based on the first number of image blocks, the second number of image blocks, and the third number of image blocks, the processor is configured to implement:
[0147] Acquire a first ratio of the number of the first image blocks to the preset number, and when the first ratio is not less than a preset ratio threshold, determine that the region type corresponding to the image region is the first image region;
[0148] When the first ratio is smaller than the preset ratio threshold, it is determined that the region type corresponding to the image region is the second image region.
[0149] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any one of the video adaptive encoding methods based on dynamic information provided in the embodiments of the present application.
[0150] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Medi a Card, SMC), a secure digital (Secure Digital, SD) card, a flash memory card (Flash Card), etc., equipped on the computer device.
[0151] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A video adaptive encoding method based on dynamic information, characterized in that: The video adaptive encoding method comprises: Based on a preset image unit, the current frame image is divided to obtain at least one image region; Acquiring regional motion state information corresponding to the image region, and dividing each image region in the current frame image into a first image region and / or a second image region based on the motion state information; Determine, in a preset strategy table, a first encoding strategy corresponding to the first image area and / or a second encoding strategy corresponding to the second image area; Based on a first encoding strategy corresponding to the first image region and / or a second encoding strategy corresponding to the second image region, adaptive encoding is performed on each image region in the current frame image.
2. The video adaptive encoding method based on dynamic information according to claim 1, characterized in that: The dividing each image area in the current frame image into a first image area and / or a second image area based on the motion state information specifically includes: Dividing the image area according to a preset division rule to divide the image area into a preset number of image blocks; In the regional motion state information, image block motion state information corresponding to each image block is obtained; Determining the category of each image block in the image area based on the motion state information of each image block, wherein the category of the image block includes a static block, a transient block, and a motion block; Among the preset number of image blocks, counting the number of first image blocks corresponding to the static blocks, the number of second image blocks corresponding to the instantaneous blocks, and the number of third image blocks corresponding to the motion blocks; Based on the first number of image blocks, the second number of image blocks, and the third number of image blocks, a region type corresponding to the image region is determined, and the region type is the first image region or the second image region.
3. The video adaptive encoding method based on dynamic information according to claim 2, characterized in that: Determining in the preset strategy table the first coding strategy corresponding to the first image area and / or the second coding strategy corresponding to the second image area specifically includes: When the graphic area is the second image area, obtaining a target area ratio corresponding to a motion image area and a trailing image area in the second image area, wherein the motion image area is an image area corresponding to a motion block, and the trailing image area is an image area corresponding to an instantaneous block; Based on the target area ratio, adaptively adjusting the quantization parameter corresponding to the second image area to obtain a target quantization parameter corresponding to the second image area; Based on the target quantization parameter, the second encoding strategy is generated.
4. The video adaptive encoding method based on dynamic information according to claim 2, characterized in that: The determining of the category of each image block in the image region based on the motion state information of each image block, wherein the category of the image block includes a static block, an instantaneous block and a motion block, specifically includes: Determine the image block in the image region whose motion state information is 0 as the static block; Determine an image block in the image region whose motion state information is 1 as the instantaneous block; An image block with motion state information of 2 in the image area is determined as the motion block.
5. The video adaptive encoding method based on dynamic information according to claim 4, characterized in that: The first image area includes a background area, and determining in the preset strategy table the first encoding strategy corresponding to the first image area and / or the second encoding strategy corresponding to the second image area specifically includes: Determine the area corresponding to the static block in the image area as the background area; A Skip encoding strategy is obtained from the preset strategy table as the first encoding strategy, so as to encode the background area in the current frame image based on the Skip encoding strategy.
6. The video adaptive encoding method based on dynamic information according to claim 4, characterized in that: The second image area includes a trailing area and a motion area, and determining in the preset strategy table the first encoding strategy corresponding to the first image area and / or the second encoding strategy corresponding to the second image area specifically includes: Determine the area corresponding to the instantaneous block in the image area as the trailing area; Determine an area corresponding to the motion block in the image area as the motion area; Obtain the preset adjustment rules in the preset strategy table, and generate a target quantization parameter based on the area ratio corresponding to the trailing area and the motion area and the preset adjustment rules as the second encoding strategy, so as to adaptively adjust the trailing area and the motion area in the current frame image based on the target quantization parameter.
7. The video adaptive encoding method based on dynamic information according to any one of claims 2 to 6, characterized in that: The determining, based on the number of the first image blocks, the number of the second image blocks, and the number of the third image blocks, the region type corresponding to the image region specifically includes: Acquire a first ratio of the number of the first image blocks to the preset number, and when the first ratio is not less than a preset ratio threshold, determine that the region type corresponding to the image region is the first image region; When the first ratio is smaller than the preset ratio threshold, it is determined that the region type corresponding to the image region is the second image region.
8. A video adaptive encoding device based on dynamic information, characterized in that: include: An image region division module, used to divide the current frame image based on a preset image unit to obtain at least one image region; An image region classification module, used for obtaining regional motion state information corresponding to the image region, and dividing each image region in the current frame image into a first image region and / or a second image region based on the motion state information; A regional strategy determination module, used to determine a first encoding strategy corresponding to the first image region and / or a second encoding strategy corresponding to the second image region in a preset strategy table; The image adaptive coding module is used to adaptively encode each image area in the current frame image based on a first coding strategy corresponding to the first image area and / or a second coding strategy corresponding to the second image area.
9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the video adaptive encoding method based on dynamic information as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the video adaptive encoding method based on dynamic information according to any one of claims 1 to 7.
Citation Information
Patent Citations
Video coding method and device
CN111200734A
Video coding method, electronic equipment and computer readable storage medium
CN116074524A
Image coding method and device, storage medium and electronic device
CN118317092A
Video image noise reduction method and device
CN118984362A
Image processing device and method
US20130022125A1