CN101388947B - Image rotating system, image rotating method and decoding chip - Google Patents

Image rotating system, image rotating method and decoding chip Download PDF

Info

Publication number
CN101388947B
CN101388947B CN2008102237054A CN200810223705A CN101388947B CN 101388947 B CN101388947 B CN 101388947B CN 2008102237054 A CN2008102237054 A CN 2008102237054A CN 200810223705 A CN200810223705 A CN 200810223705A CN 101388947 B CN101388947 B CN 101388947B
Authority
CN
China
Prior art keywords
block matrix
memory
processor
normal position
address
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.)
Expired - Fee Related
Application number
CN2008102237054A
Other languages
Chinese (zh)
Other versions
CN101388947A (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.)
BEIJING BOXIN SHITONG TECHNOLOGY CO., LTD.
Original Assignee
Innofidei 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 Innofidei Technology Co Ltd filed Critical Innofidei Technology Co Ltd
Priority to CN2008102237054A priority Critical patent/CN101388947B/en
Publication of CN101388947A publication Critical patent/CN101388947A/en
Application granted granted Critical
Publication of CN101388947B publication Critical patent/CN101388947B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides an image rotating method which can embed the rotating process into the intra-frame prediction, inter-frame prediction or loop filtering of decoding. The method comprises: reading the rotated block matrix data Dn-1<R> as a reference block stored in the first memory device; rotating the Dn-1<R> into a normal positioned block matrix Dn-1 and saving it in the second memory device; using the normal positioned block matrix Dn-1 in the second memory device to implement the corresponding intra-frame prediction, inter-frame prediction or loop filtering process and acquiring a block matrix data Dn; rotating the block matrix Dn to acquire a rotated block matrix Dn<R> and saving it in the first memory device. The invention need not to add any independent rotating module, consequently, saves the internal memory cost, reduces the calculating quantity in internal memory process, and reduces the system load.

Description

Image rotating system, image rotating method, decoding chip
Technical field
The present invention relates to image rotation processing field, specifically, relate to a kind of image rotating system, image rotating method, decoding chip.
Background technology
Digital video technology has obtained increasingly extensive application in communication and broadcast world, particularly since the nineties in 20th century, along with the fast development of Internet and mobile communication, video information has become the informationalized focus of current China with the processing of multimedia messages in the mobile network with transmission technology.China Mobile multimedia broadcasting (CMMB, China Mobile Multimedia Broadcasting) is arisen at the historic moment.
CMMB is the digital multimedia broadcasting system of being set up by State Administration of Radio Film and Television with independent intellectual property right, via satellite with the mode of terrestrial wireless broadcast, can receive business such as broadcast TV program and information service whenever and wherever possible for seven cun following the small screen, small size, mobile portable hand-held Terminal Type, thereby, make people's amusement and information life style that huge variation take place, create new watching habit and consumption fashion.
Because as the continuous development of China mobile multi-media broadcasting technologies such as CMMB, the multimedia mobile terminal with still image spinfunction becomes more and more popular; And the portable terminal with video spinfunction has obtained liking of numerous consumers especially.In order to satisfy the demands of consumers, Related product in the industry comprises and has added the image spinfunction that still image rotation, video rotate in the receiving equipments such as mobile phone, PDA, MP3/MP4 player, digital camera and notebook computer one after another.
But, for now, the implementation of the image rotation technique of portable terminal is: increase a rotary module that independently is exclusively used in the image rotation in Video Decoder, this rotary module is used for the macro block matrix that the memory decoding is come out is rotated according to the actual needs, outputing to display screen then gets on, the benefit of this method is simple, shortcoming be need in internal memory, take one independently rotary module carry out, thereby increased internal memory cost; And, in the process of rotation, relate to moving of internal memory, and internal memory to move involved amount of calculation bigger, and expend time in, therefore increased the weight of the burden of system.
In view of this, need the urgent technical problem that solves of those skilled in the art to be exactly: the method that a kind of image rotation is provided, big to solve the memory cost that in realizing the image rotary course, exists in the prior art, the problem that amount of calculation is big, system burden is heavy.
Summary of the invention
Technical problem to be solved by this invention provides a kind of image rotating system, image rotating method, decoding chip, and solving in realizing the image rotary course, the big and internal memory of memory cost moves that the amount of calculation that is produced is big, problem such as long expends time in.
In order to address the above problem, the invention discloses a kind of image rotating system, this image rotating system comprises first processor, second processor, first memory, second memory, described first processor comprises address calculation and instruction generation unit, wherein, address calculation comprises the first address computation subelement and the second address computation subelement: the first address computation subelement, be used to calculate as with reference to piece, the spill spin block matrix D N-1 RRotate to be normal position block matrix D N-1After, at the memory address ADRESS1 of second memory; The second address computation subelement is used to calculate normal position block matrix D nBe transformed to the spill spin block matrix D n RAfter, at the memory address ADRESS2 of first memory; Described first processor also comprises the instruction generation unit, this instruction generation unit comprises that first rotate instruction generates subelement, second rotate instruction generates subelement and data processing instructions generates subelement, wherein, first rotate instruction generation subelement is used for generating described D N-1 RRotate to be D N-1, and carry described D N-1Be stored in the rotate instruction COMMAND1 of second memory address; Second rotate instruction generates subelement and is used for generating described D nRotate to be described D n R, and carry described D n RBe stored in the rotate instruction COMMAND2 of described first memory address; Data processing instructions generates subelement and is used to generate the instruction COMMAND3 that finishes infra-frame prediction, inter prediction or loop filtering data handling procedure; Described second processor is used for carrying out rotate instruction COMMAND1, carrying out rotate instruction COMMAND2 according to described ADRESS2 according to described ADRESS1; And, execution command COMMAND3; Described first memory is used to store described block matrix D N-1 RAnd described block matrix D n RDescribed second memory is used to store described normal position block matrix D N-1Wherein, said n is the integer greater than 1;
Described first processor also comprises the rotate instruction receiving element, and this rotate instruction receiving element is used at time point t 0Receive the rotation enabled instruction.And described address calculation also includes: the three-address computation subunit: be used for according to described rotation enabled instruction, calculate normal position block matrix D 1Be transformed to position of rotation block matrix D 1 RAfter, D 1 RBe stored to the address in the described first memory.
Preferably, described rotate instruction COMMAND1 is specially: second processor reads the described block matrix D that is stored in the described first memory N-1 RWith described block matrix D N-1 RMove to the described ADRESS1 of second memory, obtain D N-1
Preferably, described rotate instruction COMMAND2 is specially: second processor reads the described block matrix D that is stored in the second memory nWith described block matrix D nMove to the described ADRESS2 of first memory, obtain D n R
Preferably, image rotating system also comprises a dma controller, and described dma controller is used for each spill spin block matrix D N-1 RMove to described ADRESS1 by dma mode; And be used for each described block matrix D nMove to described ADRESS2 by dma mode.
Preferably, described first processor is an arm processor, and described second processor is dsp processor or the independent process unit with DSP framework.
The invention also discloses a kind of image rotating method, this method is embedded in rotary course in infra-frame prediction, inter prediction or the loop filtering of decoding, specifically comprise the steps: to read be stored in described in the described first memory as with reference to piece, spill spin block matrix data D N-1 R, with described D N-1 RRotate to be normal position block matrix D N-1And be kept in the second memory; Utilize the described normal position block matrix D in the second memory N-1Carry out the processing of corresponding infra-frame prediction, inter prediction or loop filtering, obtain block matrix data D nWith described block matrix data D nRotation obtains the spill spin block matrix D n R, and be kept in the described first memory; Wherein, with described block matrix D N-1 RRotate to be the normal blocks matrix D N-1And with described block matrix D nRotation obtains the spill spin block matrix D n RBe by read and the preservation process in coordinate transform realize; Wherein, said n is the integer greater than 1;
Wherein, when starting rotation, obtain described D as follows 1 R: put t in start-up time 0, send image rotation enabled instruction; Read the normal position block matrix D that is stored in the first memory 1, and with described normal position block matrix D 1Be kept in the described second memory; According to coordinate transform, calculate described normal position block matrix D 1Be transformed to position of rotation block matrix D 1 RThe time be stored in address in the described first memory; From described second memory, read normal position block matrix D 1, and be stored in the described address of described first memory, obtain position of rotation block matrix D 1 R
Preferably, with described spill spin block matrix D N-1 RRotate to be normal position block matrix D N-1Rotate instruction be specially: first processor calculates: described spill spin block matrix D N-1 RRotate to be normal position block matrix D N-1After, at the memory address ADRESS1 of second memory; Second processor reads described spill spin block matrix D N-1 RIn each spill spin block matrix; With described spill spin block matrix D N-1 RMove to the ADRESS1 of second memory, obtain normal position block matrix D N-1
Preferably, with block matrix D nRotation obtains matrix data D n RRotate instruction be specially: first processor calculates: described normal position block matrix D nRotate to be the spill spin block matrix D n RAfter, at the memory address ADRESS2 of first memory; Second processor reads the normal position block matrix D in the described second memory nWith described normal position block matrix D nMove to the ADRESS2 of first memory, obtain the spill spin block matrix D n R
Preferably, described spill spin block matrix D N-1 RBy dma mode, move to the ADRESS 1 of second memory, obtain normal position block matrix D N-1And, described normal position block matrix D nBy dma mode, move to the ADRESS2 of first memory, obtain the spill spin block matrix D n R
Preferably, utilize described normal position piece square D N-1As the reference piece, when carrying out infra-frame prediction, described D N-1Be 8 * 8,16 * 8,8 * 16 or 16 * 16 macro block, comprise the steps: to be undertaken the entropy decoding of current block, and carry out counter-scanning, inverse quantization, anti-DCT successively and with the residual error data B that produces by described second processor by first processor nBe stored in the second memory; By second processor with described normal position block matrix D N-1With residual error data B nAddition.
Preferably, utilize described normal position piece square D N-1As the reference piece, when carrying out infra-frame prediction, described is D N-1Be 8 * 8,16 * 8,8 * 16 or 16 * 16 macro block, comprise the steps: to be undertaken the entropy decoding of the current block of present frame by first processor, and the residual error data C that carries out counter-scanning, inverse quantization, anti-DCT successively and current block is produced by second processor nBe stored in the described second memory; By described second processor with described normal position block matrix D N-1With carry out interpolation arithmetic, obtain D ' N-1By second processor with described block matrix data D ' N-1With residual error data C nAddition.
Preferably, utilize described normal position block matrix D N-1As the reference piece, when carrying out loop filtering, described D N-1Be 8 * 6 or 6 * 8 image block, described image block is to be obtained by the image division that infra-frame prediction/interframe prediction decoding comes out, and comprises the steps: the edge of current image block is carried out loop filtering, obtains the difference L of loop filtering nWith described normal position block matrix D N-1Difference L with loop filtering nAddition.
Preferably, described first processor is an arm processor, and described second processor is dsp processor or the independent process unit with DSP framework.
The invention also discloses a kind of decoding chip, described decoding chip comprises an image rotating system, this image rotating system comprises first processor, second processor, first memory, second memory, described first processor comprises address calculation and instruction generation unit, wherein, address calculation comprises the first address computation subelement and the second address computation subelement: the first address computation subelement, be used to calculate as with reference to piece, the spill spin block matrix D N-1 RRotate to be normal position block matrix D N-1After, at the memory address ADRESS1 of second memory; The second address computation subelement is used to calculate normal position block matrix D nBe transformed to the spill spin block matrix D n RAfter, at the memory address ADRESS2 of first memory; Described first processor also comprises the instruction generation unit, this instruction generation unit comprises that first rotate instruction generates subelement, second rotate instruction generates subelement and data processing instructions generates subelement, wherein, first rotate instruction generation subelement is used for generating described D N-1 RRotate to be D N-1, and carry described D N-1Be stored in the rotate instruction COMMAND1 of second memory address; Second rotate instruction generates subelement and is used for generating described D nRotate to be described D n R, and carry described D n RBe stored in the rotate instruction COMMAND2 of described first memory address; Data processing instructions generates subelement and is used to generate the instruction COMMAND3 that finishes infra-frame prediction, inter prediction or loop filtering data handling procedure; Described second processor is used for carrying out rotate instruction COMMAND1, carrying out rotate instruction COMMAND2 according to described ADRESS2 according to described ADRESS 1; And, execution command COMMAND3; Described first memory is used to store described block matrix D N-1 RAnd described block matrix D n RDescribed second memory is used to store described normal position block matrix D N-1Wherein, said n is the integer greater than 1;
Described first processor in this decoding chip also comprises the rotate instruction receiving element, and this rotate instruction receiving element is used at time point t 0Receive the rotation enabled instruction.And described address calculation also includes: the three-address computation subunit: be used for according to described rotation enabled instruction, calculate normal position block matrix D 1Be transformed to position of rotation block matrix D 1 RAfter, D 1 RBe stored to the address in the described first memory.
Preferably, the described rotate instruction COMMAND1 in this decoding chip is specially: second processor reads the described block matrix D that is stored in the described first memory N-1 RWith described block matrix D N-1 RMove to the described ADRESS1 of second memory, obtain D N-1
Preferably, the described rotate instruction COMMAND2 in this decoding chip is specially: second processor reads the described block matrix D that is stored in the second memory nWith described block matrix D nMove to the described ADRESS2 of first memory, obtain D n R
Preferably, the image rotating system in this decoding chip also comprises a dma controller, and described dma controller is used for each spill spin block matrix D N-1 RMove to described ADRESS1 by dma mode; And be used for each described block matrix D nMove to described ADRESS2 by dma mode.
Preferably, the described first processor in this decoding chip is an arm processor, and described second processor is dsp processor or the independent process unit with DSP framework.
Compared with prior art, the present invention has the following advantages:
In rotary course, make full use of in the decoding link, have only the decoding link of infra-frame prediction, inter prediction or loop filtering need visit as characteristics with reference to block matrix data, that decoded, rotary course is embedded in the implementation of infra-frame prediction, inter prediction or loop filtering, adopts the instruction that directly sends rotation by first processor to realize the rotation of image in the mode of carrying out relevant treatment to second processor; Compare with prior art, do not need to increase independently rotary module, thereby, saved internal memory cost, and, also reduce interior existence and moved amount of calculation in the process, alleviated the burden of system.
Description of drawings
Figure 1A is according in the decoder of the prior art, the storage means schematic diagram of block matrix;
Figure 1B is according to spinning solution of the present invention, the storage schematic diagram of spill spin block matrix in first memory;
Fig. 1 C is according to spinning solution of the present invention, the storage schematic diagram of normal position block matrix in second memory;
Fig. 2 is the detailed structure schematic diagram of the image rotating system embodiment according to the present invention;
Fig. 3 is the detailed structure schematic diagram of another embodiment of image rotating system according to the present invention.
Fig. 4 is the rotational programme figure of the image rotating method embodiment according to the present invention;
Fig. 5 is with block matrix D according to invention image rotating method embodiment N-1 RRotate to be normal position block matrix D N-1Flow chart;
Fig. 6 be according to the present invention image rotating method embodiment with normal position block matrix D nRotate to be the spill spin block matrix D n RFlow chart;
Fig. 7 is the rotational programme figure when image rotating method embodiment carries out infra-frame prediction according to the present invention;
Fig. 8 is the rotational programme figure when image rotating method embodiment carries out inter prediction according to the present invention;
Fig. 9 is the rotational programme figure when image rotating method embodiment carries out loop filtering according to the present invention.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
Core concept of the present invention is: in decode procedure, the image rotation is embedded in each link of infra-frame prediction, inter prediction or loop filtering.Thereby, need not after whole decode procedure is finished, increase by one independently module store image rotating.
Concrete, decoder needs two memories: first memory and second memory when carrying out the processing of infra-frame prediction, inter prediction or loop filtering.Wherein, first memory is called external memory storage, is used to store the spill spin block matrix data of having decoded, the reference block with as decoding current block matrix data the time; Second memory is an internal storage, for processor the difference of reference block and current block is carried out computing, thereby finishes the decoding to current block, and decoding is deposited back first memory with the result after finishing again.
Shown in Figure 1A, as can be seen, when not needing to carry out the image rotation, between first memory and second memory read with the preservation process in, do not have transformation of coordinates, be directly to move, storage then.For example, when second memory was directly moved first memory, the A point of block matrix, the memory address that B is ordered were directly corresponding with the current block matrix.
Referring to Figure 1B:
In the time need in first memory, storing the block matrix data that are in rotation status, from second memory, read block matrix 101, computing block matrix 101 is in the new coordinate under the required rotation status, and it is stored in the first memory on the postrotational address.The corresponding relation that the A point of block matrix, the memory address that B is ordered are is shown in Figure 1B.
Referring to Fig. 1 C:
Be in the block matrix data of rotation status in need be with first memory, when reading to second memory and carrying out the processing of infra-frame prediction, inter prediction or loop filtering, need the block matrix data be rotated back to the normal position by the coordinate transform of reading in the process.For example, read the block matrix 102 of first memory, calculate it and be in new coordinate under the normal position, it is stored on the new coordinate address in the second memory.The corresponding relation that the A point of block matrix, the memory address that B is ordered are is shown in Fig. 1 C.
Read block matrix and preserve that coordinate transform in the block matrix process is performed such: the definition normal condition, be the block matrix relation under non-rotating state, anticlockwise state and three kinds of situations of right rotation state, the matrix relationship by definition can read or the calculating of memory address:
Under the normal condition, the address in memory of block matrix is:
start+giAVSYPitchLength×Y+X;
Under the anticlockwise state, the address in memory of block matrix is:
start+giAVSYPitchLength×X+giAVSPicHeight-Y;
Under the right rotation state, the address in memory of block matrix is:
start+giAVSYPitchLength×(giAVSPicWidthInDs-X)+Y;
Wherein, start represents the position coordinates that present frame begins in described memory cell, giAVSYPitchLength represents the width of present frame delegation, and giAVSPicHeight represents the height of present frame, and giAVSPicWidthInDs represents that present frame is the frame width of unit with the piece.
And, above-mentioned each block matrix D N-1 R, D N-1, D n, D n RIt all is the block matrix of yuv data structure.Wherein, described n is the integer greater than 1.
Below in conjunction with rotary system embodiment and the spinning solution embodiment explanation detailed in addition to the present invention:
Rotary system embodiment:
Below in conjunction with Fig. 2 to Fig. 3 image rotating system of the present invention is made detailed description.
With reference to Fig. 2, Fig. 2 A, Fig. 2 B, Fig. 2 C, wherein, rotary system comprises: first processor 201, second processor 202, first memory 203 and second memory 204, wherein:
First processor 201 comprises address calculation 2A01 and instruction generation unit 2A02, and wherein, address calculation 2A01 comprises:
The first address computation subelement 2B01: be used to calculate as with reference to piece, the spill spin block matrix D N-1 RRotate to be normal position block matrix D N-1After, at the memory address ADRESS1 of second memory;
The second address computation subelement 2B02: be used to calculate normal position block matrix D nBe transformed to the spill spin block matrix D n RAfter, at the memory address ADRESS2 of first memory;
The instruction generation unit comprises 2A02:
First rotate instruction generates subelement 2C01: be used for generating D N-1 RRotate to be D N-1, and carry D N-1Be stored in the rotate instruction COMMAND1 of second memory address;
Second rotate instruction generates subelement 2C02: be used for generating D nRotate to be D n R, and carry D n RBe stored in the rotate instruction COMMAND2 of first memory address;
Data processing instructions generates subelement 2C03, is used to generate the instruction COMMAND3 that finishes infra-frame prediction, inter prediction or loop filtering data handling procedure;
Second processor 202 is used to carry out rotate instruction COMMAND1 and COMMAND2;
First memory 203 is used to store the block matrix D that has rotated as with reference to piece N-1 RAnd by the block matrix D that has rotated of second processor 202 decoding n R
Second memory 204 is used for storage with block matrix D N-1 RRotate back to entopic block matrix data D N-1
Wherein, rotate instruction COMMAND1 is specially: indicate second processor 202 to read the block matrix D that is stored in the first memory 203 N-1 RAnd with YUV spill spin block D N-1 RMove among the ADRESS1 to the second memory 104 to obtain D N-1
Rotate instruction COMMAND2 is specially: second processor 202 reads the block matrix D that is stored in the second memory 104 nAnd with block matrix D nMove among the ADRESS2 to the first memory 203 and obtain D n R
Further, first processor also comprises: the rotate instruction receiving element is used at time point t 0Receive the rotation enabled instruction; And described address calculation also includes: the second address computation subelement: be used for according to described rotation enabled instruction, calculate normal position block matrix D 1Be transformed to position of rotation block matrix D 1 RAfter, D 1 RBe stored to the address in the described first memory.
Preferably, first memory is selected the memory of SDRAM type, and second memory is selected the memory of SRAM type, and each above-mentioned block matrix all is the block matrix of yuv data structure.
With reference to Fig. 3, show the structural representation of the image rotating system embodiment according to the present invention, as shown in Figure 2, rotary system comprises: first processor 301, second processor 302, first memory 303, second memory 304 and dma controller 35, wherein:
First processor 301 is used for the computing block matrix D N-1 RReverse rotation is normal blocks D N-1The back in second memory 304 memory address ADRESS1 and be used to calculate YUV block matrix data D nRotate to be piece D n RThe back is at the memory address ADRESS2 of first memory 303; And, being used for to sending rotate instruction COMMAND1 and COMMAND2 to second processor 302, the COMMAND1 here is identical with a last embodiment with COMMAND2, does not repeat them here.
Second processor 302 is used to carry out above-mentioned rotate instruction COMMAND1 and COMMAND2;
First memory 303 is used to store the block matrix D that has rotated as with reference to piece N-1 RAnd by the block matrix D that has rotated of second processor decodes n R
Second memory 304 is used for storage and comprises block matrix D N-1 RRotate back to entopic block matrix data D N-1
Dma controller 305 is used for each is stored in the spill spin block D of first memory 303 N-1 RMove to the memory address ADRESS1 of second memory 304 by dma mode; And: the piece D that is used for each is stored in second memory 304 nMove among the memory address ADRESS2 to the first memory 303 by dma mode.
Preferably, first processor can be arm processor, and second processor can be for having the dsp processor of very strong data-handling capacity, certainly, the selection of second processor is not limited to dsp processor, also can select to have other independent process unit of DSP framework.
Similarly, first memory can be selected the memory of SDRAM type, and second memory is selected the memory of SRAM type, and each above-mentioned block matrix all is the block matrix of yuv data structure.
Spinning solution embodiment:
Below in conjunction with Fig. 4 to Fig. 9 image rotating method of the present invention is made detailed description.
With reference to Fig. 4, show the rotational programme figure of image rotating method embodiment of the present invention, specifically comprise the steps:
Step 401: read and be stored in the block matrix data D that has rotated in the first memory N-1 R, simultaneously, with D N-1 RRotate to be normal blocks matrix data D N-1And be kept in the second memory;
Step 402: utilize the matrix data D in the second memory N-1Carry out processing such as corresponding infra-frame prediction, inter prediction or loop filtering, obtain block matrix data D n
Step 403: with block matrix data D nRotation obtains block matrix data D n R, and be kept in the first memory.
Wherein, with D N-1 RRotate to be normal blocks matrix data D N-1And with block matrix data D nRotation obtains block matrix data D n RBe by read and the preservation process in coordinate transform realize.
Specifically, can send rotate instruction and carry out by second processor that rotate instruction finishes to second processor by first processor, then provided in the rotate instruction read and the preservation process in the address of coordinate transform.
And, D N-1 RCan obtain as follows:
At time point t 0, send the image rotate instruction; Read the normal position block matrix D that is stored in the second memory N-1, and with described normal position block matrix D N-1Be kept in the described first memory; According to coordinate transform, calculate described normal position block matrix D N-1Be transformed to position of rotation block matrix D N-1 RThe time, be stored in the address in the described second memory.
According to described address, from described second memory, read normal position block matrix D N-1, and be stored in the described address of described first memory, obtain position of rotation block matrix D N-1 R
Preferably, first memory is selected the memory of SDRAM type, and second memory is selected the memory of SRAM type, and each above-mentioned block matrix all is the block matrix of yuv data structure.
Present embodiment is by in the infra-frame prediction, inter prediction or the loop filtering that rotary course are embedded in decoding, add the module that independent being used to realizes rotating thereby saved, thereby saved internal memory cost, simultaneously, also reduce the number of times of moving of internal memory, reduced amount of calculation.
With reference to Fig. 5, show invention image rotating method embodiment with block matrix D N-1 RRotate to be normal position block matrix D N-1Flow chart, comprise the steps:
Step 501: first processor calculates the spill spin block matrix D N-1 RBe transformed to normal position block matrix D N-1The back is at the memory address ADRESS1 of second memory;
Wherein, the normal condition that has defined according to the front, be that piece YUV matrix relationship under non-rotating state, anticlockwise state and three kinds of situations of right rotation state can be read or the calculating of memory address by first processor: for example, for resolution is the image of 320*240, for Y:giAVSYPitchLength=384, giAVSPicHeight=240 is for address (X, Y) if initial piece is D N-1 RBe in the anticlockwise state, foundation:
Under the anticlockwise state, the address in memory of block matrix is:
start+giAVSYPitchLength×X+giAVSPicHeight-Y;
Then: first processor calculated address: start+384 * X+240-Y; Second processor reads in this address that a piece is put into second memory according to aforementioned calculation reading of data as a result from first memory.
Step 502: second processor reads the spill spin block matrix D N-1 RIn each spill spin block;
Step 503: with each spill spin block matrix D N-1 RMove to the memory address ADRESS1 of second memory and obtain normal position block matrix D N-1
Wherein, each is stored in the spill spin block block matrix D in the first memory N-1 RCan move to the memory address ADRESS1 of second memory by dma mode;
With reference to Fig. 6, show according to the present invention image rotating method embodiment with normal position block matrix D nRotate to be the spill spin block matrix D n RFlow chart, comprise the steps:
Step 601: first processor calculates normal position block matrix D nRotate to be the spill spin block matrix D n RThe back is at the memory address ADRESS2 of first memory;
Wherein, the normal condition that has defined according to the front, be that piece YUV matrix relationship under non-rotating state, anticlockwise state and three kinds of situations of right rotation state can be read or the calculating of memory address by first processor: for example, for resolution is the image of 320*240, for Y:giAVSYPitchLength=384, giAVSPicHeight=240 is for address (X, Y) if initial piece is D n RWill be in the anticlockwise state, foundation:
Under the anticlockwise state, the address in memory of block matrix is:
start+giAVSYPitchLength×X+giAVSPicHeight-Y;
Then: first processor calculated address: start+384 * X+240-Y; Second processor reads in this address that a piece is put into first memory according to aforementioned calculation reading of data as a result from second memory.
Step 602: second processor reads the normal position block matrix D in the second memory n
Step 603: with the normal position block matrix D in the second memory nMove to first memory memory address ADRESS2 and obtain D n R
Wherein, each is stored in the normal position block matrix D in the second memory nMove to first memory memory address ADRESS2 by dma mode.
Preferably, first memory is selected the memory of SDRAM type, and second memory is selected the memory of SRAM type.
With reference to Fig. 7, show according to the present invention the rotational programme figure when image rotating method embodiment carries out infra-frame prediction, comprise the steps:
Step 701: carry out the entropy decoding of current block by first processor, and carry out counter-scanning, inverse quantization, anti-DCT successively and with the residual error data B that produces by described second processor nBe stored in the second memory;
Step 702: by second processor with described normal position block matrix D N-1With residual error data B nAddition.
For infra-frame prediction, the elementary cell of rotation is 8 * 8,16 * 8,8 * 16 or 16 * 16 macro block.
With reference to Fig. 8, show according to the present invention the rotational programme figure when image rotating method embodiment carries out inter prediction, comprise the steps:
Step 801: first processor carries out the entropy decoding;
Step 802: the residual error data C that second processor carries out counter-scanning, inverse quantization, anti-DCT successively and current block is produced nBe stored in the second memory;
Step 803: will be stored in conduct in the first memory with reference to the spill spin block matrix D of piece N-1 RRotate to be normal position block matrix D N-1And be stored in the second memory;
Step 804: with normal position block matrix D N-1Carry out interpolation arithmetic, obtain D ' N-1
Step 805: with residual error data C nWith D ' N-1Addition obtains the normal position block matrix D of current block n
Step 806: with normal position block matrix D nRotation outputs to the relevant position of first memory.
For instance, when execution in step 803, if be in the location status of anticlockwise after the portable terminal rotation, then, from the process of first memory reading of data, at first with the spill spin block matrix D of reference block N-1 RCarry out reverse rotation, promptly to right rotation, and the D as a result that will rotate N-1Be kept in the second memory.
Next, after execution of step 803, the step 804, when execution in step 806, read normal position block matrix D from second memory nProcess in, at first with current matrix-block D nCarry out to anticlockwise, with the D as a result of rotation n RBe kept in the first memory.
And, the normal condition that has defined according to the front, be that piece YUV matrix relationship under non-rotating state, anticlockwise state and three kinds of situations of right rotation state can be read or the calculating of memory address by first processor: for example, for resolution is the image of 320*240, for Y:giAVSYPitchLength=384, and giAVSPicHeight=240, for address (X, Y) initial piece, if to anticlockwise, foundation:
Under the anticlockwise state, the address in memory of piece YUV matrix is:
start+giAVSYPitchLength×X+giAVSPicHeight-Y;
Then: first processor calculated address: start+384 * X+240-Y; Second processor reads in this address that a piece is put into second memory according to aforementioned calculation reading of data as a result from first memory.
Preferably, first memory is selected the memory of SDRAM type, and second memory is selected the memory of SRAM type.
For inter prediction, the elementary cell of rotation is 8 * 8,16 * 8,8 * 16 or 16 * 16 macro block.
With reference to Fig. 9, show according to the present invention the rotational programme figure when image rotating method embodiment carries out loop filtering, when carrying out loop filtering, described D N-1Be 8 * 6 or 6 * 8 image block, described image block is to be obtained by the image division that infra-frame prediction/interframe prediction decoding comes out, and comprises the steps:
Step 901: the edge to current image block carries out loop filtering, obtains the difference L of loop filtering n
Step 902: with described normal position block matrix D N-1Difference L with loop filtering nAddition.
In the process of specific implementation said method, can select arm processor as first processor, selecting DSP is second processor, finish the rotation of image jointly by arm processor and dsp processor, specifically, arm processor is the status that is in primary processor, sends instruction by arm processor to dsp processor, by the above-mentioned instruction of the concrete execution of dsp processor.Certainly, the selection of second processor is not limited to dsp processor, also can select to have other independent process unit of DSP framework.
According to embodiments of the invention, a kind of decoding chip also is provided, in this decoding chip, comprise image rotating system described above.Because image rotating system has been done detailed description, at this, comprises that the AVS decoding chip of this image rotating system repeats no more.
Further, above-mentioned decoding chip can be the AVS decoding chip that a kind of CMMB of providing receives, and in this AVS decoding chip, comprises image rotating system described above.
To sum up, in the present invention:
Rotary course is embedded in read in infra-frame prediction, inter prediction or the loop filtering of decoding be stored in the first memory as with reference to block matrix the time, postrotational above-mentioned block matrix is rotated, be kept in the second memory, after handling accordingly then, preserve back in the first memory again; Compare with prior art, do not need to increase independently rotary module, thereby, reduced internal memory cost, and, also reduce interior existence and moved amount of calculation in the process, alleviated the burden of system.
Each embodiment in this specification all adopts the mode of going forward one by one to describe, and what each embodiment stressed all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For decoding chip, because its principle to method embodiment, system embodiment is similar substantially, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
More than a kind of image rotating method provided by the present invention, image rotating system, decoding chip are described in detail, used specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, to sum up, this description should not be construed as limitation of the present invention.

Claims (18)

1. an image rotating system is characterized in that, comprises first processor, second processor, first memory, second memory, and described first processor comprises address calculation and instruction generation unit, and wherein, address calculation comprises:
The first address computation subelement: be used to calculate as with reference to piece, the spill spin block matrix D N-1 RRotate to be normal position block matrix D N-1After, at the memory address ADRESS1 of second memory;
The second address computation subelement: be used to calculate normal position block matrix D nBe transformed to the spill spin block matrix D n RAfter, at the memory address ADRESS2 of first memory;
The instruction generation unit comprises:
First rotate instruction generates subelement: be used for generating described D N-1 RRotate to be D N-1, and carry described D N-1Be stored in the rotate instruction COMMAND1 of second memory address;
Second rotate instruction generates subelement: be used for generating described D nRotate to be described D n R, and carry described D n RBe stored in the rotate instruction COMMAND2 of described first memory address;
Data processing instructions generates subelement, is used to generate the instruction COMMAND3 that finishes infra-frame prediction, inter prediction or loop filtering data handling procedure;
Described second processor is used for carrying out rotate instruction COMMAND1, carrying out rotate instruction COMMAND2 according to described ADRESS2 according to described ADRESS1; And, execution command COMMAND3;
Described first memory is used to store described block matrix D N-1 RAnd described block matrix D n R
Described second memory is used to store described normal position block matrix D N-1
Wherein, said n is the integer greater than 1;
Described first processor also comprises:
The rotate instruction receiving element is used at time point t 0Receive the rotation enabled instruction;
And described address calculation also comprises: the three-address computation subunit: be used for according to described rotation enabled instruction, calculate normal position block matrix D 1Be transformed to position of rotation block matrix D 1 RAfter, D 1 RBe stored to the address in the described first memory.
2. image rotating system according to claim 1 is characterized in that, described rotate instruction COMMAND1 is specially:
Second processor reads the described block matrix D that is stored in the described first memory N-1 R
With described block matrix D N-1 RMove to the described ADRESS1 of second memory, obtain D N-1
3. image rotating system according to claim 2 is characterized in that, described rotate instruction COMMAND2 is specially:
Second processor reads the described block matrix D that is stored in the second memory n
With described block matrix D nMove to the described ADRESS2 of first memory, obtain D n R
4. image rotating system according to claim 3 is characterized in that, also comprises a dma controller, and described dma controller is used for each spill spin block matrix D N-1 RMove to described ADRESS1 by dma mode; And
Be used for each described block matrix D nMove to described ADRESS2 by dma mode.
5. image rotating system according to claim 4 is characterized in that, described first processor is an arm processor, and described second processor is dsp processor or the independent process unit with DSP framework.
6. an image rotating method is characterized in that, rotary course is embedded in infra-frame prediction, inter prediction or the loop filtering of decoding, specifically comprises the steps:
Read be stored in described in the described first memory as with reference to piece, spill spin block matrix data D N-1 R, with described D N-1 RRotate to be normal position block matrix D N-1And be kept in the second memory;
Utilize the described normal position block matrix D in the second memory N-1Carry out the processing of corresponding infra-frame prediction, inter prediction or loop filtering, obtain block matrix data D n
With described block matrix data D nRotation obtains the spill spin block matrix D n R, and be kept in the described first memory;
Wherein, with described block matrix D N-1 RRotate to be the normal blocks matrix D N-1And with described block matrix D nRotation obtains the spill spin block matrix D n RBe by read and the preservation process in coordinate transform realize;
Wherein, said n is the integer greater than 1;
Wherein, when starting rotation, obtain described D as follows 1 R:
Put t in start-up time 0, send image rotation enabled instruction;
Read the normal position block matrix D that is stored in the first memory 1, and with described normal position block matrix D 1Be kept in the described second memory;
According to coordinate transform, calculate described normal position block matrix D 1Be transformed to position of rotation block matrix D 1 RThe time be stored in address in the described first memory;
From described second memory, read normal position block matrix D 1, and be stored in the described address of described first memory, obtain position of rotation block matrix D 1 R
7. image rotating method according to claim 6 is characterized in that, with described spill spin block matrix D N-1 RRotate to be normal position block matrix D N-1Rotate instruction be specially:
First processor calculates: described spill spin block matrix D N-1 RRotate to be normal position block matrix D N-1After, at the memory address ADRESS1 of second memory;
Second processor reads described spill spin block matrix D N-1 RIn each spill spin block matrix;
With described spill spin block matrix D N-1 RMove to the ADRESS1 of second memory, obtain normal position block matrix D N-1
8. image rotating method according to claim 7 is characterized in that, with block matrix D nRotation obtains matrix data D n RRotate instruction be specially:
First processor calculates: described normal position block matrix D nRotate to be the spill spin block matrix D n RAfter, at the memory address ADRESS2 of first memory;
Second processor reads the normal position block matrix D in the described second memory n
With described normal position block matrix D nMove to the ADRESS2 of first memory, obtain the spill spin block matrix D n R
9. image rotating method according to claim 8 is characterized in that,
Described spill spin block matrix D N-1 RBy dma mode, move to the ADRESS1 of second memory, obtain normal position block matrix D N-1And
Described normal position block matrix D nBy dma mode, move to the ADRESS2 of first memory, obtain the spill spin block matrix D n R
10. image processing method according to claim 9 is characterized in that, utilizes described normal position piece square D N-1As the reference piece, when carrying out infra-frame prediction, described D N-1Be 8 * 8,16 * 8,8 * 16 or 16 * 16 macro block, comprise the steps:
Carry out the entropy decoding of current block by first processor, and carry out counter-scanning, inverse quantization, anti-DCT successively and with the residual error data B that produces by described second processor nBe stored in the second memory;
By second processor with described normal position block matrix D N-1With residual error data B nAddition.
11. image processing method according to claim 9 is characterized in that, utilizes described normal position block matrix D N-1As the reference piece, when carrying out inter prediction, described D N-1Be 8 * 8,16 * 8,8 * 16 or 16 * 16 macro block, comprise the steps:
Carry out the entropy decoding of the current block of present frame by first processor, and the residual error data C that carries out counter-scanning, inverse quantization, anti-DCT successively and current block is produced by second processor nBe stored in the described second memory;
By described second processor with described normal position block matrix D N-1With carry out interpolation arithmetic, obtain D ' N-1
By second processor with described block matrix data D ' N-1With residual error data C nAddition.
12. image processing method according to claim 9 is characterized in that, utilizes described normal position block matrix D N-1As the reference piece, when carrying out loop filtering, described D N-1Be 8 * 6 or 6 * 8 image block, described image block is to be obtained by the image division that infra-frame prediction/interframe prediction decoding comes out, and comprises the steps:
Edge to current image block carries out loop filtering, obtains the difference L of loop filtering n
With described normal position block matrix D N-1Difference L with loop filtering nAddition.
13. image rotating method according to claim 6 is characterized in that, described first processor is an arm processor, and described second processor is dsp processor or the independent process unit with DSP framework.
14. decoding chip, it is characterized in that, described decoding chip comprises an image rotating system, described image rotating system comprises: comprise first processor, second processor, first memory, second memory, described first processor comprises address calculation and instruction generation unit, wherein, address calculation comprises:
The first address computation subelement: be used to calculate as with reference to piece, the spill spin block matrix D N-1 RRotate to be normal position block matrix D N-1After, at the memory address ADRESS1 of second memory;
The second address computation subelement: be used to calculate normal position block matrix D nBe transformed to the spill spin block matrix D n RAfter, at the memory address ADRESS2 of first memory;
The instruction generation unit comprises:
First rotate instruction generates subelement: be used for generating described D N-1 RRotate to be D N-1, and carry described D N-1Be stored in the rotate instruction COMMAND1 of second memory address;
Second rotate instruction generates subelement: be used for generating described D nRotate to be described D n R, and carry described D n RBe stored in the rotate instruction COMMAND2 of described first memory address;
Data processing instructions generates subelement, is used to generate the instruction COMMAND3 that finishes infra-frame prediction, inter prediction or loop filtering data handling procedure;
Described second processor is used for carrying out rotate instruction COMMAND1, carrying out rotate instruction COMMAND2 according to described ADRESS2 according to described ADRESS1; And, execution command COMMAND3;
Described first memory is used to store described block matrix D N-1 RAnd described block matrix D n R
Described second memory is used to store described normal position block matrix D N-1
Wherein, said n is the integer greater than 1;
Described first processor also comprises:
The rotate instruction receiving element is used at time point t 0Receive the rotation enabled instruction;
And described address calculation also includes: the first address computation subelement: be used for according to described rotation enabled instruction, calculate normal position block matrix D 1Be transformed to position of rotation block matrix D 1 RAfter, D 1 RBe stored to the address in the described first memory.
15. decoding chip according to claim 14 is characterized in that, described rotate instruction COMMAND1 is specially:
Second processor reads the described block matrix D that is stored in the described first memory N-1 R
With described block matrix D N-1 RMove to the described ADRESS1 of second memory, obtain D N-1
16. decoding chip according to claim 15 is characterized in that, described rotate instruction COMMAND2 is specially:
Second processor reads the described block matrix D that is stored in the second memory n
With described block matrix D nMove to the described ADRESS2 of first memory, obtain D n R
17. decoding chip according to claim 16 is characterized in that, also comprises a dma controller, described dma controller is used for each spill spin block matrix D N-1 RMove to described ADRESS1 by dma mode; And
Be used for each described block matrix D nMove to described ADRESS2 by dma mode.
18. decoding chip according to claim 14 is characterized in that, described first processor is an arm processor, and described second processor is dsp processor or the independent process unit with DSP framework.
CN2008102237054A 2008-10-08 2008-10-08 Image rotating system, image rotating method and decoding chip Expired - Fee Related CN101388947B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008102237054A CN101388947B (en) 2008-10-08 2008-10-08 Image rotating system, image rotating method and decoding chip

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008102237054A CN101388947B (en) 2008-10-08 2008-10-08 Image rotating system, image rotating method and decoding chip

Publications (2)

Publication Number Publication Date
CN101388947A CN101388947A (en) 2009-03-18
CN101388947B true CN101388947B (en) 2011-04-06

Family

ID=40478103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008102237054A Expired - Fee Related CN101388947B (en) 2008-10-08 2008-10-08 Image rotating system, image rotating method and decoding chip

Country Status (1)

Country Link
CN (1) CN101388947B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015139175A1 (en) * 2014-03-17 2015-09-24 Mediatek Singapore Pte. Ltd. Improved block copying
CN105551456A (en) * 2015-12-11 2016-05-04 中国航空工业集团公司西安航空计算技术研究所 DDR2 block storage method based on image rotation display

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1178591A (en) * 1996-02-05 1998-04-08 精工爱普生株式会社 Hardware for rotating an image for portrait-oriented display
CN1604053A (en) * 2003-09-30 2005-04-06 松下电器产业株式会社 Image processing method and image processing apparatus

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1178591A (en) * 1996-02-05 1998-04-08 精工爱普生株式会社 Hardware for rotating an image for portrait-oriented display
CN1604053A (en) * 2003-09-30 2005-04-06 松下电器产业株式会社 Image processing method and image processing apparatus

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
李筱琳等.基于DSP的图像旋转算法数据调度策略.微型电脑应用24 3.2008,24(3),6-8,26.
李筱琳等.基于DSP的图像旋转算法数据调度策略.微型电脑应用24 3.2008,24(3),6-8,26. *

Also Published As

Publication number Publication date
CN101388947A (en) 2009-03-18

Similar Documents

Publication Publication Date Title
CN111314741B (en) Video super-resolution processing method and device, electronic equipment and storage medium
CN105263050B (en) Mobile terminal real-time rendering system and method based on cloud platform
US8948822B2 (en) Coordinating power management functions in a multi-media device
TWI364714B (en) Caching method and apparatus for video motion compensation
US20080285652A1 (en) Apparatus and methods for optimization of image and motion picture memory access
CN103609117B (en) Code and decode the method and device of image
US20050190976A1 (en) Moving image encoding apparatus and moving image processing apparatus
JP5548671B2 (en) Image processing system, image providing server, information processing apparatus, and image processing method
CN101394569B (en) Error tolerance method, device and chip for AVS video decoder
CN108780584A (en) Conversion and pretreatment for steaming transfer and the spherical video of rendering
CN102044058B (en) Method and system for processing pictures in electronic equipment, and electronic equipment
CN101729893B (en) MPEG multi-format compatible decoding method based on software and hardware coprocessing and device thereof
CN101388947B (en) Image rotating system, image rotating method and decoding chip
CN101257625B (en) Method for indexing position in video decoder and video decoder
CN103686349A (en) Multi-screen interaction method and device, set-top box
CN101783958A (en) Computation method and device of time domain direct mode motion vector in AVS (audio video standard)
CN101383968A (en) Video decoder, video decoding method and mobile multimedia terminal chip
CN101771867B (en) Size-reducing decoding method and system
CN102073987A (en) Method and system for converting YUV420 image into RGB565 image
US20080278606A9 (en) Image compositing
JP4870563B2 (en) Image processing method and apparatus in portable device
CN102306076B (en) The generation method of dynamic pattern texture and terminal
CN101729903B (en) Method, system and multimedia processor for reading reference frame data
CN101184142A (en) Image processing method and image rotatable digital photo frame of implementing the same
US10104373B2 (en) Content based video encoding for wireless display

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20151020

Address after: 100080, Beijing, Zhongguancun Haidian District Street 11, 100 million world wealth center, block A, 12

Patentee after: BEIJING BOXIN SHITONG TECHNOLOGY CO., LTD.

Address before: 100084 Beijing, Zhongguancun East Road, No. 1, building No. 8, Tsinghua Science Park, science and technology building, block A, 803

Patentee before: Beijing Chuangyi Vision Technology Co., Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20110406

Termination date: 20171008