Video coding method and device, electronic equipment, chip and medium

By dividing the area and calculating the change rate of the video picture, determining the encoding area and strategy, differentiated encoding of different regions is achieved, and the problems of inflexible encoding and low efficiency in the existing technology are solved, and the efficiency of video encoding is improved. Adaptability.

CN119299700APending Publication Date: 2025-01-10CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411447459.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

Existing video encoding technology usually adopts a fixed encoding mode to uniformly encode the entire picture, resulting in inflexible encoding and low efficiency. Especially in scenarios such as application windowing and text office, the picture change area is small, or slide show playback. When the frequency of picture changes is not high in scenes, the encoding efficiency is low.

Method used

By dividing the area of ​​the multi-frame picture in the original video, multiple initial areas in each frame picture are determined, the change rate is calculated based on the pixel points of these areas, the encoding area and its corresponding encoding strategy are determined, and different encoding strategies are used to pair it. Encode different areas to avoid encoding the entire picture.

Benefits of technology

It improves encoding efficiency, reduces encoding calculation requirements and network bandwidth requirements, reduces transmission volume, adapts to the frequency of picture changes in different scenarios, and improves encoding flexibility and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299700A_ABST
    Figure CN119299700A_ABST
Patent Text Reader

Abstract

The invention provides a video coding method and device, electronic equipment, a chip and a medium, and relates to the field of video coding, and the method comprises the steps: determining a plurality of initial regions in each frame of picture for a plurality of frames of pictures in an original video; determining the change rate of each initial region based on the pixel points in the plurality of initial regions; determining at least one coding region and a coding strategy corresponding to each coding region based on the change rate; and performing video coding on each coding region by using the coding region corresponding to each coding region to obtain target data. According to the coding method provided by the invention, the change frequencies of different regions are identified, the regions needing to be coded are determined, and different coding modes are adopted according to the change frequencies of the coding regions, so that efficient and flexible dynamic regional coding is realized, the coding efficiency is improved, the calculation amount and the transmission amount are reduced, and the network bandwidth requirement is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of video encoding technology, and in particular to a video encoding method, device, electronic device, chip and medium. Background Art

[0002] In the field of cloud computers, desktop transmission protocols require real-time capture, encoding, and transmission of the entire desktop image. However, in actual applications, it is often not necessary to encode the entire image. For example, in windowed applications and text office light scenarios, the image change area is small; or in scenarios such as slideshow playback and idle operations, the image changes less frequently and there is no need to encode the entire image. However, current video encoding technologies usually use a fixed encoding mode to uniformly encode the entire image. The encoding method is not flexible, and the encoding and decoding algorithm is introduced, resulting in low encoding efficiency. Summary of the invention

[0003] The present disclosure provides a video encoding method and a video decoding method, device, electronic device, chip and medium to solve the problem in the related art that the encoding process needs to encode the entire picture and the encoding process is inflexible and inefficient.

[0004] The first aspect of the present disclosure proposes a video encoding method, which includes: determining multiple initial areas in each frame of a plurality of frames in an original video; determining a change rate of each initial area based on pixel points in the multiple initial areas; determining at least one encoding area and an encoding strategy corresponding to each encoding area based on the change rate; and performing video encoding on each encoding area using the encoding strategy corresponding to each encoding area to obtain target data.

[0005] In some embodiments of the present disclosure, for multiple frames in an original video, determining multiple initial regions in each frame includes: initially dividing the first frame in the original video according to initial parameters to obtain multiple first regions; re-dividing the multiple first regions based on content features of the multiple first regions to determine multiple initial regions in the first frame, the content features including boundary features and texture features; adding identification information to the multiple initial regions, the identification information including position information and boundary information.

[0006] In some embodiments of the present disclosure, based on the pixel points in multiple initial areas, determining the change rate of each initial area includes: traversing multiple frames in the original video, and for multiple initial areas, preprocessing the pixel points in each initial area to obtain the grayscale value of each pixel point; based on the grayscale value of each pixel point, determining the change rate of each initial area.

[0007] In some embodiments of the present disclosure, determining the change rate of each initial area based on the grayscale value of each pixel includes: determining the grayscale value difference of a first pixel in a first initial area among multiple initial areas of adjacent frame pictures; determining an average change value of the first initial area based on the grayscale value difference and the number of pixels in the first initial area; continuously obtaining the average change values ​​of a preset number of groups of adjacent frame pictures in the first initial area to obtain a set of average change values ​​in the first initial area; and determining the change rate of the first initial area based on the set of average change values.

[0008] In some embodiments of the present disclosure, determining at least one coding region and a coding strategy corresponding to each coding region based on the change rate includes: determining at least one coding region based on the change rate of each initial region; determining the change rate level of each coding region based on a correspondence table between the change rate and the change rate level; and determining the coding strategy of each coding region based on the change rate level of each coding region according to preset rules.

[0009] In some embodiments of the present disclosure, according to the correspondence table between the change rate and the change rate level, determining the change rate level of each coding area includes any of the following items: when the change rate is greater than a first threshold, the change rate level is determined to be a high level; when the change rate is greater than a second threshold and less than or equal to the first threshold, the change rate level is determined to be a medium level; when the change rate is less than or equal to the second threshold, the change rate level is determined to be a low level, and the first threshold is greater than the second threshold.

[0010] In some embodiments of the present disclosure, the method further includes: determining a coding parameter of a first coding region according to a coding strategy of the first coding region among at least one coding region; determining a parameter value of the coding parameter based on the coding parameter of the first coding region, a change rate level of the first coding region, and coding requirements.

[0011] In some embodiments of the present disclosure, video encoding is performed on each coding area using a coding strategy corresponding to each coding area, including: for a second picture frame in a multi-frame picture, encoding the second coding area according to a coding strategy of the second coding area in at least one coding area to obtain regional data corresponding to the second coding area; determining a ranking value of the regional data corresponding to the second coding area in the second picture frame according to a first rule; adding the ranking value, the change rate level corresponding to the second coding area, and the coding strategy corresponding to the second coding area to the identification information of the second coding area; and encapsulating the regional data of the second coding area with the corresponding identification information.

[0012] The second aspect embodiment of the present disclosure proposes a video decoding method, including: obtaining target data, the target data is obtained using the video encoding method as described in the first aspect of the present disclosure, the target data includes regional data of at least one encoding area and corresponding identification information, regional data of at least one non-coding area and corresponding identification information, the identification information includes at least one of position information, sorting value, boundary information, change rate level, and encoding strategy; according to the identification information, decoding the target data to obtain the original video.

[0013] In some embodiments of the present disclosure, the target data is decoded according to the identification information to obtain the original video, including: determining the decoding strategy corresponding to each area data according to the encoding strategy of each area data; using the decoding strategy, decoding the area data corresponding to the decoding strategy to obtain pixel data corresponding to each area data; combining the pixel data corresponding to each area data according to the position information and the sorting value to obtain the original video.

[0014] The third aspect embodiment of the present disclosure proposes a video encoding device, which includes: a division module, used to determine multiple initial areas in each frame of multiple frames in an original video; a first determination module, used to determine the change rate of each initial area based on the pixels in the multiple initial areas; a second determination module, used to determine at least one encoding area and the encoding strategy corresponding to each encoding area based on the change rate; an encoding module, used to use the encoding strategy corresponding to each encoding area to perform video encoding on each encoding area to obtain target data.

[0015] The fourth aspect embodiment of the present disclosure proposes a video decoding device, including: an acquisition module, used to acquire target data, the target data is obtained using the video encoding device as described in the third aspect of the present disclosure, the target data includes regional data of at least one encoding area and corresponding identification information, regional data of at least one non-coding area and corresponding identification information, the identification information includes at least one of position information, sorting value, boundary information, change rate level, and encoding strategy; a decoding module, used to decode the target data according to the identification information to obtain the original video.

[0016] The fifth aspect embodiment of the present disclosure proposes an electronic device, comprising: one or more processors and a storage device communicatively connected to the one or more processors, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the method described in the first aspect or second aspect embodiment of the present disclosure.

[0017] The sixth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in the first aspect or second aspect embodiment of the present disclosure.

[0018] The seventh aspect embodiment of the present disclosure proposes a chip, which includes one or more interface circuits and one or more processors; the interface circuit is used to receive signals from a memory of an electronic device and send signals to the processor, the signals include computer instructions stored in the memory, and when the processor executes the computer instructions, the electronic device executes the method described in the first aspect or second aspect embodiment of the present disclosure.

[0019] In summary, according to the video encoding method proposed in the present disclosure, for multiple frames in the original video, multiple initial areas in each frame are determined; based on the pixels in the multiple initial areas, the change rate of each initial area is determined; based on the change rate, at least one encoding area and the encoding strategy corresponding to each encoding area are determined; using the encoding strategy corresponding to each encoding area, each encoding area is video encoded to obtain target data. The video encoding method proposed in the present disclosure can identify the change frequency of different areas in each sampling frame of the original video, and determine the encoding area and the encoding strategy of the encoding area according to the change frequency of different areas, so as to implement different encoding strategies for different areas, avoid encoding the entire picture, thereby reducing the encoding calculation requirements, improving the encoding efficiency, reducing the network bandwidth requirements, and reducing the transmission volume.

[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0022] Figure 1 A flowchart of a video encoding method proposed in an embodiment of the present disclosure;

[0023] Figure 2 A flowchart for determining multiple initial regions proposed in an embodiment of the present disclosure;

[0024] Figure 3 A flow chart for determining the rate of change of the initial area proposed in an embodiment of the present disclosure;

[0025] Figure 4 A flow chart for determining a rate of change proposed for an embodiment of the present disclosure;

[0026] Figure 5 A flowchart of determining a coding area and a coding strategy proposed in an embodiment of the present disclosure;

[0027] Figure 6 A flowchart of a video encoding method proposed in an embodiment of the present disclosure;

[0028] Figure 7 A flowchart of performing video encoding on a coding area proposed in an embodiment of the present disclosure;

[0029] Figure 8 A flowchart of a video decoding method proposed in an embodiment of the present disclosure;

[0030] Fig. 9 A flowchart of decoding target data proposed in an embodiment of the present disclosure;

[0031] Fig.10 A flowchart of a video encoding and decoding method provided by the present disclosure;

[0032] Fig.11 A schematic diagram of the structure of a video encoding device proposed in an embodiment of the present disclosure;

[0033] Fig.12 A schematic diagram of the structure of a video decoding device proposed in an embodiment of the present disclosure;

[0034] Fig.13 A schematic diagram of the structure of an electronic device proposed in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0035] Embodiments of the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. Embodiments are described below with reference to the accompanying drawings.

[0036] In order to solve the problems existing in the related art, the present disclosure proposes a video encoding method, including: determining a coding area in each frame of a plurality of frames in an original video; determining a change rate of the coding area in each frame based on pixels in the coding area; determining a coding strategy for the coding area based on the change rate; and using the coding strategy to perform video encoding on the coding area in each frame to obtain target data.

[0037] Compared with the related art, the method proposed in the present invention can identify the change frequency of different areas, and adopt different encoding strategies based on the change frequency of different areas, so as to improve the encoding efficiency and achieve the purpose of not encoding the entire picture. By improving the encoding efficiency and reducing the encoding calculation requirements, the network bandwidth requirements are reduced, and the transmission volume is reduced.

[0038] The video encoding method and video decoding method provided by the present application are described in detail below in conjunction with the accompanying drawings. The video encoding method and video decoding method proposed in the present disclosure are applied to cloud computer scenarios, which refer to the application of computer services based on cloud computing technology in different fields and scenarios. Cloud computers are also called cloud computing terminals or cloud desktops, which virtualize traditional computer hardware and operating systems and connect to remote servers through the network, so that users can access and use applications, data and files on personal computers at any location and on any device.

[0039] Figure 1 Flow chart of a video encoding method proposed in an embodiment of the present disclosure. Figure 1 As shown, the method comprises the following steps:

[0040] Step 101, for multiple frames in an original video, determine multiple initial regions in each frame.

[0041] In an embodiment of the present disclosure, the multiple frames in the original video may be multiple frames determined according to a preset sampling frequency. In other words, the multiple frames in the original video are multiple sampled frames in the original video.

[0042] For example, the sampling frequency may be 3-5 seconds to determine multiple frames in the original video.

[0043] In the embodiment of the present disclosure, determining multiple initial regions in each frame may be to perform initial region division on each sampling frame, and divide multiple regions with different characteristics in a sampling frame into multiple initial regions.

[0044] For example, an input video frame is read, and regions with different features in the video frame are divided into a plurality of initial regions.

[0045] In an embodiment of the present disclosure, each frame of the original video is divided to obtain multiple initial regions by using initial parameters for the first division, and then optimizing and adjusting according to the content characteristics of the picture to determine multiple initial regions.

[0046] In an embodiment of the present disclosure, each sampling frame in the original video is divided to obtain multiple initial areas by using an image segmentation algorithm, wherein the image segmentation algorithm can be a threshold-based segmentation algorithm, an edge-based segmentation algorithm, a region-based segmentation algorithm, an energy-based segmentation algorithm, or a deep learning-based segmentation algorithm, etc., which is not limited by the present disclosure.

[0047] Step 102: determining the change rate of each initial area based on the pixels in the multiple initial areas.

[0048] In the embodiment of the present disclosure, based on the pixel points in the multiple initial regions, the change rate of each initial region may be determined according to the pixel points in the multiple initial regions in each sampling frame.

[0049] In the embodiment of the present disclosure, there are multiple pixels in each initial area, and the change rate of each initial area can be determined based on the multiple pixels.

[0050] In the embodiments of the present disclosure, the change rate may be a spatial change rate or change frequency of pixel values ​​in the initial region, or may refer to a change rate of pixel values ​​over time.

[0051] In an embodiment of the present disclosure, the change rate of each initial region is determined based on the pixel points in the multiple initial regions, and the change rate of each initial region may be determined by gradient calculation.

[0052] In an embodiment of the present disclosure, the change rate of each initial area is determined based on the pixel points in multiple initial areas. The change rate of each initial area can be determined by a frame difference method, wherein the frame difference method calculates the change rate by comparing the changes in pixel values ​​of corresponding areas between two adjacent sampling frames or multiple sampling frames.

[0053] In an embodiment of the present disclosure, the change rate of each initial area is determined based on the pixel points in multiple initial areas. The change rate of each initial area can be determined by an optical flow method, wherein the optical flow method is an estimation method based on the motion of pixels or feature points. The motion information is calculated by analyzing the trajectory of pixels or feature points in a video sequence over time, and then the change rate within the area is evaluated.

[0054] In an embodiment of the present disclosure, the change rate of each initial area is determined based on the pixel points in multiple initial areas. The change rate of each initial area can be determined by a background difference method, wherein the background difference method detects moving objects by comparing the difference between the current frame and the background model, and indirectly evaluates the change rate within the area.

[0055] In an embodiment of the present disclosure, the change rate of each initial area is determined based on the pixel points in multiple initial areas. The change rate of each initial area can be determined by a pixel statistics method, wherein the pixel statistics method is based on the pixel values ​​in the area, and analyzes the distribution of pixel values ​​and the change rate in the change evaluation area.

[0056] In the embodiments of the present disclosure, the method for determining the change rate of each initial area based on the pixel values ​​in multiple initial areas is not limited, and a suitable method can be selected according to the application scenario and needs. For example, in scenarios with high real-time requirements, the frame difference method or the pixel statistics method can be selected. In scenarios with high accuracy requirements, the optical flow method can be selected.

[0057] In the above embodiment, by determining the rate of change of each initial region, the encoding calculation requirements can be reduced.

[0058] Step 103: Determine at least one coding region and a coding strategy corresponding to each coding region based on the change rate.

[0059] In an embodiment of the present disclosure, based on the change rate, determining at least one coding area can be based on the change rate of multiple initial areas in each frame, and further determining at least one coding area and at least one non-coding area in the multiple initial areas, wherein the coding area is a changing area, and the non-coding area is an area without change. In other words, the coding area is a dynamic picture, which needs to be encoded and transmitted; the non-coding area is a static picture, which does not require encoding processing or adopts a fixed low bit rate encoding strategy for encoding processing and transmission.

[0060] In an embodiment of the present disclosure, a coding strategy corresponding to at least one coding area is determined based on the change rate. Different coding methods may be used for the change rate of each coding area, or a business scenario is determined based on the change rate, and the coding strategy for each coding area is determined according to the coding method corresponding to the business scenario.

[0061] In an embodiment of the present disclosure, a coding strategy corresponding to at least one coding region is determined based on the change rate. The corresponding relationship between the change rate and the coding strategy may be pre-set, and the coding strategy corresponding to the change rate is determined by looking up a table, thereby determining the coding strategy corresponding to each coding region.

[0062] In an embodiment of the present disclosure, a coding strategy corresponding to at least one coding area is determined based on the change rate. The correspondence between the business scenario and the coding strategy may be pre-set, and the corresponding coding strategy may be determined by the business scenario determined by the change rate.

[0063] In the embodiments of the present disclosure, determining at least one coding region based on the change rate can achieve the purpose of separately encoding regions with different change rates in multiple initial regions and not encoding the entire picture.

[0064] In an embodiment of the present disclosure, based on the change rate, determining at least one coding area and the coding strategy corresponding to each coding area can achieve differentiated coding methods for different coding areas. Under the premise of ensuring picture quality, it avoids resource consumption caused by adopting a unified coding method for all coding areas, thereby further improving coding efficiency.

[0065] In the above embodiment, by determining the coding area and the non-coding area, and determining the coding strategy of the coding area according to the change rate, the coding efficiency can be improved, the coding calculation requirements can be reduced, the network bandwidth requirements can be reduced, and the transmission volume can be reduced.

[0066] Step 104 , using the encoding strategy corresponding to each encoding region, performs video encoding on each encoding region to obtain target data.

[0067] In an embodiment of the present disclosure, using a coding strategy corresponding to each coding area, video encoding of each coding area can be performed by adjusting the parameters of the encoder according to the coding strategy to perform encoding processing on the corresponding coding area to obtain encoding data corresponding to the coding area in each sampling frame in the original video.

[0068] In an embodiment of the present disclosure, the target data includes encoded data corresponding to at least one encoded area and encoded data corresponding to at least one non-encoded area in each sampling frame, wherein the encoded data corresponding to the non-encoded area is the encoded data obtained by adopting a fixed encoding strategy for the non-encoded area or by not performing encoding processing.

[0069] In an embodiment of the present disclosure, the coded data obtained by encoding the coding area is encapsulated with the information of the corresponding coding area, and the coded data corresponding to the non-coding area is encapsulated with the information of the corresponding non-coding area to obtain target data.

[0070] In summary, according to the video encoding method proposed in the present disclosure, each frame of the original video is divided to obtain multiple initial regions, and the change rate of each initial region is determined. According to the change rate, the coding region and the non-coding region in each frame are determined. Based on the change rate of the coding region, the corresponding coding strategy is determined to encode the coding region to obtain the target data. Based on the change rate, the area to be encoded is determined to achieve not encoding the entire video screen. At the same time, the coding strategy is determined according to the change rate to achieve differentiated coding, which reduces the computing requirements and transmission volume of coding, improves coding efficiency, and reduces network bandwidth requirements.

[0071] based on Figure 1 The embodiment shown, Figure 2 The following further illustrates a flow chart of determining a plurality of initial regions proposed by the present disclosure. Figure 2 based on Figure 1 In the embodiment shown, step 101 is further defined. Figure 2 As shown, step 101 may include the following steps:

[0072] Step 201 : initially dividing the first picture frame in the original video according to initial parameters to obtain a plurality of first regions.

[0073] In an embodiment of the present disclosure, the initial parameter may be a preset initialization region division parameter, and the first picture frame is initialized to divide the region to obtain a plurality of first regions.

[0074] For example, a grid-based division method is used to evenly divide a picture frame into rectangular areas of a fixed size, for example, a frame of picture is divided into areas of 9*9 or 3*3 pixels.

[0075] In an embodiment of the present disclosure, the first picture frame may be each picture frame obtained by sampling the original video according to a preset sampling frequency.

[0076] In an embodiment of the present disclosure, initially dividing the first picture frame in the original video may be initially dividing each picture frame sampled from the original video to obtain a plurality of first regions in each picture frame.

[0077] In the above embodiment, each first area is an area range of the same size, that is, the initial division is performed according to the initial parameters, which can facilitate subsequent calculation and processing and can adapt to pictures of different resolutions and sizes.

[0078] Step 202: based on the content features of the plurality of first regions, the plurality of first regions are re-divided to determine a plurality of initial regions in the first picture frame.

[0079] In an embodiment of the present disclosure, the content features include boundary features and texture features.

[0080] In an embodiment of the present disclosure, based on the content features of the multiple first regions, the multiple first regions are re-divided, and the multiple first regions in the first picture frame can be optimized and adjusted according to the boundary features and texture features of the first regions to obtain multiple initial regions.

[0081] In an embodiment of the present disclosure, the boundary feature corresponds to the discontinuity of grayscale intensity in the picture frame, that is, the boundary feature of the first area, that is, the change of the boundary grayscale value of the first area, which can be a variety of patterns, such as step type, slope type, roof type, narrow peak type, etc.

[0082] In the embodiments of the present disclosure, texture features reflect the visual characteristics of homogeneous phenomena in image frames, and embody the slowly changing or periodically changing surface structure organization and arrangement properties of the object surface. Texture features are mainly expressed through the grayscale distribution of pixels and their surrounding spatial neighborhoods, that is, local texture information. Texture features include local serial repetition, non-random arrangement, global texture information, etc.

[0083] In the embodiment of the present disclosure, the multiple first regions are re-divided based on the content features of the multiple first regions, and the boundaries of the high-frequency change regions in the first picture frame can be determined to obtain multiple initial regions.

[0084] In the embodiment of the present disclosure, each of the multiple initial areas may be of the same size or of different sizes. In other words, the number of pixels in each initial area may be the same or different.

[0085] For example, each sampled frame is divided into rectangular areas of fixed size, and then adjustments are made to areas with obvious boundaries and different texture features based on content features to ensure the rationality of the division. For example, for a picture containing a person and a background, the person's face and body need to be divided into smaller areas separately to capture their changes more accurately.

[0086] For example, a fast image segmentation algorithm may be used to first detect edges of the image and determine possible region boundaries; then, the initially divided regions are optimized and adjusted based on features such as color and texture.

[0087] Step 203: adding identification information to the multiple initial areas.

[0088] In an embodiment of the present disclosure, the identification information includes location information and boundary information.

[0089] In the embodiment of the present disclosure, adding identification information to the multiple initial regions may be adding the position coordinates and boundary information of the initial region to each initial region.

[0090] In the embodiment of the present disclosure, the position information may be the coordinates of the edge of the initial area in the first picture frame, and the boundary information may be the dividing line or edge between multiple initial areas.

[0091] For example, for the optimized and adjusted regions, the position and boundary information of each region are marked, and identification information is added to each region.

[0092] In the above embodiment, the picture of each sampling frame is initially divided and optimized and adjusted according to content characteristics to determine multiple initial areas in each sampling frame, thereby dividing the picture of each sampling frame into multiple separate areas to more accurately capture the changes in each initial area.

[0093] Figure 3 The flow chart of determining the rate of change of the initial area proposed by the present disclosure is further shown. Figure 1-Figure 2 The embodiment shown, Figure 3 right Figure 1 Step 102 in the further definition is as follows: Figure 3 As shown, the following steps are included:

[0094] Step 301, traverse multiple frames in the original video, and for multiple initial regions, pre-process the pixels in each initial region to obtain the grayscale value of each pixel.

[0095] In the embodiment of the present disclosure, the preprocessing may be to convert the grayscale value of the pixel value of the pixel point.

[0096] In the embodiment of the present disclosure, the preprocessing may be to convert the color pixel value into a grayscale value using an average method or a weighted average method.

[0097] In the embodiment of the present disclosure, grayscale value conversion is performed on multiple initial regions in each sampling frame to obtain the grayscale value of each pixel in each initial region.

[0098] For example, for each divided region, the pixel value of each region is converted into a grayscale value.

[0099] In the embodiments of the present disclosure, preprocessing the pixels in each initial area may also include denoising, background modeling and other processing.

[0100] In an embodiment of the present disclosure, the preprocessing further includes checking the integrity and format correctness of each sample frame.

[0101] For example, two consecutive frames of image data are read from the video stream, and necessary preprocessing is performed on the two acquired frames, such as checking the integrity and format correctness of the frames, traversing each divided area, and for each pixel in the area, converting its color pixel value into a grayscale value using a grayscale conversion formula.

[0102] Step 302: Determine the change rate of each initial area based on the grayscale value of each pixel.

[0103] In an embodiment of the present disclosure, the change rate of each initial area is determined based on the grayscale value of each pixel point, and the change rate of each initial area can be determined based on the grayscale value of each pixel point in multiple initial areas in each sampling frame.

[0104] In the embodiments of the present disclosure, based on the grayscale value of each pixel, multiple initial regions may be simultaneously calculated in parallel to determine the change rate of each initial region.

[0105] In the embodiment of the present disclosure, based on the pixels of each initial area in a plurality of sampling frames, the change rate of each initial area can be determined by comparing the changes of the pixels of the same initial area in adjacent sampling frames.

[0106] In the above embodiment, the initial area in each frame is preprocessed to improve the accuracy and robustness of the calculation, and the change rate of each initial area is obtained by parallel calculation of multiple initial areas, thereby improving the calculation efficiency and reducing the amount of calculation.

[0107] Figure 4 The flow chart of determining the change rate proposed in the embodiment of the present disclosure is further shown. Figure 1-Figure 3 The embodiment shown, Figure 4 right Figure 3 Step 302 in the further definition is as follows: Figure 4 As shown, the following steps are included:

[0108] Step 401 : determining a grayscale value difference of a first pixel point in a first initial area among a plurality of initial areas between adjacent frames.

[0109] In the embodiment of the present disclosure, the adjacent frame pictures are two adjacent sampling frame pictures among a plurality of sampling frame pictures in the original video.

[0110] In the embodiment of the present disclosure, the first initial area is any initial area in each sampling frame, and the first pixel point is any pixel point in an initial area.

[0111] In the embodiment of the present disclosure, determining the grayscale value difference of the first pixel point of adjacent frame pictures in the first initial area is to determine the grayscale value difference of the corresponding pixel points of adjacent sampling frame pictures in the same initial area.

[0112] For example, for each divided region, the change frequency is calculated by comparing the pixel differences of the corresponding regions in adjacent frames.

[0113] For example, for the same area of ​​adjacent frames, the grayscale values ​​are compared pixel by pixel, the differences between the grayscale values ​​are calculated, and the differences are stored.

[0114] In an embodiment of the present disclosure, the grayscale value difference of each pixel point in the first initial area between adjacent frames may be zero, indicating that the first initial area is an area without change; or, among the multiple pixels in the first initial area, there are pixels whose grayscale value difference is zero and there are also pixels whose grayscale value difference is not zero, indicating that the first initial area is an area with change; or, the grayscale value difference of each pixel point in the first initial area is not zero, indicating that the first initial area may be an area with relatively large changes.

[0115] Step 402: Determine an average change value of the first initial area based on the gray value difference and the number of pixels in the first initial area.

[0116] In an embodiment of the present disclosure, the number of pixels in the first initial area is the total number of pixels in any initial area in each sampling frame, wherein the number of pixels in each initial area may be the same or different.

[0117] In an embodiment of the present disclosure, based on the grayscale value difference and the number of pixels in the first initial area, the average change value of the first initial area can be determined based on the grayscale value difference of all pixels in the first initial area and the number of pixels in the first initial area.

[0118] In an embodiment of the present disclosure, determining the average change value of the first initial area can be performed by summing the absolute values ​​of the grayscale value differences of all pixels in the first initial area and dividing the sum by the number of all pixels to obtain the average change value of the first initial area.

[0119] For example, for two adjacent frames, the difference in grayscale values ​​of corresponding regions is calculated. The larger the absolute value of the difference, the greater the change in the region. The values ​​of these differences are summed and divided by the pixel integration of the region to obtain the average change value.

