CN112004087B - Code rate control optimization method taking double frames as control units and storage medium - Google Patents

Code rate control optimization method taking double frames as control units and storage medium Download PDF

Info

Publication number
CN112004087B
CN112004087B CN201910445837.XA CN201910445837A CN112004087B CN 112004087 B CN112004087 B CN 112004087B CN 201910445837 A CN201910445837 A CN 201910445837A CN 112004087 B CN112004087 B CN 112004087B
Authority
CN
China
Prior art keywords
rate control
frame
current
code rate
control unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910445837.XA
Other languages
Chinese (zh)
Other versions
CN112004087A (en
Inventor
张传兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Ingenic Semiconductor Co Ltd
Original Assignee
Beijing Ingenic Semiconductor Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Ingenic Semiconductor Co Ltd filed Critical Beijing Ingenic Semiconductor Co Ltd
Priority to CN201910445837.XA priority Critical patent/CN112004087B/en
Publication of CN112004087A publication Critical patent/CN112004087A/en
Application granted granted Critical
Publication of CN112004087B publication Critical patent/CN112004087B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation

Abstract

The invention provides a code rate control optimization method taking double frames as a control unit, which comprises the following steps: s1, obtaining coding information of a coded frame; s2, calculating and obtaining the code rate and quantization parameters of the current coding frame according to the obtained coding information; s3, obtaining a code rate control error of the current coding frame according to the code rate of the current coding frame and the expected code rate of the current coding frame in the step S2; s4, adjusting quantization parameters of the current coding frame according to the code rate control error and criticality; judging whether the code rate control error of the current coding frame is smaller than a set error; if not, finishing optimizing the quantization parameter of the current coding frame; if yes, entering S5; s5, judging whether the current coding frame is a key frame or not; if no: increase in size qp: qp_next 0=qp_current+qp_delta/2; qp_next 1=qp_current+3 qp_delta/2; if yes: when qp is reduced: qp_next 0=qp_current-3 x qp_delta/2; qp_next 1=qp_current-qp_delta/2.

Description

Code rate control optimization method taking double frames as control units and storage medium
Technical Field
The present invention relates to the field of video encoding/decoding technologies, and in particular, to a code rate control optimization method using double frames as control units and a computer readable storage medium.
Background
The statements in this section merely provide background information related to the present disclosure and may not constitute prior art.
Today's society is a highly digitized society, and video coding technology has been widely used in many fields such as cable television, digital broadcasting, video conferencing, etc. In the application process, the data processing of a computer is matched with the processing of video information and the transmission of a network, and the audiovisual quality is ensured to reach the acceptable range of the common level of people. Video coding technology has been the focus of scientific research in order to save transmission bandwidth and storage space. Better image quality is obtained under the limitations of bandwidth, delay, buffer memory and the like, coded data is efficiently transmitted under the code rate, meanwhile, good and stable quality is ensured, and the code rate control is a key technology of video coding.
In inter prediction, the quality of the reference frame affects the accuracy of the motion search, and thus the code rate and quality of the current frame. In video coding, a previous frame is generally used as a reference frame for inter-frame prediction. The quality of the previous frame is determined by qp of the previous frame. Therefore, qp ordering affects coding efficiency. However, the existing rate control does not consider the influence of qp arrangement order on coding. Wherein, video code rate: video rate is the number of bits of data transmitted per unit time during data transmission, and generally we use kbps, i.e., kilobits per second. A popular understanding is the sampling rate, which is the greater the unit time, the higher the accuracy and the closer the processed file is to the original file. qp is an abbreviation of quantization parameter, and controls quantization step length of residual coefficient, thereby affecting code rate and quality of coding. Code Rate Control (RC): rate control is effectively an optimization algorithm for coding, which is used to control the size of the video stream. The same video coding format has a large code stream, and the more information it contains, the clearer the corresponding image. Two commonly used current methods of code stream control are VBR, which is a dynamic bit rate, and CBR, which is a fixed bit rate. CBR: constant Bit Rate (fixed code rate). The coding is carried out in a constant bit rate mode, when Motion occurs, the code rate is constant, the code word size can only be reduced by increasing the QP, the image quality is poor, and when the scene is static, the image quality is good again, so the image quality is unstable. Such algorithms prioritize code rate (bandwidth). VBR: variable Bit Rate (variable code rate) abbreviations for (c) are provided. The dynamic bit rate, the code rate can be changed along with the different complexity of the image, so the coding efficiency is higher, and the mosaic is less when the motion occurs. The bit rate control algorithm determines the bit rate according to the image content, the image content is simpler, less bit rate is allocated (the code words seem to be more suitable), and more code words are allocated when the image content is complex, so that the quality is ensured, and the bandwidth limitation is also considered. Such algorithms prioritize image quality. Code Rate Control (RC): in transmitting compression encoded video, two issues must be considered: video quality and transmission bandwidth, if the bandwidth is large, it is certain to transmit video with better quality as much as possible; if the bandwidth is low, the compression ratio needs to be increased, and the code stream is reduced; if the bandwidth is dynamically changed, the code stream also needs to be dynamically changed to adapt to the bandwidth, and in summary, the code stream is closely related to the bandwidth. At the same time, we want to get high definition restored images as much as possible, so it is essential to rate control to compress video as much as possible within an acceptable video quality range to improve bandwidth utilization. The bandwidth utilization rate is improved, and the bandwidth is reduced as much as possible under the condition of keeping the video restoration definition. Inter prediction: the image compression is achieved by utilizing the correlation between video image frames, namely the time correlation. In image transmission technology, video images are the main object of interest. Video images are a temporal image sequence of successive image frames spaced apart in time by a frame period that has a greater temporal correlation than in space. The detail change between the adjacent frames of most video images is very small, namely the video images have very strong correlation between frames, and the characteristics of the correlation of the frames are utilized for inter-frame coding, so that the compression ratio is much higher than that of intra-frame coding.
In inter prediction, the quality of the reference frame affects the accuracy of the motion search, and thus the code rate and quality of the current frame. In video coding, a previous frame is generally used as a reference frame for inter-frame prediction. The quality of the previous frame is determined by qp of the previous frame. Therefore, qp ordering affects coding efficiency. However, the existing rate control does not consider the influence of qp arrangement order on coding.
Disclosure of Invention
In order to solve the above problems in the prior art, an object of the present invention is to: the invention upgrades the original code rate control method, and adopts double frames as control units, thereby realizing optimization.
The application provides a code rate control optimization method taking double frames as a control unit, which comprises the following steps:
s1, obtaining coding information of a coded frame;
s2, calculating and obtaining the code rate and quantization parameters of the current coding frame according to the obtained coding information;
s3, obtaining a code rate control error of the current coding frame according to the code rate of the current coding frame and the expected code rate of the current coding frame in the step S2;
s4, adjusting quantization parameters of the current coding frame according to the code rate control error and criticality; judging whether the code rate control error of the current coding frame is smaller than a set error;
if not, finishing optimizing the quantization parameter of the current coding frame;
if so, the first and second data are not identical, then enter S5;
s5 a step of judging whether the current coding frame is a key frame or not:
if no: (1) when qp is increased:
qp_next0=qp_current+qp_delta/2;
qp_next1=qp_current+3*qp_delta/2;
if yes: (2) when qp is reduced:
qp_next0=qp_current-3*qp_delta/2;
qp_next1=qp_current-qp_delta/2;
wherein, the liquid crystal display device comprises a liquid crystal display device,
qp_next0, qp of the first frame of the next rate control unit during double-frame rate control;
qp_next1, qp of the first frame (next frame) of the next rate control unit when double-frame rate control is performed;
qp_current, qp of the current rate control unit;
qp_delta is the absolute value of the difference between the next rate control unit qp and the current rate control unit qp.
The present application also provides an electronic device is provided, which comprises a first electronic device, comprising the following steps: a processor for executing the computer program stored in the memory; a memory having stored thereon a computer program which when executed by a processor implements a rate control optimization method of any of the above with double frames as control units.
The present application further provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a rate control optimization method with a double frame as a control unit as described in any of the above.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate and together with the description serve to explain the invention.
Fig. 1 is a diagram of a relationship between rate control and coding.
FIG. 2A is one of the complete flowcharts of the optimization method of the present invention.
FIG. 2B is a second complete flow chart of the optimization method of the present invention.
Detailed Description
Rate control is an important ring in video coding technology. Video quality and transmission bandwidth are two considerations for rate control. The code rate prioritized algorithm is called cbr and the quality prioritized algorithm is called vbr. The balance of the coding rate and the quality is realized by adjusting qp.
The existing code rate control is single-frame adjustment, and the size of qp is adjusted once. And determining the qp of the next frame according to the feedback of the code rate of the current frame. As shown in fig. 1, is the relationship between rate control and coding.
Furthermore, inter prediction: the correlation between video image frames is exploited, the instant correlation is used for achieving the purpose of image compression.
Reconstructing a frame: and decoding the coded code stream to obtain the frame.
Reference frame: in inter prediction, a frame is used as a reference. The reconstructed frame is used as a reference frame in video encoding and decoding.
qp_next, qp for the next rate control unit (next frame) during single frame rate control.
qp_next0, qp for the first frame of the next rate control unit, during dual-frame rate control.
qp_next1, qp for the first frame of the next rate control unit, during dual-frame rate control.
qp_current qp for the current rate control unit.
qp_delta is the absolute value of the difference between the next rate control unit qp and the current rate control unit qp.
Single frame rate control: original code rate control algorithm using single frame as control unit.
Double-frame code rate control: the invention optimizes the code rate control algorithm which takes double frames as a control unit.
The original code rate control takes a single frame as a control unit. The invention upgrades the original code rate control algorithm, and adopts double frames as control units.
The original single frame code rate control method comprises the following steps:
when qp is increased: qp_next=qp_current+qp_delta;
when qp is reduced: qp_next=qp_current-qp_delta;
the method for controlling the code rate of the upgraded double frames comprises the following steps:
when qp is increased:
qp_next0=qp_current+qp_delta/2;
qp_next1=qp_current+3*qp_delta/2;
when qp is reduced:
qp_next0=qp_current-3*qp_delta/2;
qp_next1=qp_current-qp_delta/2;
specifically, as shown in fig. 2A and fig. 2B, a code rate control optimization method using a double frame as a control unit, the optimization method includes:
s1, obtaining coding information of a coded frame;
s2, calculating and obtaining the code rate and quantization parameters of the current coding frame according to the obtained coding information;
s3, obtaining a code rate control error of the current coding frame according to the code rate of the current coding frame and the expected code rate of the current coding frame in the step S2;
s4, adjusting quantization parameters of the current coding frame according to the code rate control error and criticality; judging whether the code rate control error of the current coding frame is smaller than a set error;
if not, finishing optimizing the quantization parameter of the current coding frame;
if yes, entering S5;
s5, judging whether the current coding frame is a key frame or not:
if no: (1) when qp is increased:
qp_next0=qp_current+qp_delta/2;
qp_next1=qp_current+3*qp_delta/2;
if yes: (2) when qp is reduced:
qp_next0=qp_current-3*qp_delta/2;
qp_next1=qp_current-qp_delta/2;
wherein, the liquid crystal display device comprises a liquid crystal display device,
qp_next0, qp of the first frame of the next rate control unit during double-frame rate control;
qp_next1, qp of the first frame (next frame) of the next rate control unit when double-frame rate control is performed;
qp_current, qp of the current rate control unit;
qp_delta is the absolute value of the difference between the next rate control unit qp and the current rate control unit qp.
The application also provides an electronic device comprising: a processor for executing the computer program stored in the memory; a memory having stored thereon a computer program which when executed by a processor implements a rate control optimization method of any of the above with double frames as control units.
The present application further provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a rate control optimization method with a double frame as a control unit as described in any of the above.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, and various modifications and variations can be made to the embodiments of the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (4)

1. The code rate control optimization method taking double frames as a control unit is characterized by comprising the following steps of:
s1, obtaining coding information of a coded frame;
s2, calculating and obtaining the code rate and quantization parameters of the current coding frame according to the obtained coding information;
s3, obtaining a code rate control error of the current coding frame according to the code rate of the current coding frame and the expected code rate of the current coding frame in the step S2;
s4, adjusting quantization parameters of the current coding frame according to the code rate control error and criticality; judging whether the code rate control error of the current coding frame is smaller than a set error;
if not, finishing optimizing the quantization parameter of the current coding frame;
if yes, entering S5;
s5, judging whether the current coding frame is a key frame or not:
if no: (1) when qp is increased:
qp_next0 = qp_current + qp_delta/2;
qp_next1 = qp_current + 3*qp_delta/2;
if yes: (2) when qp is reduced:
qp_next0 = qp_current - 3*qp_delta/2;
qp_next1 = qp_current - qp_delta/2;
wherein, the liquid crystal display device comprises a liquid crystal display device,
qp_next0, qp of the first frame of the next rate control unit during double-frame rate control;
qp_next1, qp of the next frame of the first frame of the next rate control unit when double-frame rate control is performed;
qp_current, qp of the current rate control unit;
qp_delta is the absolute value of the difference between the next rate control unit qp and the current rate control unit qp.
2. The method for optimizing code rate control by using double frames as control unit according to claim 1, wherein the video file encoded by the method for optimizing code rate control conforms to video-audio coding and decoding specifications of Chinese telecom IPTV service.
3. An electronic device, comprising: a processor for executing the computer program stored in the memory; a memory having stored thereon a computer program which when executed by a processor implements a rate control optimization method with double frames as control unit according to claim 1 or 2.
4. A computer readable storage medium having stored thereon a computer program, characterized in that the program, when executed by a processor, implements a rate control optimization method with double frames as control unit according to the preceding claim 1 or 2.
CN201910445837.XA 2019-05-27 2019-05-27 Code rate control optimization method taking double frames as control units and storage medium Active CN112004087B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910445837.XA CN112004087B (en) 2019-05-27 2019-05-27 Code rate control optimization method taking double frames as control units and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910445837.XA CN112004087B (en) 2019-05-27 2019-05-27 Code rate control optimization method taking double frames as control units and storage medium

Publications (2)

Publication Number Publication Date
CN112004087A CN112004087A (en) 2020-11-27
CN112004087B true CN112004087B (en) 2023-05-09

Family

ID=73461900

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910445837.XA Active CN112004087B (en) 2019-05-27 2019-05-27 Code rate control optimization method taking double frames as control units and storage medium

Country Status (1)

Country Link
CN (1) CN112004087B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1988659A (en) * 2006-12-30 2007-06-27 清华大学 Method for control video frequency coding rate
CN101478676A (en) * 2008-12-08 2009-07-08 四川虹微技术有限公司 Method for B frame code rate controlling
CN102186084A (en) * 2011-06-07 2011-09-14 东莞电子科技大学电子信息工程研究院 Spatial enhancement layer code rate control realization method for scalable video coding
CN102970540A (en) * 2012-11-21 2013-03-13 宁波大学 Multi-view video code rate control method based on key frame code rate-quantitative model
CN104954792A (en) * 2014-03-24 2015-09-30 兴唐通信科技有限公司 Method and device for carrying out subjective video quality optimization coding on P-frame sequence

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI593273B (en) * 2016-04-07 2017-07-21 晨星半導體股份有限公司 Bit-rate controlling method and video encoding device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1988659A (en) * 2006-12-30 2007-06-27 清华大学 Method for control video frequency coding rate
CN101478676A (en) * 2008-12-08 2009-07-08 四川虹微技术有限公司 Method for B frame code rate controlling
CN102186084A (en) * 2011-06-07 2011-09-14 东莞电子科技大学电子信息工程研究院 Spatial enhancement layer code rate control realization method for scalable video coding
CN102970540A (en) * 2012-11-21 2013-03-13 宁波大学 Multi-view video code rate control method based on key frame code rate-quantitative model
CN104954792A (en) * 2014-03-24 2015-09-30 兴唐通信科技有限公司 Method and device for carrying out subjective video quality optimization coding on P-frame sequence

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
视频编码中自适应的初始量化参数预测算法;方权亮;微型机与应用;第33卷(第13期);38-41 *

Also Published As

Publication number Publication date
CN112004087A (en) 2020-11-27

Similar Documents

Publication Publication Date Title
US5485211A (en) Multiple encoder output buffer apparatus for differential coding of video information
US5241383A (en) Pseudo-constant bit rate video coding with quantization parameter adjustment
US5457495A (en) Adaptive video coder with dynamic bit allocation
US20090207918A1 (en) Method and apparatus for video transcoding
US20130251031A1 (en) Method for bit rate control within a scalable video coding system and system therefor
US7826529B2 (en) H.263/MPEG video encoder for efficiently controlling bit rates and method of controlling the same
US20240040127A1 (en) Video encoding method and apparatus and electronic device
US6775325B1 (en) Method and apparatus for converting the bitrate of an encoded bitstream without full re-encoding
US6667698B2 (en) Distributed compression and transmission method and system
JPH0984019A (en) Image data storage device
CN112004084B (en) Code rate control optimization method and system by utilizing quantization parameter sequencing
WO2021007702A1 (en) Video encoding method, video decoding method, video encoding device, and video decoding device
CN112004087B (en) Code rate control optimization method taking double frames as control units and storage medium
Tagliasacchi et al. Minimum variance optimal rate allocation for multiplexed H. 264/AVC bitstreams
KR20040007818A (en) Method for controlling DCT computational quantity for encoding motion image and apparatus thereof
US8548045B2 (en) Method and apparatus for video encoding
CN112004082B (en) Optimization method for code rate control by using double frames as control unit
CN112004083B (en) Method and system for optimizing code rate control by utilizing inter-frame prediction characteristics
KR20030083109A (en) apparatus for transcoding bit rate
WO2024082971A1 (en) Video processing method and related device
Kuo et al. Distributed video coding with limited feedback requests
JP2002534864A (en) Adaptive buffer and quantization adjustment scheme for bandwidth scalability of video data
JPH11196423A (en) Device and method for picture processing and presentation medium
Iwasaki et al. Video transcoding technology for wireless communication systems
KR100323752B1 (en) Method and Telephone for still picture transport

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant