US12568236B2ActiveUtilityA1

Video compression method and apparatus, computer device, and storage medium

44
Assignee: TENCENT TECH SHENZHEN CO LTDPriority: Nov 10, 2021Filed: Aug 17, 2023Granted: Mar 3, 2026
Est. expiryNov 10, 2041(~15.3 yrs left)· nominal 20-yr term from priority
H04N 19/463H04N 19/177H04N 19/176H04N 19/172H04N 19/137H04N 19/119H04N 19/103H04N 19/436
44
PatentIndex Score
0
Cited by
25
References
20
Claims

Abstract

A video compression method includes: acquiring a video to be compressed; determining encoding parameters respectively corresponding to a plurality of image frames in the video; and compressing the video based on the encoding parameters respectively corresponding to the plurality of image frames in the video. Determining encoding parameters respectively corresponding to a plurality of image frames in the video includes: for an image frame of a plurality of image frames: performing adaptive mapping on the image frame based on a differential feature of the image frame relative to a corresponding reference frame, to obtain a mapping result; determining a parallel processing condition corresponding to the image frame according to the mapping result; performing, in response to that a hierarchical feature of the image frame satisfies the parallel processing condition, parallel compression analysis on image encoding units in the image frame to obtain an encoding parameter for the image frame.

Claims

exact text as granted — not AI-modified
What is claimed is: 
     
         1 . A video compression method, performed by a computer device and comprising:
 acquiring a video to be compressed;   determining encoding parameters respectively corresponding to a plurality of image frames in the video, comprising: for an image frame of a plurality of image frames:
 determining an adaptive mapping parameter and a result limit range, the result limit range being obtained based on a picture group feature of a group of pictures to which the image frame belongs; 
 performing adaptive mapping on the image frame based on a differential feature of the image frame relative to a corresponding reference frame according to the adaptive mapping parameter, to obtain a differential feature mapping result; 
 adjusting the differential feature mapping result based on the result limit range to obtain a mapping result within the result limit range; 
 determining a parallel processing condition corresponding to the image frame according to the mapping result; and 
 performing, in response to that a hierarchical feature of the image frame satisfies the parallel processing condition, parallel compression analysis on image encoding units in the image frame to obtain an encoding parameter for the image frame, the image encoding units being obtained by performing unit division on the image frame; and 
   compressing the video based on the encoding parameters respectively corresponding to the plurality of image frames in the video.   
     
     
         2 . The method according to  claim 1 , wherein determining the parallel processing condition corresponding to the image frame according to the mapping result comprises:
 determining a parallel processing threshold according to the mapping result, and generating the parallel processing condition corresponding to the image frame based on the parallel processing threshold.   
     
     
         3 . The method according to  claim 1 , wherein the differential feature comprises a motion feature and a residual feature; the adaptive mapping parameter comprises a motion feature mapping parameter and a residual feature mapping parameter; and
 the performing adaptive mapping on the differential feature of the image frame relative to the corresponding reference frame according to the adaptive mapping parameter to obtain a differential feature mapping result comprises:
 performing adaptive mapping on the motion feature according to the motion feature mapping parameter to obtain a motion feature mapping result; 
 performing adaptive mapping on the residual feature according to the residual feature mapping parameter to obtain a residual feature mapping result; and 
 obtaining the differential feature mapping result based on the motion feature mapping result and the residual feature mapping result. 
   
     
     
         4 . The method according to  claim 1 , wherein the performing, in response to that a hierarchical feature of the image frame satisfies the parallel processing condition, parallel compression analysis on image encoding units in the image frame to obtain an encoding parameter for the image frame comprises:
 determining image encoding units in the image frame in response to that an image depth of the image frame is greater than a parallel processing threshold; and   performing parallel compression analysis on the image encoding units by a wavefront parallel processing method, and obtaining an encoding parameter for the image frame according to analysis results respectively corresponding to the image encoding units.   
     
     
         5 . The method according to  claim 4 , wherein the image encoding units in the image frame are arranged in rows; and the performing parallel compression analysis on the image encoding units, and obtaining an encoding parameter for the image frame according to analysis results respectively corresponding to the image encoding units comprises:
 performing parallel residual analysis on the image encoding units to obtain residual parameters respectively corresponding to the image encoding units;   correcting a residual parameter of a first image encoding unit in response to that a residual parameter of the first image encoding unit in the image encoding units satisfies a residual correction condition, to obtain a corrected residual parameter, the first image encoding unit being a first image encoding unit in one row of the image encoding units;   obtaining an analysis result corresponding to the first image encoding unit based on the corrected residual parameter; and   obtaining an encoding parameter for the image frame according to analysis results respectively corresponding to the image encoding units.   
     
     
         6 . The method according to  claim 5 , wherein the correcting a residual parameter of the first image encoding unit in response to that the residual parameter of the first image encoding unit in the image encoding units satisfies a residual correction condition comprises:
 adjusting the residual parameter of the first image encoding unit to have a non-zero numerical value in response to that a numerical value of the residual parameter of the first image encoding unit in the image encoding units is zero.   
     
     
         7 . The method according to  claim 1 , wherein the compressing the video based on the encoding parameters respectively corresponding to the image frames in the video comprises:
 compressing the corresponding image frames by a non-wavefront parallel processing method based on the encoding parameters respectively corresponding to the plurality of image frames, to obtain encoding results respectively corresponding to the plurality of image frames; and   compressing the video based on the encoding results respectively corresponding to the plurality of image frames.   
     
     
         8 . The method according to  claim 1 , further comprising: for an image frame of a plurality of image frames:
 determining image size information of the image frame; and   performing, in response to that the image size information and a compression resource satisfy a parallel initiation condition, the operation of performing adaptive mapping on the image frame in the video based on a differential feature of the image frame relative to a corresponding reference frame.   
     
     
         9 . The method according to  claim 8 , further comprising:
 compressing the video by a parallel method in response to that the image size information and the compression resource do not satisfy the parallel initiation condition, the parallel method comprising at least one of: slice-level parallelism, tile-level parallelism, or frame-level parallelism.   
     
     
         10 . The method according to  claim 1 , further comprising:
 determining a group of pictures to which the image frame belongs in the video;   determining a hierarchical feature of the image frame and a reference frame corresponding to the image frame based on the group of pictures; and   performing differential analysis on the image frame and the reference frame to obtain a differential feature of the image frame relative to the reference frame.   
     
     
         11 . The method according to  claim 10 , wherein the determining a hierarchical feature of the image frame and a reference frame corresponding to the image frame based on the group of pictures comprises:
 determining a picture group feature of the group of pictures; and   determining a hierarchical feature of the image frame and a reference frame corresponding to the image frame based on a picture group reference relationship in the picture group feature.   
     
     
         12 . The method according to  claim 10 , wherein the performing differential analysis on the image frame and the reference frame to obtain a differential feature of the image frame relative to the reference frame comprises:
 determining matching image blocks respectively corresponding to original image blocks in the image frame from the reference frame;   obtaining motion information respectively corresponding to the original image blocks according to positions of the original image blocks and positions of the corresponding matching image blocks; and   obtaining a motion feature of the image frame relative to the reference frame based on the motion information respectively corresponding to original image blocks.   
     
     
         13 . The method according to  claim 12 , wherein the motion information comprises first displacements of the original image blocks in the image frame in an image width direction, and second displacements of the original image blocks in the image frame in an image height direction; and the obtaining a motion feature of the image frame relative to the reference frame based on the motion information respectively corresponding to the original image blocks comprises:
 performing summation on the first displacements of the original image blocks, and obtaining a first displacement ratio based on a ratio of the obtained first displacement sum to an image width of the image frame;   performing summation on the second displacements of the original image blocks, and obtaining a second displacement ratio based on a ratio of the obtained second displacement sum to an image height of the image frame;   obtaining an intermediate motion feature according to a ratio of a displacement ratio sum of the first displacement ratio and the second displacement ratio to a quantity of original image blocks; and   obtaining a motion feature of the image frame relative to the reference frame according to a ratio of the intermediate motion feature to an image distance, the image distance comprising a distance between the reference frame and the image frame.   
     
     
         14 . The method according to  claim 8 , wherein the performing differential analysis on the image frame and the reference frame to obtain a differential feature of the image frame relative to the reference frame comprises:
 determining matching image blocks respectively corresponding to original image blocks in the image frame from the reference frame;   obtaining residual information respectively corresponding to the original image blocks according to pixels of the original image blocks and pixels of the corresponding matching image blocks; and   obtaining a residual feature of the image frame relative to the reference frame based on the residual information respectively corresponding to the original image blocks and a quantity of original image blocks.   
     
     
         15 . The method according to  claim 14 , wherein the residual information comprises pixel residual absolute values of the original image blocks, and a pixel residual absolute value of an original image block is obtained according to pixel differences between the pixels in the original image block and a corresponding matching image block; and the obtaining a residual feature of the image frame relative to the reference frame based on the residual information respectively corresponding to the original image blocks and a quantity of original image blocks comprises:
 performing summation on the pixel residual absolute values of the original image blocks to obtain a sum of absolute differences of residuals; and   obtaining a residual feature of the image frame relative to the reference frame according to a ratio of the sum of absolute differences of residuals to the quantity of original image blocks.   
     
     
         16 . The method according to  claim 1 , further comprising:
 performing, in response to that the hierarchical feature of the image frame does not satisfy the parallel processing condition, compression analysis on the image frame by a non-wavefront parallel processing method to obtain an encoding parameter for the image frame.   
     
     
         17 . A video compression apparatus, comprising:
 at least one memory and at least one processor, the at least one memory storing a computer-readable instruction that, when executed by the at least one processor, implements:   acquiring a video to be compressed;   determining encoding parameters respectively corresponding to a plurality of image frames in the video, comprising: for an image frame of a plurality of image frames:
 determining an adaptive mapping parameter and a result limit range, the result limit range being obtained based on a picture group feature of a group of pictures to which the image frame belongs; 
 performing adaptive mapping on the image frame based on a differential feature of the image frame relative to a corresponding reference frame according to the adaptive mapping parameter, to obtain a differential feature mapping result; 
 adjusting the differential feature mapping result based on the result limit range to obtain a mapping result within the result limit range; 
 determining a parallel processing condition corresponding to the image frame according to the mapping result; and 
 performing, in response to that a hierarchical feature of the image frame satisfies the parallel processing condition, parallel compression analysis on image encoding units in the image frame to obtain an encoding parameter for the image frame, the image encoding units being obtained by performing unit division on the image frame; and 
   compressing the video based on the encoding parameters respectively corresponding to the plurality of image frames in the video.   
     
     
         18 . The apparatus according to  claim 17 , wherein determining the parallel processing condition corresponding to the image frame according to the mapping result comprises:
 determining a parallel processing threshold according to the mapping result, and generating the parallel processing condition corresponding to the image frame based on the parallel processing threshold.   
     
     
         19 . The apparatus according to  claim 17 , wherein the differential feature comprises a motion feature and a residual feature; the adaptive mapping parameter comprises a motion feature mapping parameter and a residual feature mapping parameter; and
 the performing adaptive mapping on the differential feature of the image frame relative to the corresponding reference frame according to the adaptive mapping parameter to obtain a differential feature mapping result comprises:
 performing adaptive mapping on the motion feature according to the motion feature mapping parameter to obtain a motion feature mapping result; 
 performing adaptive mapping on the residual feature according to the residual feature mapping parameter to obtain a residual feature mapping result; and 
 obtaining the differential feature mapping result based on the motion feature mapping result and the residual feature mapping result. 
   
     
     
         20 . A non-transitory computer-readable storage medium, storing a computer-readable instruction that, when executed by at least one processor, causing the at least one processor to perform:
 acquiring a video to be compressed;   determining encoding parameters respectively corresponding to a plurality of image frames in the video, comprising: for an image frame of a plurality of image frames:
 determining an adaptive mapping parameter and a result limit range, the result limit range being obtained based on a picture group feature of a group of pictures to which the image frame belongs; 
 performing adaptive mapping on the image frame based on a differential feature of the image frame relative to a corresponding reference frame according to the adaptive mapping parameter, to obtain a differential feature mapping result; 
 adjusting the differential feature mapping result based on the result limit range to obtain a mapping result within the result limit range; 
 determining a parallel processing condition corresponding to the image frame according to the mapping result; and 
 performing, in response to that a hierarchical feature of the image frame satisfies the parallel processing condition, parallel compression analysis on image encoding units in the image frame to obtain an encoding parameter for the image frame, the image encoding units being obtained by performing unit division on the image frame; and 
   compressing the video based on the encoding parameters respectively corresponding to the plurality of image frames in the video.

Cited by (0)

No later patents cite this yet.

References (0)

No backward citations on record.