CN106846255A - Image rotation implementation method and device - Google Patents

Image rotation implementation method and device Download PDF

Info

Publication number
CN106846255A
CN106846255A CN201611235685.3A CN201611235685A CN106846255A CN 106846255 A CN106846255 A CN 106846255A CN 201611235685 A CN201611235685 A CN 201611235685A CN 106846255 A CN106846255 A CN 106846255A
Authority
CN
China
Prior art keywords
pixel
rotation
rotary unit
order
image
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
CN201611235685.3A
Other languages
Chinese (zh)
Other versions
CN106846255B (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.)
NUFRONT SOFTWARE TECHNOLOGY Co Ltd
Original Assignee
NUFRONT SOFTWARE TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NUFRONT SOFTWARE TECHNOLOGY Co Ltd filed Critical NUFRONT SOFTWARE TECHNOLOGY Co Ltd
Priority to CN201611235685.3A priority Critical patent/CN106846255B/en
Publication of CN106846255A publication Critical patent/CN106846255A/en
Application granted granted Critical
Publication of CN106846255B publication Critical patent/CN106846255B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/60Rotation of whole images or parts thereof
    • G06T3/602Rotation of whole images or parts thereof by block rotation, e.g. by recursive reversal or rotation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/60Rotation of whole images or parts thereof
    • G06T3/606Rotation of whole images or parts thereof by memory addressing or mapping

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a kind of image rotation implementation method and device, the method includes:Source storage format and source data form according to image to be rotated, the anglec of rotation of image, determine the reading order of view data;Each rotary unit in view data is read according to the reading order for determining, circulator is sent to;Circulator carries out pixel rotation according to the anglec of rotation to the pixel in the rotary unit that will read, recombinates the postrotational rotary unit of pixel, obtains the image of the corresponding anglec of rotation.By way of hardware, image rotation is realized in the form of changing reading order, reduce hardware cost input, improve processing speed and efficiency.

Description

Image rotation implementation method and device
Technical field
The invention belongs to technical field of image processing, more particularly to a kind of image rotation implementation method and device.
Background technology
With the development of electronic technology, the use of electronic image is more and more extensive, during electronic image use, often May require that carries out rotation process to image, to facilitate user to browse.
The existing multiplex software realization of image rotation technology, rotation processing is carried out to image by software, changes image Display direction, due to needing data volume to be processed than larger, usual response speed is slower, it is impossible to meet image rotation for this mode Operation is quick, the processing requirement of promptness.
And the scheme that very small amount is realized with hardware, using the mode of hardware handles due to being limited to hardware performance in itself Cause that it uses in the prior art is fewer, and random storage reservoir (RAM) size that it is used is larger, so as to increase core Piece area, this just itself proposes requirement higher to hardware.
It can be seen that, image rotation implementation of the prior art can not be met in the case where hardware input is not increased, Quickly, image rotation operation is efficiently completed.
The content of the invention
In view of this, it is an object of the invention to image rotation implementation method and device.In order to the embodiment for disclosing Some aspects have a basic understanding, shown below is simple summary.The summarized section is not extensive overview, nor Determine key/critical component or describe the protection domain of these embodiments.Its sole purpose is to be in simple form Existing some concepts, in this, as the preamble of following detailed description.
The embodiment of the present invention provides a kind of image rotation implementation method, including:
Source storage format and source data form according to image to be rotated, the anglec of rotation of image, determine view data Reading order;
Each rotary unit in view data is read according to the reading order for determining, circulator is sent to;
Circulator carries out pixel rotation, restructuring pixel rotation to the pixel in the rotary unit that will read according to the anglec of rotation Rotary unit after turning, obtains the image of the corresponding anglec of rotation.
In some optional embodiments, when the anglec of rotation is 180 degree:
The reading order for determining view data, specifically includes:The sequence of addresses of rotary unit during by memory access Inverted;Accordingly,
It is described that pixel rotation is carried out to pixel in the rotary unit that will read according to the anglec of rotation, after restructuring pixel rotation Rotary unit, obtain the image of the corresponding anglec of rotation, specifically include:
Pixel order in each rotary unit is inverted;
Rotary unit after pixel inversion is reorganized by the sequence of addresses after reversion, the image after being processed Data.
In some optional embodiments, the pixel order in each rotary unit is inverted, specifically included:
The one-row pixels that will be included in each rotary unit carry out order reversion;When carrying out order reversion, by described a line Pixel is divided into the pixel groups of specified quantity, and the order to pixel groups is inverted, and order is carried out to the pixel in pixel groups Reversion.
In some optional embodiments, when the anglec of rotation is 90 or 270 degree:
The reading order for determining view data, specifically includes:The sequence of addresses of rotary unit during by memory access Enter line translation by the anglec of rotation;Accordingly,
It is described that pixel rotation is carried out to pixel in the rotary unit that will read according to the anglec of rotation, after restructuring pixel rotation Rotary unit, obtain the image of the corresponding anglec of rotation, specifically include:
Pixel procession in each rotary unit is exchanged;
Rotary unit after ranks are exchanged, is entered according to the sequence of addresses after conversion in units of the rotary unit group selected Row is reorganized, the view data after being processed.
In some optional embodiments, the pixel procession in each rotary unit is exchanged, specifically included:
The picture element matrix in rotary unit is filled according to the order that a row connect a row by circulator, is connect according still further to a line The order of a line reads, and realizes exchanging the pixel procession in each rotary unit.
The embodiment of the present invention also provides a kind of image rotation and realizes device, including:
Determining module, for according to the source storage format and source data form, the anglec of rotation of image of image to be rotated, really Determine the reading order of view data;
Memory access module, for reading each rotary unit in view data according to the reading order for determining, sends to Circulator;
Circulator, for carrying out pixel rotation to the pixel in the rotary unit that will read according to the anglec of rotation;
Recombination module, for recombinating the postrotational rotary unit of pixel, obtains the image of the corresponding anglec of rotation.
In some optional embodiments, the determining module, specifically for when the anglec of rotation is 180 degree, by internal memory The sequence of addresses of rotary unit during access is inverted;Accordingly,
The circulator, specifically for the pixel order in each rotary unit is inverted;
The recomposition unit, specifically for the rotary unit after pixel inversion is carried out again by the sequence of addresses after reversion Tissue, the view data after being processed.
In some optional embodiments, the circulator, specifically for a line picture that will be included in each rotary unit Element carries out order reversion;When carrying out order reversion, the one-row pixels are divided into the pixel groups of specified quantity, to the suitable of pixel groups Sequence is inverted, and carries out order reversion to the pixel in pixel groups.
In some optional embodiments, the determining module, specifically for when the anglec of rotation is 90 or 270 degree, inciting somebody to action The sequence of addresses of rotary unit during memory access enters line translation by the anglec of rotation;Accordingly,
The circulator, specifically for the pixel procession in each rotary unit is exchanged;
The recomposition unit, specifically for ranks are exchanged after rotary unit, according to the sequence of addresses after conversion selecting Fixed rotary unit group is reorganized for unit, the view data after being processed.
In some optional embodiments, the circulator, specifically for by the picture element matrix in rotary unit according to one Row connect the order filling of a row, are read according still further to order line by line, and realization carries out the pixel in each rotary unit Ranks are exchanged.
Image rotation implementation method provided in an embodiment of the present invention and device, source storage format according to image to be rotated and The anglec of rotation of source data form, image, determines the reading order of view data, suitable to change reading by way of hardware The form of sequence realizes image rotation and data recombination, the postrotational view data of angle is obtained, using the side of hardware memory accesses Formula is realized, the characteristics of for view data, is fully multiplexed memory source, reduces the requirement to hardware performance, reduces hardware cost Input, meanwhile, improve processing speed and efficiency, the even image of big data quantity, it is also possible to treatment it is very timely.
For above-mentioned and related purpose, one or more embodiments include will be explained in below and in claim In the feature that particularly points out.Following explanation and accompanying drawing describes some illustrative aspects in detail, and its indicate be only Some modes in the utilizable various modes of principle of each embodiment.Other benefits and novel features will be under The detailed description in face is considered in conjunction with the accompanying and becomes obvious, the disclosed embodiments be will include all these aspects and they Be equal to.
Brief description of the drawings
Accompanying drawing is used for providing a further understanding of the present invention, and constitutes a part for specification, with reality of the invention Applying example is used to explain the present invention together, is not construed as limiting the invention.In the accompanying drawings:
Fig. 1 is the flow chart of image rotation implementation method in the embodiment of the present invention one;
Fig. 2 is the principle schematic of image rotation implementation method in the embodiment of the present invention one;
Fig. 3 is that one kind of image rotation implementation method in the embodiment of the present invention two implements flow chart;
Fig. 4 is original image schematic diagram in the embodiment of the present invention two;
Fig. 5 is the suitable image schematic diagram sought after reversion in address in the embodiment of the present invention two;
Fig. 6 is that one kind of image rotation implementation method in the embodiment of the present invention three implements flow chart;
Fig. 7 is original image schematic diagram in the embodiment of the present invention three;
Fig. 8 is 90 degree of postrotational image schematic diagrames in the embodiment of the present invention three;
Fig. 9 is 270 degree of postrotational image schematic diagrames in the embodiment of the present invention three;
Figure 10 is one of circulator read-write sequential schematic in the embodiment of the present invention;
Figure 11 is two of circulator read-write sequential schematic in the embodiment of the present invention;
Figure 12 is three of circulator read-write sequential schematic in the embodiment of the present invention;
Figure 13 is the arrangement mode schematic diagram of block when the first round reads in the embodiment of the present invention;
Figure 14 is the filling mode schematic diagram when first round reads in the embodiment of the present invention;
Figure 15 is the reading order schematic diagram when first round reads in the embodiment of the present invention;
Figure 16 is the arrangement mode schematic diagram of block when the second wheel reads in the embodiment of the present invention;
Figure 17 is filling mode schematic diagram when the second wheel reads in the embodiment of the present invention;
Figure 18 is reading manner schematic diagram when the second wheel reads in the embodiment of the present invention;
Figure 19 is the arrangement mode schematic diagram of block when third round reads in the embodiment of the present invention;
Figure 20 is the structural representation that image rotation realizes device in the embodiment of the present invention.
Specific embodiment
The following description and drawings fully show specific embodiments of the present invention, to enable those skilled in the art to Put into practice them.Other embodiments can include structure, logic, it is electric, process and it is other changes.Embodiment Only represent possible change.Unless explicitly requested, otherwise single component and function are optional, and the order for operating can be with Change.The part of some embodiments and feature can be included in or replace part and the feature of other embodiments.This hair The scope of bright embodiment includes the gamut of claims, and all obtainable of claims is equal to Thing.Herein, these embodiments of the invention can individually or generally be represented that this is only with term " invention " For convenience, and if in fact disclosing the invention more than, it is not meant to automatically limit the scope of the application to appoint What single invention or inventive concept.
During in order to solve to rotate image by software present in prior art, because the data volume for processing is big, response speed Degree is slow, and hardware performance in itself is limited to again, it is impossible to fast and efficiently complete image rotation not increasing in the case that hardware puts into Problem, the embodiment of the present invention provides a kind of image rotation implementation method, by the multiplexing to hardware memory accesses, by certain Read-write order change, realize the rotation of image, reduce the requirement to hardware, improve the speed and efficiency for the treatment of.
It is described in detail below by specific embodiment.
Embodiment one
The embodiment of the present invention one provides a kind of image rotation implementation method, its flow as shown in figure 1, its principle such as Fig. 2 institutes Show, the method comprises the following steps:
Step S101:Source storage format and source data form according to image to be rotated, the anglec of rotation of image, it is determined that figure As the reading order of data.
As shown in Figure 2, by direct memory access (DMA), circulator (Rotator), the control of random storage reservoir Three hardware modules of device (RAM Controller) combine to realize image rotation.Such as select the screen anglec of rotation or mobile display During screen, caused image angles of display rotation etc..
Angle and picture source storage format and picture source data form that DMA rotates as needed, determine view data Reading order., wherein it is desired to the angle of rotation can be 90 °, 180 °, 270 ° angularly.Picture source storage format can be The storage formats such as linear picture memory module (linear mode), the picture memory module (tile mode) of block format.Figure Film source data form can be 32bpp, the data form such as 16bpp, 8bpp.
Step S102:Each rotary unit in view data is read according to the reading order for determining, circulator is sent to.
DMA reads view data with the order determined in Double Data Rate synchronous DRAM (ddr), passes Give Rotator.
Step S103:Circulator carries out pixel rotation according to the anglec of rotation to the pixel in the rotary unit that will read.
Rotator is a ranks transition matrix, and each rotary unit in the original image that will come from DMA readings enters Every trade row conversion.So that the order of the image pixel included in each rotary unit changes, the effect that image rotation shows is reached.
Step S104:The restructuring postrotational rotary unit of pixel, obtains the image of the corresponding anglec of rotation.
RAM Controller are a read-write controllers for on-chip memory, and it is by Rotator with the order of cell block The data sent, according to raster scanning (Raster scan) Sequential output of display refreshing.So as to the restructuring for realizing data is defeated Go out, obtain the output image of the corresponding anglec of rotation.
Embodiment two
What the embodiment of the present invention two provided a kind of image rotation implementation method implements flow, for 180 degree rotatably Situation is described in detail, and its flow is as shown in figure 3, the method comprises the following steps:
Step S201:Source storage format and source data form, the anglec of rotation 180 degree of image according to image to be rotated, The sequence of addresses of rotary unit during by memory access is inverted.
The step is by DMA treatment.When 180 degree rotates, as long as actually the order of each pixel according to original storage Form and data form carry out the reversion of pixel dot sequency, but are generally not once only to read a pixel because internal memory reads Point, it is therefore desirable to the reversion treatment of sequence of addresses is carried out in units of rotary unit.
Step S202:Rotary unit after sequence of addresses is inverted, sends circulator to.
Step S203:Pixel order in each rotary unit is inverted.
After the reversion treatment of sequence of addresses is carried out to rotary unit, in addition it is also necessary to by the suitable of each pixel in rotary unit Sequence carries out reversion treatment.The one-row pixels that will be included in each rotary unit carry out order reversion;When carrying out order reversion, will One-row pixels are divided into the pixel groups of specified quantity, and the order to pixel groups is inverted, and the pixel in pixel groups is carried out Order is inverted.
Step S204:Rotary unit after pixel inversion is reorganized by the sequence of addresses after reversion, is obtained everywhere View data after reason.
Rotary unit sequence of addresses is inverted with after the pixel order reversion in rotary unit, is reorganized, you can View data after to reversion, the view data after reversion then correspond to rotate the image after 180 degree.
That is, to realize 180 ° of rotations (rotation), it is necessary to following 2 key steps:
1>Compared with 0 °, by the sequence of addresses fetched to ddr reversion;
2>In order to meet requirement of real-time, the burst-length (burst length) and the burst length phases of ddr of DMA Together.By taking burst length=2 as an example, each treatment (transaction) gets 256bit (8 32bpp pixels) data and is Example.So need the order of two 128bit in 256 bits (bit) is inverted;Four 32bit pixels in 128bit Order be also required to it is inverted.
The above 1>Realized by DMA, 2>Realized by Rotator.Under this scene, Rotator need not do ranks conversion, Only need to rearrange a data of burst length according to the order of pixel.
The original image before rotation is illustrated in figure 4, each solid line grid represents the rotary unit of 256bit.Numeral " 0 " represents the initial address of a two field picture, and the digital i between 0~64 represents i-th address.It is illustrated in figure 51>Sequence of addresses Image after reversion treatment.
1>After treatment, the order of data is changed into:
63,62,61 ..., 56,
55,54,53 ..., 48,
47,46,45 ..., 40,
39,38,37 ..., 32,
31,30,29 ..., 24,
23,22,21 ..., 16,
15,14,13 ..., 8,
7,6,5 ..., 0.
Embodiment three
What the embodiment of the present invention three provided a kind of image rotation implementation method implements flow, its flow as shown in fig. 6, The method comprises the following steps:
Step S301:Source storage format and source data form, 90 degree of the anglec of rotation of image according to image to be rotated or 270 degree, the sequence of addresses of rotary unit during by memory access enters line translation by the anglec of rotation.
The step is by DMA treatment.Wherein, 90 degree and 270 degree of difference of changing direction.It is real when 90 degree and 270 degree of degree rotate As long as the order of each pixel is carried out the conversion of respective angles according to original storage format and data form on border, by It is generally not once only to read a pixel to be read in internal memory, it is therefore desirable to sequence of addresses is carried out in units of rotary unit Conversion process.
Step S302:Rotary unit after sequence of addresses is converted, sends circulator to.
Step S303:Pixel procession in each rotary unit is exchanged.
It is in fact a pixel array in one rotary unit, therefore not only the order of rotary unit will carry out respective corners The conversion of degree, each pixel in pixel array in rotary unit will also carry out the conversion of respective angles.
Step S304:Rotary unit after ranks are exchanged, the rotary unit according to the sequence of addresses after conversion to select Group is reorganized for unit, the view data after being processed.
The picture element matrix in rotary unit is filled according to the order that a row connect a row by circulator, is connect according still further to a line The order of a line reads, and realizes exchanging the pixel procession in each rotary unit.
After pixel after rotary unit sequence of addresses is angularly converted and in rotary unit is also angularly converted, carry out again Tissue, you can the view data after being inverted, the view data after reversion then correspond to be rotated by 90 ° or 270 degree after figure Picture.
That is, for realize 90 °, 270 ° of rotation are, it is necessary to following 3 key steps:
1>Compared with 0 °, line translation will be entered according to the angle of rotation to ddr access sequence of addresses;
2>Ranks in cell block (block) are interchangeable;Cell block i.e. above-mentioned rotary unit.
3>Data in each block are reorganized according to the order of actual displayed.
The above 1>Realized by DMA, 2>Realized by Rotator, 3>Realized by RAM Controller.
The function that DMA is realized is described as follows:
The original image before rotation is illustrated in figure 7, each fine line grid represents a block, and it is Rotator The minimum matrix unit that can be processed.
It is as shown in Figure 8 by the image after 90 ° of rotation.But, the read-write in RAM Controller for convenience The generation of address, 1>In address mapping should with " cluster " (part that each solid wire frame is surrounded in Fig. 7) for unit again Tissue (is described in detail) when RAM Controller are introduced.1>After treatment, the order of data is changed into:
56,24,48,16,40,8,32,0,
57,25,49,17,41,9,33,1,
58,26,50,18,42,10,34,2,
59,27,51,19,43,11,35,3,
60,28,52,20,44,12,36,4,
61,29,53,21,45,13,37,5,
62,30,54,22,46,14,38,6,
63,31,55,23,47,15,39,7.
By the image after 270 ° of rotation as shown in figure 9, the order of data is changed into:
7,39,15,47,23,55,31,63,
6,38,14,46,21,54,30,62,
5,37,13,45,20,53,29,61,
4,36,12,44,19,52,28,60,
3,35,11,43,18,51,27,59,
2,34,10,42,17,50,26,58,
1,33,9,41,16,49,25,57,
0,32,8,40,15,48,24,56.
The function that Rotator is realized is described as follows:
Row in one rotary unit (or saying block) are sequentially converted into row order by Rotator using a matrix. Exactly the picture element matrix in rotary unit is filled according to the order that a row connect a row, is read according to order line by line. If Figure 10, Figure 11, Figure 12 are the schematic diagram of circulator read-write order.Each unit represents a pixel, can be 32bpp, 16bpp, 8bpp etc..
It is 256bit with DMA output bit wides, as a example by Rotator outputs are 128bit, the rotation list of minimum recycling First (block), referring to Figure 10, Figure 11, Figure 12, it indicates 90 °, the 270 ° block of rotation.Wherein, w0~wn is represented The order for connecing a row according to a row is filled, and r0~rn is represented and read according to order line by line.
Figure 10, Figure 11 and Figure 12 are illustrated with 4 bits/pixels (byte/pixel), 2 bits/pixel (byte/ respectively Pixel), 1 bits/pixel (byte/pixel) connects one for minimum pixel unit carries out a row.The order filling of row and a line connect The situation that the order of a line reads.
Wherein, the order filling that a row connect a row is carried out from w0~w3 in Figure 10, often row includes 8 row, then from r0~r7 The order for carrying out line by line reads.The order filling that a row connect a row is carried out from w0~w7 in Figure 11, often row includes 16 row, Then the order for being carried out line by line from r0~r15 reads.From w0~w15 a row being carried out in Figure 12 and connecing the order of a row filling out Fill, often row includes 32 row, the order for then being carried out line by line from r0~r31 reads.
The function that RAM Controller are realized is described as follows:
Rotator output data be with block as order, but RAM Controller output data be according to light Grid scanning screen-refresh namely from top to bottom from left to right is sequentially.Therefore, the effect of RAM controller be exactly by Block's is sequentially converted into raster scan order.Different with type according to raw image data form, a block typically can Across 4~32 row pixels.And a full line of whole two field picture can cross over multiple block.On the piece that RAM Controller are controlled RAM, is filled with the order that a block meets a block, is fetched with screen-refresh order line by line. Therefore, most intuitively idea is exactly to use a Pingpang Memory device, while being written and read.
Meanwhile, in order to reduce RAM sizes, and to solve the problems, such as that read/write address order is inconsistent, introduce with a kind of skilful Wonderful read/write address control method.As the internal memory that Figure 13 to Figure 17 illustrates read-write order uses cyclic process.In order to Simplify the computational methods of read/write address, reusable region should be the smaller the better in RAM.This is reused region and includes Several block, this some block can be called " cluster " (cluster).Can reduce big to internal memory by the multiplexing of internal memory Small requirement, cleverly internal memory multiplexing also improves the utilization rate of internal memory.
The reading process of pixel is described as follows in cluster:
With 32bpp, linear mode data instances, one includes 4x8 pixels, one by the block after matrix conversion Cluster includes 8 block.
The detailed process of RAM accesses is as follows:
1>The arrangement mode of the block included in a cluster is illustrated such as Figure 13.Each in one cluster Block is arranged in the manner depicted in fig. 13;As be from left to right respectively in Figure 13 block0, block1, block2, Block3, block4, block5, block6, block7 totally 8 block, include 4x8pixel by taking block0 as an example, other Block is similar to.
2>It is as shown in figure 14 fill order signal in a cluster.Each cluster includes 8 block, such as schemes Block0, block1, block2, block3, block4, block5, block6, block7 totally 8 is from left to right respectively in 14 Individual block.RAM is with W0.0, W0.1 ... ..., W0.7;W1.0, W1.1 ... ..., W1.7;……;W7.0, W7.1 ... ... .W7.7 Order be filled, i.e., one arrange be filled.Each block needs to write action 8 times, so a cluster is total to Need 64 and write action, referring specifically to as shown in figure 14.
3>It is as shown in figure 15 reading order signal in a cluster.When all of block is in a cluster After filling is finished, can start with R0.0, R0.1 ... ..., R0.7;R1.0, R1.1 ... ..., R1.7;……;R7.0, The order of R7.1 ... ..., R7.7 is read out.As shown in figure 15, read with this order, then pixel is exactly according to light The Sequential output of grid scanning.
4>It is as shown in figure 16 the arrangement mode of block in second cluster after reading first cluster.Reading During taking, the region for being changed into idle because of reading can be used to carry out the filling of the second wheel, i.e., second cluster's fills out Fill.Each block in second cluster is arranged in the way of shown in Figure 16, is respectively from top to bottom in such as Figure 16 Block0, block1, block2, block3, block4, block5, block6, block7 totally 8 block.
5>It is as shown in figure 17 fill order signal in second cluster.The fill order of the second wheel is W0.0, W0.1 ... ..., W0.7;W1.0, W1.1 ... ..., W1.7;……;W7.0, W7.1 ... ... .W7.7, this reading with the first round Order is the same.It is as shown in figure 17, therefore, read from the first round finish to the second wheel filling finish need not be very long wait when Between.
6>It is as shown in figure 18 reading order signal in second cluster.When RAM passes through the second filling taken turns again After being fully written, the reading of the second wheel starts.As shown in figure 18, reading order is R0.0, R0.1 ... ..., R0.7;R1.0, R1.1 ... ..., R1.7;……;R7.0, R7.1 ... ..., R7.7.
7>It is as shown in figure 19 the arrangement mode of block in the 3rd cluster after reading second cluster.As schemed Shown in 19, in reading process, the region being available can be used to fill the cluster pixels of a new round.So clsuter Middle piece of arrangement mode has just been returned to the arrangement mode of the first round (as shown in figure 13), into next recycling of internal memory Process.
Above procedure is circulated always, until all of cluster is converted.
Read/write address intuitively can be calculated and showed very with three counters (counter).Count each The counter of the line number that block is crossed over is referred to as location counter (unit counter);Count what each cluster was included The counter of block numbers is referred to as block counter (block counter);Count each lane (circulation on chip Groove) counter referred to as cluster counters (cluster counter) of cluster numbers that includes.The counting of each counter Scope is as follows, after these counter count down to the respective upper limit, resets to 0:
Unit_counter={ 0, line_per_block };
Block_counter={ 0, block_per_cluster };
Cluster_counter={ 0, cluster_per_lane }.
It is above-mentioned to represent respectively:
Element count={ 0, every piece of line number };
Block count={ 0, the block number per cluster };
Cluster is counted={ 0, every number of clusters of circulation groove }.
Image if necessary to rotation is smaller, whole image only comprising if a block, block_counter and Cluster_counter is 0.Only need to rotate the pixel in block in the case of this special case, can save anti- The step of turning or convert the sequence of addresses of block.
In upper graph 13 to Figure 19 figures, the write address w0 of the first round, the reading address r0 of the first round, the write address of the second wheel W1, the reading address r1 formula of the second wheel are as follows, characterized by three countings of counter:
W0={ unit_counter, cluster_counter, block_counter };
R0={ block_counter, cluster_counter, unit_counter };
W1={ block_counter, cluster_counter, unit_counter };
R1={ unit_counter, cluster_counter, block_counter }.
It is above-mentioned to represent respectively:
The write address w0={ element count, cluster is counted, block count } of the first round;
The reading address r0={ block count, cluster is counted, element count } of the first round;
The write address w1={ block count, cluster is counted, element count } of the second wheel;
The reading address r1={ element count, cluster is counted, block count } of the second wheel.
By the multiplexing of chip memory access, chip utilization rate is improve, using the idle component after having read, entered in time Row next round is filled, and improves the processing speed that filling is read, and reduces processing latency.
Based on same inventive concept, the embodiment of the present invention also provides a kind of image rotation and realizes device, its structure such as Figure 20 It is shown, including:Determining module 201, memory access module 202, circulator 203 and recombination module 204.
Determining module 201, for source storage format and source data form, the anglec of rotation of image according to image to be rotated Degree, determines the reading order of view data;
Memory access module 202, for reading each rotary unit in view data, transmission according to the reading order for determining To circulator;
Circulator 203, for carrying out pixel rotation to the pixel in the rotary unit that will read according to the anglec of rotation;
Recombination module 204, for recombinating the postrotational rotary unit of pixel, obtains the image of the corresponding anglec of rotation.
Preferably, above-mentioned determining module 201, specifically for when the anglec of rotation be 180 degree when, rotation during by memory access The sequence of addresses of unit is inverted;Accordingly,
Preferably, above-mentioned circulator 203, specifically for the pixel order in each rotary unit is inverted;
Preferably, above-mentioned recomposition unit 204, specifically for the rotary unit after pixel inversion is suitable by the address after reversion Sequence is reorganized, the view data after being processed.
Preferably, above-mentioned circulator 203, it is anti-that the one-row pixels specifically for will be included in each rotary unit carry out order Turn;When carrying out order reversion, the one-row pixels are divided into the pixel groups of specified quantity, the order to pixel groups is inverted, And order reversion is carried out to the pixel in pixel groups.
Preferably, above-mentioned determining module 201, specifically for when the anglec of rotation is 90 or 270 degree, during by memory access The sequence of addresses of rotary unit enters line translation by the anglec of rotation;Accordingly,
Preferably, above-mentioned circulator 203, specifically for the pixel procession in each rotary unit is exchanged;
Preferably, above-mentioned recomposition unit 204, specifically for ranks are exchanged after rotary unit, according to the ground after conversion Location order is reorganized in units of the rotary unit group selected, the view data after being processed.
Preferably, above-mentioned circulator 203, specifically for the picture element matrix in rotary unit is connect into the suitable of a row according to a row Sequence is filled, and is read according still further to order line by line, realizes exchanging the pixel procession in each rotary unit.
The above method and device of the embodiment of the present invention, rotation processing is done using the repeatable matrix for utilizing.Used in RAM On by reading and writing the ingehious design of pointer, reduce size, reduce chip area.The method that the present invention is used be with hardware come Realize, improve the response speed of rotation.Have wide range of applications, be applicable to mobile phone, panel computer etc. and move display chip.
Unless otherwise specific statement, term such as process, calculate, computing, determination, display etc. can refer to it is one or more Individual treatment or action and/or the process of computing system or similar devices, the action and/or process will be indicated as processing system The data manipulation of physics (such as electronics) amount in the register or memory of system and it is converted into and is similarly represented as processing system Memory, register or other this type of informations storage, transmitting or display device in physical quantity other data.Information Can be represented using any one of various different technologies and method with signal.For example, in above description Data, instruction, order, information, signal, bit, symbol and the chip for referring to can use voltage, electric current, electromagnetic wave, magnetic field or grain Son, light field or particle or its any combination are represented.
It should be understood that the particular order or level the step of during disclosed are the examples of illustrative methods.Based on setting Meter preference, it should be appreciated that during the step of particular order or level can be in the feelings of the protection domain for not departing from the disclosure Rearranged under condition.Appended claim to a method gives the key element of various steps with exemplary order, and not It is to be limited to described particular order or level.
In above-mentioned detailed description, various features are combined in single embodiment together, to simplify the disclosure.No This open method should be construed to reflect such intention, i.e. the embodiment of theme required for protection needs clear The more features of feature stated in each claim to Chu.Conversely, that reflected such as appending claims Sample, the present invention is in the state fewer than whole features of disclosed single embodiment.Therefore, appending claims is special This is expressly incorporated into detailed description, and wherein each claim is alone as the single preferred embodiment of the present invention.
It should also be appreciated by one skilled in the art that the various illustrative box, the mould that are described with reference to the embodiments herein Block, circuit and algorithm steps can be implemented as electronic hardware, computer software or its combination.In order to clearly demonstrate hardware and Interchangeability between software, is carried out to various illustrative parts, frame, module, circuit and step around its function above It is generally described.Hardware is implemented as this function and is also implemented as software, depending on specific application and to whole The design constraint that system is applied.Those skilled in the art can be directed to each application-specific, be realized in the way of accommodation Described function, but, it is this to realize that decision-making should not be construed as the protection domain away from the disclosure.
The step of method or algorithm with reference to described by the embodiments herein, can be embodied directly in hardware, be held by processor Capable software module or its combination.Software module may be located at RAM memory, flash memory, ROM memory, eprom memory, The storage of eeprom memory, register, hard disk, mobile disk, CD-ROM or any other form well known in the art is situated between In matter.A kind of exemplary storage medium is connected to processor, so as to enable a processor to from the read information, and Information can be write to the storage medium.Certainly, storage medium can also be the part of processor.Processor and storage medium In may be located at ASIC.The ASIC may be located in user terminal.Certainly, processor and storage medium can also be used as discrete sets Part is present in user terminal.
Realized for software, technology described in this application can be with the module of the herein described function of execution (for example, mistake Journey, function etc.) realize.These software codes can be stored in memory cell and by computing device.Memory cell can To realize in processor, it is also possible to realize outside processor, in the case of the latter, it via various means by correspondence Processor is coupled to, these are all well known in the art.
Described above includes the citing of one or more embodiments.Certainly, in order to above-described embodiment is described and description portion The all possible combination of part or method is impossible, but it will be appreciated by one of ordinary skill in the art that each is implemented Example can do further combinations and permutations.Therefore, embodiment described herein is intended to fall into appended claims Protection domain in all such changes, modifications and variations.Additionally, with regard to the term used in specification or claims "comprising", the word cover mode similar to term " including ", solved as link word in the claims just as " including, " As releasing.Additionally, the use of any one term "or" in the specification of claims being to represent " non-exclusionism Or ".

Claims (10)

1. a kind of image rotation implementation method, it is characterised in that including:
Source storage format and source data form according to image to be rotated, the anglec of rotation of image, determine the reading of view data Sequentially;
Each rotary unit in view data is read according to the reading order for determining, circulator is sent to;
Circulator carries out pixel rotation to the pixel in the rotary unit that will read according to the anglec of rotation, after restructuring pixel rotation Rotary unit, obtain the image of the corresponding anglec of rotation.
2. the method for claim 1, it is characterised in that when the anglec of rotation is 180 degree:
The reading order for determining view data, specifically includes:The sequence of addresses of rotary unit during by memory access is carried out Reversion;Accordingly,
It is described that pixel rotation is carried out to pixel in the rotary unit that will read according to the anglec of rotation, recombinate the postrotational rotation of pixel Turn unit, obtain the image of the corresponding anglec of rotation, specifically include:
Pixel order in each rotary unit is inverted;
Rotary unit after pixel inversion is reorganized by the sequence of addresses after reversion, the picture number after being processed According to.
3. method as claimed in claim 2, it is characterised in that inverted the pixel order in each rotary unit, has Body includes:
The one-row pixels that will be included in each rotary unit carry out order reversion;When carrying out order reversion, by the one-row pixels It is divided into the pixel groups of specified quantity, the order to pixel groups is inverted, and order reversion is carried out to the pixel in pixel groups.
4. the method for claim 1, it is characterised in that when the anglec of rotation is 90 or 270 degree:
The reading order for determining view data, specifically includes:The sequence of addresses of rotary unit during by memory access is by rotation Gyration enters line translation;Accordingly,
It is described that pixel rotation is carried out to pixel in the rotary unit that will read according to the anglec of rotation, recombinate the postrotational rotation of pixel Turn unit, obtain the image of the corresponding anglec of rotation, specifically include:
Pixel procession in each rotary unit is exchanged;
Rotary unit after ranks are exchanged, weight is carried out according to the sequence of addresses after conversion in units of the rotary unit group selected New organization, the view data after being processed.
5. method as claimed in claim 4, it is characterised in that exchange the pixel procession in each rotary unit, tool Body includes:
The picture element matrix in rotary unit is filled according to the order that a row connect a row by circulator, according still further to line by line Order read, realize by each rotary unit pixel procession exchange.
6. a kind of image rotation realizes device, it is characterised in that including:
Determining module, for source storage format and source data form, the anglec of rotation of image according to image to be rotated, it is determined that figure As the reading order of data;
Memory access module, for reading each rotary unit in view data according to the reading order for determining, sends rotation to Device;
Circulator, for carrying out pixel rotation to the pixel in the rotary unit that will read according to the anglec of rotation;
Recombination module, for recombinating the postrotational rotary unit of pixel, obtains the image of the corresponding anglec of rotation.
7. device as claimed in claim 6, it is characterised in that
The determining module, specifically for when the anglec of rotation be 180 degree when, the sequence of addresses of rotary unit during by memory access Inverted;Accordingly,
The circulator, specifically for the pixel order in each rotary unit is inverted;
The recomposition unit, specifically for the rotary unit after pixel inversion is carried out into group again by the sequence of addresses after reversion Knit, the view data after being processed.
8. device as claimed in claim 7, it is characterised in that
The circulator, the one-row pixels specifically for will be included in each rotary unit carry out order reversion;Carry out order anti- When turning, the one-row pixels are divided into the pixel groups of specified quantity, the order to pixel groups is inverted, and in pixel groups Pixel carry out order reversion.
9. device as claimed in claim 6, it is characterised in that
The determining module, specifically for when the anglec of rotation be 90 or 270 degree when, the address of rotary unit during by memory access Order enters line translation by the anglec of rotation;Accordingly,
The circulator, specifically for the pixel procession in each rotary unit is exchanged;
The recomposition unit, specifically for ranks are exchanged after rotary unit, according to the sequence of addresses after conversion with select Rotary unit group is reorganized for unit, the view data after being processed.
10. device as claimed in claim 9, it is characterised in that
The circulator, specifically for the picture element matrix in rotary unit is filled according to the order that a row connect a row, according still further to Order line by line reads, and realizes exchanging the pixel procession in each rotary unit.
CN201611235685.3A 2017-02-23 2017-02-23 Image rotation realization method and device Active CN106846255B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611235685.3A CN106846255B (en) 2017-02-23 2017-02-23 Image rotation realization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611235685.3A CN106846255B (en) 2017-02-23 2017-02-23 Image rotation realization method and device

Publications (2)

Publication Number Publication Date
CN106846255A true CN106846255A (en) 2017-06-13
CN106846255B CN106846255B (en) 2024-01-16

Family

ID=59112593

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611235685.3A Active CN106846255B (en) 2017-02-23 2017-02-23 Image rotation realization method and device

Country Status (1)

Country Link
CN (1) CN106846255B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107493439A (en) * 2017-08-16 2017-12-19 珠海全志科技股份有限公司 Video image spinning solution, rotating device and computer-readable storage medium
CN108389155A (en) * 2018-03-20 2018-08-10 北京奇虎科技有限公司 Image processing method, device and electronic equipment
CN108399604A (en) * 2018-03-07 2018-08-14 杭州朔天科技有限公司 A method of supporting large scale picture rotation in printer SoC chip
CN108447023A (en) * 2018-03-20 2018-08-24 北京奇虎科技有限公司 Image processing method, device and electronic equipment
CN109639993A (en) * 2018-12-28 2019-04-16 北京思比科微电子技术股份有限公司 Multiwindow exposal control method
CN110191298A (en) * 2019-04-17 2019-08-30 广州虎牙信息科技有限公司 Mobile terminal and its video rotation method, computer storage medium in record screen

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1929539A (en) * 2002-07-19 2007-03-14 三星电子株式会社 Image processing device and method
CN101000685A (en) * 2007-01-05 2007-07-18 深圳安凯微电子技术有限公司 Method and equipment of image rotation
CN102023807A (en) * 2010-12-17 2011-04-20 福州瑞芯微电子有限公司 System realizing clockwise 270-degree rotation of screen
CN102497567A (en) * 2011-12-06 2012-06-13 合肥工业大学 Voxel data reconstruction method for solid true three-dimensional volumetric display
CN103377030A (en) * 2012-04-26 2013-10-30 华为技术有限公司 Image rotation control method and device
CN104079857A (en) * 2013-03-25 2014-10-01 索尼公司 Image processing apparatus, image processing method, and program
CN104331861A (en) * 2014-11-14 2015-02-04 广东威创视讯科技股份有限公司 Image rotary method and system
CN105739874A (en) * 2016-03-11 2016-07-06 沈阳聚德视频技术有限公司 EDMA achieving method in image rotation based on DSP

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1929539A (en) * 2002-07-19 2007-03-14 三星电子株式会社 Image processing device and method
CN101000685A (en) * 2007-01-05 2007-07-18 深圳安凯微电子技术有限公司 Method and equipment of image rotation
CN102023807A (en) * 2010-12-17 2011-04-20 福州瑞芯微电子有限公司 System realizing clockwise 270-degree rotation of screen
CN102497567A (en) * 2011-12-06 2012-06-13 合肥工业大学 Voxel data reconstruction method for solid true three-dimensional volumetric display
CN103377030A (en) * 2012-04-26 2013-10-30 华为技术有限公司 Image rotation control method and device
CN104079857A (en) * 2013-03-25 2014-10-01 索尼公司 Image processing apparatus, image processing method, and program
CN104331861A (en) * 2014-11-14 2015-02-04 广东威创视讯科技股份有限公司 Image rotary method and system
CN105739874A (en) * 2016-03-11 2016-07-06 沈阳聚德视频技术有限公司 EDMA achieving method in image rotation based on DSP

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘承禹等: "一种基于图像旋转显示的DDR2高效存储方法", 《计算机技术与发展》 *
刘承禹等: "一种基于图像旋转显示的DDR2高效存储方法", 《计算机技术与发展》, no. 04, 30 April 2016 (2016-04-30), pages 18 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107493439A (en) * 2017-08-16 2017-12-19 珠海全志科技股份有限公司 Video image spinning solution, rotating device and computer-readable storage medium
CN108399604A (en) * 2018-03-07 2018-08-14 杭州朔天科技有限公司 A method of supporting large scale picture rotation in printer SoC chip
CN108399604B (en) * 2018-03-07 2021-08-10 杭州朔天科技有限公司 Method for supporting rotation of large-size picture on SoC chip of printer
CN108389155A (en) * 2018-03-20 2018-08-10 北京奇虎科技有限公司 Image processing method, device and electronic equipment
CN108447023A (en) * 2018-03-20 2018-08-24 北京奇虎科技有限公司 Image processing method, device and electronic equipment
CN108447023B (en) * 2018-03-20 2021-08-24 北京奇虎科技有限公司 Image processing method and device and electronic equipment
CN108389155B (en) * 2018-03-20 2021-10-01 北京奇虎科技有限公司 Image processing method and device and electronic equipment
CN109639993A (en) * 2018-12-28 2019-04-16 北京思比科微电子技术股份有限公司 Multiwindow exposal control method
CN109639993B (en) * 2018-12-28 2020-10-23 北京思比科微电子技术股份有限公司 Multi-window exposure control method
CN110191298A (en) * 2019-04-17 2019-08-30 广州虎牙信息科技有限公司 Mobile terminal and its video rotation method, computer storage medium in record screen

