CN102750928B - A kind of graph image based on SSE2 is fade-in fade-out processing method - Google Patents

A kind of graph image based on SSE2 is fade-in fade-out processing method Download PDF

Info

Publication number
CN102750928B
CN102750928B CN201110127388.8A CN201110127388A CN102750928B CN 102750928 B CN102750928 B CN 102750928B CN 201110127388 A CN201110127388 A CN 201110127388A CN 102750928 B CN102750928 B CN 102750928B
Authority
CN
China
Prior art keywords
fade
parallel
rgb
data
pixel
Prior art date
Application number
CN201110127388.8A
Other languages
Chinese (zh)
Other versions
CN102750928A (en
Inventor
廖健
吕精华
郑培枫
饶文辉
Original Assignee
新奥特(北京)视频技术有限公司
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 新奥特(北京)视频技术有限公司 filed Critical 新奥特(北京)视频技术有限公司
Priority to CN201110127388.8A priority Critical patent/CN102750928B/en
Publication of CN102750928A publication Critical patent/CN102750928A/en
Application granted granted Critical
Publication of CN102750928B publication Critical patent/CN102750928B/en

Links

Abstract

The invention discloses a kind of graph image based on SSE2 to be fade-in fade-out processing method, including: read pending graphic image data, choose pending graphic image data pixel, to its parallel processing;Utilize RGB Mask method to obtain the Alpha value part of parallel computation data, and described Alpha value part is carried out parallel computation, obtain the parallel result of Alpha value;Utilize RGB Mask method, the parallel result of Alpha after the RGB portion of merging legacy data and parallel computation, obtain complete RGBA value result.The method provided by the present invention, improves parallel computation data volume, and 4 pixels of operation, substantially increase efficiency every time, have employed RGB Mask and separates and merge pixel RGB portion method, drastically reduce the area unnecessary calculating, thus improve arithmetic speed;Give up computation of table lookup method, the more efficient performance that make use of CPU, thus improve calculating speed, shorten the calculating time.

Description

A kind of graph image based on SSE2 is fade-in fade-out processing method

Technical field

The present invention relates to field of broadcast televisions, particularly relate to a kind of graph image based on SSE2 and fade in light Go out processing method.

Background technology

In multimedia technology can as required graph image is done various process, be wherein fade-in fade-out exactly than More common one.Being fade-in fade-out of graph image, is the display faded in, fade out of a kind of graph image Method.Graph image is dark by bright turn, so that disappearing completely, the end of this process, fading out, is also named gradually Hidden;Graph image is by secretly brightening, and last the most clear, the beginning of this process is named and fades in, and cries again and fades in.Light Going out fades in is express time in graph and image processing, a kind of skill of space conversion.

And on a colour screen, hardware unit makes the red, green of each pixel emission varying number on screen And blue light.This varicolored quantity is known respectively as R, G and B value.It is often packaged in one with them That rises also has the 4th transparence value, referred to as Alpha, i.e. represents with A.Alpha value is to shown by screen Color do not have direct effect, but it has many purposes, including mixing and transparent etc..

Chinese patent literature CN1664865A is the immediate prior art of the present invention, and inventor is realizing During the present invention, find that prior art at least there is problems in that in prior art, fade in every time The handled pixel quantity of operation of fading out is 1-2, and function call expense is compared with big and treatment effeciency is relatively low; The middle data majority that participates in of operation of being fade-in fade-out is given with lookup table mode, thus considerably increases cache miss Generation, reduce processing speed and efficiency.

Summary of the invention

The problem that the embodiment of the present invention is to be solved is to provide a kind of graph image based on SSE2 and is fade-in fade-out Processing method, improves the efficiency of parallel data processing, 4 pixels of each married operation, reduces slow Deposit the frequency of disappearance, replace look-up table with directly calculating.

For reaching above-mentioned purpose, the invention provides a kind of based on data stream single-instruction multiple-data extended instruction The graph image of collection 2SSE2 is fade-in fade-out processing method, including:

Read pending graphic image data, choose pending graphic image data pixel, parallel to it Process;

RGB Mask method is utilized to obtain the Alpha value part of parallel computation data, and to described Alpha Value part carries out parallel computation, obtains the parallel result of Alpha value;

Utilize RGB Mask method, the Alpha after the RGB portion of merging legacy data and parallel computation Parallel result, obtains complete RGBA value result.

The technical scheme of the embodiment of the present invention has the following advantages, and (1) improves parallel computation data volume, 4 pixels of operation, substantially increase efficiency every time;(2) have employed RGB Mask separate and merge pixel Point RGB portion method, drastically reduce the area unnecessary calculating, thus improves arithmetic speed;(4) Give up computation of table lookup method, the more efficient performance that make use of CPU, thus improve calculating speed, Shorten the calculating time.

Accompanying drawing explanation

Fig. 1 is that in the present invention, a kind of graph image based on SSE2 is fade-in fade-out the flow chart of processing method.

Detailed description of the invention

Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out Clearly and completely describe, it should be pointed out that described embodiment is only the part of the present invention Embodiment rather than whole embodiments.Based on the embodiment in the present invention, ordinary skill people The every other embodiment that member is obtained under not making creative work premise, broadly falls into the present invention and protects The scope protected.

Below in conjunction with the accompanying drawings and embodiment, the detailed description of the invention of the present invention is described in further detail:

The invention provides a kind of graph image based on SSE2 to be fade-in fade-out processing method, such as Fig. 1 institute Show, comprise the following steps:

Step S101, reads pending graphic image data, chooses pending graphic image data pixel, To its parallel processing.

First, pending graphic image data to be read, arbitrarily select 4 neighbor pixels. Prior art can only process 1-2 pixel simultaneously, and owing to the embodiment of the present invention is to provide based on SSE2 128 bit registers, and the RGBA value of each pixel is 32, so the embodiment of the present invention provides Method can support the process to 4 pixels.It is carried out by 4 neighbor pixels selected 4 neighbor pixels selected are processed, by an operational order by parallel processing the most simultaneously Realize single-instruction multiple-data operation.

Step S102, utilizes RGB Mask method to obtain the Alpha value part of parallel computation data, and Described Alpha value part is carried out parallel computation, obtains the parallel result of Alpha value.

4 neighbor pixels selecting step S101, obtain parallel 4 by RGB MASK The respective Alpha value part of individual neighbor pixel, obtains the parallel result of Alpha value then.

(1) each pixel has RGBA value, arranges as follows:

A | R | G | each value of B accounts for 8 Bit positions

(2) method processes four continuous print pixels (0,1,2,3 pixel) every time, then arrangement is such as Under:

RGBA=A3 | R3 | G3 | B3 | A2 | R2 | G2 | B2 | A1 | R1 | G1 | B1 | A0 | R0 | G0 | B0

(3) being not fee from the computing of multiplication etc. in method, such as: the A value of pixel, A*X makes knot The fruit 8 powers more than 2, namely can not be stored in original 8bit, cause the result distortion of computing, RGB Mask method separates and solves this problem exactly.

(4) RGB Mask method separation pixel point value principle is as follows:

(FF=11111111;00=00000000, hexadecimal)

Defconstant RGB MASK=FF000000 | FF000000 | FF000000 | FF000000 RGB MASK and RGBA value do logic and operation, obtain

A3 | 0 | 0 | 0 | A1 | 0 | 0 | 0 | A0 | 0 | 0 | 0, | A2 | 0 | 0 | 0,

The most each pixel A value has enough bit positions can use, it is ensured that being normally carried out of computing.

Step S103, utilizes RGB Mask method, merges RGB portion and the parallel computation of legacy data After the parallel result of Alpha, obtain complete RGBA value result.

4 pixels currently chosen are being carried out after computing obtains complete RGBA value result, it is judged that Whether current data also has untreated pixel, if had, directly selected pixels point;Without Then continue to read other graphic image datas not processed.

By embodiments of the invention, improve parallel computation data volume, every time 4 pixels of operation, greatly Improve greatly efficiency, have employed RGB Mask and separate and merge pixel RGB portion method, significantly Decrease unnecessary calculating, thus improve arithmetic speed;Give up computation of table lookup method, more efficient Make use of the performance of CPU, thus improve calculating speed, shorten the calculating time.

Through the above description of the embodiments, those skilled in the art is it can be understood that arrive this Invention can add the mode of required general hardware platform by software and realize, naturally it is also possible to by firmly Part, but a lot of in the case of the former is more preferably embodiment.Based on such understanding, the skill of the present invention The part that prior art is contributed by art scheme the most in other words can be with the form body of software product Revealing to come, this computer software product is stored in a storage medium, including some instructions in order to make Obtain a station terminal equipment (can be mobile phone, personal computer, server, or the network equipment etc.) Perform the method described in each embodiment of the present invention.

The above is only the preferred embodiment of the present invention, it is noted that for the art For those of ordinary skill, under the premise without departing from the principles of the invention, it is also possible to make some improvement And retouching, these improvements and modifications also should regard protection scope of the present invention.

Claims (4)

1. a graph image based on SSE2 is fade-in fade-out processing method, it is characterised in that including:
Read pending graphic image data, choose pending graphic image data pixel, parallel to it Process;
RGB Mask method is utilized to obtain the Alpha value part of parallel computation data, and to described Alpha Value part carries out parallel computation, obtains the parallel result of Alpha value;
Utilize RGB Mask method, the Alpha after the RGB portion of merging legacy data and parallel computation Parallel result, obtains complete RGBA value result;
Described choose pending graphic image data pixel be specially from described pending graph image number 4 neighbor pixels are arbitrarily selected according to;
Described the most right after 4 neighbor pixels of any selection from described pending graphic image data 4 neighbor pixels selected process, and realize single-instruction multiple-data by an operational order and grasp Make;
RGB Mask method separation pixel point value principle is as follows:
Defconstant RGB MASK=FF000000 | FF000000 | FF000000 | FF000000,
RGB MASK and RGBA value do logic and operation.
2. graph image based on SSE2 as claimed in claim 1 is fade-in fade-out processing method, and it is special Levy and be, after the parallel result of Alpha after the RGB portion of described merging legacy data and parallel computation also Judge whether current data has untreated pixel.
3. graph image based on SSE2 as claimed in claim 2 is fade-in fade-out processing method, and it is special Levy and be, when there being untreated pixel, continue directly to choose 4 neighbor pixels and process.
4. graph image based on SSE2 as claimed in claim 2 is fade-in fade-out processing method, and it is special Levy and be, when there is no untreated pixel, then read other graphic image datas not dealt with, Therefrom selected pixels point processes.
CN201110127388.8A 2011-05-17 2011-05-17 A kind of graph image based on SSE2 is fade-in fade-out processing method CN102750928B (en)

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 CN102750928A (en) 2012-10-24
CN102750928B true CN102750928B (en) 2016-08-17

Family

ID=47031057

Family Applications (1)

Application Number Title Priority Date Filing Date
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

Country Status (1)

Country Link
CN (1) CN102750928B (en)

Citations (3)

* Cited by examiner, † Cited by third party
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

Patent Citations (3)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
Alpha通道在多媒体课件作品开发中的应用;周中云;《现代教育技术》;20030228(第2期);全文 *
谈Alpha通道及其应用;夏仁康;《中国医学教育技术》;20051231(第6期);全文 *

Also Published As

Publication number Publication date
CN102750928A (en) 2012-10-24

Similar Documents

Publication Publication Date Title
CN2906675Y (en) High brightness display with novel sub-pixel layout and arrangement
US9454843B2 (en) Modulated and blended anti-aliasing
KR100989351B1 (en) Systems and methods for selective handling of out-of-gamut color conversions
CN1707522B (en) Colour compressing system and method utilizing marginal data bit element shade
CN101065784B (en) Computer graphics
DE102013113721A1 (en) A system, method, and computer program product that implement an image processing pipeline for high dynamic range images
US8505001B2 (en) Method and system for utilizing data flow graphs to compile shaders
JP2014041377A (en) Improved gamut mapping and sub-pixel rendering system and method
JP2006003475A (en) Oled display device
EP1735748B1 (en) System and method for processing graphics operations with graphics processing unit
JP4679242B2 (en) Display device
US20030227462A1 (en) Graphics texture processing methods, apparatus and computer program products using texture compression, block overlapping and/or texture filtering
WO2000063840A9 (en) Color modification on a digital nonlinear editing system
AU5785101A (en) Recirculating shade tree blender for a graphics system
KR20040106300A (en) Scalable high performance 3d graphics
KR20090117809A (en) Efficient 2-d and 3-d graphics processing
US9058685B2 (en) Method and system for controlling a 3D processor using a control list in memory
US8619085B2 (en) Method and system for compressing tile lists used for 3D rendering
US7724263B2 (en) System and method for a universal data write unit in a 3-D graphics pipeline including generic cache memories
JP2002537615A (en) It has a super sampling sample buffer, the graphics system to generate an output pixel using the selective filtering adjusted to reduce artifacts.
JP2002537612A (en) Render the sample into the sample buffer, in response to the stored samples, graphics system for generating a pixel at different rates
CN101916539B (en) System and method for correcting brightness and chromaticity of LED display screen point by point
CN102231264A (en) Dynamic contrast enhancement device and method
EP1735701A1 (en) High-level program interface for graphics operations
JP5478826B2 (en) Display device

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