CN105957011B - Image processing method and device - Google Patents
Image processing method and device Download PDFInfo
- Publication number
- CN105957011B CN105957011B CN201610355530.7A CN201610355530A CN105957011B CN 105957011 B CN105957011 B CN 105957011B CN 201610355530 A CN201610355530 A CN 201610355530A CN 105957011 B CN105957011 B CN 105957011B
- Authority
- CN
- China
- Prior art keywords
- memory
- memory block
- virtual memory
- target sizes
- application program
- 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.)
- Active
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 13
- 238000000034 method Methods 0.000 claims abstract description 32
- 238000012545 processing Methods 0.000 claims description 25
- 238000007599 discharging Methods 0.000 claims description 2
- 238000013467 fragmentation Methods 0.000 abstract description 5
- 238000006062 fragmentation reaction Methods 0.000 abstract description 5
- 230000007246 mechanism Effects 0.000 abstract description 4
- 238000004891 communication Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 7
- 230000003287 optical effect Effects 0.000 description 4
- 230000005236 sound signal Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 2
- 238000000429 assembly Methods 0.000 description 2
- 230000000712 assembly Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000000717 retained effect Effects 0.000 description 2
- KLDZYURQCUYZBL-UHFFFAOYSA-N 2-[3-[(2-hydroxyphenyl)methylideneamino]propyliminomethyl]phenol Chemical compound OC1=CC=CC=C1C=NCCCN=CC1=CC=CC=C1O KLDZYURQCUYZBL-UHFFFAOYSA-N 0.000 description 1
- 241000209140 Triticum Species 0.000 description 1
- 235000021307 Triticum Nutrition 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 201000001098 delayed sleep phase syndrome Diseases 0.000 description 1
- 208000033921 delayed sleep phase type circadian rhythm sleep disease Diseases 0.000 description 1
- 238000000151 deposition Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000012092 media component Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 239000011800 void material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4092—Image resolution transcoding, e.g. by using client-server architectures
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
Abstract
The disclosure is directed to a kind of image processing method and devices.This method comprises: obtaining original image to display in the presumptive area on Application Program Interface;The original size and the target sizes after scaling for calculating the original image;The first memory block is obtained in the non-virtual memory of the application program according to the original size, the original image is decoded in first memory block;According to the target sizes, the decoded original image is zoomed in the second memory block for meeting the target sizes in the virtual memory of the application program, obtains the Target Photo for meeting the target sizes.The case where technical solution generates memory fragmentation when can be avoided the decoding picture in virtual memory, the number for applying for memory block in the virtual memory of application program is reduced simultaneously, to reduce the frequency of garbage reclamation mechanism, application program Caton is avoided, keeps the operation of application program more smooth.
Description
Technical field
This disclosure relates to image processing technology more particularly to a kind of image processing method and device.
Background technique
In the related technology, in the application development based on Android platform, picture is the biggest factor of committed memory always
One of.When some region on Application Program Interface needs to show picture, in most cases, the size of the display area is big
Small inconsistent with picture, this just needs application program to generate the picture met the size requirements in memory.Meet size in generation
It is required that picture when, it is necessary first to apply for a interim memory block in application program memory, to decode original image, then
Apply for a new memory block again, decoded original image is zoomed in new memory block, finally obtains and meet size and want
The picture asked, and shown on the display area of application program.However, will result in when the interim memory block of application is more
Contain a large amount of memory fragmentation in virtual memory where application program, and then virtual memory is caused to increase comparatively fast and under utilization rate
Drop.
Summary of the invention
The embodiment of the present disclosure provides a kind of image processing method and device.The technical solution is as follows:
According to the first aspect of the embodiments of the present disclosure, a kind of image processing method is provided, comprising:
Obtain original image to display in the presumptive area on Application Program Interface;
The original size and the target sizes after scaling for calculating the original image;
The first memory block is obtained in the non-virtual memory of the application program according to the original size, it will be described original
Picture is decoded in first memory block;
According to the target sizes, the decoded original image is zoomed in the virtual memory of the application program
Meet in the second memory block of the target sizes, obtains the Target Photo for meeting the target sizes.
The technical scheme provided by this disclosed embodiment can include the following benefits:
Above-mentioned technical proposal contracts by decoding original image in the non-virtual memory of application program, and by original image
The case where being put into the virtual memory of application program, generating memory fragmentation when can be avoided the decoding picture in virtual memory, together
When reduce the number for applying for memory block in the virtual memory of application program, to reduce the frequency of garbage reclamation mechanism,
Application program Caton is avoided, keeps the operation of application program more smooth.
In one embodiment, the method also includes:
Judge in the virtual memory whether to include the second memory block for meeting the target sizes;
When the second memory block in the virtual memory comprising meeting the target sizes, execution will be described decoded
Original image zooms to the step met in the second memory block of the target sizes in the virtual memory of the application program;
When not including the second memory block for meeting the target sizes in the virtual memory, in the virtual memory
Application meets the second memory block of the target sizes.
In the embodiment, before scaling original image, it need to first determine whether big comprising meeting target in virtual memory
The second small memory block, and only in virtual memory do not include meet target sizes the second memory block when just apply for scaling
The memory block of original image, so that without applying for virtual memory every time when scaling pictures, to reduce the workload of terminal.
In one embodiment, the method also includes:
Judge in the virtual memory with the presence or absence of remaining space;
When there are when remaining space, retaining second memory block in the virtual memory.
In the embodiment, by retaining the second memory block so that application program again scaling pictures when, if the picture
Target sizes match with the second memory block, then no longer need to apply for new memory block in virtual memory, to reduce terminal
Workload, while avoiding repeating to apply in virtual memory the memory block of same size.
In one embodiment, the method also includes:
When remaining space is not present in the virtual memory, the third for meeting preset condition in the virtual memory is obtained
Memory block;
The third memory block is discharged, and retains second memory block;
The preset condition comprises at least one of the following:
Access times are lower than preset threshold;
Frequency of use is lower than predeterminated frequency;
Duration between the time that the last time uses and current time is greater than preset duration.
In the embodiment, in the case where there is no remaining space in virtual memory, retained by release third memory block
Second memory block enables the lower memory block of utilization rate in virtual memory to be released in time, to avoid useless memory
Block occupies the case where virtual memory, improves the utilization rate of virtual memory.
In one embodiment, described whether to judge in the virtual memory comprising meeting in the second of the target sizes
Counterfoil, comprising:
All memory blocks in the virtual memory are matched with the target sizes;
According to the matching result, judge in the virtual memory whether to include the second memory for meeting the target sizes
Block.
Whether the embodiment enables the terminal to accurately judge comprising the second memory block in virtual memory, to avoid
The memory block of application same size is repeated in virtual memory.
In one embodiment, the method also includes:
The Target Photo is shown in the presumptive area on the Application Program Interface.
According to the second aspect of an embodiment of the present disclosure, a kind of picture processing unit is provided, comprising:
First obtains module, for obtaining original image to display in the presumptive area on Application Program Interface;
Computing module, for calculate it is described first obtain module obtain original image original size and scaling after mesh
Mark size;
Decoder module, the non-virtual memory of original size for being calculated according to the computing module in the application program
The first memory block of middle acquisition, the original image is decoded in first memory block;
Zoom module, for according to the target sizes, the decoded original image of the decoder module to be zoomed to institute
It states and meets in the second memory block of the target sizes in the virtual memory of application program, obtain the mesh for meeting the target sizes
It marks on a map piece.
In one embodiment, described device further include:
First judgment module, for judging in the virtual memory whether to include the second memory for meeting the target sizes
Block;
Execution module, for determining in the virtual memory when the first judgment module comprising meeting the target sizes
The second memory block when, execute to zoom to the decoded original image in the virtual memory of the application program and meet institute
State the step in the second memory block of target sizes;
Apply for module, for meeting the target sizes when the judgment module determines not including in the virtual memory
When the second memory block, application meets the second memory block of the target sizes in the virtual memory.
In one embodiment, described device further include:
Second judgment module, for judging in the virtual memory with the presence or absence of remaining space;
Reservation module, for determining to retain in the virtual memory there are when remaining space when second judgment module
Second memory block.
In one embodiment, described device further include:
Second obtains module, for when second judgment module determining that remaining space is not present in the virtual memory
When, obtain the third memory block for meeting preset condition in the virtual memory;
Release/reservation module obtains the third memory block that module obtains for discharging described second, and retains described second
Memory block;
The preset condition comprises at least one of the following:
Access times are lower than preset threshold;
Frequency of use is lower than predeterminated frequency;
Duration between the time that the last time uses and current time is greater than preset duration.
In one embodiment, the first judgment module includes:
Matched sub-block, for matching all memory blocks in the virtual memory with the target sizes;
Judging submodule judges whether wrap in the virtual memory for the matching result according to the matched sub-block
Containing the second memory block for meeting the target sizes.
In one embodiment, described device further include:
Display module, for showing the Target Photo in the presumptive area on the Application Program Interface.
According to the third aspect of an embodiment of the present disclosure, a kind of picture processing unit is provided, comprising:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
Obtain original image to display in the presumptive area on Application Program Interface;
The original size and the target sizes after scaling for calculating the original image;
The first memory block is obtained in the non-virtual memory of the application program according to the original size, it will be described original
Picture is decoded in first memory block;
According to the target sizes, the decoded original image is zoomed in the virtual memory of the application program
Meet in the second memory block of the target sizes, obtains the Target Photo for meeting the target sizes.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not
The disclosure can be limited.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows the implementation for meeting the disclosure
Example, and together with specification for explaining the principles of this disclosure.
Fig. 1 is a kind of flow chart of image processing method shown according to an exemplary embodiment.
Fig. 2 is a kind of flow chart of image processing method shown according to an exemplary embodiment.
Fig. 3 is a kind of flow chart of image processing method shown according to an exemplary embodiment.
Fig. 4 is a kind of block diagram of picture processing unit shown according to an exemplary embodiment.
Fig. 5 is a kind of block diagram of picture processing unit shown according to an exemplary embodiment.
Fig. 6 is a kind of block diagram of picture processing unit shown according to an exemplary embodiment.
Fig. 7 is a kind of block diagram of picture processing unit shown according to an exemplary embodiment.
Fig. 8 is the block diagram of first judgment module in a kind of picture processing unit shown according to an exemplary embodiment.
Fig. 9 is a kind of block diagram of device suitable for picture processing shown according to an exemplary embodiment.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all implementations consistent with this disclosure.On the contrary, they be only with it is such as appended
The example of the consistent device and method of some aspects be described in detail in claims, the disclosure.
Fig. 1 is a kind of flow chart of image processing method shown according to an exemplary embodiment, the image processing method
For in terminal, wherein terminal can be mobile phone, computer, digital broadcast terminal, messaging devices, game control
Platform, tablet device, Medical Devices, body-building equipment, personal digital assistant etc..As shown in Figure 1, this approach includes the following steps S11-
S14。
In step s 11, original image to display in the presumptive area on Application Program Interface is obtained.
In step s 12, the original size and the target sizes after scaling for calculating original image.
Wherein, the Target Photo after scaling can be calculated according to the size of presumptive area.In one embodiment, fate
The size in domain is the target sizes after original image scaling.
In step s 13, the first memory block is obtained in the non-virtual memory of application program according to original size, it will be original
Picture is decoded in the first memory block.
In one embodiment, the memory size of the first memory block should meet the original size of original image, that is, in first
The memory size of counterfoil should be at least equal to the original size of original image.Original image is decoded to the decoding in the first memory block
Existing picture decoding process can be used in mode, and details are not described herein.
In step S14, according to target sizes, decoded original image is zoomed in the virtual memory of application program
Meet in the second memory block of target sizes, obtains the Target Photo for meeting target sizes.
In one embodiment, after executing step S14, the above method is further comprising the steps of: Target Photo is shown
In presumptive area on Application Program Interface.
The technical solution provided using the embodiment of the present disclosure, by decoding original graph in the non-virtual memory of application program
Piece, and original image is zoomed in the virtual memory of application program, generation when can be avoided the decoding picture in virtual memory
The case where memory fragmentation, while the number for applying for memory block in the virtual memory of application program is reduced, it is returned to reduce rubbish
The frequency of receipts mechanism avoids application program Caton, keeps the operation of application program more smooth.
In one embodiment, as shown in Fig. 2, the above method is also implementable for following steps S21-S27:
In the step s 21, original image to display in the presumptive area on Application Program Interface is obtained.
In step S22, the original size and the target sizes after scaling that calculate original image.
In step S23, the first memory block is obtained in the non-virtual memory of application program according to original size, it will be original
Picture is decoded in the first memory block.
In step s 24, judge in virtual memory whether to include the second memory block for meeting target sizes.If in virtual
Include the second memory block for meeting target sizes in depositing, thens follow the steps S25;If big not comprising target is met in virtual memory
The second small memory block, thens follow the steps S27.
When executing the step, whether it can judge as follows in virtual memory comprising meeting in the second of target sizes
Counterfoil: all memory blocks in virtual memory are matched with target sizes;According to matching result, judge be in virtual memory
No the second memory block comprising meeting target sizes.If the memory for meeting target sizes can be matched in virtual memory
Block then can determine comprising the second memory block in virtual memory, otherwise, it determines not including the second memory block in virtual memory.
In step s 25, according to target sizes, decoded original image is zoomed in the virtual memory of application program
Meet in the second memory block of target sizes, obtains the Target Photo for meeting target sizes.
In step S26, Target Photo is shown in the presumptive area on Application Program Interface.
In step s 27, apply for the second memory block for meeting target sizes in virtual memory.Return step S25.
In the embodiment, before scaling original image, it need to first determine whether big comprising meeting target in virtual memory
The second small memory block, and only in virtual memory do not include meet target sizes the second memory block when just apply for scaling
The memory block of original image, so that without applying for virtual memory every time when scaling pictures, to reduce the workload of terminal.
In one embodiment, after executing step S25, as shown in figure 3, the further comprising the steps of S31- of the above method
S34。
In step S31, judge in virtual memory with the presence or absence of remaining space.If existed in virtual memory remaining empty
Between, then follow the steps S32;If remaining space is not present in virtual memory, S33 is thened follow the steps.
In step s 32, retain the second memory block.
In step S33, the third memory block for meeting preset condition in virtual memory is obtained.
Wherein, preset condition comprises at least one of the following: access times are lower than preset threshold, frequency of use lower than default frequency
Duration between rate, the last time used and current time is greater than preset duration.
In step S34, third memory block is discharged, and retain the second memory block.
In the embodiment, by retaining the second memory block so that application program again scaling pictures when, if the picture
Target sizes match with the second memory block, then no longer need to apply for new memory block in virtual memory, to reduce terminal
Workload, while avoiding repeating to apply in virtual memory the memory block of same size.In addition, without remaining empty in virtual memory
Between in the case where, the second memory block is retained by release third memory block, so that the lower memory of utilization rate in virtual memory
Block can be released in time, so that the case where avoiding useless memory block from occupying virtual memory, improves the utilization rate of virtual memory.
In any of the above-described embodiment, after original image is zoomed in virtual memory, in releasable non-virtual memory
For decoding the first memory block of original image, so that the first memory block in non-virtual memory be enable to be cleared up in time, keep away
Exempt from the case where useless memory block occupies non-virtual memory.
Following is embodiment of the present disclosure, can be used for executing embodiments of the present disclosure.
Fig. 4 is a kind of block diagram of picture processing unit shown according to an exemplary embodiment, which can be by soft
Part, hardware or both are implemented in combination with as some or all of of electronic equipment.Referring to Fig. 4, the picture processing unit packet
Include the first acquisition module 401, computing module 402, decoder module 403 and Zoom module 404;Wherein:
First acquisition module 401 is configured as obtaining original graph to display in the presumptive area on Application Program Interface
Piece.
Computing module 402 is configured as calculating the first original size and scaling for obtaining the original image that module 401 obtains
Target sizes afterwards.
Wherein, the Target Photo after scaling can be calculated according to the size of presumptive area.In one embodiment, fate
The size in domain is the target sizes after original image scaling.
Decoder module 403 is configured as the original size calculated according to computing module 402 in the non-virtual interior of application program
The first memory block of middle acquisition is deposited, original image is decoded in the first memory block.
In one embodiment, the memory size of the first memory block should meet the original size of original image, that is, in first
The memory size of counterfoil should be at least equal to the original size of original image.Original image is decoded in first by decoder module 403
Existing picture decoding process can be used in decoding process in counterfoil, and details are not described herein.
Zoom module 404 is configured as zooming to the decoded original image of decoder module 403 according to target sizes and answering
With in the second memory block for meeting target sizes in the virtual memory of program, the Target Photo for meeting target sizes is obtained.
The device provided using the embodiment of the present disclosure, is solved in the non-virtual memory of application program by decoder module 403
Code original image, and zoomed to original image in the virtual memory of application program by Zoom module 404, it can be avoided in void
The case where generating memory fragmentation when decoding picture in quasi- memory, while reducing and applying for memory block in the virtual memory of application program
Number avoid application program Caton to reduce the frequency of garbage reclamation mechanism, flow the operation of application program more
Freely.
In one embodiment, as shown in figure 5, above-mentioned apparatus further includes first judgment module 405,406 and of execution module
Apply for module 407;Wherein:
First judgment module 405 is configured as judging in virtual memory whether including the second memory for meeting target sizes
Block.
Execution module 406 is configured as determining in virtual memory when first judgment module 405 comprising meeting target sizes
When the second memory block, executes and decoded original image is zoomed in the virtual memory of application program to meet target sizes the
Step in two memory blocks.
Application module 407 is configured as meeting target sizes when first judgment module 405 determines not including in virtual memory
The second memory block when, application meets the second memory block of target sizes in virtual memory.
In the embodiment, before scaling original image, first judgment module 405 need to first determine whether in virtual memory whether
The second memory block comprising meeting target sizes, and only in virtual memory do not include meet target sizes the second memory block when
The memory block for scaling original image is just applied for by application module 407, so that virtual without application every time when scaling pictures
Memory, to reduce the workload of terminal.
In one embodiment, as shown in fig. 6, above-mentioned apparatus further includes the second judgment module 408 and reservation module 409;
Wherein:
Second judgment module 408 is configured as judging in virtual memory with the presence or absence of remaining space.
Reservation module 409 is configured as determining to retain in virtual memory there are when remaining space when the second judgment module 408
Second memory block.
In the embodiment, by reservation module 409 retain the second memory block so that application program again scaling pictures when,
If the target sizes of the picture match with the second memory block, no longer need to apply for new memory block in virtual memory, from
And the workload of terminal is reduced, while avoiding repeating to apply in virtual memory the memory block of same size.
In one embodiment, as shown in fig. 7, above-mentioned apparatus further includes the second acquisition module 410 and release/reservation module
411;Wherein:
Second acquisition module 410 is configured as determining that there is no remaining spaces in virtual memory when the second judgment module 408
When, obtain the third memory block for meeting preset condition in virtual memory.
Release/reservation module 411 is configured as release second and obtains the third memory block that module 410 obtains, and retains the
Two memory blocks;
Wherein, preset condition comprises at least one of the following:
Access times are lower than preset threshold;
Frequency of use is lower than predeterminated frequency;
Duration between the time that the last time uses and current time is greater than preset duration.
In the embodiment, in the case where there is no remaining space in virtual memory, discharged by release/reservation module 411
Third memory block retains the second memory block, and the lower memory block of utilization rate in virtual memory is released in time, from
And the case where avoiding useless memory block from occupying virtual memory, improve the utilization rate of virtual memory.
In one embodiment, as shown in figure 8, first judgment module 405 includes matched sub-block 4051 and judges submodule
Block 4052;Wherein:
Matched sub-block 4051 is configured as matching all memory blocks in virtual memory with target sizes.
Judging submodule 4052 is configured as the matching result according to matched sub-block 4051, judge in virtual memory whether
The second memory block comprising meeting target sizes.
If matched sub-block 4051 can match the memory block for meeting target sizes in virtual memory, can determine
It include the second memory block in virtual memory, otherwise, it determines not including the second memory block in virtual memory.
In one embodiment, above-mentioned apparatus further includes display module, which is configured as showing Target Photo
Show in the presumptive area on Application Program Interface.
In the exemplary embodiment, a kind of picture processing unit is provided, comprising:
Processor;
Memory for storage processor executable instruction;
Wherein, processor is configured as:
Obtain original image to display in the presumptive area on Application Program Interface;
The original size and the target sizes after scaling for calculating the original image;
The first memory block is obtained in the non-virtual memory of the application program according to the original size, it will be described original
Picture is decoded in first memory block;
According to the target sizes, the decoded original image is zoomed in the virtual memory of the application program
Meet in the second memory block of the target sizes, obtains the Target Photo for meeting the target sizes.
Above-mentioned processor is also configured to:
Judge in the virtual memory whether to include the second memory block for meeting the target sizes;
When the second memory block in the virtual memory comprising meeting the target sizes, execution will be described decoded
Original image zooms to the step met in the second memory block of the target sizes in the virtual memory of the application program;
When not including the second memory block for meeting the target sizes in the virtual memory, in the virtual memory
Application meets the second memory block of the target sizes.
Above-mentioned processor is also configured to:
Judge in the virtual memory with the presence or absence of remaining space;
When there are when remaining space, retaining second memory block in the virtual memory.
Above-mentioned processor is also configured to:
When remaining space is not present in the virtual memory, the third for meeting preset condition in the virtual memory is obtained
Memory block;
The third memory block is discharged, and retains second memory block;
The preset condition comprises at least one of the following:
Access times are lower than preset threshold;
Frequency of use is lower than predeterminated frequency;
Duration between the time that the last time uses and current time is greater than preset duration.
Above-mentioned processor is also configured to:
All memory blocks in the virtual memory are matched with the target sizes;
According to the matching result, judge in the virtual memory whether to include the second memory for meeting the target sizes
Block.
Above-mentioned processor is also configured to:
The Target Photo is shown in the presumptive area on the Application Program Interface.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method
Embodiment in be described in detail, no detailed explanation will be given here.
Fig. 9 is a kind of block diagram of device for picture processing shown according to an exemplary embodiment.For example, device
1200 can be mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical treatment
Equipment, body-building equipment, personal digital assistant etc..
Device 1200 may include following one or more components: processing component 1202, memory 1204, power supply module
1206, multimedia component 1208, audio component 1210, the interface 1212 of input/output (I/O), sensor module 1214, and
Communication component 1216.
The integrated operation of the usual control device 1200 of processing component 1202, such as with display, telephone call, data communication,
Camera operation and record operate associated operation.Processing component 1202 may include one or more processors 1220 to execute
Instruction, to perform all or part of the steps of the methods described above.In addition, processing component 1202 may include one or more moulds
Block, convenient for the interaction between processing component 1202 and other assemblies.For example, processing component 1202 may include multi-media module,
To facilitate the interaction between multimedia component 1208 and processing component 1202.
Memory 1204 is configured as storing various types of data to support the operation in device 1200.These data
Example includes the instruction of any application or method for operating on device 1200, contact data, telephone book data,
Message, picture, video etc..Memory 1204 can by any kind of volatibility or non-volatile memory device or they
Combination is realized, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), it is erasable can
Program read-only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash memory
Reservoir, disk or CD.
Power supply module 1206 provides electric power for the various assemblies of device 1200.Power supply module 1206 may include power management
System, one or more power supplys and other with for device 1200 generate, manage, and distribute the associated component of electric power.
Multimedia component 1208 includes the screen of one output interface of offer between described device 1200 and user.?
In some embodiments, screen may include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel,
Screen may be implemented as touch screen, to receive input signal from the user.Touch panel includes that one or more touch passes
Sensor is to sense the gesture on touch, slide, and touch panel.The touch sensor can not only sense touch or sliding is dynamic
The boundary of work, but also detect duration and pressure associated with the touch or slide operation.In some embodiments, more
Media component 1208 includes a front camera and/or rear camera.When device 1200 is in operation mode, as shot mould
When formula or video mode, front camera and/or rear camera can receive external multi-medium data.Each preposition camera shooting
Head and rear camera can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio component 1210 is configured as output and/or input audio signal.For example, audio component 1210 includes a wheat
Gram wind (MIC), when device 1200 is in operation mode, when such as call mode, recording mode, and voice recognition mode, microphone quilt
It is configured to receive external audio signal.The received audio signal can be further stored in memory 1204 or via communication
Component 1216 is sent.In some embodiments, audio component 1210 further includes a loudspeaker, is used for output audio signal.
I/O interface 1212 provides interface, above-mentioned peripheral interface module between processing component 1202 and peripheral interface module
It can be keyboard, click wheel, button etc..These buttons may include, but are not limited to: home button, volume button, start button and
Locking press button.
Sensor module 1214 includes one or more sensors, and the state for providing various aspects for device 1200 is commented
Estimate.For example, sensor module 1214 can detecte the state that opens/closes of device 1200, the relative positioning of component, such as institute
The display and keypad that component is device 1200 are stated, sensor module 1214 can be with detection device 1200 or device 1,200 1
The position change of a component, the existence or non-existence that user contacts with device 1200,1200 orientation of device or acceleration/deceleration and dress
Set 1200 temperature change.Sensor module 1214 may include proximity sensor, be configured in not any physics
It is detected the presence of nearby objects when contact.Sensor module 1214 can also include optical sensor, as CMOS or ccd image are sensed
Device, for being used in imaging applications.In some embodiments, which can also include acceleration sensing
Device, gyro sensor, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 1216 is configured to facilitate the communication of wired or wireless way between device 1200 and other equipment.Dress
The wireless network based on communication standard, such as WiFi can be accessed by setting 1200,2G or 3G or their combination.It is exemplary at one
In embodiment, communication component 1216 receives broadcast singal or broadcast correlation from external broadcasting management system via broadcast channel
Information.In one exemplary embodiment, the communication component 1216 further includes near-field communication (NFC) module, to promote short distance
Communication.For example, radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band can be based in NFC module
(UWB) technology, bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, device 1200 can be by one or more application specific integrated circuit (ASIC), number
Signal processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array
(FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for executing the above method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided
It such as include the memory 1204 of instruction, above-metioned instruction can be executed by the processor 1220 of device 1200 to complete the above method.Example
Such as, the non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, soft
Disk and optical data storage devices etc..
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is by the processing of device 1200
When device executes, so that device 1200 is able to carry out above-mentioned image processing method, which comprises
Obtain original image to display in the presumptive area on Application Program Interface;
The original size and the target sizes after scaling for calculating the original image;
The first memory block is obtained in the non-virtual memory of the application program according to the original size, it will be described original
Picture is decoded in first memory block;
According to the target sizes, the decoded original image is zoomed in the virtual memory of the application program
Meet in the second memory block of the target sizes, obtains the Target Photo for meeting the target sizes.
The method also includes:
Judge in the virtual memory whether to include the second memory block for meeting the target sizes;
When the second memory block in the virtual memory comprising meeting the target sizes, execution will be described decoded
Original image zooms to the step met in the second memory block of the target sizes in the virtual memory of the application program;
When not including the second memory block for meeting the target sizes in the virtual memory, in the virtual memory
Application meets the second memory block of the target sizes.
The method also includes:
Judge in the virtual memory with the presence or absence of remaining space;
When there are when remaining space, retaining second memory block in the virtual memory.
The method also includes:
When remaining space is not present in the virtual memory, the third for meeting preset condition in the virtual memory is obtained
Memory block;
The third memory block is discharged, and retains second memory block;
The preset condition comprises at least one of the following:
Access times are lower than preset threshold;
Frequency of use is lower than predeterminated frequency;
Duration between the time that the last time uses and current time is greater than preset duration.
It is described to judge in the virtual memory whether to include the second memory block for meeting the target sizes, comprising:
All memory blocks in the virtual memory are matched with the target sizes;
According to the matching result, judge in the virtual memory whether to include the second memory for meeting the target sizes
Block.
The method also includes:
The Target Photo is shown in the presumptive area on the Application Program Interface.
Those skilled in the art will readily occur to other realities of the disclosure after considering specification and practicing disclosure herein
Apply scheme.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or suitable
The variation of answering property follows the general principles of this disclosure and including the undocumented common knowledge in the art of the disclosure or used
Use technological means.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are by following right
It is required that pointing out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by the accompanying claims.
Claims (14)
1. a kind of image processing method characterized by comprising
Obtain original image to display in the presumptive area on Application Program Interface;
The original size and the target sizes after scaling for calculating the original image;
The first memory block is obtained in the non-virtual memory of the application program according to the original size, by the original image
It is decoded in first memory block;
According to the target sizes, the decoded original image is zoomed in the virtual memory of the application program and met
In second memory block of the target sizes, the Target Photo for meeting the target sizes is obtained.
2. the method according to claim 1, wherein the method also includes:
Judge in the virtual memory whether to include the second memory block for meeting the target sizes;
When the second memory block in the virtual memory comprising meeting the target sizes, execution will be described decoded original
Picture zooms to the step met in the second memory block of the target sizes in the virtual memory of the application program;
When not including the second memory block for meeting the target sizes in the virtual memory, apply in the virtual memory
Meet the second memory block of the target sizes.
3. according to the method described in claim 2, it is characterized in that, the method also includes:
Judge in the virtual memory with the presence or absence of remaining space;
When there are when remaining space, retaining second memory block in the virtual memory.
4. according to the method described in claim 3, it is characterized in that, the method also includes:
When remaining space is not present in the virtual memory, the third memory for meeting preset condition in the virtual memory is obtained
Block;
The third memory block is discharged, and retains second memory block;
The preset condition comprises at least one of the following:
Access times are lower than preset threshold;
Frequency of use is lower than predeterminated frequency;
Duration between the time that the last time uses and current time is greater than preset duration.
5. according to the method described in claim 2, it is characterized in that, whether described judge in the virtual memory comprising meeting institute
State the second memory block of target sizes, comprising:
All memory blocks in the virtual memory are matched with the target sizes;
According to the matching result, judge in the virtual memory whether to include the second memory block for meeting the target sizes.
6. method according to claim 1-5, which is characterized in that the method also includes:
The Target Photo is shown in the presumptive area on the Application Program Interface.
7. a kind of picture processing unit characterized by comprising
First obtains module, for obtaining original image to display in the presumptive area on Application Program Interface;
Computing module, for calculate it is described first obtain module obtain original image original size and scaling after target it is big
It is small;
Decoder module, the original size for being calculated according to the computing module obtain in the non-virtual memory of the application program
The first memory block is taken, the original image is decoded in first memory block;
Zoom module, for according to the target sizes, the decoded original image of the decoder module to be zoomed to described answer
With in the second memory block for meeting the target sizes in the virtual memory of program, the target figure for meeting the target sizes is obtained
Piece.
8. device according to claim 7, which is characterized in that described device further include:
First judgment module, for judging in the virtual memory whether to include the second memory block for meeting the target sizes;
Execution module, for determining in the virtual memory when the first judgment module comprising meeting the of the target sizes
When two memory blocks, executes in the virtual memory that the decoded original image is zoomed to the application program and meet the mesh
Mark the step in the second memory block of size;
Apply for module, for meeting the second of the target sizes when the judgment module determines not including in the virtual memory
When memory block, application meets the second memory block of the target sizes in the virtual memory.
9. device according to claim 8, which is characterized in that described device further include:
Second judgment module, for judging in the virtual memory with the presence or absence of remaining space;
Reservation module, for determining in the virtual memory there are when remaining space, described in reservation when second judgment module
Second memory block.
10. device according to claim 9, which is characterized in that described device further include:
Second obtains module, for obtaining when second judgment module determines that remaining space is not present in the virtual memory
Take the third memory block for meeting preset condition in the virtual memory;
Release/reservation module obtains the third memory block that module obtains for discharging described second, and retains second memory
Block;
The preset condition comprises at least one of the following:
Access times are lower than preset threshold;
Frequency of use is lower than predeterminated frequency;
Duration between the time that the last time uses and current time is greater than preset duration.
11. device according to claim 8, which is characterized in that the first judgment module includes:
Matched sub-block, for matching all memory blocks in the virtual memory with the target sizes;
Whether judging submodule judges in the virtual memory for the matching result according to the matched sub-block comprising symbol
Close the second memory block of the target sizes.
12. according to the described in any item devices of claim 7-11, which is characterized in that described device further include:
Display module, for showing the Target Photo in the presumptive area on the Application Program Interface.
13. a kind of picture processing unit characterized by comprising
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
Obtain original image to display in the presumptive area on Application Program Interface;
The original size and the target sizes after scaling for calculating the original image;
The first memory block is obtained in the non-virtual memory of the application program according to the original size, by the original image
It is decoded in first memory block;
According to the target sizes, the decoded original image is zoomed in the virtual memory of the application program and met
In second memory block of the target sizes, the Target Photo for meeting the target sizes is obtained.
14. a kind of computer readable storage medium, is stored thereon with computer instruction, which is characterized in that the instruction is by processor
The step of any one of the claims 1-6 the method is realized when execution.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610355530.7A CN105957011B (en) | 2016-05-25 | 2016-05-25 | Image processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610355530.7A CN105957011B (en) | 2016-05-25 | 2016-05-25 | Image processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105957011A CN105957011A (en) | 2016-09-21 |
CN105957011B true CN105957011B (en) | 2019-05-21 |
Family
ID=56909862
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610355530.7A Active CN105957011B (en) | 2016-05-25 | 2016-05-25 | Image processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105957011B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107506119B (en) * | 2017-08-10 | 2020-11-03 | 广州视源电子科技股份有限公司 | Picture display method, device, equipment and storage medium |
CN108228050B (en) * | 2017-12-13 | 2021-01-22 | 创新先进技术有限公司 | Picture scaling method and device and electronic equipment |
CN112988609B (en) * | 2019-12-02 | 2023-05-02 | 杭州海康机器人股份有限公司 | Data processing method, device, storage medium and client |
CN112565771B (en) * | 2020-11-30 | 2024-08-02 | 博泰车联网科技(上海)股份有限公司 | Picture compression method and device, electronic equipment and medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1670766A (en) * | 2004-03-17 | 2005-09-21 | 德鑫科技股份有限公司 | Image zooming method |
CN101212660A (en) * | 2006-12-29 | 2008-07-02 | 安凯(广州)软件技术有限公司 | Sectionalized image decoding method |
CN102012870A (en) * | 2010-11-18 | 2011-04-13 | 清华大学 | Memory allocation method |
CN102123259A (en) * | 2010-12-28 | 2011-07-13 | 四川长虹电器股份有限公司 | Method for displaying extra-large-resolution pictures on television |
CN104952037A (en) * | 2014-03-27 | 2015-09-30 | 联科集团(中国)有限公司 | Method and system for rescaling image files |
CN105335442A (en) * | 2014-08-13 | 2016-02-17 | 优视科技有限公司 | Picture memory processing method and apparatus |
KR20160052240A (en) * | 2014-11-04 | 2016-05-12 | 삼성전자주식회사 | Method and apparatus for managing a plurality of memory devices |
-
2016
- 2016-05-25 CN CN201610355530.7A patent/CN105957011B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1670766A (en) * | 2004-03-17 | 2005-09-21 | 德鑫科技股份有限公司 | Image zooming method |
CN101212660A (en) * | 2006-12-29 | 2008-07-02 | 安凯(广州)软件技术有限公司 | Sectionalized image decoding method |
CN102012870A (en) * | 2010-11-18 | 2011-04-13 | 清华大学 | Memory allocation method |
CN102123259A (en) * | 2010-12-28 | 2011-07-13 | 四川长虹电器股份有限公司 | Method for displaying extra-large-resolution pictures on television |
CN104952037A (en) * | 2014-03-27 | 2015-09-30 | 联科集团(中国)有限公司 | Method and system for rescaling image files |
CN105335442A (en) * | 2014-08-13 | 2016-02-17 | 优视科技有限公司 | Picture memory processing method and apparatus |
KR20160052240A (en) * | 2014-11-04 | 2016-05-12 | 삼성전자주식회사 | Method and apparatus for managing a plurality of memory devices |
Also Published As
Publication number | Publication date |
---|---|
CN105957011A (en) | 2016-09-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3301559B1 (en) | Content sharing method and device | |
CN106572299B (en) | Camera opening method and device | |
CN106547663B (en) | Key management method and device | |
EP3136391B1 (en) | Method, device and terminal device for video effect processing | |
KR101819985B1 (en) | Method, device, program and computer-readable recording medium for controlling application | |
KR101952486B1 (en) | Video categorization method and apparatus | |
EP3046212B1 (en) | Method and apparatus for controlling charging of terminal device | |
CN106034170B (en) | Group's generation method and device | |
CN105487680B (en) | Method, apparatus and terminal for terminal screenshotss | |
CN106527882A (en) | Content sharing method, device and terminal | |
RU2664674C2 (en) | Method and apparatus for creating a panorama | |
CN105957011B (en) | Image processing method and device | |
CN104361558B (en) | Image processing method, device and equipment | |
CN107820006A (en) | Control the method and device of camera shooting | |
EP3435218A1 (en) | Method and device for displaying application, and storage medium | |
EP3905660A1 (en) | Method and device for shooting image, and storage medium | |
CN104809744A (en) | Method and device for processing pictures | |
CN105323491A (en) | Image shooting method and device | |
CN106228077B (en) | It handles image and shows the method, apparatus and terminal of image | |
US10671827B2 (en) | Method and device for fingerprint verification | |
CN106447747B (en) | Image processing method and device | |
CN106980449A (en) | Image switches the rendering method and device of transition effect | |
CN107832112B (en) | Wallpaper setting method and device | |
CN107885464B (en) | Data storage method, device and computer readable storage medium | |
CN112423092A (en) | Video recording method and video recording 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |