CN107197296B - A kind of HEVC parallel encoding method and system based on COStream - Google Patents

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

Info

Publication number
CN107197296B
CN107197296B CN201710477885.8A CN201710477885A CN107197296B CN 107197296 B CN107197296 B CN 107197296B CN 201710477885 A CN201710477885 A CN 201710477885A CN 107197296 B CN107197296 B CN 107197296B
Authority
CN
China
Prior art keywords
ctu
image group
parallel
entropy coding
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.)
Active
Application number
CN201710477885.8A
Other languages
Chinese (zh)
Other versions
CN107197296A (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 system based on COStream, wherein the realization of method includes: that video sequence is divided into several image groups, passes through and the function of C++ encapsulation is called to carry out image group parallel encoding in COStream;Frame image each in image group is divided into several CTU according to HEVC standard, carries out image parallel encoding using the splitjoin structure of COStream;Each CTU includes several syntactic elements, the corresponding entropy coding function of each syntactic element, each syntactic element calls the entropy coding function of each syntactic element using the pipeline of COStream, obtains entropy coding assembly line, carries out parallel entropy coding to syntactic element using entropy coding assembly line;Obtain compressed video.The present invention solves the demand of magnanimity multimedia video data fast coding under internet environment, reduce the compression time of video data, it provides convenience for video service provider quick response client request, while reducing the time that user requests Video service, improve efficiency.

Description

A kind of HEVC parallel encoding method and system based on COStream
Technical field
The invention belongs to computer application technologies, parallel more particularly, to a kind of HEVC based on COStream Coding method and system.
Background technique
With the popularity of the internet with the extensive use of handheld device, the data on internet show volatile increasing Long, wherein the multi-medium datas such as video and image account for significant proportion.The multi-medium data of these magnanimity passes storage and network Defeated to be proposed very high requirement, simple meets growing multimedia with network bandwidth is improved by increase storage equipment Data are unpractical, it is necessary to solve this problem by method for distinguishing.
Traditional programming language such as C++ and Java etc. be all eighties of last century the 80s and 90s propose with single instruction stream for spy The programming language of sign, they cannot be applied to current generally existing multicore architecture very well.In order to be provided using the calculating of multicore Source, the parallel frame such as pthread, MPI, OpenMP are 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 use base In the hybrid encoding frame of block of pixels.In order to cope under current internet environment the spy that the video data volume is big, video resolution is high Point, HEVC propose a series of new coding techniques.Although in the domestic and foreign scholars in terms of the optimization processing of HEVC Video coding A large amount of research has been carried out, but in the case where current internet multimedia data explosion increases, HEVC Video coding It still suffers from following Railway Project: not solving the demand of magnanimity multimedia video data fast coding under internet environment, depending on The compression time of frequency evidence is longer, and user requests the time of Video service longer, and efficiency is lower.
Summary of the invention
Aiming at the above defects or improvement requirements of the prior art, the present invention provides a kind of HEVC based on COStream simultaneously Thus row coding method and system solve the 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 user requests the time of Video service longer, and the lower technology of efficiency is asked Topic.
To achieve the above object, according to one aspect of the present invention, it is parallel to provide a kind of HEVC based on COStream Coding method, comprising:
(1) image group parallel encoding: being divided into several image groups for video sequence, obtains the information of each image group, will The corresponding image group encoder of the information input of each image group, by calling the function of C++ encapsulation to carry out in COStream Parallel encoding;
(2) image parallel encoding: being divided into several CTU for frame image each in image group according to HEVC standard, collects The information of CTU row ties one wavefront parallel encoder of information input of every row CTU row using the splitjoin of COStream Structure carries out parallel encoding;
(3) the parallel entropy coding of syntactic element: each CTU includes several syntactic elements, and each syntactic element is one corresponding Entropy coding function, each syntactic element are called the entropy coding function of each syntactic element using the pipeline of COStream, obtained To entropy coding assembly line, parallel entropy coding is carried out to syntactic element using entropy coding assembly line;
(4) image group parallel encoding, image parallel encoding and syntactic element compression of video sequence: are carried out simultaneously to video sequence After row entropy coding, compressed video is obtained.
Further, step (1) includes:
Video sequence is divided into several image groups by (1-1), obtains the information of each image group, the information of described image group In ID, image group including image group in the quantity, image group of image the size, image group of each frame image start frame and knot Beam frame;
(1-2) by the corresponding image group encoder of the information input of each image group, when image group is open image group When, corresponding image group encoder is periodically inserted into every IDR frame when coding;
(1-3) carries out parallel encoding in image group encoder, through the function for calling C++ to encapsulate in COStream.
Further, step (2) includes:
Frame image each in image group is divided into several CTU according to HEVC standard by (2-1), collects the information of CTU row, The information of the CTU row include the index of CTU row, in the line number of CTU row and CTU row CTU number;
One wavefront parallel encoder of information input of every row CTU row is used the splitjoin of COStream by (2-2) Structure carries out parallel encoding;Other than the first row CTU row, remaining CTU row, which is intended to wait until, receives one The notice of CTU row can just continue to execute;The every coding of current wavefront coded device is completed a CTU and is just sent to next CTU row Notice.
Further, step (3) includes:
(3-1) each CTU includes several syntactic elements, and syntactic element carries out arithmetic volume after being converted into binary bits string Code, the corresponding context probability modeling of each syntactic element, entropy coding function use arithmetic coding and context probability modeling;
(3-2) each syntactic element calls the entropy coding function of each syntactic element using the pipeline of COStream, Entropy coding assembly line is obtained, parallel entropy coding is carried out to syntactic element using entropy coding assembly line.
It is another aspect of this invention to provide that providing a kind of HEVC parallel encoder system based on COStream, comprising:
Image group parallel encoding module obtains the letter of each image group for video sequence to be divided into several image groups Breath, by the corresponding image group encoder of the information input of each image group, by the function for calling C++ encapsulation in COStream Carry out parallel encoding;
Image parallel encoding module, for frame image each in image group to be divided into several CTU according to HEVC standard, One wavefront parallel encoder of information input of every row CTU row is used COStream's by the information for collecting CTU row Splitjoin structure carries out parallel encoding;
The parallel entropy code module of syntactic element, includes several syntactic elements for each CTU, and each syntactic element is corresponding One entropy coding function, each syntactic element call the entropy coding letter of each syntactic element using the pipeline of COStream Number, obtains entropy coding assembly line, carries out parallel entropy coding to syntactic element using entropy coding assembly line;
Compression of video sequence module, for carrying out image group parallel encoding, image parallel encoding and grammer to video sequence After elements in parallel entropy coding, compressed video is obtained.
Further, image group parallel encoding module includes:
First submodule obtains the information of each image group, the figure for video sequence to be divided into several image groups As the information of group include the ID of image group, in image group in the quantity, image group of image each frame image size, image group Start frame and end frame;
Second submodule, for by the corresponding image group encoder of the information input of each image group, when image group is to open When putting formula image group, corresponding image group encoder is periodically inserted into every IDR frame when coding;
Third submodule, for being carried out by the function for calling C++ to encapsulate in COStream in image group encoder Parallel encoding.
Further, image parallel encoding module includes:
The message sub-module of CTU row, for frame image each in image group to be divided into several according to HEVC standard CTU, collects the information of CTU row, and the information of the CTU row includes the index of CTU row, CTU in the line number of CTU row and CTU row Number;
Image parallel encoding submodule, for using one wavefront parallel encoder of information input of every row CTU row The splitjoin structure of COStream carries out parallel encoding;Other than the first row CTU row, remaining CTU row is intended to carry out etc. To which notice until receiving a upper CTU row can just continue to execute;The every coding of current wavefront coded device completes a CTU just It sends and notifies to next CTU row.
Further, the parallel entropy code module of syntactic element includes:
Entropy coding function submodule, includes several syntactic elements for each CTU, and syntactic element is converted into binary system ratio Arithmetic coding, the corresponding context probability modeling of each syntactic element are carried out after spy's string, entropy coding function uses arithmetic coding And context probability modeling;
Parallel entropy coding submodule calls each grammer member using the pipeline of COStream for each syntactic element The entropy coding function of element, obtains entropy coding assembly line, carries out parallel entropy coding to syntactic element using entropy coding assembly line.
In general, through the invention it is contemplated above technical scheme is compared with the prior art, have below beneficial to effect Fruit:
(1) the characteristics of present invention can be handled using image group with parallelization carries out parallel encoding to image group, accelerates coding Speed, can be with parallel processing using CTU row in image the characteristics of, carry out parallel encoding to CTU row, accelerate coding rate, utilize The syntactic element of CTU can carry out the characteristics of pipeline processes, realize entropy coding parallel processing, accelerate coding rate, in conjunction with each The parallel encoding characteristic of a level realizes HEVC parallel encoding, accelerates coding rate.Reduce the scramble time of HEVC, solves The demand of magnanimity multimedia video data fast coding, reduces the compression time of video data under internet environment, for view Frequency service provider quick response client request is provided convenience, while reducing the time that user requests Video service, is improved Efficiency.
(2) preferably, in open image group, the frame in an image group can be with reference in the image group of front one Frame, for open image group, there are data dependence relations between image group.In such image group, only First frame of first image group is every IDR frame.Since Video coding is a kind of lossy coding, it is difficult during coding Exempt from that mistake can be introduced, due to inter-prediction, mistake can constantly be spread after introducing, in order to avoid the hair of such case Raw, encoder can periodically be inserted into 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.
Detailed description of the invention
Fig. 1 is a kind of flow chart of HEVC parallel encoding method based on COStream provided in an embodiment of the present invention;
Fig. 2 is the master-plan block diagram for the HEVC parallel encoding method based on COStream that the embodiment of the present invention 1 provides;
Fig. 3 is the flow chart for the image group parallel encoding that the embodiment of the present invention 1 provides;
Fig. 4 is the flow chart for the single image coding that the embodiment of the present invention 1 provides;
Fig. 5 is the wavefront parallel encoding schematic diagram that the embodiment of the present invention 1 provides;
Fig. 6 is the flow chart for the wavefront parallel encoding frame that the embodiment of the present invention 1 provides;
Fig. 7 is the flow chart for the wavefront parallel encoding details that the embodiment of the present invention 1 provides;
Fig. 8 is the entropy coding assembly line schematic diagram that the embodiment of the present invention 1 provides;
Fig. 9 is the entropy coding parallel processing flow chart that the embodiment of the present invention 1 provides;
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right 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 the various embodiments of the present invention described below Not constituting a conflict with each other can be combined with each other.
As shown in Figure 1, a kind of HEVC parallel encoding method based on COStream, comprising:
(1) image group parallel encoding: being divided into several image groups for video sequence, obtains the information of each image group, will The corresponding image group encoder of the information input of each image group, by calling the function of C++ encapsulation to carry out in COStream Parallel encoding;
(2) image parallel encoding: being divided into several CTU for frame image each in image group according to HEVC standard, collects The information of CTU row ties one wavefront parallel encoder of information input of every row CTU row using the splitjoin of COStream Structure carries out parallel encoding;
(3) the parallel entropy coding of syntactic element: each CTU includes several syntactic elements, and each syntactic element is one corresponding Entropy coding function, each syntactic element are called the entropy coding function of each syntactic element using the pipeline of COStream, obtained To entropy coding assembly line, parallel entropy coding is carried out to syntactic element using entropy coding assembly line;
(4) image group parallel encoding, image parallel encoding and syntactic element compression of video sequence: are carried out simultaneously to video sequence After row entropy coding, compressed video is obtained.
Embodiment 1
As shown in Fig. 2, HEVC parallel encoding is by image group parallel encoding, wavefront parallel encoding, entropy coding parallel processing structure At original video sequence passes through after HEVC parallel encoding, generates bit stream file, completes coding.
(1) image group is divided, image group parallel encoding is carried out
Image group is the processing unit that granularity is most thick in HEVC, and image group is divided into two types, and one is closed type images Group, another kind are open image groups.For closed type image group, the frame in an image group will not refer to another figure As the frame in group, mutually indepedent between image group, without data dependence relation, the referring-to relation between frame and frame exists only in figure As the inside of group.Open image group is different with closed type image group, and in open image group, the frame in an image group can With with reference to the frame in the image group of front one, for open image group, there are data dependence relations between image group.? In such image group, first frame of only first image group is every IDR frame.Since Video coding is that one kind damages volume Code, therefore, can inevitably introduce mistake during coding, due to inter-prediction, mistake can constantly expand after introducing It dissipates, in order to avoid this kind of situation, image group encoder can periodically be inserted into every IDR frame, every IDR frame meeting when coding Encoder is set to empty reference frame lists, it can be to avoid the lasting diffusion of code error.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 group.The step as shown in Figure 3 includes two sub-steps:
(1-1) pretreatment stage: main function is the parameter of parsing input, carries out entirety to image group encoder and matches It sets.The ID of image group, the quantity of image, the size for calculating each frame, the start frame and knot for calculating image group in image group are set Beam frame etc..After initialization is completed, the information of image group is needed to be assigned in each different image group encoder, image group is compiled After code device obtains the information of image group, it is parsed, image group is then read, then successively image group is compiled 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, main to use In the parallel task of processing data level.Entire parallel frame is built using COStream, and internal specific coding step uses C++ It realizes, and is packaged into function, be supplied to COStream and be called.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 group according to the information of image group, so Image group is put into queue afterwards, since input module and multiple images group encoder require to grasp image group queue Make, it is therefore desirable to which mutual exclusion lock protects input rank, needs to lock input progress locking operation before reading data, read Take release input lock after finishing.An image group is finished in each reading and is activated by an image group encoder, allows image group Encoder is handled.
(1-2-2) parallel processing: parallel work-flow module is the nucleus module of image group parallelization processing, it is by N number of image Group encoder is constituted, and N is degree of parallelism, and depending on the setting of developer, theoretically the higher speed-up ratio of degree of parallelism is higher, but specific Need to consider the environment of processing platform when realization, because the quantity of CPU and memory are conditional.Each image group encoder It is indicated with a GOPEncoder node.Before encoding an image group, first input is locked and carries out locking operation, Waiting Graph It is ready as organizing, if input module has read image group, input lock will be discharged, indicates that image group is ready, that It continues to execute, image group encoder takes out an image group from queue and handled.It, will not be first by figure when realizing It is transmitted to GOPEncoder again after reading out as group, because image group data volume is very big, figure is related to during transmission As the duplication and movement of group, huge expense can be generated.Therefore the data not instead of image group in data flow, figure one by one As the information of group.GOPEncoder obtains traversing image group after image group, encodes to each of image group image, This part in COStream mainly by calling the function of C++ encapsulation to be realized that specific encoding operation is as shown in Figure 4.
(1-2-2) output processing: after completing to image group coding, generating bit stream, due in COStream, Image group is 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 multiple while writing and cause dirty data, needs to lock output lock before bit stream file is written, then bit stream is written In file, release output lock after writing.
(2) CTU row is divided, realizes wavefront parallel encoding
CTU is the variation in order to more adapt to image texture characteristic, the one kind proposed with obtaining better encoding efficiency New coding structure.One CTU includes a luminance coding tree block (Coding Tree Block, CTB) and two chroma coders Tree block.CTU common size 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 the size of CU can be from 8 × 8 to 64 × 64.This flexible division mode of CTU Increase the complexity of calculating.In order to accelerate the processing speed to CTU, HEVC proposes wavefront parallel encoding, it can be simultaneously Multiple CTU rows are handled, realize the parallel encoding to CTU row.Wavefront parallel encoding is as shown in Figure 5.In addition to first CTU row it Outside, remaining each CTU row will fall the progress of latter two CTU than a upper CTU row, this is because there are in frame in HEVC Prediction, the CTU that CTU needs to refer to right above it and upper right side just can be carried out intra prediction, therefore on each CTU row will fall behind The progress of one CTU row, two CTU.The process of wavefront parallel encoding is as shown in fig. 6, contain two big steps.
(2-1) initialization
The major function of initialization module is initialization encoder context, and the structural body of the information of CTU row is stored in definition, The quantity for calculating CTU row, initializes relevant structural body etc., this part is realized using C++.
(2-1-1) defines CTURow data structure: in order to carry out parallelization processing, first definition structure to CTU row Body stores information related with CTU row, each CTU is indicated using CTURow, it includes following information: row_index table Show CTU row is which row of image, specify the current abscissa of CTU to be processed in the picture, current_col expression is worked as Preceding preparation will handle the row number of CTU, the current ordinate of CTU to be processed in the picture be specified, since image can be by more A CTU is constituted, can be only by row_index and current_col if whole image can be regarded as the two-dimensional array of CTU One determines the position of CTU in the picture;Is_active indicates whether current CTU row is active, if current CTURow is being waited To the notice of a upper CTURow, then it is equal to false, otherwise it is equal to true;Semaphore is notified for event Semaphore needs to wait the notification signal of a upper CTURow, if do not received, with regard to that before handling a CTU Enter blocked state until notified event just continues to execute;Entropy is entropy coding object, is operated for entropy coding, In order to allow CTU row parallel processing, it is necessary to allow the entropy coding for having Context-dependent to operate mutually indepedent between CTU row, Therefore, each CTU row is equipped with an entropy coder;The backup of entropy_buffer then entropy coding object allows every Although a CTU row be owned by an entropy coder can entropy coding operation between the above CTU row it is mutually indepedent, also result in Entropy coding 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 row need to replicate before proceeding the entropy coding context of a CTU row, the work of entropy_buffer With being that every coding is completed to save entropy coding context after a CTU, to facilitate the use of CTU row below.
The quantity of (2-1-2) calculating CTU row: calculating the quantity of CTU row according to the height of frame and the size of CTU, CTURowNum=PictHeight ÷ CTUHeight.
(2-1-3) initializes the corresponding CTURow object of each CTU row: row_index is initialized as current CTU row Row number;Current_col is initialized as 0;Remaining is_active is initialized as false other than 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 processing: parallel processing module realized using the splitjoin structure of COStream, The processing parallel dedicated for data level of splitjoin data flow architecture, its each node are that a wavefront is compiled parallel Code device WPPEncoder, the number of node illustrate degree of parallelism.The unit of WPPEncoder processing is CTU row, it traverses CTU row Each of CTU, complete encoding operation is carried out to each CTU, until all CTU are disposed.Due to multiple Can be executed parallel between WPPEncoder, it is achieved that the parallelization of CTU row is handled, the degree of parallelism N of WPPEncoder by It can according to need and configured.The processing to CTU row of each WPPEncoder is as shown in Figure 7.
(2-2-1) start WPPEncoder: the setting according to front to CTURow, in addition to first WPPEncoder it Outside, other WPPEncoder are blocked waiting, because other than first CTURow, the semaphore of other CTURow It is all no signal condition.
(2-2-2) waits notification event: in addition to the first row CTU, other every a line CTU before handling a CTU, on The processing progress of one CTU row must more than current CTU row two CTU.If image is regarded as the two-dimensional array of CTU, frame [x] [y] indicates the CTU of xth row y column, then having to wait at frame [x-1] [y+2] before frame [x] [y] processing Reason is completed, and otherwise cannot be handled.The notice of event may be implemented by semaphore, but COStream does not have the branch of semaphore It holds, it is therefore desirable to realize the encapsulation to semaphore operations using C++, interface is provided and is called to COStream, COStream is supported With the hybrid programming of C++.If WPPEncoder has received the notice of signal, continue to execute downwards.
(2-2-3) replicates the entropy coding context of a upper CTU row: the purpose of duplication entropy coding context is in order to effective Utilize already present context probabilistic information.Only need to replicate before CTU row starts it is primary, behind to the institute of the CTU row There is entropy coding operation to be all based on this entropy coding context, it is no longer necessary to replicate.
(2-2-4) CTU coding: the step contains the operations such as complete prediction, transformation, quantization, entropy coding.This part Call directly the realization of C++ function.
(2-2-5) counts the number that the CTU of completion has been handled in current CTU row: for the CTU that statistics has been handled Several reasons is to calculate the processing " spacing " between next line CTU and current CTU row, i.e., current line is than next line multiprocessing CTU number, for deciding whether to issue the CTU of next line event notice.
(2-2-6) judges whether to need to issue event notice: calculate the number of the current completed CTU of CTU row with it is next The difference of the number of a completed CTU of CTU row just issues event notice to next line CTU if difference is more than or equal to 2, Tell next line that can continue with CTU.Since the complexity of the texture of image parts is different, between CTU row Processing progress will appear inconsistent situation, in order to meet the requirement of intra-prediction data dependence, it is necessary to judge whether Meet specified condition, event notice is sent if meeting, is not otherwise sent.In addition, if thing can be sent by judgement Part notice, needs to set true for the is_active field of next CTURow, indicates that next CTU row is in and enlivens shape State.
The state of current CTU row is arranged in (2-2-7): the number of the calculating completed CTU of a upper CTU row and current CTU The difference of the number of the completed CTU of row, if difference less than 2, indicates that next CTU of current CTU row will be discontented with The data dependence relation of sufficient intra prediction, the is_active for needing to be arranged current CTURow is false, indicates that current CTU is about to Into blocked state.
(2-2-8) judges whether current CTU row has handled completion: so exiting if having handled completion Otherwise WPPEncoder encoder continues cycling through execution.
(3) entropy coding assembly line is constructed, realizes entropy coding parallel processing
Binary arithmetic coding (the Context-based Adaptive of context-adaptive is mainly used in HEVC Binary Arithmetic Coding, CABAC) it is used as entropy coding algorithm.CABAC is realized based on arithmetic coding, in addition to ginseng Except manifold and slice header information, the entropy coding of remaining syntactic element and transformation 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 be by well-designed, the probability of symbol by tabling look-up to obtain, needed after being completed to symbolic coding to probabilistic model into Row updates, and therefore, the probability of current sign depends on the result of front entropy coding.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 is compiled from context model The complete symbol of code needs to update context model, and therefore, there are data dependence relations by CABAC.The context model of CABAC with Syntactic element is related, the corresponding context probability modeling of a syntactic element, 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 Initial position entropy coder is reset, the main function of resetting is to rebuild and initialize context probability modeling. When carrying out entropy coding to a slice, need to encode CTU all in slice in sequence, for single CTU, inside it Syntactic element is also required to be encoded in sequence, therefore, the parallel characteristics of data level is not present for the inside slice. Analyze, found in the same slice according to the characteristics of context probability modeling, the update of context probability modeling with Based on syntactic element, identical syntactic element uses the same context mould, different syntactic elements using it is different up and down Literary probabilistic model, that is to say, that for different syntactic elements, their context probability modeling is independently, before CTU is different It puts, different syntactic elements can be encoded simultaneously.Therefore, although the parallel characteristics of the not no data level of the entropy coding of CTU, But possessing the parallel characteristics of task level, the parallel characteristics of task level are also assembly line.The entropy coding process of CTU according to grammer The coded sequence of element is divided into multiple steps, forms an assembly line, each step corresponds to a stage of assembly line, leads to The mode for crossing assembly line is realized and can be handled the parallelization of entropy coding.The entropy coding assembly line of Slice is as shown in figure 8, CTU is pressed Executed all coding processes according to the coded sequence of syntactic element, different CTU can be handled simultaneously, with CTU1 and For CTU2, the split_flag of the skip_flag and CTU2 of CTU1 can be encoded simultaneously, because of the two syntactic elements Context probability modeling it is mutually indepedent, without data dependence, and not in the same CTU, it is possible to encode simultaneously.Entropy The process for encoding parallel processing is as shown in Figure 9.
(3-1) preprocessing module: TU is handled by defining a recursive function, current TU is recorded using TUInfo object Information, judge whether TU will continue to downwards according to the model split of quaternary tree for sub- TU, if current TU continues to divide downwards, So indicate that current TU does not need encoding transform coefficients and other syntactic elements relevant with transformation coefficient, the is_ of TUInfo Split is set as true, if TU does not continue to be divided downwards, needs to encode all including transformation coefficient The is_split field of syntactic element, TUInfo is set as false, then record relative indexing of the current TU in CTU and Depth in CTU, then adds it in queue, and queue directly uses the dique in C++ standard template library.Due to The sequence of TUInfo in the queue is exactly TU sequence encoded, therefore entropy code module is to the sequential processes and recurrence of TUInfo The sequence that TU is handled under mode is identical, will not cause confusion.
(3-2) entropy coding parallelization module: the pipeline data flow architecture of COStream dedicated for handle assembly line, Support the parallel of task level.The coding of each of TU syntactic element as a stage of assembly line, each language The calculate node actor, TU that the encoding operation of method is packaged into pipeline are every just to encode a language by a calculate node Method element just completes the entropy coding of the TU after TU passes through pipeline.One TUInfo queue includes multiple The object of TUInfo, each object represent a TU, and for any one TUInfo object, the calculate node in pipeline is all The value for judging is_split attribute, if it is true, the TU for indicating that the TUInfo is represented will continue to be divided into sub- TU downwards, So only need to encode split_flag syntactic element, other syntactic elements include that transformation coefficient does not need to be encoded, such as Fruit is_split is false, and the TU for indicating that TUInfo is represented does not continue to divide downwards, then needing to encode includes split_ All syntactic elements including flag.The entropy coding of various syntactic elements mainly uses CABAC as realization in HEVC, main It to include three steps: binarization, context modeling, binary arithmetic coding.
(3-2-1) binarization: the object of the arithmetic coding processing of CABAC 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, Unitary code, truncation this code of Lay, k rank Exp- Golomb, fixed length code etc. is truncated.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 a correlation between syntactic element, the probability of current sign according to Entropy coding as a result, can more accurately estimate current sign using the information of the coded symbol in front before Lai Yu Probability, these coded information are thus referred to as context.In general, the probability of symbol becomes with the content of video Change.Selecting a suitable contextual information for syntactic element is exactly context modeling.The standard document of HEVC gives all Syntactic element initial context, the context of different syntactic elements is generally different.
(3-2-3) binary arithmetic coding: after the corresponding context model initialization of syntactic element is completed, start to carry out Binary arithmetic coding.Binary arithmetic coding is to carry out arithmetic coding to the corresponding binary bits string of syntactic element.Two into Arithmetic coding processed includes two ways: bypass mode and usual manner.Bypass coding mode in, the symbol of binary string it is general Rate be it is identical, do not need yet update context probability modeling;In conventional manner, the probability of symbol can be by binary string It is obtained in context model, requires to be updated context model after completing each symbolic coding.Use routine Mode or bypass mode are determined by syntactic element, HEVC document 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, not to The limitation present invention, any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should all include Within protection scope of the present invention.

Claims (8)

1. a kind of HEVC parallel encoding method based on COStream characterized by comprising
Step (1) image group parallel encoding: being divided into several image groups for video sequence, obtains the information of each image group, will The corresponding image group encoder of the information input of each image group, by calling the function of C++ encapsulation to carry out in COStream Parallel encoding;
Step (2) image parallel encoding: being divided into several CTU for frame image each in image group according to HEVC standard, collects The information of CTU row ties one wavefront parallel encoder of information input of every row CTU row using the splitjoin of COStream Structure carries out parallel encoding;
The parallel entropy coding of step (3) syntactic element: each CTU includes several syntactic elements, and each syntactic element is one corresponding Entropy coding function, each syntactic element are called the entropy coding function of each syntactic element using the pipeline of COStream, obtained To entropy coding assembly line, parallel entropy coding is carried out to syntactic element using entropy coding assembly line;
Step (4) compression of video sequence: image group parallel encoding, image parallel encoding and syntactic element are carried out simultaneously to video sequence After row entropy coding, compressed video is obtained;
Although the entropy coding assembly line indicates the parallel characteristics of the not no data level of the entropy coding of CTU, possess task level The parallel characteristics of parallel characteristics, task level are also assembly line, and the entropy coding process of CTU is divided according to the coded sequence of syntactic element At multiple steps, an assembly line is formed, each step corresponds to a stage of assembly line, real by way of assembly line The parallelization of entropy coding can now be handled.
2. a kind of HEVC parallel encoding method based on COStream according to claim 1, which is characterized in that the step Suddenly (1) includes:
Video sequence is divided into several image groups by (1-1), obtains the information of each image group, and the information of described image group includes The size of each frame image, the start frame of image group and end in the quantity, image group of image in the ID of image group, image group Frame;
(1-2) is right when image group is open image group by the corresponding image group encoder of the information input of each image group The image group encoder answered periodically is inserted into every IDR frame when coding;
(1-3) carries out parallel encoding in image group encoder, through the function for calling C++ to encapsulate in COStream.
3. a kind of HEVC parallel encoding method based on COStream according to claim 1, which is characterized in that the step Suddenly (2) include:
Frame image each in image group is divided into several CTU according to HEVC standard by (2-1), collects the information of CTU row, described The information of CTU row include the index of CTU row, in the line number of CTU row and CTU row CTU number;
One wavefront parallel encoder of information input of every row CTU row is used the splitjoin structure of COStream by (2-2) Carry out parallel encoding;Other than the first row CTU row, remaining CTU row, which is intended to wait until, receives a CTU row Notice, can just continue to execute;The every coding of current wavefront coded device completes a CTU and just sends notice to next CTU row.
4. the HEVC parallel encoding method according to claim 1 based on COStream, which is characterized in that the step (3) include:
(3-1) each CTU includes several syntactic elements, and syntactic element carries out arithmetic coding after being converted into binary bits string, The corresponding context probability modeling of each syntactic element, entropy coding function use arithmetic coding and context probability modeling;
(3-2) each syntactic element calls the entropy coding function of each syntactic element using the pipeline of COStream, obtains Entropy coding assembly line carries out parallel entropy coding to syntactic element using entropy coding assembly line.
5. a kind of HEVC parallel encoder system based on COStream characterized by comprising
Image group parallel encoding module obtains the information of each image group, incites somebody to action for video sequence to be divided into several image groups The corresponding image group encoder of the information input of each image group, by calling the function of C++ encapsulation to carry out in COStream Parallel encoding;
Image parallel encoding module is collected for frame image each in image group to be divided into several CTU according to HEVC standard The information of CTU row ties one wavefront parallel encoder of information input of every row CTU row using the splitjoin of COStream Structure carries out parallel encoding;
The parallel entropy code module of syntactic element, includes several syntactic elements for each CTU, and each syntactic element is one corresponding Entropy coding function, each syntactic element are called the entropy coding function of each syntactic element using the pipeline of COStream, obtained To entropy coding assembly line, parallel entropy coding is carried out to syntactic element using entropy coding assembly line;
Compression of video sequence module, for carrying out image group parallel encoding, image parallel encoding and syntactic element to video sequence After parallel entropy coding, compressed video is obtained;
Although the entropy coding assembly line indicates the parallel characteristics of the not no data level of the entropy coding of CTU, possess task level The parallel characteristics of parallel characteristics, task level are also assembly line, and the entropy coding process of CTU is divided according to the coded sequence of syntactic element At multiple steps, an assembly line is formed, each step corresponds to a stage of assembly line, real by way of assembly line The parallelization of entropy coding can now be handled.
6. a kind of HEVC parallel encoder system based on COStream according to claim 5, which is characterized in that the figure As group parallel encoding module includes:
First submodule obtains the information of each image group, described image group for video sequence to be divided into several image groups Information include the ID of image group, in image group in the quantity, image group of image the size, image group of each frame image starting Frame and end frame;
Second submodule, for by the corresponding image group encoder of the information input of each image group, when image group is open When image group, corresponding image group encoder is periodically inserted into every IDR frame when coding;
Third submodule, for being carried out by the function for calling C++ to encapsulate in COStream parallel in image group encoder Coding.
7. a kind of HEVC parallel encoder system based on COStream according to claim 5, which is characterized in that the figure As parallel encoding module includes:
The message sub-module of CTU row is received for frame image each in image group to be divided into several CTU according to HEVC standard Collect the information of CTU row, the information of the CTU row include the index of CTU row, in the line number of CTU row and CTU row CTU number;
Image parallel encoding submodule, for using one wavefront parallel encoder of information input of every row CTU row The splitjoin structure of COStream carries out parallel encoding;Other than the first row CTU row, remaining CTU row is intended to carry out etc. To which notice until receiving a upper CTU row can just continue to execute;The every coding of current wavefront coded device completes a CTU just It sends and notifies to next CTU row.
8. the HEVC parallel encoder system according to claim 5 based on COStream, which is characterized in that the grammer member Entropy code module includes: element parallel
Entropy coding function submodule, includes several syntactic elements for each CTU, and syntactic element is converted into binary bits string After carry out arithmetic coding, the corresponding context probability modeling of each syntactic element, entropy coding function uses arithmetic coding and upper Hereafter probabilistic model;
Parallel entropy coding submodule calls each syntactic element using the pipeline of COStream for each syntactic element Entropy coding function obtains entropy coding assembly line, carries out parallel entropy coding to syntactic element using entropy coding assembly line.
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 CN107197296A (en) 2017-09-22
CN107197296B true 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)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
MX2021006944A (en) * 2018-12-21 2021-08-24 Sony Group Corp Image processing device and method.
AU2019201649A1 (en) 2019-03-11 2020-10-01 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
CN115278302A (en) * 2022-07-29 2022-11-01 腾讯科技(深圳)有限公司 Live broadcast streaming media data processing method, system, device and computer equipment

Citations (8)

* 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
CN106788467A (en) * 2016-11-28 2017-05-31 华中科技大学 A kind of Raptor Code coding methods based on CUDA, interpretation method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
MX341067B (en) * 2012-09-26 2016-08-05 Panasonic Ip Corp America Image decoding method, image encoding method, image decoding device, image encoding device, and image encoding/decoding device.
US10382793B2 (en) * 2015-06-23 2019-08-13 Integrated Device Technology, Inc. Apparatuses and methods for performing information extraction and insertion on bitstreams

Patent Citations (8)

* 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
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
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
A Deeply Pipelined CABAC Decoder for HEVC Supporting Level 6.2 High-Tier Applications;Yu-Hsin Chen,et al.;《IEEE Transactions on Circuits and Systems for Video Technology》;20141020;第25卷(第5期);全文
COStream:一种面向数据流的编程语言和编译器实现;张维维,等.;《计算机学报》;20131031;第36卷(第10期);全文
面向Storm的数据流编程模型与编译优化方法研究;杨秋吉,等.;《计算机工程与科学》;20161231;第38卷(第12期);全文

Also Published As

Publication number Publication date
CN107197296A (en) 2017-09-22

Similar Documents

Publication Publication Date Title
CN107197296B (en) A kind of HEVC parallel encoding method and system based on COStream
USRE49727E1 (en) System and method for decoding using parallel processing
JP7098805B2 (en) Codec using neural network
CN103918273B (en) It is determined that the method for the binary code word for conversion coefficient
CN101616323B (en) System and method for decoding video coding data stream
CN102098519B (en) Video encoding method and decoding method as well as encoding and decoding device
CN104869398B (en) A kind of CABAC realized based on CPU+GPU heterogeneous platforms in HEVC parallel method
US20090010338A1 (en) Picture encoding using same-picture reference for pixel reconstruction
TW200407031A (en) Spatial prediction based intra coding
CN105120277A (en) Method for encoding and decoding images, encoding and decoding device, and corresponding computer programs
US9380314B2 (en) Pixel retrieval for frame reconstruction
CN109788285A (en) The context model choosing method and device of a kind of quantization parameter end mark position
US10455244B2 (en) Method and device for entropy encoding or entropy decoding video signal for high-capacity parallel processing
CN104854621A (en) Encoding video into lower resolution streams
CN106358043A (en) Hybrid video decoding apparatus and associated hybrid video decoding method
CN103947211A (en) Method and apparatus of video encoding with partitioned bitstream
KR101673186B1 (en) Apparatus and method of processing in parallel of encoding and decoding of image data by using correlation of macroblock
CN105874800B (en) Syntax resolver and syntax analytic method
CN102036065A (en) Method and system for video coding
Enfedaque et al. GPU implementation of bitplane coding with parallel coefficient processing for high performance image compression
WO2024124901A1 (en) Point cloud processing method and apparatus, device, medium, and program product
CN102215422A (en) Method, device and system for generating verification code stream of video processing integrated circuit
US20180316920A1 (en) Video image encoding device, video image encoding method and program recording medium
CN109672889A (en) The method and device of the sequence data head of constraint
US20240080478A1 (en) Point cloud encoding and decoding method and apparatus, computer, and storage medium

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