A video encoding method and apparatus, electronic device, storage medium, and computer program product

By determining the average number of bits per pixel and the quantization parameter model in the hardware video encoder, and adaptively setting the quantization parameters for each video frame to be encoded, the resource overhead problem caused by the complexity of SATD in the hardware video encoder is solved, and efficient MiniGOP-level bitrate control is achieved.

CN121000871BActive Publication Date: 2026-01-27MOORE THREADS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511137714.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-14
Publication Date
2026-01-27
Estimated Expiration
2045-08-14

AI Technical Summary

Technical Problem

In hardware video encoders, calculating the sum of absolute differences (SATD) of each video frame to be encoded to achieve bitrate control incurs huge resource overhead, and existing technologies struggle to efficiently achieve MiniGOP-level bitrate control.

Method used

By determining the average number of bits per pixel in the target video based on preset video parameters, using preset quantization parameters to determine the model, and adaptively determining the target quantization parameters for each video frame to be encoded, the complexity of SATD calculation is avoided, and MiniGOP-level bitrate control is achieved.

Benefits of technology

Without needing to calculate the SATD complexity of each video frame to be encoded, it efficiently achieves MiniGOP-level bitrate control that is friendly to hardware video encoders, solving the bitrate control problem during MiniGOP switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121000871B_ABST
    Figure CN121000871B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a video encoding method and device, electronic equipment, storage medium and computer program product, the method comprising: determining an average bit per pixel number of a target video according to a preset video parameter; determining a first target model parameter of a preset quantization parameter determination model; determining a second target model parameter of each to-be-encoded video frame included in a current to-be-encoded MiniGOP in the target video under the preset quantization parameter determination model; and determining a target quantization parameter of each to-be-encoded video frame by using the preset quantization parameter determination model according to the average bit per pixel number, the first target model parameter and the second target model parameter of each to-be-encoded video frame. The embodiment of the present disclosure can efficiently implement MiniGOP-level rate control friendly to a hardware video encoder without calculating the SATD complexity of each to-be-encoded video frame.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a video encoding method and apparatus, electronic device, storage medium and computer program product. Background Technology

[0002] Rate control (RC) is a crucial step in video encoding, aiming to adjust video quality by controlling the number of bits used by the encoder. Current techniques typically involve calculating the Sum of Absolute Transformed Differences (SATD) complexity of each video frame to be encoded, and then using this SATD complexity for bitrate allocation to achieve bitrate control. However, calculating the SATD complexity of each video frame in a hardware video encoder incurs significant resource overhead. Therefore, there is a pressing need for an efficient and hardware-friendly video encoding method to effectively implement bitrate control during video encoding. Summary of the Invention

[0003] This disclosure presents a technical solution for a video coding method and apparatus, electronic device, storage medium, and computer program product.

[0004] According to one aspect of this disclosure, a video encoding method is provided, comprising: determining an average number of bits per pixel in a target video based on preset video parameters; determining first target model parameters of a preset quantization parameter determination model; determining second target model parameters of each video frame to be encoded within a current MiniGOP in the target video, under the preset quantization parameter determination model, for each MiniGOP to be encoded; and determining target quantization parameters of each video frame to be encoded within the current MiniGOP to be encoded, using the preset quantization parameter determination model, based on the average number of bits per pixel, the first target model parameters, and the second target model parameters of each video frame to be encoded within the current MiniGOP to be encoded.

[0005] In one possible implementation, the preset video parameters include: preset video bitrate, preset video frame rate, and preset video resolution.

[0006] In one possible implementation, determining the second target model parameters for each video frame included in the current MiniGOP to be encoded in the target video, under the preset quantization parameter determination model, includes: when the current MiniGOP to be encoded is an initialized MiniGOP, determining the second initial model parameters of the preset quantization parameter determination model, wherein the initialized MiniGOP represents a MiniGOP that needs to be encoded independently; and determining the second target model parameters for each video frame included in the current MiniGOP to be encoded using the preset quantization parameter determination model based on the average bits per pixel, the first target model parameters, and the second initial model parameters.

[0007] In one possible implementation, determining the second target model parameters for each video frame to be encoded in the current MiniGOP by using the preset quantization parameters to determine the model based on the average number of bits per pixel, the first target model parameters, and the second initial model parameters includes: determining the initial quantization parameters by using the preset quantization parameters to determine the model based on the average number of bits per pixel, the first target model parameters, and the second initial model parameters; and determining the second target model parameters for each video frame to be encoded in the current MiniGOP by using the preset quantization parameters to determine the model based on the initial quantization parameters and the preset quantization parameter increment for each video frame to be encoded in the current MiniGOP.

[0008] In one possible implementation, determining the second target model parameters for each video frame to be encoded within the current MiniGOP to be encoded in the target video, under the preset quantization parameter determination model, includes: when the current MiniGOP to be encoded is a non-initialized MiniGOP, determining the historical encoded bit count and historical quantization parameters of each encoded video frame included in the adjacent encoded MiniGOPs of the current MiniGOP to be encoded, wherein a non-initialized MiniGOP represents a MiniGOP that needs to be encoded with reference to adjacent encoded MiniGOPs; and determining the second target model parameters for each video frame to be encoded within the current MiniGOP to be encoded using the preset quantization parameter determination model based on the historical encoded bit count and historical quantization parameters of each encoded video frame included in the adjacent encoded MiniGOPs.

[0009] In one possible implementation, determining the second target model parameters for each video frame to be encoded in the current MiniGOP by using the preset quantization parameters to determine the model based on the historical number of encoded bits and historical quantization parameters of each encoded video frame included in the adjacent encoded MiniGOP includes: when the number of video frames to be encoded in the current MiniGOP is the same as the number of encoded video frames included in the adjacent encoded MiniGOP, determining the second target model parameters for the i-th video frame to be encoded in the current MiniGOP by using the preset quantization parameters to determine the model based on the historical number of encoded bits and historical quantization parameters of the i-th encoded video frame included in the adjacent encoded MiniGOP, where i is a positive integer.

[0010] In one possible implementation, determining the second target model parameters for each video frame to be encoded in the current MiniGOP based on the historical encoded bit count and historical quantization parameters of each encoded video frame included in the adjacent encoded MiniGOP, using the preset quantization parameter determination model, includes: when the number of frames in the current MiniGOP to be encoded differs from the number of encoded video frames in the adjacent encoded MiniGOP, determining the average historical encoded bit count and average historical quantization parameter value corresponding to the target frame type in the adjacent encoded MiniGOP based on the historical encoded bit count and historical quantization parameters of each encoded video frame included in the adjacent encoded MiniGOP, wherein the target frame type includes: P-frame, referenceable B-frame, and non-referenceable B-frame; and determining the second target model parameters for each video frame to be encoded of the target frame type in the current MiniGOP based on the average historical encoded bit count and average historical quantization parameter value corresponding to the target frame type in the adjacent encoded MiniGOP, using the preset quantization parameter determination model.

[0011] In one possible implementation, determining the target quantization parameters for each video frame in the current MiniGOP by using the preset quantization parameters to determine the model based on the average bits per pixel, the first target model parameters, and the second target model parameters of each video frame to be encoded included in the current MiniGOP includes: for any video frame to be encoded included in the current MiniGOP, determining the reference quantization parameters of the video frame to be encoded by using the preset quantization parameters to determine the model based on the average bits per pixel, the first target model parameters, and the second target model parameters of the video frame to be encoded; adjusting the reference quantization parameters of the video frame to be encoded based on the preset quantization parameter increment corresponding to the video frame to be encoded to obtain the target quantization parameters of the video frame to be encoded.

[0012] In one possible implementation, the method is applied to a hardware video encoder.

[0013] According to one aspect of this disclosure, a video encoding apparatus is provided, comprising: a first determining module, configured to determine an average number of bits per pixel of a target video based on preset video parameters; a second determining module, configured to determine a first target model parameter of a preset quantization parameter determining model; a third determining module, configured to determine, for a current MiniGOP to be encoded in the target video, a second target model parameter of each video frame to be encoded included in the current MiniGOP to be encoded, under the preset quantization parameter determining model; and a fourth determining module, configured to determine a target quantization parameter of each video frame to be encoded included in the current MiniGOP to be encoded based on the average number of bits per pixel, the first target model parameter, and the second target model parameter of each video frame to be encoded included in the current MiniGOP to be encoded, using the preset quantization parameter determining model.

[0014] According to one aspect of this disclosure, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to perform the method described above.

[0015] According to one aspect of this disclosure, a computer-readable storage medium is provided that stores computer program instructions thereon, which, when executed by a processor, implement the above-described method.

[0016] According to one aspect of this disclosure, a computer program product is provided, including a computer program or a non-volatile computer-readable storage medium carrying the computer program, wherein the computer program implements the above-described method when executed by a processor.

[0017] In this embodiment, the average bit-per-pixel count of the target video is determined according to preset parameters; a first target model parameter of the preset quantization parameter determination model is determined; for the current MiniGOP to be encoded in the target video, a second target model parameter of each video frame to be encoded included in the current MiniGOP to be encoded is determined under the preset quantization parameter determination model; based on the average bit-per-pixel count, the first target model parameter, and the second target model parameter of each video frame to be encoded included in the current MiniGOP to be encoded, the target quantization parameter of each video frame to be encoded included in the current MiniGOP to be encoded is determined using the preset quantization parameter determination model. By determining the average bit-per-pixel count of each video frame to be encoded, the target quantization parameter of each video frame to be encoded included in each MiniGOP can be adaptively determined based on the average bit-per-pixel count using the preset quantization parameter determination model. Thus, without needing to calculate the SATD complexity of each video frame to be encoded, efficient MiniGOP-level bitrate control friendly to hardware video encoders can be achieved.

[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the specification, serve to illustrate the technical solutions of this disclosure.

[0020] Figure 1 A flowchart illustrating a video encoding method according to an embodiment of the present disclosure is shown.

[0021] Figure 2 This diagram illustrates how, according to an embodiment of the present disclosure, the second target model parameters of each video frame to be encoded included in the current MiniGOP are determined by referring to adjacent encoded MiniGOPs based on frame type.

[0022] Figure 3 A block diagram of a video encoding apparatus according to an embodiment of the present disclosure is shown.

[0023] Figure 4 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation

[0024] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.

[0025] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.

[0026] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0027] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.

[0028] Video consists of a series of images that occur in a continuous sequence. During video encoding and compression, the video is first divided into several Groups of Pictures (GOPs). Within each GOP, based on the relationship between P-frames and B-frames, a series of smaller GOPs are formed, with the P-frames as the boundary.

[0029] The core of bitrate control is determining the quantization parameter (QP). The quantization parameter is a key factor affecting video quality and bitrate. During the encoding process, adjusting the quantization parameter controls the number of bits used by the video encoder, thereby controlling the bitrate.

[0030] In existing technologies, the common approach is to calculate the Sum of Absolute Transformed Differences (SATD) complexity of each video frame to be encoded, and then use the SATD complexity of each frame for bitrate allocation to achieve bitrate control. Since the SATD complexity is calculated for each video frame, the bitrate control problem caused by MiniGOP switching is avoided. However, in hardware video encoders, calculating the SATD complexity incurs significant resource overhead.

