CN102750928A - Graphic image fade-in fade-out processing method based on streaming single instruction multiple data extension 2 (SSE2) - Google Patents
Graphic image fade-in fade-out processing method based on streaming single instruction multiple data extension 2 (SSE2) Download PDFInfo
- Publication number
- CN102750928A CN102750928A CN2011101273888A CN201110127388A CN102750928A CN 102750928 A CN102750928 A CN 102750928A CN 2011101273888 A CN2011101273888 A CN 2011101273888A CN 201110127388 A CN201110127388 A CN 201110127388A CN 102750928 A CN102750928 A CN 102750928A
- Authority
- CN
- China
- Prior art keywords
- fade
- data
- sse2
- graphic image
- parallel
- 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
Links
Abstract
The invention discloses a graphic image fade-in fade-out processing method based on streaming single instruction multiple data extension 2 (SSE2). The method includes: reading data of a graphic image to be processed, selecting data pixel points of the graphic image to be processed, and processing the data pixel points; obtaining an Alpha value portion of parallel computing data by using a red green blue (RGB) Mask method and conducting parallel computing on the Alpha value portion to obtain Alpha value parallel results; and by means of the RGB Mask method, combining an RGB portion of original data and the Alpha parallel results after parallel computing to obtain a complete red green blue alpha (RGBA) value result. By means of the method, parallel computing data quantity is increased, four pixels are operated each time, and efficiency is greatly improved. By using a method of separating the RGB Mask and combining a pixel point RGB portion, unnecessary computing is greatly reduced, and computing speed is increased. A table look-up computing method is abandoned, and central processor unit (CPU) performance is used efficiently, and therefore the computing speed is increased, and computing time is shortened.
Description
Technical field
The present invention relates to field of broadcast televisions, particularly relate to a kind of graph image disposal route of being fade-in fade-out based on SSE2.
Background technology
Can do various processing to graph image as required in the multimedia technology, wherein being fade-in fade-out is exactly relatively use always a kind of.Being fade-in fade-out of graph image is a kind of display packing of fading in, fading out of graph image.Graph image is dark by bright commentaries on classics, so that disappearance fully, the end of this process is also named and faded out fading out; Graph image is by secretly brightening, and clear fully at last, the beginning of this process is named and fades in, and cries again and fades in.Fading over is a kind of skill of express time in the graph and image processing, space conversion.
And on color/graphics, hardware unit makes red, the green and blue light of each the pixel emission varying number on the screen.This varicolored quantity is called as R, G and B value respectively.With they the 4th transparence values in addition usually packaging together, be called Alpha, promptly represent with A.The Alpha value does not have direct effect to the color that screen showed, but it has many purposes, comprises mixing and transparent or the like.
The inventor finds that there is following problem at least in prior art in realizing process of the present invention: in the prior art, the operation pixel number amount of handling of at every turn being fade-in fade-out is 1-2, and the function call expense is big and treatment effeciency is lower; The middle data majority of participating in of the operation of being fade-in fade-out provides with lookup table mode, thereby has increased the generation of cache miss greatly, has reduced processing speed and efficient.
Summary of the invention
The problem that the embodiment of the invention will solve provides a kind of graph image based on SSE2 disposal route of being fade-in fade-out, and improves the efficient that data parallel is handled, and each 4 pixels of married operation reduce the frequency of cache miss, with directly calculating the replacement look-up table.
For achieving the above object, the invention provides a kind of graph image disposal route of being fade-in fade-out based on data stream single instruction multiple data expansion instruction set 2SSE2, comprising:
Read pending graphic image data, choose pending graphic image data pixel, its parallel processing;
Utilize RGB Mask method to obtain the Alpha value part of parallel computation data, and said Alpha value part is carried out parallel computation, obtain the parallel result of Alpha value;
Utilize RGB Mask method, merge the RGB part of legacy data and the parallel result of Alpha after the parallel computation, obtain complete RGBA value result.
The technical scheme of the embodiment of the invention has the following advantages, and the parallel computation data volume has been improved in (1), operates 4 pixels at every turn, has improved efficient greatly; (2) adopted RGB Mask to separate and merging pixel RGB part method, reduced unnecessary computations significantly, thereby improved arithmetic speed; (4) give up the computation of table lookup method, utilized the performance of CPU more efficiently, thereby improved computing velocity, shortened computing time.
Description of drawings
Fig. 1 is the be fade-in fade-out process flow diagram of disposal route of a kind of graph image based on SSE2 among the present invention.
Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention will be carried out clear, intactly description, it is pointed out that described embodiment only is a part of embodiment of the present invention, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
Below in conjunction with accompanying drawing and embodiment, specific embodiments of the invention describes in further detail:
The invention provides a kind of graph image disposal route of being fade-in fade-out based on SSE2, as shown in Figure 1, may further comprise the steps:
Step S101 reads pending graphic image data, chooses pending graphic image data pixel, to its parallel processing.
At first, read pending graphic image data, therefrom select 4 neighbor pixels arbitrarily.Can only handle 12 pixels simultaneously in the prior art, and because the embodiment of the invention is based on 128 bit registers that SSE2 provides, and the RGBA value of each pixel is 32, so the method that the embodiment of the invention provides can be supported the processing to 4 pixels.4 neighbor pixels to selecting carry out parallel processing to it, promptly simultaneously 4 neighbor pixels selecting are handled, and realize the single instruction multiple data operation through an operational order.
Step S102 utilizes RGB Mask method to obtain the Alpha value part of parallel computation data, and said Alpha value part is carried out parallel computation, obtains the parallel result of Alpha value.
4 neighbor pixels that step S101 is selected, the Alpha value part separately of 4 neighbor pixels that obtain walking abreast through RGB MASK obtains the parallel result of Alpha value then.
(1) each pixel has the RGBA value, arranges as follows:
Each value of A|R|G|B accounts for 8 Bit positions
(2) each four continuous pixels (0,1,2,3 pixel) of handling in the method, arrange as follows so:
RGBA=A3|R?3|G?3|B?3|A2|R2|G2|B2|A1|R1|G1|B1|A0|R0|G0|B0
(3) keep away the computing of unavoidable multiplication or the like in the method, for example: the A value of pixel, A*X makes the result greater than 28 powers, just can not be stored among original 8bit, causes the distortion as a result of computing, it is exactly to address this problem that RGB Mask method is separated.
(4) RGB Mask method discrete pixels point value principle is following:
(FF=11111111; 00=00000000, sexadecimal)
Defconstant RGB MASK=FF000000|FF000000|FF000000|FF000000RGB MASK and RGBA value are done logic and operation, obtain
A3|0|0|0|A2|0|0|0|A1|0|0|0|A0|0|0|0,
It is available that each pixel A value all has enough bit position like this, guarantees normally carrying out of computing.
Step S103 utilizes RGB Mask method, merges the RGB part of legacy data and the parallel result of Alpha after the parallel computation, obtains complete RGBA value result.
After current 4 pixels choosing are carried out computing obtaining complete RGBA value result, judge whether also have untreated pixel in the current data, if having then direct selected pixels point; If not then continue to read the graphic image data that other do not process.
Through embodiments of the invention, improved the parallel computation data volume, operate 4 pixels at every turn, improved efficient greatly, adopted RGB Mask to separate and merging pixel RGB part method, reduce unnecessary computations significantly, thereby improved arithmetic speed; Give up the computation of table lookup method, utilized the performance of CPU more efficiently, thereby improved computing velocity, shortened computing time.
Through the description of above embodiment, those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential general hardware platform, can certainly pass through hardware, but the former is better embodiment under a lot of situation.Based on such understanding; The part that technical scheme of the present invention contributes to prior art in essence in other words can be come out with the embodied of software product; This computer software product is stored in the storage medium, comprise some instructions with so that a station terminal equipment (can be mobile phone, personal computer; Server, the perhaps network equipment etc.) carry out the described method of each embodiment of the present invention.
The above only is a preferred implementation of the present invention; Should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; Can also make some improvement and retouching, these improvement and retouching also should be looked protection scope of the present invention.
Claims (6)
1. the graph image based on SSE2 disposal route of being fade-in fade-out is characterized in that, comprising:
Read pending graphic image data, choose pending graphic image data pixel, its parallel processing;
Utilize RGB Mask method to obtain the Alpha value part of parallel computation data, and said Alpha value part is carried out parallel computation, obtain the parallel result of Alpha value;
Utilize RGB Mask method, merge the RGB part of legacy data and the parallel result of Alpha after the parallel computation, obtain complete RGBA value result.
2. the graph image based on the SSE2 as claimed in claim 1 disposal route of being fade-in fade-out is characterized in that, saidly chooses pending graphic image data pixel and is specially and from said pending graphic image data, selects 4 neighbor pixels arbitrarily.
3. the graph image based on the SSE2 as claimed in claim 2 disposal route of being fade-in fade-out; It is characterized in that; Said from said pending graphic image data, the selection arbitrarily handled 4 neighbor pixels selecting behind 4 neighbor pixels simultaneously, realizes the single instruction multiple data operation through an operational order.
4. the graph image based on the SSE2 as claimed in claim 1 disposal route of being fade-in fade-out is characterized in that, the Alpha after the RGB part of said merging legacy data and the parallel computation walks abreast judges also whether untreated pixel is arranged in the current data behind the result.
5. the graph image based on the SSE2 as claimed in claim 4 disposal route of being fade-in fade-out is characterized in that, when untreated pixel, directly continues to choose 4 neighbor pixels and handles.
6. the graph image based on the SSE2 as claimed in claim 4 disposal route of being fade-in fade-out is characterized in that when not having untreated pixel, then read the graphic image data that other do not deal with, therefrom the selected pixels point is handled.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110127388.8A CN102750928B (en) | 2011-05-17 | 2011-05-17 | A kind of graph image based on SSE2 is fade-in fade-out processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110127388.8A CN102750928B (en) | 2011-05-17 | 2011-05-17 | A kind of graph image based on SSE2 is fade-in fade-out processing method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102750928A true CN102750928A (en) | 2012-10-24 |
CN102750928B CN102750928B (en) | 2016-08-17 |
Family
ID=47031057
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110127388.8A Expired - Fee Related CN102750928B (en) | 2011-05-17 | 2011-05-17 | A kind of graph image based on SSE2 is fade-in fade-out processing method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102750928B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5940080A (en) * | 1996-09-12 | 1999-08-17 | Macromedia, Inc. | Method and apparatus for displaying anti-aliased text |
CN1664865A (en) * | 2004-02-18 | 2005-09-07 | 哈曼贝克自动系统股份有限公司 | Image processor |
CN101753912A (en) * | 2008-12-22 | 2010-06-23 | 康佳集团股份有限公司 | Method and device for displaying picture of embedded set top box |
-
2011
- 2011-05-17 CN CN201110127388.8A patent/CN102750928B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5940080A (en) * | 1996-09-12 | 1999-08-17 | Macromedia, Inc. | Method and apparatus for displaying anti-aliased text |
CN1664865A (en) * | 2004-02-18 | 2005-09-07 | 哈曼贝克自动系统股份有限公司 | Image processor |
CN101753912A (en) * | 2008-12-22 | 2010-06-23 | 康佳集团股份有限公司 | Method and device for displaying picture of embedded set top box |
Non-Patent Citations (2)
Title |
---|
周中云: "Alpha通道在多媒体课件作品开发中的应用", 《现代教育技术》 * |
夏仁康: "谈Alpha通道及其应用", 《中国医学教育技术》 * |
Also Published As
Publication number | Publication date |
---|---|
CN102750928B (en) | 2016-08-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
RU2677584C1 (en) | Exploiting frame to frame coherency in architecture of image construction with primitives sorting at intermediate stage | |
US10061592B2 (en) | Architecture and execution for efficient mixed precision computations in single instruction multiple data/thread (SIMD/T) devices | |
CN101796842A (en) | An efficient image compression scheme to minimize storage and bus bandwidth requirements | |
CN105229695B (en) | Subset-based compression and decompression of graphics data | |
WO2000063840A9 (en) | Color modification on a digital nonlinear editing system | |
TW201514915A (en) | Compression and decompression of graphics data using pixel region bit values | |
KR20230084153A (en) | Methods and apparatus for histogram-based and adaptive tone mapping using multiple frames | |
US8655063B2 (en) | Decoding system and method operable on encoded texture element blocks | |
US10127887B2 (en) | Acceleration of color conversion | |
US20180097527A1 (en) | 32-bit hdr pixel format with optimum precision | |
CN102752606A (en) | Method for performing color spatial switching based on SSE2 (Streaming SIMD Extensions 2) | |
US9336561B2 (en) | Color buffer caching | |
TWI505717B (en) | Joint scalar embedded graphics coding for color images | |
CN102164284A (en) | Video decoding method and system | |
CN102750928A (en) | Graphic image fade-in fade-out processing method based on streaming single instruction multiple data extension 2 (SSE2) | |
CN101159819A (en) | Method and device of inter cut Flash in online video | |
CN102750726A (en) | Depth-of-field achieving method based on Open graphics library (GL) | |
CN104113704A (en) | Game image processing method and device | |
CN206757592U (en) | A kind of data handling system | |
CN102263924A (en) | Image processing method based on bicubic interpolation and image display method | |
CN104813342A (en) | Content aware video resizing | |
WO2021202470A1 (en) | Super-resolution of block-compressed texture for texture mapping applications | |
CN102752547B (en) | A kind of speed changing method of scrolling subtitle | |
US20150325032A1 (en) | Hybrid mode graphics processing interpolator | |
JP2011128714A (en) | Image processing apparatus, image data and image processing program |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20160817 Termination date: 20200517 |
|
CF01 | Termination of patent right due to non-payment of annual fee |