[0120] For example, the absolute values ​​of all differences in the same area are summed and divided by the total number of pixels to obtain an average change value.

[0121] Step 403 : continuously obtain average change values ​​of a preset number of groups of adjacent frame images in the first initial region to obtain a set of average change values ​​in the first initial region.

[0122] In the embodiment of the present disclosure, the preset number of groups may be a preset number of consecutive sampling frame pictures, for example, ten consecutive sampling frame pictures, or 20 consecutive sampling frame pictures.

[0123] In an embodiment of the present disclosure, the preset number of groups of adjacent frame pictures may be adjacent frame pictures in ten consecutive sampling frame pictures.

[0124] In an embodiment of the present disclosure, continuously obtaining the average change value of a preset number of groups of adjacent frame pictures in the first initial area can be performed by repeating steps 401 and 402 to determine the average change value of every two adjacent frame pictures in the preset number of groups in the first initial area, thereby obtaining a set of average change values ​​of the first initial area.

[0125] For example, by repeatedly calculating the average change value within a period of time (eg, 10 consecutive frames), a series of average change values ​​are obtained.

[0126] For example, new adjacent frames are continuously acquired, the average change value within a period of time is repeatedly calculated, and the average change values ​​of the corresponding areas of multiple groups of adjacent frames are cumulatively calculated, for example, the average change values ​​of 10 groups of adjacent frames are continuously calculated to obtain more representative change data.

[0127] In an embodiment of the present disclosure, the average change value set of consecutively acquired preset number of adjacent frame pictures in the first initial area may have zero and non-zero average change values, or may be all zero or all non-zero.

[0128] Step 404: Determine the change rate of the first initial area based on the average change value set.

[0129] In an embodiment of the present disclosure, the change rate of the first initial area is determined based on a set of average change values. The change rate of the first initial area can be determined by statistical analysis based on multiple average change values ​​of a preset number of groups of adjacent frame images in the first initial area.

[0130] In an embodiment of the present disclosure, the change rate of the first initial area is determined based on the average change value set, and the change rate of the first initial area can be determined by calculating the average value of multiple average change values ​​in the average change value set.

[0131] In an embodiment of the present disclosure, the change rate of the first initial area is determined based on the average change value set, and the change rate of the first initial area can be determined by calculating the median of multiple average change values ​​in the average change value set.

[0132] In the embodiments of the present disclosure, the change rate of the first initial region is determined based on the average change value set. The change rate of the first initial region may be determined by other data statistical methods, which is not limited by the present disclosure.

[0133] For example, for a series of average change values ​​repeatedly calculated over a period of time, the average value or median is calculated by performing statistical analysis on these values ​​to determine the change frequency of the area.

[0134] For example, the obtained series of average change values ​​are sorted and sorted, and the average of these values ​​can be calculated as the average change frequency of the area, or the median can be calculated to avoid the influence of extreme values ​​on the results, and the final change frequency of the area is determined according to the results of statistical analysis.

[0135] In an embodiment of the present disclosure, when all values ​​in the average change value set are zero, the change rate of the first initial area is zero, indicating that the first initial area is an area without change; when there are zero values ​​and non-zero values ​​in the average change value set, or all are non-zero, the change rate of the first initial area is determined by statistical analysis.

[0136] In the embodiment of the present disclosure, each sampling frame has an area with a zero change rate and an area with a non-zero change rate.

[0137] In the above embodiment, the average change value of each initial area can be determined based on the grayscale value of the pixel points in each initial area in each sampling frame, and by continuously determining the average change value of multiple adjacent frames in the same initial area, the change rate determined by statistical analysis is more accurate and can accurately reflect the changes in the area.

[0138] Figure 5 The following is a flowchart of determining the coding area and coding strategy proposed by the embodiment of the present disclosure. Figure 1-Figure 4 The embodiment shown, Figure 5 right Figure 1 Step 103 in the further definition is as follows: Figure 5 As shown, the following steps are included:

[0139] Step 501: Determine at least one coding region according to the change rate of each initial region.

[0140] In the embodiment of the present disclosure, at least one coding area and at least one non-coding area in each sampling frame picture are determined according to the change rate of each initial area, that is, according to the change rate of each initial area in each sampling frame picture.

[0141] In the embodiments of the present disclosure, according to Figure 4 The change rate of each initial area in the first sampling frame picture determined in the embodiment is determined, and the initial area with a change rate of zero is determined as a non-coding area, and the initial area with a change rate not zero is determined as a coding area, thereby determining at least one coding area.

[0142] In the embodiments of the present disclosure, the non-coding region may be a region that is not subjected to coding processing, or may be a region that adopts a fixed coding strategy, wherein the fixed coding strategy may be a coding strategy with a low coding rate.

[0143] In an embodiment of the present disclosure, based on the change rate of each initial area, determining at least one coding area can be that the initial area with a change rate lower than a preset threshold is determined as a non-coding area, and the initial area with a change rate higher than or equal to the preset threshold is determined as a coding area, wherein the preset threshold can be a pre-set minimum value of the change rate that needs to be encoded.

[0144] Step 502: Determine the change rate level of each coding region according to the correspondence table between the change rate and the change rate level.

[0145] In an embodiment of the present disclosure, according to a correspondence table between change rate and change rate level, determining the change rate level of each coding area includes any of the following items: when the change rate is greater than a first threshold, the change rate level is determined to be a high level; when the change rate is greater than a second threshold and less than or equal to the first threshold, the change rate level is determined to be a medium level; when the change rate is less than or equal to the second threshold, the change rate level is determined to be a low level, and the first threshold is greater than the second threshold.

[0146] In an embodiment of the present disclosure, the first threshold and the second threshold are pre-set thresholds for dividing the change rate levels, that is, the first threshold is used to divide the high-level change rate, and the second threshold is used to divide the low-level change rate. The change rate between the first threshold and the second threshold is a medium-level change rate.

[0147] In the embodiment of the present disclosure, based on the change rate of each coding region, the change rate level of each coding region can be determined through a correspondence table between the change rate and the change rate level.

[0148] For example, the first threshold may be 30fps, and the second threshold may be 17fps. When the rate of change of the coding area is greater than 30fps, the coding area is at a high level. When the rate of change is greater than 17fps and less than or equal to 30fps, the coding area is at a medium level. When the rate of change is less than or equal to 17fps, the coding area is at a low level.

[0149] In the embodiments of the present disclosure, the values ​​of the first threshold and the second threshold can be configured according to actual needs, which is not limited by the present disclosure.

[0150] Step 503: Determine the encoding strategy for each encoding region based on the change rate level of each encoding region according to a preset rule.

[0151] In the embodiments of the present disclosure, the preset rule may be a preset correspondence between a change rate level and an encoding strategy, or may be an encoding strategy for a scene corresponding to a change rate level.

[0152] In the embodiment of the present disclosure, based on the change rate level of each coding region, the coding strategy of each coding region is determined by finding the corresponding coding strategy in the preset rules.

[0153] In an embodiment of the present disclosure, the preset rule may be a high level corresponding to a high bit rate and high precision coding strategy, a medium level corresponding to a medium bit rate and precision coding strategy, and a low level corresponding to a low bit rate and low precision coding strategy, that is, according to the three levels of change rate, high, medium and low, the corresponding coding strategy is determined. For example, the high level corresponds to the first coding rate and the first coding accuracy, the medium level corresponds to the second coding rate and the second coding accuracy, and the low level corresponds to the third coding rate and the third coding accuracy, wherein the values ​​of the first coding rate, the second coding rate, and the third coding rate decrease successively, and the values ​​of the first coding accuracy, the second coding accuracy, and the third coding accuracy decrease successively.

[0154] For example, the corresponding encoding strategy is selected according to the level: for areas marked as high level (area of ​​high interest), it means that the content of these areas changes frequently and is important, and it is necessary to adopt an encoding method that can provide high quality and high detail, including using more complex encoding algorithms and allocating more bits to identify pixel information to ensure the details and smoothness of the picture. For example, in video coding standards such as H265 / HEVC, advanced coding modes are enabled, prediction accuracy is increased, and more transformation modes are used; for areas marked as medium level (area of ​​medium interest), it is necessary to strike a balance between picture quality and coding efficiency, adopt a medium-complexity coding algorithm, and allocate an appropriate amount of bit resources to ensure a certain picture quality without increasing the amount of encoded data too much; for low-level areas (areas of low interest), due to their low rate of change, the impact on picture quality is relatively small, and a simple and efficient encoding mode can be adopted to reduce bit allocation to save coding resources and reduce the amount of data.

[0155] In the embodiments of the present disclosure, for different encoding strategies, the encoding parameters may be preset values, or the encoding parameters may be dynamically adjusted according to actual conditions or encoding requirements to adapt to different types of video images and improve the encoding effect.

[0156] In the above embodiment, differentiated coding is achieved by adopting different coding strategies for different coding areas according to the change rate. By making differences in computing resource investment, more computing resources are invested in high-speed changing scenes to ensure smoothness and clarity. Coding resources can be used more effectively, unnecessary data redundancy can be reduced, and coding efficiency can be improved. High-bitrate coding is used for areas with higher change frequencies to ensure image details and quality and avoid problems such as blurring or distortion. On the premise of ensuring image quality, low-bitrate coding of low-change frequency areas can be used to reduce the overall bit rate and save storage space and transmission bandwidth.

[0157] Figure 6 The flowchart of the video encoding method proposed in the embodiment of the present disclosure is further shown. Figure 1-Figure 5 The embodiment shown, as Figure 6 As shown, the following steps are included:

[0158] Step 601: Determine a coding parameter of a first coding region according to a coding strategy of the first coding region among at least one coding region.

[0159] In an embodiment of the present disclosure, the first coding region in the at least one coding region may be any coding region in each sampling frame picture.

[0160] In an embodiment of the present disclosure, the coding parameters of the first coding area are determined according to the coding strategy of the first coding area in at least one coding area, and the coding parameters of each coding area can be determined according to the coding strategy of each coding area in each sampling frame.

[0161] In the embodiments of the present disclosure, for different encoding strategies, the encoding parameters that need to be adjusted may be the same or different.

[0162] In an embodiment of the present disclosure, the encoding parameter may be at least one of a quantization parameter, a prediction accuracy, and a motion vector, wherein the quantization parameter includes a frame rate, a resolution, an encoding format, a bit rate, and the like.

[0163] For example, after the coding strategy is determined, specific coding parameters are further adjusted. According to the coding strategy corresponding to each coding area, the coding parameters that need to be adjusted are clearly identified. The coding parameters may include quantization parameters, prediction modes, motion vectors, and the like.

[0164] Step 602: Determine a parameter value of the encoding parameter based on the encoding parameter of the first encoding region, the change rate level of the first encoding region, and the encoding requirement.

[0165] In the embodiments of the present disclosure, the encoding requirements may be pre-set encoding requirements for different regions, such as requirements for bit rate, image quality, etc.

[0166] In the embodiments of the present disclosure, the encoding requirements may also include the following: picture quality and bit rate balance: according to the specific application requirements, balance the picture quality and bit rate, and minimize the bit rate while ensuring a certain picture quality to save bandwidth or storage space; real-time requirements: if the encoding is performed in real time, it is necessary to consider the impact of parameter adjustment on the encoding speed to ensure that the encoding process can meet the real-time requirements; encoding standards and hardware support: different encoding standards and hardware may have different support and performance for certain parameters. When adjusting parameters, it is necessary to consider the characteristics of the encoding standards and hardware used; experiments and optimization: the adjustment of encoding parameters usually requires experiments and optimization. You can perform encoding tests on different parameter combinations, compare the encoding effects, and select better parameter settings.

[0167] In an embodiment of the present disclosure, based on the coding parameters of the first coding area, the change rate level of the first coding area, and the coding requirements, the parameter value of the coding parameter can be determined based on a corresponding mapping relationship. For high-level coding areas, the quantization parameter is reduced, and the prediction accuracy and the accuracy of the motion vector are improved to retain more detail information; for low-level coding areas, the quantization parameter is increased, the selection of prediction modes is reduced, and the accuracy of the motion vector is reduced to reduce the amount of encoded data; for medium-level coding areas, the coding parameters are balanced between high and low levels.

[0168] For example, for each parameter that needs to be adjusted, the appropriate parameter value is calculated according to the characteristics of the region (such as change frequency, texture complexity, etc.) and encoding requirements (such as bit rate, image quality, etc.), and the calculated parameter value is applied to the actual encoding process.

[0169] In the above embodiment, by using different encoding strategies, based on the change rate level of the encoding area and the encoding requirements, the encoding parameters in each encoding strategy are adaptively adjusted so that each encoding strategy can adapt to the corresponding encoding area to adapt to different types of video pictures and improve the encoding effect.

[0170] Figure 7 The flowchart of performing video encoding on the encoding area proposed by the embodiment of the present disclosure is further shown. Figure 1-Figure 6 The embodiment shown, Figure 7 right Figure 1 Step 104 in the further definition is as follows: Figure 7 As shown, the following steps are included:

[0171] Step 701 , for a second picture frame in a plurality of picture frames, encoding is performed on a second encoding region according to an encoding strategy of a second encoding region in at least one encoding region to obtain region data corresponding to the second encoding region.

[0172] In the embodiment of the present disclosure, the second picture frame is any one of a plurality of sample frame pictures in the original video.

[0173] In the embodiment of the present disclosure, the second coding area is any coding area in the second picture frame.

[0174] In the embodiment of the present disclosure, the encoding strategy of the second encoding region may be to use a preset encoding parameter value, or may be based on Figure 7 The method shown is an encoding strategy after adjusting the encoding parameters.

[0175] In an embodiment of the present disclosure, the second coding area is encoded according to the encoding strategy of the second coding area. Each coding area in each sampling frame picture may be encoded according to the corresponding encoding strategy to obtain area data corresponding to each coding area.

[0176] In an embodiment of the present disclosure, encoding processing is performed on the second encoding region according to the encoding strategy of the second encoding region. The encoding processing may be performed by setting corresponding parameters in the encoder according to the encoding parameters in the encoding strategy, or by adjusting the encoding parameters using an interface provided by the encoding library.

[0177] Step 702: Determine the sorting value of the area data corresponding to the second coding area in the second picture frame according to the first rule.

[0178] In an embodiment of the present disclosure, the first rule may be a preset sorting rule, for example, sorting by position in the screen, wherein the sorting rule may be from the upper left corner to the lower right corner, or in a row-first order, or in a column-first order.

[0179] In an embodiment of the present disclosure, determining the sorting value of the regional data corresponding to the second coding region in the second picture frame according to the first rule may be determining the sorting value of the regional data corresponding to each coding region in the picture frame in which it is located according to a preset sorting rule.

[0180] In the above embodiment, determining the ranking value of each coding region in the picture helps to process and restore in the same order during decoding.

[0181] Step 703: Add the ranking value, the change rate level corresponding to the second coding region, and the coding strategy corresponding to the second coding region to the identification information of the second coding region.

[0182] In an embodiment of the present disclosure, the sorting value, the change rate level, and the coding strategy are added to the identification information of the corresponding coding area, so as to add identification information for each coding area, and the identification information of each coding area also includes the location information and boundary information of the area.

[0183] For example, for each region, an identifier is generated containing detailed information such as its position (such as starting coordinates and ending coordinates), size (such as width and height), change frequency level (high, medium, low), and the encoding strategy adopted. This identification information usually exists in the form of a specific data structure or field so that it can be clearly represented and distinguished in the code stream.

[0184] Step 704: encapsulate the region data of the second coding region and the corresponding identification information.

[0185] In the embodiment of the present disclosure, encapsulating the region data of the second coding region with the corresponding identification information may be to encapsulate at least one coding region in each picture frame with the corresponding identification information to generate final target data.

[0186] In an embodiment of the present disclosure, the target data also includes regional data of at least one non-coding area and corresponding identification information. The regional data of at least one non-coding area may be data that has not been encoded, or may be data after the non-coding area has been encoded according to a fixed encoding strategy. The identification information includes position information and boundary information corresponding to the non-coding area, as well as header information, check number, version number, etc.

[0187] In an embodiment of the present disclosure, the region data and the corresponding identification information are encapsulated, including combining the region data and the corresponding identification information, and adding header information, a check number, a version number, etc., to ensure the integrity and correctness of the code stream.

[0188] For example, the data and identification information are encapsulated to generate the final code stream. The encoded regional data and the corresponding identification information are combined together using a specific encapsulation format or protocol. This encapsulation process can add header information, check numbers, version numbers, etc. to ensure the integrity and correctness of the code stream. The final generated code stream can be transmitted over the network or stored in a file for parsing and processing at the decoding end.

[0189] In the above embodiment, based on the encoding strategy corresponding to the encoding area in each sampling frame picture determined above, each encoding area is encoded, which can achieve differentiated encoding of the video frame picture, avoid video encoding of the entire picture frame, reduce the encoding calculation requirements, reduce network bandwidth requirements and transmission volume, and thus improve encoding efficiency.

[0190] Figure 8 Flow chart of a video decoding method proposed in an embodiment of the present disclosure. Figure 8 As shown, the following steps are included:

[0191] Step 801, obtaining target data.

[0192] In the embodiment of the present disclosure, the target data is used as follows Figure 1-Figure 7 The target data obtained by the video encoding method shown includes regional data of at least one encoding area and corresponding identification information, regional data of at least one non-coding area and corresponding identification information, and the identification information includes at least one of position information, sorting value, boundary information, change rate level, and encoding strategy.

[0193] In the embodiment of the present disclosure, the identification information also includes header information, a check number, a version number, etc.

[0194] In an embodiment of the present disclosure, the non-coding area is an area that has not been encoded or an area that has been encoded according to a fixed encoding strategy. Accordingly, the area data of the non-coding area can be pixel data of the non-coding area that has not been encoded or area data that has been encoded according to a fixed encoding strategy.

[0195] For example, the encoded code stream data is obtained from the network transmission, and a connection with the data source is established to ensure stable reading of the data.

[0196] Step 802: Decode the target data according to the identification information to obtain the original video.

[0197] In an embodiment of the present disclosure, the target data is decoded based on the identification information, which may be performed by parsing the identification information to obtain the position information, sorting value, boundary information, change rate level and encoding strategy in the identification information to decode the target data.

[0198] In an embodiment of the present disclosure, the target data is decoded according to the identification information. The decoding strategy corresponding to the encoding strategy can be obtained according to the encoding strategy in the identification information, the regional data corresponding to the encoding strategy is decoded, and the decoded regional images are combined according to the identification information to obtain multiple frames of the original video.

[0199] In an embodiment of the present disclosure, the target data is decoded according to the identification information to obtain the original video. The regional data of the encoded area may be decoded according to the decoding strategy corresponding to each encoded area, and the regional data of the non-encoded area may be decoded according to the encoding strategy corresponding to the non-encoded area, and the decoded pixel data may be combined to obtain multiple frames of the original video.

[0200] In an embodiment of the present disclosure, the regional data of the non-coding area is decoded according to the identification information. The pixel data of the non-coding area that has not been encoded is directly obtained, or the regional data obtained by encoding according to a fixed encoding strategy is decoded using a corresponding decoding strategy to obtain corresponding pixel data.

[0201] In the above embodiment, by parsing the identification information in the target data, the encoding strategy of the encoding area and the encoding strategy of the non-coding area can be obtained to determine the corresponding decoding strategy, realize the decoding of the regional data, and arrange and combine the decoded pixel data according to the identification information to obtain multiple frames of the original video.

[0202] Fig. 9 The flowchart of decoding the target data proposed by the embodiment of the present disclosure is further shown. Figure 8 The embodiment shown, Fig. 9 right Figure 8 Step 802 in the embodiment is further defined as Fig. 9 As shown, the following steps are included:

[0203] Step 901, determining a decoding strategy corresponding to each region data according to the encoding strategy of each region data.

[0204] In the embodiment of the present disclosure, a corresponding decoding strategy is determined according to the encoding strategy in the identification information corresponding to each region data.

[0205] In the embodiments of the present disclosure, the decoding strategy corresponding to each area data is determined according to the encoding strategy of each area data. The decoding strategy of each encoding area can be determined according to the correspondence table between the encoding strategy and the decoding strategy corresponding to the three pre-set change rate levels of high, medium and low; the decoding strategy of each non-coding area can be determined according to the encoding strategy of the non-coding area and the identification information of the non-coding area.

[0206] In the embodiment of the present disclosure, for the non-encoded area that has not been encoded, the decoding strategy may be not to perform decoding processing.

[0207] For example, for empty data packets or filling data, the decoder skips these data packets and does not perform decoding operations.

[0208] In the embodiment of the present disclosure, for the non-coding region encoded by using a fixed encoding strategy, the decoding strategy is the decoding strategy corresponding to the fixed encoding strategy, wherein the fixed encoding strategy and the corresponding decoding strategy are the encoding and decoding strategy mapping relationship of the pre-set non-coding region.

[0209] Step 902: Use the decoding strategy to decode the area data corresponding to the decoding strategy to obtain pixel data corresponding to each area data.

[0210] In an embodiment of the present disclosure, a decoding strategy is used to decode the regional data corresponding to the decoding strategy. The regional data of the corresponding coding area can be decoded according to the decoding strategy of each coding area, and the regional data of the corresponding non-coding area can be decoded according to the decoding strategy of each non-coding area to obtain pixel data corresponding to each regional data.

[0211] In an embodiment of the present disclosure, the pixel data also includes pixel data corresponding to a non-encoding region that has not been encoded.

[0212] In an embodiment of the present disclosure, a decoding strategy is used to decode the regional data corresponding to the decoding strategy. The regional data can also be decoded according to the decoding strategy with reference to pre-set decoding parameters, reference frame information, etc. to obtain pixel data corresponding to each regional data.

[0213] For example, according to the acquired encoding mode, a corresponding decoding algorithm is selected, and the encoding data of each region is processed using the decoding algorithm to restore the original pixel data.

[0214] Step 903, combining the pixel data corresponding to each area data according to the position information and the sorting value to obtain the original video.

[0215] In an embodiment of the present disclosure, pixel data corresponding to each area data is combined according to position information and sorting value. Pixel data of all coding areas and pixel data of all non-coding areas may be combined according to position information and sorting value of each coding area and position information of each non-coding area to obtain multiple frames of the original video.

[0216] For example, according to the position and size information of the area, the decoded pictures of each area are accurately placed at the corresponding position, so that the splicing between the areas is seamless and conforms to the layout of the original picture, and the combined complete picture is output on the real device.

[0217] In the embodiments of the present disclosure, during the decoding and display process, the following aspects also need to be considered: performance optimization, minimizing the time overhead of decoding and combining pictures to achieve smooth video playback; error handling, handling possible errors or missing data in the bitstream, and taking appropriate error correction or recovery measures; dynamic adjustment, dynamically adjusting the decoding and display strategies according to the playback environment and user operations (such as zooming, pausing, etc.).

[0218] In the above embodiment, according to the information in the acquired target data, the decoding strategy corresponding to each area is parsed and acquired, and the regional data of each area is decoded using the decoding strategy to obtain the pixel data of each area, and all the pixel data are arranged and combined according to the position information and the sorting number, so as to realize decoding and display, and the obtained original video can restore the multi-frame picture input by the encoding end.

[0219] Fig.10 A flowchart of a video encoding and decoding method provided by the present disclosure is as follows: Fig.10 As shown, the method includes:

[0220] (1) Screen area division

[0221] The grid-based partitioning method is used to evenly divide the picture into rectangular areas of fixed size, for example, a frame of the picture is divided into 9*9 pixel areas. This partitioning method is not only convenient for calculation and processing, but also can better adapt to pictures of different resolutions and sizes. In the partitioning process, the content characteristics of the picture are considered, and appropriate adjustments are made to areas with obvious boundaries and different texture characteristics to ensure the rationality of the partition. For example, for a picture containing a person and a background, the face and body of the person may need to be divided into smaller areas separately to capture their changes more accurately.

[0222] In order to achieve efficient region division, a fast image segmentation algorithm is used. The algorithm first detects the edge of the picture to determine the possible region boundaries, and then optimizes and adjusts the initially divided regions based on color, texture and other features.

[0223] (2) Change frequency calculation

[0224] For each divided region, its change frequency is calculated by comparing the pixel differences of the corresponding regions in adjacent frames.

[0225] The specific calculation method is as follows: first, convert the pixel values ​​of each area into grayscale values ​​to simplify the calculation; then, for two adjacent frames, calculate the difference in the grayscale values ​​of the corresponding areas. The larger the absolute value of the difference, the greater the change in the area; sum these differences and divide them by the total number of pixels in the area to obtain the average change value; repeat the calculation process over a period of time (for example, 10 consecutive frames) to obtain a series of average change values; finally, perform statistical analysis on a series of average change values, calculate the average or median, and determine the change frequency of the area.

[0226] In order to improve the computational efficiency, parallel computing technology is used to calculate the change frequency of multiple regions at the same time. In addition, a cache mechanism is used to store the pixel information of adjacent frames that have been calculated to avoid repeated reading and calculation.

[0227] The process of changing frequency calculation is as follows:

[0228] 1) Obtain two adjacent frames: read two consecutive frames of image data from the video stream; perform necessary preprocessing on the acquired frames, such as checking the integrity and format correctness of the frames;

[0229] 2) For each area, convert the pixel value into a grayscale value: traverse each divided area; for each pixel in the area, use a common grayscale conversion formula (such as the average method, weighted average method, etc.) to convert the color pixel value into a grayscale value; store the converted grayscale value for subsequent calculations.

[0230] 3) Calculate the difference in grayscale values ​​of corresponding areas in adjacent frames: For the same area in adjacent frames, compare the grayscale values ​​pixel by pixel; calculate the difference between the grayscale values ​​and store these differences.

[0231] 4) Sum the differences and divide by the total number of pixels to get the average change value: Sum the absolute values ​​of all the differences; divide the sum by the total number of pixels in the area to get the average change value; the average change value reflects the average degree of change in the area between the two frames.

[0232] 5) Repeat steps 1) to 4) to calculate the average change value over a period of time: continue to obtain new adjacent frames, repeat the above steps, and cumulatively calculate the average change values ​​of the corresponding areas of multiple groups of adjacent frames; for example, continuously calculate the average change values ​​of 10 groups of adjacent frames to obtain more representative change data.

[0233] 6) Perform statistical analysis on the average change values ​​to determine the change frequency: sort and sort the obtained series of average change values; calculate the average of these values ​​as the average change frequency of the area; or calculate the median to avoid the influence of extreme values ​​on the results; based on the statistical analysis results, determine the final change frequency level (high, medium, low) of the area.

[0234] (3) Coding strategy selection

[0235] According to the calculated regional change frequency, select the appropriate encoding strategy. The change frequency is divided into three levels: high, medium, and low, and a corresponding encoding strategy is assigned to each level.

[0236] For high-frequency change regions (regions of high interest), a high-bitrate, high-precision encoding method is adopted, such as using the advanced encoding mode in the advanced video coding standard to allocate more bits for encoding to ensure the details and smoothness of the picture; for medium-frequency change regions (regions of medium interest), a medium-bitrate and high-precision encoding method is adopted to balance the picture quality and encoding efficiency; for low-frequency change regions (regions of low interest), a low-bitrate, low-precision encoding method is adopted, such as using a simple encoding mode to reduce the amount of encoded data, thereby saving resources.

[0237] The process of encoding strategy selection is as follows:

[0238] 1) Obtaining the change frequency of the region: The change frequency value of each divided region needs to be obtained through the change frequency calculation method in step (2);

[0239] 2) According to the preset threshold, the change frequency is divided into three levels: high, medium and low: set a clear threshold to divide the levels, mark the area with a change frequency greater than a certain higher value as a high level, the change frequency in the middle range as a medium level, and the change frequency less than a certain lower value as a low level;

[0240] 3) Select the corresponding encoding strategy according to the level:

[0241] For areas marked as high-level, it means that the content in these areas changes frequently and is important, and a coding method that can provide high quality and high details is required. More complex coding algorithms can be used and more bits can be allocated to represent pixel information to ensure the details and smoothness of the picture.