Also Published As

Publication number Publication date
CN106846255B (en) 2024-01-16

Similar Documents

Publication Publication Date Title
CN106846255A (en) Image rotation implementation method and device
CN105431831B (en) Data access method and the data access device for utilizing same procedure
US7737986B2 (en) Methods and systems for tiling video or still image data
CN103760525B (en) Completion type in-place matrix transposition method
EP3289560B1 (en) Adaptive memory address scanning based on surface format for graphics processing
CN101958112B (en) Method for realizing rotation of handheld device screen pictures by 90 degrees and 270 degrees simultaneously
CN106776358A (en) DIMM SSD address performance technologies
US20170357570A1 (en) Storing Arrays of Data in Data Processing Systems
CN106462499B (en) Sensor module, its control method and electronic equipment
US20120206657A1 (en) Reproducible Dither-noise Injection
US9086959B2 (en) Apparatus to access multi-bank memory
US7546425B2 (en) Data processor with a built-in memory
US20080301400A1 (en) Method and Arrangement for Efficiently Accessing Matrix Elements in a Memory
US20150178217A1 (en) 2-D Gather Instruction and a 2-D Cache
CN106933756B (en) DMA fast transposition method and device for variable matrix
CN108280801A (en) Method, apparatus and programmable logic device are remapped based on bilinear interpolation
US10978131B2 (en) Mobile device and operation method thereof
JP2009110600A (en) Memory access method and memory control device
US20160163020A1 (en) Image processor, method of operating the same, and application processor including the same
CN112835522A (en) Video data access device and method based on nonvolatile memory
US20230307036A1 (en) Storage and Accessing Methods for Parameters in Streaming AI Accelerator Chip
CN101989418B (en) Picture turning method and system
JP2001128108A (en) Video processor
CN115766956A (en) Image data transmission method and device based on FPGA and computer equipment
CN112068791A (en) Storage method, addressing method and device for display data of rotary display device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room E203, Building No. 76, West Fourth Ring South Road, Fengtai District, Beijing 100071

Applicant after: New Shoreline (Beijing) Science and Technology Group Co.,Ltd.

Address before: Room E203, Building No. 76, West Fourth Ring South Road, Fengtai District, Beijing 100071

Applicant before: Beijing New Shoreline Technology Co.,Ltd.

Address after: Room E203, Building No. 76, West Fourth Ring South Road, Fengtai District, Beijing 100071

Applicant after: Beijing New Shoreline Technology Co.,Ltd.

Address before: Room E203, Building No. 76, West Fourth Ring South Road, Fengtai District, Beijing 100071

Applicant before: BEIJING PUJIXIN TECHNOLOGY CO.,LTD.

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant