Search

CN-121397232-B - Video encoding method, apparatus, computing device, medium, and program product

CN121397232BCN 121397232 BCN121397232 BCN 121397232BCN-121397232-B

Abstract

The application provides a video coding method, a video coding device, a video coding computing device, a video coding medium and a video coding program product, and belongs to the field of video processing. The video coding method comprises the steps of performing scalable video coding on a plurality of frames to be coded in a video to be coded to generate a first coded code stream, determining respective coding quality of coding results of a plurality of quality levels of the coded frame for any one of the plurality of coded frames, determining the coding result of the quality level as a reference coding result in response to the coding quality of any one of the coding results of the plurality of quality levels meeting a predetermined coding quality condition, determining a reference layer number corresponding to the reference coding result, determining at least one target coding result from the coding results of the plurality of quality levels, and generating a second coded code stream according to the at least one target coding result respectively included in the plurality of coded frames. The method can improve the stability of video quality.

Inventors

  • SHAO MINGKAI
  • YIN TING
  • SHU XIAO

Assignees

  • 瀚博半导体(上海)股份有限公司

Dates

Publication Date
20260512
Application Date
20251225

Claims (9)

  1. 1. A video encoding method, comprising: Performing scalable video coding on a plurality of frames to be coded in a video to be coded to generate a first coding code stream, wherein the first coding code stream comprises a plurality of coded frames which are in one-to-one correspondence with the plurality of frames to be coded, any one of the plurality of coded frames comprises coding results of a plurality of quality levels, and the coding results of the plurality of quality levels comprise a base layer coding result and a plurality of enhancement layer coding results; for any one of the plurality of encoded frames: determining respective encoding qualities of the encoding results of the plurality of quality levels of the encoded frame; in response to the encoding quality of the encoding result of any one of the plurality of quality levels satisfying a predetermined encoding quality condition, determining the encoding result of the quality level as a reference encoding result, the encoding quality condition being predetermined according to the target client; determining a reference layer number corresponding to the reference coding result, wherein the reference layer number indicates the layer numbers of the base layer and the enhancement layer corresponding to the reference coding result; determining at least one target coding result from the coding results of the quality levels according to the number of layers of the base layer and the enhancement layer respectively corresponding to the coding results of the quality levels and the reference layer, and Generating a second code stream according to the at least one target coding result respectively included in the plurality of coded frames, wherein the second code stream is used for being transmitted to the target client, wherein the target client comprises a plurality of sub-clients, the coding quality condition comprises a plurality of sub-coding quality conditions respectively corresponding to the plurality of sub-clients, the second code stream comprises a plurality of second code sub-code streams respectively corresponding to the plurality of sub-clients, For any one of the plurality of sub-clients: Determining the encoding result of the quality hierarchy as a reference encoding result in response to the encoding quality of the encoding result of any one of the quality hierarchies satisfying a predetermined encoding quality condition includes determining the encoding result of the quality hierarchy as a reference encoding result corresponding to the sub-client in response to the encoding quality of the encoding result of any one of the quality hierarchies satisfying a sub-encoding quality condition corresponding to the sub-client; determining the reference layer number corresponding to the reference coding result comprises determining the reference layer number corresponding to the reference coding result corresponding to the sub-client; determining at least one target coding result from the coding results of the quality levels according to the number of layers of the base layer and the enhancement layer respectively corresponding to the coding results of the quality levels and the reference layer number, wherein the determining at least one target coding result corresponding to the sub-client from the coding results of the quality levels according to the number of layers of the base layer and the enhancement layer respectively corresponding to the coding results of the quality levels and the reference layer number corresponding to the sub-client; Generating a second code sub-stream according to the at least one target coding result respectively included in the plurality of coded frames, wherein the second code sub-stream is used for being transmitted to the sub-client according to the at least one target coding result respectively included in the plurality of coded frames and corresponding to the sub-client.
  2. 2. The video coding method of claim 1, wherein the determining the coding result of the quality level as the reference coding result in response to the coding quality of the coding result of any one of the quality levels satisfying a predetermined coding quality condition comprises: Determining the coding result of at least one quality level with coding quality greater than or equal to a predetermined coding quality threshold from the coding results of the quality levels; determining at least one quality difference between the coding quality corresponding to the coding result of the at least one quality level and the coding quality threshold; determining a minimum mass difference from the at least one mass difference, and And determining the coding result of the quality level corresponding to the minimum quality difference value as the reference coding result.
  3. 3. The video coding method according to claim 1, wherein the determining at least one target coding result from the coding results of the plurality of quality levels according to the number of layers of the base layer and the enhancement layer and the reference number of layers respectively corresponding to the coding results of the plurality of quality levels comprises: Determining the base layer coding result as a target coding result, and And determining the enhancement layer coding result as a target coding result in response to the number of layers of the enhancement layer corresponding to any one of the enhancement layer coding results being less than or equal to the reference number of layers.
  4. 4. The method of video coding according to claim 1, wherein said determining the respective coding quality of the coding results of the plurality of quality levels of the coded frame comprises: And determining the coding quality corresponding to the coding quality condition of each of the coding results of the quality levels based on the coding quality condition.
  5. 5. The video coding method according to any one of claims 1 to 3, characterized in that the video coding method further comprises: determining a plurality of key reference frames from the plurality of encoded frames, wherein a predetermined number of encoded frames are included between any two adjacent key reference frames in the plurality of key reference frames; for any of the plurality of key reference frames: and determining the base layer coding result and the enhancement layer coding results included in the key reference frame as target coding results.
  6. 6. A video encoding apparatus, comprising: the encoding module is used for performing scalable video encoding on a plurality of frames to be encoded in the video to be encoded to generate a first encoding code stream, wherein the first encoding code stream comprises a plurality of encoded frames which are in one-to-one correspondence with the plurality of frames to be encoded, any one of the plurality of encoded frames comprises encoding results of a plurality of quality levels, and the encoding results of the plurality of quality levels comprise a base layer encoding result and a plurality of enhancement layer encoding results; A quality determination module for determining, for any one of the plurality of encoded frames, respective encoding quality of encoding results of the plurality of quality levels of the encoded frame, the encoding quality condition being predetermined according to a target client; a reference evaluation module for determining the encoding result of a quality level as a reference encoding result in response to the encoding quality of the encoding result of any one of the plurality of quality levels satisfying a predetermined encoding quality condition; the layer number determining module is used for determining a reference layer number corresponding to the reference coding result, wherein the reference layer number indicates the layer numbers of the base layer and the enhancement layer corresponding to the reference coding result; a quality evaluation module for determining at least one target coding result from the coding results of the quality levels according to the number of layers of the base layer and the enhancement layer and the reference layer respectively corresponding to the coding results of the quality levels, and A generating module, configured to generate a second encoded code stream according to the at least one target encoding result respectively included in the plurality of encoded frames, where the second encoded code stream is used for being transmitted to the target client, where the target client includes a plurality of sub-clients, the encoding quality condition includes a plurality of sub-encoding quality conditions respectively corresponding to the plurality of sub-clients, the second encoded code stream includes a plurality of second encoded sub-code streams respectively corresponding to the plurality of sub-clients, For any one of the plurality of sub-clients: Determining the encoding result of the quality hierarchy as a reference encoding result in response to the encoding quality of the encoding result of any one of the quality hierarchies satisfying a predetermined encoding quality condition includes determining the encoding result of the quality hierarchy as a reference encoding result corresponding to the sub-client in response to the encoding quality of the encoding result of any one of the quality hierarchies satisfying a sub-encoding quality condition corresponding to the sub-client; determining the reference layer number corresponding to the reference coding result comprises determining the reference layer number corresponding to the reference coding result corresponding to the sub-client; determining at least one target coding result from the coding results of the quality levels according to the number of layers of the base layer and the enhancement layer respectively corresponding to the coding results of the quality levels and the reference layer number, wherein the determining at least one target coding result corresponding to the sub-client from the coding results of the quality levels according to the number of layers of the base layer and the enhancement layer respectively corresponding to the coding results of the quality levels and the reference layer number corresponding to the sub-client; Generating a second code sub-stream according to the at least one target coding result respectively included in the plurality of coded frames, wherein the second code sub-stream is used for being transmitted to the sub-client according to the at least one target coding result respectively included in the plurality of coded frames and corresponding to the sub-client.
  7. 7. A computing device, comprising: at least one processor, and At least one memory communicatively coupled to the at least one processor, the at least one memory storing instructions that, when executed by the at least one processor, individually or collectively, cause the computing device to perform the video encoding method of any one of claims 1-5.
  8. 8. A computer-readable storage medium storing instructions that, when executed by one or more processors of a computing device, individually or collectively, cause the computing device to perform the video encoding method of any one of claims 1-5.
  9. 9. A computer program product comprising instructions that, when executed individually or collectively by one or more processors of a computing device, cause the computing device to perform the video encoding method of any one of claims 1 to 5.

Description

Video encoding method, apparatus, computing device, medium, and program product Technical Field The present application relates to the field of video processing, and in particular, to a video encoding method, apparatus, computing device, medium, and program product. Background Currently, in some application scenarios of video storage and transmission, there is a high requirement for visual consistency and video quality. For these application scenarios, constant quality coding (Constant Quality Encoding) is typically used. Constant quality coding will maintain consistent visual quality throughout the video rather than forcing control over the output code rate or file size. However, when facing complex scenes or highly dynamic content, it is often difficult to ensure absolute stability of video quality, and fluctuations in video quality will likely occur. Disclosure of Invention The application aims to at least solve the technical problem that the video quality is difficult to keep stable in the background technology. It is therefore an object of the present application to provide a video encoding method to improve video encoding quality and stability of video quality. An embodiment of a first aspect of the present application provides a video encoding method, including performing scalable video encoding on a plurality of frames to be encoded in a video to be encoded to generate a first encoded code stream, wherein the first encoded code stream includes a plurality of encoded frames corresponding to the plurality of frames to be encoded one by one, any one of the plurality of encoded frames includes an encoding result of a plurality of quality levels including a base layer encoding result and a plurality of enhancement layer encoding results, determining, for any one of the plurality of encoded frames, a respective encoding quality of the encoding result of the plurality of quality levels of the encoded frame, determining, in response to the encoding quality of the encoding result of any one of the quality levels satisfying a predetermined encoding quality condition, the encoding result of the quality level as a reference encoding result, determining a reference layer number corresponding to the reference encoding result, the reference indicating a number of base layer and an enhancement layer layers corresponding to the reference encoding result, respectively, determining, from among the plurality of target encoding results of quality levels, at least one of the plurality of encoded frames, and generating, from the target layer numbers of the plurality of target encoding results, at least one of the target layer numbers, and the target encoded stream, wherein the target encoded stream is transmitted to the first encoded code stream. In the technical scheme of the embodiment of the application, the scalable video coding is used for the video to obtain the base layer coding result and the enhancement layer coding result, and the coding result is screened according to the preset coding quality condition, so that the quality of the code stream output to the client reaches the expected target quality requirement, the stability is kept high, and the video effect is improved. In some embodiments, responsive to the encoding quality of the encoding results of any one of the quality levels satisfying a predetermined encoding quality condition, determining the encoding results of the quality level as a reference encoding result includes determining, from among the encoding results of the quality levels, encoding results of at least one quality level having an encoding quality greater than or equal to a predetermined encoding quality threshold, determining at least one quality difference between the encoding quality and the encoding quality threshold to which the encoding results of the at least one quality level respectively correspond, determining a minimum quality difference from the at least one quality difference, and determining the encoding results of the quality level corresponding to the minimum quality difference as a reference encoding result. The coding result with the minimum quality difference value with the coding quality threshold is determined as a reference to screen the coding results of a plurality of quality levels obtained by coding, so that part of unnecessary enhancement layers can be abandoned while the video quality is maintained, the coding rate is reduced, and the coding efficiency is improved. In some embodiments, determining at least one target encoding result from the encoding results of the plurality of quality levels based on the number of layers and the reference number of layers of the base layer and the enhancement layer respectively corresponding to the encoding results of the plurality of quality levels includes determining the base layer encoding result as the target encoding result and determining the enhancement layer encoding result as the target encoding result in response to t