Low-bit-rate video coding method based on sparse representation
By introducing a sparse representation-based method in video encoding, using dictionary learning and gradient sparseness algorithms, the representation and decoding process of video signals is optimized, and the problems of low video encoding efficiency and poor quality at low bit rate are solved, and efficient compression and high-quality reconstruction are achieved.
Patent Information
- Application Number
- CN202411702911.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-26
AI Technical Summary
The prior art has low video encoding efficiency, poor video quality and insufficient sparse data processing capabilities under low bit rate conditions, making it difficult to effectively remove non-redundant information in video signals, especially in complex textures and motion scenarios.
Using a low-bit rate video encoding method based on sparse representation, the video frame is processed through dictionary learning algorithm and a sparse representation algorithm with gradient sparseness to obtain sparse representation coefficients, and quantization and entropy encoding are performed. The decoding end reconstructs the same sparse representation model and adaptive dictionary, combining the refined processing of block merging and frame merging to improve encoding efficiency and video quality.
Under low bit rate conditions, the video compression efficiency is significantly improved, high-quality video reconstruction is maintained, and the problems of low encoding efficiency, poor video quality and insufficient sparse data processing capabilities are solved.
Smart Images

Figure CN119520808A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video encoding, and in particular to a low bit rate video encoding method based on sparse representation. Background Art
[0002] With the development of digital video technology, the demand for video data storage and transmission is increasing. Traditional video coding standards, such as H.264 and H.265 (HEVC), achieve high compression efficiency by removing redundant information and utilizing spatiotemporal correlation. However, with the popularity of HD, UHD and video streaming applications, how to maintain high-quality video coding under low bit rate conditions has become an important research topic.
[0003] Existing video coding technologies mainly rely on methods such as transform coding, quantization and entropy coding, which have a trade-off between compressing the bit rate and maintaining video quality. Under low bit rate conditions, traditional coding methods often lead to a significant decrease in video quality, with artifacts such as mosaics, blurs, and block effects. This is because traditional coding technologies are difficult to effectively remove non-redundant information in video signals while reducing the bit rate, especially in complex texture and motion scenes, where the coding efficiency is significantly reduced.
[0004] Traditional low-bitrate video coding techniques usually rely on block-based transform coding, such as discrete cosine transform (DCT) and wavelet transform. The core idea of these techniques is to convert video signals into frequency domain or other transform domains so that redundant information can be removed more easily. However, in complex scenes, these transforms often cannot effectively represent the detailed features in the video signal, resulting in a decrease in the quality of the encoded video. In addition, traditional coding techniques rely on motion estimation and compensation techniques when processing motion information. The performance of these methods is also unsatisfactory under low bitrate conditions, especially when dealing with fast motion and complex scenes, which are prone to distortion and artifacts.
[0005] In the prior art, there is also a method based on predictive coding, which reduces the amount of data to be encoded by predicting the current frame. However, at low bit rates, the prediction error is large, resulting in the inability to effectively compress the residual signal, which in turn affects the overall quality of the video. In addition, the existing entropy coding method has low compression efficiency when processing sparse data, which is one of the reasons why video quality is difficult to ensure at low bit rates.
[0006] In summary, the existing technology has the problems of low coding efficiency, poor video quality and insufficient sparse data processing capability in low bit rate video coding. Summary of the invention
[0007] In view of the deficiencies in the prior art, the present invention provides a low-bit-rate video encoding method based on sparse representation, which solves the problems in the prior art.
[0008] According to an embodiment of the present invention, a low bit rate video encoding method based on sparse representation comprises the following steps:
[0009] S1: After the encoder obtains the input video, it performs frame segmentation sampling on the input video to obtain a video frame sequence, and performs block segmentation on the elements in the video frame sequence to obtain an image block sequence;
[0010] S2: A sparse representation algorithm based on a dictionary learning algorithm and gradient sparsity processes the elements in the image block sequence to obtain sparse representation coefficients;
[0011] S3: quantize and entropy encode the sparse representation system in sequence to obtain a compressed bit stream and store and transmit it;
[0012] S4: Obtain the compressed bit stream, perform entropy decoding and inverse quantization on the bit stream in sequence, and obtain the original sparse representation coefficients;
[0013] S5: The original sparse representation coefficients are processed by a sparse decoding algorithm based on a dictionary learning algorithm and gradient sparsity to obtain a reconstructed image block;
[0014] S6: merging several reconstructed image blocks to obtain a reconstructed video frame;
[0015] S7: Merge several reconstructed video frames to obtain a reconstructed input video.
[0016] As an embodiment of the present invention, step S1 includes:
[0017] S11: Obtain an input video, and divide the input video into an input video frame sequence V = {v t}; where v t is the input video frame at time t;
[0018] S12: Determine the sampling frame rate, and sample the input video frame sequence V according to the sampling frame rate to obtain a video frame sequence Among them, t s is the sampling time, At sampling time t s When is the video frame;
[0019] S13: Video frame sequence V s Block segmentation is performed to divide each video frame Divide into several image block sequences in, For video frames The image block at position (i, j), where i and j represent the position index of the image block in the horizontal direction and the vertical direction respectively;
[0020] S14: Frame sorting of a plurality of image block sequences v is performed according to preset coding requirements.
[0021] As an embodiment of the present invention, step S2 includes:
[0022] S21: Initial frame based on video frame sequence Construct the initial dictionary D0. The calculation formula of the initial dictionary D0 is as follows:
[0023]
[0024] Among them, ∥·∥2 is the l2 norm, ∥·∥1 is the l1 norm, is the Frobenius norm of the dictionary, λ1 and λ2 are the first weight parameter and the second weight parameter respectively;
[0025] S22: Obtain the image block sequence v of the current frame, and perform dictionary update on the image blocks in the image block sequence v of the current frame to obtain an updated dictionary Update dictionary The calculation formula is as follows:
[0026]
[0027] in, is the dictionary of image blocks of the previous video frame, Incremental adjustment, incremental adjustment The calculation formula is as follows:
[0028]
[0029] Among them, η is the first learning rate, is the sparse representation coefficient corresponding to the previous video frame, T is the transposition operation,
[0030] S23: Sparse representation algorithm based on gradient sparsity, by updating the dictionary and image blocks Establish a sparse representation model and solve for the sparse representation coefficients The calculation formula is as follows:
[0031]
[0032] in, is the gradient of the sparse representation coefficient, γ1 is the gradient sparsity weight coefficient, and γ4 is the weight coefficient of the total sparsity constraint;
[0033] S24: Each image block According to the sparse representation coefficient and update the dictionary Constructing a sparse matrix Sparse Matrix as follows:
[0034]
[0035] Among them, m and n represent the sparse representation coefficient and the index of the dictionary respectively.
[0036] As an embodiment of the present invention, step S3 includes:
[0037] S31: Sparse representation coefficients Perform amplitude normalization to obtain the normalized sparse representation coefficient The calculation formula is as follows:
[0038]
[0039] in, is the maximum absolute value of the sparse representation coefficient;
[0040] S32: quantizing the normalized sparse representation coefficients according to the preset quantization step size q Perform uniform quantization to obtain the quantized sparse representation coefficients The calculation formula is as follows:
[0041]
[0042] Among them, round is the rounding operation;
[0043] S33: Get the quantized sparse representation coefficients Convert to an integer sequence and compress it based on entropy coding method.
[0044] As an embodiment of the present invention, step S33 includes:
[0045] S331: Quantized sparse representation coefficients Perform sign coding and amplitude coding to convert it into sign bits and amplitude bits;
[0046] According to Huffman coding, the sign bit and amplitude bit are compressed and encoded to obtain the compressed bit stream And store and transmit to the decoding end.
[0047] As an embodiment of the present invention, step S4 includes:
[0048] S41: After being transmitted to the decoding end, the compressed bit stream Performing preliminary analysis to obtain coded information; wherein the coded information includes: extracting a sign bit and extracting an amplitude bit;
[0049] S42: Entropy decoding is performed on the extracted sign bit and the extracted amplitude bit according to Huffman coding to obtain the quantized original sparse representation coefficients.
[0050] S43: Quantize the original sparse representation coefficients Perform inverse quantization to obtain the normalized original sparse representation coefficients The calculation formula is as follows:
[0051]
[0052] S44: Normalized original sparse representation coefficients The original sparse representation coefficient is obtained by denormalizing through the following formula: The formula is as follows:
[0053]
[0054] As an embodiment of the present invention, step S5 includes:
[0055] S51: Based on the initial dictionary, the original sparse representation coefficients Decoding dictionary Update, decode dictionary The calculation formula is as follows:
[0056]
[0057] Among them, η1 is the second learning rate, is the decoding dictionary of the previous frame, is the original sparse representation coefficient of the previous frame;
[0058] S52: Sparse decoding algorithm based on gradient sparsity, through decoding dictionary and the original sparse representation coefficients Establish a decoding model and decode to obtain the reconstructed image block Among them, the objective function of the decoding model is as follows:
[0059]
[0060] As an embodiment of the present invention, step S6 includes:
[0061] S61: All the reconstructed image blocks obtained by decoding are Rearrange them according to their original positions at the encoding end;
[0062] S62: merging two adjacent reconstructed image blocks based on a weighted average method or a smoothing filter method to obtain a reconstructed video frame
[0063] As an embodiment of the present invention, step S7 includes:
[0064] S71: Reconstructing a number of video frames Sort the frames to get the reconstructed video frame sequence
[0065] S72: Generate transition frames between elements of the reconstructed video frame sequence according to bicubic interpolation Transition Frame The calculation formula is as follows:
[0066]
[0067] Among them, α1 is the interpolation weight coefficient, and Reconstructed video frames before and after;
[0068] S73: Generate transition frame according to The reconstructed input video frame sequence is generated by combining the reconstructed input video frame sequence with the reconstructed video frame sequence, and the reconstructed input video frame sequence is subjected to frame merging processing to obtain the reconstructed input video.
[0069] Compared with the prior art, the present invention has the following beneficial effects: the present invention introduces a dictionary learning algorithm with adaptive characteristics in the video encoding process; and the proposed sparse representation and decoding algorithm optimizes the solution and decoding process of sparse representation coefficients by combining gradient information and sparsity constraints; and through the refined processing of block merging and frame merging, efficient video compression and high-quality reconstruction under low bit rate conditions are achieved, solving the problems of low encoding efficiency, poor video quality, and insufficient sparse data processing capabilities in traditional low bit rate video encoding. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 Schematic diagram of a flow chart of an embodiment of the present invention. DETAILED DESCRIPTION
[0071] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0072] like Figure 1 As shown, the embodiment of the present invention proposes a low bit rate video encoding method based on sparse representation, comprising the following steps:
[0073] S1: After the encoder obtains the input video, it performs frame segmentation sampling on the input video to obtain a video frame sequence, and performs block segmentation on the elements in the video frame sequence to obtain an image block sequence;
[0074] S2: A sparse representation algorithm based on a dictionary learning algorithm and gradient sparsity processes the elements in the image block sequence to obtain sparse representation coefficients;
[0075] S3: quantize and entropy encode the sparse representation system in sequence to obtain a compressed bit stream and store and transmit it;
[0076] S4: Obtain the compressed bit stream, perform entropy decoding and inverse quantization on the bit stream in sequence, and obtain the original sparse representation coefficients;
[0077] S5: The original sparse representation coefficients are processed by a sparse decoding algorithm based on a dictionary learning algorithm and gradient sparsity to obtain a reconstructed image block;
[0078] S6: merging several reconstructed image blocks to obtain a reconstructed video frame;
[0079] S7: merging several reconstructed video frames to obtain a reconstructed input video;
[0080] The working principle and beneficial effects of the above technical solution: The present invention introduces a dictionary learning algorithm with adaptive characteristics in the video encoding process; and the proposed sparse representation and decoding algorithm optimizes the solution and decoding process of sparse representation coefficients by combining gradient information and sparsity constraints; and through the refined processing of block merging and frame merging, efficient video compression and high-quality reconstruction under low bit rate conditions are achieved, solving the problems of low coding efficiency, poor video quality, and insufficient sparse data processing capabilities in traditional low bit rate video encoding.
[0081] In one embodiment, step S1 includes:
[0082] S11: Obtain an input video, and divide the input video into an input video frame sequence V = {v t}; where v t is the input video frame at time t;
[0083] S12: Determine the sampling frame rate, and sample the input video frame sequence V according to the sampling frame rate to obtain a video frame sequence Among them, t s is the sampling time, At sampling time t s When is the video frame;
[0084] S13: Video frame sequence V s Block segmentation is performed to divide each video frame Divide into several image block sequences in, For video frames The image block at position (i, j), where i and j represent the position index of the image block in the horizontal direction and the vertical direction respectively;
[0085] S14: Frame sorting of a plurality of image block sequences v is performed according to preset coding requirements.
[0086] The working principle and beneficial effects of the above technical solution are as follows: by decomposing the input video into an input video frame sequence, sampling the input video frame sequence according to a preset sampling frequency to obtain a video frame sequence; decomposing each video frame in the video frame sequence into i*j image blocks to obtain an image block sequence; finally, sorting the segmented image block sequence according to preset encoding requirements, and dynamically adjusting the sorting order according to the motion information and texture complexity of the video content; wherein the number of elements in the video frame sequence is adapted to the requirements of the target encoding rate.
[0087] In one embodiment, step S2 includes:
[0088] S21: Initial frame based on video frame sequence Construct the initial dictionary D0. The calculation formula of the initial dictionary D0 is as follows:
[0089]
[0090] Among them, ∥·∥2 is the l2 norm, ∥·∥1 is the l1 norm, is the Frobenius norm of the dictionary, λ1 and λ2 are the first weight parameter and the second weight parameter respectively;
[0091] S22: Obtain the image block sequence v of the current frame, and perform dictionary update on the image blocks in the image block sequence v of the current frame to obtain an updated dictionary Update dictionary The calculation formula is as follows:
[0092]
[0093] in, is the dictionary of image blocks of the previous video frame, Incremental adjustment, incremental adjustment The calculation formula is as follows:
[0094]
[0095] Among them, η is the first learning rate, is the sparse representation coefficient corresponding to the previous video frame, T is the transposition operation,
[0096] S23: Sparse representation algorithm based on gradient sparsity, by updating the dictionary and image blocks Establish a sparse representation model and solve for the sparse representation coefficients The calculation formula is as follows:
[0097]
[0098] in, is the gradient of the sparse representation coefficient, γ1 is the gradient sparsity weight coefficient, and γ4 is the weight coefficient of the total sparsity constraint;
[0099] S24: Each image block According to the sparse representation coefficient and update the dictionary Constructing a sparse matrix Sparse Matrix as follows:
[0100]
[0101] Among them, m and n represent the sparse representation coefficient and the index of the dictionary respectively.
[0102] The working principle of the above technical solution is: for each image block Adopting an adaptive incremental dictionary learning algorithm based on a dictionary update framework, in which the updated dictionary Update frame by frame between video frames instead of rebuilding a new dictionary for each frame: Specifically, initialize the dictionary D0 using the image blocks of the initial frame or several frames of the video sequence Construct the initial dictionary D0 and obtain the initial dictionary D0 by minimizing the following objective function. The objective function is as follows:
[0103]
[0104] Among them, ∥·∥2 represents the l2 norm, which is used to measure the reconstruction error of the image block; ∥·∥1 is the l1 norm, which is used to maintain the sparsity constraint; is the Frobenius norm of the dictionary, which controls the complexity of the dictionary; λ1 and λ2 are weight parameters, which respectively control the impact of sparsity and dictionary complexity on the objective function; the video information of each frame is processed frame by frame to obtain the image block of the current frame Then, for the existing dictionary Perform incremental updates and update the dictionary To keep the dictionary consistent in the video sequence, the update process follows the following formula:
[0105]
[0106] Among them, the incremental adjustment It is calculated by the following formula:
[0107]
[0108] Among them, η is the learning rate, which is used to control the step size of dictionary update; is the sparse representation coefficient corresponding to the previous frame; T is the transposition operation. By updating the formula, the dictionary is adjusted in the video processing of each frame, thereby reducing the bit rate overhead while maintaining the continuity and consistency of the dictionary; in the dictionary update process, an incremental adjustment strategy is adopted to retain the dictionary The backbone of the ,reduces unnecessary dictionary reconstruction and update frequency, and reduces the bit rate overhead caused by dictionary updates:
[0109]
[0110] Among them, the newly added items It is used to measure the difference between the new dictionary and the dictionary of the previous frame. λ3 is the weight coefficient that controls the stability and update frequency of the dictionary. By optimizing the target, the bit rate overhead can be reduced while maintaining the consistency of the dictionary.
[0111] Updating the dictionary Based on this, a sparse representation algorithm based on gradient sparsity is used to transform the image blocks Update the dictionary with Combined with the above, a sparse representation model is established to solve the sparse representation coefficients The calculation formula is as follows:
[0112]
[0113] in, represents the gradient of the sparse representation coefficient, which is used to capture the edge and texture information of the image block; γ1 is the gradient sparsity weight coefficient, which further strengthens the sparsity of the sparse representation in the gradient space; λ4 is the weight coefficient of the total sparsity constraint;
[0114] For each image block By sparsely representing the coefficients and update the dictionary Constructing a sparse matrix
[0115]
[0116] Among them, m and n represent the sparse representation coefficient and the index of the dictionary respectively, and the final sparse matrix Features for storing image blocks in sparse form, providing an optimized encoding form for subsequent compression and transmission;
[0117] The beneficial effects of the above technical solution are as follows: the present invention introduces a dictionary learning algorithm with adaptive characteristics in the video encoding process; by dynamically generating and updating the dictionary, the dictionary can be adaptively adjusted according to the characteristics of the video frame, ensuring that the sparse representation coefficient can characterize the characteristics of the video block with the least non-zero elements; compared with the traditional fixed dictionary encoding method, the adaptive dictionary learning of the present invention can more accurately capture the temporal and spatial characteristics of the video, significantly improve the compression efficiency of the video, and reduce the storage of redundant information, thereby maintaining a high encoding quality at a low bit rate.
[0118] In one embodiment, step S3 includes:
[0119] S31: Sparse representation coefficients Perform amplitude normalization to obtain the normalized sparse representation coefficient The calculation formula is as follows:
[0120]
[0121] in, is the maximum absolute value of the sparse representation coefficient;
[0122] S32: quantizing the normalized sparse representation coefficients according to the preset quantization step size q Perform uniform quantization to obtain the quantized sparse representation coefficients The calculation formula is as follows:
[0123]
[0124] Among them, round is the rounding operation;
[0125] S33: Get the quantized sparse representation coefficients Convert to integer sequence and compress it based on entropy coding method;
[0126] Step S33 includes:
[0127] S331: Quantized sparse representation coefficients Perform sign coding and amplitude coding to convert it into sign bits and amplitude bits;
[0128] According to Huffman coding, the sign bit and amplitude bit are compressed and encoded to obtain the compressed bit stream And store and transmit to the decoding end;
[0129] The working principle and beneficial effects of the above technical solution:
[0130] The sparse representation coefficients are preprocessed to reduce the errors that may be introduced during the quantization process; the preprocessing step includes normalizing the amplitude of the sparse representation coefficients and scaling them to a standard range:
[0131]
[0132] in, is the normalized sparse representation coefficient, is the maximum absolute value of the sparse representation coefficient, which is used for normalization;
[0133] Select an appropriate quantization step size q to uniformly quantize the normalized sparse representation coefficients. The calculation formula is as follows:
[0134]
[0135] in, is the quantized sparse representation coefficient, round represents the rounding operation, and a balance is achieved between compression efficiency and quantization error by selecting an appropriate quantization step size q;
[0136] The quantized sparse representation coefficients Encoding is performed to compress the number of bits required for its storage and transmission. During the encoding process, the quantized sparse representation coefficients are converted into integer sequences and further compressed using the entropy coding method to reduce the bit rate. The specific encoding steps are as follows:
[0137] The quantized sparse representation coefficients Perform sign encoding and amplitude encoding to convert them into sign bits and amplitude bits; use Huffman coding to compress the sign bits and amplitude bits to obtain a compressed bit stream The compressed bit stream As input to the subsequent video encoding process, it is stored or transmitted.
[0138] In one embodiment, step S4 includes:
[0139] S41: After being transmitted to the decoding end, the compressed bit stream Performing preliminary analysis to obtain coded information; wherein the coded information includes: extracting a sign bit and extracting an amplitude bit;
[0140] S42: Entropy decoding is performed on the extracted sign bit and the extracted amplitude bit according to Huffman coding to obtain the quantized original sparse representation coefficients.
[0141] S43: Quantize the original sparse representation coefficients Perform inverse quantization to obtain the normalized original sparse representation coefficients The calculation formula is as follows:
[0142]
[0143] S44: Normalized original sparse representation coefficients The original sparse representation coefficient is obtained by denormalizing through the following formula: The formula is as follows:
[0144]
[0145] The working principle and beneficial effects of the above technical solution:
[0146] The compressed bit stream is received at the decoding end After that, the bit stream is initially parsed to extract the coded information including the extracted sign bit and the extracted amplitude bit, so as to prepare for entropy decoding processing;
[0147] According to the Huffman coding used by the encoder, the extracted sign bits and the extracted amplitude bits are entropy decoded respectively, and the bit stream is converted into Convert to get the quantized original sparse representation coefficient
[0148] In the specific entropy decoding process, the symbol table or probability model is first used to reversely map the symbol bits to restore the original symbol information; then, the amplitude bits are decoded to restore the quantized amplitude value, thereby obtaining the complete quantized original sparse representation coefficients.
[0149] The decoded quantized original sparse representation coefficients Perform inverse quantization to restore the normalized original sparse representation coefficients The calculation formula is as follows:
[0150]
[0151] Normalize the original sparse representation coefficients Perform anti-normalization processing to restore its original amplitude range. The anti-normalization formula is:
[0152]
[0153] in, is the maximum absolute value recorded at the encoding end, which is used to restore the original amplitude of the sparse representation coefficient;
[0154] The beneficial effects of the above technical solution are as follows: the sparse representation and decoding algorithm proposed in the present invention optimizes the solution and decoding process of the sparse representation coefficients by combining gradient information and sparsity constraints; at the video encoding end, the gradient sparsity constraint enables the sparse representation coefficients to not only efficiently represent the content of the image block, but also maintain the edge and texture information of the image block, thereby avoiding the blur and artifact problems that are prone to occur in traditional methods at low bit rates; at the decoding end, the same sparse representation model and adaptive dictionary are used to enable the reconstructed image block to maintain high definition and high visual quality under low bit rate conditions; at the same time, in the present invention, the quantization and entropy coding processing of the sparse representation coefficients are optimized; through the preprocessing and inverse quantization steps, the cumulative effect of the quantization error is reduced and the accuracy of the sparse representation coefficients is improved; at the same time, combined with the adaptive entropy coding method, the quantized sparse representation coefficients are effectively compressed, the encoding bit rate is significantly reduced, and the encoding efficiency and compression effect are further improved.
[0155] In one embodiment, step S5 includes:
[0156] S51: Based on the initial dictionary, the original sparse representation coefficients Decoding dictionary Update, decode dictionary The calculation formula is as follows:
[0157]
[0158] Among them, η1 is the second learning rate, is the decoding dictionary of the previous frame, is the original sparse representation coefficient of the previous frame;
[0159] S52: Sparse decoding algorithm based on gradient sparsity, through decoding dictionary and the original sparse representation coefficients Establish a decoding model and decode to obtain the reconstructed image block Among them, the objective function of the decoding model is as follows:
[0160]
[0161] The working principle and beneficial effects of the above technical solution: Using the same dictionary learning algorithm as the encoding end, the decoding end dynamically generates a decoding dictionary for decoding Among them, the decoding dictionary The generation of is based on the same initial conditions and update rules as the encoding end to ensure the consistency of the dictionary and the encoding end. The dictionary generation process is as follows:
[0162] Initialize the dictionary using image patches extracted from the initial frame or frames of the video sequence Build the initial dictionary;
[0163] For each frame of the image block Based on the original sparse representation coefficient and the decoding dictionary of the previous frame Decoding dictionary To update, follow the following update formula:
[0164]
[0165] Among them, η1 is the learning rate, which controls the step size of dictionary update. is the original sparse representation coefficient, T represents the transposition operation;
[0166] Using a sparse decoding algorithm based on gradient sparsity, the recovered sparse representation coefficients are combined with a dynamically generated dictionary to reconstruct the image block: Specifically, using the gradient sparsity constraint, the sparse representation coefficients are input into the decoding model, combined with the decoding dictionary dynamically generated at the decoding end, to decode the reconstructed image block The objective function of the decoding model is as follows:
[0167]
[0168] Using the original sparse representation coefficients and a dynamically generated decoding dictionary High-quality reconstruction of image blocks is achieved at the decoding end, providing basic data for subsequent image block merging and video frame reconstruction.
[0169] In one embodiment, step S6 includes:
[0170] S61: All the reconstructed image blocks obtained by decoding are Rearrange them according to their original positions at the encoding end;
[0171] S62: merging two adjacent reconstructed image blocks based on a weighted average method or a smoothing filter method to obtain a reconstructed video frame
[0172] The working principle and beneficial effects of the above technical solution: after all the reconstructed image blocks are After rearranging them according to their original positions at the encoding end, two adjacent reconstructed image blocks are merged by a weighted average method or a smoothing filter method. In the block merging process, in order to reduce the splicing error at the block boundary, the boundary between adjacent image blocks is transitionally processed by a weighted average or smoothing filter method. The processing logic of the weighted average method is as follows:
[0173] Weighted average of pixels at the boundary of adjacent blocks:
[0174] For each image block’s boundary pixel, we first find the corresponding boundary pixel of the adjacent block, and then perform a weighted average of the two pixels. This weighted operation can be dynamically adjusted based on the characteristics of the two image blocks, such as brightness, texture, etc., to ensure a smooth transition at the boundary. The calculation formula is as follows:
[0175]
[0176] in, is the value of the pixel (x, y) in the image block (i, j), is the pixel value of the corresponding position in the adjacent image block (i', j'), w1 and w2 are weighting coefficients used to control the smoothness of the boundary transition, and (x, y) represents the position coordinates of the pixel in the image block; the selection of weighting coefficients includes:
[0177] w1 and w2 are usually dynamically adjusted based on the similarity of the two image blocks. If the brightness or texture of two adjacent blocks are very close, a higher weighting coefficient can be selected to make the transition smoother; if the difference is large, the weighting coefficient can be reduced to reduce the impact of the transition;
[0178] Among them, the processing logic of the smoothing filtering method is as follows:
[0179] Smoothing filtering further processes the entire image frame to reduce artifacts and discontinuities caused by block merging. The most commonly used smoothing filters include Gaussian filters and bilateral filters; among them, Gaussian filtering is as follows:
[0180] Gaussian filtering is an extended form of weighted averaging. It uses the Gaussian function as a weight to perform weighted averaging on each pixel and its surrounding pixels. Filtering can effectively smooth the image while avoiding excessive blurring of edge information. The calculation formula is as follows:
[0181]
[0182] in, is the pixel value after smoothing, g(i,j) is the weight function of the smoothing filter, which is usually determined by the Gaussian distribution function g(i,j), and the calculation formula is as follows:
[0183]
[0184] Among them, σ controls the width of the Gaussian function and is used to determine the degree of smoothing; the Gaussian filter effectively removes high-frequency noise in the image, making the image smoother while maintaining the basic shape of the edge;
[0185] The bilateral filtering is as follows:
[0186] Bilateral filtering is a smoothing method that considers spatial distance and color similarity. It not only weights pixels according to their spatial distance, but also considers the similarity of pixel values. It can better preserve edge information. The calculation formula is as follows:
[0187]
[0188] Among them, w s (i, j) is the weight determined according to the spatial distance (similar to Gaussian filtering); It is a weight determined by the similarity of pixel values. If two pixel values are very close, the weight is larger, otherwise it is smaller. Bilateral filtering has better edge preservation effect than Gaussian filtering and is suitable for merging complex images or image blocks with more textures. (x, y) represents the position coordinates of the pixel in the image block.
[0189] In the process of block merging, (x, y) can be used to describe the position of pixels in the same image block as well as the relationship between corresponding pixels in adjacent image blocks. By performing weighted averaging and filtering on the pixels at the (x, y) position, it is ensured that adjacent image blocks have a smooth transition visually, thereby improving the overall merging effect.
[0190] Ideas to improve the merging effect of reconstructed image blocks:
[0191] Adaptive weights: The weighted average weights can be adaptively adjusted according to the image content, dynamically processing the transition between blocks and reducing the obvious boundaries between different image blocks; Efficient smoothing filtering: By using bilateral filters, the image edge information can be better preserved, the blurring effect can be reduced, and the transition can be smoothed to improve the visual consistency after block merging; Global optimization processing: Global smoothing processing is performed on the entire merged image to further eliminate the block effect and ensure that the transition between image blocks is more natural and smooth, especially in high-texture or complex scenes. The effect is more significant.
[0192] In one implementation, step S7 includes:
[0193] S71: Reconstructing a number of video frames Sort the frames to get the reconstructed video frame sequence
[0194] S72: Generate transition frames between elements of the reconstructed video frame sequence according to bicubic interpolation Transition Frame The calculation formula is as follows:
[0195]
[0196] Among them, α1 is the interpolation weight coefficient, and Reconstructed video frames before and after;
[0197] S73: Generate transition frame according to The reconstructed input video frame sequence is generated by combining the reconstructed input video frame sequence with the reconstructed video frame sequence, and the reconstructed input video frame sequence is subjected to frame merging processing to obtain the reconstructed input video.
[0198] The working principle of the above technical solution is: to reconstruct the video frame sequence Perform frame sorting to ensure that the reconstructed video frames are arranged in the time order of the original video. The goal of frame sorting is to restore the temporal consistency of the video.
[0199] Temporal interpolation is performed on the sorted reconstructed video frame sequence to compensate for the frame information that may be lost during the encoding process. Specifically, bicubic interpolation is used to generate transition frames between adjacent frames. The calculation formula is as follows:
[0200]
[0201] Among them, α1 is the interpolation weight coefficient, and are adjacent front and back frames respectively;
[0202] Merge the interpolated video frame sequence to generate a continuous reconstructed input video. Specifically, merge the interpolated transition frame with the reconstructed video frame to form a complete reconstructed input video frame sequence. Then, use the frame merging algorithm to uniformly encode and process all frames in the frame sequence to ensure smooth transitions between frames and avoid frame skipping or discontinuity caused by interpolation and reconstruction.
[0203] The beneficial effects of the above technical solution are as follows: by performing block merging and frame merging processing on the decoded image blocks, and adopting refined processing methods such as weighted averaging, smoothing filtering, and time interpolation, the block effect and boundary artifacts are significantly reduced, ensuring the temporal consistency and visual coherence between video frames. This processing method not only effectively improves the overall quality of the reconstructed video at a low bit rate, but also makes the visual effect of the video smoother and more natural, avoiding visual discomfort caused by block effects and frame discontinuity.
[0204] Finally, in the technical solution of this application, a low-bitrate video encoding method based on sparse representation is proposed, which aims to optimize the compression efficiency of video data while maintaining high-quality visual effects under low bit rate conditions. Compared with other similar technical solutions, although they can solve the problem of video compression and quality balance to some extent, they have fatal shortcomings and cannot replace the solution submitted in this application.
[0205] First, traditional video coding methods such as H.264 and H.265 mainly rely on transform coding, quantization and entropy coding to achieve video data compression. While reducing the bit rate, these methods often lead to a significant decrease in video quality, especially when dealing with complex textures and motion scenes, which are prone to problems such as mosaics, blurs and block effects. These methods ignore the sparsity characteristics of video signals and cannot fully explore the inherent structure of video content, making it difficult to ensure high-quality coding effects at low bit rates.
[0206] Secondly, although some deep learning-based compression methods have attempted to enhance video coding effects through neural networks in recent years, these methods are usually computationally complex, expensive to train, and require high hardware, making them unsuitable for real-time video coding applications. In addition, deep learning methods often require a large amount of training data and a long training process when processing video data, lacking universality and flexibility. This makes it difficult for them to achieve efficient video compression at low bit rates in practical applications.
[0207] In contrast, the proposed scheme can significantly improve the video compression efficiency under low bit rate conditions and maintain high video quality by introducing sparse representation technology, combining adaptive dictionary learning and sparse representation algorithm based on gradient sparsity. Specifically, this method dynamically generates dictionaries to represent image blocks with the least non-zero coefficients, greatly reducing the redundant information of video data. At the same time, combined with gradient sparsity constraints, it effectively retains the edge and texture information of image blocks, thereby avoiding the common visual artifact problems in traditional methods.
[0208] In addition, for the quantization and entropy coding process, this solution proposes an optimized quantization processing and entropy coding algorithm, which reduces the quantization error and improves the compression efficiency. At the decoding end, by dynamically generating a dictionary and sparse decoding algorithm consistent with the encoding end, the image blocks can be efficiently reconstructed to ensure that the visual effect of the reconstructed video is similar to the original video.
[0209] In order to avoid the infringement risks of possible competing solutions and existing technologies, the implementation of this solution can be further optimized. For example, in the dictionary learning algorithm, a more complex adaptive algorithm can be introduced to further improve the accuracy of the dictionary and the efficiency of sparse representation; in entropy coding, more dynamic adjustment strategies can be combined to adapt to the complexity of different video content. These improvements can further enhance the competitiveness and technical barriers of this solution.
[0210] The application scheme can achieve high-quality video compression at low bit rates, is suitable for various video transmission and storage scenarios, and can significantly improve the overall effect and application value of video encoding.
[0211] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.
Claims
1. A low bit rate video coding method based on sparse representation, characterized in that: The following steps are involved: S1: After the encoder obtains the input video, it performs frame segmentation sampling on the input video to obtain a video frame sequence, and performs block segmentation on the elements in the video frame sequence to obtain an image block sequence; S2: A sparse representation algorithm based on a dictionary learning algorithm and gradient sparsity processes the elements in the image block sequence to obtain sparse representation coefficients; S3: quantize and entropy encode the sparse representation system in sequence to obtain a compressed bit stream and store and transmit it; S4: Obtain the compressed bit stream, perform entropy decoding and inverse quantization on the bit stream in sequence, and obtain the original sparse representation coefficients; S5: The original sparse representation coefficients are processed by a sparse decoding algorithm based on a dictionary learning algorithm and gradient sparsity to obtain a reconstructed image block; S6: merging several reconstructed image blocks to obtain a reconstructed video frame; S7: Merge several reconstructed video frames to obtain a reconstructed input video.
2. A low bit rate video encoding method based on sparse representation as claimed in claim 1, characterized in that: Step S1 includes: S11: Obtain an input video, and divide the input video into an input video frame sequence V = {v t }; where v t is the input video frame at time t; S12: Determine the sampling frame rate, and sample the input video frame sequence V according to the sampling frame rate to obtain a video frame sequence Among them, t s is the sampling time, At sampling time t s When is the video frame; S13: Video frame sequence V s Block segmentation is performed to divide each video frame Divide into several image block sequences in, For video frames The image block at position (i, j), where i and j represent the position index of the image block in the horizontal direction and the vertical direction respectively; S14: Frame sorting of a plurality of image block sequences v is performed according to preset coding requirements.
3. A low bit rate video encoding method based on sparse representation as claimed in claim 1, characterized in that: Step S2 includes: S21: Initial frame based on video frame sequence Construct the initial dictionary D0. The calculation formula of the initial dictionary D0 is as follows: Among them, ∥·∥2 is the l2 norm, ∥·∥1 is the l1 norm, is the Frobenius norm of the dictionary, λ1 and λ2 are the first weight parameter and the second weight parameter respectively; S22: Obtain the image block sequence v of the current frame, and perform dictionary update on the image blocks in the image block sequence v of the current frame to obtain an updated dictionary Update dictionary The calculation formula is as follows: in, is the dictionary of image blocks of the previous video frame, Incremental adjustment, incremental adjustment The calculation formula is as follows: Among them, η is the first learning rate, is the sparse representation coefficient corresponding to the previous video frame, T is the transposition operation, S23: Sparse representation algorithm based on gradient sparsity, by updating the dictionary and image blocks Establish a sparse representation model and solve for the sparse representation coefficients The calculation formula is as follows: in, is the gradient of the sparse representation coefficient, γ1 is the gradient sparsity weight coefficient, and γ4 is the weight coefficient of the total sparsity constraint; S24: Each image block According to the sparse representation coefficient and update the dictionary Constructing a sparse matrix Sparse Matrix as follows: Among them, m and n represent the sparse representation coefficient and the index of the dictionary respectively.
4. A low bit rate video encoding method based on sparse representation as claimed in claim 1, characterized in that: Step S3 includes: S31: Sparse representation coefficients Perform amplitude normalization to obtain the normalized sparse representation coefficient The calculation formula is as follows: in, is the maximum absolute value of the sparse representation coefficient; S32: quantizing the normalized sparse representation coefficients according to the preset quantization step size q Perform uniform quantization to obtain the quantized sparse representation coefficients The calculation formula is as follows: Among them, round is the rounding operation; S33: Get the quantized sparse representation coefficients Convert to an integer sequence and compress it based on entropy coding method.
5. A low bit rate video encoding method based on sparse representation as claimed in claim 4, characterized in that: Step S33 includes: S331: Quantized sparse representation coefficients Perform sign coding and amplitude coding to convert it into sign bits and amplitude bits; According to Huffman coding, the sign bit and amplitude bit are compressed and encoded to obtain the compressed bit stream And store and transmit to the decoding end.
6. A low bit rate video encoding method based on sparse representation as claimed in claim 1, characterized in that: Step S4 includes: S41: After being transmitted to the decoding end, the compressed bit stream Performing preliminary analysis to obtain coded information; wherein the coded information includes: extracting a sign bit and extracting an amplitude bit; S42: Entropy decoding is performed on the extracted sign bit and the extracted amplitude bit according to Huffman coding to obtain the quantized original sparse representation coefficients. S43: Quantize the original sparse representation coefficients Perform inverse quantization to obtain the normalized original sparse representation coefficients The calculation formula is as follows: S44: Normalized original sparse representation coefficients The original sparse representation coefficient is obtained by denormalizing through the following formula: The formula is as follows:
7. A low bit rate video encoding method based on sparse representation as claimed in claim 1, characterized in that: Step S5 includes: S51: Based on the initial dictionary, the original sparse representation coefficients Decoding dictionary Update, decode dictionary The calculation formula is as follows: Among them, η1 is the second learning rate, is the decoding dictionary of the previous frame, is the original sparse representation coefficient of the previous frame; S52: Sparse decoding algorithm based on gradient sparsity, through decoding dictionary and the original sparse representation coefficients Establish a decoding model and decode to obtain the reconstructed image block Among them, the objective function of the decoding model is as follows:
8. The low bit rate video encoding method based on sparse representation as claimed in claim 1, characterized in that: Step S6 includes: S61: All the reconstructed image blocks obtained by decoding are Rearrange them according to their original positions at the encoding end; S62: merging two adjacent reconstructed image blocks based on a weighted average method or a smoothing filter method to obtain a reconstructed video frame 9. The low bit rate video encoding method based on sparse representation as claimed in claim 1, characterized in that: Step S7 includes: S71: Reconstructing a number of video frames Sort the frames to get the reconstructed video frame sequence S72: Generate transition frames between elements of the reconstructed video frame sequence according to bicubic interpolation Transition Frame The calculation formula is as follows: Among them, α1 is the interpolation weight coefficient, and Reconstructed video frames before and after; S73: Generate transition frame according to The reconstructed input video frame sequence is generated by combining the reconstructed input video frame sequence with the reconstructed video frame sequence, and the reconstructed input video frame sequence is subjected to frame merging processing to obtain the reconstructed input video.
Citation Information
Patent Citations
Compressed sensing video transmission method and system based on dual sparse model decoding
CN104159112A
Single-frame super-resolution reconstruction method and device based on sparse domain reconstruction
US20180225807A1
3D point cloud encoding and decoding method, compression method and device based on graph dictionary learning
US20240202982A1
Video bit-rate reduction system and method utilizing a reference images matrix
US9215468B1
Cited By
Lightning waveform classification method based on multi-scale residual network
CN120337011A
Video packet loss repair method based on image odd-even row / column recombination and block coding
CN120434409A
Video compression and intelligent exchange method and device
CN121442106A