[0031] This disclosure provides a video encoding method that can efficiently achieve hardware-friendly MiniGOP-level bitrate control without calculating the SATD complexity of each video frame to be encoded, effectively solving the bitrate control problem during MiniGOP switching. The video encoding method of this disclosure is described in detail below.

[0032] Figure 1 A flowchart illustrating a video encoding method according to an embodiment of this disclosure is shown. The method can be executed by a video encoder, which can be located in an electronic device such as a terminal device or a server. The terminal device can be a user equipment (UE), mobile device, user terminal, terminal, cellular phone, cordless phone, personal digital assistant (PDA), handheld device, computing device, in-vehicle device, wearable device, etc. The method can be implemented by a processor calling computer-readable instructions stored in memory. Figure 1 As shown, the method includes:

[0033] In step S11, the average number of bits per pixel of the target video is determined according to preset video parameters.

[0034] In one possible implementation, the preset video parameters include: preset video bitrate, preset video frame rate, and preset video resolution.

[0035] Video bitrate refers to the number of bits of data transmitted per unit of time, typically used to describe the bit rate of a video file. Video frame rate refers to the number of video frames displayed per second, a key factor in video smoothness and visual effects. Video resolution is a standard for measuring the precision of a video frame image, composed of the number of horizontal and vertical pixels. For example, a 1920×1080 video resolution means that the video frame has 1920 horizontal pixels and 1080 vertical pixels.

[0036] The target video refers to the video that needs to be compressed and encoded in this video encoding scenario. The preset video bitrate, preset video frame rate, and preset video resolution can be flexibly set according to the actual encoding requirements of the target video, and this disclosure does not impose specific limitations on them.

[0037] Bits per pixel (bpp) describes the number of bits occupied by each pixel in an image. Average bits per pixel in the target video indicates the average number of bits per pixel in each frame of the target video to be encoded.

[0038] In one example, the average number of bits per pixel (avg_bpp) of the target video can be determined using the following formula (1) based on the preset video bitrate B, preset video frame rate (fps), and preset video resolution (w×h):

[0039] avg_bpp=B / fps / (w×h) (1).

[0040] In step S12, the preset quantization parameters are determined to determine the first target model parameters of the model.

[0041] The model is determined by pre-setting quantization parameters, which can employ an RQ (Rate-QP model) that reflects the correlation between the quantization parameters and bpp: QP = a × log2(bpp) + b. Here, a and b are the model parameters in the model determined by pre-setting quantization parameters. Specifically, the first model parameter a is the coefficient corresponding to bpp in the RQ (Rate-QP model), and the second model parameter b is the offset corresponding to bpp.

[0042] During the initialization phase, that is, before video encoding of the target video begins, a first initial model parameter a0 and a second initial model parameter b0 can be set. The specific values ​​of the first initial model parameter a0 and the second initial model parameter b0 can be flexibly set according to the actual application scenario, and this disclosure does not impose specific limitations on them.

[0043] During the video encoding process of the target video, the first initial model parameter a0 remains unchanged. Therefore, the first initial model parameter a0 can be determined as the first target model parameter a0.

[0044] In step S13, for the current MiniGOP to be encoded in the target video, each video frame to be encoded included in the current MiniGOP to be encoded is determined, and the second target model parameters are determined under the preset quantization parameter determination model.

[0045] During the video encoding process of the target video, the second initial model parameter b0 needs to be updated.

[0046] In other words, for any MiniGOP to be encoded in the target video, assuming that the MiniGOP includes N video frames to be encoded, during the video encoding process of the MiniGOP, it is necessary to determine the second target model parameter b under the preset quantization parameter determination model for each video frame included in the MiniGOP. — i, where the value of i ranges from 1 to N.

[0047] The length of the different MiniGOPs obtained from the target video segmentation can be fixed or variable. That is, the N corresponding to different MiniGOPs to be encoded in the target video can have the same value or different values.

[0048] When encoding the current MiniGOP to be encoded in the target video, it is necessary to determine the parameters of the second target model under the preset quantization parameter determination model for each video frame to be encoded included in the current MiniGOP.

[0049] The following sections will describe in detail how to determine the second target model parameters under the preset quantization parameter determination model for each video frame included in the current MiniGOP to be encoded, based on the possible implementation methods disclosed herein. These details will not be elaborated upon here.

[0050] In step S14, the model is determined using preset quantization parameters based on the average number of bits per pixel, the first target model parameters, and the second target model parameters of each video frame to be encoded included in the current MiniGOP to be encoded. The target quantization parameters of each video frame to be encoded included in the current MiniGOP to be encoded are then determined.

[0051] For the i-th video frame to be encoded in the current MiniGOP, based on the average bits per pixel avg_bpp, the first target model parameter a0, and the second target model parameter b of the i-th video frame to be encoded in the current MiniGOP... _ i. Using a preset quantization parameter determination model (RQ model), determine the target quantization parameter QP of the i-th video frame to be encoded in the current MiniGOP. _ i.

[0052] The following sections will describe in detail how to determine the target quantization parameters of each video frame included in the current MiniGOP by using preset quantization parameters, based on the average number of bits per pixel, the first target model parameters, and the second target model parameters of each video frame to be encoded included in the current MiniGOP. These details will not be elaborated upon here.

[0053] In one possible implementation, the method is applied to a hardware video encoder.

[0054] In this embodiment, the average bit-per-pixel count of the target video is determined based on preset video parameters; a first target model parameter of the preset quantization parameter determination model is determined; for the current MiniGOP to be encoded in the target video, a second target model parameter of each video frame to be encoded included in the current MiniGOP to be encoded is determined under the preset quantization parameter determination model; based on the average bit-per-pixel count, the first target model parameter, and the second target model parameter of each video frame to be encoded included in the current MiniGOP to be encoded, the target quantization parameter of each video frame to be encoded included in the current MiniGOP to be encoded is determined using the preset quantization parameter determination model. By determining the average bit-per-pixel count of each video frame to be encoded, the target quantization parameter of each video frame to be encoded included in each MiniGOP can be adaptively determined based on the average bit-per-pixel count using the preset quantization parameter determination model. Thus, without needing to calculate the SATD complexity of each video frame to be encoded, efficient MiniGOP-level bitrate control friendly to hardware video encoders can be achieved.

[0055] In one possible implementation, for the current MiniGOP to be encoded in the target video, the second target model parameters of each video frame to be encoded included in the current MiniGOP are determined under a preset quantization parameter determination model. This includes: if the current MiniGOP to be encoded is an initialized MiniGOP, determining the second initial model parameters of the preset quantization parameter determination model, where the initialized MiniGOP represents a MiniGOP that needs to be encoded independently; and determining the second target model parameters of each video frame to be encoded included in the current MiniGOP using the preset quantization parameter determination model based on the average number of bits per pixel, the first target model parameters, and the second initial model parameters.

[0056] Since the initialization of MiniGOPs requires independent encoding, meaning that the initialization of MiniGOPs does not refer to other MiniGOPs during the encoding process, when encoding the initialization of MiniGOPs in the target video, a parameter initialization operation needs to be performed to determine the second target model parameters for each video frame to be encoded included in the initialization of MiniGOPs.

[0057] In video coding, there are two types of Group of Pictures (GOPs): closed GOPs and open GOPs. In a closed GOP, each GOP begins with an Instantaneous Decoding Refresh (IDR) image, i.e., an I-frame. Each GOP is independent and can be decoded independently. In an open GOP, the first video frame to be encoded in the first GOP is an I-frame, and the first video frame to be encoded in each subsequent GOP is a non-I-frame. Subsequent GOPs can skip non-I-frames and use already encoded video frames from the previous GOP as reference frames.

[0058] When a closed GOP is used in the encoding process of the target video, only the first MiniGOP in the first GOP in the target video is the initial MiniGOP. The parameters need to be initialized to determine the second target model parameters of each video frame to be encoded included in the MiniGOP.

[0059] When using open GOPs in the encoding process of the target video, the first MiniGOP in each GOP in the target video is the initialization MiniGOP. Parameter initialization operations need to be performed to determine the second target model parameters for each video frame to be encoded included in that MiniGOP.

[0060] When the current MiniGOP to be encoded is the initial MiniGOP, the model (RQ model) is determined by using preset quantization parameters based on the average number of bits per pixel avg_bpp, the first target model parameter a0, and the second initial model parameter b0, and the second target model parameter for each video frame to be encoded included in the current MiniGOP to be encoded.

[0061] In one possible implementation, the model is determined using preset quantization parameters based on the average number of bits per pixel, the first target model parameters, and the second initial model parameters. The determination of the second target model parameters for each video frame to be encoded within the current MiniGOP includes: determining the model using preset quantization parameters based on the average number of bits per pixel, the first target model parameters, and the second initial model parameters; determining the initial quantization parameters; and determining the model using preset quantization parameters based on the initial quantization parameters and the preset quantization parameter increment for each video frame to be encoded within the current MiniGOP. This process further determines the second target model parameters for each video frame to be encoded within the current MiniGOP.

[0062] Based on the average bit per pixel (avg_bpp), the first target model parameter (a0), and the second initial model parameter (b0), the model (RQ model) is determined using preset quantization parameters and the following formula (2), and the initial quantization parameter (QP) is determined._ init:

[0063] QP _ init=a0×log2(avg_bpp)+b0 (2).

[0064] Assume the current MiniGOP to be encoded contains N video frames. For the i-th video frame to be encoded in the current MiniGOP, where i ranges from 1 to N, based on the initial quantization parameter QP... _ init, and the preset quantization parameter increment delta_qp_i of the i-th video frame to be encoded in the current MiniGOP, are used to determine the second target model parameter b_i of the i-th video frame to be encoded in the current MiniGOP using the preset quantization parameter determination model (RQ model) and the following formula (3):

[0065] b_i=(QP _ init+delta_qp_i)-a0×log2(avg_bpp) (3).

[0066] The preset quantization parameter increment for each video frame to be encoded included in each MiniGOP in the target video can be preset according to relevant technologies, and this disclosure does not impose specific limitations on it.

[0067] In one possible implementation, for the current MiniGOP to be encoded in the target video, the second target model parameters of each video frame to be encoded included in the current MiniGOP are determined under a preset quantization parameter determination model. This includes: when the current MiniGOP to be encoded is an uninitialized MiniGOP, determining the historical number of encoded bits and historical quantization parameters of each encoded video frame included in the adjacent encoded MiniGOPs of the current MiniGOP to be encoded, wherein an uninitialized MiniGOP refers to a MiniGOP that needs to be encoded by referring to the adjacent encoded MiniGOPs; and determining the second target model parameters of each video frame to be encoded included in the current MiniGOP to be encoded using the preset quantization parameter determination model based on the historical number of encoded bits and historical quantization parameters of each encoded video frame included in the adjacent encoded MiniGOPs.

[0068] Since uninitialized MiniGOPs need to reference adjacent encoded MiniGOPs for encoding, in order to adapt to video scene changes during MiniGOP switching, when the current MiniGOP to be encoded is an uninitialized MiniGOP, it is necessary to determine the second target model parameters for each video frame to be encoded in the current MiniGOP by using a preset quantization parameter model (RQ model) based on the historical encoded bit count and historical quantization parameters of each encoded video frame included in the adjacent encoded MiniGOPs.

[0069] The adjacent encoded MiniGOP of the MiniGOP to be encoded refers to the MiniGOP that has been encoded before the MiniGOP to be encoded.

[0070] In one possible implementation, based on the historical number of encoded bits and historical quantization parameters of each encoded video frame included in the adjacent encoded MiniGOP, a model is determined using preset quantization parameters to determine the second target model parameters of each video frame to be encoded included in the current MiniGOP. This includes: when the number of video frames to be encoded included in the current MiniGOP is the same as the number of encoded video frames included in the adjacent encoded MiniGOP, the model is determined using preset quantization parameters to determine the second target model parameters of the i-th video frame to be encoded included in the current MiniGOP, where i is a positive integer.

[0071] If the number of video frames to be encoded in the current MiniGOP is the same as the number of encoded video frames in the adjacent encoded MiniGOPs, then each video frame to be encoded in the current MiniGOP can correspond one-to-one with each encoded video frame in the adjacent encoded MiniGOPs. Therefore, based on the historical encoded bit count and historical quantization parameters of the corresponding i-th encoded video frame in the adjacent encoded MiniGOPs, the model can be determined using preset quantization parameters to determine the second target model parameters for the i-th video frame to be encoded in the current MiniGOP.

[0072] The historical number of encoded bits for each encoded video frame in an adjacent encoded MiniGOP refers to the actual number of encoded bits consumed by each encoded video frame in an adjacent encoded MiniGOP; the historical quantization parameter for each encoded video frame in an adjacent encoded MiniGOP refers to the actual QP value during the encoding process of each encoded video frame in an adjacent encoded MiniGOP.

[0073] In one example, the historical encoded bit count real_bits_i and historical quantization parameter real_qp of the i-th encoded video frame in the adjacent encoded MiniGOP are obtained. Then, the second target model parameter b_i of the i-th video frame to be encoded in the current MiniGOP can be determined by using the preset quantization parameter determination model (RQ model) and the following formula (4):

[0074] b_i=real_qp-a0×log2(real_bits_i / (w×h)) (4).

[0075] In one possible implementation, based on the historical number of encoded bits and historical quantization parameters of each encoded video frame included in adjacent encoded MiniGOPs, a model is determined using preset quantization parameters to determine the second target model parameters for each video frame to be encoded in the current MiniGOP. This includes: when the number of frames in the current MiniGOP differs from the number of encoded video frames in adjacent encoded MiniGOPs, determining the average historical number of encoded bits and the average historical quantization parameters corresponding to the target frame type in adjacent encoded MiniGOPs based on the historical number of encoded bits and historical quantization parameters of each encoded video frame included in adjacent encoded MiniGOPs, wherein the target frame type includes: P-frame, referenceable B-frame, and non-referenceable B-frame; and determining the second target model parameters for each video frame to be encoded of the target frame type in the current MiniGOP based on the average historical number of encoded bits and the average historical quantization parameters corresponding to the target frame type in adjacent encoded MiniGOPs using the preset quantization parameters to determine the model.

[0076] If the number of video frames to be encoded in the current MiniGOP is the same as the number of encoded video frames in adjacent MiniGOPs, then each video frame to be encoded in the current MiniGOP cannot be matched one-to-one with each encoded video frame in an adjacent MiniGOP. Therefore, there may be video frames in the current MiniGOP for which the historical bit count and quantization parameters cannot be obtained from adjacent MiniGOPs.

[0077] At this point, for the current MiniGOP to be encoded, the second target model parameters of each video frame to be encoded in the current MiniGOP can be determined by referring to the adjacent encoded MiniGOPs according to the frame type.

[0078] In video coding, the frame types within a MiniGOP include: P-frames, referenceable B-frames, and non-referenceable B-frames. Therefore, firstly, the number of P-frames, referenceable B-frames, and non-referenceable B-frames in adjacent encoded MiniGOPs is counted. Then, the total number of historical encoded bits and quantization parameters corresponding to P-frames, referenceable B-frames, and non-referenceable B-frames in adjacent encoded MiniGOPs are counted. Finally, based on the total number of historical encoded bits and historical quantization parameters corresponding to P-frames in adjacent encoded MiniGOPs, and the number of P-frames, the average number of historical encoded bits and the average number of historical quantization parameters corresponding to P-frame types in adjacent encoded MiniGOPs are determined. Based on the total number of historical encoded bits and historical quantization parameters corresponding to referable B-frames in adjacent encoded MiniGOPs, and the number of referable B-frames, the average number of historical encoded bits and the average number of historical quantization parameters corresponding to non-referenceable B-frame types in adjacent encoded MiniGOPs are determined.

[0079] Based on the average historical encoded bit count and average historical quantization parameter values ​​of the P-frame types in adjacent encoded MiniGOPs, the model is determined using preset quantization parameters to determine the second target model parameters for each video frame to be encoded in the current MiniGOP containing P-frame types.

[0080] Based on the average historical encoded bit count and average historical quantization parameter values ​​of the reference B-frame types in adjacent encoded MiniGOPs, the model is determined using preset quantization parameters to determine the second target model parameters for each video frame to be encoded in the MiniGOP containing the reference B-frame types.

[0081] Based on the average historical encoded bit count and average historical quantization parameter values ​​of the unreferenced B-frame types in adjacent encoded MiniGOPs, the model is determined using preset quantization parameters to determine the second target model parameters for each video frame to be encoded in the current MiniGOP containing unreferenced B-frame types.

[0082] The division of GOPs and MiniGOPs in the target video, and the frame type of each video frame included in each MiniGOP, can be determined according to relevant technologies, and this disclosure does not make specific limitations in this regard.

[0083] Based on the historical average number of encoded bits (avg_real_bits) and the historical average quantization parameter (avg_real_qp) corresponding to the target frame type (P-frame, reference B-frame, non-reference B-frame) in adjacent encoded MiniGOPs, the second target model parameter b is determined for each video frame to be encoded in the current MiniGOP, including the target frame type (P-frame, reference B-frame, non-reference B-frame), using the preset quantization parameter determination model (RQ model) and the following formula (5):

[0084] b=avg_real_qp-a0×log2(avg_real_bits / (w×h)) (5).

[0085] Figure 2 This diagram illustrates how, according to an embodiment of the present disclosure, second target model parameters for each video frame to be encoded included in the current MiniGOP are determined by referencing adjacent encoded MiniGOPs based on frame type. Figure 2 As shown, the adjacent encoded MiniGOP includes P-frame (P8), referenceable B-frames (B4, B2, B6), and non-referenceable B-frames (B1, B3, B5, B7); the current MiniGOP to be encoded includes P-frame (P12), referenceable B-frame (B10), and non-referenceable B-frames (B9, B11).

[0086] Based on the historical average number of encoded bits and the historical average quantization parameter of P-frames (P8) in adjacent encoded MiniGOPs, determine the second target model parameters of P-frames (P12) included in the current MiniGOP to be encoded.

[0087] Based on the historical average number of encoded bits and the historical average value of quantization parameters of the reference B frames (B4, B2, B6) in the adjacent encoded MiniGOP, determine the second target model parameters of the reference B frame (B10) included in the current MiniGOP to be encoded.

[0088] Based on the historical average number of encoded bits and the historical average quantization parameter of unreferenced B-frames (B1, B3, B5, B7) in adjacent encoded MiniGOPs, determine the second target model parameters of the unreferenced B-frames (B9, B11) included in the current MiniGOP to be encoded.

[0089] In one possible implementation, the target quantization parameters for each video frame included in the current MiniGOP are determined using preset quantization parameters based on the average number of bits per pixel, the first target model parameters, and the second target model parameters of each video frame to be encoded included in the current MiniGOP. This includes: for any video frame to be encoded included in the current MiniGOP, determining the reference quantization parameters of the video frame to be encoded based on the average number of bits per pixel, the first target model parameters, and the second target model parameters of the video frame to be encoded using preset quantization parameters; and adjusting the reference quantization parameters of the video frame to be encoded based on the preset quantization parameter increment corresponding to the video frame to be encoded, thereby obtaining the target quantization parameters of the video frame to be encoded.

[0090] For the i-th video frame to be encoded in the current MiniGOP, based on the average bits per pixel avg_bpp, the first target model parameter a0, and the second target model parameter b_i of the i-th video frame to be encoded, the reference quantization parameter QP of the i-th video frame to be encoded is determined using the preset quantization parameter determination model (RQ model) and the following formula (6). _ i:

[0091] QP _ i=a0×log2(avg_bpp)+b_i (6).

[0092] Furthermore, based on the preset quantization parameter increment delta_qp_i corresponding to the i-th video frame to be encoded, the reference quantization parameter QP of the video frame to be encoded is adjusted using the following formula (7). _ i, obtain the target quantization parameter QP of the video frame to be encoded. _ i':

[0093] QP _ i' = QP _ i+delta_qp_i (7).

[0094] In this embodiment, the average bit-per-pixel count of the target video is determined based on preset video parameters; a first target model parameter of the preset quantization parameter determination model is determined; for the current MiniGOP to be encoded in the target video, a second target model parameter of each video frame to be encoded included in the current MiniGOP to be encoded is determined under the preset quantization parameter determination model; based on the average bit-per-pixel count, the first target model parameter, and the second target model parameter of each video frame to be encoded included in the current MiniGOP to be encoded, the target quantization parameter of each video frame to be encoded included in the current MiniGOP to be encoded is determined using the preset quantization parameter determination model. By determining the average bit-per-pixel count of each video frame to be encoded, the target quantization parameter of each video frame to be encoded included in each MiniGOP can be adaptively determined based on the average bit-per-pixel count using the preset quantization parameter determination model. Thus, without needing to calculate the SATD complexity of each video frame to be encoded, efficient MiniGOP-level bitrate control friendly to hardware video encoders can be achieved.

[0095] It is understood that the various method embodiments mentioned above in this disclosure can be combined with each other to form combined embodiments without violating the principle and logic. Due to space limitations, this disclosure will not elaborate further. Those skilled in the art will understand that in the above methods of specific implementation, the specific execution order of each step should be determined by its function and possible internal logic.

[0096] In addition, this disclosure also provides video encoding apparatus, electronic equipment, computer-readable storage medium, and program, all of which can be used to implement any of the video encoding methods provided in this disclosure. The corresponding technical solutions and descriptions are described in the corresponding descriptions in the method section and will not be repeated here.

[0097] Figure 3 A block diagram of a video encoding apparatus according to an embodiment of the present disclosure is shown. Figure 3 As shown, device 30 includes:

[0098] The first determining module 31 is used to determine the average number of bits per pixel of the target video based on preset video parameters;

[0099] The second determining module 32 is used to determine the first target model parameters of the preset quantization parameter determining model;

[0100] The third determining module 33 is used to determine the second target model parameters under the preset quantization parameter determining model for each video frame included in the current MiniGOP to be encoded in the target video;

[0101] The fourth determining module 34 is used to determine the model using preset quantization parameters based on the average number of bits per pixel, the first target model parameters, and the second target model parameters of each video frame to be encoded included in the current MiniGOP to be encoded.

[0102] In one possible implementation, the preset video parameters include: preset video bitrate, preset video frame rate, and preset video resolution.

[0103] In one possible implementation, the third determining module 33 is specifically used for:

[0104] When the MiniGOP to be encoded is the initial MiniGOP, the preset quantization parameters are determined to determine the second initial model parameters of the model, where the initial MiniGOP refers to the MiniGOP that needs to be encoded independently;

[0105] Based on the average number of bits per pixel, the first target model parameters, and the second initial model parameters, the model is determined using preset quantization parameters, and the second target model parameters of each video frame to be encoded included in the current MiniGOP to be encoded are determined.

[0106] In one possible implementation, the third determining module 33 is specifically used for:

[0107] Based on the average number of bits per pixel, the first target model parameters, and the second initial model parameters, the model is determined using preset quantization parameters, and the initial quantization parameters are determined.

[0108] Based on the initial quantization parameters and the preset quantization parameter increments for each video frame to be encoded included in the current MiniGOP, the model is determined using the preset quantization parameters, and the second target model parameters for each video frame to be encoded included in the current MiniGOP are determined.

[0109] In one possible implementation, the third determining module 33 is specifically used for:

[0110] When the current MiniGOP to be encoded is an uninitialized MiniGOP, determine the number of historical encoded bits and historical quantization parameters of each encoded video frame included in the adjacent encoded MiniGOPs of the current MiniGOP to be encoded. Here, an uninitialized MiniGOP means a MiniGOP that needs to be encoded by referring to the adjacent encoded MiniGOPs.

[0111] Based on the historical number of encoded bits and historical quantization parameters of each encoded video frame included in the adjacent encoded MiniGOP, the model is determined using preset quantization parameters, and the second target model parameters of each video frame to be encoded included in the current MiniGOP to be encoded are determined.

[0112] In one possible implementation, the third determining module 33 is specifically used for:

[0113] If the number of video frames to be encoded in the current MiniGOP is the same as the number of encoded video frames in the adjacent MiniGOPs, the second target model parameters of the i-th video frame to be encoded in the current MiniGOP are determined by using the model with preset quantization parameters based on the historical encoded bit count and historical quantization parameters of the i-th encoded video frame in the adjacent MiniGOPs, where i is a positive integer.

[0114] In one possible implementation, the third determining module 33 is specifically used for:

[0115] When the number of video frames to be encoded in the current MiniGOP to be encoded is different from the number of encoded video frames in the adjacent encoded MiniGOPs, the average historical number of encoded bits and the average historical quantization parameters corresponding to the target frame type in the adjacent encoded MiniGOPs are determined based on the historical number of encoded bits and historical quantization parameters of each encoded video frame in the adjacent encoded MiniGOPs. The target frame types include: P-frames, referenceable B-frames, and non-referenceable B-frames.

[0116] Based on the average historical encoded bit count and average historical quantization parameter of the target frame type in adjacent encoded MiniGOPs, the model is determined using preset quantization parameters, and the second target model parameters of each video frame to be encoded in the target frame type included in the current MiniGOP to be encoded are determined.

[0117] In one possible implementation, the fourth determining module 34 is specifically used for:

[0118] For any video frame to be encoded in the current MiniGOP, the model is determined by using preset quantization parameters based on the average number of bits per pixel, the first target model parameters, and the second target model parameters of the video frame to be encoded, and the reference quantization parameters of the video frame to be encoded are determined.

[0119] Based on the increment of the preset quantization parameters corresponding to the video frame to be encoded, the reference quantization parameters of the video frame to be encoded are adjusted to obtain the target quantization parameters of the video frame to be encoded.

[0120] In one possible implementation, device 30 is located in a hardware video encoder.

[0121] This method is specifically technically related to the internal structure of computer systems and can solve technical problems of how to improve hardware computing efficiency or execution performance (including reducing data storage, reducing data transmission, and increasing hardware processing speed), thereby achieving technical effects that improve the internal performance of computer systems in accordance with natural laws.

[0122] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0123] This disclosure also proposes a computer-readable storage medium storing computer program instructions that, when executed by a processor, implement the above-described method. The computer-readable storage medium can be volatile or non-volatile.

[0124] This disclosure also proposes an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to execute the above-described method.

[0125] This disclosure also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the above-described method.

[0126] Electronic devices can be provided as terminals, servers, or other forms of devices.

[0127] Figure 4 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. (Refer to...) Figure 4 The electronic device 1900 can be provided as a server or a terminal device. (See reference...) Figure 4 The electronic device 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by the processing component 1922. The application programs stored in memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform the methods described above.

[0128] Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input / output interface 1958. Electronic device 1900 can operate on an operating system stored in memory 1932, such as Microsoft Server operating system (Windows Server). TM Apple's graphical user interface-based operating system (Mac OS X) TM ), a multi-user, multi-process computer operating system (Unix) TM Linux is a free and open-source Unix-like operating system. TM ), the open-source Unix-like operating system (FreeBSD) TM (or similar.)

[0129] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions that can be executed by a processing component 1922 of an electronic device 1900 to perform the above-described method.

[0130] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.

[0131] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example, (but not limited to) electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0132] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0133] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.

[0134] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0135] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0136] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0137] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0138] The computer program product can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0139] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.

[0140] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0141] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.

[0142] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A video encoding method, characterized in that, include: Determine the average number of bits per pixel in the target video based on preset video parameters; Determine the preset quantization parameters to determine the first target model parameters of the model; For the current MiniGOP to be encoded in the target video, determine each video frame to be encoded included in the current MiniGOP to be encoded, and determine the second target model parameters under the preset quantization parameter determination model; Based on the average number of bits per pixel, the first target model parameters, and the second target model parameters of each video frame to be encoded included in the current MiniGOP to be encoded, the model is determined using the preset quantization parameters, and the target quantization parameters of each video frame to be encoded included in the current MiniGOP to be encoded are determined.

2. The method according to claim 1, characterized in that, The preset video parameters include: preset video bitrate, preset video frame rate, and preset video resolution.

3. The method according to claim 1, characterized in that, The step of determining the second target model parameters under the preset quantization parameter determination model for each video frame included in the current MiniGOP to be encoded in the target video includes: When the MiniGOP to be encoded is the initial MiniGOP, the second initial model parameters of the model are determined by the preset quantization parameters, wherein the initial MiniGOP refers to the MiniGOP that needs to be encoded independently; Based on the average number of bits per pixel, the first target model parameters, and the second initial model parameters, the model is determined using the preset quantization parameters, and the second target model parameters of each video frame to be encoded included in the current MiniGOP to be encoded are determined.

4. The method according to claim 3, characterized in that, The step of determining the second target model parameters for each video frame to be encoded in the current MiniGOP, based on the average number of bits per pixel, the first target model parameters, and the second initial model parameters, using the preset quantization parameters, includes: Based on the average number of bits per pixel, the first target model parameters, and the second initial model parameters, the model is determined using the preset quantization parameters, and the initial quantization parameters are determined. Based on the initial quantization parameters and the preset quantization parameter increments of each video frame to be encoded included in the current MiniGOP to be encoded, the model is determined using the preset quantization parameters to determine the second target model parameters of each video frame to be encoded included in the current MiniGOP to be encoded.

5. The method according to claim 1, characterized in that, The step of determining the second target model parameters under the preset quantization parameter determination model for each video frame included in the current MiniGOP to be encoded in the target video includes: When the current MiniGOP to be encoded is a non-initialized MiniGOP, the historical encoded bit count and historical quantization parameters of each encoded video frame included in the adjacent encoded MiniGOPs of the current MiniGOP to be encoded are determined. Here, a non-initialized MiniGOP means a MiniGOP that needs to be encoded by referring to the adjacent encoded MiniGOPs. Based on the historical number of encoded bits and historical quantization parameters of each encoded video frame included in the adjacent encoded MiniGOP, the model is determined using the preset quantization parameters to determine the second target model parameters of each video frame to be encoded included in the current MiniGOP to be encoded.

6. The method according to claim 5, characterized in that, The step of determining the second target model parameters for each video frame to be encoded in the current MiniGOP by using the preset quantization parameters to determine the model based on the historical encoded bit count and historical quantization parameters of each encoded video frame included in the adjacent encoded MiniGOP includes: If the number of video frames to be encoded in the current MiniGOP is the same as the number of encoded video frames in the adjacent encoded MiniGOP, the second target model parameters of the i-th video frame to be encoded in the current MiniGOP are determined by using the preset quantization parameters based on the historical encoded bit count and historical quantization parameters of the i-th encoded video frame in the adjacent encoded MiniGOP, where i is a positive integer.

7. The method according to claim 5, characterized in that, The step of determining the second target model parameters for each video frame to be encoded in the current MiniGOP by using the preset quantization parameters to determine the model based on the historical encoded bit count and historical quantization parameters of each encoded video frame included in the adjacent encoded MiniGOP includes: If the number of video frames to be encoded in the current MiniGOP to be encoded is different from the number of encoded video frames in the adjacent encoded MiniGOP, the average historical bit count and the average historical quantization parameter of the target frame type in the adjacent encoded MiniGOP are determined based on the historical bit count and historical quantization parameter of each encoded video frame in the adjacent encoded MiniGOP. The target frame type includes: P-frame, referenceable B-frame, and non-referenceable B-frame. Based on the average historical encoded bit count and average historical quantization parameter value corresponding to the target frame type in the adjacent encoded MiniGOP, the model is determined using the preset quantization parameters to determine the second target model parameters for each video frame to be encoded of the target frame type included in the current MiniGOP to be encoded.

8. The method according to claim 1, characterized in that, The step of determining the target quantization parameters for each video frame included in the current MiniGOP by using the preset quantization parameters to determine the model based on the average number of bits per pixel, the first target model parameters, and the second target model parameters for each video frame to be encoded included in the current MiniGOP includes: For any video frame to be encoded included in the current MiniGOP to be encoded, the model is determined using the preset quantization parameters based on the average number of bits per pixel, the first target model parameters, and the second target model parameters of the video frame to be encoded, and the reference quantization parameters of the video frame to be encoded are determined. Based on the preset quantization parameter increment corresponding to the video frame to be encoded, the reference quantization parameter of the video frame to be encoded is adjusted to obtain the target quantization parameter of the video frame to be encoded.

9. The method according to claim 1, characterized in that, The method is applied to a hardware video encoder.

10. A video encoding device, characterized in that, include: The first determining module is used to determine the average number of bits per pixel in the target video based on preset video parameters; The second determining module is used to determine the first target model parameters of the model based on preset quantization parameters. The third determining module is used to determine the second target model parameters under the preset quantization parameter determining model for each video frame included in the current MiniGOP to be encoded in the target video. The fourth determining module is used to determine the target quantization parameters of each video frame included in the current MiniGOP by using the preset quantization parameters to determine the model based on the average number of bits per pixel, the first target model parameters, and the second target model parameters of each video frame to be encoded included in the current MiniGOP.

11. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 9.

12. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 9.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Video coding method and device, electronic equipment and storage medium

    CN118264798A

  • Video coding method and device

    CN118945351A