Video encoding method, apparatus, device, and medium
By performing luminance encoding on the transform unit during video encoding, determining the chrominance prediction value, and storing it in the transform unit's memory, the write-out problem is solved, and the success rate of video encoding is improved.
Patent Information
- Application Number
- CN202310149866.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-09
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-02-09
AI Technical Summary
In traditional video coding methods, when the coding unit is split into multiple transform units, the chroma prediction value is easily overwritten when written to the transform unit memory, leading to coding failure.
After the encoding unit of a video frame is divided into multiple transform units, the luminance encoding of each transform unit is completed, the chrominance prediction value of each pixel is determined and stored in the memory of the transform unit. It is ensured that the size of the stored chrominance prediction value is consistent with the size of the transform unit memory to avoid write out of bounds.
This improves the success rate of chroma encoding of pixels in the transform unit, thereby increasing the overall success rate of video encoding.
Smart Images

Figure CN118474381B_ABST
Abstract
Description
Technical Field
[0001] This application relates to video processing technology, belonging to the field of cloud technology, and in particular to a video encoding method, apparatus, device and medium. Background Technology
[0002] Video is a continuous sequence of images, composed of consecutive frames, each frame representing an image. Due to the persistence of vision, when the frame sequence is played at a certain rate, we perceive a continuous video. Because consecutive frames are highly similar, the original video needs to be encoded and compressed to remove spatial and temporal redundancy for easy storage and transmission. Video encoding includes luminance coding and chrominance coding for video frames. For each image block to be encoded within a video frame, luminance coding is typically performed first, followed by chrominance coding. For chrominance coding, the chrominance value of each pixel in the image block must first be predicted.
[0003] In traditional techniques, when a coding unit is split into multiple transformation units, chroma prediction is performed on the prediction unit that matches the coding unit, and the predicted chroma value is written into the memory of the transformation unit of the coding unit. This can cause write out of bounds, resulting in encoding failure. Summary of the Invention
[0004] Therefore, it is necessary to provide a video encoding method, apparatus, device, and medium that can improve the success rate of video encoding in response to the above-mentioned technical problems.
[0005] In a first aspect, this application provides a video encoding method, the method comprising:
[0006] When encoding a video frame, if the encoding unit of the video frame is split into multiple transformation units, then for each transformation unit, after the luminance encoding of the pixels in the transformation unit is completed, the chrominance prediction value corresponding to each pixel in the transformation unit is determined.
[0007] The memory corresponding to the transformation unit is determined, and the chromaticity prediction value corresponding to each pixel in the transformation unit is stored in the memory of the transformation unit.
[0008] The chromaticity prediction values stored in the memory of the transformation unit are used to perform chromaticity encoding on the pixels in the transformation unit.
[0009] Secondly, this application provides a video encoding apparatus, the apparatus comprising:
[0010] The determination module is used to determine the chromaticity prediction value corresponding to each pixel in the transformation unit after the luminance encoding of the pixels in the transformation unit is completed when encoding the video frame.
[0011] A storage module is used to determine the memory corresponding to the transformation unit and store the chromaticity prediction values corresponding to each pixel in the transformation unit into the memory of the transformation unit.
[0012] The chromaticity prediction values stored in the memory of the transformation unit are used to perform chromaticity encoding on the pixels in the transformation unit.
[0013] In one embodiment, the determining module is further configured to, if the encoding unit of the video frame is split into multiple transform units, after performing luminance encoding on the pixels in the multiple transform units, perform chroma prediction using the prediction unit corresponding to the encoding unit as the basic unit of chroma prediction to obtain the chroma prediction result corresponding to the prediction unit; wherein, the chroma prediction result corresponding to the prediction unit includes the chroma prediction value of each pixel in the multiple transform units; the size of the prediction unit matches the size of the corresponding encoding unit; for each transform unit, based on the position of the transform unit in the encoding unit, determine the chroma prediction value corresponding to each pixel in the transform unit from the chroma prediction result corresponding to the prediction unit.
[0014] In one embodiment, the determining module is further configured to, for each transformation unit, determine a prediction region corresponding to the transformation unit based on the position of the transformation unit in the encoding unit; the prediction region is located in the prediction unit; determine a chroma prediction value matching the prediction region from the chroma prediction result corresponding to the prediction unit, and use each of the chroma prediction values matching the prediction region as the chroma prediction values corresponding to each pixel in the transformation unit.
[0015] In one embodiment, the determining module is further configured to, if the encoding unit of the video frame is split into multiple transform units, perform chroma prediction for each transform unit after luminance encoding of the pixels in the transform unit is completed, using the transform unit as the basic unit for chroma prediction, to obtain the chroma prediction result corresponding to the transform unit; wherein the chroma prediction result corresponding to the transform unit includes the chroma prediction value corresponding to each pixel in the transform unit.
[0016] In one embodiment, the chromaticity prediction value corresponding to each pixel in the transformation unit is obtained from the chromaticity prediction result corresponding to the target unit; the target unit is a basic unit of chromaticity prediction; the target unit includes a prediction unit corresponding to the transformation unit or the encoding unit; the determining module is further configured to, for each target pixel in the target unit, determine target neighboring pixels that are spatially adjacent to the target pixel and have completed luminance encoding from the video frame; determine a set of filtering coefficients based on reference pixels; the reference pixels are pixels around the target unit that satisfy a proximity relationship and have completed luminance and chromaticity encoding; the set of filtering coefficients is used to characterize the mapping relationship between the luminance value and chromaticity value of the pixel; perform chromaticity prediction on the target pixel according to the luminance reconstruction value of the target pixel, the luminance reconstruction value of the target neighboring pixels and the set of filtering coefficients to obtain the chromaticity prediction value of the target pixel; the chromaticity prediction result corresponding to the target unit includes the chromaticity prediction value corresponding to each target pixel in the target unit.
[0017] In one embodiment, the filter coefficient group includes multiple filter coefficients; the determining module is further configured to convolve the luminance reconstruction value of the target pixel and the luminance reconstruction value of each target neighboring pixel with the corresponding filter coefficient, and obtain the chromaticity prediction value of the target pixel based on the convolution result.
[0018] In one embodiment, the determining module is further configured to determine at least one chromaticity adjustment parameter based on at least one of the luminance reconstruction value and the average color depth of the target pixel; convolve the luminance reconstruction value of the target pixel, the luminance reconstruction value of each of the target neighboring pixels, and each of the chromaticity adjustment parameters with the corresponding filtering coefficients, and obtain the chromaticity prediction value of the target pixel based on the convolution result.
[0019] In one embodiment, the region composed of the reference pixels is a pixel reference region; when the target unit is the transformation unit, the pixel reference region that satisfies the proximity relationship and whose brightness and chroma are both encoded includes at least one of the following pixel regions: the pixel region corresponding to at least one encoded neighboring transformation unit of the transformation unit; the neighboring transformation unit is spatially adjacent to the transformation unit; the pixel region around the transformation unit that satisfies a first proximity condition and whose brightness and chroma are both encoded; and the pixel region around the prediction unit corresponding to the transformation unit that satisfies a second proximity condition and whose brightness and chroma are both encoded.
[0020] In one embodiment, the neighborhood transform unit includes at least one of a sibling transform unit and a non-sibling transform unit; the sibling transform unit is located in the same coding unit as the transform unit; the non-sibling transform unit is located in a different coding unit than the transform unit.
[0021] In one embodiment, the filter coefficient set includes multiple solved filter coefficients; the luminance reconstruction value and chrominance reconstruction value of the reference pixel are known; the determining module is further configured to construct an error equation based on the error between the chrominance prediction value and the chrominance reconstruction value corresponding to each of the reference pixels; wherein, the chrominance prediction value of each reference pixel is determined based on the luminance reconstruction value of the reference pixel, the luminance reconstruction values of the neighboring pixels of the reference pixel, and the preset filter coefficients to be solved; by minimizing the solution of the error equation, the filter coefficients to be solved are solved to obtain each of the solved filter coefficients.
[0022] In one embodiment, the chromaticity reconstruction value of the reference pixel includes chromaticity reconstruction values under multiple chromaticity components; the determining module is further configured to construct an error equation corresponding to the chromaticity component for each chromaticity component based on the error between the chromaticity prediction value and the chromaticity reconstruction value of the chromaticity component corresponding to each reference pixel; wherein, the chromaticity prediction value of each reference pixel under the chromaticity component is determined based on the luminance reconstruction value of the reference pixel, the luminance reconstruction values of the neighboring pixels of the reference pixel, and the filter coefficients to be solved corresponding to the chromaticity component; by minimizing the solution of the error equation corresponding to the chromaticity component, the filter coefficients to be solved corresponding to the chromaticity component are obtained to predict the chromaticity prediction value under the chromaticity component.
[0023] In one embodiment, the filter coefficient set includes multiple filter coefficient sets corresponding to each chromaticity component; the chromaticity prediction value of the target pixel includes chromaticity prediction values under multiple chromaticity components; the determining module is further configured to perform chromaticity prediction on the target pixel for each chromaticity component based on the luminance reconstruction value of the target pixel, the luminance reconstruction value of the target neighboring pixels, and the filter coefficient set corresponding to the chromaticity component, to obtain the chromaticity prediction value of the target pixel under the chromaticity component.
[0024] Thirdly, this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the various method embodiments of this application.
[0025] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in the various method embodiments of this application.
[0026] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps in the various method embodiments of this application.
[0027] In the aforementioned video encoding methods, apparatuses, devices, media, and computer program products, when encoding video frames, if the encoding unit of the video frame is divided into multiple transform units, for each transform unit, after performing luminance encoding on the pixels within that transform unit, the chrominance prediction value corresponding to each pixel within that transform unit is determined. Then, the memory corresponding to that transform unit is determined, and the chrominance prediction values corresponding to each pixel within that transform unit are stored in the memory of that transform unit. Since the chrominance prediction values stored in the memory of that transform unit are determined based on that transform unit, the memory size occupied by the chrominance prediction values stored in the memory of that transform unit is consistent with the memory size of that transform unit, which can avoid write out-of-bounds errors. Therefore, performing chrominance encoding on the pixels within the transform unit based on the chrominance prediction values stored in the memory of the transform unit can improve the success rate of chrominance encoding for the pixels within the transform unit, thereby improving the success rate of video encoding. Attached Figure Description
[0028] Figure 1 This is a diagram illustrating the application environment of a video encoding method in one embodiment;
[0029] Figure 2 This is a flowchart illustrating a video encoding method in one embodiment;
[0030] Figure 3 This is a schematic diagram of the traditional process of writing the chromaticity prediction values obtained by prediction units into the transformation unit;
[0031] Figure 4 This is a schematic diagram illustrating the process of determining the chromaticity prediction result corresponding to the target unit in one embodiment;
[0032] Figure 5 This is a schematic diagram illustrating the relative positions of the target pixel and its neighboring pixels in one embodiment.
[0033] Figure 6 This is a schematic diagram of a target unit and a pixel reference region consisting of the target unit and the corresponding reference pixels in one embodiment.
[0034] Figure 7 This is a flowchart illustrating a video encoding method in another embodiment;
[0035] Figure 8 This is a structural block diagram of a video encoding device in one embodiment;
[0036] Figure 9 This is an internal structural diagram of a computer device in one embodiment;
[0037] Figure 10 This is a diagram of the internal structure of a computer device in another embodiment. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0039] The video encoding method provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on other servers. Terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, cloud security, host security and other network security services, CDN, and basic cloud computing services such as big data and artificial intelligence platforms. Terminal 102 and server 104 can be directly or indirectly connected via wired or wireless communication, which is not limited herein.
[0040] When encoding video frames, if the encoding unit of the video frame is divided into multiple transform units, then for each transform unit, after the server 104 has performed luminance encoding on the pixels in the transform unit, it can determine the chrominance prediction value corresponding to each pixel in the transform unit. Furthermore, the server 104 can determine the memory corresponding to the transform unit and store the chrominance prediction values corresponding to each pixel in the transform unit into the memory of the transform unit. The chrominance prediction values stored in the memory of the transform unit are used for chrominance encoding of the pixels in the transform unit.
[0041] It is understood that after the server 104 completes the encoding of the video frame, it can send the encoded video frame to the terminal 102, which can then decode and display the video frame. This embodiment does not limit this; it is understood that... Figure 1 The application scenarios shown are for illustrative purposes only and are not limited to these.
[0042] In one embodiment, such as Figure 2 As shown, a video encoding method is provided. This method can be applied to computer devices, which can be terminals or servers. The method can be executed independently by the terminal or server, or it can be implemented through interaction between the terminal and the server. This embodiment illustrates the application of this method to a computer device as an example, including the following steps:
[0043] Step 202: When encoding a video frame, if the encoding unit of the video frame is split into multiple transform units, then for each transform unit, after the luminance encoding of the pixels in the transform unit is completed, the chrominance prediction value corresponding to each pixel in the transform unit is determined.
[0044] A video consists of multiple video frames. A coding unit is the basic unit for encoding video frames. The sizes of the coding units corresponding to different video frames can be the same or different. A coding unit can be divided into multiple transform units; that is, a single coding unit may contain multiple transform units. Each transform unit may contain multiple pixels. It can be understood that encoding a video frame involves first performing luminance encoding, and then performing chroma encoding. In other words, for each pixel within the same coding unit, luminance encoding is performed on each pixel within that unit first, and then chroma encoding is performed after luminance encoding is complete.
[0045] Specifically, video coding may include intra-frame coding for each video frame. When encoding video frames, if the coding unit of a video frame is divided into multiple transform units, the computer device may first perform luminance coding on the pixels within each transform unit. After completing the luminance coding of the pixels within the transform unit, the computer device may determine the predicted chrominance value corresponding to each pixel within that transform unit.
[0046] In one embodiment, for each transform unit, after luminance encoding of the pixels within that transform unit is completed, the computer device can perform chrominance prediction using the target unit as the basic unit for chrominance prediction, obtaining the chrominance prediction result corresponding to the target unit. Furthermore, the computer device can determine the chrominance prediction value corresponding to each pixel within the transform unit based on the chrominance prediction result corresponding to the target unit. Here, the target unit includes a prediction unit corresponding to the transform unit or encoding unit, and the size of the prediction unit matches the size of the corresponding encoding unit; that is, the size of the prediction unit is the same as the size of the corresponding encoding unit. It can be understood that the size of the prediction unit being the same as the size of the corresponding encoding unit means that the number and position of pixels within the prediction unit are the same as the number and position of pixels within the encoding unit, respectively.
[0047] Step 204: Determine the memory corresponding to the transformation unit, and store the chromaticity prediction values corresponding to each pixel in the transformation unit into the memory of the transformation unit; wherein, the chromaticity prediction values stored in the memory of the transformation unit are used to perform chromaticity encoding on the pixels in the transformation unit.
[0048] Specifically, after the encoding unit is divided into multiple transform units, the total memory corresponding to the encoding unit is also divided into multiple memory locations matching each transform unit. For each transform unit in the encoding unit, the computer device can determine the memory location corresponding to that transform unit and store the chroma prediction values corresponding to each pixel within that transform unit into the memory location of that transform unit. The chroma prediction values stored in the memory location of the transform unit are used to perform chroma encoding on the pixels within that transform unit.
[0049] In one embodiment, for each transformation unit in the encoding unit, after storing the chromaticity prediction values corresponding to each pixel in the transformation unit into the memory of the transformation unit, for each pixel in the transformation unit, the computer device can obtain the original chromaticity value of the pixel, determine the chromaticity error between the original chromaticity value of the pixel and the chromaticity prediction value of the pixel, and encode the chromaticity error.
[0050] In the aforementioned video encoding method, when encoding video frames, if the encoding unit of a video frame is divided into multiple transform units, then for each transform unit, after performing luminance encoding on the pixels within that transform unit, the chrominance prediction value corresponding to each pixel within that transform unit is determined. Furthermore, the memory corresponding to that transform unit is determined, and the chrominance prediction values corresponding to each pixel within that transform unit are stored in the memory of that transform unit. Since the chrominance prediction values stored in the memory of that transform unit are determined based on that transform unit, the memory size occupied by the chrominance prediction values stored in the memory of that transform unit is consistent with the memory size of that transform unit, which can avoid write out-of-bounds errors. Therefore, performing chrominance encoding on the pixels within the transform unit based on the chrominance prediction values stored in the memory of that transform unit can improve the success rate of chrominance encoding for the pixels within the transform unit, thereby improving the success rate of video encoding.
[0051] It is understandable that in traditional technologies, such as Figure 3 As shown, when the coding unit is divided into multiple transform units, a pixel reference region is constructed and filtering coefficients are determined on a predictive unit basis. Then, chroma is predicted on a predictive unit basis based on the determined filtering coefficients, resulting in chroma prediction values that conform to the memory size of the predictive unit. These chroma prediction values are then written into the memory of the transform unit. Since the memory of the predictive unit is larger than the memory of the transform unit, writing chroma prediction values that conform to the memory size of the predictive unit to the memory of the transform unit will cause write-out errors, leading to encoding failure. However, the video encoding method of this application, for each transform unit, first determines the chroma prediction values corresponding to each pixel within the transform unit, and then stores these chroma prediction values in the memory of the transform unit. Since the memory size occupied by the chroma prediction values stored in the transform unit's memory is consistent with the memory size of the transform unit, write-out errors can be avoided, thereby improving the success rate of video encoding.
[0052] In one embodiment, if the encoding unit of a video frame is divided into multiple transform units, then for each transform unit, after the luminance encoding of the pixels in the transform unit is completed, the chrominance prediction value corresponding to each pixel in the transform unit is determined, including: if the encoding unit of the video frame is divided into multiple transform units, after the luminance encoding of the pixels in the multiple transform units is completed, chrominance prediction is performed using the prediction unit corresponding to the encoding unit as the basic unit of chrominance prediction, and the chrominance prediction result corresponding to the prediction unit is obtained; wherein, the chrominance prediction result corresponding to the prediction unit includes the chrominance prediction value of each pixel in the multiple transform units; the size of the prediction unit matches the size of the corresponding encoding unit; for each transform unit, based on the position of the transform unit in the encoding unit, the chrominance prediction value corresponding to each pixel in the transform unit is determined from the chrominance prediction result corresponding to the prediction unit.
[0053] Specifically, if the coding unit of a video frame is divided into multiple transform units, after luminance encoding of the pixels in the multiple transform units is completed, the computer device can use the prediction unit corresponding to the coding unit as the basic unit for chrominance prediction to perform chrominance prediction, obtaining the chrominance prediction result corresponding to the prediction unit. It can be understood that the chrominance prediction result corresponding to the prediction unit includes the chrominance prediction values of each pixel within the multiple transform units. The size of the prediction unit matches the size of the corresponding coding unit; that is, the size of the prediction unit is the same as the size of the corresponding coding unit. For each transform unit, the computer device can determine the chrominance prediction values corresponding to each pixel within that transform unit from the chrominance prediction results corresponding to the prediction unit, based on the transform unit's location within the coding unit.
[0054] In one embodiment, for each transform unit, the computer device can determine the chromaticity prediction value that matches the position from the chromaticity prediction result corresponding to the prediction unit, based on the position of the transform unit in the coding unit, and use it as the chromaticity prediction value corresponding to each pixel in the transform unit.
[0055] In the above embodiments, chroma prediction is performed using the prediction unit corresponding to the encoding unit as the basic unit of chroma prediction, thereby obtaining the chroma prediction result corresponding to the prediction unit. For each transform unit, based on the position of the transform unit in the encoding unit, the chroma prediction value corresponding to each pixel within the transform unit is determined from the chroma prediction result corresponding to the prediction unit. Then, the chroma prediction values corresponding to each pixel within the transform unit are stored in the memory of the transform unit. This ensures that the memory size occupied by the chroma prediction values stored in the memory of the transform unit is consistent with the memory size of the transform unit itself, avoiding write out-of-bounds errors and further improving the encoding success rate.
[0056] In one embodiment, for each transform unit, based on the position of the transform unit in the encoding unit, the chromaticity prediction value corresponding to each pixel in the transform unit is determined from the chromaticity prediction result corresponding to the prediction unit, including: for each transform unit, based on the position of the transform unit in the encoding unit, determining the prediction region corresponding to the transform unit; the prediction region is located in the prediction unit; determining the chromaticity prediction value matching the prediction region from the chromaticity prediction result corresponding to the prediction unit, and using each chromaticity prediction value matching the prediction region as the chromaticity prediction value corresponding to each pixel in the transform unit.
[0057] The prediction region corresponding to the transformation unit is the image region in the prediction unit that matches the transformation unit.
[0058] Specifically, for each transform unit, the computer device can determine the prediction region corresponding to that transform unit from the prediction unit corresponding to that coding unit, based on the transform unit's location within the coding unit. It can be understood that the prediction region is located within the prediction unit, and the prediction unit includes multiple prediction regions corresponding to each transform unit. Furthermore, the computer device can determine the chroma prediction value matching the prediction region from the chroma prediction results corresponding to the prediction unit, and use each chroma prediction value matching the prediction region as the chroma prediction value corresponding to each pixel within the transform unit.
[0059] In the above embodiments, by first determining the prediction region corresponding to each transformation unit, then determining the chromaticity prediction value that matches each prediction region from the chromaticity prediction result corresponding to the prediction unit, and using each chromaticity prediction value that matches the prediction region as the chromaticity prediction value corresponding to each pixel in the corresponding transformation unit, the accuracy of the chromaticity prediction value corresponding to each pixel in each transformation unit can be improved.
[0060] In one embodiment, if the encoding unit of a video frame is divided into multiple transform units, then for each transform unit, after the luminance encoding of the pixels in the transform unit is completed, the chrominance prediction value corresponding to each pixel in the transform unit is determined, including: if the encoding unit of a video frame is divided into multiple transform units, then for each transform unit, after the luminance encoding of the pixels in the transform unit is completed, chrominance prediction is performed with the transform unit as the basic unit of chrominance prediction to obtain the chrominance prediction result corresponding to the transform unit; wherein, the chrominance prediction result corresponding to the transform unit includes the chrominance prediction value corresponding to each pixel in the transform unit.
[0061] Specifically, if the coding unit of a video frame is divided into multiple transform units, then for each transform unit, after the luminance encoding of the pixels in the transform unit is completed, the computer device can use the transform unit as the basic unit for chrominance prediction to perform chrominance prediction, obtaining the chrominance prediction result corresponding to the transform unit. The chrominance prediction result corresponding to the transform unit includes the chrominance prediction value corresponding to each pixel within the transform unit. It can be understood that the computer device can directly use the chrominance prediction values included in the chrominance prediction result corresponding to the transform unit as the chrominance prediction values corresponding to each pixel within that transform unit.
[0062] In the above embodiments, chroma prediction is performed using the transformation unit as the basic unit for chroma prediction, resulting in a chroma prediction result corresponding to the transformation unit. This result includes the chroma prediction value for each pixel within the transformation unit. Furthermore, the chroma prediction values for each pixel within the transformation unit are stored in the memory of that transformation unit. This ensures that the memory size occupied by the chroma prediction values stored in the transformation unit's memory is consistent with the memory size of the transformation unit itself, preventing write out-of-bounds errors and further improving the encoding success rate.
[0063] In one embodiment, such as Figure 4 As shown, the chromaticity prediction value corresponding to each pixel within the transform unit is obtained from the chromaticity prediction result corresponding to the target unit; the target unit is the basic unit of chromaticity prediction; the target unit includes the prediction unit corresponding to the transform unit or the coding unit; the method also includes:
[0064] Step 402: For each target pixel in the target unit, determine the target neighbor pixels that are spatially adjacent to the target pixel and whose brightness encoding is completed from the video frame.
[0065] In this context, neighboring pixels are pixels in a video frame that are spatially adjacent to the target pixel. Target neighboring pixels are the luminance-encoded neighboring pixels in a video frame.
[0066] Specifically, for each target pixel in the target unit, the computer device can determine the neighboring pixels spatially adjacent to the target pixel from the video frame. It can be understood that there are multiple neighboring pixels for the target pixel. The computer device can determine the luminance-encoded target neighboring pixel from these multiple neighboring pixels.
[0067] In one embodiment, if there are pixels with incomplete luminance encoding among the multiple neighboring pixels of the target pixel, the computer device may take the pixels in the video frame that are spatially adjacent to the pixels with incomplete luminance encoding and have completed luminance encoding, as well as the neighboring pixels of the target pixel with completed luminance encoding, as the target neighboring pixels.
[0068] For example, such as Figure 5 As shown, pixel C represents the target pixel in the target unit, and pixels E, S, W, and N represent the neighboring pixels spatially adjacent to the target pixel C in the four cardinal directions (north, south, east, west), respectively. If pixels E, S, W, and N have all completed luminance encoding, then they are the target neighboring pixels of the target pixel C. If any of pixels E, S, W, or N have incomplete luminance encoding, the computer device can consider the pixels spatially adjacent to the incompletely luminance-encoded pixels in the video frame, as well as the neighboring pixels of the luminance-encoded target pixel, as the target neighboring pixels.
[0069] In one embodiment, for each target pixel in the target unit, if the target pixel is located on the boundary of the target unit, the target neighbor pixels of the target pixel may include pixels that do not belong to the target unit.
[0070] Step 404: Determine the filter coefficient set based on the reference pixels; the reference pixels are pixels around the target unit that satisfy the distance relationship and have completed luminance and chrominance encoding; the filter coefficient set is used to characterize the mapping relationship between the luminance value and chrominance value of the pixel.
[0071] The reference pixel is the pixel used as a reference during the chromaticity prediction process. The filter coefficient set includes multiple filter coefficients. The proximity relationship is used to characterize the proximity to the target unit.
[0072] Specifically, the computer device can identify reference pixels in the video frame that satisfy the proximity relationship around the target unit and have completed luminance and chrominance encoding, and determine the filter coefficient set based on the reference pixels.
[0073] In one embodiment, the filter coefficient set includes multiple filter coefficients. The computer device can construct an error equation based on the chromaticity values corresponding to each reference pixel. It is understood that the error equation includes the filter coefficients to be solved. Furthermore, the computer device can solve the error equation to obtain the filter coefficients.
[0074] In one embodiment, the proximity relationship can be a condition used to characterize that the distance between the target unit and the target unit is within a preset pixel distance.
[0075] In one embodiment, the proximity relationship further includes at least one of the following: a pixel region located above the target unit in the video frame and within a first preset pixel distance; a pixel region extending to the right from the target unit at a second preset pixel distance; a pixel region located to the left of the target unit and within a first preset pixel distance; and a pixel region extending downward from below the boundary of the target unit at a third preset pixel distance.
[0076] In one embodiment, the proximity relationship further includes at least one of the following: a pixel region located above the target unit in the video frame and within a first preset pixel distance; a pixel region extending to the right from the target unit by a prediction unit width; a pixel region located to the left of the target unit and within a first preset pixel distance; and a pixel region extending downward from below the target unit boundary by a prediction unit height.
[0077] In one embodiment, the computer device may use pixels that are close to the target unit and have completed luminance and chrominance encoding as initial reference pixels. To ensure that the initial reference pixels and the target pixels located at the boundary of the target unit are available in the subsequent chrominance prediction process, the computer device may extend the boundary of the initial reference pixels and the boundary of the target unit, and use the initial reference pixels and the extended pixels as reference pixels of the target unit.
[0078] For example, such as Figure 6 As shown, 601 is the target unit, 602 is the initial reference pixel that is close to the target unit and has completed luminance and chrominance encoding, and 603 is the pixel obtained by expanding the boundary of the initial reference pixel. It can be understood that the initial reference pixel 602 and the expanded pixel 603 together constitute the reference pixel of the target unit.
[0079] Step 406: Based on the luminance reconstruction value of the target pixel, the luminance reconstruction value of the target neighboring pixels, and the filtering coefficient group, perform chromaticity prediction on the target pixel to obtain the chromaticity prediction value of the target pixel; the chromaticity prediction result corresponding to the target unit includes the chromaticity prediction value corresponding to each target pixel in the target unit.
[0080] Among them, the brightness reconstruction value is the brightness value of the pixel after brightness encoding is completed.
[0081] Specifically, the filter coefficient set includes multiple filter coefficients. Since the luminance encoding of the target pixel and its neighboring pixels has been completed, the luminance reconstruction values of the target pixel and each of its neighboring pixels are known. It can be understood that for a pixel with completed luminance encoding, the computer device can directly obtain its luminance reconstruction value. Based on the luminance reconstruction values of the target pixel, the luminance reconstruction values of each neighboring pixel, and the multiple filter coefficients included in the filter coefficient set, the computer device can perform chrominance prediction on the target pixel to obtain its chrominance prediction value. It can be understood that the chrominance prediction result corresponding to the target unit includes the chrominance prediction value corresponding to each target pixel within the target unit.
[0082] In one embodiment, the computer device can perform mathematical operations on the luminance reconstruction value of the target pixel and the luminance reconstruction values of each target neighboring pixel with the corresponding filter coefficients in the filter coefficient group, and perform chromaticity prediction on the target pixel based on the operation results to obtain the chromaticity prediction value of the target pixel.
[0083] In one embodiment, when the target unit is a prediction unit corresponding to an encoding unit, for each transformation unit, the computer device can determine the prediction region corresponding to the transformation unit based on the location of the transformation unit within the encoding unit, wherein the prediction region is located within the prediction unit. The computer device can determine the chroma prediction value matching the prediction region from the chroma prediction result corresponding to the prediction unit, and use each chroma prediction value matching the prediction region as the chroma prediction value corresponding to each pixel within the transformation unit. When the target unit is a transformation unit, the computer device can use the chroma prediction result corresponding to the transformation unit as the chroma prediction value corresponding to each pixel within the transformation unit. Furthermore, the computer device can determine the memory corresponding to the transformation unit and store the chroma prediction values corresponding to each pixel within the transformation unit into the memory of the transformation unit. The chroma prediction values stored in the memory of the transformation unit are used for chroma encoding of the pixels within the transformation unit.
[0084] In one embodiment, the computer device can downsample the luminance reconstruction values corresponding to each target pixel and each reference pixel in the target unit to match the magnitude of the chromaticity components. Then, the computer device can determine a set of filtering coefficients based on the downsampled luminance reconstruction values of the reference pixels, and perform chromaticity prediction on the target pixel based on the downsampled luminance reconstruction values of the target pixel, the downsampled luminance reconstruction values of the target neighboring pixels, and the filtering coefficient set, thereby obtaining the predicted chromaticity value of the target pixel. This can further improve the accuracy of the predicted chromaticity value of the target pixel.
[0085] In the above embodiments, for each target pixel in the target unit, the filter coefficient group corresponding to the target unit is determined by the reference pixel, and the chromaticity prediction of the target pixel is performed based on the luminance reconstruction value of the target pixel, the luminance reconstruction value of the target neighboring pixels and the filter coefficient group to obtain the chromaticity prediction value of the target pixel, thereby obtaining the chromaticity prediction result corresponding to the target unit, which improves the accuracy of the chromaticity prediction result corresponding to the target unit.
[0086] In one embodiment, the filter coefficient set includes multiple filter coefficients; based on the luminance reconstruction value of the target pixel, the luminance reconstruction value of the target neighboring pixels, and the filter coefficient set, chrominance prediction is performed on the target pixel to obtain the chrominance prediction value of the target pixel, including: convolving the luminance reconstruction value of the target pixel and the luminance reconstruction value of each target neighboring pixel with the corresponding filter coefficients, and obtaining the chrominance prediction value of the target pixel based on the convolution result.
[0087] Specifically, the computer device can convolve the reconstructed brightness value of the target pixel and the reconstructed brightness values of each neighboring pixel with the corresponding filter coefficients in the filter coefficient group, and perform chromaticity prediction on the target pixel based on the convolution result to obtain the chromaticity prediction value of the target pixel.
[0088] In one embodiment, a computer device can fuse the convolution results corresponding to the target pixel and each of the target's neighboring pixels, and obtain the chromaticity prediction value of the target pixel based on the fusion result.
[0089] In the above embodiments, by convolving the luminance reconstruction value of the target pixel and the luminance reconstruction value of each target neighboring pixel with the corresponding filtering coefficients, and obtaining the chromaticity prediction value of the target pixel based on the convolution result, the accuracy of the chromaticity prediction value of the target pixel can be improved, thereby further improving the accuracy of the chromaticity prediction result corresponding to the target unit.
[0090] In one embodiment, convolving the luminance reconstruction value of the target pixel and the luminance reconstruction values of each target neighboring pixel with corresponding filtering coefficients, and obtaining the chromaticity prediction value of the target pixel based on the convolution result, includes: determining at least one chromaticity adjustment parameter based on at least one of the luminance reconstruction value of the target pixel and the average color depth; convolving the luminance reconstruction value of the target pixel, the luminance reconstruction values of each target neighboring pixel, and each chromaticity adjustment parameter with corresponding filtering coefficients, and obtaining the chromaticity prediction value of the target pixel based on the convolution result.
[0091] The mean color depth is the median value of the color depth. Color depth is used to characterize the number of color levels of a pixel. For example, if a pixel has a color depth of 10 bits (1024 color levels), and the median value of 1024 is 512, then the mean color depth of that pixel is 512. The chromaticity adjustment parameter is used to adjust the chromaticity during the chromaticity prediction process for a pixel.
[0092] Specifically, the computer device can determine at least one chromaticity adjustment parameter based on at least one of the luminance reconstruction value and the average color depth of the target pixel. Furthermore, the computer device can convolve the luminance reconstruction value of the target pixel, the luminance reconstruction values of each target neighboring pixel, and each chromaticity adjustment parameter with their respective filtering coefficients, and obtain the predicted chromaticity value of the target pixel based on the convolution result.
[0093] In one embodiment, the chromaticity adjustment parameters include a first chromaticity adjustment parameter and a second chromaticity adjustment parameter. The computer device can determine the first chromaticity adjustment parameter based on the average color depth of the target pixel. Furthermore, the computer device can convolve the reconstructed brightness value of the target pixel, the reconstructed brightness values of each target neighboring pixel, the first chromaticity adjustment parameter, and the second chromaticity adjustment parameter with corresponding filtering coefficients, and obtain the predicted chromaticity value of the target pixel based on the convolution result.
[0094] In one embodiment, for each target pixel in the target unit, the predicted chromaticity value of the target pixel can be determined by the following formula:
[0095] predChromaVal=c0C+c1N+c2S+c3E+c4W+c5P+c6B;
[0096] Where P = (C*C + midVal) >> bitDepth; B = midVal. C represents the reconstructed brightness value of the target pixel, N, S, E, and W represent the reconstructed brightness values of each neighboring pixel of the target, B represents the first chromaticity adjustment parameter, P represents the second chromaticity adjustment parameter, bitDepth represents the color depth, midVal represents the average color depth, c0, c1, c2, c3, c4, c5, and c6 represent the filtering coefficients, and predChromaVal represents the predicted chromaticity value of the target pixel.
[0097] In the above embodiments, by convolving the luminance reconstruction value of the target pixel, the luminance reconstruction value of each target neighboring pixel, and each chromaticity adjustment parameter used to correct the final chromaticity prediction result with the corresponding filter coefficients, and obtaining the chromaticity prediction value of the target pixel based on the convolution result, the accuracy of the chromaticity prediction value of the target pixel can be improved, thereby further improving the accuracy of the chromaticity prediction result corresponding to the target unit.
[0098] In one embodiment, the region composed of reference pixels is a pixel reference region; when the target unit is a transform unit, the pixel reference region that satisfies the proximity relationship and whose brightness and chroma are both encoded includes at least one of the following pixel regions: the pixel region corresponding to at least one neighboring transform unit that has been encoded by the transform unit; the neighboring transform unit and the transform unit being spatially adjacent; the pixel region around the transform unit that satisfies the first proximity condition and whose brightness and chroma are both encoded; and the pixel region around the prediction unit corresponding to the transform unit that satisfies the second proximity condition and whose brightness and chroma are both encoded.
[0099] In one embodiment, the first proximity condition may be that the distance between the transformer unit and the transformer unit is within a preset pixel distance.
[0100] In one embodiment, the second proximity condition may be that the distance between the prediction unit and the prediction unit is within a preset pixel distance.
[0101] In one embodiment, for each transform unit in the same coding unit, these transform units may each correspond to a different pixel reference region. Specifically, for each transform unit, the pixel reference region corresponding to the transform unit includes at least one of the following pixel regions: the pixel region corresponding to at least one neighboring transform unit that has been encoded by the transform unit; the neighboring transform units that are spatially adjacent to the transform unit; the pixel region around the transform unit that satisfies a first proximity condition and whose luminance and chrominance are both encoded; and the pixel region around the prediction unit corresponding to the transform unit that satisfies a second proximity condition and whose luminance and chrominance are both encoded.
[0102] In one embodiment, for each transform unit in the same coding unit, these transform units may correspond to the same pixel reference region. Specifically, the same pixel reference region corresponding to these transform units may be a pixel region around the prediction unit corresponding to the transform unit that satisfies the second proximity condition and whose luminance and chrominance are both encoded.
[0103] In the above embodiments, by taking at least one of the pixel regions corresponding to the neighboring transformation units that have completed the encoding of at least one transformation unit, the pixel regions around the transformation unit that satisfy the first proximity condition and whose brightness and chroma are both encoded, and the pixel regions around the prediction unit corresponding to the transformation unit that satisfy the second proximity condition and whose brightness and chroma are both encoded, as the pixel reference regions, the determination of the pixel reference regions becomes more flexible and diverse.
[0104] In one embodiment, the neighborhood transform unit includes at least one of a sibling transform unit and a non-sibling transform unit; the sibling transform unit and the transform unit are located in the same coding unit; the non-sibling transform unit and the transform unit are located in different coding units.
[0105] In the above embodiments, by limiting the neighborhood transformation unit to include sibling transformation units and non-sibling transformation units, the selection of neighborhood transformation units can be broadened, thereby improving the accuracy of chromaticity prediction.
[0106] In one embodiment, the filter coefficient set includes multiple solved filter coefficients; the luminance reconstruction value and chrominance reconstruction value of the reference pixel are known; determining the filter coefficient set based on the reference pixel includes: constructing an error equation based on the error between the chrominance prediction value and the chrominance reconstruction value corresponding to each reference pixel; wherein, the chrominance prediction value of each reference pixel is determined based on the luminance reconstruction value of the reference pixel, the luminance reconstruction values of the neighboring pixels of the reference pixel, and the preset filter coefficients to be solved; by minimizing the solution of the error equation, each filter coefficient to be solved is solved to obtain each solved filter coefficient.
[0107] Specifically, the computer device can construct an error equation based on the error between the predicted chromaticity value and the reconstructed chromaticity value corresponding to each reference pixel. The predicted chromaticity value for each reference pixel is determined based on the reconstructed luminance value of the reference pixel, the reconstructed luminance values of its neighboring pixels, and preset filtering coefficients to be solved. It can be understood that the predicted chromaticity value for each reference pixel is essentially an expression composed of the reconstructed luminance value of the reference pixel, the reconstructed luminance values of its neighboring pixels, and preset filtering coefficients to be solved. This expression includes unknowns, namely the filtering coefficients to be solved. The computer device can minimize the solution of the error equation to solve for each unknown, i.e., each filtering coefficient, to obtain the solved filtering coefficients.
[0108] In one embodiment, the error equation can be a mean square error equation constructed from the error between the predicted and reconstructed chromaticity values corresponding to each reference pixel. A computer device can solve for each filter coefficient by minimizing the solution of the mean square error equation, thus obtaining the solved filter coefficients.
[0109] In the above embodiments, an error equation is constructed by the error between the chromaticity prediction value and the chromaticity reconstruction value corresponding to each reference pixel. By minimizing the solution of the error equation, each filter coefficient to be solved is obtained, thereby improving the accuracy of the filter coefficient and further improving the accuracy of chromaticity prediction.
[0110] In one embodiment, the chromaticity reconstructed value of a reference pixel includes chromaticity reconstructed values under multiple chromaticity components. An error equation is constructed based on the error between the chromaticity predicted value and the chromaticity reconstructed value corresponding to each reference pixel. This includes: for each chromaticity component, constructing an error equation corresponding to the chromaticity component based on the error between the chromaticity predicted value and the chromaticity reconstructed value of the chromaticity component corresponding to each reference pixel. The chromaticity predicted value of each reference pixel under the chromaticity component is determined based on the luminance reconstructed value of the reference pixel, the luminance reconstructed values of the neighboring pixels of the reference pixel, and the filter coefficients to be solved corresponding to the chromaticity component. The filter coefficients to be solved are obtained by minimizing the solution of the error equation, including: minimizing the solution of the error equation corresponding to the chromaticity component to solve the filter coefficients to be solved corresponding to the chromaticity component, obtaining the filter coefficients used to predict the chromaticity predicted value under the chromaticity component.
[0111] Specifically, the chromaticity reconstructed value of the reference pixel includes chromaticity reconstructed values under multiple chromaticity components. For each chromaticity component, the computer device can construct an error equation corresponding to that chromaticity component based on the error between the chromaticity predicted value and the chromaticity reconstructed value of that chromaticity component for each reference pixel. It can be understood that the chromaticity predicted value of each reference pixel under that chromaticity component is determined based on the luminance reconstructed value of the reference pixel, the luminance reconstructed values of the neighboring pixels of the reference pixel, and the filter coefficients to be solved for that chromaticity component. Furthermore, the computer device can solve for the filter coefficients to be solved for that chromaticity component by minimizing the solution of the error equation corresponding to that chromaticity component, thus obtaining the filter coefficients used to predict the chromaticity predicted value under that chromaticity component.
[0112] In one embodiment, the chromaticity reconstructed value of a reference pixel includes the chromaticity reconstructed value under a first chromaticity component and the chromaticity reconstructed value under a second chromaticity component. For the first chromaticity component, the computer device can construct an error equation corresponding to the first chromaticity component based on the error between the predicted chromaticity value of each reference pixel under the first chromaticity component and the chromaticity reconstructed value of that first chromaticity component. It can be understood that the predicted chromaticity value of each reference pixel under the first chromaticity component is determined based on the luminance reconstructed value of the reference pixel, the luminance reconstructed values of the neighboring pixels of the reference pixel, and the filter coefficients to be solved for the first chromaticity component. Furthermore, the computer device can solve for the filter coefficients to be solved for the first chromaticity component by minimizing the solution of the error equation corresponding to the first chromaticity component, thereby obtaining the filter coefficients used to predict the chromaticity predicted value under the first chromaticity component. For the second chromaticity component, the computer device can construct an error equation corresponding to the second chromaticity component based on the error between the predicted chromaticity value of each reference pixel under the second chromaticity component and the chromaticity reconstructed value of that second chromaticity component. It can be understood that the predicted chromaticity value of each reference pixel under the second chromaticity component is determined based on the reconstructed luminance value of the reference pixel, the reconstructed luminance values of the neighboring pixels of the reference pixel, and the filter coefficients to be solved for the second chromaticity component. Furthermore, the computer device can solve for the filter coefficients to be solved for the second chromaticity component by minimizing the solution of the error equation corresponding to the second chromaticity component, thus obtaining the filter coefficients used to predict the predicted chromaticity value under the second chromaticity component.
[0113] In the above embodiments, for each chromaticity component, an error equation corresponding to the chromaticity component is constructed based on the error between the chromaticity predicted value and the chromaticity reconstructed value of the chromaticity component corresponding to each reference pixel. By minimizing the solution of the error equation corresponding to the chromaticity component, the filter coefficients to be solved for the chromaticity component are obtained, thus improving the accuracy of the filter coefficients for the chromaticity predicted value of each chromaticity component.
[0114] In one embodiment, the filter coefficient set includes multiple filter coefficient sets corresponding to multiple chromaticity components; the chromaticity prediction value of the target pixel includes chromaticity prediction values under multiple chromaticity components; chromaticity prediction of the target pixel is performed based on the luminance reconstruction value of the target pixel, the luminance reconstruction value of the target neighboring pixels, and the filter coefficient set to obtain the chromaticity prediction value of the target pixel, including: for each chromaticity component, chromaticity prediction of the target pixel is performed based on the luminance reconstruction value of the target pixel, the luminance reconstruction value of the target neighboring pixels, and the filter coefficient set corresponding to the chromaticity component to obtain the chromaticity prediction value of the target pixel under the chromaticity component.
[0115] Specifically, the filter coefficient set includes multiple filter coefficient sets corresponding to each chromaticity component. For each chromaticity component, the computer device can perform chromaticity prediction on the target pixel based on the luminance reconstruction value of the target pixel, the luminance reconstruction values of the target neighboring pixels, and the filter coefficient set corresponding to that chromaticity component, to obtain the chromaticity prediction value of the target pixel under that chromaticity component.
[0116] In one embodiment, the filter coefficient set includes filter coefficient sets corresponding to the first chromaticity component and the second chromaticity component, respectively. For the first chromaticity component, the computer device can perform chromaticity prediction on the target pixel based on the reconstructed luminance value of the target pixel, the reconstructed luminance values of the target neighboring pixels, and the filter coefficient set corresponding to the first chromaticity component, to obtain the predicted chromaticity value of the target pixel under the first chromaticity component. For the second chromaticity component, the computer device can perform chromaticity prediction on the target pixel based on the reconstructed luminance value of the target pixel, the reconstructed luminance values of the target neighboring pixels, and the filter coefficient set corresponding to the second chromaticity component, to obtain the predicted chromaticity value of the target pixel under the second chromaticity component.
[0117] In the above embodiments, for each chromaticity component, chromaticity prediction is performed on the target pixel using the reconstructed luminance value of the target pixel, the reconstructed luminance values of the target neighboring pixels, and the filtering coefficient set corresponding to the chromaticity component, thus obtaining the chromaticity prediction value of the target pixel under each chromaticity component. This improves the accuracy of the chromaticity prediction value of the target pixel under each chromaticity component.
[0118] like Figure 7 As shown, in one embodiment, a video encoding method is provided. This method can be applied to a computer device, which can be a terminal or a server. The method can be executed independently by the terminal or server, or it can be implemented through interaction between the terminal and the server. This embodiment uses the application of this method to a computer device as an example for illustration. The method specifically includes the following steps:
[0119] Step 702: When encoding a video frame, if the encoding unit of the video frame is divided into multiple transform units, then for each target pixel in the target unit, determine the target neighboring pixels in the video frame that are spatially adjacent to the target pixel and have completed luminance encoding; wherein, the target unit is the basic unit of chrominance prediction; the target unit includes the prediction unit corresponding to the transform unit or the encoding unit.
[0120] Step 704: For each of the multiple chromaticity components, construct an error equation corresponding to the chromaticity component based on the error between the chromaticity prediction value and the chromaticity reconstruction value of each reference pixel in the chromaticity component. Here, the reference pixel is a pixel around the target unit that satisfies the proximity relationship and has completed luminance and chromaticity encoding. The chromaticity prediction value of each reference pixel in the chromaticity component is determined based on the luminance reconstruction value of the reference pixel, the luminance reconstruction values of the neighboring pixels of the reference pixel, and the filter coefficients to be solved for the chromaticity component.
[0121] In one embodiment, the region composed of reference pixels is a pixel reference region; when the target unit is a transform unit, the pixel reference region that satisfies the proximity relationship and whose brightness and chroma are both encoded includes at least one of the following pixel regions: the pixel region corresponding to at least one neighboring transform unit that has been encoded by the transform unit; the neighboring transform unit and the transform unit being spatially adjacent; the pixel region around the transform unit that satisfies the first proximity condition and whose brightness and chroma are both encoded; and the pixel region around the prediction unit corresponding to the transform unit that satisfies the second proximity condition and whose brightness and chroma are both encoded.
[0122] In one embodiment, the neighborhood transform unit includes at least one of a sibling transform unit and a non-sibling transform unit; the sibling transform unit and the transform unit are located in the same coding unit; the non-sibling transform unit and the transform unit are located in different coding units.
[0123] Step 706: By minimizing the solution of the error equation corresponding to the chromaticity component, the filter coefficients to be solved for the chromaticity component are obtained, thus obtaining the filter coefficients used to predict the chromaticity prediction value under the chromaticity component.
[0124] Step 708: Determine at least one chromaticity adjustment parameter based on at least one of the luminance reconstruction value and the average color depth of the target pixel.
[0125] Step 710: Convolve the reconstructed brightness value of the target pixel, the reconstructed brightness value of each target neighboring pixel, and each chromaticity adjustment parameter with the corresponding filter coefficients of the chromaticity components, and obtain the chromaticity prediction value of the target pixel under the chromaticity components based on the convolution result; wherein, the chromaticity prediction result corresponding to the target unit includes the chromaticity prediction value corresponding to each target pixel in the target unit.
[0126] Step 712: When the target unit is the prediction unit corresponding to the coding unit, for each transformation unit, the prediction region corresponding to the transformation unit is determined according to the position of the transformation unit in the coding unit; the prediction region is located in the prediction unit.
[0127] Step 714: Determine the chromaticity prediction value that matches the prediction region from the chromaticity prediction results corresponding to the prediction unit, and use each chromaticity prediction value that matches the prediction region as the chromaticity prediction value corresponding to each pixel in the transformation unit.
[0128] Step 716: When the target unit is a transformation unit, the chromaticity prediction result corresponding to the transformation unit is used as the chromaticity prediction value corresponding to each pixel in the transformation unit.
[0129] Step 718: Determine the memory corresponding to the transformation unit, and store the chromaticity prediction values corresponding to each pixel in the transformation unit into the memory of the transformation unit; wherein, each chromaticity prediction value stored in the memory of the transformation unit is used to perform chromaticity encoding on the pixels in the transformation unit.
[0130] This application also provides an application scenario where the aforementioned video encoding method is applied. Specifically, this video encoding method can be applied to encoding scenarios for live video in live video streaming. It is understood that in live video streaming scenarios, it is necessary to encode the luminance and chrominance of each frame of the live video. When encoding live video frames, if the encoding unit of the live video frame is divided into multiple transform units, the computer device can determine, for each target pixel in the target unit, target neighboring pixels that are spatially adjacent to the target pixel and have completed luminance encoding from the live video frame. Here, the target unit is the basic unit of chrominance prediction; the target unit includes prediction units corresponding to transform units or encoding units. For each of the multiple chrominance components, an error equation corresponding to the chrominance component is constructed based on the error between the chrominance prediction value and the chrominance reconstruction value of each reference pixel under the chrominance component. Here, the reference pixel is a pixel around the target unit that satisfies a proximity relationship and has completed luminance and chrominance encoding. The chrominance prediction value of each reference pixel under the chrominance component is determined based on the luminance reconstruction value of the reference pixel, the luminance reconstruction values of the neighboring pixels of the reference pixel, and the filter coefficients to be solved for the chrominance component.
[0131] The region composed of reference pixels is a pixel reference region. When the target unit is a transform unit, the pixel reference region that satisfies the proximity relationship and has both luminance and chrominance encoded includes at least one of the following pixel regions: the pixel region corresponding to at least one neighboring transform unit that has been encoded by the transform unit; the neighboring transform unit and the transform unit being spatially adjacent; the pixel region around the transform unit that satisfies the first proximity condition and has both luminance and chrominance encoded; the pixel region around the prediction unit corresponding to the transform unit that satisfies the second proximity condition and has both luminance and chrominance encoded. The neighboring transform unit includes at least one of sibling transform units and non-sibling transform units; the sibling transform unit and the transform unit are located in the same coding unit; the non-sibling transform unit and the transform unit are located in different coding units.
[0132] The computer device can solve for the filter coefficients corresponding to the chromaticity components by minimizing the solution of the error equation corresponding to the chromaticity components, thereby obtaining the filter coefficients used to predict the chromaticity prediction value under the chromaticity components; determine at least one chromaticity adjustment parameter based on at least one of the luminance reconstruction value of the target pixel and the mean color depth; convolve the luminance reconstruction value of the target pixel, the luminance reconstruction value of each target neighboring pixel, and each chromaticity adjustment parameter with the corresponding filter coefficients corresponding to the chromaticity components, and obtain the chromaticity prediction value of the target pixel under the chromaticity components based on the convolution result; wherein, the chromaticity prediction result corresponding to the target unit includes the chromaticity prediction value corresponding to each target pixel in the target unit.
[0133] When the target unit is a prediction unit corresponding to an encoding unit, for each transform unit, the computer device can determine the prediction region corresponding to the transform unit based on its location within the encoding unit; the prediction region is located within the prediction unit; from the chroma prediction results corresponding to the prediction unit, the chroma prediction values matching the prediction region are determined, and each chroma prediction value matching the prediction region is used as the chroma prediction value corresponding to each pixel within the transform unit. When the target unit is a transform unit, the computer device can use the chroma prediction results corresponding to the transform unit as the chroma prediction values corresponding to each pixel within the transform unit.
[0134] The computer device can determine the memory corresponding to the transformation unit and store the chroma prediction values corresponding to each pixel in the transformation unit into the memory of the transformation unit. These chroma prediction values stored in the memory of the transformation unit are used for chroma encoding of the pixels in the transformation unit. The video encoding method of this application can improve the success rate of live video encoding.
[0135] This application also provides another application scenario where the aforementioned video encoding method is applied. Specifically, this video encoding method can be applied to encoding on-demand videos in video-on-demand, and also to encoding conference videos in video conferencing. It is understood that in video-on-demand scenarios, luminance and chrominance encoding of each frame of the on-demand video is required. In video conferencing scenarios, luminance and chrominance encoding of each frame of the conference video is required. The video encoding method of this application can improve the success rate of both on-demand video encoding and conference video encoding.
[0136] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially, these steps are not necessarily executed in that order. Unless otherwise expressly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the above embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0137] In one embodiment, such as Figure 8 As shown, a video encoding device 800 is provided. This device can be a software module, a hardware module, or a combination of both, integrated into a computer device. Specifically, the device includes:
[0138] The determination module 802 is used to determine the chromaticity prediction value corresponding to each pixel in the transformation unit after the luminance encoding of the pixels in the transformation unit is completed when encoding the video frame.
[0139] The storage module 804 is used to determine the memory corresponding to the transformation unit and store the chromaticity prediction value corresponding to each pixel in the transformation unit into the memory of the transformation unit.
[0140] The chromaticity prediction values stored in the memory of the transformation unit are used to perform chromaticity encoding on the pixels in the transformation unit.
[0141] In one embodiment, the determining module 802 is further configured to, if the encoding unit of a video frame is split into multiple transform units, after the luminance encoding of the pixels in the multiple transform units is completed, perform chrominance prediction using the prediction unit corresponding to the encoding unit as the basic unit of chrominance prediction, and obtain the chrominance prediction result corresponding to the prediction unit; wherein, the chrominance prediction result corresponding to the prediction unit includes the chrominance prediction value of each pixel in the multiple transform units; the size of the prediction unit matches the size of the corresponding encoding unit; for each transform unit, based on the position of the transform unit in the encoding unit, determine the chrominance prediction value corresponding to each pixel in the transform unit from the chrominance prediction result corresponding to the prediction unit.
[0142] In one embodiment, the determining module 802 is further configured to, for each transform unit, determine the prediction region corresponding to the transform unit based on the position of the transform unit in the encoding unit; the prediction region is located in the prediction unit; determine the chromaticity prediction value that matches the prediction region from the chromaticity prediction result corresponding to the prediction unit, and use each chromaticity prediction value that matches the prediction region as the chromaticity prediction value corresponding to each pixel in the transform unit.
[0143] In one embodiment, the determining module 802 is further configured to, if the encoding unit of a video frame is split into multiple transform units, perform chromaticity prediction for each transform unit after the luminance encoding of the pixels in the transform unit is completed, using the transform unit as the basic unit for chromaticity prediction, to obtain the chromaticity prediction result corresponding to the transform unit; wherein the chromaticity prediction result corresponding to the transform unit includes the chromaticity prediction value corresponding to each pixel in the transform unit.
[0144] In one embodiment, the chromaticity prediction value corresponding to each pixel in the transformation unit is obtained from the chromaticity prediction result corresponding to the target unit; the target unit is the basic unit of chromaticity prediction; the target unit includes the prediction unit corresponding to the transformation unit or the encoding unit; the determining module 802 is further configured to, for each target pixel in the target unit, determine the target neighboring pixels that are spatially adjacent to the target pixel and have completed luminance encoding from the video frame; determine the filtering coefficient set based on the reference pixels; the reference pixels are pixels around the target unit that satisfy the distance proximity relationship and have completed luminance and chromaticity encoding; the filtering coefficient set is used to characterize the mapping relationship between the luminance value and the chromaticity value of the pixel; perform chromaticity prediction on the target pixel according to the luminance reconstruction value of the target pixel, the luminance reconstruction value of the target neighboring pixels and the filtering coefficient set, to obtain the chromaticity prediction value of the target pixel; the chromaticity prediction result corresponding to the target unit includes the chromaticity prediction value corresponding to each target pixel in the target unit.
[0145] In one embodiment, the filter coefficient group includes multiple filter coefficients; the determining module 802 is further configured to convolve the luminance reconstruction value of the target pixel and the luminance reconstruction value of each target neighboring pixel with the corresponding filter coefficients, and obtain the chromaticity prediction value of the target pixel based on the convolution result.
[0146] In one embodiment, the determining module 802 is further configured to determine at least one chromaticity adjustment parameter based on at least one of the luminance reconstruction value and the average color depth of the target pixel; convolve the luminance reconstruction value of the target pixel, the luminance reconstruction value of each target neighboring pixel, and each chromaticity adjustment parameter with the corresponding filtering coefficients respectively, and obtain the chromaticity prediction value of the target pixel based on the convolution result.
[0147] In one embodiment, the region composed of reference pixels is a pixel reference region; when the target unit is a transform unit, the pixel reference region that satisfies the proximity relationship and whose brightness and chroma are both encoded includes at least one of the following pixel regions: the pixel region corresponding to at least one neighboring transform unit that has been encoded by the transform unit; the neighboring transform unit and the transform unit being spatially adjacent; the pixel region around the transform unit that satisfies the first proximity condition and whose brightness and chroma are both encoded; and the pixel region around the prediction unit corresponding to the transform unit that satisfies the second proximity condition and whose brightness and chroma are both encoded.
[0148] In one embodiment, the neighborhood transform unit includes at least one of a sibling transform unit and a non-sibling transform unit; the sibling transform unit and the transform unit are located in the same coding unit; the non-sibling transform unit and the transform unit are located in different coding units.
[0149] In one embodiment, the filter coefficient set includes multiple solved filter coefficients; the luminance reconstruction value and chrominance reconstruction value of the reference pixel are known; the determining module 802 is further configured to construct an error equation based on the error between the chrominance prediction value and the chrominance reconstruction value corresponding to each reference pixel; wherein, the chrominance prediction value of each reference pixel is determined based on the luminance reconstruction value of the reference pixel, the luminance reconstruction value of the neighboring pixels of the reference pixel, and the preset filter coefficients to be solved; by minimizing the solution of the error equation, the filter coefficients to be solved are solved to obtain the solved filter coefficients.
[0150] In one embodiment, the chromaticity reconstruction value of the reference pixel includes chromaticity reconstruction values under multiple chromaticity components; the determining module 802 is further configured to construct an error equation corresponding to the chromaticity component for each chromaticity component by means of the error between the chromaticity prediction value and the chromaticity reconstruction value of the chromaticity component corresponding to each reference pixel; wherein, the chromaticity prediction value of each reference pixel under the chromaticity component is determined based on the luminance reconstruction value of the reference pixel, the luminance reconstruction value of the neighboring pixels of the reference pixel, and the filter coefficients to be solved corresponding to the chromaticity component; by minimizing the solution of the error equation corresponding to the chromaticity component, the filter coefficients to be solved corresponding to the chromaticity component are solved to obtain the filter coefficients used to predict the chromaticity prediction value under the chromaticity component.
[0151] In one embodiment, the filter coefficient set includes multiple filter coefficient sets corresponding to multiple chromaticity components; the chromaticity prediction value of the target pixel includes chromaticity prediction values under multiple chromaticity components; the determining module 802 is further configured to perform chromaticity prediction on the target pixel for each chromaticity component based on the luminance reconstruction value of the target pixel, the luminance reconstruction value of the target neighboring pixels, and the filter coefficient set corresponding to the chromaticity component, so as to obtain the chromaticity prediction value of the target pixel under the chromaticity component.
[0152] In the aforementioned video encoding apparatus, when encoding video frames, if the encoding unit of a video frame is divided into multiple transform units, for each transform unit, after performing luminance encoding on the pixels within that transform unit, the chrominance prediction value corresponding to each pixel within that transform unit is determined. Then, the memory corresponding to that transform unit is determined, and the chrominance prediction values corresponding to each pixel within that transform unit are stored in the memory of that transform unit. Since the chrominance prediction values stored in the memory of that transform unit are determined based on that transform unit, the memory size occupied by the chrominance prediction values stored in the memory of that transform unit is consistent with the memory size of that transform unit, which can avoid write out-of-bounds errors. Therefore, performing chrominance encoding on the pixels within the transform unit based on the chrominance prediction values stored in the memory of that transform unit can improve the success rate of chrominance encoding for the pixels within the transform unit, thereby improving the success rate of video encoding.
[0153] Each module in the aforementioned video encoding device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware within or independently of the processor in a computer device, or stored in software within the memory of the computer device, so that the processor can call and execute the operations corresponding to each module.
[0154] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 9As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and databases. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media to run. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a video encoding method.
[0155] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a video encoding method. The display unit of the computer device is used to form a visually visible image. It can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0156] Those skilled in the art will understand that Figure 9 and Figure 10The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0157] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0158] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0159] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0160] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0161] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0162] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0163] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A video encoding method, characterized in that, The method includes: When encoding a video frame, if the encoding unit of the video frame is split into multiple transformation units, then for each transformation unit, after the luminance encoding of the pixels in the transformation unit is completed, the chrominance prediction value corresponding to each pixel in the transformation unit is determined. The memory corresponding to the transformation unit is determined, and the chromaticity prediction value corresponding to each pixel in the transformation unit is stored in the memory of the transformation unit. The memory size occupied by the chromaticity prediction value stored in the memory of the transformation unit is consistent with the memory size corresponding to the transformation unit. The chromaticity prediction values stored in the memory of the transformation unit are used to perform chromaticity encoding on the pixels in the transformation unit.
2. The method according to claim 1, characterized in that, If the encoding unit of the video frame is divided into multiple transform units, then for each transform unit, after performing luminance encoding on the pixels in the transform unit, the chrominance prediction value corresponding to each pixel in the transform unit is determined, including: If the encoding unit of the video frame is divided into multiple transformation units, after the luminance encoding of the pixels in the multiple transformation units is completed, chrominance prediction is performed using the prediction unit corresponding to the encoding unit as the basic unit of chrominance prediction to obtain the chrominance prediction result corresponding to the prediction unit; wherein, the chrominance prediction result corresponding to the prediction unit includes the chrominance prediction value of each pixel in the multiple transformation units; the size of the prediction unit matches the size of the corresponding encoding unit. For each transformation unit, based on the position of the transformation unit in the encoding unit, the chromaticity prediction value corresponding to each pixel in the transformation unit is determined from the chromaticity prediction result corresponding to the prediction unit.
3. The method according to claim 2, characterized in that, For each of the transformation units, determining the chromaticity prediction value corresponding to each pixel within the transformation unit from the chromaticity prediction result corresponding to the prediction unit, based on the position of the transformation unit within the coding unit, includes: For each of the transform units, a prediction region corresponding to the transform unit is determined based on the position of the transform unit within the coding unit; the prediction region is located within the prediction unit. From the chromaticity prediction results corresponding to the prediction unit, determine the chromaticity prediction value that matches the prediction region, and use each of the chromaticity prediction values that matches the prediction region as the chromaticity prediction value corresponding to each pixel in the transformation unit.
4. The method according to claim 1, characterized in that, If the encoding unit of the video frame is divided into multiple transform units, then for each transform unit, after performing luminance encoding on the pixels in the transform unit, the chrominance prediction value corresponding to each pixel in the transform unit is determined, including: If the encoding unit of the video frame is divided into multiple transformation units, then for each transformation unit, after the luminance encoding of the pixels in the transformation unit is completed, chrominance prediction is performed using the transformation unit as the basic unit for chrominance prediction, and the chrominance prediction result corresponding to the transformation unit is obtained. The chromaticity prediction result corresponding to the transformation unit includes the chromaticity prediction value corresponding to each pixel point within the transformation unit.
5. The method according to claim 1, characterized in that, The chromaticity prediction value corresponding to each pixel in the transformation unit is obtained from the chromaticity prediction result corresponding to the target unit; the target unit is the basic unit of chromaticity prediction. The target unit includes a prediction unit corresponding to the transformation unit or the coding unit; the method further includes: For each target pixel in the target unit, determine the target neighbor pixels that are spatially adjacent to the target pixel and whose brightness encoding is completed from the video frame; The filter coefficient set is determined based on reference pixels; the reference pixels are pixels around the target unit that satisfy the proximity relationship and have completed luminance and chrominance encoding; the filter coefficient set is used to characterize the mapping relationship between the luminance value and chrominance value of the pixel; Based on the luminance reconstruction value of the target pixel, the luminance reconstruction value of the target neighboring pixels, and the filtering coefficient set, chromaticity prediction is performed on the target pixel to obtain the chromaticity prediction value of the target pixel; the chromaticity prediction result corresponding to the target unit includes the chromaticity prediction value corresponding to each target pixel in the target unit.
6. The method according to claim 5, characterized in that, The filtering coefficient set includes multiple filtering coefficients; the step of performing chromaticity prediction on the target pixel based on the luminance reconstruction value of the target pixel, the luminance reconstruction values of the target neighboring pixels, and the filtering coefficient set to obtain the chromaticity prediction value of the target pixel includes: The luminance reconstruction value of the target pixel and the luminance reconstruction value of each of the target neighboring pixels are convolved with the corresponding filtering coefficients, and the chromaticity prediction value of the target pixel is obtained based on the convolution result.
7. The method according to claim 6, characterized in that, The step of convolving the reconstructed luminance value of the target pixel and the reconstructed luminance values of each of the target neighboring pixels with the corresponding filtering coefficients, and obtaining the chromaticity prediction value of the target pixel based on the convolution result, includes: At least one chromaticity adjustment parameter is determined based on at least one of the luminance reconstruction value and the average color depth value of the target pixel; The luminance reconstruction value of the target pixel, the luminance reconstruction value of each of the target neighboring pixels, and each of the chromaticity adjustment parameters are convolved with the corresponding filtering coefficients, and the chromaticity prediction value of the target pixel is obtained based on the convolution result.
8. The method according to claim 5, characterized in that, The region formed by the reference pixels is a pixel reference region; when the target unit is the transformation unit, the pixel reference region that satisfies the distance proximity relationship and whose brightness and chroma are both encoded includes at least one of the following pixel regions: The pixel region corresponding to at least one encoded neighboring transformation unit of the transformation unit; the neighboring transformation unit is spatially adjacent to the transformation unit; The pixel region surrounding the transformation unit that satisfies the first proximity condition and whose brightness and chromaticity are both encoded; The pixel region surrounding the prediction unit corresponding to the transformation unit that satisfies the second proximity condition and whose brightness and chromaticity are both encoded.
9. The method according to claim 8, characterized in that, The neighborhood transform unit includes at least one of a sibling transform unit and a non-sibling transform unit; the sibling transform unit and the transform unit are located in the same coding unit; the non-sibling transform unit and the transform unit are located in different coding units.
10. The method according to claim 5, characterized in that, The filter coefficient set includes multiple solved filter coefficients; the luminance reconstruction value and chrominance reconstruction value of the reference pixel are known; the step of determining the filter coefficient set based on the reference pixel includes: An error equation is constructed based on the error between the chromaticity prediction value and the chromaticity reconstruction value corresponding to each reference pixel; wherein, the chromaticity prediction value of each reference pixel is determined based on the luminance reconstruction value of the reference pixel, the luminance reconstruction values of the neighboring pixels of the reference pixel, and the preset filtering coefficients to be solved. By minimizing the solution of the error equation, the filter coefficients to be solved are obtained.
11. The method according to claim 10, characterized in that, The chromaticity reconstruction value of the reference pixel includes chromaticity reconstruction values under multiple chromaticity components; The step of constructing an error equation based on the error between the predicted chromaticity value and the reconstructed chromaticity value corresponding to each of the reference pixels includes: For each chromaticity component, an error equation corresponding to the chromaticity component is constructed based on the error between the chromaticity prediction value and the chromaticity reconstruction value of each reference pixel under the chromaticity component; wherein, the chromaticity prediction value of each reference pixel under the chromaticity component is determined based on the luminance reconstruction value of the reference pixel, the luminance reconstruction values of the neighboring pixels of the reference pixel, and the filtering coefficients to be solved for the chromaticity component; The step of minimizing the solution of the error equation to solve for each filter coefficient to be solved, thereby obtaining each solved filter coefficient, includes: By minimizing the solution of the error equation corresponding to the chromaticity component, the filter coefficients to be solved for the chromaticity component are obtained, thus obtaining the filter coefficients used to predict the chromaticity prediction value under the chromaticity component.
12. The method according to claim 5, characterized in that, The filtering coefficient set includes multiple filtering coefficient sets corresponding to each chromaticity component; the chromaticity prediction value of the target pixel includes chromaticity prediction values under multiple chromaticity components. The step of performing chromaticity prediction on the target pixel based on the luminance reconstruction value of the target pixel, the luminance reconstruction values of the target neighboring pixels, and the filtering coefficient set to obtain the chromaticity prediction value of the target pixel includes: For each chromaticity component, based on the luminance reconstruction value of the target pixel, the luminance reconstruction value of the target neighboring pixels, and the filtering coefficient group corresponding to the chromaticity component, chromaticity prediction is performed on the target pixel to obtain the chromaticity prediction value of the target pixel under the chromaticity component.
13. A video encoding device, characterized in that, The device includes: The determination module is used to determine the chromaticity prediction value corresponding to each pixel in the transformation unit after the luminance encoding of the pixels in the transformation unit is completed when encoding the video frame. The storage module is used to determine the memory corresponding to the transformation unit and store the chromaticity prediction values corresponding to each pixel in the transformation unit into the memory of the transformation unit. The memory size occupied by the chromaticity prediction values stored in the memory of the transformation unit is consistent with the memory size corresponding to the transformation unit. The chromaticity prediction values stored in the memory of the transformation unit are used to perform chromaticity encoding on the pixels in the transformation unit.
14. The apparatus according to claim 13, characterized in that, The determining module is further configured to, if the encoding unit of the video frame is split into multiple transform units, after performing luminance encoding on the pixels in the multiple transform units, perform chroma prediction using the prediction unit corresponding to the encoding unit as the basic unit for chroma prediction, and obtain the chroma prediction result corresponding to the prediction unit; wherein, the chroma prediction result corresponding to the prediction unit includes the chroma prediction value of each pixel in the multiple transform units; the size of the prediction unit matches the size of the corresponding encoding unit; for each transform unit, based on the position of the transform unit in the encoding unit, determine the chroma prediction value corresponding to each pixel in the transform unit from the chroma prediction result corresponding to the prediction unit.
15. The apparatus according to claim 14, characterized in that, The determining module is further configured to, for each transformation unit, determine the prediction region corresponding to the transformation unit based on the position of the transformation unit in the encoding unit; the prediction region is located in the prediction unit; determine the chromaticity prediction value that matches the prediction region from the chromaticity prediction result corresponding to the prediction unit, and use each of the chromaticity prediction values that matches the prediction region as the chromaticity prediction values corresponding to each pixel in the transformation unit.
16. The apparatus according to claim 13, characterized in that, The determining module is further configured to, if the encoding unit of the video frame is split into multiple transformation units, perform chroma prediction for each transformation unit after performing luminance encoding on the pixels in the transformation unit, using the transformation unit as the basic unit for chroma prediction, to obtain the chroma prediction result corresponding to the transformation unit; wherein the chroma prediction result corresponding to the transformation unit includes the chroma prediction value corresponding to each pixel in the transformation unit.
17. The apparatus according to claim 13, characterized in that, The chromaticity prediction value corresponding to each pixel in the transformation unit is obtained from the chromaticity prediction result corresponding to the target unit; the target unit is the basic unit of chromaticity prediction; the target unit includes the prediction unit corresponding to the transformation unit or the encoding unit; the determining module is further used to determine, for each target pixel in the target unit, a target neighboring pixel in the video frame that is spatially adjacent to the target pixel and has completed luminance encoding. Determine the filter coefficient group based on reference pixels; The reference pixel is a pixel around the target unit that satisfies a proximity relationship and has completed luminance and chrominance encoding; the filter coefficient set is used to characterize the mapping relationship between the luminance value and chrominance value of the pixel; based on the luminance reconstruction value of the target pixel, the luminance reconstruction value of the target neighboring pixels, and the filter coefficient set, chrominance prediction is performed on the target pixel to obtain the chrominance prediction value of the target pixel. The chromaticity prediction result corresponding to the target unit includes the chromaticity prediction value corresponding to each target pixel in the target unit.
18. The apparatus according to claim 17, characterized in that, The filtering coefficient group includes multiple filtering coefficients; the determining module is further configured to convolve the luminance reconstruction value of the target pixel and the luminance reconstruction value of each target neighboring pixel with the corresponding filtering coefficient, and obtain the chromaticity prediction value of the target pixel based on the convolution result.
19. The apparatus according to claim 18, characterized in that, The determining module is further configured to determine at least one chromaticity adjustment parameter based on at least one of the luminance reconstruction value and the average color depth of the target pixel; to convolve the luminance reconstruction value of the target pixel, the luminance reconstruction value of each of the target neighboring pixels, and each of the chromaticity adjustment parameters with the corresponding filtering coefficients, and to obtain the chromaticity prediction value of the target pixel based on the convolution result.
20. The apparatus according to claim 17, characterized in that, The region formed by the reference pixels is a pixel reference region. When the target unit is the transformation unit, the pixel reference region that satisfies the proximity relationship and whose brightness and chroma are both encoded includes at least one of the following pixel regions: the pixel region corresponding to at least one encoded neighboring transformation unit of the transformation unit; the neighboring transformation unit is spatially adjacent to the transformation unit; the pixel region around the transformation unit that satisfies the first proximity condition and whose brightness and chroma are both encoded; and the pixel region around the prediction unit corresponding to the transformation unit that satisfies the second proximity condition and whose brightness and chroma are both encoded.
21. The apparatus according to claim 20, characterized in that, The neighborhood transform unit includes at least one of a sibling transform unit and a non-sibling transform unit; the sibling transform unit and the transform unit are located in the same coding unit; the non-sibling transform unit and the transform unit are located in different coding units.
22. The apparatus according to claim 17, characterized in that, The filter coefficient set includes multiple solved filter coefficients; the luminance reconstruction value and chrominance reconstruction value of the reference pixel are known; the determining module is further used to construct an error equation based on the error between the chrominance prediction value and the chrominance reconstruction value corresponding to each of the reference pixels; wherein, the chrominance prediction value of each reference pixel is determined based on the luminance reconstruction value of the reference pixel, the luminance reconstruction values of the neighboring pixels of the reference pixel, and the preset filter coefficients to be solved; by minimizing the solution of the error equation, the filter coefficients to be solved are solved to obtain each solved filter coefficient.
23. The apparatus according to claim 22, characterized in that, The chromaticity reconstruction value of the reference pixel includes chromaticity reconstruction values under multiple chromaticity components; the determining module is further configured to construct an error equation corresponding to the chromaticity component for each chromaticity component based on the error between the chromaticity prediction value and the chromaticity reconstruction value of the chromaticity component corresponding to each reference pixel; wherein, the chromaticity prediction value of each reference pixel under the chromaticity component is determined based on the luminance reconstruction value of the reference pixel, the luminance reconstruction values of the neighboring pixels of the reference pixel, and the filter coefficients to be solved for the chromaticity component; by minimizing the solution of the error equation corresponding to the chromaticity component, the filter coefficients to be solved for the chromaticity component are obtained to predict the chromaticity prediction value under the chromaticity component.
24. The apparatus according to claim 17, characterized in that, The filtering coefficient set includes multiple filtering coefficient sets corresponding to each chromaticity component; the chromaticity prediction value of the target pixel includes chromaticity prediction values under multiple chromaticity components; the determining module is further configured to perform chromaticity prediction on the target pixel for each chromaticity component based on the luminance reconstruction value of the target pixel, the luminance reconstruction value of the target neighboring pixels, and the filtering coefficient set corresponding to the chromaticity component, to obtain the chromaticity prediction value of the target pixel under the chromaticity component.
25. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 12.
26. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 12.
27. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Method, apparatus and system for encoding and decoding a subset of transform units of encoded video data
CN107071420A
Video processing method and device, storage medium and computer program product
CN115118982A
