WO2018176734A1 - Data processing method and terminal - Google Patents

Data processing method and terminal Download PDF

Info

Publication number
WO2018176734A1
WO2018176734A1 PCT/CN2017/100080 CN2017100080W WO2018176734A1 WO 2018176734 A1 WO2018176734 A1 WO 2018176734A1 CN 2017100080 W CN2017100080 W CN 2017100080W WO 2018176734 A1 WO2018176734 A1 WO 2018176734A1
Authority
WO
WIPO (PCT)
Prior art keywords
format
video
new
surface view
frame data
Prior art date
Application number
PCT/CN2017/100080
Other languages
French (fr)
Chinese (zh)
Inventor
仇建斌
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201780033551.XA priority Critical patent/CN109196865B/en
Publication of WO2018176734A1 publication Critical patent/WO2018176734A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/40Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream

Definitions

  • the present application relates to the field of terminal technologies, and in particular, to a data processing method and a terminal.
  • the system decoder of the Android system can decode the video source data of the general format, and then send the decoded video frame data to the image processing unit such as MDP for scaling. And then sent to the display unit for display.
  • some video playback applications may encode video source data using other video formats than the common video format.
  • the video playing application decodes through a decoder other than the system decoder, and the format of the decoded video frame data is usually not matched with the mobile phone hardware, and thus cannot be directly sent.
  • the image processing unit of the mobile phone and the display unit perform processing.
  • a graphics processing unit converts the format of the video frame data into a target format that can be directly used for display, and displays a video layer image of the video frame data. After being scaled to the size matching the display unit, it is sent to the image processing unit and the display unit for processing.
  • the format of the video frame data is converted into a target format that can be directly used for display by the GPU, and the video layer picture is scaled to a size matching the display unit, which consumes more power of the mobile phone. Reduce the user experience.
  • the embodiment of the present invention provides a data processing method and a terminal, which can reduce power consumption during video playback and improve user experience.
  • the embodiment of the present application provides a data processing method, which is applied to a terminal, where the terminal includes a central processing unit (CPU), an image processing unit, and a display unit, and the method includes: when the decoded video
  • the CPU converts the first format into the second format.
  • the video frame data is used to represent the video layer picture
  • the second format is a preset type format
  • the preset class format is a format that the image processing unit can recognize.
  • the image processing unit converts the second format into a target format, which is a data frame format used by the display unit for display.
  • the image processing unit scales the video layer picture represented by the video frame data of the target format such that the size of the scaled video layer picture matches the size of the display unit Match.
  • the method further includes: the display unit displaying the scaled video layer picture.
  • the display unit can display the video layer screen after the image processing unit is scaled.
  • the first format is corresponding to the first video playing application
  • the video frame data of the first format is a decoder corresponding to the first video playing application. Data obtained by decoding video source data.
  • the first format processed by the CPU is the format of the video frame data obtained by decoding the decoder corresponding to the first video playing application.
  • the CPU converting the first format into the second format includes: the CPU, according to the first video playback application corresponding to the first format, the first The format is converted to the second format.
  • the CPU may convert the first format into the second format according to the first video playing application.
  • the terminal saves a correspondence between the first video playing application and the third format, where the third format is a preset type format, and the second format is A third format corresponding to the first video playback application.
  • the CPU may convert the first format corresponding to the first video playing application into the third format according to the correspondence between the first video playback saved in advance and the third format.
  • the video layer is displayed through a surface view surfaceview
  • the method further includes: the CPU is in the video.
  • a new video layer is created on the upper layer of the corresponding position of the original video layer corresponding to the frame data, the new video layer is used to cover the original video layer, and the new video layer corresponds to the new surface view new surface view.
  • the CPU acquires video frame data through an open graphics library (opengl) interface. The CPU fills in the new surface view new surfaceview with the video frame data acquired through the opengl interface.
  • the terminal side is not easy to modify and control, so the terminal can replace the original surface view by creating a new surface view new surfaceview and a new video layer. And the original video layer to operate on the new surface view new surfaceview and the new video layer.
  • the user does not perceive, and the resolution, the frame rate, the playback speed, and the display content are not affected, and thus Will not reduce the user experience.
  • the CPU converting the first format into the second format includes: the first format corresponding to the video frame data in the new surface view new surface view of the CPU Convert to the second format.
  • the CPU can convert the first format corresponding to the video frame data in the new surface view new surface view corresponding to the new video layer into the second format.
  • the CPU converts the first format corresponding to the video frame data in the new surface view new surface view into the second format, including: the CPU passes the new surface view.
  • the undersurface module nativesurface of the new surfaceview converts the first format corresponding to the video frame data in the new surface view new surfaceview into the second format.
  • the CPU specifically converts the first format into the second format by using the underlying module.
  • the image processing unit converting the second format into the target format includes: the image processing unit corresponding to the video frame data in the new surface view new surface view
  • the second format is converted to the target format.
  • the image processing unit scaling the video layer picture represented by the video frame data of the target format includes: the image processing unit scales the new video layer picture represented by the video frame data converted into the target format in the new surface view new surfaceview.
  • the image processing unit may specifically convert the second format corresponding to the video frame data into the target format in the new surface view new surface view, and convert the video image data converted into the target format in the new surface view new surfaceview.
  • the new video layer picture is scaled.
  • the original video layer corresponds to an original surface view
  • the method further includes: the display unit stops displaying the original video layer corresponding to the original surface view original surface view Picture.
  • the CPU inserts the new surface view new surfaceview into the view hierarchy viewhieiarchy in which the original surface view is located.
  • the display unit displays the scaled video layer picture including: the display unit displays the scaled target video layer picture, and the target video layer picture is a new video layer picture in the new surface view new surfaceview that has been converted into the target format video frame data.
  • the terminal can no longer display the original video layer picture, but replace it by displaying a new video layer picture.
  • the second format is a YUV type format.
  • the CPU can convert the first format to the second format of the YUV type.
  • the CPU creates a new video layer on a higher layer of a corresponding position of the original video layer corresponding to the video frame data, including: the CPU corresponding to setting a new video layer Zorder creates a new video layer on the upper layer of the corresponding position of the original video layer of the video frame.
  • the CPU can set the upper and lower layers of the new video layer and the original video layer through zorder.
  • the method further includes: the image processing unit is configured to: The video layer picture represented by the frame data is scaled such that the size of the scaled video layer picture matches the size of the display unit, and the display unit displays the scaled video layer picture.
  • the image processing unit can directly process the video frame data of the first format.
  • an embodiment of the present application provides a terminal, including at least one processor, an image processing unit, a screen, a memory, and a bus.
  • the processor, the image processing unit, the screen, and the memory are connected by a bus.
  • the memory is used to store instructions.
  • the processor is configured to execute an instruction to: when the first format corresponding to the decoded video frame data is not a preset type format, convert the first format into a second format, where the video frame data is used to represent the video layer picture, and the second format
  • the preset class format is a format that the image processing unit can recognize.
  • the image processing unit is configured to execute an instruction to: convert the second format into a target format, and the target format is a display unit for
  • the displayed data frame format scales the video layer picture represented by the video frame data of the target format such that the size of the scaled video layer picture matches the size of the display unit.
  • the display unit is configured to execute an instruction to perform: displaying the scaled video layer picture.
  • the first format corresponds to the first video playing application
  • the video frame data of the first format is the decoding corresponding to the first video playing application.
  • the processor is specifically configured to: convert the first format into the second format according to the first video playing application corresponding to the first format.
  • the terminal saves a correspondence between the first video playing application and the third format, where the third format is a preset type format, and the second format is A third format corresponding to the first video playback application.
  • the video layer is displayed by a surface view surfaceview
  • the processor is further configured to: before converting the first format into the second format, in the video frame A new video layer is created on the upper layer of the corresponding position of the original video layer corresponding to the data, the new video layer is used to cover the original video layer, and the new video layer corresponds to the new surface view new surface view.
  • the processor is specifically configured to: convert the first format corresponding to the video frame data in the new surface view new surface view into the second format.
  • the processor is specifically configured to: corresponding to the video frame data in the new surface view new surface view by using the bottom surface module nativesurface of the new surface view new surface view
  • the first format is converted to the second format.
  • the image processing unit is specifically configured to: convert the second format corresponding to the video frame data into the target format in the new surface view new surface view.
  • the new video layer picture represented by the video frame data that has been converted into the target format is scaled in the new surface view new surfaceview.
  • the original video layer corresponds to the original surface view original surface view
  • the display unit is configured to stop displaying the original video layer picture corresponding to the original surface view original surface view.
  • the processor is further configured to insert the new surface view new surfaceview into the view hierarchy viewhieiarchy where the original surface view is located.
  • the display unit is specifically configured to: display the scaled target video layer picture, and the target video layer picture is a new video layer picture that has been converted into a video frame data representation of the target format in the new surface view new surfaceview.
  • the second format is a YUV type format.
  • an embodiment of the present application provides a device, which is in the form of a product of a chip.
  • the device includes a processor and a memory, and the memory is coupled to the processor to save necessary program instructions of the device. And data, the processor for executing program instructions stored in the memory such that the apparatus performs the functions of data processing in the above method.
  • an embodiment of the present application provides a computer readable storage medium, where the storage medium includes an instruction, When it is running on the terminal, the terminal is caused to perform the data processing method according to any of the first aspect and the first aspect described above.
  • the embodiment of the present application provides a computer program product including instructions, when the terminal is running on the terminal, causing the terminal to perform the data processing method in any one of the foregoing first aspect and the first aspect.
  • FIG. 2 is a schematic structural diagram of a mobile phone according to an embodiment of the present application.
  • FIG. 3 is a flowchart of a data processing method according to an embodiment of the present application.
  • FIG. 5 is a flowchart of another data processing method according to an embodiment of the present application.
  • FIG. 6 is a flowchart of another data processing method according to an embodiment of the present application.
  • FIG. 7 is a flowchart of another data processing method according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a terminal according to an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of another terminal according to an embodiment of the present application.
  • the format of the video frame data is converted by the GPU into a target format that can be directly used for display of the display unit, and the video layer picture is scaled to a size matching the display unit. This consumes more power and reduces the user experience.
  • the data processing method provided by the embodiment of the present application can reduce the power consumption during video playback.
  • the main principle is: replacing the GPU with a part of the format conversion operation and the zoom operation by using a simpler and less power-consuming image processing unit.
  • the data processing method provided by the embodiment of the present application can be applied to a terminal capable of video playback.
  • the terminal here may be a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or the like.
  • UMPC ultra-mobile personal computer
  • PDA personal digital assistant
  • the data processing method provided by the embodiment of the present application is introduced by using the terminal as a mobile phone as an example.
  • the components of the mobile phone 100 will be specifically described below with reference to FIG. 2:
  • the mobile phone 100 may include: a screen 101, a processor 102, a memory 103, a power source 104, a radio frequency (RF) circuit 105, a gravity sensor 106, an audio circuit 107, a video card 108, a GPU 109, and image processing.
  • Units such as unit 110, which may be connected by a bus or directly connected.
  • the screen 101 may specifically be a touch display screen or a non-touch display screen, and may be used for interface display, video play, picture browsing, and the like.
  • the processor 102 is the control center of the handset 100, which connects various portions of the entire handset using various interfaces and lines, by running or executing software programs and/or modules stored in the memory 103, and recalling data stored in the memory 103, The various functions and processing data of the mobile phone 100 are executed to perform overall monitoring of the mobile phone 100.
  • processor 102 can include one or more processing units; processor 102 can integrate an application processor and a modem processor.
  • the application processor mainly processes an operating system, a user interface, an application, and the like, and the modem processor mainly processes wireless communication. It will be appreciated that the above described modem processor may also not be integrated into the processor 102.
  • the memory 103 can be used to store data, software programs, and modules, and can be a volatile memory, such as a random-access memory (RAM), or a non-volatile memory.
  • RAM random-access memory
  • non-volatile memory for example, a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); or a combination of the above types of memories.
  • the program code is stored in the memory 103, and the program code is used to enable the processor 102 to execute the data processing method provided by the embodiment of the present application by executing the program code.
  • the power source 104 which can be a battery, is logically coupled to the processor 102 through a power management system to manage functions such as charging, discharging, and power management through the power management system.
  • the RF circuit 105 can be used for transmitting and receiving information or during a call, receiving and transmitting signals, and in particular, processing the received information to the processor 102; in addition, transmitting the signals generated by the processor 102.
  • RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, and the like.
  • LNA low noise amplifier
  • RF circuit 105 can also communicate with the network and other devices via wireless communication.
  • the gravity sensor 106 can collect the acceleration of the mobile phone in various directions (usually three axes), and can collect the magnitude and direction of gravity when stationary, and can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching, related Game, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping). It should be noted that the mobile phone 100 may further include other sensors, such as a pressure sensor, a light sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, and the like, and details are not described herein.
  • the audio circuit 107 is used to provide an audio interface between the user and the handset 100.
  • the video card 108 is a device for digital-to-analog signal conversion of the mobile phone, and has image processing capability, which can assist the completion of the work of the processor 102 and improve the overall running speed of the mobile phone 100.
  • the GPU 109 is a processor of a graphics card, which is a complex arithmetic unit, and includes a large number of logic arrays for converting and driving display information required by the mobile phone 100, and providing a line scan signal to the screen 101 to control the correctness of the screen 101. Display, you can perform complex mathematical and geometric calculations required for graphics rendering.
  • the image processing unit 110 is a simple hardware logic unit that contains fewer logic arrays and is small in size and low in power consumption, and is generally used to scale an image to a size that matches the size of the screen 101, such as an MDP unit. (Qualcomm) or DSS unit (His) and so on. In one implementation, image processing unit 110 may also be integrated into processor 110 or other chips of handset 100.
  • the audio circuit 107, the video card 108, the GPU 109, and the image processing unit 110 can be used to perform video playback in conjunction with the screen 101 and the processor 102.
  • the mobile phone 100 may further include a wireless fidelity (WiFi) module, a Bluetooth module, a camera, and the like, and details are not described herein.
  • WiFi wireless fidelity
  • Bluetooth Bluetooth
  • camera and the like, and details are not described herein.
  • the data processing method provided by the embodiment of the present application is described in detail below with reference to the specific components in the mobile phone 100 shown in FIG. 2 in order to make the purpose, the technical solution and the advantages of the embodiment of the present application more clear.
  • the steps shown below can also be performed in any terminal other than the mobile phone shown in FIG. 2.
  • the logical order of the data processing methods provided by the embodiments of the present application is shown in the method flowchart, in some cases, the steps shown or described may be performed in an order different from that herein.
  • an embodiment of the present application provides a data processing method, which may be applied to a terminal, where the terminal may include a central processing unit CPU, an image processing unit, and a display unit.
  • the method may include:
  • the CPU converts the first format into a second format, where the video frame data is used to represent the video layer picture, and the second format is a preset class.
  • the format, the preset class format is a format that the image processing unit can recognize.
  • the video refers to a continuous picture whose display speed exceeds 24 frames per second, and is specifically composed of video data of one frame and one frame.
  • the video frame data is video data obtained after decoding the video source data, and may be referred to as rawdata data, and each frame of data may correspond to one video layer picture.
  • the preset class format here is a video frame format that the image processing unit can recognize and directly process, and is usually a general standard video frame format, for example, a format such as YUV, CMYK, YCBCR or RGB, and each type is specifically Can include multiple formats.
  • a general standard video frame format for example, a format such as YUV, CMYK, YCBCR or RGB, and each type is specifically Can include multiple formats.
  • some of the preset video frame formats can be found in some common standard video formats listed in Table 1 below.
  • the CPU may convert the first format.
  • the first format is usually close to the preset type format, and is generally a simple variant of the preset type format. For example, the first format adds, changes, or deletes some characters in the video data stream corresponding to the format of the preset class format YUV type.
  • the CPU converts the first format into the second format at a faster speed, and the delay is small, for example, may be several milliseconds.
  • the converting the first format to the second format by the CPU specifically means that the CPU converts the video frame data of the first format into the video frame data of the second format.
  • the CPU may determine, by the framework framework layer module, whether the first format can be recognized by the image processing unit.
  • the image processing unit converts the second format into a target format, where the target format is a data frame format that the display unit can use for display.
  • the target format is a data frame format that the display unit can directly use for display, and can usually be an RGB type format.
  • the image processing unit may specifically convert the second format into a target format that is adapted to the characteristics of the display unit according to the characteristics of the display unit.
  • the target format may be the RGB888 format; when the display unit is an enhanced color screen, the target format may be the RGB555 format.
  • the image processing unit scales the video layer picture represented by the video frame data of the target format, so that the size of the scaled video layer picture matches the size of the display unit.
  • the size of the video layer picture represented by the video frame data may also be scaled so that the size of the video layer picture matches the size of the display unit. In order for the display unit to display the scaled video layer screen.
  • the CPU may convert the first format into a second format that is close to the format of the first format, and the image processing unit may convert the second format.
  • the target format can be directly used for display, and the video layer picture is scaled to the screen size to facilitate display of the display unit.
  • the terminal When adopting the solution in the prior art, the terminal will convert the first format into the target format through the GPU. Since the first format and the target format usually differ greatly, the first format is usually not a simple deformation of the target format, and thus the GPU usually needs to perform complex processing to convert the GPU into a target format. Also, the GPU needs to scale the video layer to the screen size. Since the GPU is a complex arithmetic unit and internally contains a large number of logic arrays, the operation of the GPU will consume more power.
  • the process of converting the first format into the target format may be divided into two parts, that is, the CPU converts the first format into the second format, and the image processing unit converts the second format into the target format.
  • the CPU converts the first format into the second format
  • the image processing unit converts the second format into the target format.
  • the first part compared with the GPU, although the CPU is also a complex arithmetic unit, the CPU is only used to convert the first format into a second format similar to the first format, so that the CPU can be realized by simple processing and processing. Fast speed and small delay.
  • the power consumption can be saved by running the image processing unit to convert the second format to the target format compared to running the GPU. It can be seen that the method for converting the first format into the second format by the CPU+image processing unit provided by the embodiment of the present application can save power.
  • the prior art is implemented by running a complex arithmetic unit GPU, and the present application is realized by running a simpler image processing unit, thereby saving power.
  • the embodiment of the present application replaces the GPU by a smaller and simpler image processing unit to perform a part of the format conversion operation and the zoom operation, thereby reducing the power consumption and improving the user experience.
  • the image processing unit is configured to scale the video layer image to a screen size, that is, the size of the video layer picture entering the image processing unit is the original size;
  • the GPU is used to scale the video layer picture to the screen size, that is, the video layer picture that enters the image processing unit from the GPU has been scaled to the screen size, and the image processing unit only performs 1:1 scaling (it can also be understood as No scaling).
  • the method provided by the embodiment of the present application may further include:
  • the display unit displays the scaled video layer screen.
  • the video frame data corresponding to the video layer picture herein is a target format.
  • the display unit here may be a screen of the terminal, such as a liquid crystal display (LCD) screen or an organic light emitting display (OLED) screen.
  • LCD liquid crystal display
  • OLED organic light emitting display
  • the display unit and the screen are used to indicate the same meaning, and both can be used universally.
  • the display unit can display the scaled video layer picture. And, the display unit displays the video layer screen at a frequency greater than 24 frames/second for video playback.
  • the process of scaling the size of the video layer picture to match the size of the display unit is referred to as scaling the video layer picture to the screen size or scaling the video layer picture to the matching size.
  • the first format in step 201 may correspond to the first video playing application, and the video frame data in the first format is data obtained by decoding the video source data by using a decoder corresponding to the first video playing application. .
  • the video frame data here is the video data obtained by decoding by the decoder, where the decoder is a decoder corresponding to the video playing application, not a system decoder of the Android system, and specifically may include a software decoder or a hardware decoder.
  • the decoders corresponding to different video playbacks may be different.
  • the format of the video frame data obtained by decoding corresponding to different video playing applications may also be different, that is, the format of the decoded video frame data corresponds to the video playing application.
  • the video playback application 1 corresponds to a video frame format 1 (first format)
  • the video playback application 2 corresponds to a video frame format 2 (first format).
  • the CPU converting the first format into the second format may include:
  • the CPU converts the first format into the second format according to the first video playing application corresponding to the first format.
  • the first format is a format of the video data obtained by decoding by the decoder corresponding to the first video playing application, and thus the CPU may use the first video playing application corresponding to the first format, Convert the first format to the second format.
  • the terminal may save the correspondence between the first video playing application and the third format, where the third format is a preset type format, and the second format is a third format corresponding to the first video playing application. Therefore, the step 2011 may specifically include: the CPU converting the first format into a third format corresponding to the first video playing application, the third format That is the second format.
  • the video playback application 1 corresponds to video frame format 3 (third format)
  • the video playback application 2 corresponds to video frame format 4 (third format).
  • the first format is the video frame format 2
  • the first video playing application corresponding to the video frame format 2 is the video playing application 2
  • the third format corresponding to the video playing application 2 is the video frame format 4, and thus, the CPU can Video frame format 2 (first format) is converted into video frame format 4 (second format).
  • the terminal may also store a correspondence between other video playback applications and video frame formats in the preset video, and the terminal may also pass The software upgrade and the like update and modify the correspondence between the video playback application and the video frame format saved in the terminal.
  • the correspondence between the first video playing application and the third format may be determined in a testing phase.
  • the format in the preset class format may be referred to as a fourth format.
  • the first format of the video frame data obtained by decoding by the decoder corresponding to the first video playing application may be converted into a preset type format.
  • the image processing unit can convert the fourth format into a target format, and the display unit can display the video layer picture represented by the video frame data of the target format, if the screen display condition is met, It can be determined that the fourth format belongs to the preset type format, and the third format is determined to be the format in which the video layer data represented by the corresponding video frame data has the highest resolution in the preset format; or, the third format can be determined.
  • the format is any of the preset class formats. Furthermore, the correspondence between the first video playing application corresponding to the first format and the determined third format may be saved.
  • the screen display conditions can be set according to actual needs. For example, a pixel on the display unit that can normally display an image is greater than or equal to a preset value.
  • the first format may be converted into a fourth format in the preset class format, and if the video frame data corresponding to the fourth format converted to this time satisfies the screen display condition, the current format is determined.
  • the corresponding relationship between the second format corresponding to the video playback application and the first format may be incorrect, and the video playback application may be deleted at this time.
  • the correspondence of the third format may be incorrect, and the video playback application may be deleted at this time.
  • the video layer may be displayed through a surface view surfaceview.
  • surfaceview has a separate drawing surface, which does not share the same drawing surface with its host window.
  • the surfaceview interface can be drawn in a separate thread without taking up the main thread resources, enabling a complex and efficient interface.
  • the method may further include:
  • the CPU creates a new video layer on the upper layer of the corresponding position of the original video layer corresponding to the video frame data, where the new video layer is used to cover the original video layer, and the new video layer corresponds to the new surface view new surface view.
  • the CPU may create a new video layer at a corresponding position of the original video layer by setting the width wide and the height height corresponding to the new video layer to be the same as the width width and the cover height corresponding to the original video layer. Moreover, the CPU can create a new video on the upper layer of the original video layer of the video frame by setting the zorder corresponding to the new video layer. Floor. In this way, the new video layer set can completely cover the original video layer.
  • the CPU acquires video frame data through an open graphics library opengl interface.
  • the CPU fills the new surface view new surfaceview with the video frame data obtained through the open graphics library opengl interface.
  • the video frame data in the new surface view is the video frame data corresponding to the new video layer
  • the video frame data corresponding to the new video layer is the video frame data corresponding to the original video layer
  • the terminal side Since the original video layer and the original surface view new surfaceview corresponding to the original video layer are created by the video playing application, the terminal side is not easy to modify and control them, so the CPU on the terminal side can create a new surface view new surfaceview and new
  • the video layer replaces the original surface view new surfaceview and the original video layer, so that the terminal components can be formatted and scaled by controlling the original surface view new surfaceview and the original video layer to achieve the purpose of reducing power consumption.
  • the user does not perceive, and the resolution, the frame rate, the playback speed, and the display content are not affected, and thus Will not reduce the user experience.
  • the CPU may convert the first format into the second format, which may include:
  • the CPU converts the first format corresponding to the video frame data in the new surface view new surfaceview into the second format.
  • the CPU can correspond to the new video layer corresponding to the first format corresponding to the video frame data in the new surface view new surfaceview. Convert to the second format.
  • the converting, by the CPU, the first format corresponding to the video frame data in the new surface view in the new surface view to the second format may include:
  • the CPU converts the first format corresponding to the video frame data in the new surface view new surfaceview into the second format through the underlying module nativesurface of the new surface view new surfaceview.
  • the underlying module nativesurface is used to support the function of the new surfaceview.
  • the CPU may first obtain video frame data (ie, data capture data catch) from the opengl interface through the nativesurface, and then copy the acquired video frame data (ie, data sharing data share), thereby converting the first format corresponding to the video frame into the second format. (ie data adjustment data adjust).
  • step 2010 the image processing unit can process the video data in the new surface view new surfaceview.
  • the foregoing step 202 may specifically include:
  • the image processing unit converts the second format corresponding to the video frame data into the target format in the new surface view new surface view.
  • the foregoing step 203 may specifically include:
  • the image processing unit scales a new video layer image represented by the video frame data that has been converted into the target format in the new surface view new surfaceview.
  • the original video layer may correspond to the original surface view.
  • the method may further include:
  • the display unit stops displaying the original video layer picture corresponding to the original surface view of the original surface view.
  • the CPU sends the video frame data corresponding to the original video layer to the GPU, the image processing unit, and the display unit for processing.
  • the original video layer picture does not need to be displayed again.
  • the CPU may stop sending the video frame data in the original surface view to the GPU, the image processing unit, and the display unit for processing, and the display unit may stop displaying the original video layer image, and display the new surface view new surfaceview new Video layer picture.
  • the CPU can stop displaying the original video layer by setting the transparency of the new video layer to be non-transparent.
  • the transparency of the new video layer is non-transparent, the original video layer is completely occluded, and the terminal will not continue to perform the display processing flow on the original video layer, and the display unit will no longer display the original video layer picture.
  • the CPU does not need to set the transparency of the new video layer to be non-transparent.
  • the CPU inserts a new surface view new surfaceview into the view hierarchy viewhieiarchy where the original surfaceview is located.
  • Viewhieiarchy is a tree-tree structure of the view view, including all views and attributes of all views, such as the wide coordinate information of the view, the height coordinate information, and the z-axis coordinate information. Based on this information, the layout of the entire screen can be obtained. Viewhieiarchy can correspond to video playback applications.
  • the CPU can insert the new surface view new surfaceview into the view hierarchy viewhieiarchy where the original surfaceview is located, so that the new surface view new surfaceview can be merged with other views in the screen, thus in the new surface view.
  • the new surfaceview replaces the original surface view corresponding to the original video layer, it does not affect the overall layout of the screen, and does not change the normal display of the screen.
  • step 209 may be performed after step 205 and before step 2040.
  • the above step 204 may specifically include:
  • the display unit displays the scaled target video layer picture, and the target video layer picture is a new video layer picture represented by the video frame data of the target format in the new surface view new surfaceview.
  • the method may further include:
  • the image processing unit scales the video layer picture represented by the video frame data, so that the size of the scaled video layer picture matches the size of the display unit.
  • the display unit displays the scaled video layer screen.
  • the image processing unit can directly process the video frame data of the first format.
  • the video frame data obtained by decoding by the system decoder may be directly sent to the image processing unit for processing.
  • the method can also include:
  • the display unit displays a bullet layer and/or a logo logo layer.
  • the terminal includes corresponding hardware structures and/or software modules for performing various functions.
  • the present application can be implemented in a combination of hardware or hardware and computer software in combination with the algorithmic steps of the various examples described in the embodiments disclosed herein. Whether a function is implemented in hardware or computer software to drive hardware depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present application.
  • the embodiment of the present application may divide the function module into the terminal according to the foregoing method example.
  • each function module may be divided according to each function, or two or more functions may be integrated into one processing module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of the module in the embodiment of the present application is schematic, and is only a logical function division, and the actual implementation may have another division manner.
  • FIG. 8 is a schematic diagram showing a possible composition of the terminal 30 involved in the foregoing embodiment.
  • the terminal 30 may include: at least one processor. 31. Image processing unit 32, screen 33, memory 34, and bus 35.
  • the processor 31, the image processing unit 32, the screen 33, and the memory 34 are connected by a bus 35.
  • the memory 34 is used to store instructions.
  • the processor 31 is configured to execute an instruction to: convert the first format into the second format when the first format corresponding to the decoded video frame data is not the preset class format.
  • the video frame data is used to represent the video layer picture
  • the second format is a preset type format
  • the preset class format is a format that the image processing unit can recognize.
  • the image processing unit 32 is configured to execute an instruction to: convert the second format into a target format, the target format is a data frame format used by the display unit for display, and scale the video layer image represented by the video frame data of the target format, so that The size of the scaled video layer picture matches the size of the display unit.
  • the screen 33 is for supporting the terminal to execute step 204 in the data processing method shown in FIG. 5, step 208 and step 2040 in FIG.
  • the processor 31 is further configured to support the terminal to perform steps 205-207, step 2010, and step 209 in the data processing method shown in FIG. 6.
  • the image processing unit 32 can also be used to support the terminal to perform steps 2020 and 2030 in the data processing method shown in FIG. 6.
  • the terminal provided in the embodiment of the present application is configured to execute the foregoing data processing method, so that the same effect as the data processing method described above can be achieved.
  • FIG. 9 shows another possible composition diagram of the terminal 40 involved in the above embodiment.
  • the terminal 40 includes a processing module 41 and a communication module 42.
  • the processing module 41 is configured to control and manage the actions of the terminal 40.
  • the processing module 41 is configured to support the terminal 40 to perform the operations of the processor 31, the image processing unit 32, and the screen 33 shown in FIG. 8, and/or for the purposes of this document. Other processes of the described techniques.
  • the communication module 42 is used to support communication between the terminal and other network entities. Terminal also A storage module 43 may be included for performing the operations of the memory 34 shown in FIG. 8, storing the program code and data of the terminal 40.
  • the processing module 41 can be a processor or a controller. It is possible to implement or carry out the various illustrative logical blocks, modules and circuits described in connection with the present disclosure.
  • the processor can also be a combination of computing functions, for example, including one or more microprocessor combinations, a combination of a digital signal processor (DSP) and a microprocessor, and the like.
  • the communication module 42 can be a transceiver, a transceiver circuit, a communication interface, or the like.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of modules or units is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or It can be integrated into another device, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may be one physical unit or multiple physical units, that is, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • An integrated unit can be stored in a readable storage medium if it is implemented as a software functional unit and sold or used as a standalone product.
  • the technical solution of the embodiments of the present application may be embodied in the form of a software product in the form of a software product in essence or in the form of a contribution to the prior art, and the software product is stored in a storage medium.
  • a number of instructions are included to cause a device (which may be a microcontroller, chip, etc.) or a processor to perform all or part of the steps of the various embodiments of the present application.
  • the foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.

Abstract

Provided are a data processing method and a terminal, relating to the technical field of terminals and able to save the electric quantity of terminals. The specific solution involves: a terminal comprises a central processing unit (CPU), an image processing unit and a display unit, and when a first format corresponding to decoded video frame data is not a pre-set type format, the CPU converts the first format into a second format, wherein the video frame data is used for representing a video layer picture, the second format is the pre-set type format, and the pre-set type format is a format that can be recognized by the image processing unit; the image processing unit converts the second format into a target format, wherein the target format is a data frame format for display by the display unit; and the image processing unit zooms a video layer picture represented by video frame data of the target format, so that the size of the zoomed video layer picture matches the size of the display unit. The embodiment of the present application is used for playing video.

Description

一种数据处理方法及终端Data processing method and terminal
本申请要求于2017年3月27日提交中国专利局、申请号为201710189121.9、申请名称为“一种视频播放的方法和设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. PCT Application No. No. No. No. No. No. No. No. No. No. No. No. No. in.
技术领域Technical field
本申请涉及终端技术领域,尤其涉及一种数据处理方法及终端。The present application relates to the field of terminal technologies, and in particular, to a data processing method and a terminal.
背景技术Background technique
在手机安卓系统中,大部分视频播放应用均支持通用视频格式如MP4、3GP、RMVB和AVI等。对于这些通用视频格式,安卓系统软硬件都默认支持,因此,安卓系统的系统解码器可以对通用格式的视频源数据进行解码,从而将解码后的视频帧数据送到MDP等图像处理单元进行缩放,进而送到显示单元进行显示。In mobile Android, most video playback applications support common video formats such as MP4, 3GP, RMVB and AVI. For these common video formats, the Android system software and hardware are supported by default. Therefore, the system decoder of the Android system can decode the video source data of the general format, and then send the decoded video frame data to the image processing unit such as MDP for scaling. And then sent to the display unit for display.
但由于视频源不同、支持的平台不同以及历史问题等原因,一些视频播放应用可能采用通用视频格式以外的其它视频格式,对视频源数据进行编码。相应地,对于这些非通用视频格式的视频源数据,视频播放应用通过系统解码器以外的其它解码器进行解码,而解码获得的视频帧数据的格式通常不能和手机硬件匹配,因而不能直接送到手机的图像处理单元和显示单元进行处理。参见图1,现有技术采用的方案为,图形处理器(graphics processing unit,GPU)将该视频帧数据的格式转换成可以直接用于显示的目标格式,并将视频帧数据表示的视频层画面缩放到与显示单元相匹配的尺寸后,再送到图像处理单元和显示单元进行处理。However, due to different video sources, different supported platforms, and historical issues, some video playback applications may encode video source data using other video formats than the common video format. Correspondingly, for video source data of these non-universal video formats, the video playing application decodes through a decoder other than the system decoder, and the format of the decoded video frame data is usually not matched with the mobile phone hardware, and thus cannot be directly sent. The image processing unit of the mobile phone and the display unit perform processing. Referring to FIG. 1 , a solution adopted by the prior art is that a graphics processing unit (GPU) converts the format of the video frame data into a target format that can be directly used for display, and displays a video layer image of the video frame data. After being scaled to the size matching the display unit, it is sent to the image processing unit and the display unit for processing.
其中,在播放视频时,通过GPU将视频帧数据的格式转换成可以直接用于显示的目标格式,并将视频层画面缩放到与显示单元相匹配的尺寸,将会耗费手机较多的电量,降低用户使用体验。Wherein, when the video is played, the format of the video frame data is converted into a target format that can be directly used for display by the GPU, and the video layer picture is scaled to a size matching the display unit, which consumes more power of the mobile phone. Reduce the user experience.
发明内容Summary of the invention
本申请实施例提供一种数据处理方法及终端,能够降低视频播放时的耗电量,提高用户使用体验。The embodiment of the present invention provides a data processing method and a terminal, which can reduce power consumption during video playback and improve user experience.
为达到上述目的,本申请实施例采用如下技术方案:To achieve the above objective, the embodiment of the present application adopts the following technical solutions:
第一方面,本申请实施例提供了一种数据处理方法,应用于终端,该终端包括中央处理单元(central processing unit,CPU)、图像处理单元和显示单元,该方法包括:当解码后的视频帧数据对应的第一格式不是预设类格式时,CPU将第一格式转换成第二格式。其中,视频帧数据用于表示视频层画面,第二格式为预设类格式,预设类格式为图像处理单元能够识别的格式。图像处理单元将第二格式转换成目标格式,该目标格式为显示单元用于显示的数据帧格式。图像处理单元将目标格式的视频帧数据表示的视频层画面进行缩放,以使得缩放后的视频层画面的尺寸与显示单元的尺寸相匹 配。In a first aspect, the embodiment of the present application provides a data processing method, which is applied to a terminal, where the terminal includes a central processing unit (CPU), an image processing unit, and a display unit, and the method includes: when the decoded video When the first format corresponding to the frame data is not the preset type format, the CPU converts the first format into the second format. The video frame data is used to represent the video layer picture, the second format is a preset type format, and the preset class format is a format that the image processing unit can recognize. The image processing unit converts the second format into a target format, which is a data frame format used by the display unit for display. The image processing unit scales the video layer picture represented by the video frame data of the target format such that the size of the scaled video layer picture matches the size of the display unit Match.
这样,可以通过更小、更简单的图像处理单元来代替GPU进行一部分格式转换操作和缩放操作,因而耗电量更小,能够提高用户的使用体验。In this way, a smaller, simpler image processing unit can be used instead of the GPU to perform a part of the format conversion operation and the zoom operation, thereby consuming less power and improving the user experience.
结合第一方面,在一种可能的实现方式中,该方法还包括:显示单元显示缩放后的视频层画面。In conjunction with the first aspect, in a possible implementation manner, the method further includes: the display unit displaying the scaled video layer picture.
即,显示单元可以将图像处理单元缩放后的视频层画面进行显示。That is, the display unit can display the video layer screen after the image processing unit is scaled.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,第一格式与第一视频播放应用对应,第一格式的视频帧数据为通过第一视频播放应用对应的解码器对视频源数据进行解码获得的数据。With reference to the first aspect and the foregoing possible implementation manner, in another possible implementation manner, the first format is corresponding to the first video playing application, and the video frame data of the first format is a decoder corresponding to the first video playing application. Data obtained by decoding video source data.
也就是说,CPU所处理的第一格式,为第一视频播放应用对应的解码器解码获得的视频帧数据的格式。That is to say, the first format processed by the CPU is the format of the video frame data obtained by decoding the decoder corresponding to the first video playing application.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,CPU将第一格式转换成第二格式包括:CPU根据与第一格式对应的第一视频播放应用,将第一格式转换成第二格式。In combination with the first aspect and the foregoing possible implementation manner, in another possible implementation manner, the CPU converting the first format into the second format includes: the CPU, according to the first video playback application corresponding to the first format, the first The format is converted to the second format.
由于第一格式为第一视频播放应用对应的解码器解码获得的视频帧数据的格式,因而CPU可以根据第一视频播放应用,将第一格式转换成第二格式。Since the first format is the format of the video frame data obtained by decoding by the decoder corresponding to the first video playing application, the CPU may convert the first format into the second format according to the first video playing application.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,终端保存有第一视频播放应用与第三格式的对应关系,第三格式为预设类格式,第二格式为与第一视频播放应用对应的第三格式。With reference to the first aspect and the foregoing possible implementation manner, in another possible implementation manner, the terminal saves a correspondence between the first video playing application and the third format, where the third format is a preset type format, and the second format is A third format corresponding to the first video playback application.
这样,CPU可以根据预先保存的第一视频播放应用于第三格式的对应关系,将与第一视频播放应用对应的第一格式转换成第三格式。In this way, the CPU may convert the first format corresponding to the first video playing application into the third format according to the correspondence between the first video playback saved in advance and the third format.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,视频层通过表面视图surfaceview展示,在CPU将第一格式转换成第二格式之前,该方法还包括:CPU在视频帧数据对应的原视频层的对应位置的上层创建新视频层,新视频层用于覆盖原视频层,新视频层对应新表面视图new surfaceview。CPU通过开放图形库(open graphics library,opengl)接口获取视频帧数据。CPU用通过opengl接口获取的视频帧数据,填充新表面视图new surfaceview。In combination with the first aspect and the foregoing possible implementation manners, in another possible implementation manner, the video layer is displayed through a surface view surfaceview, and before the CPU converts the first format into the second format, the method further includes: the CPU is in the video. A new video layer is created on the upper layer of the corresponding position of the original video layer corresponding to the frame data, the new video layer is used to cover the original video layer, and the new video layer corresponds to the new surface view new surface view. The CPU acquires video frame data through an open graphics library (opengl) interface. The CPU fills in the new surface view new surfaceview with the video frame data acquired through the opengl interface.
由于原视频层及对应的原表面视图new surfaceview是由视频播放应用创建的,终端侧不易进行修改和控制,因而终端可以通过创建新表面视图new surfaceview和新视频层,来代替原表面视图new surfaceview和原视频层,从而对新表面视图new surfaceview和新视频层进行操作。Since the original video layer and the corresponding original surface view new surfaceview are created by the video playing application, the terminal side is not easy to modify and control, so the terminal can replace the original surface view by creating a new surface view new surfaceview and a new video layer. And the original video layer to operate on the new surface view new surfaceview and the new video layer.
并且,通过在原视频层的对应位置的上层创建一个新视频层以代替原视频层的方式,用户不会感知到,且分辨率、帧率、播放速度、显示内容均不会收到影响,因而不会降低用户的使用体验。Moreover, by creating a new video layer on the upper layer of the corresponding position of the original video layer instead of the original video layer, the user does not perceive, and the resolution, the frame rate, the playback speed, and the display content are not affected, and thus Will not reduce the user experience.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,CPU将第一格式转换成第二格式包括:CPU将新表面视图new surfaceview中的视频帧数据对应的第一格式转换成第二格式。With reference to the first aspect and the foregoing possible implementation manner, in another possible implementation manner, the CPU converting the first format into the second format includes: the first format corresponding to the video frame data in the new surface view new surface view of the CPU Convert to the second format.
这样,CPU可以将新视频层对应的新表面视图new surfaceview中的视频帧数据对应的第一格式转换成第二格式。 In this way, the CPU can convert the first format corresponding to the video frame data in the new surface view new surface view corresponding to the new video layer into the second format.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,CPU将新表面视图new surfaceview中的视频帧数据对应的第一格式转换成第二格式包括:CPU通过新表面视图new surfaceview的底层模块nativesurface,将新表面视图new surfaceview中的视频帧数据对应的第一格式转换成第二格式。With reference to the first aspect and the foregoing possible implementation manners, in another possible implementation manner, the CPU converts the first format corresponding to the video frame data in the new surface view new surface view into the second format, including: the CPU passes the new surface view. The undersurface module nativesurface of the new surfaceview converts the first format corresponding to the video frame data in the new surface view new surfaceview into the second format.
其中,CPU具体可以通过底层模块将第一格式转换成第二格式。The CPU specifically converts the first format into the second format by using the underlying module.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,图像处理单元将第二格式转换成目标格式包括:图像处理单元将新表面视图new surfaceview中,视频帧数据对应的第二格式转换成目标格式。图像处理单元将目标格式的视频帧数据表示的视频层画面进行缩放包括:图像处理单元将新表面视图new surfaceview中,已转换成目标格式的视频帧数据表示的新视频层画面进行缩放。With reference to the first aspect and the foregoing possible implementation manner, in another possible implementation manner, the image processing unit converting the second format into the target format includes: the image processing unit corresponding to the video frame data in the new surface view new surface view The second format is converted to the target format. The image processing unit scaling the video layer picture represented by the video frame data of the target format includes: the image processing unit scales the new video layer picture represented by the video frame data converted into the target format in the new surface view new surfaceview.
也就是说,图像处理单元具体可以将新表面视图new surfaceview中,视频帧数据对应的第二格式转换成目标格式,并将新表面视图new surfaceview中,已转换成目标格式的视频帧数据表示的新视频层画面进行缩放。That is, the image processing unit may specifically convert the second format corresponding to the video frame data into the target format in the new surface view new surface view, and convert the video image data converted into the target format in the new surface view new surfaceview. The new video layer picture is scaled.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,原视频层对应原表面视图original surfaceview,该方法还包括:显示单元停止显示原表面视图original surfaceview对应的原视频层画面。CPU将新表面视图new surfaceview插入原表面视图original surfaceview所在的视图层级结构viewhieiarchy中。显示单元显示缩放后的视频层画面包括:显示单元显示缩放后的目标视频层画面,目标视频层画面为新表面视图new surfaceview中,已转换成目标格式的视频帧数据表示的新视频层画面。With reference to the first aspect and the foregoing possible implementation manner, in another possible implementation manner, the original video layer corresponds to an original surface view, and the method further includes: the display unit stops displaying the original video layer corresponding to the original surface view original surface view Picture. The CPU inserts the new surface view new surfaceview into the view hierarchy viewhieiarchy in which the original surface view is located. The display unit displays the scaled video layer picture including: the display unit displays the scaled target video layer picture, and the target video layer picture is a new video layer picture in the new surface view new surfaceview that has been converted into the target format video frame data.
这样,终端可以不再显示原视频层画面,而通过显示新视频层画面进行替代。In this way, the terminal can no longer display the original video layer picture, but replace it by displaying a new video layer picture.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,第二格式为YUV类型的格式。In combination with the first aspect and the above possible implementation manners, in another possible implementation manner, the second format is a YUV type format.
这样,CPU可以将第一格式转换成YUV类型的第二格式。In this way, the CPU can convert the first format to the second format of the YUV type.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,CPU在视频帧数据对应的原视频层的对应位置的上层创建新视频层包括:CPU通过设置新视频层对应的zorder,在视频帧原视频层对应位置的上层创建新视频层。With reference to the first aspect and the foregoing possible implementation manner, in another possible implementation manner, the CPU creates a new video layer on a higher layer of a corresponding position of the original video layer corresponding to the video frame data, including: the CPU corresponding to setting a new video layer Zorder creates a new video layer on the upper layer of the corresponding position of the original video layer of the video frame.
这样,CPU可以通过zorder设置新视频层与原视频层的上下层关系。In this way, the CPU can set the upper and lower layers of the new video layer and the original video layer through zorder.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,当解码后的视频帧数据对应的第一格式为预设类格式时,该方法还包括:图像处理单元将视频帧数据表示的视频层画面进行缩放,以使得缩放后的视频层画面的尺寸与显示单元的尺寸相匹配,显示单元显示缩放后的视频层画面。With reference to the first aspect and the foregoing possible implementation manner, in another possible implementation manner, when the first format corresponding to the decoded video frame data is a preset class format, the method further includes: the image processing unit is configured to: The video layer picture represented by the frame data is scaled such that the size of the scaled video layer picture matches the size of the display unit, and the display unit displays the scaled video layer picture.
这样,当解码后的视频帧数据对应的第一格式为图像处理单元能够识别的预设类格式时,图像处理单元可以直接对第一格式的视频帧数据进行处理。In this way, when the first format corresponding to the decoded video frame data is a preset type format that can be recognized by the image processing unit, the image processing unit can directly process the video frame data of the first format.
第二方面,本申请实施例提供一种终端,包括至少一个处理器、图像处理单元、屏幕、存储器和总线。其中,处理器、图像处理单元、屏幕和存储器通过总线相连。存储器用于存储指令。处理器用于执行指令以执行:当解码后的视频帧数据对应的第一格式不是预设类格式时,将第一格式转换成第二格式,视频帧数据用于表示视频层画面,第二格式为预设类格式,预设类格式为图像处理单元能够识别的格式。图像处理单元用于执行指令以执行:将第二格式转换成目标格式,目标格式为显示单元用于 显示的数据帧格式,将目标格式的视频帧数据表示的视频层画面进行缩放,以使得缩放后的视频层画面的尺寸与显示单元的尺寸相匹配。In a second aspect, an embodiment of the present application provides a terminal, including at least one processor, an image processing unit, a screen, a memory, and a bus. The processor, the image processing unit, the screen, and the memory are connected by a bus. The memory is used to store instructions. The processor is configured to execute an instruction to: when the first format corresponding to the decoded video frame data is not a preset type format, convert the first format into a second format, where the video frame data is used to represent the video layer picture, and the second format For the preset class format, the preset class format is a format that the image processing unit can recognize. The image processing unit is configured to execute an instruction to: convert the second format into a target format, and the target format is a display unit for The displayed data frame format scales the video layer picture represented by the video frame data of the target format such that the size of the scaled video layer picture matches the size of the display unit.
结合第二方面,在一种可能的实现方式中,显示单元用于执行指令以执行:显示缩放后的视频层画面。In conjunction with the second aspect, in a possible implementation, the display unit is configured to execute an instruction to perform: displaying the scaled video layer picture.
结合第二方面和上述可能的实现方式,在另一种可能的实现方式中,第一格式与第一视频播放应用相对应,第一格式的视频帧数据为通过第一视频播放应用对应的解码器对视频源数据进行解码获得的数据。With reference to the second aspect and the foregoing possible implementation manner, in another possible implementation manner, the first format corresponds to the first video playing application, and the video frame data of the first format is the decoding corresponding to the first video playing application. The data obtained by decoding the video source data.
结合第二方面和上述可能的实现方式,在另一种可能的实现方式中,处理器具体用于:根据与第一格式对应的第一视频播放应用,将第一格式转换成第二格式。With reference to the second aspect and the foregoing possible implementation manner, in another possible implementation, the processor is specifically configured to: convert the first format into the second format according to the first video playing application corresponding to the first format.
结合第二方面和上述可能的实现方式,在另一种可能的实现方式中,终端保存有第一视频播放应用与第三格式的对应关系,第三格式为预设类格式,第二格式为与第一视频播放应用对应的第三格式。With reference to the second aspect and the foregoing possible implementation manner, in another possible implementation manner, the terminal saves a correspondence between the first video playing application and the third format, where the third format is a preset type format, and the second format is A third format corresponding to the first video playback application.
结合第二方面和上述可能的实现方式,在另一种可能的实现方式中,视频层通过表面视图surfaceview展示,处理器还用于:在将第一格式转换成第二格式之前,在视频帧数据对应的原视频层的对应位置的上层创建新视频层,新视频层用于覆盖原视频层,新视频层对应新表面视图new surfaceview。通过opengl接口获取视频帧数据。用通过opengl接口获取的视频帧数据,填充新表面视图new surfaceview。With reference to the second aspect and the foregoing possible implementation manners, in another possible implementation manner, the video layer is displayed by a surface view surfaceview, and the processor is further configured to: before converting the first format into the second format, in the video frame A new video layer is created on the upper layer of the corresponding position of the original video layer corresponding to the data, the new video layer is used to cover the original video layer, and the new video layer corresponds to the new surface view new surface view. Obtain video frame data through the opengl interface. Fill in the new surface view new surfaceview with the video frame data obtained through the opengl interface.
结合第二方面和上述可能的实现方式,在另一种可能的实现方式中,处理器具体用于:将新表面视图new surfaceview中的视频帧数据对应的第一格式转换成第二格式。With reference to the second aspect and the foregoing possible implementation manners, in another possible implementation manner, the processor is specifically configured to: convert the first format corresponding to the video frame data in the new surface view new surface view into the second format.
结合第二方面和上述可能的实现方式,在另一种可能的实现方式中,处理器具体用于:通过新表面视图new surfaceview的底层模块nativesurface,将新表面视图new surfaceview中的视频帧数据对应的第一格式转换成第二格式。With reference to the second aspect and the foregoing possible implementation manners, in another possible implementation manner, the processor is specifically configured to: corresponding to the video frame data in the new surface view new surface view by using the bottom surface module nativesurface of the new surface view new surface view The first format is converted to the second format.
结合第二方面和上述可能的实现方式,在另一种可能的实现方式中,图像处理单元具体用于:将新表面视图new surfaceview中,视频帧数据对应的第二格式转换成目标格式。将新表面视图new surfaceview中,已转换成目标格式的视频帧数据表示的新视频层画面进行缩放。With reference to the second aspect and the foregoing possible implementation manners, in another possible implementation manner, the image processing unit is specifically configured to: convert the second format corresponding to the video frame data into the target format in the new surface view new surface view. The new video layer picture represented by the video frame data that has been converted into the target format is scaled in the new surface view new surfaceview.
结合第二方面和上述可能的实现方式,在另一种可能的实现方式中,原视频层对应原表面视图original surfaceview,显示单元用于,停止显示原表面视图original surfaceview对应的原视频层画面。处理器还用于,将新表面视图new surfaceview插入原表面视图original surfaceview所在的视图层级结构viewhieiarchy中。显示单元具体用于:显示缩放后的目标视频层画面,目标视频层画面为新表面视图new surfaceview中,已转换成目标格式的视频帧数据表示的新视频层画面。With reference to the second aspect and the foregoing possible implementation manners, in another possible implementation manner, the original video layer corresponds to the original surface view original surface view, and the display unit is configured to stop displaying the original video layer picture corresponding to the original surface view original surface view. The processor is further configured to insert the new surface view new surfaceview into the view hierarchy viewhieiarchy where the original surface view is located. The display unit is specifically configured to: display the scaled target video layer picture, and the target video layer picture is a new video layer picture that has been converted into a video frame data representation of the target format in the new surface view new surfaceview.
结合第二方面和上述可能的实现方式,在另一种可能的实现方式中,第二格式为YUV类型的格式。In combination with the second aspect and the above possible implementation manners, in another possible implementation manner, the second format is a YUV type format.
第三方面,本申请实施例提供了一种装置,该装置以芯片的产品形态存在,该装置的结构中包括处理器和存储器,该存储器用于与处理器耦合,保存该装置必要的程序指令和数据,该处理器用于执行存储器中存储的程序指令,使得该装置执行上述方法中数据处理的功能。In a third aspect, an embodiment of the present application provides a device, which is in the form of a product of a chip. The device includes a processor and a memory, and the memory is coupled to the processor to save necessary program instructions of the device. And data, the processor for executing program instructions stored in the memory such that the apparatus performs the functions of data processing in the above method.
第四方面,本申请实施例提供了一种计算机可读存储介质,该存储介质包括指令, 当其在终端上运行时,使得终端执行如上述第一方面及第一方面任一项中的数据处理方法。In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, where the storage medium includes an instruction, When it is running on the terminal, the terminal is caused to perform the data processing method according to any of the first aspect and the first aspect described above.
第五方面,本申请实施例提供了一种包含指令的计算机程序产品,当其在终端上运行时,使得终端执行如上述第一方面及第一方面任一项中的数据处理方法。In a fifth aspect, the embodiment of the present application provides a computer program product including instructions, when the terminal is running on the terminal, causing the terminal to perform the data processing method in any one of the foregoing first aspect and the first aspect.
其中,关于上述第二方面至第五方面的有益效果,可以参见上述第一方面中的相应描述,这里不再赘述。For the beneficial effects of the foregoing second to fifth aspects, reference may be made to the corresponding description in the above first aspect, and details are not described herein again.
附图说明DRAWINGS
图1为现有技术中提供的一种数据处理方法流程图;1 is a flow chart of a data processing method provided in the prior art;
图2为本申请实施例提供的一种手机的结构示意图;2 is a schematic structural diagram of a mobile phone according to an embodiment of the present application;
图3为本申请实施例提供的一种数据处理方法流程图;FIG. 3 is a flowchart of a data processing method according to an embodiment of the present application;
图4为本申请实施例提供的另一种数据处理方法流程图;4 is a flowchart of another data processing method according to an embodiment of the present application;
图5为本申请实施例提供的另一种数据处理方法流程图;FIG. 5 is a flowchart of another data processing method according to an embodiment of the present application;
图6为本申请实施例提供的另一种数据处理方法流程图;FIG. 6 is a flowchart of another data processing method according to an embodiment of the present application;
图7为本申请实施例提供的另一种数据处理方法流程图;FIG. 7 is a flowchart of another data processing method according to an embodiment of the present application;
图8为本申请实施例提供的一种终端的结构示意图;FIG. 8 is a schematic structural diagram of a terminal according to an embodiment of the present application;
图9为本申请实施例提供的另一种终端的结构示意图。FIG. 9 is a schematic structural diagram of another terminal according to an embodiment of the present application.
具体实施方式detailed description
由于图1所示的现有技术在进行视频播放时,通过GPU将视频帧数据的格式转换成可以直接用于显示单元显示的目标格式,并将视频层画面缩放到与显示单元相匹配的尺寸,从而耗费了较多的电量,降低了用户使用体验。而本申请实施例提供的数据处理方法可以在视频播放时降低耗电量,主要原理为:通过更简单、耗电量更小的图像处理单元来代替GPU进行一部分格式转换操作和缩放操作。Since the prior art shown in FIG. 1 performs video playback, the format of the video frame data is converted by the GPU into a target format that can be directly used for display of the display unit, and the video layer picture is scaled to a size matching the display unit. This consumes more power and reduces the user experience. The data processing method provided by the embodiment of the present application can reduce the power consumption during video playback. The main principle is: replacing the GPU with a part of the format conversion operation and the zoom operation by using a simpler and less power-consuming image processing unit.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise stated, "/" means the meaning of or, for example, A/B may represent A or B; "and/or" herein is merely a description of the associated object. The association relationship indicates that there may be three relationships, for example, A and/or B, which may indicate that there are three cases in which A exists separately, A and B exist at the same time, and B exists separately. In addition, in the description of the embodiments of the present application, "a plurality" means two or more than two.
本申请实施例提供的数据处理方法可以适用于能够进行视频播放的终端。示例性的,这里的终端可以为手机、平板电脑、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等。The data processing method provided by the embodiment of the present application can be applied to a terminal capable of video playback. Exemplarily, the terminal here may be a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or the like.
具体的,本申请实施例以终端为手机为例,对本申请实施例提供的数据处理方法进行介绍。下面结合附图2对手机100的各个构成部件进行具体的介绍:Specifically, the data processing method provided by the embodiment of the present application is introduced by using the terminal as a mobile phone as an example. The components of the mobile phone 100 will be specifically described below with reference to FIG. 2:
如图2所示,手机100可以包括:屏幕101、处理器102、存储器103、电源104、射频(radio frequency,RF)电路105、重力传感器106、音频电路107、显卡108、GPU 109、图像处理单元110等部件,这些部件之间可以以总线连接,也可以直连连接。本领域技术人员可以理解,图1中示出的手机结构并不构成对手机的限定,可以 包括比图示更多的部件,或者组合某些部件,或者不同的部件布置。As shown in FIG. 2, the mobile phone 100 may include: a screen 101, a processor 102, a memory 103, a power source 104, a radio frequency (RF) circuit 105, a gravity sensor 106, an audio circuit 107, a video card 108, a GPU 109, and image processing. Units such as unit 110, which may be connected by a bus or directly connected. Those skilled in the art can understand that the structure of the mobile phone shown in FIG. 1 does not constitute a limitation on the mobile phone, and It includes more components than the illustrations, or some components, or different component arrangements.
其中,屏幕101具体可以是触摸显示屏或非触摸显示屏,可以用于界面显示,进行视频播放、图片浏览等。The screen 101 may specifically be a touch display screen or a non-touch display screen, and may be used for interface display, video play, picture browsing, and the like.
处理器102是手机100的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器103内的软件程序和/或模块,以及调用存储在存储器103内的数据,执行手机100的各种功能和处理数据,从而对手机100进行整体监控。在具体实现中,作为一种实施例,处理器102可包括一个或多个处理单元;处理器102可集成应用处理器和调制解调处理器。其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器102中。The processor 102 is the control center of the handset 100, which connects various portions of the entire handset using various interfaces and lines, by running or executing software programs and/or modules stored in the memory 103, and recalling data stored in the memory 103, The various functions and processing data of the mobile phone 100 are executed to perform overall monitoring of the mobile phone 100. In a particular implementation, as an embodiment, processor 102 can include one or more processing units; processor 102 can integrate an application processor and a modem processor. The application processor mainly processes an operating system, a user interface, an application, and the like, and the modem processor mainly processes wireless communication. It will be appreciated that the above described modem processor may also not be integrated into the processor 102.
存储器103可用于存储数据、软件程序以及模块,可以是易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM);或者非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,ROM),快闪存储器(flash memory),硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD);或者上述种类的存储器的组合。具体的,存储器103内可存储程序代码,该程序代码用于使处理器102通过执行该程序代码,执行本申请实施例提供的数据处理方法。The memory 103 can be used to store data, software programs, and modules, and can be a volatile memory, such as a random-access memory (RAM), or a non-volatile memory. For example, a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); or a combination of the above types of memories. Specifically, the program code is stored in the memory 103, and the program code is used to enable the processor 102 to execute the data processing method provided by the embodiment of the present application by executing the program code.
电源104,可以为电池,通过电源管理系统与处理器102逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The power source 104, which can be a battery, is logically coupled to the processor 102 through a power management system to manage functions such as charging, discharging, and power management through the power management system.
RF电路105可用于收发信息或通话过程中,信号的接收和发送,特别地,将接收到的信息给处理器102处理;另外,将处理器102生成的信号发送出去。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(low noise amplifier,LNA)、双工器等。此外,RF电路105还可以通过无线通信与网络和其他设备通信。The RF circuit 105 can be used for transmitting and receiving information or during a call, receiving and transmitting signals, and in particular, processing the received information to the processor 102; in addition, transmitting the signals generated by the processor 102. Generally, RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, and the like. In addition, RF circuit 105 can also communicate with the network and other devices via wireless communication.
重力传感器(gravity sensor)106,可以采集手机在各个方向上(一般为三轴)加速度的大小,静止时可采集出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等。需要说明的是,手机100还可以包括其它传感器,比如压力传感器、光传感器、陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。The gravity sensor 106 can collect the acceleration of the mobile phone in various directions (usually three axes), and can collect the magnitude and direction of gravity when stationary, and can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching, related Game, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping). It should be noted that the mobile phone 100 may further include other sensors, such as a pressure sensor, a light sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, and the like, and details are not described herein.
音频电路107用于提供用户与手机100之间的音频接口。The audio circuit 107 is used to provide an audio interface between the user and the handset 100.
显卡108是手机进行数模信号转换的设备,并且具有图像处理能力,可以协助完成处理器102的工作,提高手机100的整体运行速度。The video card 108 is a device for digital-to-analog signal conversion of the mobile phone, and has image processing capability, which can assist the completion of the work of the processor 102 and improve the overall running speed of the mobile phone 100.
GPU 109即显卡的处理器,是一种复杂的运算单元,包含大量的逻辑阵列,用于将手机100所需要的显示信息进行转换驱动,并向屏幕101提供行扫描信号,控制屏幕101的正确显示,可以执行图形渲染所需的复杂的数学和几何计算。The GPU 109 is a processor of a graphics card, which is a complex arithmetic unit, and includes a large number of logic arrays for converting and driving display information required by the mobile phone 100, and providing a line scan signal to the screen 101 to control the correctness of the screen 101. Display, you can perform complex mathematical and geometric calculations required for graphics rendering.
图像处理单元110是一种简单的硬件逻辑单元,包含较少的逻辑阵列,且体积小、功耗小,通常用于将图像缩放到与屏幕101的尺寸相匹配的大小,例如可以是MDP单元(高通)或DSS单元(海思)等。在一种实现方式中,图像处理单元110还可以集成在处理器110或手机100的其它芯片中。 The image processing unit 110 is a simple hardware logic unit that contains fewer logic arrays and is small in size and low in power consumption, and is generally used to scale an image to a size that matches the size of the screen 101, such as an MDP unit. (Qualcomm) or DSS unit (His) and so on. In one implementation, image processing unit 110 may also be integrated into processor 110 or other chips of handset 100.
其中,音频电路107、显卡108,GPU 109以及图像处理单元110,可以用于配合上述屏幕101和处理器102进行视频播放。The audio circuit 107, the video card 108, the GPU 109, and the image processing unit 110 can be used to perform video playback in conjunction with the screen 101 and the processor 102.
尽管未示出,手机100还可以包括无线保真(wireless fidelity,WiFi)模块、蓝牙模块、摄像头等功能模块,在此不再一一赘述。Although not shown, the mobile phone 100 may further include a wireless fidelity (WiFi) module, a Bluetooth module, a camera, and the like, and details are not described herein.
为使本申请实施例的目的、技术方案和优点更加清楚,下面结合图2所示的手机100中的具体部件,对本申请实施例提供的数据处理方法进行详细描述。其中,以下示出的步骤也可以在除图2所示手机之外的其他任一终端中执行。此外,虽然在方法流程图中示出了本申请实施例提供的数据处理方法的逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The data processing method provided by the embodiment of the present application is described in detail below with reference to the specific components in the mobile phone 100 shown in FIG. 2 in order to make the purpose, the technical solution and the advantages of the embodiment of the present application more clear. Among them, the steps shown below can also be performed in any terminal other than the mobile phone shown in FIG. 2. In addition, although the logical order of the data processing methods provided by the embodiments of the present application is shown in the method flowchart, in some cases, the steps shown or described may be performed in an order different from that herein.
参见图3,本申请实施例提供一种数据处理方法,可以应用于终端,该终端可以包括中央处理单元CPU、图像处理单元和显示单元,该方法主要可以包括:Referring to FIG. 3, an embodiment of the present application provides a data processing method, which may be applied to a terminal, where the terminal may include a central processing unit CPU, an image processing unit, and a display unit. The method may include:
201、当解码后的视频帧数据对应的第一格式为非预设类格式时,CPU将第一格式转换成第二格式,视频帧数据用于表示视频层画面,第二格式为预设类格式,预设类格式为图像处理单元能够识别的格式。201. When the first format corresponding to the decoded video frame data is a non-preset type format, the CPU converts the first format into a second format, where the video frame data is used to represent the video layer picture, and the second format is a preset class. The format, the preset class format is a format that the image processing unit can recognize.
其中,视频是指显示速度超过每秒24帧以上的连续画面,具体由一帧一帧的视频数据组成。视频帧数据是视频源数据解码后获得的视频数据,可以称为rawdata数据,每一帧数据可以对应一个视频层画面。The video refers to a continuous picture whose display speed exceeds 24 frames per second, and is specifically composed of video data of one frame and one frame. The video frame data is video data obtained after decoding the video source data, and may be referred to as rawdata data, and each frame of data may correspond to one video layer picture.
这里的预设类格式为图像处理单元能够识别和直接处理的视频帧格式,通常为通用的标准视频帧格式,例如可以是YUV、CMYK、YCBCR或RGB等类型的格式,且每种类型具体还可以包括多种格式。示例性的,部分预设类视频帧格式可以参见如下表1列出的一些通用的标准视频格式。The preset class format here is a video frame format that the image processing unit can recognize and directly process, and is usually a general standard video frame format, for example, a format such as YUV, CMYK, YCBCR or RGB, and each type is specifically Can include multiple formats. For example, some of the preset video frame formats can be found in some common standard video formats listed in Table 1 below.
表1Table 1
Figure PCTCN2017100080-appb-000001
Figure PCTCN2017100080-appb-000001
当解码后的视频帧数据对应的第一格式为非预设类格式时,即第一格式不能被图像处理单元识别,因而不能直接被图像处理单元处理时,CPU可以将该第一格式转换 成能够被图像处理单元处理的第二格式,从而使得视频帧数据可以被图像处理单处理。其中,第一格式通常与预设类格式较为接近,一般为预设类格式的简单变形。例如,第一格式为在预设类格式YUV类型的格式对应的视频数据流中添加、更改或删减一些字符。并且,CPU将第一格式转换成第二格式的速度较快,时延较小,例如可以为几毫秒。When the first format corresponding to the decoded video frame data is a non-preset type format, that is, the first format cannot be recognized by the image processing unit, and thus cannot be directly processed by the image processing unit, the CPU may convert the first format. A second format that can be processed by the image processing unit such that the video frame data can be processed by the image processing single. The first format is usually close to the preset type format, and is generally a simple variant of the preset type format. For example, the first format adds, changes, or deletes some characters in the video data stream corresponding to the format of the preset class format YUV type. Moreover, the CPU converts the first format into the second format at a faster speed, and the delay is small, for example, may be several milliseconds.
其中,CPU将第一格式转换成第二格式具体是指,CPU将第一格式的视频帧数据转换成第二格式的视频帧数据。The converting the first format to the second format by the CPU specifically means that the CPU converts the video frame data of the first format into the video frame data of the second format.
具体的,CPU可以通过框架framework层模块确定第一格式是否能够被图像处理单元识别。Specifically, the CPU may determine, by the framework framework layer module, whether the first format can be recognized by the image processing unit.
202、图像处理单元将第二格式转换成目标格式,目标格式为显示单元可以用于显示的数据帧格式。202. The image processing unit converts the second format into a target format, where the target format is a data frame format that the display unit can use for display.
这里的图像处理单元的描述可以参见上文图2相关部分的描述。其中,目标格式为显示单元可以直接用于显示的数据帧格式,通常可以为RGB类型的格式。图像处理单元具体可以根据显示单元的特性,将第二格式转换成与显示单元特性相适应的目标格式。示例性的,当显示单元为真彩色屏幕时,目标格式可以为RGB888格式;当显示单元为增强色屏幕时,目标格式可以是RGB555格式。A description of the image processing unit herein can be found in the description of the relevant portion of FIG. 2 above. The target format is a data frame format that the display unit can directly use for display, and can usually be an RGB type format. The image processing unit may specifically convert the second format into a target format that is adapted to the characteristics of the display unit according to the characteristics of the display unit. Exemplarily, when the display unit is a true color screen, the target format may be the RGB888 format; when the display unit is an enhanced color screen, the target format may be the RGB555 format.
203、图像处理单元将目标格式的视频帧数据表示的视频层画面进行缩放,以使得缩放后的视频层画面的尺寸与显示单元的尺寸相匹配。203. The image processing unit scales the video layer picture represented by the video frame data of the target format, so that the size of the scaled video layer picture matches the size of the display unit.
在图像处理单元将视频帧数据对应的第二格式转换成目标格式后,还可以对视频帧数据表示的视频层画面的尺寸进行缩放,以使得视频层画面的尺寸与显示单元的尺寸相匹配,以便于显示单元将缩放后的视频层画面进行显示。After the image processing unit converts the second format corresponding to the video frame data into the target format, the size of the video layer picture represented by the video frame data may also be scaled so that the size of the video layer picture matches the size of the display unit. In order for the display unit to display the scaled video layer screen.
在本申请实施例中,当第一格式为图像处理单元不能识别的格式时,CPU可以将第一格式转换成与第一格式的格式接近的第二格式,图像处理单元可以将第二格式转换成可以直接用于显示的目标格式,并将视频层画面缩放到屏幕尺寸,以便于显示单元进行画面显示。In the embodiment of the present application, when the first format is a format that the image processing unit cannot recognize, the CPU may convert the first format into a second format that is close to the format of the first format, and the image processing unit may convert the second format. The target format can be directly used for display, and the video layer picture is scaled to the screen size to facilitate display of the display unit.
当采用现有技术中的方案时,终端将通过GPU将第一格式转换成目标格式。由于第一格式与目标格式通常差异较大,第一格式通常不会是目标格式的简单变形,因而GPU通常需要通过复杂的处理才可以将GPU转换成目标格式。并且,GPU还需要将视频层画面缩放到屏幕尺寸。由于GPU为复杂的运算单元,内部包括大量的逻辑阵列,因而GPU的运行将会耗费较多的电量。When adopting the solution in the prior art, the terminal will convert the first format into the target format through the GPU. Since the first format and the target format usually differ greatly, the first format is usually not a simple deformation of the target format, and thus the GPU usually needs to perform complex processing to convert the GPU into a target format. Also, the GPU needs to scale the video layer to the screen size. Since the GPU is a complex arithmetic unit and internally contains a large number of logic arrays, the operation of the GPU will consume more power.
而在本申请实施例中,第一格式转换成目标格式的过程可以划分为两部分,即CPU将第一格式转换成第二格式,图像处理单元将第二格式转换成目标格式。在第一部分,与GPU相比,虽然CPU也是复杂的运算单元,但CPU仅用于将第一格式转换成与第一格式类似的第二格式,因而CPU通过简单的处理即可实现,且处理速度快、时延小。在第二部分,与运行GPU相比,通过运行图像处理单元将第二格式转换成目标格式,可以节省电量的耗费。可见,本申请实施例提供的通过CPU+图像处理单元将第一格式转换成第二格式的方式更能够节省电量。对于将视频层画面缩放到屏幕尺寸这一过程,现有技术通过运行复杂运算单元GPU来实现,而本申请通过运行更为简单的图像处理单元来实现,因而更能节省电量。 In the embodiment of the present application, the process of converting the first format into the target format may be divided into two parts, that is, the CPU converts the first format into the second format, and the image processing unit converts the second format into the target format. In the first part, compared with the GPU, although the CPU is also a complex arithmetic unit, the CPU is only used to convert the first format into a second format similar to the first format, so that the CPU can be realized by simple processing and processing. Fast speed and small delay. In the second part, the power consumption can be saved by running the image processing unit to convert the second format to the target format compared to running the GPU. It can be seen that the method for converting the first format into the second format by the CPU+image processing unit provided by the embodiment of the present application can save power. For the process of scaling a video layer picture to a screen size, the prior art is implemented by running a complex arithmetic unit GPU, and the present application is realized by running a simpler image processing unit, thereby saving power.
也就是说,本申请实施例通过更小、更简单的图像处理单元来代替GPU进行一部分格式转换操作和缩放操作,因而耗电量更小,能够提高用户的使用体验。That is to say, the embodiment of the present application replaces the GPU by a smaller and simpler image processing unit to perform a part of the format conversion operation and the zoom operation, thereby reducing the power consumption and improving the user experience.
此外,需要说明的是,在本申请实施例中,图像处理单元用于将视频层图像缩放成屏幕尺寸,即进入图像处理单元的视频层画面的尺寸为原始尺寸;而在图1所示的现有技术中,GPU用于将视频层画面缩放成屏幕尺寸,即从GPU进入图像处理单元的视频层画面已经缩放为与屏幕尺寸,图像处理单元仅进行了1:1缩放(也可以理解为没有进行缩放)。In addition, it should be noted that, in the embodiment of the present application, the image processing unit is configured to scale the video layer image to a screen size, that is, the size of the video layer picture entering the image processing unit is the original size; In the prior art, the GPU is used to scale the video layer picture to the screen size, that is, the video layer picture that enters the image processing unit from the GPU has been scaled to the screen size, and the image processing unit only performs 1:1 scaling (it can also be understood as No scaling).
此外,本申请上述实施例提供的数据处理方法流程图还可以参见图4。In addition, the flowchart of the data processing method provided by the foregoing embodiment of the present application can also refer to FIG. 4 .
进一步地,参见图5,在步骤203之后,本申请实施例提供的方法还可以包括:Further, referring to FIG. 5, after the step 203, the method provided by the embodiment of the present application may further include:
204、显示单元显示缩放后的视频层画面。204. The display unit displays the scaled video layer screen.
其中,这里的视频层画面对应的视频帧数据为目标格式。这里的显示单元可以为终端的屏幕,例如可以是液晶显示(liquid crystal display,LCD)屏或有机发光显示(organic light emitting display,OLED)屏等。在本申请实施例中,若无特别说明,则显示单元和屏幕用于表示相同的含义,两者可以通用。The video frame data corresponding to the video layer picture herein is a target format. The display unit here may be a screen of the terminal, such as a liquid crystal display (LCD) screen or an organic light emitting display (OLED) screen. In the embodiment of the present application, unless otherwise stated, the display unit and the screen are used to indicate the same meaning, and both can be used universally.
在图像处理单元对视频层画面的尺寸进行缩放后,显示单元可以显示缩放后的视频层画面。并且,显示单元按照大于24帧/秒的频率显示视频层画面,以进行视频播放。After the image processing unit scales the size of the video layer picture, the display unit can display the scaled video layer picture. And, the display unit displays the video layer screen at a frequency greater than 24 frames/second for video playback.
本申请实施例把将视频层画面的尺寸缩放到与显示单元的尺寸相匹配的过程称为,将视频层画面缩放到屏幕尺寸,或者将视频层画面缩放到匹配尺寸。The process of scaling the size of the video layer picture to match the size of the display unit is referred to as scaling the video layer picture to the screen size or scaling the video layer picture to the matching size.
在本申请实施例中,步骤201中的第一格式可以与第一视频播放应用对应,第一格式的视频帧数据为通过第一视频播放应用对应的解码器对视频源数据进行解码获得的数据。In the embodiment of the present application, the first format in step 201 may correspond to the first video playing application, and the video frame data in the first format is data obtained by decoding the video source data by using a decoder corresponding to the first video playing application. .
其中,这里的视频帧数据是通过解码器解码获得的视频数据,这里的解码器是视频播放应用对应的解码器,而不是通过安卓系统的系统解码器,具体可以包括软件解码器或硬件解码器,不同视频播放应对应的解码器可能不同。不同视频播放应用对应的解码获得的视频帧数据的格式也可能不同,即解码后的视频帧数据的格式与视频播放应用相对应。例如,视频播放应用1与视频帧格式1(第一格式)对应,视频播放应用2与视频帧格式2(第一格式)对应。Wherein, the video frame data here is the video data obtained by decoding by the decoder, where the decoder is a decoder corresponding to the video playing application, not a system decoder of the Android system, and specifically may include a software decoder or a hardware decoder. The decoders corresponding to different video playbacks may be different. The format of the video frame data obtained by decoding corresponding to different video playing applications may also be different, that is, the format of the decoded video frame data corresponds to the video playing application. For example, the video playback application 1 corresponds to a video frame format 1 (first format), and the video playback application 2 corresponds to a video frame format 2 (first format).
当第一格式与第一视频播放应用相对应时,在上述步骤201中,CPU将第一格式转换成第二格式可以包括:When the first format corresponds to the first video playing application, in the foregoing step 201, the CPU converting the first format into the second format may include:
2011、CPU根据与第一格式对应的第一视频播放应用,将第一格式转换成第二格式。In 2011, the CPU converts the first format into the second format according to the first video playing application corresponding to the first format.
当第一格式与第一视频播放应用相对应时,第一格式为第一视频播放应用对应的解码器解码获得的视频数据的格式,因而CPU可以根据第一格式对应的第一视频播放应用,将第一格式转换成第二格式。When the first format corresponds to the first video playing application, the first format is a format of the video data obtained by decoding by the decoder corresponding to the first video playing application, and thus the CPU may use the first video playing application corresponding to the first format, Convert the first format to the second format.
具体的,终端可以保存有第一视频播放应用与第三格式的对应关系,第三格式为预设类格式,第二格式为与第一视频播放应用对应的第三格式。因此,步骤2011具体可以包括:CPU将第一格式转换成与第一视频播放应用对应的第三格式,该第三格式 即为第二格式。Specifically, the terminal may save the correspondence between the first video playing application and the third format, where the third format is a preset type format, and the second format is a third format corresponding to the first video playing application. Therefore, the step 2011 may specifically include: the CPU converting the first format into a third format corresponding to the first video playing application, the third format That is the second format.
例如,视频播放应用1与视频帧格式3(第三格式)对应,视频播放应用2与视频帧格式4(第三格式)对应。当第一格式为视频帧格式2时,与视频帧格式2对应的第一视频播放应用为视频播放应用2,与视频播放应用2对应的第三格式为视频帧格式4,因而,CPU可以将视频帧格式2(第一格式),转换成视频帧格式4(第二格式)。For example, the video playback application 1 corresponds to video frame format 3 (third format), and the video playback application 2 corresponds to video frame format 4 (third format). When the first format is the video frame format 2, the first video playing application corresponding to the video frame format 2 is the video playing application 2, and the third format corresponding to the video playing application 2 is the video frame format 4, and thus, the CPU can Video frame format 2 (first format) is converted into video frame format 4 (second format).
值得注意的是,除第一视频帧应用与第三格式的对应关系外,终端中还可以保存有其它视频播放应用与预设类视频中的视频帧格式的对应关系,并且,终端还可以通过软件升级等方式更新和修改终端中保存的视频播放应用与视频帧格式的对应关系。It is noted that, in addition to the correspondence between the first video frame application and the third format, the terminal may also store a correspondence between other video playback applications and video frame formats in the preset video, and the terminal may also pass The software upgrade and the like update and modify the correspondence between the video playback application and the video frame format saved in the terminal.
其中,第一视频播放应用与第三格式的对应关系可以在测试阶段进行确定。例如,预设类格式中的格式可以称为第四格式,在一种实现方式中,可以将第一视频播放应用对应的解码器解码获得的视频帧数据的第一格式转换成预设类格式中的一种第四格式,而后,图像处理单元可以将该种第四格式转换成目标格式,显示单元可以对目标格式的视频帧数据表示的视频层画面进行显示,若满足画面显示条件,则可以确定该种第四格式属于预设类格式,此时可以确定第三格式为预设类格式中,对应的视频帧数据表示的视频层画面显示清晰度最高的格式;或者,可以确定第三格式为预设类格式中的任意一种格式。进而,可以保存第一格式对应的第一视频播放应用与确定的第三格式的对应关系。The correspondence between the first video playing application and the third format may be determined in a testing phase. For example, the format in the preset class format may be referred to as a fourth format. In an implementation manner, the first format of the video frame data obtained by decoding by the decoder corresponding to the first video playing application may be converted into a preset type format. a fourth format, and then the image processing unit can convert the fourth format into a target format, and the display unit can display the video layer picture represented by the video frame data of the target format, if the screen display condition is met, It can be determined that the fourth format belongs to the preset type format, and the third format is determined to be the format in which the video layer data represented by the corresponding video frame data has the highest resolution in the preset format; or, the third format can be determined. The format is any of the preset class formats. Furthermore, the correspondence between the first video playing application corresponding to the first format and the determined third format may be saved.
其中,画面显示条件可以根据实际需要进行设定。例如,显示单元上可以正常显示图像的像素大于或者等于预设值。Among them, the screen display conditions can be set according to actual needs. For example, a pixel on the display unit that can normally display an image is greater than or equal to a preset value.
在另一种实现方式中,可以将第一格式转换成预设类格式中的一种第四格式,若本次转换成的第四格式对应的视频帧数据满足画面显示条件,则确定本次转换成的第四格式为第三格式;若本次转换成的第四格式对应的视频帧数据不满足画面显示条件,则将第一格式转换成预设类格式中的另一种第四格式,直至转换成的第四格式对应的视频帧数据满足画面显示条件。In another implementation manner, the first format may be converted into a fourth format in the preset class format, and if the video frame data corresponding to the fourth format converted to this time satisfies the screen display condition, the current format is determined. The fourth format converted into the third format; if the video frame data corresponding to the fourth format converted to the current format does not satisfy the screen display condition, the first format is converted into another fourth format in the preset class format. Until the video frame data corresponding to the converted fourth format satisfies the screen display condition.
此外,可选的,若视频播放过程出现异常,例如视频播放应用异常退出等,则可能是由于视频播放应用对应的第二格式与第一格式的对应关系出错,此时可以删除视频播放应用与第三格式的对应关系。In addition, if the video playback process is abnormal, for example, the video playback application exits abnormally, the corresponding relationship between the second format corresponding to the video playback application and the first format may be incorrect, and the video playback application may be deleted at this time. The correspondence of the third format.
具体的,在本申请实施例中,视频层可以通过表面视图surfaceview展示。其中,surfaceview拥有独立的绘图表面,它不与其宿主窗口共享同一个绘图表面。由于拥有独立的绘图表面,因此surfaceview的界面可以在一个独立的线程中进行绘制,而不会占用主线程资源,可以实现复杂而高效的界面。Specifically, in the embodiment of the present application, the video layer may be displayed through a surface view surfaceview. Among them, surfaceview has a separate drawing surface, which does not share the same drawing surface with its host window. With a separate drawing surface, the surfaceview interface can be drawn in a separate thread without taking up the main thread resources, enabling a complex and efficient interface.
在本申请实施例中,参见图6,当第一格式不能被图像处理单元识别时,在步骤201中CPU将第一格式转换成第二格式之前,该方法还可以包括:In the embodiment of the present application, referring to FIG. 6, when the first format cannot be recognized by the image processing unit, before the CPU converts the first format to the second format in step 201, the method may further include:
205、CPU在视频帧数据对应的原视频层的对应位置的上层创建新视频层,新视频层用于覆盖原视频层,新视频层对应新表面视图new surfaceview。205. The CPU creates a new video layer on the upper layer of the corresponding position of the original video layer corresponding to the video frame data, where the new video layer is used to cover the original video layer, and the new video layer corresponds to the new surface view new surface view.
其中,CPU可以通过将新视频层对应的宽度wide和高度height设置成与原视频层对应的宽度wide和盖度height相同,从而在原视频层的对应位置创建新视频层。并且,CPU可以通过设置新视频层对应的zorder,在视频帧原视频层的上层创建新视频 层。这样,设置的新视频层可以完全覆盖原视频层。The CPU may create a new video layer at a corresponding position of the original video layer by setting the width wide and the height height corresponding to the new video layer to be the same as the width width and the cover height corresponding to the original video layer. Moreover, the CPU can create a new video on the upper layer of the original video layer of the video frame by setting the zorder corresponding to the new video layer. Floor. In this way, the new video layer set can completely cover the original video layer.
206、CPU通过开放图形库opengl接口获取视频帧数据。206. The CPU acquires video frame data through an open graphics library opengl interface.
207、CPU用通过开放图形库opengl接口获取的视频帧数据,填充新表面视图new surfaceview。207. The CPU fills the new surface view new surfaceview with the video frame data obtained through the open graphics library opengl interface.
这样,新表面视图new surfaceview中的视频帧数据即为新视频层对应的视频帧数据,新视频层对应的视频帧数据即为原视频层对应的视频帧数据。In this way, the video frame data in the new surface view is the video frame data corresponding to the new video layer, and the video frame data corresponding to the new video layer is the video frame data corresponding to the original video layer.
由于原视频层和与原视频层对应的原表面视图new surfaceview是由视频播放应用创建的,终端侧不易对它们进行修改和控制,因而终端侧的CPU可以通过创建一个新表面视图new surfaceview和新视频层来代替原表面视图new surfaceview和原视频层,从而使得终端各部件可以通过控制原表面视图new surfaceview和原视频层进行格式转换和缩放,达到降低耗电量的目的。Since the original video layer and the original surface view new surfaceview corresponding to the original video layer are created by the video playing application, the terminal side is not easy to modify and control them, so the CPU on the terminal side can create a new surface view new surfaceview and new The video layer replaces the original surface view new surfaceview and the original video layer, so that the terminal components can be formatted and scaled by controlling the original surface view new surfaceview and the original video layer to achieve the purpose of reducing power consumption.
并且,通过在原视频层的对应位置的上层创建一个新视频层以代替原视频层的方式,用户不会感知到,且分辨率、帧率、播放速度、显示内容均不会收到影响,因而不会降低用户的使用体验。Moreover, by creating a new video layer on the upper layer of the corresponding position of the original video layer instead of the original video layer, the user does not perceive, and the resolution, the frame rate, the playback speed, and the display content are not affected, and thus Will not reduce the user experience.
在上述步骤205-207的基础上,CPU将第一格式转换成第二格式具体可以包括:On the basis of the foregoing steps 205-207, the CPU may convert the first format into the second format, which may include:
2010、CPU将新表面视图new surfaceview中的视频帧数据对应的第一格式转换成第二格式。In 2010, the CPU converts the first format corresponding to the video frame data in the new surface view new surfaceview into the second format.
也就是说,在新表面视图new surfaceview代替原表面视图new surfaceview,新视频层代替原视频层后,CPU可以将新视频层对应的,新表面视图new surfaceview中的视频帧数据对应的第一格式转换成第二格式。That is to say, after the new surface view new surfaceview replaces the original surface view new surfaceview, after the new video layer replaces the original video layer, the CPU can correspond to the new video layer corresponding to the first format corresponding to the video frame data in the new surface view new surfaceview. Convert to the second format.
CPU在步骤2010中将新表面视图new surfaceview中的视频帧数据对应的第一格式转换成第二格式具体可以包括:The converting, by the CPU, the first format corresponding to the video frame data in the new surface view in the new surface view to the second format may include:
CPU通过新表面视图new surfaceview的底层模块nativesurface,将新表面视图new surfaceview中的视频帧数据对应的第一格式转换成第二格式。The CPU converts the first format corresponding to the video frame data in the new surface view new surfaceview into the second format through the underlying module nativesurface of the new surface view new surfaceview.
具体的,底层模块nativesurface用于支撑new surfaceview的功能。CPU可以首先通过nativesurface从opengl接口获取视频帧数据(即数据抓取data catch),而后拷贝获取的视频帧数据(即数据共享data share),进而将视频帧对应的第一格式转换成第二格式(即数据调整data adjust)。Specifically, the underlying module nativesurface is used to support the function of the new surfaceview. The CPU may first obtain video frame data (ie, data capture data catch) from the opengl interface through the nativesurface, and then copy the acquired video frame data (ie, data sharing data share), thereby converting the first format corresponding to the video frame into the second format. (ie data adjustment data adjust).
在步骤2010的基础上,图像处理单元可以对新表面视图new surfaceview中的视频数据进行处理。上述步骤202具体可以包括:Based on step 2010, the image processing unit can process the video data in the new surface view new surfaceview. The foregoing step 202 may specifically include:
2020、图像处理单元将新表面视图new surfaceview中,视频帧数据对应的第二格式转换成目标格式。2020. The image processing unit converts the second format corresponding to the video frame data into the target format in the new surface view new surface view.
上述步骤203具体可以包括:The foregoing step 203 may specifically include:
2030、图像处理单元将新表面视图new surfaceview中,已转换成目标格式的视频帧数据表示的新视频层画面进行缩放。2030. The image processing unit scales a new video layer image represented by the video frame data that has been converted into the target format in the new surface view new surfaceview.
在本申请实施例中,原视频层可以对应原表面视图original surfaceview,在步骤204中显示单元显示缩放后的视频层画面之前,该方法还可以包括:In the embodiment of the present application, the original video layer may correspond to the original surface view. Before the display unit displays the scaled video layer screen in step 204, the method may further include:
208、显示单元停止显示原表面视图original surfaceview对应的原视频层画面。 208. The display unit stops displaying the original video layer picture corresponding to the original surface view of the original surface view.
在未创建新表面视图new surfaceview和新视频层时,按照现有技术中的流程,CPU将原视频层对应的视频帧数据送给GPU、图像处理单元和显示单元进行处理。而在本申请实施例中,当通过创建新表面视图new surfaceview和新视频层,代替原表面视图original surfaceview和原视频层时,原视频层画面不需要再显示。具体的,CPU可以停止将原表面视图original surfaceview中的视频帧数据发送给GPU、图像处理单元和显示单元进行处理,显示单元可以停止显示原视频层画面,而显示新表面视图new surfaceview中的新视频层画面。When the new surface view new surface view and the new video layer are not created, according to the flow in the prior art, the CPU sends the video frame data corresponding to the original video layer to the GPU, the image processing unit, and the display unit for processing. In the embodiment of the present application, when the new surface view new surface view and the new video layer are created instead of the original surface view original surface view and the original video layer, the original video layer picture does not need to be displayed again. Specifically, the CPU may stop sending the video frame data in the original surface view to the GPU, the image processing unit, and the display unit for processing, and the display unit may stop displaying the original video layer image, and display the new surface view new surfaceview new Video layer picture.
具体的,CPU可以通过将新视频层的透明度设置为非透明的方式,停止显示原视频层。当新视频层的透明度为非透明,原视频层被完全遮挡,终端将不继续对原视频层执行显示处理流程,显示单元也将不再显示原视频层画面。其中,值得注意的是,对于一些目标格式例如RGB888格式的新视频层,其本身就是不透明的,因而CPU不需要再将新视频层的透明度设置为非透明。Specifically, the CPU can stop displaying the original video layer by setting the transparency of the new video layer to be non-transparent. When the transparency of the new video layer is non-transparent, the original video layer is completely occluded, and the terminal will not continue to perform the display processing flow on the original video layer, and the display unit will no longer display the original video layer picture. Among them, it is worth noting that for some target formats such as the new video layer of the RGB888 format, it is itself opaque, so the CPU does not need to set the transparency of the new video layer to be non-transparent.
209、CPU将新表面视图new surfaceview插入original surfaceview所在的视图层级结构viewhieiarchy中。209. The CPU inserts a new surface view new surfaceview into the view hierarchy viewhieiarchy where the original surfaceview is located.
其中,viewhieiarchy是视图view的一个树tree型结构,包括所有视图及所有视图的属性,例如视图的wide坐标信息、height坐标信息以及z轴坐标信息等,根据这些信息可以获得整个屏幕的布局。viewhieiarchy可以与视频播放应用相对应。Viewhieiarchy is a tree-tree structure of the view view, including all views and attributes of all views, such as the wide coordinate information of the view, the height coordinate information, and the z-axis coordinate information. Based on this information, the layout of the entire screen can be obtained. Viewhieiarchy can correspond to video playback applications.
在创建新表面视图new surfaceview后,CPU可以将新表面视图new surfaceview插入original surfaceview所在的视图层级结构viewhieiarchy中,以使得新表面视图new surfaceview可以与屏幕中的其它视图相融合,从而在新表面视图new surfaceview代替原视频层对应的原表面视图original surfaceview时,不会影响屏幕的整体布局,不会更改屏幕的正常显示。After creating a new surface view new surfaceview, the CPU can insert the new surface view new surfaceview into the view hierarchy viewhieiarchy where the original surfaceview is located, so that the new surface view new surfaceview can be merged with other views in the screen, thus in the new surface view. When the new surfaceview replaces the original surface view corresponding to the original video layer, it does not affect the overall layout of the screen, and does not change the normal display of the screen.
需要说明的是,图6所示的方法流程仅是示例性说明,步骤209可以在步骤205之后及步骤2040之前执行。It should be noted that the method flow shown in FIG. 6 is merely an exemplary description, and step 209 may be performed after step 205 and before step 2040.
上述步骤204具体可以包括:The above step 204 may specifically include:
2040、显示单元显示缩放后的目标视频层画面,目标视频层画面为新表面视图new surfaceview中,已转换成目标格式的视频帧数据表示的新视频层画面。2040. The display unit displays the scaled target video layer picture, and the target video layer picture is a new video layer picture represented by the video frame data of the target format in the new surface view new surfaceview.
另外,本申请上述实施例提供的数据处理方法流程图还可以参见图7。In addition, the flowchart of the data processing method provided by the foregoing embodiment of the present application can also refer to FIG. 7.
此外,当解码后的视频帧数据对应的第一格式为预设类格式时,该方法还可以包括:In addition, when the first format corresponding to the decoded video frame data is a preset type format, the method may further include:
210、图像处理单元将视频帧数据表示的视频层画面进行缩放,以使得缩放后的视频层画面的尺寸与显示单元的尺寸相匹配。210. The image processing unit scales the video layer picture represented by the video frame data, so that the size of the scaled video layer picture matches the size of the display unit.
211、显示单元显示缩放后的视频层画面。211. The display unit displays the scaled video layer screen.
也就是说,当所述解码后的视频帧数据对应的第一格式为图像处理单元能够识别的预设类格式时,图像处理单元可以直接对第一格式的视频帧数据进行处理。That is, when the first format corresponding to the decoded video frame data is a preset type format that can be recognized by the image processing unit, the image processing unit can directly process the video frame data of the first format.
另外,在本申请实施例提供的数据处理方法中,对于通过系统解码器解码获得的视频帧数据,可以直接送入图像处理单元进行处理。In addition, in the data processing method provided by the embodiment of the present application, the video frame data obtained by decoding by the system decoder may be directly sent to the image processing unit for processing.
进一步地,在进行视频播放时,视频层上还可能叠加有弹幕层、标志logo层等, 因而该方法还可以包括:Further, when performing video playback, a video layer, a logo layer, and the like may be superimposed on the video layer. Thus the method can also include:
212、显示单元显示弹幕层和/或标志logo层。212. The display unit displays a bullet layer and/or a logo logo layer.
上述主要从终端的角度对本申请实施例提供的方案进行了介绍。可以理解的是,终端为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The solution provided by the embodiment of the present application is mainly introduced from the perspective of the terminal. It can be understood that, in order to implement the above functions, the terminal includes corresponding hardware structures and/or software modules for performing various functions. Those skilled in the art will readily appreciate that the present application can be implemented in a combination of hardware or hardware and computer software in combination with the algorithmic steps of the various examples described in the embodiments disclosed herein. Whether a function is implemented in hardware or computer software to drive hardware depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present application.
本申请实施例可以根据上述方法示例对终端进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiment of the present application may divide the function module into the terminal according to the foregoing method example. For example, each function module may be divided according to each function, or two or more functions may be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of the module in the embodiment of the present application is schematic, and is only a logical function division, and the actual implementation may have another division manner.
在采用对应各个功能划分各个功能模块的情况下,图8示出了上述实施例中涉及的终端30的一种可能的组成示意图,如图8所示,该终端30可以包括:至少一个处理器31、图像处理单元32、屏幕33、存储器34和总线35。处理器31、图像处理单元32、屏幕33和存储器34通过总线35相连。FIG. 8 is a schematic diagram showing a possible composition of the terminal 30 involved in the foregoing embodiment. As shown in FIG. 8, the terminal 30 may include: at least one processor. 31. Image processing unit 32, screen 33, memory 34, and bus 35. The processor 31, the image processing unit 32, the screen 33, and the memory 34 are connected by a bus 35.
其中,存储器34用于存储指令。处理器31用于执行指令以执行:当解码后的视频帧数据对应的第一格式不是预设类格式时,将第一格式转换成第二格式。其中,视频帧数据用于表示视频层画面,第二格式为预设类格式,预设类格式为图像处理单元能够识别的格式。图像处理单元32用于执行指令以执行:将第二格式转换成目标格式,目标格式为显示单元用于显示的数据帧格式,将目标格式的视频帧数据表示的视频层画面进行缩放,以使得缩放后的视频层画面的尺寸与显示单元的尺寸相匹配。Among them, the memory 34 is used to store instructions. The processor 31 is configured to execute an instruction to: convert the first format into the second format when the first format corresponding to the decoded video frame data is not the preset class format. The video frame data is used to represent the video layer picture, the second format is a preset type format, and the preset class format is a format that the image processing unit can recognize. The image processing unit 32 is configured to execute an instruction to: convert the second format into a target format, the target format is a data frame format used by the display unit for display, and scale the video layer image represented by the video frame data of the target format, so that The size of the scaled video layer picture matches the size of the display unit.
此外,屏幕33用于支持终端执行图5所示的数据处理方法中的步骤204,图6中的步骤208和步骤2040。Further, the screen 33 is for supporting the terminal to execute step 204 in the data processing method shown in FIG. 5, step 208 and step 2040 in FIG.
处理器31还可以用于支持终端执行图6所示的数据处理方法中的步骤205-207、步骤2010以及步骤209。The processor 31 is further configured to support the terminal to perform steps 205-207, step 2010, and step 209 in the data processing method shown in FIG. 6.
图像处理单元32还可以用于支持终端执行图6所示的数据处理方法中的步骤2020和步骤2030。The image processing unit 32 can also be used to support the terminal to perform steps 2020 and 2030 in the data processing method shown in FIG. 6.
需要说明的是,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。It should be noted that all the related content of the steps involved in the foregoing method embodiments may be referred to the functional descriptions of the corresponding functional modules, and details are not described herein again.
本申请实施例提供的终端,用于执行上述数据处理方法,因此可以达到与上述数据处理方法相同的效果。The terminal provided in the embodiment of the present application is configured to execute the foregoing data processing method, so that the same effect as the data processing method described above can be achieved.
在采用集成的单元的情况下,图9示出了上述实施例中所涉及的终端40的另一种可能的组成示意图。如图9所示,该终端40包括:处理模块41和通信模块42。In the case of employing an integrated unit, FIG. 9 shows another possible composition diagram of the terminal 40 involved in the above embodiment. As shown in FIG. 9, the terminal 40 includes a processing module 41 and a communication module 42.
处理模块41用于对终端40的动作进行控制管理,例如,处理模块41用于支持终端40执行图8所示的处理器31、图像处理单元32和屏幕33的操作,和/或用于本文所描述的技术的其它过程。通信模块42用于支持终端与其他网络实体的通信。终端还 可以包括存储模块43,用于执行图8所示的存储器34的操作,存储终端40的程序代码和数据。The processing module 41 is configured to control and manage the actions of the terminal 40. For example, the processing module 41 is configured to support the terminal 40 to perform the operations of the processor 31, the image processing unit 32, and the screen 33 shown in FIG. 8, and/or for the purposes of this document. Other processes of the described techniques. The communication module 42 is used to support communication between the terminal and other network entities. Terminal also A storage module 43 may be included for performing the operations of the memory 34 shown in FIG. 8, storing the program code and data of the terminal 40.
其中,处理模块41可以是处理器或控制器。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,微处理器(digital signal processor,DSP)和微处理器的组合等等。通信模块42可以是收发器、收发电路或通信接口等。The processing module 41 can be a processor or a controller. It is possible to implement or carry out the various illustrative logical blocks, modules and circuits described in connection with the present disclosure. The processor can also be a combination of computing functions, for example, including one or more microprocessor combinations, a combination of a digital signal processor (DSP) and a microprocessor, and the like. The communication module 42 can be a transceiver, a transceiver circuit, a communication interface, or the like.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above functional modules is illustrated. In practical applications, the above functions can be allocated according to needs. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or It can be integrated into another device, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may be one physical unit or multiple physical units, that is, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。An integrated unit can be stored in a readable storage medium if it is implemented as a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the embodiments of the present application may be embodied in the form of a software product in the form of a software product in essence or in the form of a contribution to the prior art, and the software product is stored in a storage medium. A number of instructions are included to cause a device (which may be a microcontroller, chip, etc.) or a processor to perform all or part of the steps of the various embodiments of the present application. The foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。 The foregoing is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application. It should be covered by the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of protection of the claims.

Claims (24)

  1. 一种数据处理方法,应用于终端,所述终端包括中央处理单元CPU、图像处理单元和显示单元,其特征在于,所述方法包括:A data processing method is applied to a terminal, where the terminal includes a central processing unit CPU, an image processing unit, and a display unit, wherein the method includes:
    当解码后的视频帧数据对应的第一格式不是预设类格式时,所述CPU将所述第一格式转换成第二格式,所述视频帧数据用于表示视频层画面,所述第二格式为预设类格式,所述预设类格式为所述图像处理单元能够识别的格式;When the first format corresponding to the decoded video frame data is not a preset type format, the CPU converts the first format into a second format, where the video frame data is used to represent a video layer picture, and the second The format is a preset class format, and the preset class format is a format that the image processing unit can recognize;
    所述图像处理单元将所述第二格式转换成目标格式,所述目标格式为所述显示单元用于显示的数据帧格式;The image processing unit converts the second format into a target format, where the target format is a data frame format used by the display unit for display;
    所述图像处理单元将所述目标格式的视频帧数据表示的视频层画面进行缩放,以使得缩放后的所述视频层画面的尺寸与所述显示单元的尺寸相匹配。The image processing unit scales a video layer picture represented by the video frame data of the target format such that the size of the scaled video layer picture matches the size of the display unit.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    所述显示单元显示缩放后的所述视频层画面。The display unit displays the scaled video layer picture.
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一格式与第一视频播放应用对应,所述第一格式的视频帧数据为通过所述第一视频播放应用对应的解码器对视频源数据进行解码获得的数据。The method according to claim 1 or 2, wherein the first format corresponds to a first video playing application, and the video frame data of the first format is a decoder corresponding to the first video playing application. Data obtained by decoding video source data.
  4. 根据权利要求3所述的方法,其特征在于,所述CPU将所述第一格式转换成第二格式包括:The method according to claim 3, wherein the converting the first format to the second format by the CPU comprises:
    所述CPU根据与所述第一格式对应的所述第一视频播放应用,将所述第一格式转换成第二格式。The CPU converts the first format into a second format according to the first video playing application corresponding to the first format.
  5. 根据权利要求4所述的方法,其特征在于,所述终端保存有所述第一视频播放应用与第三格式的对应关系,所述第三格式为预设类格式,所述第二格式为与所述第一视频播放应用对应的所述第三格式。The method according to claim 4, wherein the terminal saves a correspondence between the first video playing application and a third format, the third format is a preset type format, and the second format is The third format corresponding to the first video playback application.
  6. 根据权利要求2-5任一项所述的方法,其特征在于,所述视频层通过表面视图surfaceview展示,在所述CPU将所述第一格式转换成第二格式之前,所述方法还包括:The method according to any one of claims 2 to 5, wherein the video layer is displayed by a surface view surfaceview, and before the CPU converts the first format into a second format, the method further comprises :
    所述CPU在所述视频帧数据对应的原视频层的对应位置的上层创建新视频层,所述新视频层用于覆盖所述原视频层,所述新视频层对应新表面视图new surfaceview;The CPU creates a new video layer on the upper layer of the corresponding position of the original video layer corresponding to the video frame data, where the new video layer is used to cover the original video layer, and the new video layer corresponds to a new surface view new surface view;
    所述CPU通过开放图形库opengl接口获取所述视频帧数据;The CPU acquires the video frame data by using an open graphics library opengl interface;
    所述CPU用通过所述开放图形库opengl接口获取的所述视频帧数据,填充所述新表面视图new surfaceview。The CPU fills the new surface view new surfaceview with the video frame data acquired through the open graphics library opengl interface.
  7. 根据权利要求6所述的方法,其特征在于,所述CPU将所述第一格式转换成第二格式包括:The method according to claim 6, wherein the converting the first format to the second format by the CPU comprises:
    所述CPU将所述新表面视图new surfaceview中的所述视频帧数据对应的第一格式转换成所述第二格式。The CPU converts a first format corresponding to the video frame data in the new surface view new surfaceview into the second format.
  8. 根据权利要求7所述的方法,其特征在于,所述CPU将所述新表面视图new surfaceview中的所述视频帧数据对应的第一格式转换成所述第二格式包括:The method according to claim 7, wherein the converting, by the CPU, the first format corresponding to the video frame data in the new surface view new surfaceview into the second format comprises:
    所述CPU通过所述新表面视图new surfaceview的底层模块nativesurface,将所述新表面视图new surfaceview中的所述视频帧数据对应的第一格式转换成所述第二格式。The CPU converts a first format corresponding to the video frame data in the new surface view new surface view into the second format by using an underlying module nativesurface of the new surface view new surface view.
  9. 根据权利要求6-8任一项所述的方法,其特征在于,所述图像处理单元将所述第二格式转换成目标格式包括: The method according to any one of claims 6-8, wherein the converting the second format to the target format by the image processing unit comprises:
    所述图像处理单元将所述新表面视图new surfaceview中,所述视频帧数据对应的第二格式转换成所述目标格式;The image processing unit converts a second format corresponding to the video frame data into the target format in the new surface view new surface view;
    所述图像处理单元将所述目标格式的视频帧数据表示的视频层画面进行缩放包括:The image processing unit scaling the video layer picture represented by the video frame data of the target format includes:
    所述图像处理单元将所述新表面视图new surfaceview中,已转换成所述目标格式的所述视频帧数据表示的新视频层画面进行缩放。The image processing unit scales a new video layer picture represented by the video frame data that has been converted into the target format in the new surface view new surface view.
  10. 根据权利要求9所述的方法,其特征在于,所述原视频层对应原表面视图original surfaceview,所述方法还包括:The method according to claim 9, wherein the original video layer corresponds to an original surface view, and the method further comprises:
    所述显示单元停止显示所述原表面视图original surfaceview对应的原视频层画面;The display unit stops displaying the original video layer picture corresponding to the original surface view original surface view;
    所述CPU将所述新表面视图new surfaceview插入所述原表面视图original surfaceview所在的视图层级结构viewhieiarchy中;The CPU inserts the new surface view new surfaceview into the view hierarchy structure viewhieiarchy where the original surface view original surfaceview is located;
    所述显示单元显示缩放后的所述视频层画面包括:Displaying, by the display unit, the scaled video layer screen includes:
    所述显示单元显示缩放后的目标视频层画面,所述目标视频层画面为所述新表面视图new surfaceview中,已转换成所述目标格式的所述视频帧数据表示的新视频层画面。The display unit displays the scaled target video layer picture, where the target video layer picture is a new video layer picture that has been converted into the video frame data representation of the target format in the new surface view new surfaceview.
  11. 根据权利要求1-10任一项所述的方法,其特征在于,所述第二格式为YUV类型的格式。The method according to any one of claims 1 to 10, wherein the second format is a YUV type format.
  12. 一种终端,其特征在于,包括至少一个处理器、图像处理单元、屏幕、存储器和总线;A terminal, comprising: at least one processor, an image processing unit, a screen, a memory, and a bus;
    所述处理器、所述图像处理单元、所述屏幕和所述存储器通过总线相连;The processor, the image processing unit, the screen, and the memory are connected by a bus;
    所述存储器用于存储指令;The memory is for storing instructions;
    所述处理器用于执行所述指令以执行:The processor is configured to execute the instructions to perform:
    当解码后的视频帧数据对应的第一格式不是预设类格式时,将所述第一格式转换成第二格式,所述视频帧数据用于表示视频层画面,所述第二格式为预设类格式,所述预设类格式为所述图像处理单元能够识别的格式;When the first format corresponding to the decoded video frame data is not a preset type format, the first format is converted into a second format, where the video frame data is used to represent a video layer picture, and the second format is a pre- a class format, where the preset class format is a format that the image processing unit can recognize;
    所述图像处理单元用于执行所述指令以执行:The image processing unit is configured to execute the instructions to perform:
    将所述第二格式转换成目标格式,所述目标格式为显示单元用于显示的数据帧格式;Converting the second format to a target format, where the target format is a data frame format used by the display unit for display;
    将所述目标格式的视频帧数据表示的视频层画面进行缩放,以使得缩放后的所述视频层画面的尺寸与所述显示单元的尺寸相匹配。The video layer picture represented by the video frame data of the target format is scaled such that the size of the scaled video layer picture matches the size of the display unit.
  13. 根据权利要求12所述的终端,其特征在于,所述显示单元用于执行所述指令以执行:The terminal according to claim 12, wherein said display unit is configured to execute said instruction to perform:
    显示缩放后的所述视频层画面。The scaled video layer screen is displayed.
  14. 根据权利要求12或13所述的终端,其特征在于,所述第一格式与第一视频播放应用相对应,所述第一格式的视频帧数据为通过所述第一视频播放应用对应的解码器对视频源数据进行解码获得的数据。The terminal according to claim 12 or 13, wherein the first format corresponds to a first video playing application, and the video frame data of the first format is a decoding corresponding to the first video playing application. The data obtained by decoding the video source data.
  15. 根据权利要求14所述的终端,其特征在于,所述处理器具体用于:The terminal according to claim 14, wherein the processor is specifically configured to:
    根据与所述第一格式对应的所述第一视频播放应用,将所述第一格式转换成第二格式。Converting the first format to a second format according to the first video playing application corresponding to the first format.
  16. 根据权利要求15所述的终端,其特征在于,所述终端保存有所述第一视频播 放应用与第三格式的对应关系,所述第三格式为预设类格式,所述第二格式为与所述第一视频播放应用对应的所述第三格式。The terminal according to claim 15, wherein the terminal saves the first video broadcast Corresponding to the third format, the third format is a preset type format, and the second format is the third format corresponding to the first video playing application.
  17. 根据权利要求13-16任一项所述的终端,其特征在于,所述视频层通过表面视图surfaceview展示,所述处理器还用于:The terminal according to any one of claims 13 to 16, wherein the video layer is displayed by a surface view surfaceview, and the processor is further configured to:
    在将所述第一格式转换成第二格式之前,在所述视频帧数据对应的原视频层的对应位置的上层创建新视频层,所述新视频层用于覆盖所述原视频层,所述新视频层对应新表面视图new surfaceview;Before converting the first format to the second format, creating a new video layer on an upper layer of a corresponding position of the original video layer corresponding to the video frame data, where the new video layer is used to cover the original video layer. The new video layer corresponds to a new surface view new surfaceview;
    通过开放图形库opengl接口获取所述视频帧数据;Obtaining the video frame data through an open graphics library opengl interface;
    用通过所述开放图形库opengl接口获取的所述视频帧数据,填充所述新表面视图new surfaceview。Filling the new surface view new surfaceview with the video frame data obtained through the open graphics library opengl interface.
  18. 根据权利要求17所述的终端,其特征在于,所述处理器具体用于:The terminal according to claim 17, wherein the processor is specifically configured to:
    将所述新表面视图new surfaceview中的所述视频帧数据对应的第一格式转换成所述第二格式。Converting a first format corresponding to the video frame data in the new surface view new surfaceview to the second format.
  19. 根据权利要求18所述的终端,其特征在于,所述处理器具体用于:The terminal according to claim 18, wherein the processor is specifically configured to:
    通过所述新表面视图new surfaceview的底层模块nativesurface,将所述新表面视图new surfaceview中的所述视频帧数据对应的第一格式转换成所述第二格式。Converting, by the underlying module nativesurface of the new surface view new surfaceview, a first format corresponding to the video frame data in the new surface view new surfaceview to the second format.
  20. 根据权利要求17-19任一项所述的终端,其特征在于,所述图像处理单元具体用于:The terminal according to any one of claims 17 to 19, wherein the image processing unit is specifically configured to:
    将所述新表面视图new surfaceview中,所述视频帧数据对应的第二格式转换成所述目标格式;Converting, in the new surface view new surfaceview, a second format corresponding to the video frame data into the target format;
    将所述新表面视图new surfaceview中,已转换成所述目标格式的所述视频帧数据表示的新视频层画面进行缩放。The new video layer picture represented by the video frame data that has been converted into the target format is scaled in the new surface view new surfaceview.
  21. 根据权利要求20所述的终端,其特征在于,所述原视频层对应原表面视图original surfaceview,所述显示单元还用于,停止显示所述原表面视图original surfaceview对应的原视频层画面;The terminal according to claim 20, wherein the original video layer corresponds to an original surface view, and the display unit is further configured to stop displaying an original video layer corresponding to the original surface view;
    所述处理器还用于,将所述新表面视图new surfaceview插入所述原表面视图original surfaceview所在的视图层级结构viewhieiarchy中;The processor is further configured to insert the new surface view new surfaceview into the view hierarchy structure viewhieiarchy where the original surface view original surface view is located;
    所述显示单元具体用于:The display unit is specifically configured to:
    显示缩放后的目标视频层画面,所述目标视频层画面为所述新表面视图new surfaceview中,已转换成所述目标格式的所述视频帧数据表示的新视频层画面。Displaying the scaled target video layer picture, which is a new video layer picture that has been converted into the video frame data representation of the target format in the new surface view new surfaceview.
  22. 根据权利要求12-21任一项所述的终端,其特征在于,所述第二格式为YUV类型的格式。The terminal according to any one of claims 12 to 21, wherein the second format is a YUV type format.
  23. 一种计算机可读存储介质,其特征在于,包括指令,当其在终端上运行时,使得所述终端执行如权利要求1-11任一项所述的数据处理方法。A computer readable storage medium, comprising instructions that, when run on a terminal, cause the terminal to perform the data processing method of any of claims 1-11.
  24. 一种包含指令的计算机程序产品,其特征在于,当其在终端上运行时,使得所述终端执行如权利要求1-11任一项所述的数据处理方法。 A computer program product comprising instructions, wherein when executed on a terminal, the terminal is caused to perform the data processing method according to any one of claims 1-11.
PCT/CN2017/100080 2017-03-27 2017-08-31 Data processing method and terminal WO2018176734A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201780033551.XA CN109196865B (en) 2017-03-27 2017-08-31 Data processing method, terminal and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710189121 2017-03-27
CN201710189121.9 2017-03-27

Publications (1)

Publication Number Publication Date
WO2018176734A1 true WO2018176734A1 (en) 2018-10-04

Family

ID=63674060

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/100080 WO2018176734A1 (en) 2017-03-27 2017-08-31 Data processing method and terminal

Country Status (2)

Country Link
CN (1) CN109196865B (en)
WO (1) WO2018176734A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111831713A (en) * 2019-04-18 2020-10-27 阿里巴巴集团控股有限公司 Data processing method, device and equipment
CN110427094B (en) * 2019-07-17 2021-08-17 Oppo广东移动通信有限公司 Display method, display device, electronic equipment and computer readable medium
CN112839252B (en) * 2019-11-25 2023-03-21 青岛海信电器股份有限公司 Display device
CN111083496A (en) * 2019-12-25 2020-04-28 Oppo广东移动通信有限公司 Data processing method and related product
CN112788431A (en) * 2020-12-24 2021-05-11 四川云从天府人工智能科技有限公司 Video playing method, device, system, medium and browser based on HTML5
CN115904303A (en) * 2021-05-21 2023-04-04 荣耀终端有限公司 Method and equipment for playing sound
CN113613071B (en) * 2021-07-30 2023-10-20 上海商汤临港智能科技有限公司 Image processing method, device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030001964A1 (en) * 2001-06-29 2003-01-02 Koichi Masukura Method of converting format of encoded video data and apparatus therefor
CN101059797A (en) * 2006-04-20 2007-10-24 风网科技(北京)有限公司 Video frequency file automatic conversion system and its method
CN101073263A (en) * 2004-06-14 2007-11-14 Rok产品有限公司 Medium player
CN105049931A (en) * 2015-08-10 2015-11-11 合一网络技术(北京)有限公司 Method and system for converting video with non-supporting format in mobile terminal
CN105430236A (en) * 2015-12-22 2016-03-23 北京天诚盛业科技有限公司 Method for quickly converting image output formats

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8031197B1 (en) * 2006-02-03 2011-10-04 Nvidia Corporation Preprocessor for formatting video into graphics processing unit (“GPU”)-formatted data for transit directly to a graphics memory
US8233527B2 (en) * 2007-05-11 2012-07-31 Advanced Micro Devices, Inc. Software video transcoder with GPU acceleration
CN103841451B (en) * 2012-11-28 2017-09-29 腾讯科技(深圳)有限公司 Multi-medium play method, device and terminal
CN103607581A (en) * 2013-08-01 2014-02-26 广东本致数码科技有限公司 Video monitoring image display method based on three-dimensional images
CN103841389B (en) * 2014-04-02 2015-10-21 北京奇艺世纪科技有限公司 A kind of video broadcasting method and player

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030001964A1 (en) * 2001-06-29 2003-01-02 Koichi Masukura Method of converting format of encoded video data and apparatus therefor
CN101073263A (en) * 2004-06-14 2007-11-14 Rok产品有限公司 Medium player
CN101059797A (en) * 2006-04-20 2007-10-24 风网科技(北京)有限公司 Video frequency file automatic conversion system and its method
CN105049931A (en) * 2015-08-10 2015-11-11 合一网络技术(北京)有限公司 Method and system for converting video with non-supporting format in mobile terminal
CN105430236A (en) * 2015-12-22 2016-03-23 北京天诚盛业科技有限公司 Method for quickly converting image output formats

Also Published As

Publication number Publication date
CN109196865B (en) 2021-03-30
CN109196865A (en) 2019-01-11

Similar Documents

Publication Publication Date Title
WO2018176734A1 (en) Data processing method and terminal
AU2020201023B2 (en) Adaptive transfer function for video encoding and decoding
US20210132779A1 (en) Electronic device and method for configuring display thereof
US11106307B2 (en) Method for low power driving of display and electronic device for performing same
US9491367B2 (en) Image data processing method and electronic device supporting the same
US9430810B2 (en) Drawing method, apparatus, and terminal
US11050968B2 (en) Method for driving display including curved display area, display driving circuit supporting the same, and electronic device including the same
WO2018161534A1 (en) Image display method, dual screen terminal and computer readable non-volatile storage medium
US20180220068A1 (en) Foveated camera for video augmented reality and head mounted display
WO2019076274A1 (en) Method and terminal for displaying dynamic image
WO2021008427A1 (en) Image synthesis method and apparatus, electronic device, and storage medium
WO2015165013A1 (en) Method for displaying data on screen and display control apparatus
US9781380B2 (en) Method, apparatus and terminal for playing multimedia content
US11051042B2 (en) Image processing device and method
US9489883B2 (en) Electronic apparatus and method of displaying image thereof
CN106796489B (en) Method and apparatus for processing display data in an electronic device
WO2021160077A1 (en) Table processing method and apparatus, device and storage medium
US20170018247A1 (en) Idle frame compression without writeback
US20130176289A1 (en) Display switch method and portable device thereof
US20230409195A1 (en) Display method, terminal device and non-transitory storage medium
US11467798B2 (en) Display apparatus for changing an advertisement area, server, electronic apparatus and control methods thereof
EP4343674A1 (en) Call processing method and related device thereof
CN116957933A (en) Image processing method, apparatus and computer readable storage medium
CN117812274A (en) Image compression method, device and equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17903245

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17903245

Country of ref document: EP

Kind code of ref document: A1