[0242] For medium-level areas, it is necessary to strike a balance between picture quality and coding efficiency. A medium-complexity coding algorithm is used to allocate an appropriate amount of bit resources to ensure a certain picture quality without increasing the amount of coded data too much.

[0243] For low-level areas, since their frequency of change is low and the impact on picture quality is relatively small, a simple and efficient encoding mode can be used to reduce bit allocation to save encoding resources and reduce data volume.

[0244] (4) Coding parameter adjustment

[0245] After the coding strategy is determined, the specific coding parameters are further adjusted to achieve the best coding effect. The coding parameters include quantization parameters, prediction mode, motion vector, etc.

[0246] For areas coded at high bit rates, reduce the quantization parameter, improve the prediction accuracy and the accuracy of the motion vector to retain more detail information; for areas coded at low bit rates, increase the quantization parameter, reduce the selection of prediction modes, and reduce the accuracy of the motion vector to reduce the amount of coded data.

[0247] The process of adjusting encoding parameters is as follows:

[0248] 1) Determine the parameters that need to be adjusted according to the coding strategy: According to the coding strategy determined in (4), the coding parameters that need to be adjusted are determined.

[0249] 2) Calculate appropriate parameter values ​​based on regional characteristics and coding requirements: For each parameter that needs to be adjusted, calculate the appropriate parameter value based on the characteristics of the region (such as change frequency, texture complexity, etc.) and coding requirements (such as bit rate, image quality, etc.).

[0250] 3) Applying parameters to the encoding process: Applying the calculated parameter values ​​to the actual encoding process involves setting the corresponding parameters in the encoder or adjusting the parameters using the interface provided by the encoding library.

[0251] When adjusting encoding parameters, multiple factors need to be considered to achieve the best encoding effect. The following are additional considerations:

[0252] Picture quality and bit rate balance: Balance picture quality and bit rate according to specific application requirements. Under the premise of ensuring a certain picture quality, try to reduce the bit rate to save bandwidth or storage space.

[0253] Real-time requirements: If the encoding is performed in real time, it is necessary to consider the impact of parameter adjustment on the encoding speed to ensure that the encoding process can meet the real-time requirements.

[0254] Coding standards and hardware support: Different coding standards and hardware may have different support and performance for certain parameters. When adjusting parameters, you need to consider the characteristics of the coding standard and hardware used.

[0255] Experimentation and optimization: Adjustment of encoding parameters usually requires experimentation and optimization. You can perform encoding tests on different parameter combinations, compare the encoding effects, and select the optimal parameter settings.

[0256] (5) Bitstream Generation

[0257] The encoded regional data is combined into a bitstream. In the bitstream, identification information is added to each region, including the region's location, size, change frequency level, and encoding strategy. This identification information helps the decoder to correctly parse and restore the picture.

[0258] The process of code stream generation is as follows:

[0259] 1) Arrange the encoded regional data in a certain order: determine a reasonable sorting rule and arrange the encoded regional data according to the position of the region in the picture (from the upper left corner to the lower right corner, or in order of row priority, column priority, etc.); such sorting helps to process and restore in the same order during decoding.

[0260] 2) Add identification information for each region: For each region, generate an identification containing detailed information such as its location (such as starting coordinates and ending coordinates), size (such as width and height), change frequency level (high, medium, low), and the encoding strategy adopted; this identification information usually exists in the form of a specific data structure or field so that it can be clearly represented and distinguished in the code stream.

[0261] 3) Encapsulate the data and identification information to generate the final bitstream: Use a specific encapsulation format or protocol to combine the encoded regional data and the corresponding identification information; this encapsulation process may involve adding some header information, checksums, and version numbers to ensure the integrity and correctness of the bitstream; the final bitstream can be transmitted over the network or stored in a file for parsing and processing at the decoding end.

[0262] (6) Decoding and display

[0263] At the decoding end, the coded data of different regions are decoded according to the identification information in the bitstream and restored to the original picture. First, the identification information in the bitstream is read to determine the attributes and encoding method of each region; then, the regional data is decoded according to the corresponding decoding algorithm; finally, the pictures of each region are combined to display the complete video image.

[0264] The decoding and display process is as follows:

[0265] 1) Read code stream: obtain the encoded code stream data from network transmission; establish a link with the data source to ensure stable data reading.

[0266] 2) Parse the identification information to obtain the attributes and encoding method of the area:

[0267] Parse the read bitstream data and extract the identification information of each region; obtain key attributes such as the region's location (coordinates), size (width and height), change frequency level, and the encoding strategy used from the identification information.

[0268] 3) Decode the regional data:

[0269] According to the obtained encoding method, a corresponding decoding algorithm is selected; the encoding data of each area is processed using the decoding algorithm to restore the original pixel data; in the decoding process, some additional decoding parameters and reference frame information may need to be considered.

[0270] 4) Combine the decoded regional images and display them:

[0271] According to the position and size information of the area, the decoded images of each area are accurately placed in the corresponding position; ensure that the splicing between the areas is seamless and conforms to the layout of the original image; and output the combined complete image to the display device.

[0272] In the actual decoding and display process, the following aspects also need to be considered:

[0273] Performance optimization: Minimize the time overhead of decoding and combining pictures to achieve smooth video playback.

[0274] Error handling: handles possible errors or missing data in the bitstream and takes appropriate error correction or recovery measures.

[0275] Dynamic adjustment: Dynamically adjust the decoding and display strategies according to the playback environment and user operations (such as zooming, pausing, etc.).

[0276] The above video encoding method has the following beneficial effects:

[0277] (1) Improve coding efficiency: By dividing the picture into regions and selecting coding strategies based on the frequency of change, coding resources can be used more effectively, unnecessary data redundancy can be reduced, and coding efficiency can be improved;

[0278] (2) Ensure image quality: Use high bit rate encoding for areas with high frequency of changes to ensure image details and quality and avoid problems such as blur or distortion.

[0279] (3) Strong adaptability: It can adapt to different types of video images. When there are complex motions or scene changes in the images, it can automatically adjust the encoding strategy to improve the encoding effect.

[0280] (4) Reduce bit rate: Under the premise of ensuring image quality, low bit rate encoding of low-frequency change areas can reduce the overall bit rate, saving storage space and transmission bandwidth.

[0281] Fig.11 FIG. 1 is a schematic diagram of a video encoding device provided by an embodiment of the present disclosure. Fig.11 As shown, the present disclosure provides a schematic diagram of a video encoding device 1100.

[0282] In the embodiment of the present disclosure, the device 1100 includes: a division module 1101 , a first determination module 1102 , a second determination module 1103 , and an encoding module 1104 .

[0283] In the embodiment of the present disclosure, the division module 1101 is used to determine a plurality of initial regions in each frame of a plurality of frames in an original video.

[0284] The first determination module 1102 is used to determine the change rate of each initial area based on the pixels in the multiple initial areas.

[0285] The second determination module 1103 is used to determine at least one coding region and a coding strategy corresponding to each coding region based on the change rate.

[0286] The encoding module 1104 is used to use the encoding strategy corresponding to each encoding region to perform video encoding on each encoding region to obtain target data.

[0287] In some embodiments, the division module 1101 is also used to: perform initial division on the first picture frame in the original video according to initial parameters to obtain multiple first areas; re-divide the multiple first areas based on content features of the multiple first areas to determine multiple initial areas in the first picture frame, the content features include boundary features and texture features; add identification information to the multiple initial areas, the identification information includes location information and boundary information.

[0288] In some embodiments, the first determination module 1102 is also used to: traverse multiple frames in the original video, and for multiple initial areas, pre-process the pixels in each initial area to obtain the grayscale value of each pixel; based on the grayscale value of each pixel, determine the change rate of each initial area.

[0289] In some embodiments, the first determination module 1102 is also used to: determine the grayscale value difference of the first pixel point in the first initial area of ​​multiple initial areas among adjacent frame pictures; determine the average change value of the first initial area based on the grayscale value difference and the number of pixels in the first initial area; continuously obtain the average change values ​​of a preset number of groups of adjacent frame pictures in the first initial area to obtain a set of average change values ​​in the first initial area; and determine the change rate of the first initial area based on the set of average change values.

[0290] In some embodiments, the second determination module 1103 is also used to: determine at least one coding region based on the change rate of each initial region; determine the change rate level of each coding region based on a correspondence table between the change rate and the change rate level; and determine the coding strategy of each coding region based on the change rate level of each coding region according to preset rules.

[0291] In some embodiments, the second determination module 1103 is also used for: when the change rate is greater than the first threshold, the change rate level is determined to be a high level; when the change rate is greater than the second threshold and less than or equal to the first threshold, the change rate level is determined to be a medium level; when the change rate is less than or equal to the second threshold, the change rate level is determined to be a low level, and the first threshold is greater than the second threshold.

[0292] In some embodiments, the second determination module 1103 is also used to: determine the encoding parameters of the first encoding region according to the encoding strategy of the first encoding region in at least one encoding region; determine the parameter value of the encoding parameter based on the encoding parameter of the first encoding region, the change rate level of the first encoding region, and the encoding requirements.

[0293] In some embodiments, the encoding module 1104 is also used to: for a second picture frame in a multi-frame picture, encode the second encoding region according to the encoding strategy of the second encoding region in at least one encoding region to obtain regional data corresponding to the second encoding region; determine the sorting value of the regional data corresponding to the second encoding region in the second picture frame according to the first rule; add the sorting value, the change rate level corresponding to the second encoding region, and the encoding strategy corresponding to the second encoding region to the identification information of the second encoding region; and encapsulate the regional data of the second encoding region and the corresponding identification information.

[0294] In summary, the video encoding device provided by the present invention divides multiple frames in the original video into regions, determines the encoding region according to the change rate, and determines the encoding strategy for each encoding region based on the change rate, so as to perform differential encoding on different encoding regions, thereby achieving the purpose of not encoding the entire picture, thereby reducing the overall bit rate, improving the encoding efficiency, and saving storage space and transmission bandwidth while ensuring picture quality.

[0295] Fig.12 FIG. 1 is a schematic diagram of a video decoding device provided by an embodiment of the present disclosure. Fig.12 As shown, the present disclosure provides a schematic diagram of a video decoding device 1200.

[0296] In the embodiment of the present disclosure, the device 1200 includes: an acquisition module 1201 and a decoding module 1202 .

[0297] The acquisition module 1201 is used to acquire target data. The target data is obtained by using Fig.11 The target data obtained by the video encoding device shown includes regional data of at least one encoding area and corresponding identification information, regional data of at least one non-coding area and corresponding identification information, and the identification information includes at least one of position information, sorting value, boundary information, change rate level, and encoding strategy.

[0298] The decoding module 1202 is used to decode the target data according to the identification information to obtain the original video.

[0299] In some embodiments, the decoding module is also used to: determine the decoding strategy corresponding to each regional data according to the encoding strategy of each regional data; use the decoding strategy to decode the regional data corresponding to the decoding strategy to obtain pixel data corresponding to each regional data; combine the pixel data corresponding to each regional data according to the position information and sorting value to obtain the original video.

[0300] In the embodiments provided in the present application, the methods and devices provided in the embodiments of the present application are introduced. In order to implement the functions in the methods provided in the embodiments of the present application, the electronic device may include a hardware structure and a software module, and implement the functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. A function of the functions may be executed in the form of a hardware structure, a software module, or a hardware structure plus a software module.

[0301] Fig.13 It is a block diagram of an electronic device 1300 for implementing the above-mentioned video encoding method or video decoding method according to an exemplary embodiment.

[0302] Reference Fig.13 The electronic device 1300 may include a communication interface 1301, which can interact with other devices; a processor 1302, which is connected to the communication interface 1301 to interact with other devices and is used to execute the method provided by one or more of the above technical solutions when running a computer program; and a memory 1303, on which the computer program is stored. Specifically, the specific processing process of the processor 1302 can refer to the video encoding method or video decoding method described in the above embodiments of the present disclosure.

[0303] Of course, in actual application, the various components in the electronic device 1300 are coupled together through the bus system 1304. It can be understood that the bus system 1304 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1304 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Fig.13 Various buses are labeled as bus system 1304.

[0304] The memory 1303 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device 1300. Examples of such data include: any computer program used to operate on the electronic device 1300.

[0305] The method disclosed in the above embodiment of the present application can be applied to the processor 1302, or implemented by the processor 1302. The processor 1302 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1302. The above processor 1302 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 1302 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the memory 1303, and the processor 1302 reads the information in the memory 1303, and completes the steps of the above method in combination with its hardware.

[0306] In an exemplary embodiment, the electronic device 1300 can be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to execute the aforementioned method.

[0307] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the video encoding method or the video decoding method described in the above embodiments of the present disclosure.

[0308] An embodiment of the present disclosure further provides a computer program product, including a computer program, which executes the video encoding method or the video decoding method described in the above embodiments of the present disclosure when a processor is used to execute the computer program.

[0309] An embodiment of the present disclosure also proposes a chip, which includes one or more interface circuits and one or more processors; the interface circuit is used to receive signals from a memory of an electronic device and send signals to the processor, the signals include computer instructions stored in the memory, and when the processor executes the computer instructions, the electronic device executes the video encoding method or video decoding method described in the above embodiments of the present disclosure.

[0310] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0311] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0312] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0313] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (control method), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CD ROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.

[0314] It should be understood that the various parts of the embodiments of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0315] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0316] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0317] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A video encoding method, characterized in that: The method comprises: For multiple frames in the original video, determine multiple initial regions in each frame; Determining a change rate of each initial region based on the pixels in the plurality of initial regions; Based on the change rate, determining at least one coding region and a coding strategy corresponding to each coding region; Using the encoding strategy corresponding to each encoding region, video encoding is performed on each encoding region to obtain target data.

2. The method according to claim 1, characterized in that The step of determining a plurality of initial regions in each frame of the original video comprises: Performing initial division on the first picture frame in the original video according to the initial parameters to obtain a plurality of first regions; Based on content features of the plurality of first regions, the plurality of first regions are re-divided to determine a plurality of initial regions in the first picture frame, wherein the content features include boundary features and texture features; Identification information is added to the multiple initial areas, where the identification information includes location information and boundary information.

3. The method according to claim 2, characterized in that The determining the change rate of each initial area based on the pixels in the multiple initial areas comprises: Traversing multiple frames in the original video, and for the multiple initial regions, preprocessing the pixels in each initial region to obtain a grayscale value of each pixel; Based on the grayscale value of each pixel, a change rate of each initial area is determined.

4. The method according to claim 3, characterized in that The determining the change rate of each initial area based on the grayscale value of each pixel includes: Determine a grayscale value difference of a first pixel point in a first initial area of ​​the plurality of initial areas in adjacent frames; Determining an average change value of the first initial area based on the gray value difference and the number of pixels in the first initial area; Continuously acquiring average change values ​​of a preset number of groups of adjacent frame images in the first initial area to obtain a set of average change values ​​in the first initial area; Based on the set of average change values, a rate of change of the first initial area is determined.

5. The method according to claim 4, characterized in that The determining, based on the change rate, at least one coding region and a coding strategy corresponding to each coding region comprises: Determining the at least one coding region according to the change rate of each of the initial regions; Determining the change rate level of each coding region according to the correspondence table between the change rate and the change rate level; According to a preset rule, based on the change rate level of each coding region, the coding strategy of each coding region is determined.

6. The method according to claim 5, characterized in that Determining the change rate level of each coding region according to the correspondence table between the change rate and the change rate level includes any one of the following: When the change rate is greater than a first threshold, the change rate level is determined to be a high level; When the change rate is greater than a second threshold and less than or equal to the first threshold, the change rate level is determined to be a medium level; When the change rate is less than or equal to the second threshold, the change rate level is determined to be a low level, and the first threshold is greater than the second threshold.

7. The method according to claim 5, characterized in that The method further comprises: Determining, according to a coding strategy of a first coding region among the at least one coding region, a coding parameter of the first coding region; Based on the encoding parameter of the first encoding region, the change rate level of the first encoding region, and the encoding requirement, a parameter value of the encoding parameter is determined.

8. The method according to claim 6 or 7, characterized in that: The using the encoding strategy corresponding to each encoding region to perform video encoding on each encoding region includes: For a second picture frame in the multiple picture frames, encoding the second encoding region according to an encoding strategy of a second encoding region in at least one encoding region, to obtain region data corresponding to the second encoding region; According to a first rule, determining a sorting value of the area data corresponding to the second coding area in the second picture frame; Adding the ranking value, the change rate level corresponding to the second coding region, and the coding strategy corresponding to the second coding region to the identification information of the second coding region; The area data of the second coding area is encapsulated with the corresponding identification information.

9. A video decoding method, characterized in that: The method comprises: Acquire target data, wherein the target data is obtained by using the video encoding method as described in claims 1-8, the target data includes regional data of at least one encoding region and corresponding identification information, regional data of at least one non-coding region and corresponding identification information, and the identification information includes at least one of position information, sorting value, boundary information, change rate level, and encoding strategy; The target data is decoded according to the identification information to obtain the original video.

10. The method according to claim 9, characterized in that The decoding process of the target data according to the identification information to obtain the original video includes: Determine a decoding strategy corresponding to each area data according to the encoding strategy of each area data; Using the decoding strategy, decoding the area data corresponding to the decoding strategy to obtain pixel data corresponding to each area data; According to the position information and the sorting value, the pixel data corresponding to each area data is combined to obtain the original video.

11. A video encoding device, characterized in that: include: A partitioning module, for determining a plurality of initial regions in each frame of a plurality of frames in an original video; A first determination module, configured to determine a change rate of each initial area based on the pixels in the plurality of initial areas; A second determination module, configured to determine at least one coding region and a coding strategy corresponding to each coding region based on the change rate; The encoding module is used to use the encoding strategy corresponding to each encoding area to perform video encoding on each encoding area to obtain target data.

12. A video decoding device, characterized in that: include: an acquisition module, configured to acquire target data, wherein the target data is obtained by using the video encoding method as described in claims 1 to 8, wherein the target data includes regional data of at least one encoding region and corresponding identification information, and regional data of at least one non-coding region and corresponding identification information, wherein the identification information includes at least one of position information, sorting value, boundary information, change rate level, and encoding strategy; The decoding module is used to decode the target data according to the identification information to obtain the original video.

13. An electronic device, characterized in that: include: one or more processors; A storage device communicatively connected to the one or more processors, on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1-8 or 9-10.

14. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-8 or 9-10.

15. A chip, characterized in that: It includes one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of an electronic device and send the signal to the processor, the signal includes a computer instruction stored in the memory, and when the processor executes the computer instruction, the electronic device executes the method described in any one of claims 1-8 or 9-10.

Citation Information

Cited By

  • Regional high-efficiency video coding method for mine low-bit-rate video transmission

    CN119520794A

  • Intelligent coding and decoding method and system based on video content in cloud desktop scene

    CN119653089A

  • Video encoding method and apparatus, electronic device, medium, and program product

    WO2026082028A1