Summary of the invention
In view of above content, be necessary to provide a kind of image diced system, it can utilize marginal information in the image to prejudge cutting mode in the LCU, and then reduces the number of times of recursive operation in four minutes trees, to reach the purpose that reduces amount of calculation and accelerate tree cutting in four minutes in the LCU.
In view of above content, be necessary to provide a kind of image cutting method, it can utilize marginal information in the image to prejudge cutting mode in the LCU, and then reduces the number of times of recursive operation in four minutes trees, to reach the purpose that reduces amount of calculation and accelerate tree cutting in four minutes in the LCU.
A kind of image diced system is applied to electronic installation, and this system comprises: the first cutting module, and a maximum coding unit LCU for obtaining an image cuts into a plurality of N * N block with this LCU; Computing module is for the angle of calculating each N * N block; Statistical module is for the angle of each N of present encoding unit CU block that adds up this LCU * N block; Judge module, for the cutting mode of determining current C U block according to above-mentioned statistics, described cutting mode comprises the continuation cutting and ends cutting; And the second cutting module, if the cutting mode that is used for current C U block then cuts into current C U block four onesize inferior CU blocks for continuing cutting, if the cutting mode of current C U block, is then ended cutting current C U block for ending cutting.
A kind of image cutting method is applied to electronic installation, and the method comprises: cutting step one, obtain a maximum coding unit LCU in the image, and this LCU is cut into a plurality of N * N block; Calculation procedure is calculated the angle of each N * N block; Statistic procedure, the angle of adding up each N * N block in the present encoding unit CU block of this LCU; Determining step is determined according to above-mentioned statistics that the cutting mode of current C U block, described cutting mode comprise and is continued cutting and end cutting; And cutting step two, if the cutting mode of current C U block then cuts into current C U block four onesize inferior CU blocks for continuing cutting, if the cutting mode of current C U block, is then ended cutting current C U block for ending cutting.
Compared to prior art, described image diced system and method, it can utilize marginal information in the image to prejudge cutting mode in the LCU, and then reduces the number of times of recursive operation in four minutes trees, reduces amount of calculation and accelerates tree cutting in four minutes in the LCU.
Embodiment
As shown in Figure 1, be the running environment schematic diagram of image diced system of the present invention.This image diced system 24 runs in the electronic installation 2.This electronic installation 2 also comprises display device 20, input equipment 22, memory 23 and the processor 25 that links to each other by data/address bus.Described electronic installation 2 can be computer, mobile phone, PDA(Personal Digital Assistant, personal digital assistant) etc.
Described memory 23 is for data such as the program code of storing described image diced system 24 and images.Described display device 20 is used for showing the data such as described image, the LCDs that this display device 20 can be computer, the touch-screen of mobile phone etc.Described input equipment 22 is used for the various data that the input user arranges, for example, and keyboard, mouse etc.
Described image diced system 24 is used for utilizing the marginal information of image to prejudge the cutting mode of each block in the LCU, when the consistency of each the sub-block direction in judging certain block is higher, stops to continue this block of cutting, and detailed process is following to be described.
In the present embodiment, described image diced system 24 can be divided into one or more modules, described one or more module is stored in the described memory 23 and is configured to and carried out by one or more processors (present embodiment is a processor 25), to finish the present invention.For example, consult shown in Figure 2ly, described image diced system 24 is divided into the first cutting module 240, computing module 241, statistical module 242, judge module 243, the second cutting module 244 and prediction module 245.The alleged module of the present invention is to finish the program segment of a specific function, is more suitable in describing the implementation of software in electronic installation 2 than program.The concrete function of each module is described below with reference to Fig. 3.
As shown in Figure 3, be the flow chart of the first embodiment of image cutting method of the present invention.
Step S10, the first cutting module 240 obtain an image from memory 23 or other electronic equipment, a maximum coding unit in this image (Largest Coding Unit, LCU) is cut into a plurality of N * N block.Be appreciated that, the LCU that comprises a plurality of fixed sizes in image, be 64 * 64 such as size, when this image is encoded, each LCU cuts into the coding unit (CodingUnits of different sizes with the framework recurrence of four minutes trees, CU) block, each coding unit block comprises a plurality of N * N block.
Be appreciated that size is different at the CU block of different levels recurrence generation and the CU block ratio on upper strata.For example, consult Fig. 4 and shown in Figure 5, be cut into four CU block b, g, h and i during this LCU recurrence first time, wherein, first CU block b is continued to cut into again four less inferior CU block c, d, e and f.
Present embodiment describes so that a LCU is cut into example.In the present embodiment, N=8.Take the size 64 * 64 of the most general LCU as example, before the cutting of beginning recurrence, can be cut to first the block of 64 8 * 8 sizes.
Step S11, computing module 241 calculates the angle (such as the angle of 64 8 * 8 blocks) of each N * N block.The method of calculating angle has many kinds, comprises and utilize discrete cosine transform (Discrete Cosine Transform, DCT) or Sobel algorithm etc. that present embodiment describes as an example of the Sobel algorithm example.
Suppose N=8, computing can obtain 64 angles and weight (Weight) thereof to 64 pixels in 241 pairs of 8 * 8 blocks of computing module through Sobel.These 64 angles are mapped to (comprising 34 kinds of patterns) behind the pattern list of infra-frame prediction (Intra prediction), then can count the cumulative rear maximum a certain pattern of weight, and the angle that this pattern corresponds to can represent the angle of this 8 * 8 block, namely represents the marginal information of this 8 * 8 block.Need to prove, as long as can produce an angle in the mode of Representative Region intra-block edge information, all applicable to the present invention.
Step S12, the angle of each N * N block in each coding unit block (hereinafter referred to as " CU block ") of statistical module 242 these LCU of statistics.In the present embodiment, statistical module 242 is according to recursive sequence, adds up successively the angle of each N * N block in each the CU block in each recursive hierarchical of this LCU, for example, adds up 4 CU blocks of ground floor for the first time.
Then, judge module 243 is determined the cutting mode of each CU block in this LCU according to statistics.Described cutting mode comprises the cutting that continues cutting current C U block and end current C U block.Consulting shown in Figure 4ly, is corresponding four minutes trees of the cutting mode schematic diagram of each CU block in determined this LCU of the present invention, and each node represents a CU block.As can be seen from Figure 4, CU block " h " does not need to continue down cutting.
Particularly, if the N that angle is identical or adjacent in the current C U block * N block surpasses preset ratio (such as 50%), then judge module 243 judges that the direction consistency of the N that these current CU blocks include * N block is high, do not need down to cut, namely end the cutting (consulting the CU block " h " among Fig. 4) of current C U block.If the N that angle is identical or adjacent in the current C U block * N block is less than or equal to this preset ratio, then judge module 243 judges that the direction consistency of the N that these current CU blocks include * N block is not high, needs to continue cutting current C U block (consulting the CU block " b " among Fig. 4).In the present embodiment, described angle is adjacent is to determine according to whether intra prediction mode corresponding to angle be adjacent.For example, if the logical order (Logical order) of two intra prediction modes in pattern list is adjacent, judge that then these two corresponding angles of intra prediction mode are adjacent.
For example, suppose that the size of current C U block is 32 * 32, include 16 8 * 8 blocks, namely have 16 directions to represent the marginal information of this CU block.If the consistency of these 16 directions is high, for example identical or adjacent more than half, then can a direction represent this 32 * 32 block, the following recursive program of this 32 * 32 block will be skipped, and carry out the judgement of next 32 * 32 blocks.If these 16 directions are in disorder, for example, identical or adjacent angle is less than half, it is complicated and can not be with a direction representative to represent marginal information in this 32 * 32 block, so recursive program can continue this 32 * 32 block is cut into 4 16 * 16 CU blocks, and each time CU block proceeded to judge last four minutes trees that generate will as shown in Figure 4, be one and set in non-complete four minutes.
In the present embodiment, through step S10-S12, the cutting mode of each CU block pre-determines, and subsequent step will begin each CU block is cut according to predetermined cutting mode.
Step S13, the second cutting module 244 judge according to the cutting mode of each CU block whether current C U block needs to continue cutting.If current C U block need to continue cutting, then execution in step S14-S15; If current C U block does not need to continue cutting, then execution in step S16-S18.
Step S14, the second cutting module 244 cuts into four onesize inferior CU blocks with current C U block.Consult shown in Figure 5, it is the schematic diagram that the Si Fenshu according to Fig. 4 cuts, this LCU comprises four the CU block " b ", " g ", " h ", " i " that wait size, and wherein, CU block " b " continues to cut into four inferior CU block " c ", " d ", " e ", " f " that wait size.
Step S15, the second cutting module 244 choose the upper left degree CU block of current C U block as new current C U block, and then, flow process is returned step S13.Consult shown in Figure 5ly, after CU block " b " was cut into four inferior CU blocks " c " that wait size, " d ", " e ", " f ", the second cutting module 244 was chosen time CU block " c " as new current C U block, continues down to cut.
Step S16, the second cutting module 244 is ended the cutting of current C U block, and 245 couples of current C U of prediction module block carries out pixel prediction.Wherein, described pixel prediction comprises that infra-frame prediction (Intra Prediction) and frame predict (Inter Prediction) outward.In the present embodiment, only carry out infra-frame prediction.
Step S17, the second cutting module 244 judge whether the CU block among this LCU is all predicted complete.If the CU block among this LCU all prediction is complete, then flow process finishes.If also have the CU block to predict among this LCU, then continue execution in step S18.
Step S18, the second cutting module 244 is chosen next CU block as new current C U block according to the zigzag order from this LCU.For example, consult shown in Figure 5ly, according to the zigzag order, if current C U block " e " prediction is complete, then choose the CU block " f " identical with current C U block " e " size as new current C U block.If current C U block " f " prediction is complete, then choose CU block " g " with the sizes such as last layer (being block " b ") of current C U block " f " as new current C U block.
In above-mentioned the first embodiment, statistical module 242 counts the angle of each N * N block in each CU block of this LCU, and judge module 243 pre-determines the cutting mode of each CU block in this LCU according to statistics.Then, the second cutting module 244 is according to the cutting mode of predetermined each CU block, and the CU block that needs are cut cuts.
In a second embodiment, also can adopt while judging the mode of cutting to carry out, i.e. the angle of each N * N block in the current C U block of this LCU of 242 statistics of each statistical module, judge module 243 is determined the cutting mode of this current CU block according to statistics.Then, the cutting mode that the second cutting module 244 is determined according to judge module 243 determines it is to continue cutting current C U block, still ends the cutting of current C U block.Consult shown in Figure 6ly about the flow chart of the second embodiment, the flow process of the flow process of the second embodiment and the first embodiment is basic identical, does not repeat them here.
It should be noted that at last, above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although with reference to preferred embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that, can make amendment or be equal to replacement technical scheme of the present invention, and not break away from the spirit and scope of technical solution of the present invention.