Coding method for weakening chromaticity smear

By analyzing the difference between the reconstructed pixels and the original pixels, and combining this with dual threshold determination, modes that may cause chroma ghosting are disabled, thus solving the problem of severe chroma ghosting in existing technologies and improving the subjective quality of video encoding.

CN121842398APending Publication Date: 2026-04-10HEFEI JUNZHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-08
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing encoders tend to select modes with high distortion but low bit count under high QP, resulting in severe chroma ghosting that significantly affects subjective quality. The RDCost scheme fails to effectively consider chroma distortion, and under high QP, the larger the λ value, the larger the bit count, leading to a tendency to select unreasonable modes.

Method used

By analyzing the UV data of reconstructed pixels and combining it with the original pixels to determine whether the current block is moving, a dual threshold is used to determine the sad value of reconstructed pixels and original pixels in non-skip and skip modes, and modes that may cause chroma ghosting are disabled.

Benefits of technology

It effectively reduces chroma ghosting, improves the subjective quality of video encoding, is simple to operate and easy to implement in hardware, has high accuracy, conforms to the characteristics of chroma ghosting, and selects the mode by judging the severity through motion detection and dual thresholds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121842398A_ABST
    Figure CN121842398A_ABST
Patent Text Reader

Abstract

The invention provides a coding method for weakening chromaticity smear. The coding method comprises the following steps: S0, inputting a 32 * 32 block or a 16 * 16 block or an 8 * 8 block; s1, motion judgment; s2, judging whether the block is a motion block- If yes, the step S3 is carried out, and if not, the process is ended; s3, traversing the coeff of the non-skip mode; s4, judging whether coeff is not all 0- If yes, the step S5 is carried out, and if not, the step S6 is carried out; s5, calculating the sad of each 4 * 4 block of the skip mode recon and the non-skip mode recon of the uv component; obtaining the maximum value sadmax of the uv component sad; determining whether sadmax > = Recsadthrd0- If yes, forbidding is carried out, the skip is disable, and the non-skip is disable; if not, further judging whether sadmax is greater than or equal to recsadthrd1-or not If yes, forbidding is carried out, and skip: disable is carried out; if not, ending; s6, calculating sad of each 4 * 4 block raw and recon of the uv component; obtaining the maximum value sadmax of the uv component sad; determining whether sadmax > = rawsadthrd0- If yes, forbidding is carried out, the skip is disable, and the non-skip is disable; and if not, ending.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of video encoding processing technology, and specifically relates to an encoding method for reducing chroma ghosting. Background Technology

[0002] Current encoders use a hybrid framework of prediction and transform quantization. When the prediction block is inaccurate, the residual input of transform quantization will be large, resulting in more quantized data being lost and causing more significant chroma distortion. Therefore, the accuracy of the prediction can be determined by the performance of the UV residual. Conversely, if the residual is small and fully quantized, the UV components of the predicted pixel and the original pixel can be compared. If the difference between the UV components and the original pixel is too large, it indicates that the current encoding block is using an unreasonable mode, which needs to be disabled.

[0003] Currently, encoders often use the RDCost scheme to determine mode selection, which involves calculating the RDCost of each mode, comparing the RDCost of each mode, and selecting the mode with the lowest cost.

[0004] However, the shortcomings of existing technologies are:

[0005] Currently, encoders commonly use the RDCost scheme for mode selection. RDCost consists of distortion, bit, and a balance factor λ. The larger the qp (quantum pressure), the larger λ, and the larger the bit proportion in the rdcost. This tends to favor modes with fewer bits and higher distortion. However, the RDCost scheme does not separately consider chroma distortion. Chromatic RDCost accounts for a smaller proportion of the overall cost than luminance. Using only rdcost at high qp can easily lead to chroma ghosting that severely impacts subjective quality.

[0006] Furthermore, the terminology used in this art includes:

[0007] H.265 / HEVC: A high-efficiency video coding protocol, a general scheme for compressing redundant information in video in terms of space, time, and structure.

[0008] CTU: is an independent encoding unit in H.265 / HEVC, and its size can be 64x64, 32x32, or 16x16.

[0009] CU: A CTU contains multiple coding units (CUs), whose sizes can be 64x64, 32x32, 16x16, or 8x8.

[0010] QP: Quantization level. The range for H.265 / HEVC is [0,51]. The larger the QP, the higher the quantization level, the less image detail is preserved, but the higher the compression rate.

[0011] Raw pixels: refers to the unprocessed pixels input to the encoder, i.e., the input data.

[0012] Predicted pixel (pred): refers to the pixel obtained by the prediction module of the encoder.

[0013] Residual pixel resi: refers to the input data of the encoder transform quantization module, which is the raw pixel - predicted pixel pred.

[0014] Residual coefficient coeff: refers to the output result after the residual pixel resi is transformed and quantized.

[0015] Reconstructed pixel recon: refers to the pixel obtained by adding the residual coefficient coeff to pred after the inverse quantization and inverse transformation of the encoder.

[0016] Merge mode: A prediction mode of Inter that does not perform motion search, but performs prediction + transformation quantization.

[0017] merge-skip mode: A special mode of merge where the coeff is 0, based on the merge mode.

[0018] AMVP mode: An inter prediction mode that performs prediction + transformation quantization and motion search compared to merge.

[0019] AMVP-Skip mode: A special mode of AMVP where the coeff is 0 (non-265 protocol mode).

[0020] Non-skip mode: refers to the inter-frame prediction mode with coeff, such as merge mode and AMVP mode.

[0021] Skip mode: refers to the mode where there is no coeff in inter-frame prediction, such as merge-skip mode and amvp-skip mode.

[0022] RDCost: In H.265 / HEVC, the cost value is calculated. Typically, the mode or partition with the minimum RDCost is chosen as the decision. It consists of Distortion and BitRate, and its formula is RDCost = Distortion + λ * BitRate. Distortion is usually represented by the difference between the original pixel value and the pixel value after encoding and decoding. BitRate is usually the number of bits required to encode the current block, and λ is the Lagrange multiplier, used to weigh the weights of distortion and bits.

[0023] Chroma trailing: During encoding, because RDCost tends to favor a mode with high distortion but low bit depth under high QP, inter-frame prediction modes without residuals are often used for moving objects. This causes the encoded block to use incorrect motion information from the reference frame. In the bitstream, viewers will see objects that have already moved still appearing in the current frame, severely impacting subjective quality. A screenshot of chroma trailing is shown below. Figure 1 As shown. Summary of the Invention

[0024] To address the aforementioned issues, the purpose of this application is to: for moving blocks, determine whether the current block is predicted inaccurately, thus causing color drag, by analyzing the UV data of the recon pixels in two modes; when the recon pixel data of the two modes are the same, the original data raw and the recon pixels are added to assist in determining whether color drag has occurred.

[0025] Specifically, the present invention provides an encoding method for reducing chroma ghosting, the method comprising: determining whether the current block is moving by using the original pixel raw_prev of the reference frame and the original pixel raw of the current frame; if it is moving, it indicates that chroma ghosting may occur; if it is not a moving block, it indicates that chroma ghosting will not occur.

[0026] Assuming the use of merge and merge-skip modes, where merge-skip is a special merge mode where the predicted pixel pred is the same as the reconstructed pixel recon, and also the same as the predicted pixel pred in the merge mode; then the accuracy of the merge mode's prediction can be determined by comparing the recon pixels of merge and merge-skip. Alternatively, the use of AMVP and AMVP-skip modes follows the same process as the use of merge and merge-skip modes.

[0027] Check the coeff of the non-skip mode. If the coeff is not all zero, perform a chromatic aberration check using the recon of both the non-skip and skip modes; if the coeff is all zero, perform a chromatic aberration check using both raw and recon modes. Further, this includes:

[0028] If coeff is not all zero: Divide the UV chromaticity components into 4x4 blocks respectively, and calculate the sad value for the recon pixels within each 4x4 block for both non-skip and skip modes; if the sad value is too large, i.e., sad is greater than or equal to the threshold recon_sad_thrd0 (empirical value is 15), it indicates that the mode prediction is inaccurate, and the modes with and without residuals can be directly disabled; if the sad value is within a reasonable range, i.e., sad is less than the threshold recon_sad_thrd0 (empirical value is 15) and greater than or equal to the threshold recon_sad_thrd1 (empirical value is 10), it indicates that the mode without residuals has chromaticity ghosting and needs to be disabled; if the sad value is too small, i.e., sad is less than the threshold recon_sad_thrd1 (empirical value is 10), it indicates that no chromaticity ghosting occurs.

[0029] If coeff is all 0, then the raw and reconstructed pixels need to be used for judgment. The sad value of the UV component is calculated for the raw and reconstructed pixels in each 4x4 block. If sad is too large, that is, sad is greater than or equal to the threshold raw_sad_thrd0, the empirical value is 15, it means that the current pred has not been restored to the UV component value of the raw data, indicating that color dragging has occurred, and then this mode is disabled.

[0030] The method further includes:

[0031] S0, input 32×32 or 16×16 or 8×8 blocks;

[0032] S1, motion determination;

[0033] S2, determine if it is a moving block? If yes, proceed to step S3; otherwise, end.

[0034] S3, iterate through the coeff in non-skip mode;

[0035] S4. Determine if coeff is not all zero. If yes, proceed to step S5; otherwise, proceed to step S6.

[0036] S5, calculate the sad of each 4×4 block skip mode recon and non-skip mode recon for the UV component; obtain the maximum value of the UV component sad_max;

[0037] Check if sad_max ≥ recon_sad_thrd0. If yes, disable it (skip:disable), otherwise disable it. If no, further check if sad_max ≥ recon_sad_thrd1. If yes, disable it (skip:disable), otherwise end.

[0038] S6, calculate the sad of each 4×4 block of raw and recon for the UV component;

[0039] Get the maximum value of the UV component sad_max;

[0040] Determine if sad_max ≥ raw_sad_thrd0. If yes, disable it (skip:disable) or otherwise (not skip:disable); otherwise, end the process.

[0041] The method assumes that cu16x16, sets the current block size to 16x16, and under the yuv420 format, the y component block size is 16x16 and the uv component block size is 8x8;

[0042] The prediction modes used by P-frames are merge, merge-skip, amvp, amvp-skip, and intra; among them, the inter-frame prediction modes are merge, merge-skip, amvp, and amvp-skip, and the intra-frame mode is intra; chroma motion blur determination is carried out in the merge and merge-skip modes, and also in the amvp and amvp-skip modes; assuming that the chroma motion blur process is carried out in the merge and merge-skip modes, the chroma motion blur process in the amvp and amvp-skip modes is exactly the same.

[0043] The motion determination in step S1 further includes:

[0044] Calculate the mean value of motion_avg, which is the sum of the absolute values ​​of the differences between each pixel in the current raw block and the previous frame's raw_pred at the same position. If motion_avg is greater than the threshold motion_thrd, the current block is considered to be in motion, and motion_flag is set to 1; otherwise, it is set to 0.

[0045]

[0046] The threshold, motion_thrd, is an empirical value and can be set to 8.

[0047] The step S2, determining whether it is a moving block, further includes:

[0048] If motion_flag is 0, the current block is stationary, and it is determined that there will be no chroma ghosting in the current block. The chroma ghosting determination of the current block is stopped, and the process ends. If motion_flag is 1, the current block is in motion, and the chroma ghosting determination of the current block continues.

[0049] Step S4 further includes:

[0050] Check the quantization coefficients Coeff of the luminance and chrominance components in the current block's non-skip mode and determine the quantization coefficients Coeff of the luminance and chrominance components. If not all of Coeff are 0, proceed to step S5 to calculate sad_raw_avg of the non-skip and skip mode recon to determine chrominance ghosting. If all of Coeff are 0, proceed to step S6 to calculate sad_raw_avg of the raw and non-skip mode recon to determine chrominance ghosting. Otherwise, continue with chrominance ghosting determination.

[0051] Step S5 further includes:

[0052] If the coeff of non-skip blocks is not all zero, calculate the sad_recon_avg of the recon values ​​for non-skip mode and skip mode to determine chromatic ghosting:

[0053] (1) Obtain the reconstructed pixels for merge mode and merge-skip as recon m and recon ms Calculate the mean sad values ​​(sad_recon_u_avg, sad_recon_v_avg) of the UV channels for each 4x4 block within the reconstructed pixel recon.

[0054]

[0055] (2) Obtain the mean sad_avg and maximum sad_recon_u_avgmax, sad_recon_v_avgmax of each 4x4 block of the uv channel inside the recon pixel.

[0056] sad_recon_u_avgmax=max{sad_recon_u_avg0,...sad_recon_u_avg n}

[0057] sad_recon_v_avgmax=max{sad_recon_v_avg0,...sad_recon_v_avg n}

[0058] (3) If sad_recon_u_avgmax or sad_recon_v_avgmax is greater than or equal to recon_sad_thrd0 in both uv channels, then stop the chroma ghosting determination and disable both merge and merge-skip modes; where recon_sad_thrd0 is an empirical value and can be set to 15.

[0059] (4) If sad_recon_u_avgmax or sad_recon_v_avgmax is greater than or equal to recon_sad_thrd1 in both uv channels, then stop the chroma ghosting determination and disable the merge-skip mode; where recon_sad_thrd1 is an empirical value and can be set to 10.

[0060] Step S6 further includes:

[0061] If all non-skip blocks have coeff values ​​of 0, calculate sad_raw_avg for raw and recon to determine chromatic ghosting:

[0062] (1) Obtain the original pixels in raw and merge modes and calculate the average value of the UV component sad_raw_avg in each 4x4 block inside the raw and recon pixels.

[0063]

[0064] (2) Obtain the average sad_avg and maximum sad_raw_avgmax of each 4x4 block for both UV channels.

[0065] sad_raw_u_avgmax=max{sad_raw_u_avg0,...sad_raw_u_avg n}

[0066] sad_raw_v_avgmax=max{sad_raw_v_avg0,...sad_raw_v_avg n}

[0067] (3) If sad_raw_avgmax is greater than or equal to raw_sad_thrd0 in both UV channels, the chroma trailing detection is stopped and both merge and merge-skip modes are disabled; where raw_sad_thrd0 is an empirical value and can be set to 15.

[0068] The method is applied to mode selection in video encoders.

[0069] Therefore, the advantage of this application is:

[0070] 1. The solution to reduce chromatic aberration is simple to operate and easy to implement in hardware;

[0071] 2. This method for reducing chromatic aberration has high accuracy and, based on motion detection, conforms to the characteristics of determining the occurrence of chromatic aberration.

[0072] 3. In the comparison of sub-block recon between non-skip mode and skip mode, a dual threshold is used for judgment, and the mode is selected based on the severity of chroma ghosting;

[0073] 4. When there is no residual due to quantization for non-skip data, raw data is introduced to determine chromaticity ghosting. Attached Figure Description

[0074] The accompanying drawings, which are provided to further illustrate the invention and form part of this application, are not intended to limit the scope of the invention.

[0075] Figure 1 This is a screenshot illustrating an example of color image ghosting.

[0076] Figure 2 This is a schematic diagram of the method flow of the present invention. Detailed Implementation

[0077] To better understand the technical content and advantages of the present invention, the present invention will now be described in further detail with reference to the accompanying drawings.

[0078] In encoder mode selection, the RDCost scheme is commonly used. However, as QP increases, λ also increases, tending to select modes with fewer bits. For example, merge-skip or AMVP-skip modes have no residuals, and encoding these modes requires fewer bits than merge and AMVP modes. In motion regions, there is a high probability of using modes with high distortion and low bit count, which can easily lead to chromatic aberration and affect subjective quality.

[0079] Methods to reduce chroma ghosting, applied to mode selection in video encoders, can reduce chroma ghosting and improve the subjective quality of the video. This application provides an encoding method to reduce chroma ghosting, which can be described as follows:

[0080] 1. Determine whether the current block is moving by comparing the original pixel raw_prev of the reference frame with the original pixel raw of the current frame. If it is moving, it indicates that color dragging may occur; if it is not a moving block, it indicates that color dragging will not occur.

[0081] 2. Taking merge and merge-skip modes as examples, merge-skip is a special merge mode where the predicted pixel pred is the same as the reconstructed pixel recon, and also the same as the predicted pixel pred in the merge mode. Therefore, the accuracy of the merge mode's prediction can be determined by comparing the recon pixels of merge and merge-skip.

[0082] 3. Check the coeff in non-skip mode. If the coeff is not all 0, use the recon in both non-skip and skip modes to check for chromatic aberration, as shown in step 4 below. If the coeff is all 0, use raw and recon to check for chromatic aberration, as shown in step 5 below.

[0083] 4. If coeff is not all 0: Divide the UV chromaticity components into 4x4 blocks respectively, and calculate the sad value for the recon reconstruction pixels within each 4x4 block for both non-skip and skip modes. If the sad value is too large, it indicates that the mode prediction is inaccurate, and the modes with and without residuals can be directly disabled; if the sad value is within a reasonable range, it indicates that the mode without residuals has chromaticity ghosting and needs to be disabled; if the sad value is too small, it indicates that chromaticity ghosting does not occur.

[0084] 5. If coeff is all 0: then the raw and reconstructed pixels need to be used for judgment. The sad value of the UV components is calculated for the raw and reconstructed pixels within each 4x4 block. If sad is too large, it indicates that the current pred has not been restored to the UV component values ​​of the raw data, indicating color dragging, and this mode is disabled.

[0085] Furthermore, this application as Figure 2 As shown, it includes the following steps:

[0086] S0, input 32×32 or 16×16 or 8×8 blocks;

[0087] S1, motion determination;

[0088] S2, determine if it is a moving block? If yes, proceed to step S3; otherwise, end.

[0089] S3, iterate through the coeff in non-skip mode;

[0090] S4. Determine if coeff is not all zero. If yes, proceed to step S5; otherwise, proceed to step S6.

[0091] S5, calculate the sadness of the recon in skip mode and the recon in non-skip mode for each 4×4 block of UV component;

[0092] Get the maximum value of the UV component sad_max;

[0093] Check if sad_max ≥ recon_sad_thrd0. If yes, disable it (skip:disable), otherwise disable it. If no, further check if sad_max ≥ recon_sad_thrd1. If yes, disable it (skip:disable), otherwise end.

[0094] S6, calculate the sad of each 4×4 block of raw and recon for the UV component;

[0095] Get the maximum value of the UV component sad_max;

[0096] Determine if sad_max ≥ raw_sad_thrd0. If yes, disable it (skip:disable) or otherwise (not skip:disable); otherwise, end the process.

[0097] The specific implementation is as follows, the overall process:

[0098] The encoder offers CU32, CU16, and CU8 mode selections, and they are similar; the following examples all use CU16x16. The current block size is set to 16x16. In YUV420 format, the Y component block size is 16x16, and the UV component block size is 8x8. The prediction modes used for P-frames are merge, merge-skip, AMVP, AMVP-skip, and intra. The inter-frame prediction modes are merge, merge-skip, AMVP, and AMVP-skip, while the intra-frame mode is intra. Chroma motion detection is performed in merge and merge-skip modes, and also in AMVP and AMVP-skip modes. The following steps describe the chroma motion process using merge and merge-skip modes as examples; the chroma motion process is exactly the same in AMVP and AMVP-skip modes.

[0099] The motion determination in step S1 further includes:

[0100] Calculate the mean value of motion_avg, which is the sum of the absolute values ​​of the differences between each pixel in the current block (raw) and the previous frame (raw_pred) at the same position. If motion_avg is greater than the threshold motion_thrd, the current block is determined to be in motion, and motion_flag is set to 1; otherwise, it is set to 0.

[0101]

[0102] Among them, motion_thrd can be 8, which is an empirical value.

[0103] The step S2, determining whether it is a moving block, further includes:

[0104] If motion_flag is 0, the current block is stationary, and it is determined that there will be no chroma ghosting in the current block, so the chroma ghosting determination of the current block is stopped; if motion_flag is 1, the current block is moving, and the chroma ghosting determination of the current block continues.

[0105] Step S4 further includes:

[0106] Check the quantization coefficients Coeff of the luminance and chrominance components in the current block's non-skip mode and determine the quantization coefficients Coeff of the luminance and chrominance components. If not all of Coeff are 0, proceed to step S5 to calculate sad_raw_avg of the non-skip and skip mode recon to determine chrominance ghosting. If all of Coeff are 0, proceed to step S6 to calculate sad_raw_avg of the raw and non-skip mode recon to determine chrominance ghosting. Otherwise, continue with chrominance ghosting determination.

[0107] Step S5 further includes:

[0108] If the coeff of non-skip blocks is not all zero, calculate the sad_recon_avg of the recon values ​​for non-skip mode and skip mode to determine chromatic ghosting:

[0109] (1) Obtain the reconstructed pixels for merge mode and merge-skip as recon m recon ms Calculate the mean sad_recon_u_avg and sad_recon_v_avg of the UV channels for each 4x4 block within the reconstructed pixel recon.

[0110]

[0111] (2) Obtain the mean sad_avg and maximum sad_recon_u_avgmax of each 4x4 block of the uv channel inside the recon pixel recon.

[0112] sad_recon_u_avgmax=max{sad_recon_u_avg0,...sad_recon_u_avg n}

[0113] sad_recon_v_avgmax=max{sad_recon_v_avg0,...sad_recon_v_avg n}

[0114] (3) If sad_recon_u_avgmax or sad_recon_v_avgmax is greater than or equal to recon_sad_thrd0 (15, which is an empirical value) in both uv channels, then stop the chroma ghosting determination and disable both merge and merge-skip modes.

[0115] (4) If sad_recon_u_avgmax or sad_recon_v_avgmax is greater than or equal to recon_sad_thrd1 (10, which is an empirical value) in both uv channels, then stop the chroma ghosting determination and disable the merge-skip mode.

[0116] Step S6 further includes:

[0117] If all non-skip blocks have coeff values ​​of 0, calculate sad_raw_avg for raw and recon to determine chromatic ghosting:

[0118] (1) Obtain the original pixels (raw) and the reconstructed pixels (merge mode), and calculate the average value of the UV component (sad_raw_avg) of each 4x4 block inside the raw and reconstructed pixels (recon mode).

[0119]

[0120] (2) Obtain the average sad_avg and maximum sad_raw_avgmax of each 4x4 block for both UV channels.

[0121] sad_raw_u_avgmax=max{sad_raw_u_avg0,...sad_raw_u_avg n}

[0122] sad_raw_v_avgmax=max{sad_raw_v_avg0,...sad_raw_v_avg n}

[0123] (3) If sad_raw_avgmax in both UV channels is greater than or equal to raw_sad_thrd0 (15, which is an empirical value), then stop the chroma ghosting determination and disable both merge and merge-skip modes.

[0124] This application presents a hardware-friendly method for detecting and reducing chroma ghosting. It determines whether chroma ghosting occurs by checking the recon of the current block in both non-skip and skipped modes; it determines whether chroma ghosting occurs in the current block by checking the raw and recon modes; it guides the encoder's mode decision by detecting chroma ghosting; and finally, it reduces the generation of chroma ghosting in video encoding.

[0125] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. An encoding method for reducing chroma ghosting, characterized in that, The method includes: The motion of the current block is determined by comparing the original pixel raw_prev of the reference frame with the original pixel raw of the current frame. If it is moving, it indicates that color dragging may occur; if it is not a moving block, it indicates that color dragging will not occur. Assuming the use of merge and merge-skip modes, where merge-skip is a special merge mode where the predicted pixel pred is the same as the reconstructed pixel recon, and also the same as the predicted pixel pred in the merge mode; then the accuracy of the merge mode's prediction can be determined by comparing the recon pixels of merge and merge-skip. Alternatively, the use of AMVP and AMVP-skip modes follows the same process as the use of merge and merge-skip modes. Check the coeff of the non-skip mode. If the coeff is not all zero, perform a chromatic aberration check using the recon of both the non-skip and skip modes; if the coeff is all zero, perform a chromatic aberration check using both raw and recon modes. Further, this includes: If coeff is not all zero: Divide the UV chromaticity components into 4x4 blocks respectively, and calculate the sad value for the recon pixels within each 4x4 block for both non-skip and skip modes; if the sad value is too large, i.e., sad is greater than or equal to the threshold recon_sad_thrd0, where the empirical value of recon_sad_thrd0 is 15, it indicates that the mode prediction is inaccurate, and the modes with and without residuals can be directly disabled; if the sad value is within a reasonable range, i.e., sad is less than the threshold recon_sad_thrd0 and greater than or equal to the threshold recon_sad_thrd1, where the empirical value of recon_sad_thrd0 is 15 and the empirical value of recon_sad_thrd1 is 10, it indicates that the mode without residuals has chromaticity ghosting and needs to be disabled; if the sad value is too small, i.e., sad is less than the threshold recon_sad_thrd1, where the empirical value of recon_sad_thrd1 is 10, it indicates that no chromaticity ghosting occurs. If coeff is all 0, then the raw and reconstructed pixels need to be used for judgment. The sad value of the UV component is calculated for the raw and reconstructed pixels in each 4x4 block. If sad is too large, that is, sad is greater than or equal to the threshold raw_sad_thrd0, the empirical value of raw_sad_thrd0 is 15, it means that the current pred has not been restored to the UV component value of the raw data, indicating that color dragging has occurred, and then this mode is disabled.

2. The encoding method for reducing chroma ghosting according to claim 1, characterized in that, The method further includes: S0, input 32×32 or 16×16 or 8×8 blocks; S1, motion determination; S2, determine if it is a moving block? If yes, proceed to step S3; otherwise, end. S3, iterate through the coeff in non-skip mode; S4. Determine if coeff is not all zero. If yes, proceed to step S5; otherwise, proceed to step S6. S5, calculate the sad of each 4×4 block skip mode recon and non-skip mode recon for the UV component; obtain the maximum value of the UV component sad_max; Check if sad_max ≥ recon_sad_thrd0. If yes, disable it (skip:disable), otherwise disable it. If no, further check if sad_max ≥ recon_sad_thrd1. If yes, disable it (skip:disable), otherwise end. S6, calculate the sad of each 4×4 block of raw and recon for the UV component; Get the maximum value of the UV component sad_max; Determine if sad_max ≥ raw_sad_thrd0. If yes, disable it (skip:disable) or otherwise (not skip:disable); otherwise, end the process.

3. The encoding method for reducing chroma ghosting according to claim 2, characterized in that, The method assumes that cu16x16, sets the current block size to 16x16, and under the yuv420 format, the y component block size is 16x16 and the uv component block size is 8x8; The prediction modes used by P-frames are merge, merge-skip, amvp, amvp-skip, and intra; among them, the inter-frame prediction modes are merge, merge-skip, amvp, and amvp-skip, and the intra-frame mode is intra; chroma motion blur determination is carried out in the merge and merge-skip modes, and also in the amvp and amvp-skip modes; assuming that the chroma motion blur process is carried out in the merge and merge-skip modes, the chroma motion blur process in the amvp and amvp-skip modes is exactly the same.

4. The encoding method for reducing chroma ghosting according to claim 3, characterized in that, The motion determination in step S1 further includes: Calculate the mean value of motion_avg, which is the sum of the absolute values ​​of the differences between each pixel in the current raw block and the previous frame's raw_pred at the same position. If motion_avg is greater than the threshold motion_thrd, the current block is considered to be in motion, and motion_flag is set to 1; otherwise, it is set to 0. The threshold, motion_thrd, is an empirical value and can be set to 8.

5. The encoding method for reducing chroma ghosting according to claim 4, characterized in that, The step S2, determining whether it is a moving block, further includes: If motion_flag is 0, the current block is stationary, and it is determined that there will be no chroma ghosting in the current block. The chroma ghosting determination of the current block is stopped, and the process ends. If motion_flag is 1, the current block is in motion, and the chroma ghosting determination of the current block continues.

6. The encoding method for reducing chroma ghosting according to claim 5, characterized in that, Step S4 further includes: Check the quantization coefficients Coeff of the luminance and chrominance components in the current block's non-skip mode and determine the quantization coefficients Coeff of the luminance and chrominance components. If not all of Coeff are 0, proceed to step S5 to calculate sad_raw_avg of the non-skip and skip mode recon to determine chrominance ghosting. If all of Coeff are 0, proceed to step S6 to calculate sad_raw_avg of the raw and non-skip mode recon to determine chrominance ghosting. Otherwise, continue with chrominance ghosting determination.

7. The encoding method for reducing chroma ghosting according to claim 6, characterized in that, Step S5 further includes: If the coeff of non-skip blocks is not all zero, calculate the sad_recon_avg of the recon values ​​for non-skip mode and skip mode to determine chromatic ghosting: (1) Obtain the reconstructed pixels for merge mode and merge-skip as recon m and recon ms Calculate the mean sad values ​​(sad_recon_u_avg, sad_recon_v_avg) of the UV channels for each 4x4 block within the reconstructed pixel recon. (2) Obtain the mean sad_avg and maximum sad_recon_u_avgmax, sad_recon_v_avgmax of each 4x4 block of the uv channel inside the recon pixel. sad_recon_u_avgmax=max{sad_recon_u_avg0,...sad_recon_u_avg n } sad_recon_v_avgmax=max{sad_recon_v_avg0,...sad_recon_v_avg n } (3) If sad_recon_u_avgmax or sad_recon_v_avgmax is greater than or equal to recon_sad_thrd0 in both uv channels, then stop the chroma ghosting determination and disable both merge and merge-skip modes; where recon_sad_thrd0 is an empirical value and can be set to 15. (4) If sad_recon_u_avgmax or sad_recon_v_avgmax is greater than or equal to recon_sad_thrd1 in both uv channels, then stop the chroma ghosting determination and disable the merge-skip mode; where recon_sad_thrd1 is an empirical value and can be set to 10.

8. The encoding method for reducing chroma ghosting according to claim 6, characterized in that, Step S6 further includes: If all non-skip blocks have coeff values ​​of 0, calculate sad_raw_avg for raw and recon to determine chromatic ghosting: (1) Obtain the original pixels in raw and merge modes and calculate the average value of the UV component sad_raw_avg in each 4x4 block inside the raw and recon pixels. (2) Obtain the average sad_avg and maximum sad_raw_avgmax of each 4x4 block for both UV channels. sad_raw_u_avgmax=max{sad_raw_u_avg0,...sad_raw_u_avg n } sad_raw_v_avgmax=max{sad_raw_v_avg0,...sad_raw_v_avg n } (3) If sad_raw_avgmax is greater than or equal to raw_sad_thrd0 in both UV channels, the chroma trailing detection is stopped and both merge and merge-skip modes are disabled; where raw_sad_thrd0 is an empirical value and can be set to 15.

9. The encoding method for reducing chroma ghosting according to claim 1, characterized in that, The method is applied to mode selection in video encoders.