Movatterモバイル変換


[0]ホーム

URL:


CN110545418B - Self-adaptive video coding method based on scene - Google Patents

Self-adaptive video coding method based on scene
Download PDF

Info

Publication number
CN110545418B
CN110545418BCN201910795484.6ACN201910795484ACN110545418BCN 110545418 BCN110545418 BCN 110545418BCN 201910795484 ACN201910795484 ACN 201910795484ACN 110545418 BCN110545418 BCN 110545418B
Authority
CN
China
Prior art keywords
frame
coding
code rate
idx
data points
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
CN201910795484.6A
Other languages
Chinese (zh)
Other versions
CN110545418A (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.)
Hangzhou Arcvideo Technology Co ltd
Original Assignee
Hangzhou Arcvideo Technology 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 Hangzhou Arcvideo Technology Co ltdfiledCriticalHangzhou Arcvideo Technology Co ltd
Priority to CN201910795484.6ApriorityCriticalpatent/CN110545418B/en
Publication of CN110545418ApublicationCriticalpatent/CN110545418A/en
Application grantedgrantedCritical
Publication of CN110545418BpublicationCriticalpatent/CN110545418B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The invention discloses a scene-based adaptive video coding method. The method comprises the following specific operation steps: the video encoder takes the source video with each scene as a minimum coding unit; coding each coding unit according to the fixed GOP number, 0B frame, 1 reference frame and a fixed quantization parameter QP mode, and generating an intermediate file; counting the actual consumed bit number, skip block number and actual quality score of each frame; calculating a theoretical code rate, and calculating each P frame in the GOP to obtain a data point; all data points in the same scene are processed in sections at intervals according to the sorting of the code rates from small to large, the average code rate and the average fraction of all the data points in each code rate section are screened and solved, the working point of the section is obtained, and an RD curve is fitted; and the predictor adaptively generates the coding rate for the coding unit. The invention has the beneficial effects that: the computational complexity is greatly reduced and can be conveniently applied to the existing coding framework.

Description

Self-adaptive video coding method based on scene
Technical Field
The invention relates to the technical field related to video coding, in particular to a scene-based adaptive video coding method.
Background
For the current online video-on-demand service, in order to provide better video viewing experience under the conditions of bandwidth limitation and cost control, an OTT distribution platform generally generates a plurality of versions with combination of resolution and code rate for each source video according to a general coding configuration table (or called a coding ladder table), and then selects a proper version according to user bandwidth and a playing terminal. Such a coding configuration table only considers network conditions and terminal player limitations, but not video characteristics. Content complexity can vary greatly for different classes of video. For example, for higher complexity videos such as sports events, the code rate of the encoding configuration may be lower; for videos with low complexity, such as animation films, the code rate of the coding configuration may be high, which causes bandwidth waste. The most immediate result of this approach is inconsistent video quality seen by the user terminals.
Manufacturers represented by Netflix provide a frame based on perceptual video coding optimization, which can improve the video quality of users and save bandwidth, but needs extremely high computational complexity. The method comprises the following steps:
(1) dividing a source video into small coding units according to subjects, segments or scenes;
(2) using different code rate and resolution ratio combinations to compile a plurality of results with quality discrimination for each coding unit and obtain actual code rate and quality fraction;
(3) based on the discrete points of (code rate, quality fraction), finding the most approximate convex hull as the RD curve of the coding unit;
(4) the combination of the optimal code rate resolution is obtained through the RD curve, and the lowest required code rate can be obtained under certain set quality.
Therefore, this method actually obtains the optimal coding parameters by an enumeration method, that is, a series of code rates need to be set for each coding unit for each resolution, and a series of discrete points can be obtained after traversal coding. This method requires extremely high computational power to implement.
Disclosure of Invention
The present invention provides a scene-based adaptive video coding method with low computational complexity to overcome the above-mentioned deficiencies in the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme:
a scene-based adaptive video coding method comprises an analyzer and a predictor, wherein the analyzer is used for determining a coding frame type and counting coding information of each frame; the predictor generates an RD curve of each scene according to the scene information and the coding statistical information, and outputs actual coding parameters according to user set parameters; the specific operation steps are as follows:
(1) a video encoder divides a source video into a series of scenes, and each scene is taken as a minimum coding unit;
(2) coding each coding unit according to the fixed GOP number, 0B frame, 1 reference frame and a fixed quantization parameter QP mode, and generating an intermediate file;
(3) counting the actual consumed bit number, skip block number and actual quality score of each frame code, and setting the skip block number of the idx P frame to be NUMidxMass fraction of Scoreidx
(4) Calculating a theoretical code rate, and calculating each P frame in the GOP to obtain a data point;
(5) sorting all data points in the same scene from small to large according to code rates, processing the data points in sections at certain code rate intervals, screening and solving the average code rate and the average fraction of all the data points in each code rate section to obtain working points of the section, and fitting an RD curve;
(6) and the predictor adaptively generates the coding code rate for the coding unit according to the quality fraction set by the user.
The RD curve calculated by the method has high goodness of fit with the actual RD curve. The original method needs to carry out multiple coding (different code rates each time) on the same resolution ratio to obtain a series of working points so as to obtain an RD curve; the RD curve can be calculated only by once coding, and the calculation complexity is greatly reduced. In practical application, the quality consistency of coding scenes with different complexity can be achieved by using the method and the device to adaptively set the coding rate only by specifying the quality score and limiting the highest coding rate by a user without considering video content. The method for rapidly acquiring the coding unit RD curve is provided, the coding parameters can be determined in a self-adaptive mode according to the quality scores set by a user, the calculation complexity is low, and the method can be conveniently applied to the existing coding framework.
Preferably, the coding information of each frame comprises a fixed quantization parameter QP value, an actual consumed bit number, an actual quality score and the number of skip blocks; the video encoder is a general h.264 or h.265 encoder.
Preferably, in step (2),the generated intermediate file is as follows: the set range of the fixed quantization parameter QP is [ QPmin,QPmax]The fixed quantization parameter QP of each frame is a fixed value; the fixed quantization parameter QP value of the I-frame is set to QPminI.e. QPI=QPminThe fixed quantization parameter QP value of the subsequent P frame is QP according to step sizestepMake an incremental setting if the value is greater than QPmaxThen get back from QPminThe setup is started.
Preferably, in step (4), the specific calculation method is as follows: distributing the BIT number of the I frame to other P frames according to the proportion of skip blocks in each P frame in the same GOP, and setting the BIT number of the I frame as BITIThe BIT number consumed by the idx-th P frame is BITidx,The corrected BIT number is BIT'idxCalculating to obtain a theoretical code rate by combining the frame rate FPS of the video file; then:
Figure BDA0002180816830000031
Figure BDA0002180816830000041
Bitrateidx=BIT′idx*FPS
each P-frame in the GOP may be calculated to obtain a data point (bitate)idx,Scoreidx)。
Preferably, in step (5), the segment is divided into m segments, for all data points in each code rate segment, data points with a confidence of 80% are screened, and the average code rate and the average score of the data points are obtained to obtain the operating point (Bitrate ') of the segment'j,Score′j) And m sections obtain m working points, n data points are set in a certain code rate interval, and then the sum of Euclidean distances between each data point and other data points is respectively obtained:
Figure BDA0002180816830000042
selecting 80% of data points with the minimum Euclidean distance sum according to the confidence coefficient of 80%; monotonously processing m working points, namely ensuring that the Score is high when the Bitrate is high; the line connecting the m operating points can be regarded as an RD curve.
Preferably, in step (6), the average code rate Bitrate required by the coding unit can be calculated from the RD curveavgBitrate is usedavg1.5 as maximum bit Rate Bitratemax(ii) a If the maximum code rate does not exceed the maximum code rate set by the user, coding at the code rate; otherwise, coding is carried out according to the code rate set by the user.
The invention has the beneficial effects that: the method has the advantages of greatly reducing the computational complexity, achieving the quality consistency when coding scenes with different complexities, being capable of adaptively determining coding parameters according to the quality scores set by a user, having lower computational complexity and being conveniently applied to the existing coding framework.
Drawings
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
The invention is further described with reference to the following figures and detailed description.
In the embodiment shown in fig. 1, a scene-based adaptive video coding method includes an analyzer and a predictor, where the analyzer is configured to determine a coding frame type and count coding information of each frame, where the coding information of each frame includes setting a fixed quantization parameter QP value, an actual consumed bit number, an actual quality score, and a skip block number; the predictor generates an RD curve of each scene according to the scene information and the coding statistical information, and outputs actual coding parameters according to user set parameters; the video encoder is a general h.264 or h.265 encoder; the specific operation steps are as follows:
(1) a video encoder divides a source video into a series of scenes, and each scene is taken as a minimum coding unit;
(2) coding each coding unit according to the fixed GOP number, 0B frame, 1 reference frame and a fixed quantization parameter QP mode, and generating an intermediate file;
the generated intermediate file is as follows: the set range of the fixed quantization parameter QP is [ QPmin,QPmax]For example, [20, 40 ] can be taken]The fixed quantization parameter QP of each frame is a fixed value; the fixed quantization parameter QP value of the I-frame is set to QPminI.e. QPI=QPminThe fixed quantization parameter QP value of the subsequent P frame is QP according to step sizestepMake an incremental setting (step size is typically 1) if the value is greater than QPmaxThen get back from QPminStart setting, i.e. QPPidt=QPmin+(idx*QPstep)/(QPmax-QPmin),PidxRefers to the idx-th P frame;
(3) counting the actual consumed bit number, skip block number and actual quality score of each frame code, and setting the skip block number of the idx P frame to be NUMidxMass fraction of Scoreidx
(4) Calculating a theoretical code rate, and calculating each P frame in the GOP to obtain a data point;
the specific calculation method is as follows: distributing the BIT number of the I frame to other P frames according to the proportion of skip blocks in each P frame in the same GOP, and setting the BIT number of the I frame as BITIThe BIT number consumed by the idx-th P frame is BITidxBIT number after correction is BIT'idxCalculating to obtain a theoretical code rate by combining the frame rate FPS of the video file; then:
Figure BDA0002180816830000061
Figure BDA0002180816830000062
Bitrateidx=BIT′idx*FPS
each P-frame in the GOP may be calculated to obtain a data point (bitate)idx,Scoreidx);
(5) All data points (Bitrate) in the same scene are combinedidx,Scoreidx) Sorting according to the code rate from small to large, processing in sections at certain code rate intervals, screening all data points in each code rate section, solving the average code rate and the average fraction of the data points, obtaining the working point of the section, and fitting an RD curve;
for example, the code rate interval is 200kbps, the interval is set to be m segments, data points with a confidence of 80% are screened for all data points in each code rate segment, and the average code rate and the average score of the data points are obtained to obtain the operating point (bite ') in the segment'j,Score′j) m sections obtain m working points, n data points are set in a certain code rate interval, and then the sum of Euclidean distances between each data point and other data points is respectively obtained:
Figure BDA0002180816830000063
selecting 80% of data points with the minimum Euclidean distance sum according to the confidence coefficient of 80%; monotonously processing m working points, namely ensuring that the Score is high when the Bitrate is high; the connecting line of the m working points can be used as an RD curve;
(6) according to the quality fraction set by a user, the predictor adaptively generates a coding rate for the coding unit;
specifically, the RD curve can be used to calculate the average bit rate (Bitrate) required by the coding unitavgBitrate is usedavg1.5 as maximum bit Rate Bitratemax(ii) a If the maximum code rate does not exceed the maximum code rate set by the user, coding at the code rate; otherwise, coding is carried out according to the code rate set by the user.
The RD curve calculated by the method has high goodness of fit with the actual RD curve. The original method needs to carry out multiple coding (different code rates each time) on the same resolution ratio to obtain a series of working points so as to obtain an RD curve; the RD curve can be calculated only by once coding, and the calculation complexity is greatly reduced. In practical application, the quality consistency of coding scenes with different complexity can be achieved by using the method and the device to adaptively set the coding rate only by specifying the quality score and limiting the highest coding rate by a user without considering video content. The method for rapidly acquiring the coding unit RD curve is provided, the coding parameters can be determined in a self-adaptive mode according to the quality scores set by a user, the calculation complexity is low, and the method can be conveniently applied to the existing coding framework.

Claims (4)

1. A self-adaptive video coding method based on scenes is characterized by comprising an analyzer and a predictor, wherein the analyzer is used for determining a coding frame type and counting coding information of each frame; the predictor generates an RD curve of each scene according to the scene information and the coding statistical information, and outputs actual coding parameters according to user set parameters; the specific operation steps are as follows:
(1) a video encoder divides a source video into a series of scenes, and each scene is taken as a minimum coding unit;
(2) coding each coding unit according to the fixed GOP number, 0B frame, 1 reference frame and a fixed quantization parameter QP mode, and generating an intermediate file; the generated intermediate file is as follows: the set range of the fixed quantization parameter QP is [ QPmin,QPmax]The fixed quantization parameter QP of each frame is a fixed value; the fixed quantization parameter QP value of the I-frame is set to QPminI.e. QPI=QPminThe fixed quantization parameter QP value of the subsequent P frame is QP according to step sizestepMake an incremental setting if the value is greater than QPmaxThen get back from QPminAt the beginning of the setup, i.e.
Figure FDA0003207719170000013
PidxRefers to the idx-th P frame;
(3) counting the actual consumed bit number, skip block number and actual quality score of each frame code, and setting the skip block number of the idx P frame to be NUMidxMass fraction of Scoreidx
(4) Calculating theoretical codeRate, calculating each P frame in the GOP to obtain a data point; the specific calculation method is as follows: distributing the BIT number of the I frame to other P frames according to the proportion of skip blocks in each P frame in the same GOP, and setting the BIT number of the I frame as BITIThe BIT number consumed by the idx-th P frame is BITidxBIT number after correction is BIT'idxCalculating to obtain a theoretical code rate by combining the frame rate FPS of the video file; then:
Figure FDA0003207719170000011
Figure FDA0003207719170000012
Bitrateidx=BIT′idx*FPS
each P-frame in the GOP may be calculated to obtain a data point (bitate)idx,Scoreidx);
(5) Sorting all data points in the same scene from small to large according to code rates, processing the data points in sections at intervals of certain code rates, screening all the data points in each code rate section, solving the average code rate and the average fraction of the data points to obtain a working point of each code rate section, and fitting an RD curve;
(6) and the predictor adaptively generates the coding code rate for the coding unit according to the quality fraction set by the user.
2. The adaptive video coding method based on scenes as claimed in claim 1, wherein the coding information of each frame comprises setting a fixed quantization parameter QP value, an actual consumed bit number, an actual quality score, and a skip block number; the video encoder is a general h.264 or h.265 encoder.
3. The scene-based adaptive video coding method according to claim 1, wherein in step (5), the partition into m sections is setScreening data points with the confidence coefficient of 80% for all data points in each code rate section, and solving the average code rate and the average fraction of the data points to obtain the working point (bite ') of each code rate section'j,Score′j) M sections obtain m working points, n data points are set in a certain code rate section, and then the sum of Euclidean distances between each data point and other data points is respectively obtained:
Figure FDA0003207719170000021
selecting 80% of data points with the minimum Euclidean distance sum according to the confidence coefficient of 80%; monotonously processing m working points, namely ensuring that the Score is high when the Bitrate is high; the line connecting the m operating points can be regarded as an RD curve.
4. The method as claimed in claim 1 or 2, wherein in step (6), the average bit rate (Birate) required by the coding unit is calculated from the RD curveavgBitrate is usedavg1.5 as maximum bit Rate Bitratemax(ii) a If the maximum code rate does not exceed the maximum code rate set by the user, coding at the code rate; otherwise, coding is carried out according to the code rate set by the user.
CN201910795484.6A2019-08-272019-08-27Self-adaptive video coding method based on sceneActiveCN110545418B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910795484.6ACN110545418B (en)2019-08-272019-08-27Self-adaptive video coding method based on scene

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910795484.6ACN110545418B (en)2019-08-272019-08-27Self-adaptive video coding method based on scene

Publications (2)

Publication NumberPublication Date
CN110545418A CN110545418A (en)2019-12-06
CN110545418Btrue CN110545418B (en)2021-09-24

Family

ID=68712098

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910795484.6AActiveCN110545418B (en)2019-08-272019-08-27Self-adaptive video coding method based on scene

Country Status (1)

CountryLink
CN (1)CN110545418B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113747161B (en)*2020-05-292024-07-19北京金山云网络技术有限公司Information acquisition method and device, storage medium and electronic device
CN113747162B (en)*2020-05-292023-09-29北京金山云网络技术有限公司Video processing method and device, storage medium and electronic device
CN113938682B (en)*2020-06-292025-06-03北京金山云网络技术有限公司 Video encoding method, device and electronic device
CN115665485B (en)*2022-12-262023-04-28杭州星犀科技有限公司Video picture optimization method and device, storage medium and video terminal
CN120547336A (en)*2024-10-152025-08-26支付宝(杭州)信息技术有限公司 Video bit rate control method, device and equipment

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101511026B (en)*2009-02-232011-01-19四川长虹电器股份有限公司Code rate control method for AVS secondary encode based on scene
CN101795415B (en)*2010-04-222012-02-08杭州华三通信技术有限公司Method and device for controlling code rate in video coding
CN101888542B (en)*2010-06-112013-01-09北京数码视讯科技股份有限公司Control method for frame level bit-rate of video transcoding and transcoder
CA2839345A1 (en)*2011-06-142012-12-20Zhou WangMethod and system for structural similarity based rate-distortion optimization for perceptual video coding
US20130107960A1 (en)*2011-11-022013-05-02Syed AliScene dependent motion search range adaptation
CN107027030B (en)*2017-03-072018-11-09腾讯科技(深圳)有限公司A kind of code rate allocation method and its equipment
US10897269B2 (en)*2017-09-142021-01-19Apple Inc.Hierarchical point cloud compression
CN109286825B (en)*2018-12-142021-04-30北京百度网讯科技有限公司Method and apparatus for processing video

Also Published As

Publication numberPublication date
CN110545418A (en)2019-12-06

Similar Documents

PublicationPublication DateTitle
CN110545418B (en)Self-adaptive video coding method based on scene
US12149699B2 (en)Content adaptation for streaming
CN106537923B (en)The technology of adaptive video stream
US11736699B2 (en)Perceptual quality assessment metric based content and viewer aware encoding
CN108810545B (en)Method, apparatus, computer readable medium and electronic device for video encoding
US20140044197A1 (en)Method and system for content-aware multimedia streaming
CN112437301B (en) A code rate control method, device, storage medium and terminal for visual analysis
JP2008504750A5 (en)
EP1762093A2 (en)Multi-pass video encoding
KR101583896B1 (en)Video coding
CN117440209B (en)Implementation method and system based on singing scene
CN114430501B (en)Content adaptive coding method and system for file transcoding
EP3664456A1 (en)Apparatus and method for playing streamed media
WO2014066975A1 (en)Methods and systems for controlling quality of a media session
CN113630599A (en)ROI-based video code rate control method and system
WO2021064136A1 (en)Information-adaptive mixed deterministic/machine-learning-based bit stream video-quality model
Moon et al.An Uniformalized Quality Encoding in Cloud Transcoding System
CA3202477A1 (en)Video asset quality assessment and encoding optimization to achieve target quality requirement
Asan et al.Optimum encoding approaches on video resolution changes: A comparative study
US20140198845A1 (en)Video Compression Technique
US8971393B2 (en)Encoder
CN115103187B (en) A low-delay video encoding bit rate control method and device
EP2174505A1 (en)Scene cut detection for video stream compression
CN115550654A (en)Method, device and storage medium for adaptively modifying video coding parameters
Ren et al.Rate Control Optimizing Model for Constraining Over-Saturated Live Streaming Quality

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp