CN107197296A - A kind of HEVC parallel encoding method and systems based on COStream - Google Patents

A kind of HEVC parallel encoding method and systems based on COStream Download PDF

Info

Publication number
CN107197296A
CN107197296A CN201710477885.8A CN201710477885A CN107197296A CN 107197296 A CN107197296 A CN 107197296A CN 201710477885 A CN201710477885 A CN 201710477885A CN 107197296 A CN107197296 A CN 107197296A
Authority
CN
China
Prior art keywords
image sets
ctu
parallel
entropy code
costream
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.)
Granted
Application number
CN201710477885.8A
Other languages
Chinese (zh)
Other versions
CN107197296B (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.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
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 Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN201710477885.8A priority Critical patent/CN107197296B/en
Publication of CN107197296A publication Critical patent/CN107197296A/en
Application granted granted Critical
Publication of CN107197296B publication Critical patent/CN107197296B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/436Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation using parallelised computational arrangements
    • 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/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses a kind of HEVC parallel encoding method and systems based on COStream, the realization of wherein method includes:Video sequence is divided into some image sets, image sets parallel encoding is carried out by the function for calling C++ to encapsulate in COStream;Each two field picture in image sets is divided into several CTU according to HEVC standard, image parallel encoding is carried out using COStream splitjoin structures;Each CTU includes several syntactic elements, one entropy code function of each syntactic element correspondence, each syntactic element calls the entropy code function of each syntactic element using COStream pipeline, obtains entropy code streamline, and parallel entropy code is carried out to syntactic element using entropy code streamline;Video after being compressed.The present invention solves the demand of magnanimity multimedia video data fast coding under internet environment, reduce the compression time of video data, provided convenience for video service provider quick response client request, while reducing the time that user asks Video service, improve efficiency.

Description

A kind of HEVC parallel encoding method and systems based on COStream
Technical field
It is parallel more particularly, to a kind of HEVC based on COStream the invention belongs to Computer Applied Technology field Coding method and system.
Background technology
With the popularization and the extensive use of handheld device of internet, the data on internet show volatile increasing Long, the wherein multi-medium data such as video and image account for significant proportion.The multi-medium data of these magnanimity is passed to storage and network Defeated to be proposed very high requirement, simple meets growing multimedia by increase storage device with the network bandwidth is improved Data are unpractical, it is necessary to solve this problem by method for distinguishing.
Traditional programming language such as C++ and Java etc. are proposed eighties of last century the 80s and 90s using single instruction stream as spy The programming language levied, they can not be applied to the multicore architecture of current generally existing very well.In order to be provided using the calculating of multinuclear Source, the parallel framework such as pthread, MPI, OpenMP is suggested, but their learning cost is high, user interface is unfriendly, right The requirement of programmer is very high.
The newest coding standard in coding and decoding video field is HEVC, its coding framework with it is H.264 similar, still using base In the hybrid encoding frame of block of pixels.In order to tackle under current internet environment the spy that the video data volume is big, video resolution is high Point, HEVC proposes a series of new coding techniques.Although in the domestic and foreign scholars in terms of the optimization processing of HEVC Video codings Substantial amounts of research has been carried out, but in the case where current internet multimedia data explosion increases, HEVC Video codings Still suffer from following Railway Project:The demand of magnanimity multimedia video data fast coding under internet environment is not solved, depending on The compression time of frequency evidence is longer, and the time of user's request Video service is longer, less efficient.
The content of the invention
For the disadvantages described above or Improvement requirement of prior art, the invention provides a kind of HEVC based on COStream simultaneously Row coding method and system, thus solve prior art and do not solve magnanimity multimedia video data quick braiding under internet environment The demand of code, the compression time of video data is longer, and the time of user's request Video service is longer, and less efficient technology is asked Topic.
To achieve the above object, according to one aspect of the present invention, there is provided a kind of HEVC based on COStream is parallel Coding method, including:
(1) image sets parallel encoding:Video sequence is divided into some image sets, the information of each image sets is obtained, will The information of each image sets inputs corresponding image sets encoder, is carried out by the function for calling C++ to encapsulate in COStream Parallel encoding;
(2) image parallel encoding:Each two field picture in image sets is divided into several CTU according to HEVC standard, collected The information of CTU rows, a wavefront parallel encoder is inputted by the information of every row CTU rows, is tied using COStream splitjoin Structure carries out parallel encoding;
(3) the parallel entropy code of syntactic element:Each CTU includes several syntactic elements, each syntactic element correspondence one Entropy code function, each syntactic element calls the entropy code function of each syntactic element using COStream pipeline, obtains To entropy code streamline, parallel entropy code is carried out to syntactic element using entropy code streamline;
(4) compression of video sequence:Image sets parallel encoding, image parallel encoding and syntactic element are carried out simultaneously to video sequence After row entropy code, the video after being compressed.
Further, step (1) includes:
Video sequence is divided into some image sets by (1-1), obtains the information of each image sets, the information of described image group The size of each two field picture, the start frame of image sets and knot in the quantity of image, image sets in ID, image sets including image sets Beam frame;
The information of each image sets is inputted corresponding image sets encoder by (1-2), when image sets are open image sets When, corresponding image sets encoder periodically inserts every IDR frame when coding;
(1-3) carries out parallel encoding in image sets encoder by the function for calling C++ to encapsulate in COStream.
Further, step (2) includes:
Each two field picture in image sets is divided into several CTU by (2-1) according to HEVC standard, collects the information of CTU rows, CTU number in index of the information of the CTU rows including CTU rows, the line number of CTU rows and CTU rows;
The information of every row CTU rows is inputted a wavefront parallel encoder by (2-2), uses COStream splitjoin Structure carries out parallel encoding;In addition to the first row CTU rows, remaining CTU row is intended to progress and waited until receive one The notice of CTU rows, can just be continued executing with;Current wavefront coded device often encodes one CTU of completion and just sent to next CTU rows Notify.
Further, step (3) includes:
(3-1) each CTU includes several syntactic elements, and syntactic element is converted into after binary bits string carrying out arithmetic volume Code, one context probability modeling of each syntactic element correspondence, entropy code function uses arithmetic coding and context probability modeling;
(3-2) each syntactic element calls the entropy code function of each syntactic element using COStream pipeline, Entropy code streamline is obtained, parallel entropy code is carried out to syntactic element using entropy code streamline.
It is another aspect of this invention to provide that there is provided a kind of HEVC parallel encoder systems based on COStream, including:
Image sets parallel encoding module, for video sequence to be divided into some image sets, obtains the letter of each image sets Breath, corresponding image sets encoder is inputted by the information of each image sets, passes through the function for calling C++ to encapsulate in COStream Carry out parallel encoding;
Image parallel encoding module, for each two field picture in image sets to be divided into several CTU according to HEVC standard, The information of CTU rows is collected, the information of every row CTU rows is inputted into a wavefront parallel encoder, uses COStream's Splitjoin structures carry out parallel encoding;
The parallel entropy code module of syntactic element, several syntactic elements, each syntactic element correspondence are included for each CTU One entropy code function, each syntactic element calls the entropy code letter of each syntactic element using COStream pipeline Number, obtains entropy code streamline, and parallel entropy code is carried out to syntactic element using entropy code streamline;
Compression of video sequence module, for carrying out image sets parallel encoding, image parallel encoding and grammer to video sequence After elements in parallel entropy code, the video after being compressed.
Further, image sets parallel encoding module includes:
First submodule, for video sequence to be divided into some image sets, obtains the information of each image sets, the figure The size of each two field picture in the quantity of image, image sets in ID, image sets as the information including image sets of group, image sets Start frame and end frame;
Second submodule, for the information of each image sets to be inputted into corresponding image sets encoder, when image sets are to open When putting formula image sets, corresponding image sets encoder periodically inserts every IDR frame when coding;
3rd submodule, in image sets encoder, being carried out by the function for calling C++ to encapsulate in COStream Parallel encoding.
Further, image parallel encoding module includes:
The message sub-module of CTU rows, for each two field picture in image sets to be divided into several according to HEVC standard CTU, collects the information of CTU rows, and the information of the CTU rows includes CTU in index, the line number of CTU rows and the CTU rows of CTU rows Number;
Image parallel encoding submodule, for the information of every row CTU rows to be inputted into a wavefront parallel encoder, is used COStream splitjoin structures carry out parallel encoding;In addition to the first row CTU rows, remaining CTU row is intended to progress etc. Treat that the notice until receiving a upper CTU row can just be continued executing with;Current wavefront coded device often encodes one CTU of completion just Send and notify to next CTU rows.
Further, the parallel entropy code module of syntactic element includes:
Entropy code function submodule, several syntactic elements are included for each CTU, and syntactic element is converted into binary system ratio Arithmetic coding is carried out after spy's string, one context probability modeling of each syntactic element correspondence, entropy code function uses arithmetic coding And context probability modeling;
Parallel entropy code submodule, each grammer member is called for each syntactic element using COStream pipeline The entropy code function of element, obtains entropy code streamline, and parallel entropy code is carried out to syntactic element using entropy code streamline.
In general, by the contemplated above technical scheme of the present invention compared with prior art, with following beneficial effect Really:
(1) image sets are carried out parallel encoding by the characteristics of present invention can be handled using image sets with parallelization, accelerate coding Speed, the characteristics of can be with parallel processing using CTU rows in image, parallel encoding be carried out to CTU rows, accelerates coding rate, is utilized The characteristics of CTU syntactic element can carry out pipeline processes, realizes entropy code parallel processing, accelerates coding rate, with reference to each The parallel encoding characteristic of individual level, realizes HEVC parallel encodings, accelerates coding rate.HEVC scramble time is reduced, is solved The demand of magnanimity multimedia video data fast coding, reduces the compression time of video data under internet environment, for regarding Frequency service provider's quick response client request is provided convenience, while reducing the time that user asks Video service, is improved Efficiency.
(2) preferred, in open image sets, the frame in an image sets may be referred in an above image sets , for open image sets, there is data dependence relation between image sets in frame.In such image sets, only First frame of first image sets is every IDR frame.It is therefore, difficult during coding because Video coding is a kind of lossy coding Exempt from that mistake can be introduced, due to inter prediction, mistake can constantly spread after introducing, in order to avoid the hair of such case Raw, encoder can periodically insert every IDR frame when coding, and every IDR frame can make encoder empty reference frame lists, can keep away Exempt from the lasting diffusion of code error.
Brief description of the drawings
Fig. 1 is a kind of flow chart of HEVC parallel encoding methods based on COStream provided in an embodiment of the present invention;
Fig. 2 is the master-plan block diagram for the HEVC parallel encoding methods based on COStream that the embodiment of the present invention 1 is provided;
Fig. 3 is the flow chart for the image sets parallel encoding that the embodiment of the present invention 1 is provided;
Fig. 4 is the flow chart for the single image coding that the embodiment of the present invention 1 is provided;
Fig. 5 is the wavefront parallel encoding schematic diagram that the embodiment of the present invention 1 is provided;
Fig. 6 is the flow chart for the wavefront parallel encoding framework that the embodiment of the present invention 1 is provided;
Fig. 7 is the flow chart for the wavefront parallel encoding details that the embodiment of the present invention 1 is provided;
Fig. 8 is the entropy code streamline schematic diagram that the embodiment of the present invention 1 is provided;
Fig. 9 is the entropy code parallel processing flow chart that the embodiment of the present invention 1 is provided;
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.As long as in addition, technical characteristic involved in each embodiment of invention described below Not constituting conflict each other can just be mutually combined.
As shown in figure 1, a kind of HEVC parallel encoding methods based on COStream, including:
(1) image sets parallel encoding:Video sequence is divided into some image sets, the information of each image sets is obtained, will The information of each image sets inputs corresponding image sets encoder, is carried out by the function for calling C++ to encapsulate in COStream Parallel encoding;
(2) image parallel encoding:Each two field picture in image sets is divided into several CTU according to HEVC standard, collected The information of CTU rows, a wavefront parallel encoder is inputted by the information of every row CTU rows, is tied using COStream splitjoin Structure carries out parallel encoding;
(3) the parallel entropy code of syntactic element:Each CTU includes several syntactic elements, each syntactic element correspondence one Entropy code function, each syntactic element calls the entropy code function of each syntactic element using COStream pipeline, obtains To entropy code streamline, parallel entropy code is carried out to syntactic element using entropy code streamline;
(4) compression of video sequence:Image sets parallel encoding, image parallel encoding and syntactic element are carried out simultaneously to video sequence After row entropy code, the video after being compressed.
Embodiment 1
As shown in Fig. 2 HEVC parallel encodings are by image sets parallel encoding, wavefront parallel encoding, entropy code parallel processing structure Into original video sequence passes through after HEVC parallel encodings, generates bit stream file, completes coding.
(1) image sets are divided, image sets parallel encoding is carried out
Image sets are granularity most thick processing units in HEVC, and image sets are divided into two types, and one kind is closed type image Group, another is open image sets.For closed type image sets, the frame in an image sets will not refer to another figure Separate between frame in picture group, image sets, without data dependence relation, the referring-to relation between frame and frame exists only in figure As the inside of group.Open image sets are different with closed type image sets, in open image sets, and the frame in an image sets can With reference to the frame in an above image sets, for open image sets, there is data dependence relation between image sets. In such image sets, first frame of only first image sets is every IDR frame.Because Video coding is that one kind damages volume Code, therefore, can introduce mistake unavoidably during coding, due to inter prediction, and mistake can constantly expand after introducing Dissipate, in order to avoid the generation of such case, image sets encoder can periodically insert every IDR frame, every IDR frame meeting when coding Encoder is emptied reference frame lists, the lasting diffusion of code error can be avoided.The spacing of every IDR frame is the whole of gop size Several times and it is necessary to more than or equal to the size of image sets.The step as shown in Figure 3 includes two sub-steps:
(1-1) pretreatment stage:Main function is the parameter of parsing input, and carrying out entirety to image sets encoder matches somebody with somebody Put.The quantity of image in the ID of image sets, image sets is set, the size of each frame is calculated, calculates the start frame and knot of image sets Beam frame etc.., it is necessary to which the information of image sets is assigned in each different image sets encoder after initialization is completed, image sets are compiled Code device is obtained after the information of image sets, and it is parsed, image sets is then read, then image sets is compiled successively Code.
(1-2) pipeline stage:After pretreatment stage is completed, into pipeline stage.Pipeline stage makes Realization is mixed with C++ with COStream, splitjoin is a Data Stream Processing structure in COStream language, it is main to use In the parallel task of processing data level.Whole parallel framework is built using COStream, and internal specific coding step uses C++ Realize, and be packaged into function there is provided be called to COStream.Pipeline stage includes three steps:Input processing, simultaneously Row processing and output processing.
(1-2-1) input processing:The major function of input processing module is to read image sets according to the information of image sets, so Image sets are put into queue afterwards, because input module and multiple images group encoder are required for grasping image sets queue Make, it is therefore desirable to which mutual exclusion lock is protected to input rank, need to carry out locking operation to input lock before data are read, read Take release input lock after finishing.An image sets are finished in each reading and are activated by an image sets encoder, allow image sets Encoder is handled.
(1-2-2) parallel processing:Parallel work-flow module is the nucleus module of image sets parallelization processing, and it is by N number of image Group encoder is constituted, and N is degree of parallelism, and depending on the setting of developer, the higher speed-up ratio of degree of parallelism is higher in theory, but specifically The environment of consideration processing platform is needed when realizing, because CPU quantity and internal memory are conditional.Each image sets encoder Represented with a GOPEncoder node.Before an image sets are encoded, locking operation, Waiting Graph first are carried out to input lock It is ready as organizing, if input module has read image sets, then input lock will be discharged, represent that image sets are ready, that Continue executing with, image sets encoder takes out an image sets from queue and handled., will not be first by figure when realizing GOPEncoder is transmitted to again after being read out as group, because image sets data volume is very big, figure is relate to during transmission As the duplication and movement of group, huge expense can be produced.Therefore the data in data flow are not image sets, but figure one by one As the information of group.GOPEncoder is obtained traveling through image sets after image sets, and each image in image sets is encoded, Mainly realized that specific encoding operation is as shown in Figure 4 by the function for calling C++ to encapsulate in COStream in this part.
(1-2-2) output is handled:After being completed to image sets coding, bit stream is produced, due in COStream, Image sets are processed in parallel, and multiple images group encoder is run simultaneously, therefore the generation of bit stream is random, in order to keep away Exempt from it is multiple cause dirty data while writing, write-in bit stream file before need to output lock lock, then bit stream is write In file, release output lock after writing.
(2) CTU rows are divided, wavefront parallel encoding is realized
CTU is in order to more adapt to the change of image texture characteristic, with the one kind for obtaining more preferable encoding efficiency and proposing New coding structure.One CTU includes a luminance coding tree block (Coding Tree Block, CTB) and two chroma coders Tree block.Size common CTU is 64 × 64.CTU can continue to be divided into coding unit (Coding according to the form of quaternary tree Unit, CU), each CU includes a luminance coding block (Coding Block, CB) and two chroma coder blocks, and CU can be with It can continue to be divided into sub- CU downwards, therefore CU size can be from 8 × 8 to 64 × 64.CTU this flexible dividing mode Add the complexity of calculating.In order to accelerate the processing speed to CTU, HEVC proposes wavefront parallel encoding, and it can be simultaneously Multiple CTU rows are handled, the parallel encoding to CTU rows is realized.Wavefront parallel encoding is as shown in Figure 5.Except first CTU row it Outside, remaining each CTU row will fall latter two CTU progress than a upper CTU row, because there is frame in HEVC Prediction, the CTU that CTU needs to refer to directly over it and upper right side could carry out infra-frame prediction, therefore on each CTU rows will fall behind One CTU row, two CTU progress.The flow of wavefront parallel encoding is as shown in fig. 6, contain two big steps.
(2-1) is initialized
The major function of initialization module is initialization encoder context, and the structure of the information of CTU rows is deposited in definition, The quantity of CTU rows is calculated, related structure etc. is initialized, this part is realized using C++.
(2-1-1) defines CTURow data structures:In order to carry out parallelization processing, first definition structure to CTU rows Body stores the information relevant with CTU rows, and each CTU is represented using CTURow, and it includes following information:Row_index tables It is which row of image to show CTU rows, specifies the current abscissas of CTU to be processed in the picture, and current_col represents to work as Preceding preparation will handle CTU row number, the current ordinates of CTU to be processed in the picture be specified, because image can be by more Individual CTU is constituted, can be only by row_index and current_col if whole image can be regarded as CTU two-dimensional array One determines the positions of CTU in the picture;Whether the CTU rows that is_active represents current are active, if current CTURow is being waited Treat CTURow notice, then it is equal to false, otherwise equal to true;Semaphore is notified for event Semaphore, needs to wait CTURow notification signal, if do not received, with regard to that before a CTU is handled Enter blocked state until notified event is just continued executing with;Entropy is entropy code object, for entropy code operation, In order to allow CTU row parallel processings, it is necessary to which allowing has the entropy code operation of Context-dependent separate between CTU rows, Therefore, each CTU row is equipped with an entropy coder;The backup of entropy_buffer then entropy code objects, allows every Although it is separate that individual CTU rows are owned by the entropy code operation that an entropy coder can be between above CTU rows, also result in Entropy code operation can not make full use of existing context statistical information, in order to make full use of existing context to count Information, each CTU rows need to replicate the entropy code context of a upper CTU row, entropy_buffer work before proceeding With being that every coding completes to preserve entropy code context after a CTU, to facilitate the use of CTU rows below.
(2-1-2) calculates the quantity of CTU rows:The quantity of CTU rows is calculated according to the height of frame and CTU size, CTURowNum=PictHeight ÷ CTUHeight.
(2-1-3) initializes the corresponding CTURow objects of each CTU row:Row_index is initialized as current CTU rows Line number;Current_col is initialized as 0;Remaining is_active is initialized as false in addition to first CTU row; For first CTU row, semaphore is initialized as the state of signal, and the corresponding semaphore of other CTU rows is initial Turn to no signal condition.
(2-2) parallelization is handled:Parallel processing module realized using COStream splitjoin structures, Processing of the splitjoin data flow architectures dedicated for data level parallel, its each node is that a wavefront is compiled parallel Code device WPPEncoder, the number of node illustrates degree of parallelism.The unit of WPPEncoder processing is CTU rows, and it travels through CTU rows In each CTU, complete encoding operation is carried out to each CTU, until all CTU are disposed.Due to multiple Can be performed parallel between WPPEncoder, it is achieved that the parallelization processing of CTU rows, WPPEncoder degree of parallelism N by It can be configured as needed.The each WPPEncoder processing to CTU rows is as shown in Figure 7.
(2-2-1) starts WPPEncoder:According to setting above to CTURow, except first WPPEncoder it Outside, other WPPEncoder are blocked wait, because in addition to first CTURow, other CTURow semaphore All it is no signal condition.
(2-2-2) waits notification event:Except the first row CTU, it is other per a line CTU before a CTU is handled, on The processing progress of one CTU row must more than current CTU rows two CTU.If image is regarded as CTU two-dimensional array, frame [x] [y] represents the CTU of xth row y row, then have to wait frame [x-1] [y+2] place before frame [x] [y] processing Reason is completed, and otherwise can not be handled.The notice of event can be realized by semaphore, but COStream does not have the branch of semaphore Hold, it is therefore desirable to realize that the encapsulation to semaphore operations is called there is provided interface to COStream using C++, COStream is supported With C++ hybrid programming.If WPPEncoder have received the notice of signal, then continue to perform downwards.
(2-2-3) replicates the entropy code context of a upper CTU row:The purpose for replicating entropy code context is in order to effective The already present context probabilistic information of utilization.Only need to replicate before CTU rows start once, behind to the institutes of the CTU rows There is entropy code operation to be all based on this entropy code context, it is no longer necessary to replicate.
(2-2-4) CTU is encoded:The step contains the operation such as complete prediction, conversion, quantization, entropy code.This part Directly invoke the realization of C++ functions.
(2-2-5) counts the number for the CTU that completion has been handled in current CTU rows:Count the CTU handled The reason for number is that is, current line is than next line multiprocessing in order to calculate the processing " spacing " between next line CTU and current CTU rows CTU number, send event for the CTU that decides whether to next line and notify.
(2-2-6) judges whether to need to send event notice:Calculate the current completed CTU of CTU rows number with it is next The difference of the individual completed CTU of CTU rows number, if difference is more than or equal to 2, then event notice is just sent to next line CTU, Next line is told to continue with CTU.Because the complexity of the texture of image parts is different, between CTU rows Inconsistent situation occurs in processing progress, in order to meet the requirement of intra-prediction data dependence, it is necessary to judge whether The condition specified is met, event is sent if meeting and is notified, is not otherwise sent.In addition, if thing can be sent by judgement Part notifies that the next CTU rows of expression, which are in, enlivens shape, it is necessary to which next CTURow is_active fields are set into true State.
(2-2-7) sets the state of current CTU rows:Calculate a completed CTU of CTU rows number and current CTU The difference of the completed CTU of row number, if difference is less than 2, then representing next CTU of current CTU rows will be discontented with The data dependence relation of sufficient infra-frame prediction is, it is necessary to which the is_active for setting current CTURow is false, and the current CTU of expression is about to Into blocked state.
(2-2-8) judges whether current CTU rows have handled completion:If having handled completion so to exit WPPEncoder encoders, otherwise continue cycling through execution.
(3) entropy code streamline is constructed, entropy code parallel processing is realized
Main binary arithmetic coding (the Context-based Adaptive using context-adaptive in HEVC Binary Arithmetic Coding, CABAC) it is used as entropy code algorithm.CABAC is realized based on arithmetic coding, except ginseng Outside manifold and slice header informations, the entropy code of remaining syntactic element and conversion coefficient is all handled using CABAC.It It is combined using arithmetic coding and context probability modeling, gives an efficient entropy coding method.Context probability mould Type is that by well-designed, the probability of symbol is obtained by tabling look-up, and needs to enter probabilistic model after completing symbolic coding Row updates, therefore, and the probability of current sign depends on the result of above entropy code.The statistics that CABAC takes full advantage of symbol is special Property and context result.
CABAC is Context-dependent, and when carrying out arithmetic coding, the probability of symbol comes from context model, is compiled The complete symbol of code needs to update context model, and therefore, CABAC has data dependence relation.CABAC context model with Syntactic element is related, syntactic element one context probability modeling of correspondence, just right after context model initialization is completed All syntactic elements are handled in CTU, until CTU all in slice is disposed, then in next slice Original position entropy coder is reset, the main function of replacement is to rebuild and initialize context probability modeling. , it is necessary to encode CTU all in slice in sequence when carrying out entropy code to a slice, for single CTU, its inside Syntactic element is also required to be encoded in sequence, therefore, and the parallel characteristics of data level are not present for slice inside. The characteristics of according to context probability modeling, is analyzed, and finds in same slice, the renewal of context probability modeling with Based on syntactic element, identical syntactic element uses same context mould, and different syntactic elements are used above and below different Literary probabilistic model, that is to say, that for different syntactic elements, their context probability modeling is independent, before CTU is different Put, different syntactic elements can be encoded simultaneously.Therefore, although parallel characteristics of the CTU entropy code without data level, But possessing the parallel characteristics of task level, the parallel characteristics of task level are also streamline.CTU entropy code flow according to grammer The coded sequence of element is divided into multiple steps, forms a streamline, and each step corresponds to a stage of streamline, leads to The mode for crossing streamline is realized and the parallelization of entropy code can be handled.Slice entropy code streamline is as shown in figure 8, CTU is pressed Performed all coding flows according to the coded sequence of syntactic element, different CTU can be handled simultaneously, with CTU1 and Exemplified by CTU2, CTU1 skip_flag and CTU2 split_flag can be encoded simultaneously, because the two syntactic elements Context probability modeling it is separate, without data dependence, and not in same CTU, it is possible to simultaneously encode.Entropy The flow for encoding parallel processing is as shown in Figure 9.
(3-1) pretreatment module:TU is handled by defining a recursive function, current TU is recorded using TUInfo objects Information, judge whether TU may proceed to downwards according to the model split of quaternary tree for sub- TU, if current TU continues division downwards, So represent that current TU does not need encoding transform coefficients and other syntactic elements related to conversion coefficient, TUInfo is_ Split is set to true, if TU does not continue to be divided downwards, then need to encode all including conversion coefficient Syntactic element, TUInfo is_split fields are set to false, then record relative indexings of the current TU in CTU and Depth in CTU, is then added it in queue, and queue directly uses the dique in C++ standard template libraries.Due to Orders of the TUInfo in queue is exactly the order that TU is encoded, therefore entropy code module is to TUInfo sequential processes and recurrence The order that TU is handled under mode is identical, does not result in confusion.
(3-2) entropy code parallelization module:COStream pipeline data flow architectures dedicated for processing streamline, Support the parallel of task level., each language in the stage of the coding of each syntactic element in TU as streamline The calculate node actor, TU that the encoding operation of method is packaged into pipeline often just encode a language by a calculate node Method element, after TU is by pipeline, is just completed to the entropy code of the TU.One TUInfo queue is comprising multiple TUInfo object, each object represents a TU, for any one TUInfo object, and the calculate node in pipeline is all Judge the value of is_split attributes, if true, represent that the TU that the TUInfo is represented may proceed to be divided into sub- TU downwards, So only need to encode split_flag syntactic elements, other syntactic elements, which include conversion coefficient, to be encoded, such as Fruit is_split is false, represents that the TU that TUInfo is represented does not continue to downward division, then needing to encode includes split_ All syntactic elements including flag.The entropy code of various syntactic elements mainly uses CABAC as realization in HEVC, main To include three steps:Binarization, context modeling, binary arithmetic coding.
(3-2-1) binarization:The object of CABAC arithmetic coding processing is binary Bit String, therefore, in arithmetic The syntactic element in HEVC is needed to be converted into binary bits string before coding.Common binarizing method has:Unitary code, Block unitary code, block Lay this code, k ranks Exp- Golomb, fixed length code etc..The binarizing method of each syntactic element is not to the utmost Identical, the corresponding binarizing method of specific syntactic element can check HEVC standard document.
(3-2-2) context modeling:In HEVC, there is correlation between syntactic element, the probability of current sign according to The result of entropy code before Lai Yu, current sign can be more accurately estimated using the information of above encoded symbol Probability, these encoded information are thus referred to as context.In general, the probability of symbol becomes with the content of video Change.A suitable contextual information is selected to be exactly context modeling for syntactic element.HEVC standard document gives all Syntactic element initial context, the context of different syntactic elements is typically different.
(3-2-3) binary arithmetic coding:After the corresponding context model initialization of syntactic element is completed, proceed by Binary arithmetic coding.Binary arithmetic coding is to carry out arithmetic coding to the corresponding binary bits string of syntactic element.Two enter Arithmetic coding processed includes two ways:Bypass mode and usual manner.Bypass coded system in, the symbol of binary string it is general Rate is identical, it is not required that update context probability modeling;In conventional manner, the probability of symbol can be by binary string Obtained in context model, be required for being updated context model after completing each symbolic coding.Use routine Mode or bypass mode determine by syntactic element, HEVC documents specify which syntactic element using bypass mode which Syntactic element uses usual manner.
As it will be easily appreciated by one skilled in the art that the foregoing is merely illustrative of the preferred embodiments of the present invention, it is not used to The limitation present invention, any modifications, equivalent substitutions and improvements made within the spirit and principles of the invention etc., it all should include Within protection scope of the present invention.

Claims (8)

1. a kind of HEVC parallel encoding methods based on COStream, it is characterised in that including:
(1) image sets parallel encoding:Video sequence is divided into some image sets, the information of each image sets is obtained, will be each The information of image sets inputs corresponding image sets encoder, parallel by calling the function that C++ is encapsulated to carry out in COStream Coding;
(2) image parallel encoding:Each two field picture in image sets is divided into several CTU according to HEVC standard, CTU rows are collected Information, the information of every row CTU rows is inputted into a wavefront parallel encoder, entered using COStream splitjoin structures Row parallel encoding;
(3) the parallel entropy code of syntactic element:Each CTU includes several syntactic elements, and one entropy of each syntactic element correspondence is compiled Code function, each syntactic element is called the entropy code function of each syntactic element using COStream pipeline, obtains entropy Encoding pipeline, parallel entropy code is carried out using entropy code streamline to syntactic element;
(4) compression of video sequence:Image sets parallel encoding, image parallel encoding and the parallel entropy of syntactic element are carried out to video sequence After coding, the video after being compressed.
2. a kind of HEVC parallel encoding methods based on COStream according to claim 1, it is characterised in that the step Suddenly (1) includes:
Video sequence is divided into some image sets by (1-1), obtains the information of each image sets, and the information of described image group includes The size of each two field picture, the start frame of image sets and end in the quantity of image, image sets in the ID of image sets, image sets Frame;
The information of each image sets is inputted corresponding image sets encoder by (1-2), right when image sets are open image sets The image sets encoder answered periodically inserts every IDR frame when coding;
(1-3) carries out parallel encoding in image sets encoder by the function for calling C++ to encapsulate in COStream.
3. a kind of HEVC parallel encoding methods based on COStream according to claim 1, it is characterised in that the step Suddenly (2) include:
Each two field picture in image sets is divided into several CTU by (2-1) according to HEVC standard, collects the information of CTU rows, described CTU number in index of the information of CTU rows including CTU rows, the line number of CTU rows and CTU rows;
The information of every row CTU rows is inputted a wavefront parallel encoder by (2-2), uses COStream splitjoin structures Carry out parallel encoding;In addition to the first row CTU rows, remaining CTU row is intended to progress and waited until receive a CTU row Notice, can just continue executing with;Current wavefront coded device often encodes one CTU of completion and just sends notice to next CTU rows.
4. the HEVC parallel encoding methods according to claim 1 based on COStream, it is characterised in that the step (3) include:
(3-1) each CTU includes several syntactic elements, and syntactic element is converted into after binary bits string carrying out arithmetic coding, One context probability modeling of each syntactic element correspondence, entropy code function uses arithmetic coding and context probability modeling;
(3-2) each syntactic element calls the entropy code function of each syntactic element using COStream pipeline, obtains Entropy code streamline, parallel entropy code is carried out using entropy code streamline to syntactic element.
5. a kind of HEVC parallel encoder systems based on COStream, it is characterised in that including:
Image sets parallel encoding module, for video sequence to be divided into some image sets, obtains the information of each image sets, will The information of each image sets inputs corresponding image sets encoder, is carried out by the function for calling C++ to encapsulate in COStream Parallel encoding;
Image parallel encoding module, for each two field picture in image sets to be divided into several CTU according to HEVC standard, is collected The information of CTU rows, a wavefront parallel encoder is inputted by the information of every row CTU rows, is tied using COStream splitjoin Structure carries out parallel encoding;
The parallel entropy code module of syntactic element, several syntactic elements, each syntactic element correspondence one are included for each CTU Entropy code function, each syntactic element calls the entropy code function of each syntactic element using COStream pipeline, obtains To entropy code streamline, parallel entropy code is carried out to syntactic element using entropy code streamline;
Compression of video sequence module, for carrying out image sets parallel encoding, image parallel encoding and syntactic element to video sequence After parallel entropy code, the video after being compressed.
6. a kind of HEVC parallel encoder systems based on COStream according to claim 5, it is characterised in that the figure As group parallel encoding module includes:
First submodule, for video sequence to be divided into some image sets, obtains the information of each image sets, described image group The ID of information including image sets, in image sets in the quantity of image, image sets the size, image sets of each two field picture starting Frame and end frame;
Second submodule, for the information of each image sets to be inputted into corresponding image sets encoder, when image sets are open During image sets, corresponding image sets encoder periodically inserts every IDR frame when coding;
3rd submodule, it is parallel by calling the function that C++ is encapsulated to carry out in COStream in image sets encoder Coding.
7. a kind of HEVC parallel encoder systems based on COStream according to claim 5, it is characterised in that the figure As parallel encoding module includes:
The message sub-module of CTU rows, for each two field picture in image sets to be divided into several CTU according to HEVC standard, is received Collect the information of CTU rows, the information of the CTU rows includes the number of CTU in index, the line number of CTU rows and the CTU rows of CTU rows;
Image parallel encoding submodule, for the information of every row CTU rows to be inputted into a wavefront parallel encoder, is used COStream splitjoin structures carry out parallel encoding;In addition to the first row CTU rows, remaining CTU row is intended to progress etc. Treat that the notice until receiving a upper CTU row can just be continued executing with;Current wavefront coded device often encodes one CTU of completion just Send and notify to next CTU rows.
8. the HEVC parallel encoder systems according to claim 5 based on COStream, it is characterised in that the grammer member Plain parallel entropy code module includes:
Entropy code function submodule, several syntactic elements are included for each CTU, and syntactic element is converted into binary bits string After carry out arithmetic coding, one context probability modeling of each syntactic element correspondence, entropy code function uses arithmetic coding and upper Hereafter probabilistic model;
Parallel entropy code submodule, each syntactic element is called for each syntactic element using COStream pipeline Entropy code function, obtains entropy code streamline, and parallel entropy code is carried out to syntactic element using entropy code streamline.
CN201710477885.8A 2017-06-22 2017-06-22 A kind of HEVC parallel encoding method and system based on COStream Active CN107197296B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710477885.8A CN107197296B (en) 2017-06-22 2017-06-22 A kind of HEVC parallel encoding method and system based on COStream

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710477885.8A CN107197296B (en) 2017-06-22 2017-06-22 A kind of HEVC parallel encoding method and system based on COStream

Publications (2)

Publication Number Publication Date
CN107197296A true CN107197296A (en) 2017-09-22
CN107197296B CN107197296B (en) 2019-08-13

Family

ID=59879428

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710477885.8A Active CN107197296B (en) 2017-06-22 2017-06-22 A kind of HEVC parallel encoding method and system based on COStream

Country Status (1)

Country Link
CN (1) CN107197296B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113196768A (en) * 2018-12-21 2021-07-30 索尼集团公司 Image processing apparatus and method
CN113557731A (en) * 2019-03-11 2021-10-26 佳能株式会社 Method, apparatus and system for encoding and decoding a block tree of video samples
CN114257839A (en) * 2020-09-23 2022-03-29 京东方科技集团股份有限公司 Video encoding device, video decoding device, video playing system and video playing method
WO2024021772A1 (en) * 2022-07-29 2024-02-01 腾讯科技(深圳)有限公司 Live streaming media data processing method, system and apparatus, and computer device

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103974081A (en) * 2014-05-08 2014-08-06 杭州同尊信息技术有限公司 HEVC coding method based on multi-core processor Tilera
CN104221381A (en) * 2012-04-11 2014-12-17 高通股份有限公司 Wavefront parallel processing for video coding
CN104488267A (en) * 2012-06-29 2015-04-01 高通股份有限公司 Tiles and wavefront parallel processing
CN104811696A (en) * 2015-04-17 2015-07-29 北京奇艺世纪科技有限公司 Video data coding method and device
CN104869398A (en) * 2015-05-21 2015-08-26 大连理工大学 Parallel method of realizing CABAC in HEVC based on CPU+GPU heterogeneous platform
CN104980764A (en) * 2014-04-14 2015-10-14 深圳中兴力维技术有限公司 Parallel coding/decoding method, device and system based on complexity balance
CN105516728A (en) * 2015-12-15 2016-04-20 华中科技大学 Parallel intra-frame prediction method of 8*8 sub-macroblocks in H.265/HEVC
US20160323586A1 (en) * 2012-09-26 2016-11-03 Sun Patent Trust Image decoding method, image coding method, image decoding apparatus, image coding apparatus, and image coding and decoding apparatus
US20160381365A1 (en) * 2015-06-23 2016-12-29 Magnum Semiconductor, Inc. Apparatuses and methods for performing information extraction and insertion on bitstreams
CN106788467A (en) * 2016-11-28 2017-05-31 华中科技大学 A kind of Raptor Code coding methods based on CUDA, interpretation method and system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104221381A (en) * 2012-04-11 2014-12-17 高通股份有限公司 Wavefront parallel processing for video coding
CN104488267A (en) * 2012-06-29 2015-04-01 高通股份有限公司 Tiles and wavefront parallel processing
US20160323586A1 (en) * 2012-09-26 2016-11-03 Sun Patent Trust Image decoding method, image coding method, image decoding apparatus, image coding apparatus, and image coding and decoding apparatus
CN104980764A (en) * 2014-04-14 2015-10-14 深圳中兴力维技术有限公司 Parallel coding/decoding method, device and system based on complexity balance
CN103974081A (en) * 2014-05-08 2014-08-06 杭州同尊信息技术有限公司 HEVC coding method based on multi-core processor Tilera
CN104811696A (en) * 2015-04-17 2015-07-29 北京奇艺世纪科技有限公司 Video data coding method and device
CN104869398A (en) * 2015-05-21 2015-08-26 大连理工大学 Parallel method of realizing CABAC in HEVC based on CPU+GPU heterogeneous platform
US20160381365A1 (en) * 2015-06-23 2016-12-29 Magnum Semiconductor, Inc. Apparatuses and methods for performing information extraction and insertion on bitstreams
CN105516728A (en) * 2015-12-15 2016-04-20 华中科技大学 Parallel intra-frame prediction method of 8*8 sub-macroblocks in H.265/HEVC
CN106788467A (en) * 2016-11-28 2017-05-31 华中科技大学 A kind of Raptor Code coding methods based on CUDA, interpretation method and system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
YU-HSIN CHEN,ET AL.: "A Deeply Pipelined CABAC Decoder for HEVC Supporting Level 6.2 High-Tier Applications", 《IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS FOR VIDEO TECHNOLOGY》 *
张维维,等.: "COStream:一种面向数据流的编程语言和编译器实现", 《计算机学报》 *
杨秋吉,等.: "面向Storm的数据流编程模型与编译优化方法研究", 《计算机工程与科学》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113196768A (en) * 2018-12-21 2021-07-30 索尼集团公司 Image processing apparatus and method
CN113557731A (en) * 2019-03-11 2021-10-26 佳能株式会社 Method, apparatus and system for encoding and decoding a block tree of video samples
CN113557731B (en) * 2019-03-11 2024-04-02 佳能株式会社 Method, apparatus and system for encoding and decoding a block tree of video samples
US11949857B2 (en) 2019-03-11 2024-04-02 Canon Kabushiki Kaisha Method, apparatus and system for encoding and decoding a tree of blocks of video samples
CN114257839A (en) * 2020-09-23 2022-03-29 京东方科技集团股份有限公司 Video encoding device, video decoding device, video playing system and video playing method
WO2024021772A1 (en) * 2022-07-29 2024-02-01 腾讯科技(深圳)有限公司 Live streaming media data processing method, system and apparatus, and computer device

Also Published As

Publication number Publication date
CN107197296B (en) 2019-08-13

Similar Documents

Publication Publication Date Title
USRE49727E1 (en) System and method for decoding using parallel processing
JP7098805B2 (en) Codec using neural network
CN107197296B (en) A kind of HEVC parallel encoding method and system based on COStream
CN103918273B (en) It is determined that the method for the binary code word for conversion coefficient
TWI239207B (en) Method and device for coding digital images using intra-mode block prediction
CN102150428B (en) System and method for video encoding using adaptive segmentation
CN101616323B (en) System and method for decoding video coding data stream
CN105453570A (en) Content adaptive entropy coding of partitions data for next generation video
CN103931197A (en) Method of determining binary codewords for transform coefficients
CN105120277A (en) Method for encoding and decoding images, encoding and decoding device, and corresponding computer programs
US10455244B2 (en) Method and device for entropy encoding or entropy decoding video signal for high-capacity parallel processing
CN110337002B (en) HEVC (high efficiency video coding) multi-level parallel decoding method on multi-core processor platform
US20120155540A1 (en) Pixel retrieval for frame reconstruction
CN106358043A (en) Hybrid video decoding apparatus and associated hybrid video decoding method
CN103947211A (en) Method and apparatus of video encoding with partitioned bitstream
CN106412597A (en) Work load balancing in multicore video decoder
US9706201B2 (en) Region-based processing of predicted pixels
Jilani et al. JPEG image compression using FPGA with Artificial Neural Networks
CN115866245A (en) Video encoding method, video encoding device, computer equipment and storage medium
CN116016951A (en) Point cloud processing method, device, equipment and storage medium
US20180316920A1 (en) Video image encoding device, video image encoding method and program recording medium
CN112437303B (en) JPEG decoding method and device
CN109672889A (en) The method and device of the sequence data head of constraint
EP4391538A1 (en) Point cloud coding method and apparatus, point cloud decoding method and apparatus, and computer and storage medium
CN113259675B (en) Ultrahigh-definition video image parallel processing method

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