CN107592450B - Media data processing method and device - Google Patents

Media data processing method and device Download PDF

Info

Publication number
CN107592450B
CN107592450B CN201710769051.4A CN201710769051A CN107592450B CN 107592450 B CN107592450 B CN 107592450B CN 201710769051 A CN201710769051 A CN 201710769051A CN 107592450 B CN107592450 B CN 107592450B
Authority
CN
China
Prior art keywords
media data
resolution
media
frame buffer
frame
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
Application number
CN201710769051.4A
Other languages
Chinese (zh)
Other versions
CN107592450A (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.)
Zhuhai Seal Interest Technology Co Ltd
Original Assignee
Zhuhai Baoqu 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 Zhuhai Baoqu Technology Co Ltd filed Critical Zhuhai Baoqu Technology Co Ltd
Priority to CN201710769051.4A priority Critical patent/CN107592450B/en
Publication of CN107592450A publication Critical patent/CN107592450A/en
Application granted granted Critical
Publication of CN107592450B publication Critical patent/CN107592450B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The embodiment of the invention discloses a media data processing method and a device, wherein the media data processing method comprises the following steps: if a preview instruction is detected, creating a first frame cache, wherein the first frame cache is used for drawing the media data with a first resolution; acquiring first media data, wherein the first media data is the first resolution; drawing the first media data in the first frame cache, and displaying preview media corresponding to the first media data in the first frame cache; if a media generation instruction is detected, creating a second frame buffer, wherein the second frame buffer is used for drawing media data with a second resolution, and the second resolution is greater than the first resolution; acquiring second media data, wherein the second media data is the second resolution; and drawing the second media data in the second frame buffer, and generating a target media according to the second media data in the second frame buffer. By adopting the embodiment of the invention, the quality of the image can be improved under the condition of effectively ensuring the image processing speed.

Description

Media data processing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing media data.
Background
With the continuous development of computer technology, more and more applications are applied to the mobile terminal, wherein media applications commonly found on the mobile terminal are applications for taking pictures and/or applications for recording videos. The media application collects media data through the camera in the running process, and performs various functional processing on the media data. At present, the resolution of a camera of a mobile terminal supports 720p and 1080p, but since the media application is limited by the performance of an internal processor when performing function processing on media data, media data with a smaller resolution is usually selected, and the quality of the media is poorer. For example, when a photographing application performs various functional processes using an Open Graphics Library (OpenGL), the performance of a Graphics Processing Unit (GPU) is limited, and therefore the resolution of a selected camera is 720p, so that the resolution of an image viewed by a user in a preview stage is only 720p, and the resolution of an image captured in an image generation stage is only 720p, which reduces the quality of the image while ensuring a faster Processing speed.
Disclosure of Invention
The embodiment of the invention provides a method and a device for processing media data, electronic equipment and a storage medium, which can improve the quality of generated media under the condition of effectively ensuring the processing speed.
In a first aspect, an embodiment of the present invention provides a method for processing media data, including:
if a preview instruction is detected, creating a first frame cache, wherein the first frame cache is used for drawing the media data with a first resolution;
acquiring first media data, wherein the first media data is the first resolution;
drawing the first media data in the first frame cache, and displaying preview media corresponding to the first media data in the first frame cache;
if a photographing instruction is detected, creating a second frame buffer, wherein the second frame buffer is used for drawing media data with a second resolution, and the second resolution is greater than the first resolution;
acquiring second media data, wherein the second media data is the second resolution;
and drawing the second media data in the second frame buffer, and generating a target media according to the second media data in the second frame buffer.
In one possible design, the obtaining first media data includes:
acquiring third media data acquired by a camera, wherein the third media data is a third resolution, and the third resolution is greater than the first resolution;
and compressing the third media data to obtain the first media data.
In one possible design, the third resolution is the same as the second resolution.
In one possible design, before the drawing the first media data in the first frame buffer and displaying the preview media corresponding to the first media data in the first frame buffer, the method further includes:
performing target function processing on the first media data;
the drawing the first media data in the first frame cache and displaying the preview media corresponding to the first media data in the first frame cache includes:
drawing the first media data after the target function processing in the first frame cache, and displaying preview media corresponding to the first media data after the target function processing in the first frame cache.
In one possible design, before the drawing the second media data in the second frame buffer and generating the target media according to the second media data in the second frame buffer, the method further includes:
performing the target function processing on the second media data;
the drawing the second media data in the second frame buffer, and generating a target media according to the second media data in the second frame buffer, includes:
and drawing the second media data subjected to the target function processing in the second frame cache, and generating a target media according to the second media data subjected to the target function processing in the second frame cache.
In one possible design, the displaying the preview media corresponding to the first media data in the first frame buffer includes:
adjusting the resolution of the display area to the first resolution;
and displaying the preview media corresponding to the first media data in the first frame cache in the adjusted display area.
In a second aspect, an embodiment of the present invention provides a media data processing apparatus, including:
the device comprises a first creating module, a second creating module and a third creating module, wherein the first creating module is used for creating a first frame cache if a preview instruction is detected, and the first frame cache is used for drawing media data with a first resolution;
a first obtaining module, configured to obtain first media data, where the first media data is the first resolution;
the first drawing module is used for drawing the first media data in the first frame buffer;
the display module is used for displaying preview media corresponding to the first media data in the first frame cache;
a second creating module, configured to create a second frame buffer if a media generation instruction is detected, where the second frame buffer is used to draw media data with a second resolution, and the second resolution is greater than the first resolution;
a second obtaining module, configured to obtain second media data, where the second media data is the second resolution;
the second drawing module is used for drawing the second media data in the second frame buffer;
and the generating module is used for generating the target media according to the second media data in the second frame buffer.
In one possible design, the first obtaining module includes:
the acquisition unit is used for acquiring third media data acquired by the camera, wherein the third media data is a third resolution, and the third resolution is greater than the first resolution;
and the compression unit is used for compressing the third media data to obtain the first media data.
In one possible design, the third resolution is the same as the second resolution.
In one possible design, the apparatus further includes:
the first processing module is used for carrying out target function processing on the first media data;
the first drawing module is specifically configured to draw the first media data subjected to the target function processing in the first frame buffer;
the display module is specifically configured to display a preview media corresponding to the first media data after the target function processing is performed in the first frame buffer.
In one possible design, the apparatus further includes:
the second processing module is used for performing the target function processing on the second media data;
the second rendering module is specifically configured to render the second media data subjected to the target function processing in the second frame buffer;
the generating module is specifically configured to generate a target media according to the second media data after the target function processing is performed in the second frame buffer.
In one possible design, the display module includes:
the adjusting unit is used for adjusting the resolution of the display area to be the first resolution;
and the display unit is used for displaying the preview media corresponding to the first media data in the first frame cache in the adjusted display area.
In a third aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes: a memory, a processor and a computer program stored on the memory and executable on the processor, when executing the computer program, being adapted to perform the image processing method of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which includes instructions that, when executed on a computer, cause the computer to execute the image processing method of the first aspect.
In a fifth aspect, an embodiment of the present invention provides an application program, which includes instructions that, when executed on a computer, cause the computer to execute the image processing method of the first aspect.
When the mobile terminal detects a preview instruction, a first frame buffer of a first resolution is created, then first media data is acquired, the first media data of the first resolution is drawn in the first frame buffer, and a preview media corresponding to the first media data in the first frame buffer is displayed on the mobile terminal. According to the embodiment of the invention, the frame cache with lower resolution is created in the preview stage, and the frame cache with higher resolution is created in the media generation stage, so that the quality of generated media can be improved while the processing speed is ensured.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a media data processing method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating another media data processing method according to an embodiment of the invention;
FIG. 3 is a schematic structural diagram of a media data processing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another media data processing apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," and "third," etc. in the description and claims of the invention and in the drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The media in the embodiment of the invention includes but is not limited to images and videos. If the media is an image, the media data processing method of the embodiment of the invention can be applied to a photographing scene, a mobile terminal detects a preview instruction generated when a user opens photographing software or a photographing interface, creates a first frame cache used for drawing image data of a first resolution, acquires first image data of the first resolution again, draws the first image data in the first frame cache, displays a preview image corresponding to the first image data in the first frame cache, creates a second frame cache used for drawing image data of a second resolution if an image generation instruction generated when the user clicks a photographing button is detected, the second resolution is greater than the first resolution, acquires second image data of the second resolution again, draws the second image data in the second frame cache, and according to the second image data in the second frame cache, and generating a target picture.
If the media is a video, the media processing method of the embodiment of the invention can be applied to a recorded video scene, the mobile terminal detects a preview instruction generated when a user opens video recording software or a recording interface, creates a first frame cache used for drawing video data of a first resolution, acquires the first video data of the first resolution again, draws the first video data in the first frame cache, displays a preview video corresponding to the first video data in the first frame cache, creates a second frame cache used for drawing video data of a second resolution if a video generation instruction generated when the user clicks a start recording button is detected, the second resolution is greater than the first resolution, acquires second video data of the second resolution again, and finally draws the second video data in the second frame cache, and generating a target video according to the second video data in the second frame buffer.
In short, if the media in the embodiment of the present invention is an image, the media data is image data, the preview media is a preview image, and the target media is a target picture; if the media in the embodiment of the invention is the video, the media data is the video data, the preview media is the preview video, and the target media is the target video.
The media data processing method and apparatus provided by the embodiment of the invention will be described in detail below with reference to fig. 1 to 4.
Referring to fig. 1, which is a flowchart illustrating a media data processing method according to an embodiment of the present invention, the method according to an embodiment of the present invention may be implemented in a mobile terminal with a photographing and/or recording function, such as a mobile phone, a tablet computer, a desktop computer, and an IPAD, and as shown in the figure, the method may include, but is not limited to, the following steps:
s101, if a preview instruction is detected, the mobile terminal creates a first frame cache, and the first frame cache is used for drawing media data with a first resolution;
in the embodiment of the present invention, the media data processing process may be divided into two stages, namely, a preview stage and a media generation stage, where the preview stage may be triggered by a preview instruction and the media generation stage may be triggered by a media generation instruction.
In the embodiment of the present invention, the preview instruction may include an instruction generated by the user clicking, double-clicking, long-pressing, or the like to open the software for taking a picture or recording a video, or may include an instruction generated when the user returns to the preview interface. When the mobile terminal detects a preview instruction, the mobile terminal may create a first frame buffer on the mobile terminal by calling a library function in OpenGL, where the first frame buffer is used to draw media data with a first resolution. The media data may be image data or video data.
It should be noted that the Frame Buffer is a short-term Frame Buffer, which is a direct image of a picture displayed on a screen, and is also called a bitmap (Bit Map) or a raster, each storage unit of the Frame Buffer corresponds to a pixel point on the screen, the whole Frame Buffer corresponds to an image, and the images stored in the Frame Buffer are from Frame to Frame. The first frame buffer may be any one of a plurality of frame buffers created by the mobile terminal.
Specifically, optionally, if the mobile terminal detects the preview instruction, a first frame buffer is created, where the first frame buffer is used to draw the media data with a first resolution, and the first resolution may be any resolution, such as 720p, 1080p, or a resolution smaller than 720p, and the like, which is not limited in this embodiment of the present invention.
S102, the mobile terminal acquires first media data, wherein the first media data is the first resolution;
in the embodiment of the present invention, the resolution of the first media data is the same as the resolution of the media data used for rendering in the first frame buffer, that is, both the first and second resolutions are the first resolution. For example, the resolution of the first frame buffer for rendering is 720P, and the resolution of the first media data is 720P.
Optionally, the first media data may be media data of the target object acquired by the camera without any compression processing, that is, the resolution set by the camera is also the first resolution.
Optionally, the first media data may be media data of a target object acquired by the camera and subjected to compression processing, that is, the resolution set by the camera is greater than the first resolution. Specifically, optionally, the mobile terminal may acquire, by using the camera, third media data of a target object selected by the user, where a resolution of the third media data is a third resolution, that is, a resolution set by the camera of the mobile terminal is the third resolution, and the mobile terminal performs compression processing on the third media data acquired by the camera, for example, adjacent pixels are merged to obtain first media data of the first resolution, where it is required to say that the third resolution is greater than the first resolution. For example, the resolution of a camera of a mobile terminal is 1080p, the resolution of the camera of the mobile terminal for capturing third media data of a target object selected by a user is 1080p, and the third media data is compressed into 720p of first media data by performing compression processing such as merging adjacent pixel points on the third media data, so that the first resolution is 720p and the third resolution is 1080 p.
Optionally, the first media data may also be media data that has undergone one or more target function processes (such as skin polishing, whitening, or filtering), for example, if the resolution of the camera is set to the first resolution, the target function process is performed on the first media data of the target object acquired by the camera, and then the first media data that has undergone the target function process is rendered in the first frame buffer. Or the resolution of the camera is set to be the third resolution, and the third resolution is greater than the first resolution, then the media data of the target object acquired by the camera is compressed, and then the target function processing is performed on the compressed media data, wherein the resolution of the compressed media data is the first resolution, and the media data processed by the target function is taken as the first media data and is drawn in the first frame buffer. It should be noted that, when performing the target function processing on the media data, the resolution of the media data is not changed, that is, the first media data after the target processing is still the first resolution.
S103, the mobile terminal draws the first media data in the first frame cache and displays preview media corresponding to the first media data in the first frame cache;
in the embodiment of the invention, the mobile terminal can draw the first media data in the first frame cache through function call and display the preview media corresponding to the first media data in the first frame cache. Optionally, the resolution of the display area is adjusted to the first resolution, for example, the resolution of the viewport (viewport) is increased to the resolution of the view component, so that the first media data of the first resolution can adapt to the display requirement of the screen, and the preview media corresponding to the first media data in the first frame buffer is displayed in the adjusted display area, where the resolution of the preview media is the first resolution. The preview media may include, but is not limited to, preview pictures, preview videos, and the like. If the media data is image data, the preview media may be a preview image, and if the media data is video data, the preview media may be a preview video.
S104, if a media generation instruction is detected, the mobile terminal creates a second frame buffer, wherein the second frame buffer is used for drawing media data with a second resolution, and the second resolution is greater than the first resolution;
in the embodiment of the present invention, the media generation instruction may include an instruction generated by the operation of triggering the mobile terminal to take a picture or record a video, such as a button that a user clicks, long-presses, double-clicks to take a picture or record a video, or some gesture, voice, shortcut key, etc. that are set by the user to take a picture or record a video quickly. When the mobile terminal detects a media generation instruction, a second frame buffer can be created on the mobile terminal by calling a library function in OpenGL, and the second frame buffer is used for drawing media data with a second resolution.
Optionally, the second frame buffer corresponds to the first frame buffer, and the second frame buffer is used for drawing media data of a second resolution, where the second resolution is greater than the first resolution, for example, the first resolution is 720p, and the second resolution may be 1080 p.
S105, the mobile terminal acquires second media data, wherein the second media data is the second resolution;
in the embodiment of the present invention, the resolution of the second media data is the same as the resolution of the media data used for rendering in the second frame buffer, that is, both the second media data and the media data are the second resolution. For example, if the resolution of the media data buffered for rendering in the second frame buffer is 1080p, the resolution of the second media data is 1080 p.
Optionally, the second media data may be media data of a target object selected by the user through a camera of the mobile terminal, where the second media data is a second resolution, that is, a resolution (a third resolution in an embodiment of the present invention) set by the camera of the mobile terminal may be the same as the second resolution. For example, the resolution of a camera of the mobile terminal is 1080p, the resolution of the camera of the mobile terminal for acquiring the second media data of the target object selected by the user is 1080p, and the second resolution is 1080p, which is the same as the third resolution.
Optionally, the second media data may be media data obtained by the mobile terminal collecting media data of a target object selected by the user through a camera and performing compression processing, that is, a resolution (i.e., the third resolution in this embodiment) set by the camera is greater than the second resolution. For example, the media data of the target object acquired by the camera is 1080p, and the resolution of the 1080p media data after compression processing is 960p, that is, the second resolution is 960p, the third resolution is 1080p, and the second resolution is different from the third resolution.
Optionally, if the first media data is media data processed by a target function, the second media data may also be media data processed by the same target function. For example, the resolution of the camera is set to the third resolution, and the third resolution is the same as the second resolution, the media data of the target object acquired by the camera is subjected to the target function processing, and the media data after the target function processing is used as the second media data and is drawn in the second frame buffer. Or, the resolution of the camera is set to the third resolution, and the third resolution is greater than the second resolution, the media data of the target object acquired by the camera is compressed, and then the target function processing is performed on the compressed media data, wherein the resolution of the compressed media data is the second resolution, and the media data processed by the target function is taken as the second media data and is drawn in the second frame buffer. It should be noted that, when the target function processing is performed on the media data, the resolution of the media data is not changed, that is, the second media data processed by the target function is still at the second resolution.
And S106, the mobile terminal draws the second media data in the second frame buffer, and generates the target media according to the second media data in the second frame buffer.
In the embodiment of the present invention, the mobile terminal may draw the second media data in the second frame buffer through function call, and generate the target media according to the second media data in the second frame buffer, where the resolution of the target media is the second resolution, and the second resolution is greater than the first resolution, that is, the resolution of the target media is greater than the resolution of the preview media, so that the high processing speed in the process of previewing the media is ensured, and the quality of the target media is also ensured. The target media can be a target picture or a target video, etc. If the media data is image data, the target media may be a target picture, and if the media data is video data, the target media may be a target video.
Optionally, after the target media is generated, the mobile terminal may change the resolution of the display area to the second resolution, for example, change the resolution of the viewport to the second resolution, and display the target media in the display area of the second resolution. After the target media is displayed, the resolution of the display area may also be adjusted, such as changing the resolution of the viewport back to the first resolution.
In the embodiment of the present invention, when a mobile terminal detects a preview instruction, a first frame buffer of a first resolution is created, and then first media data is acquired, the first media data of the first resolution is drawn to the first frame buffer, and a preview media corresponding to the first media data in the first frame buffer is displayed on the mobile terminal. According to the embodiment of the invention, the frame cache with lower resolution is created in the preview stage, and the frame cache with higher resolution is created in the media generation stage, so that the quality of generated media can be improved while the processing speed is ensured.
Referring to fig. 2, a flow chart of another media data processing method according to an embodiment of the present invention is shown, where the method according to the embodiment of the present invention may be implemented in a mobile terminal with a photographing and/or recording function, such as a mobile phone, a tablet computer, a desktop computer, and an IPAD, and as shown in the figure, the method may include, but is not limited to, the following steps:
s201, if a preview instruction is detected, the mobile terminal creates a first frame cache, and the first frame cache is used for drawing media data with a first resolution;
s202, the mobile terminal acquires first media data, wherein the first media data is the first resolution;
steps S201 to S202 in the embodiment of the present invention refer to steps S101 to S102 in the embodiment of fig. 1, and are not described herein again.
S203, the mobile terminal performs target function processing on the first media data;
s204, the mobile terminal draws the first media data subjected to the target function processing in the first frame cache, and displays preview media corresponding to the first media data subjected to the target function processing in the first frame cache;
optionally, the target function processing may be any one of functional processing such as buffing, whitening, blurring a background, and adding a filter, and the resolution of the first media data after the target function processing is still the first resolution.
Optionally, the mobile terminal may create at least one frame buffer according to a requirement of the function processing, where one frame buffer may correspond to one function processing, and the at least one frame buffer may be in a cascade relationship, that is, media data of a previous frame buffer is input to a next frame buffer after being subjected to target function processing corresponding to the next frame buffer.
Optionally, if the first frame buffer is a first frame buffer in at least one frame buffer in cascade connection, the first media data may be media data acquired by a camera after being compressed, or media data acquired by the camera without being compressed; if the first frame buffer is not the first frame buffer, such as the second or third frame buffer, etc., of at least one frame buffer in the cascade, the first media data may be the media data drawn in the frame buffer before the first frame buffer. It should be noted that the resolution of the first media data is the first resolution, and the first frame buffer is also used for rendering the media data with the first resolution.
Optionally, each of the at least one frame buffer may be created when an operation instruction of a user is detected, for example, when an operation instruction (for example, a user clicks a whitening button) for instructing to perform a certain function process is detected, a frame buffer corresponding to the function process is created, media data drawn in a last frame buffer of the frame buffer corresponding to the function process is subjected to the function process, the media data subjected to the function process is drawn in the frame buffer corresponding to the function process, and a preview media corresponding to the media data in the frame buffer is further output, that is, a whitened preview media is output.
Optionally, each frame buffer in the at least one frame buffer may be automatically created according to a function process set by the system, for example, if the function process set by the system includes whitening and peeling, two frame buffers are created, and each frame buffer corresponds to one function process. The cascade relation of the at least one frame buffer may be a fixed order set inside the system, or may be a randomly generated order, and it should be noted that the cascade relation of the at least one frame buffer determines a processing order of the media data. The first frame buffer may be any frame buffer of the at least one frame buffer frame, and the system outputs the preview media corresponding to the media data drawn in the frame buffer corresponding to each function process.
If the cascade relation of the at least one frame buffer is a fixed sequence set in the system, the sequence of the function processing corresponding to the at least one frame buffer is the same when the mobile terminal performs the function processing each time. For example, when a preview instruction is detected for the first time, the sequence of function processing corresponding to at least one cascaded frame buffer is skin grinding and whitening; when the preview instruction is detected for the second time, the sequence of function processing corresponding to at least one cascaded frame cache is still skin grinding and whitening; when the preview instruction is detected for the nth time (any time), the function processing sequence corresponding to at least one cascaded frame buffer is still skin grinding and whitening.
If the cascade relation of the at least one frame buffer is a randomly generated sequence, the sequence of the function processing corresponding to the at least one frame buffer may be different when the mobile terminal performs the function processing each time. For example, when a preview instruction is detected for the first time, the sequence of function processing corresponding to at least one cascaded frame buffer is skin grinding and whitening; and when the preview instruction is detected for the second time, the sequence of function processing corresponding to the cascaded at least one frame buffer may be whitening and peeling.
Specifically, optionally, after performing the target function processing on the first media data, the mobile terminal may draw the first media data subjected to the target function processing in the first frame buffer in a manner of function call. Before outputting the preview media corresponding to the first media data after the target function processing and drawn in the first frame buffer, adjusting the resolution of the display area of the mobile terminal to be the first resolution, for example, increasing the resolution of a viewport (viewport) to the resolution of a view component, so that the first media data after the target function processing can adapt to the display requirement of a screen, and displaying the preview media corresponding to the first media data after the target function processing in the first frame buffer in the adjusted display area, where the resolution of the preview media is the first resolution. The preview media may be a preview image or a preview video, and if the media data is image data, the preview media may be the preview image, and if the media data is video data, the preview media may be the preview video.
Further optionally, the first frame buffer of the at least one frame buffer in the cascade may also not correspond to any functional processing, i.e. the first frame buffer is only used for rendering media data that does not undergo any functional processing. For example, the mobile terminal creates at least one frame buffer according to the requirement of function processing, draws first media data obtained by compressing media data of a target object acquired by a camera in the first frame buffer, and a user clicks a function button a corresponding to a target function a (such as any one of buffing, whitening or filtering), and according to an instruction generated by clicking the function button a by the user, the mobile terminal performs target function a processing on the first media data in the first frame buffer corresponding to the function button a, draws the first media data processed by the target function a in the frame buffer corresponding to the target function a processing, and displays a preview media corresponding to the first media data processed by the target function a in the frame buffer; further, if the user clicks a function button B corresponding to a target function B (such as any one of buffing, whitening or filtering), the mobile terminal performs target function B processing corresponding to the function button B on the first media data processed by the target function a according to an instruction generated by the user clicking the function button B, draws the first media data processed by the target function a and the target function B in a frame buffer corresponding to the target function B processing, and displays a preview media corresponding to the first media data processed by the target function a and the target function B in the frame buffer, and the like; and the media data processing process is switched to the media generation stage until the mobile terminal detects a media generation instruction.
S205, if a photographing instruction is detected, the mobile terminal creates a second frame buffer, wherein the second frame buffer is used for drawing media data with a second resolution, and the second resolution is greater than the first resolution;
s206, the mobile terminal acquires second media data, wherein the second media data is the second resolution;
steps S205 to S206 in the embodiment of the present invention refer to steps S104 to S105 in the embodiment of fig. 1, and are not described herein again.
S207, the mobile terminal performs the target function processing on the second media data;
s208, the mobile terminal draws the second media data processed by the target function in the second frame buffer, and generates the target media according to the second media data processed by the target function in the second frame buffer.
In the embodiment of the present invention, the mobile terminal performs target function processing on the second media data, further draws the second media data subjected to the target function processing in the second frame buffer in a function call manner, and generates the target media according to the second media data subjected to the target function processing in the second frame buffer, where the resolution of the target media is the second resolution, and the second resolution is greater than the first resolution, that is, the resolution of the target media is greater than the resolution of the preview media, so that while ensuring a high processing speed in the process of previewing the media, the quality of the target media can also be ensured. The target media can be a target picture or a target video, etc. If the media data is image data, the target media may be a target picture, and if the media data is video data, the target media may be a target video.
Optionally, the mobile terminal may create at least one frame buffer according to a requirement of the function processing, where one frame buffer may correspond to one function processing, and the at least one frame buffer may be in a cascade relationship, that is, media data of a previous frame buffer is input to a next frame buffer after being subjected to target function processing corresponding to the next frame buffer.
The target function processing in step S208 is the same as the target function processing performed in step S203, and the resolution of the second media data after the target function processing is the second resolution, and for a specific processing manner, please refer to the description of step S203, which is not described herein again.
Further optionally, after generating the target media, the mobile terminal may change the resolution of the display area to a second resolution, for example, change the resolution of the viewport to the second resolution, and display the target media in the display area of the second resolution. After the target media is displayed, the resolution of the display area may also be adjusted, such as changing the resolution of the viewport back to the first resolution.
In the embodiment of the present invention, when detecting a preview instruction, a mobile terminal creates a first frame buffer with a first resolution, and then acquires first media data, where the first media data is the first resolution, performs target function processing on the first media data, where the first media data after the target function processing is still the first resolution, draws the first media data after the target function processing in the first frame buffer, and displays a preview media corresponding to the first media data after the target function processing in the first frame buffer, where the preview media has the first resolution, and when detecting a media generation instruction, creates a second frame buffer with a second resolution, where the second resolution is greater than the first resolution, acquires second media data, where the second media data is the second resolution, and performs the target function processing on the second media data, and drawing the second media data processed by the target function in the second frame buffer, and generating a target media according to the second media data processed by the target function in the second frame buffer, wherein the resolution of the target media is a second resolution. In the embodiment of the invention, the frame buffer with lower resolution is established to carry out the target function processing in the preview stage, so that the processing speed of the media data can be effectively ensured when the frame buffer with lower resolution is used for carrying out various target function processing.
Referring to fig. 3, a schematic structural diagram of a media data processing apparatus according to an embodiment of the present invention is shown, where the media data processing apparatus according to the embodiment of the present invention includes:
a first creating module 100, configured to create a first frame buffer if a preview instruction is detected, where the first frame buffer is used to draw media data with a first resolution;
in the embodiment of the present invention, the media data processing process may be divided into two stages, namely, a preview stage and a media generation stage, where the preview stage may be triggered by a preview instruction and the media generation stage may be triggered by a media generation instruction.
In the embodiment of the present invention, the preview instruction may include an instruction generated by the user clicking, double-clicking, long-pressing, or the like to open the software for taking a picture or recording a video, or may include an instruction generated when the user returns to the preview interface. When the mobile terminal detects a preview instruction, the mobile terminal may create a first frame buffer on the mobile terminal by calling a library function in OpenGL, where the first frame buffer is used to draw media data with a first resolution. The media data may be image data, video data, or the like.
It should be noted that the Frame Buffer is a short-term Frame Buffer, which is a direct image of a picture displayed on a screen, and is also called a bitmap (Bit Map) or a raster, each storage unit of the Frame Buffer corresponds to a pixel point on the screen, the whole Frame Buffer corresponds to an image, and the images stored in the Frame Buffer are from Frame to Frame. The first frame buffer may be any one of a plurality of frame buffers created by the mobile terminal.
Specifically, optionally, if the mobile terminal detects the preview instruction, a first frame buffer is created, where the first frame buffer is used to draw the media data with a first resolution, and the first resolution may be any resolution, such as 720p, 1080p, or a resolution smaller than 720p, and the like, which is not limited in this embodiment of the present invention.
A first obtaining module 200, configured to obtain first media data, where the first media data is the first resolution;
in the embodiment of the present invention, the resolution of the first media data is the same as the resolution of the media data used for rendering in the first frame buffer, that is, both the first and second resolutions are the first resolution. For example, the resolution of the first frame buffer for rendering is 720P, and the resolution of the first media data is 720P.
Optionally, the first media data may be media data of the target object acquired by the camera without any compression processing, that is, the resolution set by the camera is also the first resolution.
Optionally, the first media data may be media data of a target object acquired by the camera and subjected to compression processing, that is, the resolution set by the camera is greater than the first resolution.
Specifically, optionally, the first obtaining module 200 may include an acquiring unit 201 and a compressing unit 202;
the acquisition unit 201 is configured to acquire third media data acquired by a camera, where the third media data is a third resolution, and the third resolution is greater than the first resolution;
a compressing unit 202, configured to perform compression processing on the third media data to obtain the first media data;
further specifically, optionally, the mobile terminal may acquire, by using the camera, third media data of a target object selected by the user, where a resolution of the third media data is a third resolution, that is, a resolution set by the camera of the mobile terminal is the third resolution, and the mobile terminal performs compression processing on the third media data acquired by the camera, for example, adjacent pixels are merged to obtain first media data of the first resolution, where it is required to be noted that the third resolution is greater than the first resolution. For example, the resolution of a camera of a mobile terminal is 1080p, the resolution of the camera of the mobile terminal for capturing third media data of a target object selected by a user is 1080p, and the third media data is compressed into 720p of first media data by performing compression processing such as merging adjacent pixel points on the third media data, so that the first resolution is 720p and the third resolution is 1080 p.
Optionally, the first media data may also be media data that has undergone one or more target function processes (such as skin polishing, whitening, or filtering), for example, if the resolution of the camera is set to the first resolution, the target function process is performed on the first media data of the target object acquired by the camera, and then the first media data that has undergone the target function process is rendered in the first frame buffer. Or the resolution of the camera is set to be the third resolution, and the third resolution is greater than the first resolution, then the media data of the target object acquired by the camera is compressed, and then the target function processing is performed on the compressed media data, wherein the resolution of the compressed media data is the first resolution, and the media data processed by the target function is taken as the first media data and is drawn in the first frame buffer. It should be noted that, when performing the target function processing on the media data, the resolution of the media data is not changed, that is, the first media data after the target processing is still the first resolution.
Optionally, the apparatus further comprises:
a first processing module 300, configured to perform target function processing on the first media data;
the first rendering module 400 is specifically configured to render the first media data subjected to the target function processing in the first frame buffer;
the display module 500 is specifically configured to display a preview media corresponding to the first media data after the target function processing is performed in the first frame buffer.
Optionally, the target function processing may be any one of functional processing such as buffing, whitening, blurring a background, and adding a filter, and the resolution of the first media data after the target function processing is still the first resolution.
Optionally, the mobile terminal may create at least one frame buffer according to a requirement of the function processing, where one frame buffer may correspond to one function processing, and the at least one frame buffer may be in a cascade relationship, that is, media data of a previous frame buffer is input to a next frame buffer after being subjected to target function processing corresponding to the next frame buffer.
If the first frame buffer is the first frame buffer in at least one cascaded frame buffer, the first media data may be the media data acquired by the camera after being compressed, or the media data acquired by the camera without being compressed; if the first frame buffer is not the first frame buffer, such as the second or third frame buffer, etc., of at least one frame buffer in the cascade, the first media data may be the media data drawn in the frame buffer before the first frame buffer. It should be noted that the resolution of the first media data is the first resolution, and the first frame buffer is also used for rendering the media data with the first resolution.
Optionally, each of the at least one frame buffer may be created when an operation instruction of a user is detected, for example, when an operation instruction (for example, a user clicks a whitening button) for instructing to perform a certain function process is detected, a frame buffer corresponding to the function process is created, media data drawn in a last frame buffer of the frame buffer corresponding to the function process is subjected to the function process, the media data subjected to the function process is drawn in the frame buffer corresponding to the function process, and a preview media corresponding to the media data in the frame buffer is further output, that is, a whitened preview media is output.
Optionally, each frame buffer in the at least one frame buffer may be automatically created according to a function process set by the system, for example, if the function process set by the system includes whitening and peeling, two frame buffers are created, and each frame buffer corresponds to one function process. The cascade relation of the at least one frame buffer may be a fixed order set inside the system, or may be a randomly generated order, and it should be noted that the cascade relation of the at least one frame buffer determines a processing order of the media data. The first frame buffer may be any frame buffer of the at least one frame buffer frame, and the system outputs the preview media corresponding to the media data drawn in the frame buffer corresponding to each function process. Or, the first frame buffer may be the last frame buffer in the at least one frame buffer, that is, after the system processes all the functions, the system outputs the preview media processed by all the functions.
If the cascade relation of the at least one frame buffer is a fixed sequence set in the system, the sequence of the function processing corresponding to the at least one frame buffer is the same when the mobile terminal performs the function processing each time. For example, when a preview instruction is detected for the first time, the sequence of function processing corresponding to at least one cascaded frame buffer is skin grinding and whitening; when the preview instruction is detected for the second time, the sequence of function processing corresponding to at least one cascaded frame cache is still skin grinding and whitening; when the preview instruction is detected for the nth time (any time), the function processing sequence corresponding to at least one cascaded frame buffer is still skin grinding and whitening.
If the cascade relation of the at least one frame buffer is a randomly generated sequence, the sequence of the function processing corresponding to the at least one frame buffer may be different when the mobile terminal performs the function processing each time. For example, when a preview instruction is detected for the first time, the sequence of function processing corresponding to at least one cascaded frame buffer is skin grinding and whitening; and when the preview instruction is detected for the second time, the sequence of function processing corresponding to the cascaded at least one frame buffer may be whitening and peeling.
Specifically, optionally, after performing the target function processing on the first media data, the mobile terminal may draw the first media data subjected to the target function processing in the first frame buffer in a manner of function call. Before outputting the preview media corresponding to the first media data after the target function processing and drawn in the first frame buffer, adjusting the resolution of the display area of the mobile terminal to be the first resolution, for example, increasing the resolution of a viewport (viewport) to the resolution of a view component, so that the first media data after the target function processing can adapt to the display requirement of a screen, and displaying the preview media corresponding to the first media data after the target function processing in the first frame buffer in the adjusted display area, where the resolution of the preview media is the first resolution. The preview media may be a preview image or a preview video, and if the media data is image data, the preview media may be the preview image, and if the media data is video data, the preview media may be the preview video.
Further optionally, the first frame buffer of the at least one frame buffer in the cascade may also not correspond to any functional processing, i.e. the first frame buffer is only used for rendering media data that does not undergo any functional processing. For example, the mobile terminal creates at least one frame buffer according to the requirement of function processing, draws first media data obtained by compressing media data of a target object acquired by a camera in the first frame buffer, and a user clicks a function button a corresponding to a target function a (such as any one of buffing, whitening or filtering), and according to an instruction generated by clicking the function button a by the user, the mobile terminal performs target function a processing on the first media data in the first frame buffer corresponding to the function button a, draws the first media data processed by the target function a in the frame buffer corresponding to the target function a processing, and displays a preview media corresponding to the first media data processed by the target function a in the frame buffer; further, if the user clicks a function button B corresponding to a target function B (such as any one of buffing, whitening or filtering), the mobile terminal performs target function B processing corresponding to the function button B on the first media data processed by the target function a according to an instruction generated by the user clicking the function button B, draws the first media data processed by the target function a and the target function B in a frame buffer corresponding to the target function B processing, and displays a preview media corresponding to the first media data processed by the target function a and the target function B in the frame buffer, and the like; and the media data processing process is switched to the media generation stage until the mobile terminal detects a media generation instruction.
A first rendering module 400, configured to render the first media data in the first frame buffer;
a display module 500, configured to display a preview media corresponding to the first media data in the first frame buffer;
optionally, the display module 500 may include an adjusting unit 501 and a display unit 502.
An adjusting unit 501, configured to adjust the resolution of the display area to the first resolution;
a display unit 502, configured to display, in the adjusted display area, a preview media corresponding to the first media data in the first frame buffer;
in the embodiment of the invention, the mobile terminal can draw the first media data in the first frame cache through function call and display the preview media corresponding to the first media data in the first frame cache. Optionally, the resolution of the display area is adjusted to the first resolution, for example, the resolution of the viewport (viewport) is increased to the resolution of the view component, so that the first media data of the first resolution can adapt to the display requirement of the screen, and the preview media corresponding to the first media data in the first frame buffer is displayed in the adjusted display area, where the resolution of the preview media is the first resolution. The preview media may include, but is not limited to, preview pictures, preview videos, and the like. If the media data is image data, the preview media may be a preview image, and if the media data is video data, the preview media may be a preview video.
A second creating module 600, configured to create a second frame buffer if a media generating instruction is detected, where the second frame buffer is used to draw media data with a second resolution, and the second resolution is greater than the first resolution;
in the embodiment of the present invention, the media generation instruction may include an instruction generated by the user clicking, long-pressing, double-clicking a button for taking a picture or recording a video, or some gesture, voice, shortcut key, etc. set by the user for quickly taking a picture or recording a video, which triggers the mobile terminal to take a picture or record a video. When the mobile terminal detects a media generation instruction, a second frame buffer can be created on the mobile terminal by calling a library function in OpenGL, and the second frame buffer is used for drawing media data with a second resolution.
Optionally, the second frame buffer corresponds to the first frame buffer, and the second frame buffer is used for drawing media data of a second resolution, where the second resolution is greater than the first resolution, for example, the first resolution is 720p, and the second resolution may be 1080 p.
A second obtaining module 700, configured to obtain second media data, where the second media data is the second resolution;
in the embodiment of the present invention, the resolution of the second media data is the same as the resolution of the media data used for rendering in the second frame buffer, that is, both the second media data and the media data are the second resolution. For example, if the resolution of the media data buffered for rendering in the second frame buffer is 1080p, the resolution of the second media data is 1080 p.
Optionally, the second media data may be media data of a target object selected by the user through a camera of the mobile terminal, where the second media data is a second resolution, that is, a resolution (a third resolution in an embodiment of the present invention) set by the camera of the mobile terminal may be the same as the second resolution. For example, the resolution of a camera of the mobile terminal is 1080p, the resolution of the camera of the mobile terminal for acquiring the second media data of the target object selected by the user is 1080p, and the second resolution is 1080p, which is the same as the third resolution.
Optionally, the second media data may be media data obtained by the mobile terminal collecting media data of a target object selected by the user through a camera and performing compression processing, that is, a resolution (i.e., the third resolution in this embodiment) set by the camera is greater than the second resolution. For example, the media data of the target object acquired by the camera is 1080p, and the resolution of the 1080p media data after compression processing is 960p, that is, the second resolution is 960p, the third resolution is 1080p, and the second resolution is different from the third resolution.
Optionally, if the first media data is media data processed by a target function, the second media data may also be media data processed by the same target function. For example, the resolution of the camera is set to the third resolution, and the third resolution is the same as the second resolution, the media data of the target object acquired by the camera is subjected to the target function processing, and the media data after the target function processing is used as the second media data and is drawn in the second frame buffer. Or, the resolution of the camera is set to the third resolution, and the third resolution is greater than the second resolution, the media data of the target object acquired by the camera is compressed, and then the target function processing is performed on the compressed media data, wherein the resolution of the compressed media data is the second resolution, and the media data processed by the target function is taken as the second media data and is drawn in the second frame buffer. It should be noted that, when the target function processing is performed on the media data, the resolution of the media data is not changed, that is, the second media data processed by the target function is still at the second resolution.
Optionally, the apparatus further comprises:
a second processing module 800, configured to perform the target function processing on the second media data;
the second drawing module 900 is specifically configured to draw the second media data subjected to the target function processing in the second frame buffer;
the generating module 1000 is specifically configured to generate a target media according to the second media data after the target function processing is performed in the second frame buffer.
In the embodiment of the present invention, the mobile terminal performs target function processing on the second media data, further draws the second media data subjected to the target function processing in the second frame buffer in a function call manner, and generates the target media according to the second media data subjected to the target function processing in the second frame buffer, where the resolution of the target media is the second resolution, and the second resolution is greater than the first resolution, that is, the resolution of the target media is greater than the resolution of the preview media, so that while ensuring a high processing speed in the process of previewing the media, the quality of the target media can also be ensured. The target media can be a target picture or a target video, etc. If the media data is image data, the target media may be a target picture, and if the media data is video data, the target media may be a target video.
Optionally, the mobile terminal may create at least one frame buffer according to a requirement of the function processing, where one frame buffer may correspond to one function processing, and the at least one frame buffer may be in a cascade relationship, that is, media data of a previous frame buffer is input to a next frame buffer after being subjected to target function processing corresponding to the next frame buffer.
The target function processing performed in the second processing module 800 is the same as the target function processing performed by the first processing module 300, and the resolution of the second media data after the target function processing is the second resolution, and the specific processing manner refers to the description of the first processing module 300, which is not described herein again.
Further optionally, after generating the target media, the mobile terminal may change the resolution of the display area to a second resolution, for example, change the resolution of the viewport to the second resolution, and display the target media in the display area of the second resolution. After the target media is displayed, the resolution of the display area may also be adjusted, such as changing the resolution of the viewport back to the first resolution.
A second drawing module 900, configured to draw the second media data in the second frame buffer;
a generating module 1000, configured to generate a target media according to the second media data in the second frame buffer.
In the embodiment of the present invention, the mobile terminal may draw the second media data in the second frame buffer through function call, and generate the target media according to the second media data in the second frame buffer, where the resolution of the target media is the second resolution, and the second resolution is greater than the first resolution, that is, the resolution of the target media is greater than the resolution of the preview media, so that the high processing speed in the process of previewing the media is ensured, and the quality of the target media is also ensured. The target media can be a target picture or a target video, etc. If the media data is image data, the target media may be a target picture, and if the media data is video data, the target media may be a target video.
Optionally, after the target media is generated, the mobile terminal may change the resolution of the display area to the second resolution, for example, change the resolution of the viewport to the second resolution, and display the target media in the display area of the second resolution. After the target media is displayed, the resolution of the display area may also be adjusted, such as changing the resolution of the viewport back to the first resolution.
In the embodiment of the present invention, when detecting a preview instruction, a mobile terminal creates a first frame buffer with a first resolution, and then acquires first media data, where the first media data is the first resolution, performs target function processing on the first media data, where the first media data after the target function processing is still the first resolution, draws the first media data after the target function processing in the first frame buffer, and displays a preview media corresponding to the first media data after the target function processing in the first frame buffer, where the preview media has the first resolution, and when detecting a media generation instruction, creates a second frame buffer with a second resolution, where the second resolution is greater than the first resolution, acquires second media data, where the second media data is the second resolution, and performs the target function processing on the second media data, and drawing the second media data processed by the target function in the second frame buffer, and generating a target media according to the second media data processed by the target function in the second frame buffer, wherein the resolution of the target media is a second resolution. In the embodiment of the invention, the frame buffer with lower resolution is established for target function processing in the preview stage, so that the processing speed of the media data can be effectively ensured when various target function processing is carried out, and the frame buffer with higher resolution is established for target function processing in the media generation stage, so that the resolution of the generated target media is higher, and the quality of the generated media is improved.
Fig. 4 is a schematic structural diagram of another image processing apparatus according to an embodiment of the present invention. As shown in fig. 4, the image processing apparatus 2000 may include: at least one processor 2001, e.g., CPU, GPU, at least one photo interface 2002, memory 2003, at least one communication bus 2004. Wherein a communication bus 2004 is used to enable connective communication between these components. The user may collect the media data by calling the photographing interface 2002, and the photographing interface 2002 may include a camera built in the mobile terminal and a camera external to the mobile terminal. The memory 2003 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The memory 2003 may optionally be at least one memory device located remotely from the processor 2001. As shown in fig. 4, the memory 2003, which is one type of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a data processing application program.
In the image processing apparatus 2000 shown in fig. 4, the processor 2001 may be configured to call a data processing application stored in the memory 2003, and specifically perform the following operations:
if a preview instruction is detected, creating a first frame cache, wherein the first frame cache is used for drawing the media data with a first resolution;
acquiring first media data, wherein the first media data is the first resolution;
drawing the first media data in the first frame cache, and displaying preview media corresponding to the first media data in the first frame cache;
if a media generation instruction is detected, creating a second frame buffer, wherein the second frame buffer is used for drawing media data with a second resolution, and the second resolution is greater than the first resolution;
acquiring second media data, wherein the second media data is the second resolution;
and drawing the second media data in the second frame buffer, and generating a target media according to the second media data in the second frame buffer.
Optionally, the processor 2001 acquires first media data, where the first media data is at the first resolution, and specifically includes:
acquiring third media data acquired by a camera, wherein the third media data is a third resolution;
and compressing the third media data to obtain the first media data.
Optionally, the processor 2001 is further configured to perform target function processing on the first media data; the processor 2001 draws the first media data in the first frame buffer, and displays a preview media corresponding to the first media data in the first frame buffer, which specifically includes:
drawing the first media data after the target function processing in the first frame cache, and displaying preview media corresponding to the first media data after the target function processing in the first frame cache.
Optionally, the processor 2001 is further configured to perform the target function processing on the second media data; the processor 2001 draws the second media data in the second frame buffer, and displays a preview media corresponding to the second media data in the second frame buffer, which specifically includes:
and drawing the second media data subjected to the target function processing in the second frame cache, and displaying preview media corresponding to the second media data subjected to the target function processing in the second frame cache.
Optionally, the processor 2001 performs target function processing on the first media data, specifically including:
and if a target instruction for indicating target function processing of the first media data is detected, the target function processing of the first media data is carried out.
Optionally, the displaying, by the processor 2001, the preview media corresponding to the first media data in the first frame buffer specifically includes:
adjusting the resolution of the display area to the first resolution;
and displaying the preview media corresponding to the first media data in the first frame cache in the adjusted display area.
An embodiment of the present invention further provides an electronic device, where the electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor is configured to execute the image processing method in the embodiment of fig. 1 or 2 when executing the computer program, and details of the image processing method are described with reference to the embodiment of fig. 1 or 2, which are not repeated herein.
An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium includes instructions, and when the instructions are executed on a computer, the computer is enabled to execute the image processing method in fig. 1 or fig. 2, for details, please refer to the description of the embodiment in fig. 1 or fig. 2, which is not repeated herein.
An embodiment of the present invention further provides an application program, where the application program includes an instruction, and when the instruction runs on a computer, the computer is enabled to execute the image processing method in fig. 1 or fig. 2, for details, please refer to the description of the embodiment in fig. 1 or fig. 2, which is not described herein again.
While the invention has been described in connection with various embodiments, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed invention, from a review of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other elements or steps, and the word "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus (device), or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein. A computer program stored/distributed on a suitable medium supplied together with or as part of other hardware, may also take other distributed forms, such as via the Internet or other wired or wireless telecommunication systems.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the invention has been described in conjunction with specific features and embodiments thereof, it will be evident that various modifications and combinations can be made thereto without departing from the spirit and scope of the invention. Accordingly, the specification and figures are merely exemplary of the invention as defined in the appended claims and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of the invention. It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (12)

1. A method for media data processing, comprising:
if a preview instruction is detected and an operation instruction for indicating target function processing of media data is detected, creating a first frame cache corresponding to the target function processing, wherein the first frame cache is used for drawing the media data with a first resolution, the first frame cache is one of at least two frame caches created by a mobile terminal according to the requirement of the function processing, one frame cache corresponds to one function processing, the function processing comprises one of skin grinding, whitening, background blurring and filter adding, the first frame cache corresponds to the target function processing, and the at least two frame caches are in a cascade relation;
acquiring first media data, wherein the first media data is the first resolution and is media data drawn in a frame cache before the first frame cache, and the first media data is subjected to function processing corresponding to the frame cache before the first frame cache;
performing target function processing on the first media data;
drawing the first media data subjected to the target function processing in the first frame cache, and displaying preview media corresponding to the first media data subjected to the target function processing in the first frame cache;
if a media generation instruction is detected, creating a second frame buffer, wherein the second frame buffer corresponds to the first frame buffer and is used for drawing media data with a second resolution, and the second resolution is greater than the first resolution;
acquiring second media data, wherein the second media data is the second resolution;
and drawing the second media data in the second frame buffer, and generating a target media according to the second media data in the second frame buffer.
2. The method of claim 1, wherein the obtaining first media data comprises:
acquiring third media data acquired by a camera, wherein the third media data is a third resolution, and the third resolution is greater than the first resolution;
and compressing the third media data to obtain the first media data.
3. The method of claim 2, wherein the third resolution is the same as the second resolution.
4. The method of claim 1, wherein prior to rendering the second media data in the second frame buffer and generating the target media based on the second media data in the second frame buffer, further comprising:
performing the target function processing on the second media data;
the drawing the second media data in the second frame buffer, and generating a target media according to the second media data in the second frame buffer, includes:
and drawing the second media data subjected to the target function processing in the second frame cache, and generating a target media according to the second media data subjected to the target function processing in the second frame cache.
5. The method of any one of claims 1-4, wherein the displaying the preview media corresponding to the first media data in the first frame buffer comprises:
adjusting the resolution of the display area to the first resolution;
and displaying the preview media corresponding to the first media data in the first frame cache in the adjusted display area.
6. A media data processing apparatus, comprising:
a first creating module, configured to create a first frame cache corresponding to target function processing if a preview instruction is detected and an operation instruction for instructing target function processing on media data is detected, where the first frame cache is used to draw media data of a first resolution, the first frame cache is one of at least two frame caches created by a mobile terminal according to the requirement of the function processing, and one frame cache corresponds to one function processing, where the function processing includes one of buffing, whitening, blurring a background, and adding a filter, the first frame cache corresponds to the target function processing, and the at least two frame caches are in a cascade relationship;
a first obtaining module, configured to obtain first media data, where the first media data is the first resolution and is media data drawn in a frame buffer before the first frame buffer, and the first media data has been subjected to function processing corresponding to the frame buffer before the first frame buffer;
the first drawing module is used for carrying out target function processing on the first media data; drawing the first media data subjected to the target function processing in the first frame buffer;
a display module, configured to perform the target function processing on the preview media corresponding to the first media data in the first frame cache;
a second creating module, configured to create a second frame buffer if a media generation instruction is detected, where the second frame buffer corresponds to the first frame buffer, and the second frame buffer is used to draw media data with a second resolution, and the second resolution is greater than the first resolution;
a second obtaining module, configured to obtain second media data, where the second media data is the second resolution;
the second drawing module is used for drawing the second media data in the second frame buffer;
and the generating module is used for generating the target media according to the second media data in the second frame buffer.
7. The apparatus of claim 6, wherein the first obtaining module comprises:
the acquisition unit is used for acquiring third media data acquired by the camera, wherein the third media data is a third resolution, and the third resolution is greater than the first resolution;
and the compression unit is used for compressing the third media data to obtain the first media data.
8. The apparatus of claim 7, wherein the third resolution is the same as the second resolution.
9. The apparatus of claim 6, wherein the apparatus further comprises:
the second processing module is used for performing the target function processing on the second media data;
the second rendering module is specifically configured to render the second media data subjected to the target function processing in the second frame buffer;
the generating module is specifically configured to generate a target media according to the second media data after the target function processing is performed in the second frame buffer.
10. The apparatus of any one of claims 6-9, wherein the display module comprises:
the adjusting unit is used for adjusting the resolution of the display area to be the first resolution;
and the display unit is used for displaying the preview media corresponding to the first media data in the first frame cache in the adjusted display area.
11. An electronic device, characterized in that the electronic device comprises: memory, processor and computer program stored on the memory and executable on the processor, the processor when executing the computer program for performing the method according to any of claims 1 to 5.
12. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method of any of claims 1 to 5.
CN201710769051.4A 2017-08-30 2017-08-30 Media data processing method and device Active CN107592450B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710769051.4A CN107592450B (en) 2017-08-30 2017-08-30 Media data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710769051.4A CN107592450B (en) 2017-08-30 2017-08-30 Media data processing method and device

Publications (2)

Publication Number Publication Date
CN107592450A CN107592450A (en) 2018-01-16
CN107592450B true CN107592450B (en) 2021-07-20

Family

ID=61050718

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710769051.4A Active CN107592450B (en) 2017-08-30 2017-08-30 Media data processing method and device

Country Status (1)

Country Link
CN (1) CN107592450B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103139473A (en) * 2011-11-28 2013-06-05 三星电子株式会社 Method of eliminating a shutter-lag, camera module, and mobile device having the same
CN105915793A (en) * 2016-05-10 2016-08-31 北京奇虎科技有限公司 Intelligent watch shooting processing method and device

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1295939C (en) * 2002-12-25 2007-01-17 北京中星微电子有限公司 Multifunctional image processor
KR100429703B1 (en) * 2003-04-07 2004-05-03 주식회사 아이콘랩 Method for capturing of real-time image
KR101701852B1 (en) * 2010-12-29 2017-02-13 엘지전자 주식회사 Mobile terminal and method for controlling the same
US9225904B2 (en) * 2012-02-13 2015-12-29 Htc Corporation Image capture method and image capture system thereof
TWI519155B (en) * 2012-02-24 2016-01-21 宏達國際電子股份有限公司 Burst image capture method and image capture system thereof
KR101893406B1 (en) * 2012-03-28 2018-08-30 삼성전자 주식회사 Apparatus and mehod for processing a image in camera device
KR101917650B1 (en) * 2012-08-03 2019-01-29 삼성전자 주식회사 Method and apparatus for processing a image in camera device
US20140232892A1 (en) * 2013-02-20 2014-08-21 Woodman Labs, Inc. Digital signal processor buffer management
CN103391414B (en) * 2013-07-24 2017-06-06 杭州趣维科技有限公司 A kind of video process apparatus and processing method for being applied to cell phone platform
US9860451B2 (en) * 2015-06-07 2018-01-02 Apple Inc. Devices and methods for capturing and interacting with enhanced digital images

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103139473A (en) * 2011-11-28 2013-06-05 三星电子株式会社 Method of eliminating a shutter-lag, camera module, and mobile device having the same
CN105915793A (en) * 2016-05-10 2016-08-31 北京奇虎科技有限公司 Intelligent watch shooting processing method and device

Also Published As

Publication number Publication date
CN107592450A (en) 2018-01-16

Similar Documents

Publication Publication Date Title
CN109118430B (en) Super-resolution image reconstruction method and device, electronic equipment and storage medium
CN110475065B (en) Image processing method and device, electronic equipment and storage medium
CN113766313B (en) Video data processing method and device, electronic equipment and storage medium
CN112165632B (en) Video processing method, device and equipment
US20140071068A1 (en) Constant speed display method of mobile device
CN112637517B (en) Video processing method and device, electronic equipment and storage medium
US10616502B2 (en) Camera preview
CN112004032B (en) Video processing method, terminal device and storage medium
CN110458771B (en) Image processing method and device, electronic equipment and storage medium
CN110913118B (en) Video processing method, device and storage medium
CN113207038B (en) Video processing method, video processing device and electronic equipment
US9076207B1 (en) Image processing method, system and electronic device
CN115379105A (en) Video shooting method and device, electronic equipment and storage medium
CN112508820A (en) Image processing method and device and electronic equipment
CN107592450B (en) Media data processing method and device
CN109981903B (en) Image processing method and electronic equipment
CN110969587A (en) Image acquisition method and device and electronic equipment
KR20060070919A (en) Panorama image display method for mobile communication terminal with dual camera system
EP2945364A1 (en) Display control device, program, and display control method
CN112383708B (en) Shooting method and device, electronic equipment and readable storage medium
JP7279169B2 (en) IMAGING DEVICE, METHOD OF OPERATION OF IMAGING DEVICE, AND PROGRAM
CN113012085A (en) Image processing method and device
CN112887611A (en) Image processing method, device, equipment and storage medium
CN113473012A (en) Virtualization processing method and device and electronic equipment
CN107707930B (en) Video processing method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20181206

Address after: Room 105-53811, No. 6 Baohua Road, Hengqin New District, Zhuhai City, Guangdong Province

Applicant after: Zhuhai Seal Interest Technology Co., Ltd.

Address before: 519070, six level 601F, 10 main building, science and technology road, Tangjia Bay Town, Zhuhai, Guangdong.

Applicant before: Zhuhai Juntian Electronic Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant