AI-based video compression platform

By using an AI-based video compression platform to dynamically adjust encoding levels and resource allocation, the problems of inaccurate identification of key targets and waste of resources in existing technologies are solved, resulting in more efficient video compression and consistent quality.

CN121486583BActive Publication Date: 2026-04-14HUNAN SANLI INFORMATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUNAN SANLI INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-01-12
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing video compression technologies struggle to accurately identify key targets when dealing with complex scenes, leading to reduced compression accuracy. Non-critical areas are treated the same as critical areas, increasing resource consumption and the risk of distortion. Furthermore, the lack of dynamic adjustment capabilities affects the stability of compression results and the consistency of video quality.

Method used

An AI-based video compression platform is used to extract key regions through a key target detection module, divide background and non-background regions, dynamically adjust the encoding level and the number of reference frames, and adjust the compression level in real time to optimize resource allocation and generate high-quality compression results.

Benefits of technology

It achieves dynamic allocation of encoding resources based on accurate content identification, improves the quality of key target retention, reduces redundant data occupation in invalid areas, overcomes problems such as inaccurate target positioning, fixed compression configuration and content response lag, and improves the stability of compression effect and the consistency of video quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121486583B_ABST
    Figure CN121486583B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of video compression, in particular to an AI-based video compression platform, which comprises a key target detection module, an image region division module, an encoding level setting module, a parameter adjustment analysis module and an encoding result integration module.In the application, key region extraction is completed by collecting pixel color combination and contour change information in a video frame image, the boundaries of background and non-background regions are demarcated, and region attribute labeling results are constructed, region distribution classification relationship mapping encoding levels are established, and reference frames and prediction interval configurations are extracted, real-time compression level adjustment is realized by normalizing and combining analysis of texture and motion change trends in different regions, region segments under different compression levels are reorganized and unified code stream processing is carried out, so that the compression process can dynamically allocate encoding resources on the basis of accurate content identification, and problems such as inaccurate target positioning, fixed compression configuration and content response lag in existing compression systems can be effectively overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of video compression technology, and more particularly to an AI-based video compression platform. Background Technology

[0002] Video compression technology primarily involves technologies that use coding algorithms to convert digital video signals into data formats that require less storage space. This includes reducing spatial, temporal, visual, and coding redundancy in video sequences, encompassing a series of systematic processes from raw video data acquisition and preprocessing to transformation, quantization, entropy coding, and finally, bitstream encapsulation and transmission. Traditional video compression systems refer to devices that use a block-based hybrid coding framework to process video data. Addressing the challenges of massive amounts of raw video data with significant correlations, they typically first divide the input video frame images into macroblocks or coding tree units. Then, discrete cosine transform is used to convert image blocks from the pixel domain to the frequency domain to remove spatial correlations. Simultaneously, block matching algorithms are used for motion estimation to calculate motion vectors and motion compensation to predict the differences between the current frame and the reference frame to remove temporal correlations. A quantizer is then used to quantize the transform coefficients, and finally, Huffman coding or arithmetic coding is used to generate a compressed bitstream.

[0003] Existing video compression technologies rely on hybrid coding frameworks for video compression, primarily removing image redundancy through partitioning and discrete cosine transform. In the motion estimation stage, block matching algorithms are used to predict and compensate for inter-frame differences. However, this method suffers from inaccurate target identification in complex scenes, especially in images where background and key targets are difficult to distinguish, which can easily lead to reduced compression accuracy. Furthermore, because this technology fails to differentiate regions based on content attributes, non-critical and critical regions are treated equally, increasing resource consumption and distortion risks during compression. In terms of compression control strategies, it lacks dynamic adjustment capabilities and struggles to adaptively adjust parameters according to changes in image content, thus affecting the stability of the overall compression effect and the consistency of video quality. Summary of the Invention

[0004] The purpose of this invention is to address the shortcomings of existing technologies by proposing an AI-based video compression platform.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: an AI-based video compression platform comprising:

[0006] The key target detection module acquires continuous video frame images, calculates the shape matching degree of each pixel block with the set target type, classifies and numbers pixel blocks whose matching degree exceeds the set recognition benchmark value, marks the effective area, and generates an effective area localization set.

[0007] The image region segmentation module delineates the bounding box indices of non-background and background regions in the video image based on the effective region positioning set, annotates the region attributes of each pixel position in the frame image, counts the pixel ratio of the two types of regions, and establishes a region distribution classification matrix.

[0008] Based on the regional distribution classification matrix, the encoding level setting module extracts the number of reference frames and inter-frame prediction intervals used for different encoding levels and establishes a level mapping to generate a compression level configuration mapping table.

[0009] The parameter adjustment and analysis module configures the mapping table according to the compression level, statistically analyzes the texture change trend of non-background and background regions and the intra-frame motion amplitude in each level, performs combined normalization processing, determines whether it deviates from the level mapped to the current frame, and if a deviation occurs, performs region mapping adjustment and generates a level adjustment step size index table.

[0010] The encoding result integration module adjusts the step size index table according to the level, selects non-background and background region segments under each encoding level for recombination, and sequentially merges the bitstream indexes of all frames to generate AI-based video compression results.

[0011] As a further aspect of the present invention, the regional attribute labeling specifically involves labeling the non-background region as a high-preservation category and labeling the background region as a compression category.

[0012] As a further embodiment of the present invention, the effective region localization set includes a key target label index, a bounding box coordinate set, and a pixel block category identifier; the region distribution classification matrix includes a background region index distribution, a non-background region attribute matrix, and a region category weight; the compression level configuration mapping table includes a mapping relationship between encoding level and region category, reference frame configuration parameters, and inter-frame prediction interval settings; the level adjustment step size index table includes a level deviation correction parameter, a compression step size index adjustment value, and a region level remapping parameter; and the video compression result includes non-background region compressed segments, background region compressed segments, and a unified bitstream index sequence.

[0013] As a further aspect of the present invention, the key target detection module includes:

[0014] The data stream receiving submodule acquires continuous video frame images from the camera, performs pixel-level block division on each frame, collects the combination values ​​of the red, green, and blue color channels of each pixel block, records the relative position number of each pixel block in the image, and generates a pixel block color channel combination matrix.

[0015] The pixel matching calculation submodule extracts the edge contour change gradient value of each region based on the pixel block color channel combination matrix, calculates the shape matching degree between each pixel block and the template by combining the preset target type shape feature template, and filters the numbered blocks with matching degree exceeding the set recognition matching benchmark value to generate a matching target pixel block number set.

[0016] The region coordinate annotation submodule extracts the boundary coordinate region information corresponding to each number based on the matching target pixel block number set, constructs a two-dimensional image coordinate set, and classifies and identifies the effective regions according to the target number. It completes the region positioning annotation in the image frame and generates a set of effective region positioning.

[0017] As a further aspect of the present invention, the image region segmentation module includes:

[0018] The bounding box extraction submodule obtains the effective region location set, takes all the located regions in the frame image as the initial input region, counts the outermost boundary range of each effective region, extracts the coordinate information of the four points of the outer rectangle boundary, and maps and encodes the boundary index number in combination with the original size of the frame image to generate a non-background region boundary index table.

[0019] The region attribute annotation submodule performs coordinate index matching judgment on the position of each pixel in the image frame based on the non-background region boundary index table. According to the matching result, the pixel is classified into two states: inside the boundary or outside the boundary. Pixels inside the boundary are marked as high-preservation category, and pixels outside the boundary are marked as compression category, generating a pixel-level region attribute annotation matrix.

[0020] The region proportion calculation submodule counts the number of pixels in all high-preservation categories and compressed categories based on the pixel-level region attribute annotation matrix, calculates the ratio of the number of pixels in high-preservation categories and compressed categories to the total number of pixels, maps the proportions of the two types of regions into a two-dimensional matrix according to the corresponding frame coordinate structure, and generates a region distribution classification matrix.

[0021] As a further aspect of the present invention, the coding level setting module includes:

[0022] The regional level mapping submodule obtains the regional distribution classification matrix. For the proportion of high-retention areas corresponding to all sub-blocks in the matrix, it determines whether it is greater than the set encoding compression threshold. If the proportion of high-retention areas is greater than the set encoding compression threshold, it is mapped to a low compression level; otherwise, it is mapped to a high compression level. An index mapping is established between the numbers of all sub-blocks and the compression levels to generate a regional encoding level index table.

[0023] The encoding parameter extraction submodule extracts the reference frame number and inter-frame prediction interval of the sub-blocks corresponding to the low compression level and the sub-blocks corresponding to the high compression level based on the regional encoding level index table, and binds each sub-block number with the corresponding encoding parameter set to generate an encoding level parameter configuration table.

[0024] The level configuration establishment submodule organizes the relationship between the set of each encoding level parameter and the spatial region of the frame graph according to the encoding level parameter configuration table, performs compression level index rearrangement and configuration mapping on all region numbers, and outputs the configuration content as a structured mapping record according to the region index to generate a compression level configuration mapping table.

[0025] As a further aspect of the present invention, the parameter adjustment and analysis module includes:

[0026] The texture motion extraction submodule obtains the compression level configuration mapping table, extracts the texture gradient change value and pixel position intra-frame motion displacement value between the current frame and the previous reference frame in all regions of each level, and performs normalization processing and merges them by region to generate region texture motion combination feature value.

[0027] The level deviation judgment submodule compares the current compression level setting parameter of each region with the actual feature value of the current frame based on the region texture motion combination feature value, determines whether the combination feature value deviates from the interval to which the current level parameter belongs, calculates the region level deviation degree, and if it is greater than the set offset index, it is determined to be a level deviation region. All deviation region numbers are filtered to obtain the level deviation region number set.

[0028] The step index adjustment submodule resets the encoding compression step index level for each offset region based on the set of level offset region numbers. If the original level is a low compression level and the offset is an upward offset, the compression step index is incremented by 1; if it is a downward offset, it is decremented by 1. After the index is updated, the corresponding region number, original level, and adjusted index are summarized and recorded to establish a level adjustment step index table.

[0029] As a further aspect of the present invention, the formula for calculating the regional level deviation is as follows:

[0030] ;

[0031] in, Indicates the region Texture change rate, For the corresponding level Mean rate of change of lower texture The standard deviation of the texture change rate. For the region Intra-frame motion amplitude, and For the corresponding level Mean and standard deviation of motion amplitude within the next frame This is an offset indicator.

[0032] As a further aspect of the present invention, the encoding result integration module includes:

[0033] The region segment reconstruction submodule obtains the level adjustment step size index table, performs a rearrangement operation on the non-background region and background region corresponding to the compression level in each frame image, extracts the segments within the region based on the step size index and compression level matching logic, establishes an intra-frame combination mapping structure, and generates a region-level coded segment mapping set.

[0034] The bitstream indexing and sorting submodule, based on the region-level coded segment mapping set, performs sequence number rearrangement processing on the coded segments of different regions in each frame according to the spatial location index and compression level order, constructs an inter-frame reference structure index table, establishes a bitstream continuity index sequence, and generates an inter-frame bitstream order index table.

[0035] The compression output generation submodule performs byte stream packaging operations on the reconstructed regional compression data in all frames according to the inter-frame bitstream order index table, and concatenates them in a unified manner according to the timeline frame order to form an AI-encoded compression output data structure, generating an AI-based video compression result.

[0036] Compared with the prior art, the advantages and positive effects of the present invention are as follows:

[0037] In this invention, key regions are extracted by acquiring pixel color combinations and contour change information in video frame images. Background and non-background region boundaries are delineated and region attribute annotation results are constructed through content recognition. The region distribution classification relationship is established to map the coding level and extract reference frames and prediction interval configurations. The compression level is adjusted in real time by normalizing and combining the texture and motion change trends of different regions. By recombining regional segments under different compression levels and unifying the bitstream processing, the compression process can dynamically allocate coding resources based on accurate content recognition, improve the quality of key target retention, and reduce redundant data occupation in invalid regions. This effectively overcomes problems such as inaccurate target positioning, fixed compression configuration, and slow content response in existing compression systems. Attached Figure Description

[0038] Figure 1 This is a platform flowchart of the present invention;

[0039] Figure 2 This is a flowchart of the key target detection module of the present invention;

[0040] Figure 3 This is a flowchart of the image region segmentation module of the present invention;

[0041] Figure 4 This is a flowchart of the coding level setting module of the present invention;

[0042] Figure 5 This is a flowchart of the parameter adjustment and analysis module of the present invention;

[0043] Figure 6 This is a flowchart of the encoding result integration module of the present invention. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0045] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0046] Please see Figure 1 AI-based video compression platforms include:

[0047] The key target detection module acquires continuous video frame images from the camera, collects the color channel combination and contour change gradient of each pixel in the image, calculates the shape matching degree of each pixel block with the set target type, classifies and numbers pixel blocks whose matching degree exceeds the set recognition benchmark value, extracts the boundary coordinate region and marks the effective region, and generates an effective region localization set.

[0048] The image region segmentation module uses AI visual segmentation logic to delineate the bounding box indices of non-background and background regions in the video image based on the effective region localization set. It then labels the region attributes of each pixel position in the frame image, labeling non-background regions as high-preservation categories and background regions as compression categories. The module also calculates the pixel ratio of the two types of regions in the image and establishes a region distribution classification matrix.

[0049] The coding level setting module is based on the regional distribution classification matrix. It maps the corresponding coding level to low compression level for non-background regions and high compression level for background regions. It extracts the number of reference frames and inter-frame prediction interval used for different coding levels and establishes the level mapping to generate a compression level configuration mapping table.

[0050] The parameter adjustment and analysis module configures the mapping table according to the compression level, statistically analyzes the texture change trend of non-background and background regions and the intra-frame motion amplitude within each level, performs combined normalization processing, determines whether it deviates from the level mapped to the current frame, and if a deviation occurs, it resets the compression step size index level used by the corresponding level and performs regional mapping adjustment, generating a level adjustment step size index table.

[0051] The encoding result integration module adjusts the step size index table according to the level, uses an AI-driven encoding sequence scheduling mechanism to select non-background and background region segments under each encoding level for recombination, and sequentially merges the bitstream indexes of all frames to generate AI-based video compression results.

[0052] The effective region localization set includes key target label index, bounding box coordinate set, and pixel block category identifier. The region distribution classification matrix includes background region index distribution, non-background region attribute matrix, and region category weight. The compression level configuration mapping table includes the mapping relationship between coding level and region category, reference frame configuration parameters, and inter-frame prediction interval setting. The level adjustment step size index table includes level deviation correction parameters, compression step size index adjustment values, and region level remapping parameters. The video compression result includes non-background region compressed segments, background region compressed segments, and unified bitstream index sequence.

[0053] Please see Figure 2 The key target detection module includes:

[0054] The data stream receiving submodule acquires continuous video frame images from the camera, performs pixel-level block division on each frame, collects the combination values ​​of the red, green, and blue color channels of each pixel block, records the relative position number of each pixel block in the image, and generates a pixel block color channel combination matrix.

[0055] To acquire continuous video frames from a camera, continuous dynamic monitoring of the target area is required using an industrial-grade image sensor or embedded image acquisition module. For example, in traffic monitoring scenarios, the camera acquires 30 frames per second at a resolution of 1920×1080. The images are buffered and managed as a frame sequence. Each frame is divided into 32,400 pixel blocks, using 8×8 pixels as the smallest block unit. The color data of each pixel block is extracted using the RGB channels, and the average pixel value across the three channels is obtained. For example, extracting the RGB value from the pixel block in the 5th row and 10th column of the image yields... , , The relative position of the pixels is determined by combining their spatial location. The numbering rule is to accumulate the numbers sequentially from left to right, prioritizing row order, to generate a number set. Each number corresponds to an 8×8 pixel block region, and a three-channel combination vector corresponding to the number is generated. To clarify the data structure, the following method is used to arrange all pixel block data of each frame image into a matrix to construct a color channel combination matrix. If a frame in an image contains 32,400 pixel blocks, then for The matrix represents the average RGB channel value of each pixel block, and this matrix will be used for subsequent contour and feature determination.

[0056] The table below lists the pixel block numbers and their corresponding color channel averages for a selected portion of an image frame:

[0057] Table 1. Mean values ​​of pixel block color channels

[0058]

[0059] As shown in Table 1, the system constructs a color channel combination matrix by extracting the average value of the RGB channels. Each element in this matrix is The triplet structure is used for subsequent calculations such as the matching degree with the target features. In actual implementation, the above data can be obtained by the image decoder in conjunction with the pixel-level mean operation module. Fixed-point representation is used to ensure processing efficiency. The pixel block color channel combination matrix is ​​obtained through the above operations.

[0060] The pixel matching calculation submodule extracts the edge contour change gradient value of each region based on the pixel block color channel combination matrix, combines it with the shape feature template of the preset target type, calculates the shape matching degree between each pixel block and the template, and filters the numbered blocks with matching degree exceeding the set recognition matching benchmark value to generate a set of matching target pixel block numbers.

[0061] Based on the pixel block color channel combination matrix, a contour gradient change rate extraction operation is performed for each pixel block. Combining this with the grayscale differences between adjacent pixel blocks in each frame, edge changes are calculated using the Sobel operator or pixel differencing. For example, for pixel blocks... Let it be related to its neighboring blocks. and The mean gray values ​​are respectively , , The horizontal contour changes as follows The vertical direction changes to contour change gradient Normalize this value to the interval [0, 1], and then normalize it using the maximum gradient value of 255 to obtain... ; Create a set by combining the pixel block number and its gradient value Then call the shape feature template of the preset target type. Each Composed of boundary parameters of a specific shape, for example Given a rectangular structure, its gradient vector is... Calculate the sum of the values ​​of each pixel block and the sum of the values ​​of the pixels. Correlation coefficient between The Pearson correlation coefficient formula is used:

[0062] ;

[0063] in For pixel blocks In the dimensional gradient value, template Feature values ​​in the same dimension and The design calculates the mean values ​​for each. If the matching correlation coefficient identification benchmark is set to 0.75 (this value is set by balancing the false detection rate and accuracy in the sample training set, see the explanation below), then the judgment is... to the pixel block Included in the matching set , which is the set of target pixel block numbers that meet the conditions in this round of recognition; the baseline value of 0.75 is the threshold setting standard for maintaining a false positive rate of less than 10% when recognizing 10 types of target templates in 2000 frames of test set images. It is calculated as follows:

[0064] If the total number of positive target blocks in the sample is 400, and 300 are identified as positive, with 40 being misclassified, then the accuracy is %. The selection of the identification threshold value is gradually increased to The number of false positives was reduced to 20, corresponding to an accuracy of [missing information]. Therefore, this value is used as the optimal identification benchmark value, and through the above calculation, the final set of matching target pixel block numbers is generated.

[0065] The region coordinate annotation submodule extracts the boundary coordinate region information corresponding to each number based on the matching target pixel block number set, constructs a two-dimensional image coordinate set and classifies and identifies the effective regions according to the target number, completes the region positioning annotation in the image frame, and generates a set of effective region positioning.

[0066] Based on the matching target pixel block number set, the boundary coordinate information of each pixel block in the image is extracted. This information comes from the block index number and row-column transformation relationship recorded when the frame image is divided into blocks, such as pixel blocks. The starting coordinates corresponding to the 15th row and 41st column of the image are If the block size is 8×8, then its boundary coordinates are: Extract the boundary coordinates corresponding to all matching numbers in sequence to construct a coordinate set. The blocks in the coordinate set are clustered according to their spatial location in the image. Blocks with a horizontal or vertical distance of less than 16 pixels between adjacent boundaries are grouped into the same region. A disjoint-set data structure algorithm is used for classification, integrating all adjacent matching blocks into target region blocks. Each target region is then numbered. They are labeled according to the number of pixels they contain and their spatial span, such as regions. By block , , , Composed of, the coordinates of its boundary regions after merging are On the original image frame, image regions are drawn using rectangular bounding boxes and labeled with information. The labeled regions are attached to the corresponding target types and are identified using color or text. A key-value mapping table of region locations and target numbers is generated in each image frame. That is, the correspondence between the target number and the spatial region, which ultimately generates a set of valid regional locations.

[0067] Please see Figure 3 The image region segmentation module includes:

[0068] The bounding box extraction submodule obtains the set of effective region locations, takes all the located regions in the frame image as the initial input region, counts the outermost boundary range of each effective region, extracts the coordinate information of the four points of the outer rectangle boundary, and maps and encodes the boundary index number in combination with the original size of the frame image to generate a non-background region boundary index table.

[0069] To obtain the set of border pixels for the effective region, it is necessary to extract the boundary coordinates of the effective region from each image provided by the upper-level module, and then uniformly convert the coordinates into a representation of the top-left and bottom-right corners. For example, let the top-left corner coordinate of the boundary be the left point. The bottom right corner is This coordinate information is obtained by directly extracting the region attribute field from the positioning set, and is ultimately used to construct the boundary index mapping process.

[0070] Next, the rectangular region needs to be traversed row by row from top to bottom and left to right, converting the pixel coordinates within the bounding box in each row into a one-dimensional array index. For example, if the image size is... Then the first In the middle of the line The one-dimensional index of the column pixel is calculated as follows:

[0071] ;

[0072] Therefore, for the rectangular region from row 180 to row 260, the effective pixel index range for each row is:

[0073] Line 180: From the index ;

[0074] Line 260: To index ;

[0075] Since the two indices do not form a contiguous memory block, as they contain pixels outside the bounding boxes of all rows, the correct approach is to work for each row... Valid column range Perform index calculations sequentially, recording the results as a set of index segments:

[0076] ;

[0077] Finally, this index set With the corresponding two-dimensional boundary coordinates It is recorded together as a boundary field, representing the boundary information of this non-background area.

[0078] The region attribute annotation submodule performs coordinate index matching judgment on the position of each pixel in the image frame based on the non-background region boundary index table. According to the matching result, the pixel is classified into two states: inside the boundary or outside the boundary. Pixels inside the boundary are marked as high-preservation category, and pixels outside the boundary are marked as compression category, generating a pixel-level region attribute annotation matrix.

[0079] Read the non-background region boundary index table and perform a determination operation on the spatial position of each pixel in the frame image according to the coordinate range recorded therein. Assume the frame image size is 1920×1080 pixels, and each pixel in the two-dimensional coordinate system... This means iterating through all pixel positions in the image and determining whether each pixel coordinate lies within the boundary of any non-background region, such as a pixel point. Determine whether it satisfies and If the conditions are met, it is marked as a high-preservation category; otherwise, it is marked as a compressed category. This determination result is then written into a two-dimensional annotation matrix of the same size as the original image. Each element corresponds to a pixel in the frame image. The category value is defined as 1 to indicate a highly preserved category and 0 to indicate a compressed category. The efficiency of judgment is improved by constructing a mapping relationship between pixel index and region boundary, avoiding pixel-by-pixel brute-force search calculation. A region hash table structure is used to quickly locate the region number to which the pixel coordinate belongs and map it to the position of the annotation matrix, realizing parallel processing under large-scale image frames, and finally generating a pixel-level region attribute annotation matrix.

[0080] The region proportion calculation submodule counts the number of pixels in all high-preservation categories and compressed categories based on the pixel-level region attribute annotation matrix, calculates the ratio of the number of pixels in high-preservation categories and compressed categories to the total number of pixels, maps the proportions of the two types of regions into a two-dimensional matrix according to the corresponding frame coordinate structure, and generates a region distribution classification matrix.

[0081] Based on the pixel-level region attribute annotation matrix, obtain the total number of pixels marked as high-preservation categories. Number of pixels with compression category Based on the total number of pixels in a frame image Based on this, calculate the percentage of highly retained categories. Compression category proportion If the matrix has 1,560,000 elements with a value of 1, then If the remaining elements are 0, then Further, each frame of the image and Two-dimensional mapping encoding is performed in conjunction with the image coordinate structure. For example, the image is divided into 192 columns horizontally and 108 rows vertically, and a sub-region scale vector is established with each block being 100×100 pixels. After statistical analysis of the pixel label values ​​in each sub-block, normalization encoding is performed. The proportion of the two types of pixels in each sub-block is recorded and arranged in a two-dimensional matrix to form a spatial distribution statistical matrix of each region category in the complete frame image. Finally, a region distribution classification matrix is ​​established.

[0082] Table 2 Pixel Statistics of Sub-Blocks in the Region

[0083]

[0084] As shown in Table 2, the statistical results of pixel categories in different regions of the image show that the proportion of high-preservation pixels in region R2 is 0.91, which belongs to a dense target region. The proportion of high-preservation pixels in region R3 is relatively low, only 0.7. The classification matrix based on the regional distribution can be used for the configuration and classification basis analysis of subsequent coding compression strategies.

[0085] Please see Figure 4 The coding level setting module includes:

[0086] The regional level mapping submodule obtains the regional distribution classification matrix. For the proportion of high-retention areas corresponding to all sub-blocks in the matrix, it determines whether it is greater than the set encoding compression threshold. If the proportion of high-retention areas is greater than the set encoding compression threshold, it is mapped to a low compression level; otherwise, it is mapped to a high compression level. An index mapping is established between the numbers of all sub-blocks and the compression levels to generate a regional encoding level index table.

[0087] After obtaining the regional distribution classification matrix, it is necessary to determine the proportion of highly retained pixels in each sub-block. Perform a step-by-step judgment operation. Suppose the matrix contains several sub-block regions numbered as follows: For each Extract the percentage of high-retention pixels and compare it with the encoding compression threshold of 0.65. If... If so, the sub-block is mapped to a low-compression level region. This corresponds to a high compression level region. The 0.65 threshold here comes from the boundary stability value between image sharpness retention and compression ratio determined in experiments with multiple frame samples. Tests in 500 frames of video showed that at this value, the degree of image information loss was controlled within 5%. The calculation method is as follows: assuming region A has 8640 high-retained pixels and a total of 10000 pixels, then... It meets the low compression level mapping condition, and the mapping level is denoted as . If region B has a height retention of 6200 pixels and a total of 10000 pixels, then The threshold condition is not met, and the mapping level is... All determined regional level information is mapped one-to-one with the corresponding level using a regional number, in the following format: This is used as a basis for selecting subsequent encoding parameters. After judging all sub-blocks in turn, a regional encoding level index table is generated.

[0088] The coding parameter extraction submodule extracts the reference frame number and inter-frame prediction interval of the sub-blocks corresponding to the low compression level and the sub-blocks corresponding to the high compression level based on the regional coding level index table. It then binds each sub-block number with the corresponding coding parameter set to generate a coding level parameter configuration table.

[0089] According to the regional coding level index table, all those marked as low compression level Extracting the preset encoding parameter set from the area code The number of reference frames is set to 3, the inter-frame prediction interval is set to 1, and the frame type order adopts the IBBP structure; for frames marked as high compression level... Region ID Extraction Parameter Set The reference frame count is 1, the inter-frame prediction interval is 3, and the frame type order adopts the IPPP structure. The parameter settings refer to the optimal ratio of compression ratio and reconstruction error obtained experimentally under the H.264 standard configuration. After comparing different configuration combinations in 100 video clips, it was determined that this parameter set has the minimum average frame reconstruction error. For example, region Z101 is a low compression level, and the assigned parameter set is... Region Z102 is a high compression level, and the set of assigned parameters is as follows: Each region number is bound to its corresponding encoding parameter to form a key-value structure, such as... This structure is used to drive the execution of encoding control logic during the encoding period of subsequent image frames. After all regions are configured, an encoding level parameter configuration table is generated.

[0090] The level configuration establishment submodule organizes the relationship between the set of each coding level parameter and the spatial region of the frame graph according to the coding level parameter configuration table, performs compression level index rearrangement and configuration mapping on all region numbers, and outputs the configuration content as a structured mapping record according to the region index to generate a compression level configuration mapping table.

[0091] Based on the coding level parameter configuration table, the coding parameters for each region are organized and merged according to their numerical order, forming a four-element combination of region number, compression level, number of reference frames, and prediction interval. Let the configurations of regions Z201 to Z205 be low, low, high, low, and high, respectively. Then their parameter combinations are Z201: (L1, 3, 1), Z202: (L1, 3, 1), Z203: (L2, 1, 3), etc. This combination structure is then mapped back to the image spatial structure, corresponding to the region location in a two-dimensional matrix structure or list format. All region compression levels are uniformly encoded, and a mapping table entry is constructed. The record format is compression level → parameter set → region number set, as shown in the example below:

[0092] Table 3 Compression Level Configuration Mapping Table

[0093]

[0094] As shown in Table 3, the parameter combination corresponding to level L1 is applied to regions Z201, Z202, and Z204, and the parameter corresponding to level L2 is applied to Z203 and Z205. This structured configuration table will be used for the encoder module parameter input interface. After all the structured content is organized into a character-type or two-dimensional indexed data structure, the output is a compression level configuration mapping table.

[0095] Please see Figure 5 The parameter adjustment and analysis module includes:

[0096] The texture motion extraction submodule obtains the compression level configuration mapping table, extracts the texture gradient change value and pixel position intra-frame motion displacement value between the current frame and the previous reference frame in all regions within each level, and performs normalization processing. After normalizing each type of parameter, it is merged by region to generate region texture motion combination feature value.

[0097] After obtaining the compression level configuration mapping table, texture change extraction and intra-frame motion calculation operations need to be performed on the non-background and background regions corresponding to each compression level in the table. First, extract the difference in pixel grayscale values ​​between the current frame and the previous frame for each region, and calculate the average texture gradient change rate of that region. If a 20-pixel block is taken from region A, and the average difference in grayscale values ​​between the current frame and the reference frame is 18.3, then... Then, the average displacement vector of all pixels in that region within the current frame is calculated. Let the average displacement amplitude be 2.6 pixels, which is the intra-frame motion amplitude. , respectively and Normalization is performed using a maximum scaling method, based on the maximum value of the region set within the compression level. and As the denominator, all regions and Normalize to the [0, 1] interval, and finally divide each region and Combined into binary feature vectors This vector is used to characterize the intensity of local changes and the magnitude of inter-frame displacement for each region under its compression level. Combined with the compression configuration, it can be used to evaluate whether the changes under the current level are reasonable. All region feature vectors are merged to form a structured feature set, as shown in the table below:

[0098] Table 4. Regional Texture and Motion Features

[0099]

[0100] As shown in Table 4, different regions exhibit variations in texture and displacement intensity at the same level. This data will be used for subsequent offset determination, ultimately generating region texture motion combination feature values.

[0101] The compression level deviation judgment submodule compares the current compression level setting parameter of each region with the actual feature value of the current frame based on the region texture motion combination feature value, and determines whether the combined feature value deviates from the range to which the current level parameter belongs, using the formula:

[0102] ;

[0103] The calculation obtains the regional level deviation. If it exceeds a set deviation index, it is determined to be a level deviation region. All deviation region numbers are then filtered to obtain a set of level deviation region numbers. Indicates the region Texture change rate, For the corresponding level Mean rate of change of lower texture The standard deviation of the texture change rate. For the region Intra-frame motion amplitude, and For the corresponding level Mean and standard deviation of motion amplitude within the next frame This is an offset indicator;

[0104] By combining the feature values ​​of regional texture motion, the compression level of each region is compared with the reference standard under the current compression level setting parameters to extract the level. Mean rate of change of reference texture with standard deviation Mean of intra-frame motion amplitude with standard deviation For each region of and Calculate the normalized distance between it and the current level mean, and use the formula to calculate the comprehensive offset. Let region A be... , , Then its texture offset value is The corresponding intra-frame motion amplitude is 2.6, with a mean of 1.8 and a standard deviation of 0.6. Therefore, the motion offset is... The merged offset is Since the offset value is greater than the offset judgment threshold of 1.5, the coding level of the area is determined to be off, and it is recorded in the offset area number set. This judgment logic uses the confidence range boundary set by empirical data to ensure that most areas are not judged to be off within 95% of the range. Through the above screening process, the grade offset area number set is obtained.

[0105] formula The operation logic lies in calculating the current region Texture change rate With its compression level Texture mean The difference between the standard deviations is normalized to obtain the degree of texture offset, and the intra-frame motion amplitude in this region is also calculated. Relative to the average level The normalized deviation value is used to obtain the degree of motion offset. Both offset values ​​are calculated using... and Standardization is performed to ensure that fluctuations caused by different data scales across different regions or levels have a uniform evaluation scale. Then, the two absolute offsets are summed to consider texture features and motion features as two independent but equally weighted influencing factors, constituting the overall "deviation degree" of the region under the current level configuration. This allows for evaluation through a single indicator. To measure whether the region deviates from the existing compression level configuration, the method of addition rather than sum of squares or square roots is used. This aims to avoid a nonlinear amplification of the total by a certain maximum value and to maintain the linear interpretability of each contribution in the deviation judgment.

[0106] Grade deviation Indicates the current image region Under a given compression level configuration, the degree to which the texture change rate and intra-frame motion amplitude deviate from the statistical mean of that level reflects whether the region still fits the currently set compression level in terms of visual complexity and dynamic change characteristics. A smaller value indicates that the texture and motion features of the region are within the statistically stable range of the current level, the compression configuration is reasonable, and no adjustment is needed; if... A large value indicates that the region has undergone drastic texture or motion changes in the current frame that are inconsistent with its class level, indicating a class mismatch. It is necessary to consider resetting the compression step size index level. Therefore, this indicator serves as a quantitative basis for the region class adaptability and is used to drive the dynamic update of encoding parameters and the region class adjustment logic.

[0107] The step index adjustment submodule resets the encoding compression step index level for each offset region based on the set of level offset region numbers. If the original level is a low compression level and the offset is an upward offset, the compression step index is incremented by 1. If it is a downward offset, the index is decremented by 1. The index range is limited to [1, 5]. After the update, the corresponding region number, original level, and adjusted index are summarized and recorded to establish a level adjustment step index table.

[0108] Based on the set of level offset region numbers, perform step index level adjustment operations on all regions with level offsets, setting the step index range for the current compression level to 1 to 5. First, extract the original index for each offset region. Then determine its offset direction, if and If so, it is determined to be an upward offset, and the step index is adjusted upward by one level, that is... Conversely, if both are below the mean, it's a downward offset, and the index is adjusted down one level. Index changes are limited by boundary conditions. If the original step size index of region Z1 is 3, and it is determined to be an upward offset, then... The adjusted index results are bound to the original region number and level combination and recorded as follows. After all regions have been adjusted, a level adjustment step size index table is generated.

[0109] Please see Figure 6 The encoding result integration module includes:

[0110] The region segment reconstruction submodule obtains the level adjustment step size index table, performs a rearrangement operation on the non-background region and background region corresponding to the compression level in each frame image, extracts the segments within the region based on the step size index and compression level matching logic, establishes an intra-frame combination mapping structure, and generates a region-level coded segment mapping set.

[0111] After obtaining the level adjustment step size index table, a matching operation is performed on the corresponding region information in each frame image. First, three parameters are extracted for each region: compression level, non-background or background attribute, and adjusted step size index level. A mapping relationship is established by combining these parameters with their spatial coordinate indices in the frame image. Then, the regions are grouped according to the compression level. The target region number is extracted by prioritizing non-background regions and associated with its frame number and encoding parameter configuration. Subsequently, the region number set in all frames is traversed, and the region segments under different levels are separated according to the step size index. Reorganization is performed. For example, in frame number F001, regions Z01 and Z02 correspond to low compression levels, with a segment duration of 0.04 seconds and corresponding indices [P101, P104]. Meanwhile, background region Z03 corresponds to high compression levels, with segments [P120, P124]. Therefore, the segment combination order in this frame is [P101, P104, P120, P124], forming a frame-level region rearrangement structure. After this reorganization operation is performed on all frames sequentially, the index structure and compression level information of each frame's reorganized regions are recorded. A specific example is as follows:

[0112] Table 5. Index of Regional Recombination Fragments

[0113]

[0114] As shown in Table 5, regional segments under different compression levels are merged and reordered according to the step index, providing a structural basis for subsequent frame-level splicing and compression scheduling, and finally generating a regional-level coded segment mapping set.

[0115] The bitstream indexing and sorting submodule, based on the region-level coded segment mapping set, performs sequence number rearrangement processing on the coded segments of different regions in each frame according to the spatial location index and compression level order, constructs an inter-frame reference structure index table, establishes a bitstream continuity index sequence, and generates an inter-frame bitstream order index table.

[0116] Based on the regional-level coded segment mapping set, an indexing and sorting operation is performed on the segment data in each frame. First, the segments in each frame are arranged according to the recombination order index to construct a local intra-frame compression sequence structure. Then, sequential merging is performed at the inter-frame dimension. A sequence frame linked list structure is established based on each frame number and its corresponding timestamp, recording the start position and length information of the compressed data between each frame. Next, the reference order structure of all frames is numbered. If frame F001 is a key frame, its corresponding lower-level frames are F002 and F003. Then, a reference index relationship with the structure F001→F002→F003 is constructed, and the data position of each segment is written into the bitstream order table. A complete index set is constructed for each frame, such as a mapping table of frame number → start position → number of segments → reference frame number. All content is organized into a linear structure to ensure that the inter-frame relationship chain can be directly read during subsequent compression and splicing. Finally, an inter-frame bitstream order index table is generated.

[0117] The compression output generation submodule performs byte stream packaging operations on the reconstructed regional compression data in all frames according to the inter-frame bitstream order index table, and concatenates them in a unified manner according to the timeline frame order to form an AI-encoded compression output data structure, generating AI-based video compression results.

[0118] Based on the inter-frame bitstream sequence index table, the segment data in each frame is uniformly packaged, the recombined regional segment index structure is extracted, and the compressed byte data corresponding to each segment number is concatenated and assembled in ascending order of frame number to form a complete frame data packet. Then, inter-frame merging is performed according to the reference index order. A data buffer management mechanism is used to input the data structure of all frames into the encoding output buffer list. The frame-level data structure is then written to the output stream buffer file frame by frame, and the corresponding frame number, total byte length and compression index code information are recorded. Finally, the data of all frames are concatenated to form a continuous video bitstream structure, and a mapping table between frame number and compressed byte segment is established. The output is a unified compression encapsulation format, and finally, an AI-based video compression result is generated.

[0119] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. An AI-based video compression platform, characterized in that, include: The key target detection module acquires continuous video frame images, calculates the shape matching degree of each pixel block with the set target type, classifies and numbers pixel blocks whose matching degree exceeds the set recognition benchmark value, marks the effective area, and generates an effective area localization set. The image region segmentation module, based on the effective region localization set and combined with AI visual segmentation logic, delineates the bounding box indices of non-background and background regions in the video image, annotates the region attributes of each pixel position in the frame image, counts the pixel ratio of the two types of regions, and establishes a region distribution classification matrix. Specifically, the region attribute labeling involves labeling the non-background region as a high-preservation category and labeling the background region as a compression category. Based on the regional distribution classification matrix, the encoding level setting module extracts the number of reference frames and inter-frame prediction intervals used for different encoding levels and establishes a level mapping to generate a compression level configuration mapping table. The coding level setting module includes: The regional level mapping submodule obtains the regional distribution classification matrix. For the proportion of high-retention areas corresponding to all sub-blocks in the matrix, it determines whether it is greater than the set encoding compression threshold. If the proportion of high-retention areas is greater than the set encoding compression threshold, it is mapped to a low compression level; otherwise, it is mapped to a high compression level. An index mapping is established between the numbers of all sub-blocks and the compression levels to generate a regional encoding level index table. The encoding parameter extraction submodule extracts the reference frame number and inter-frame prediction interval of the sub-blocks corresponding to the low compression level and the sub-blocks corresponding to the high compression level based on the regional encoding level index table, and binds each sub-block number with the corresponding encoding parameter set to generate an encoding level parameter configuration table. The level configuration establishment submodule organizes the relationship between the set of each encoding level parameter and the position of the frame graph space region according to the encoding level parameter configuration table, performs compression level index rearrangement and configuration mapping on all region numbers, and outputs the configuration content as a structured mapping record according to the region index to generate a compression level configuration mapping table. The parameter adjustment and analysis module configures the mapping table according to the compression level, and performs combined normalization processing on the texture change trend and intra-frame motion amplitude of the non-background and background regions within each level. It compares the current compression level setting parameter of each region with the actual feature value of the current frame to determine whether it deviates from the level mapped to the current frame. It resets the encoding compression step index level for each offset region. If the original level is a low compression level and the offset is an upward offset, the compression step index is incremented by 1. If it is a downward offset, it is decremented by 1. After the index is updated, the corresponding region number, original level, and adjusted index are summarized and recorded to generate a level adjustment step index table. The encoding result integration module adjusts the step size index table according to the level, selects non-background and background region segments under each encoding level for recombination, performs sequence number rearrangement processing on the encoded segments of different regions in each frame according to the spatial location index and compression level order, performs byte stream packing operation on the reconstructed region compression data in all frames and concatenates them to generate AI-based video compression results.

2. The AI-based video compression platform according to claim 1, characterized in that: The effective region localization set includes a key target label index, a bounding box coordinate set, and a pixel block category identifier. The region distribution classification matrix includes a background region index distribution, a non-background region attribute matrix, and a region category weight. The compression level configuration mapping table includes a mapping relationship between encoding level and region category, reference frame configuration parameters, and inter-frame prediction interval settings. The level adjustment step size index table includes level deviation correction parameters, compression step size index adjustment values, and region level remapping parameters. The video compression result includes non-background region compressed segments, background region compressed segments, and a unified bitstream index sequence.

3. The AI-based video compression platform according to claim 1, characterized in that, The key target detection module includes: The data stream receiving submodule acquires continuous video frame images, performs pixel-level block operation on each frame image, collects the combination values ​​of the red, green and blue color channels of each pixel block, records the relative position number of each pixel block in the image, and generates a pixel block color channel combination matrix. The pixel matching calculation submodule extracts the edge contour change gradient value of each region based on the pixel block color channel combination matrix, calculates the shape matching degree between each pixel block and the template by combining the preset target type shape feature template, and filters the numbered blocks with matching degree exceeding the set recognition matching benchmark value to generate a matching target pixel block number set. The region coordinate annotation submodule extracts the boundary coordinate region information corresponding to each number based on the matching target pixel block number set, constructs a two-dimensional image coordinate set, and classifies and identifies the effective regions according to the target number. It completes the region positioning annotation in the image frame and generates a set of effective region positioning.

4. The AI-based video compression platform according to claim 1, characterized in that, The image region segmentation module includes: The bounding box extraction submodule obtains the effective region location set, takes all the located regions in the frame image as the initial input region, counts the outermost boundary range of each effective region, extracts the coordinate information of the four points of the outer rectangle boundary, and maps and encodes the boundary index number in combination with the original size of the frame image to generate a non-background region boundary index table containing boundary coordinate information. The region attribute annotation submodule performs coordinate index matching judgment on the non-background region boundary index table containing boundary coordinate information for each pixel position in the image frame. Based on the matching result, the pixel is classified into two states: inside the boundary or outside the boundary. Pixels inside the boundary are marked as high-preservation category, and pixels outside the boundary are marked as compression category, generating a pixel-level region attribute annotation matrix. The region proportion calculation submodule counts the number of pixels in all high-preservation categories and compressed categories based on the pixel-level region attribute annotation matrix, calculates the ratio of the number of pixels in high-preservation categories and compressed categories to the total number of pixels, maps the proportions of the two types of regions into a two-dimensional matrix according to the corresponding frame coordinate structure, and generates a region distribution classification matrix.

5. The AI-based video compression platform according to claim 1, characterized in that, The coding level setting module includes: The regional level mapping submodule obtains the regional distribution classification matrix. For the proportion of high-retention areas corresponding to all sub-blocks in the matrix, it determines whether it is greater than the set encoding compression threshold. If the proportion of high-retention areas is greater than the set encoding compression threshold, it is mapped to a low compression level; otherwise, it is mapped to a high compression level. An index mapping is established between the numbers of all sub-blocks and the compression levels to generate a regional encoding level index table. The encoding parameter extraction submodule extracts the reference frame number and inter-frame prediction interval of the sub-blocks corresponding to the low compression level and the sub-blocks corresponding to the high compression level based on the regional encoding level index table, and binds each sub-block number with the corresponding encoding parameter set to generate an encoding level parameter configuration table. The level configuration establishment submodule organizes the relationship between the set of each encoding level parameter and the spatial region of the frame graph according to the encoding level parameter configuration table, performs compression level index rearrangement and configuration mapping on all region numbers, and outputs the configuration content as a structured mapping record according to the region index to generate a compression level configuration mapping table.

6. The AI-based video compression platform according to claim 1, characterized in that, The parameter adjustment and analysis module includes: The texture motion extraction submodule obtains the compression level configuration mapping table, extracts the texture gradient change value and pixel position intra-frame motion displacement value between the current frame and the previous reference frame in all regions of each level, and performs normalization processing and merges them by region to generate region texture motion combination feature value. The level deviation judgment submodule compares the current compression level setting parameter of each region with the actual feature value of the current frame based on the region texture motion combination feature value, determines whether the combination feature value deviates from the interval to which the current level parameter belongs, calculates the region level deviation degree, and if it is greater than the set offset index, it is determined to be a level deviation region. All deviation region numbers are filtered to obtain the level deviation region number set. The step index adjustment submodule resets the encoding compression step index level for each offset region based on the set of level offset region numbers. If the original level is a low compression level and the offset is an upward offset, the compression step index is incremented by 1; if it is a downward offset, it is decremented by 1. After the index is updated, the corresponding region number, original level, and adjusted index are summarized and recorded to establish a level adjustment step index table.

7. The AI-based video compression platform according to claim 6, characterized in that, The formula for calculating the deviation of the regional level is: ; in, Indicates the region Texture change rate, For the corresponding level Mean rate of change of lower texture The standard deviation of the texture change rate. For the region Intra-frame motion amplitude, and For the corresponding level Mean and standard deviation of motion amplitude within the next frame This is an offset indicator.

8. The AI-based video compression platform according to claim 1, characterized in that, The encoding result integration module includes: The region segment reconstruction submodule obtains the level adjustment step size index table, performs a rearrangement operation on the non-background region and background region corresponding to the compression level in each frame image, extracts the segments within the region based on the step size index and compression level matching logic, establishes an intra-frame combination mapping structure, and generates a region-level coded segment mapping set. The bitstream indexing and sorting submodule, based on the region-level coded segment mapping set, performs sequence number rearrangement processing on the coded segments of different regions in each frame according to the spatial location index and compression level order, constructs an inter-frame reference structure index table, establishes a bitstream continuity index sequence, and generates an inter-frame bitstream order index table. The compression output generation submodule performs byte stream packaging operations on the reconstructed regional compression data in all frames according to the inter-frame bitstream order index table, and concatenates them in a unified manner according to the timeline frame order to form an AI-encoded compression output data structure, generating an AI-based video compression result.

Citation Information

Patent Citations

  • Narrowband high-definition video compression method based on AI target tracking

    CN114979653A

  • Real-time video image compression method based on deep learning

    CN120786078A