CN-120547334-B - Video encoding method, video encoder, electronic device, storage medium, and computer program product
Abstract
The invention relates to a video coding method, a video coder, electronic equipment, a storage medium and a computer program product, wherein the method comprises the steps of aiming at any one to-be-coded block in a to-be-coded video frame, according to a time layer where the to-be-coded video frame is located and a preset ROIMAP corresponding to the to-be-coded block, adjusting a preset QP value of the to-be-coded block to obtain a target QP value of the to-be-coded block, according to the preset ROIMAP corresponding to the to-be-coded block, determining a target CU dividing mode and a target CU predicting mode of the to-be-coded block, and according to the target QP value, the target CU dividing mode and the target CU predicting mode, coding the to-be-coded block to obtain a target coding result of the to-be-coded block. The embodiment of the disclosure can perform different processing on video frames of different time layers and the ROI region and the non-ROI region in the video frames, so that the coding code rate is effectively saved while the enhancement processing is performed on the ROI region.
Inventors
- Request for anonymity
- Request for anonymity
Assignees
- 摩尔线程智能科技(北京)股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20250704
Claims (10)
- 1. A video encoding method, comprising: aiming at any block to be encoded in a video frame to be encoded, adjusting a preset Quantization Parameter (QP) value of the block to be encoded according to a time layer in which the video frame to be encoded is positioned and a preset region of interest map (ROIMAP) corresponding to the block to be encoded to obtain a target QP value of the block to be encoded; Determining a target coding unit CU dividing mode and a target CU prediction mode of the block to be coded according to the preset ROIMAP corresponding to the block to be coded; coding the block to be coded according to the target QP value, the target CU dividing mode and the target CU prediction mode to obtain a target coding result of the block to be coded; the preset ROIMAP corresponding to the block to be coded comprises preset QP adjustment parameters of each first sub-block, preset CU partition parameters of each first sub-block and preset CU mode parameters of each first sub-block; The method further comprises the steps of: Determining a time layer threshold according to the total time layer number of the GOP of the image group where the video frame to be encoded is located; For any first sub-block in the block to be encoded, determining a QP adjustment value of the first sub-block according to a preset QP adjustment parameter, the preset QP value and a first preset QP adjustment strategy of the first sub-block when a time layer of the video frame to be encoded is greater than the time layer threshold; Determining a QP adjustment value of the first sub-block according to a preset QP adjustment parameter, the preset QP value and a second preset QP adjustment strategy of the first sub-block when the time layer of the video frame to be encoded is smaller than or equal to the time layer threshold; wherein the QP adjustment amplitude of the second preset QP adjustment policy is greater than the first preset QP adjustment policy.
- 2. The method according to claim 1, wherein the adjusting the preset quantization parameter QP value of the block to be encoded according to the temporal layer in which the video frame to be encoded is located and the preset region of interest map ROIMAP corresponding to the block to be encoded to obtain the target QP value of the block to be encoded includes: determining a target QP regulating value of the block to be coded according to the QP regulating value of each first sub-block in the block to be coded; And adjusting the preset QP value according to the target QP adjustment value to obtain the target QP value.
- 3. The method according to claim 1, wherein the determining, according to the preset ROIMAP corresponding to the block to be encoded, the target CU partition mode of the target coding unit CU of the block to be encoded and the target CU prediction mode includes: Determining at least one second sub-block of the block to be coded, which is obtained by the candidate CU partitioning mode, according to any candidate CU partitioning mode, wherein the size of the second sub-block is larger than or equal to that of the first sub-block and smaller than or equal to that of the block to be coded; For any one second sub-block, determining the candidate CU partitioning mode as a target CU partitioning mode of the second sub-block when the preset CU partitioning parameter of each first sub-block included in the second sub-block indicates that the candidate CU partitioning mode is supported and the preset CU mode parameter of each first sub-block included in the second sub-block is the same; Determining a CU prediction mode indicated by a preset CU mode parameter of each first sub-block included in the second sub-block as a candidate CU prediction mode for the second sub-block; and determining the target CU prediction mode of any second sub-block according to the candidate CU prediction mode of the second sub-block aiming at any second sub-block in any target CU division mode.
- 4. The method according to claim 3, wherein determining, for any one of the second sub-blocks in any one of the target CU partitioning schemes, a target CU prediction mode for the second sub-block based on a candidate CU prediction mode for the second sub-block, comprises: If the preset CU prediction mode exists in the block to be coded, determining the preset CU prediction mode as the target CU prediction mode of any second sub-block in any target CU partition mode; And determining a candidate CU prediction mode of a second sub-block as a target CU prediction mode of the second sub-block according to any second sub-block in any target CU partition mode under the condition that the block to be coded does not have the preset CU prediction mode.
- 5. The method according to claim 3, wherein the encoding the block to be encoded according to the target QP value, the target CU partitioning scheme, and the target CU prediction mode, to obtain an encoding result of the block to be encoded, includes: for any second sub-block in any target CU partition mode, according to the target QP value, the target CU partition mode of the second sub-block and the target CU prediction mode of the second sub-block, encoding the second sub-block to obtain an encoding result of the second sub-block; and comparing the rate distortion cost of the coding result of each second sub-block of the block to be coded in each target CU dividing mode, and determining the target coding result of the block to be coded.
- 6. The method of claim 1, wherein the preset ROIMAP corresponding to the block to be encoded further includes a position indication parameter of each first sub-block, where the position indication parameter of each first sub-block is used to indicate whether the block to be encoded is a first encoding block in the video frame to be encoded; The method further comprises the steps of: and judging whether transmission dislocation exists in the preset ROIMAP corresponding to the block to be coded according to the position indication parameter of each first sub-block included in the block to be coded.
- 7. A video encoder, comprising: The first determining module is used for adjusting the preset quantization parameter QP value of the block to be encoded according to the time layer of the video frame to be encoded and the preset region of interest map ROIMAP corresponding to the block to be encoded to obtain a target QP value of the block to be encoded, wherein the block to be encoded comprises a plurality of first sub-blocks; the second determining module is used for determining a target coding unit CU dividing mode and a target CU prediction mode of the block to be coded according to the preset ROIMAP corresponding to the block to be coded; the coding module is used for coding the block to be coded according to the target QP value, the target CU dividing mode and the target CU prediction mode to obtain a target coding result of the block to be coded; the preset ROIMAP corresponding to the block to be coded comprises preset QP adjustment parameters of each first sub-block, preset CU partition parameters of each first sub-block and preset CU mode parameters of each first sub-block; The first determining module is configured to: Determining a time layer threshold according to the total time layer number of the GOP of the image group where the video frame to be encoded is located; For any first sub-block in the block to be encoded, determining a QP adjustment value of the first sub-block according to a preset QP adjustment parameter, the preset QP value and a first preset QP adjustment strategy of the first sub-block when a time layer of the video frame to be encoded is greater than the time layer threshold; Determining a QP adjustment value of the first sub-block according to a preset QP adjustment parameter, the preset QP value and a second preset QP adjustment strategy of the first sub-block when the time layer of the video frame to be encoded is smaller than or equal to the time layer threshold; wherein the QP adjustment amplitude of the second preset QP adjustment policy is greater than the first preset QP adjustment policy.
- 8. An electronic device comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to carry out the steps of the method according to any one of claims 1 to 6.
- 9. A non-transitory computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor realizes the steps of the method according to any of claims 1 to 6.
- 10. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 6.
Description
Video encoding method, video encoder, electronic device, storage medium, and computer program product Technical Field The present disclosure relates to the field of computer technology, and in particular, to a video encoding method, a video encoder, an electronic device, a storage medium, and a computer program product. Background In recent years, mobile intelligent terminals have been widely popularized, and with rapid update of network speed, vivid and visual video services are favored by more people. Meanwhile, the visual perception of people is continuously improved, and further the requirements on video definition, video smoothness and other video quality are increasingly met. Therefore, the mainstream video coding standard such as HEVC, AVC, AV a1 is used more widely. The main purpose of video coding is to minimize coding bit rate under the condition of ensuring certain video quality or to minimize coding distortion under the condition of limiting mobile coding bit rate so as to achieve optimal coding performance. In the existing video encoder scheme, video frames are compressed mainly through operations such as prediction, transformation, quantization, filtering and the like, only objective quality is optimized in the process of rate distortion optimization, and in the subsequent filtering process, the video frames are optimized mainly for distortions such as blocking effect, ringing effect and the like generated in encoding, and encoding is not adjusted according to human eye regions of interest (Region of Interest, ROI). Disclosure of Invention In view of this, the present disclosure proposes a video encoding method, a video encoder, and an electronic device, a storage medium, a computer program product. According to one aspect of the disclosure, a video coding method is provided, which includes for any one block to be coded in a video frame to be coded, adjusting a preset quantization parameter QP value of the block to be coded according to a time layer where the video frame to be coded is located and a preset region of interest map ROIMAP corresponding to the block to be coded to obtain a target QP value of the block to be coded, determining a target coding unit CU dividing mode and a target CU prediction mode of the block to be coded according to the preset ROIMAP corresponding to the block to be coded, and coding the block to be coded according to the target QP value, the target CU dividing mode and the target CU prediction mode to obtain a target coding result of the block to be coded. In one possible implementation manner, the block to be encoded includes a plurality of first sub-blocks, and the preset ROIMAP corresponding to the block to be encoded includes a preset QP adjustment parameter of each first sub-block, a preset CU partition parameter of each first sub-block, and a preset CU mode parameter of each first sub-block. In one possible implementation manner, the adjusting the preset quantization parameter QP value of the block to be encoded according to the temporal layer where the video frame to be encoded is located and the preset region of interest map ROIMAP corresponding to the block to be encoded to obtain a target QP value of the block to be encoded includes determining, for any one first sub-block in the block to be encoded, a QP adjustment value of the first sub-block according to a preset QP adjustment parameter of the first sub-block, a temporal layer where the video frame to be encoded is located, and the preset QP value, determining, according to a QP adjustment value of each first sub-block in the block to be encoded, a target QP adjustment value of the block to be encoded, and adjusting the preset QP value according to the target QP adjustment value to obtain the target QP value. In one possible implementation manner, the determining the QP adjustment value of the first sub-block according to the preset QP adjustment parameter, the temporal layer in which the video frame to be encoded is located, and the preset QP value for any one first sub-block in the block to be encoded includes determining a temporal layer threshold according to the total temporal layer number of the GOP in which the video frame to be encoded is located, determining the QP adjustment value of the first sub-block according to the preset QP adjustment parameter, the preset QP value, and the first preset QP adjustment policy for the first sub-block when the temporal layer in which the video frame to be encoded is located is greater than the temporal layer threshold, and determining the QP adjustment value of the first sub-block according to the preset QP adjustment parameter, the QP value, and the second preset QP adjustment policy for the first sub-block when the temporal layer in which the video frame to be encoded is located is less than or equal to the temporal layer threshold, where the second preset QP adjustment policy is greater than the first QP adjustment policy. In one possible implementation