Intra-coded frame rate allocation method, computer device and storage medium
AssigneeTencent Technology (Shenzhen) Company Limited
InventorsXu Nan Mao, Yao Yao Guo, Li Cai Guo, Yong Fang Shi, An Lin Gao, Haibo Deng, Chen Chen Gu, Jing Lv
Life of this patent
Estimating the term…
Abstract
An intra frame bit rate allocation method being performed by a computer device comprising at least one processor, includes when a current frame of picture is an intra frame in a specified frame sequence, pre-encoding the current frame of picture; calculating a corresponding intra frame encoding cost and an inter frame encoding cost of the pre-encoding; and allocating an intra frame bit rate according to the calculated intra frame encoding cost and the inter frame encoding cost.
Claims16
A method for intra frame bit rate allocation being performed by a computer device comprising at least one processor, the method comprising:
- pre-encoding, by the computer device, a current frame of picture that is an intra frame in a specified frame sequence, the pre-encoding comprising encoding the current frame of picture as the intra frame and encoding the current frame of picture as an inter frame by assuming that the current frame of picture, which is the intra frame, as the inter frame;
- calculating, by the computer device, an intra frame encoding cost and an inter frame encoding cost of the pre-encoding;
- calculating, by the computer device, an intra/inter frame encoding cost ratio of the current frame of picture, the intra/inter frame encoding cost ratio being a ratio of the intra frame encoding cost to the inter frame encoding cost of the current frame of picture;
- determining, by the computer device, an intra/inter frame target bit rate ratio according to the intra/inter frame encoding cost ratio, the intra/inter frame target bit rate ratio being a ratio of a preset intra frame target bit rate to a preset inter frame target bit rate, and the intra/inter frame target bit rate ratio being positively correlated with the intra/inter frame encoding cost ratio;
- obtaining, by the computer device, a total target bit rate corresponding to a quantity of frames in a current bit rate control unit;
- and
- allocating, by the computer device, an intra frame bit rate according to the total target bit rate, the intra/inter frame target bit rate ratio, and a preset quantity of intra frames and a preset quantity of inter frames of the current bit rate control unit.
A computer device comprising:
- at least one memory configured to store computer program code;
- and
- at least one processor configured to access the at least one memory and operate according to the computer program code, the computer program code comprising:
- pre-encoding code configured to cause the at least one processor to perform pre-encoding a current frame of picture that is an intra frame in a specified frame sequence, the pre-encoding comprising encoding the current frame of picture as the intra frame and encoding the current frame of picture as an inter frame by assuming that the current frame of picture, which is the intra frame, as the inter frame;
- cost calculating code configured to cause the at least one processor to calculate an intra frame encoding cost and an inter frame encoding cost of the pre-encoding;
- cost ratio calculating code configured to cause the at least one processor to calculate an intra/inter frame encoding cost ratio of the current frame of picture, the intra/inter frame encoding cost ratio being a ratio of the intra frame encoding cost to the inter frame encoding cost of the current frame of picture;
- and
- determining code configured to cause the at least one processor to determine an intra/inter frame target bit rate ratio according to the intra/inter frame encoding cost ratio, the intra/inter frame target bit rate ratio being a ratio of a preset intra frame target bit rate to a preset inter frame target bit rate, and the intra/inter frame target bit rate ratio being positively correlated with the intra/inter frame encoding cost ratio;
- and
- allocating code configured to cause the at least one processor to obtain a total target bit rate corresponding to a quantity of frames in a current bit rate control unit;
- and allocate an intra frame bit rate according to the total target bit rate, the intra/inter frame target bit rate ratio, and a preset quantity of intra frames and a preset quantity of inter frames of the current bit rate control unit.
A non-transitory computer-readable storage medium storing instructions that cause at least one processor to:
- pre-encode a current frame of picture that is an intra frame in a specified frame sequence, the pre-encoding comprising encoding the current frame of picture as the intra frame and encoding the current frame of picture as an inter frame by assuming that the current frame of picture, which is the intra frame, as the inter frame;
- calculate an intra frame encoding cost and an inter frame encoding cost of the pre-encoding;
- calculate an intra/inter frame encoding cost ratio of the current frame of picture, the intra/inter frame encoding cost ratio being a ratio of the intra frame encoding cost to the inter frame encoding cost of the current frame of picture;
- determine an intra/inter frame target bit rate ratio according to the intra/inter frame encoding cost ratio, the intra/inter frame target bit rate ratio being a ratio of a preset intra frame target bit rate to a preset inter frame target bit rate, and the intra/inter frame target bit rate ratio being positively correlated with the intra/inter frame encoding cost ratio;
- obtain a total target bit rate corresponding to a quantity of frames in a current bit rate control unit;
- and
- allocate an intra frame bit rate according to the total target bit rate, the intra/inter frame target bit rate ratio, and a preset quantity of intra frames and a preset quantity of inter frames of the current bit rate control unit.
Dependencies are inferred from the claim text.