[go: up one dir, main page]

CN112188213B - Encoding method, apparatus, computer device, and storage medium - Google Patents

Encoding method, apparatus, computer device, and storage medium Download PDF

Info

Publication number
CN112188213B
CN112188213B CN202010818050.6A CN202010818050A CN112188213B CN 112188213 B CN112188213 B CN 112188213B CN 202010818050 A CN202010818050 A CN 202010818050A CN 112188213 B CN112188213 B CN 112188213B
Authority
CN
China
Prior art keywords
encoder
code stream
coding
data
parameters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010818050.6A
Other languages
Chinese (zh)
Other versions
CN112188213A (en
Inventor
曲宝庆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ifreecomm Technology Co ltd
Original Assignee
Ifreecomm Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ifreecomm Technology Co ltd filed Critical Ifreecomm Technology Co ltd
Priority to CN202010818050.6A priority Critical patent/CN112188213B/en
Publication of CN112188213A publication Critical patent/CN112188213A/en
Application granted granted Critical
Publication of CN112188213B publication Critical patent/CN112188213B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • H04N21/426Internal components of the client ; Characteristics thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81Monomedia components thereof
    • H04N21/8166Monomedia components thereof involving executable data, e.g. software
    • H04N21/8193Monomedia components thereof involving executable data, e.g. software dedicated tools, e.g. video decoder software or IPMP tool

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application relates to an encoding method, an encoding device, a computer device and a storage medium. The method comprises the following steps: creating a system encoder when the encoding service is triggered; sending a message to an extension encoder chip by the system encoder to cause the extension encoder chip to turn on an auxiliary encoder; hard coding the multimedia data by utilizing the auxiliary encoder to obtain a coded code stream; storing the coded code stream into a data queue corresponding to the system encoder; and responding to the callback interface instruction, and taking out the corresponding coded code stream from the data queue to perform corresponding service processing. The method can improve the coding capacity of the mobile system platform.

Description

Encoding method, apparatus, computer device, and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an encoding method, an encoding apparatus, a computer device, and a storage medium.
Background
With the development of computer technology, more and more applications based on mobile system platforms require video and audio coding, such as video conferences, online classes, online interviews, etc. However, when multiple services need to be encoded at the same time, the encoding processing capability of the mobile system platform may not meet the requirements, which limits the development of video and audio services in the mobile system platform. How to increase the coding capability of a mobile system platform becomes an urgent problem to be solved.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an encoding method, apparatus, computer device, and storage medium that can improve the encoding capability of a mobile system platform.
A method of encoding, the method comprising:
creating a system encoder when the encoding service is triggered;
sending a message to an extension encoder chip by the system encoder to cause the extension encoder chip to turn on an auxiliary encoder;
hard coding the multimedia data by utilizing the auxiliary encoder to obtain a coded code stream;
storing the coded code stream into a data queue corresponding to the system encoder;
and responding to the callback interface instruction, and taking out the corresponding coded code stream from the data queue to perform corresponding service processing.
In one embodiment, after the creating the system encoder, the method further comprises:
setting parameters of a callback interface function; the parameters of the callback interface function comprise callback data types and cache area pointers of the callback data;
the responding to the callback interface instruction, the extracting the corresponding code stream from the data queue to perform corresponding service processing comprises the following steps:
and responding to a callback interface instruction, executing the callback interface function, and taking out the coded code stream corresponding to the callback data type from the data queue according to the buffer area pointer to perform corresponding service processing.
In one embodiment, after the creating the system encoder, the method further comprises:
setting parameters of the system encoder;
after the sending, by the system encoder, a message to the extension encoder chip to cause the extension encoder chip to turn on the auxiliary encoder, the method further includes:
extracting parameters of the system encoder from the message;
and setting parameters of the auxiliary encoder according to the parameters of the system encoder.
In one embodiment, the setting parameters of the system encoder includes:
displaying a coding parameter selection interface;
receiving a coding parameter selection instruction triggered in the coding parameter selection interface;
extracting coding parameters from the coding parameter selection instruction;
and setting parameters of the system encoder according to the coding parameters.
In one embodiment, the multimedia data is video data, and the corresponding encoded code stream is a video encoded code stream; the method further comprises the steps of:
decoding the video coding code stream;
displaying the video obtained by decoding in a preview frame of an application interface;
and adjusting parameters of the auxiliary encoder according to the display effect of the video in the preview frame.
In one embodiment, the sending, by the system encoder, a message to an extension encoder chip to cause the extension encoder chip to turn on an auxiliary encoder includes:
triggering a message sending instruction through the system encoder so that a system chip sends a message to the extension encoder chip according to the message sending instruction; the message comprises the type of the multimedia data;
and starting an auxiliary encoder corresponding to the type of the multimedia data through the extension encoder chip.
In one embodiment, the storing the encoded code stream in a data queue corresponding to the system encoder includes:
storing the coded code stream into a first buffer queue corresponding to the auxiliary encoder;
transmitting the coded code stream in the first cache queue to a second cache queue corresponding to a system chip;
copying the coded code stream in the second buffer queue to a data queue corresponding to the system encoder.
An encoding apparatus, the apparatus comprising:
the creation module is used for creating a system encoder when the coding service is triggered;
a transmitting module, configured to transmit a message to an extension encoder chip through the system encoder, so that the extension encoder chip turns on an auxiliary encoder;
The hard coding module is used for hard coding the multimedia data by utilizing the auxiliary encoder to obtain a coded code stream;
the storage module is used for storing the coded code stream into a data queue corresponding to the system encoder;
and the extraction module is used for responding to the callback interface instruction and extracting the corresponding coded code stream from the data queue so as to carry out corresponding service processing.
In one embodiment, the apparatus further comprises:
the setting module is used for setting parameters of the callback interface function; the parameters of the callback interface function comprise callback data types and cache area pointers of the callback data;
the take-out module is further configured to:
and responding to a callback interface instruction, executing the callback interface function, and taking out the coded code stream corresponding to the callback data type from the data queue according to the buffer area pointer to perform corresponding service processing.
In one embodiment, the apparatus further comprises:
the setting module is also used for setting parameters of the system encoder;
an extracting module, configured to extract parameters of the system encoder from the message;
the setting module is further configured to set parameters of the auxiliary encoder according to parameters of the system encoder.
In one embodiment, the setting module is further configured to:
displaying a coding parameter selection interface;
receiving a coding parameter selection instruction triggered in the coding parameter selection interface;
extracting coding parameters from the coding parameter selection instruction;
and setting parameters of the system encoder according to the coding parameters.
In one embodiment, the multimedia data is video data, and the corresponding encoded code stream is a video encoded code stream; the apparatus further comprises:
the decoding module is used for decoding the video coding code stream;
the display module is used for displaying the video obtained by decoding in a preview frame of the application interface;
and the adjusting module is used for adjusting the parameters of the auxiliary encoder according to the display effect of the video in the preview frame.
In one embodiment, the sending module is further configured to:
triggering a message sending instruction through the system encoder so that a system chip sends a message to the extension encoder chip according to the message sending instruction; the message comprises the type of the multimedia data;
and starting an auxiliary encoder corresponding to the type of the multimedia data through the extension encoder chip.
In one embodiment, the saving module is further configured to:
storing the coded code stream into a first buffer queue corresponding to the auxiliary encoder;
transmitting the coded code stream in the first cache queue to a second cache queue corresponding to a system chip;
copying the coded code stream in the second buffer queue to a data queue corresponding to the system encoder.
A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the encoding method when executing the computer program.
A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor realizes the steps of the encoding method.
In the above embodiment, when the coding service is triggered, the mobile terminal creates the system encoder, and sends a message to the extension encoder chip through the system encoder, so as to turn on the auxiliary encoder in the extension encoder chip, and then hard-code the multimedia data by using the auxiliary encoder, thereby expanding the coding capability of the mobile system platform and enabling the mobile system platform to meet more video and audio service requirements.
Drawings
FIG. 1 is a flow diagram of an encoding method in one embodiment;
FIG. 2 is a flow chart of an encoding method according to another embodiment;
FIG. 3 is a timing diagram of an encoding method in one embodiment;
FIG. 4 is a block diagram of an encoding apparatus in one embodiment;
FIG. 5 is a block diagram of an encoding apparatus according to another embodiment;
fig. 6 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
According to the coding method, when the coding service is triggered, the mobile terminal creates a system coder, and sends a message to the extension coder chip through the system coder so as to open an auxiliary coder in the extension coder chip, and then the auxiliary coder is utilized to carry out hard coding on the multimedia data, so that a coded code stream is obtained.
The mobile terminal may be, but is not limited to, various smart phones, tablet computers, and portable wearable devices.
In one embodiment, as shown in fig. 1, there is provided an encoding method, which is described by taking a mobile terminal as an example, and includes the following steps:
s102, when the coding service is triggered, the mobile terminal creates a system coder.
The coding service refers to coding service provided by a mobile system platform of the mobile terminal. The encoding service may be triggered by a software client of the mobile system platform, or may be triggered by a hardware device (e.g., camera, microphone) in the mobile terminal, etc. For example, when a video conference client opens a video conference, an encoding service that encodes video data as well as audio data may be triggered. For example, when an online classroom client displays a text file, an encoding service that encodes the text file may be triggered. For example, when the camera acquires video data, an encoding service for encoding the video data is triggered.
Wherein the system encoder is an encoder provided by the mobile system platform itself. The system encoder is provided in the system chip. A system chip is an integrated circuit with a dedicated target on which the operating system of the mobile system platform is embedded. For example, the system chip may employ an RK3399 chip.
The system encoder may provide an encoding service for encoding various types of multimedia data. Such as video data, audio data, picture data, text data, hypertext data, etc.
S104, the mobile terminal sends a message to the extension encoder chip through the system encoder so that the extension encoder chip starts the auxiliary encoder.
The expansion encoder chip is a chip externally connected to the system chip, and software modules such as an auxiliary encoder and the like are embedded on the expansion encoder chip. For example, the extension encoder chip may employ a HISI3531D chip.
Wherein the auxiliary encoder is used for encoding various types of multimedia data. Such as video data, audio data, picture data, text data, hypertext data, etc. The type of multimedia data supported by the auxiliary encoder may be the same as the system encoder or may be different from the system encoder.
And S106, the mobile terminal uses the auxiliary encoder to carry out hard coding on the multimedia data to obtain a coded code stream.
The multimedia data is the data to be encoded acquired by the mobile system platform after the encoding service is triggered, and the types of the multimedia data can be various multimedia data types supported by the system encoder and the auxiliary encoder.
The hard coding is that the mobile terminal codes by calling a hardware module at the bottom layer of the mobile system platform.
The code stream is a compressed code stream obtained by hard coding the multimedia data by the mobile terminal. For different types of multimedia data, different coding standards can be used for coding, so as to obtain coded code streams with different formats. For example, video data may be encoded using different encoding standards such as MPEG2 (Moving Picture Experts Group, moving picture experts group 2), MPEG4 (Moving Picture Experts Group, moving picture experts group 4), and h.264, to obtain encoded code streams in MPEG2, MPEG4, and h.264 formats, respectively. For example, the audio data may be encoded using different encoding standards such as MP3 (Moving Picture Experts Group Audio Layer, moving picture experts group audio layer 3), ID3V2, AAC (Advanced Audio Coding ), and the like, to obtain encoded streams in MP3, ID3V2, and AAC formats, respectively.
S108, the mobile terminal stores the coded code stream into a data queue corresponding to the system encoder.
The data queue is a linear table which only allows insertion operation at one end and deletion operation at the other end, and is a first-in first-out data structure. The data queues include a sequential queue and a circular queue. The mobile terminal allocates a special buffer area for the system encoder, and stores the coded code stream in the buffer area in a data structure of a data queue.
The mobile terminal can directly store the coded code stream into a data queue corresponding to the system encoder, or temporarily store the coded code stream into a buffer area, and then store the coded code stream into the data queue corresponding to the system encoder.
S110, the mobile terminal responds to the callback interface instruction and takes out the corresponding coded code stream from the data queue to carry out corresponding service processing.
The callback interface instruction is used for indicating the mobile terminal to take out the coded code stream from the data queue. The callback interface instruction can be triggered by a system encoder, the system encoder can detect data packets of the coded code stream in the data queue, and the callback interface instruction is triggered after a preset number of data packets are stored in the data queue. For example, when encoding video data, the system encoder may trigger a callback interface instruction upon detecting a data packet storing a frame of data in the data queue.
And after the callback interface instruction is triggered, the mobile terminal takes out the corresponding code stream from the data queue according to the data arrangement sequence in the data queue.
The corresponding business processing refers to corresponding processing according to the business requirement of an application layer in the mobile system platform. For example, if the client of the application layer is conducting the video conference service, the mobile terminal sends the encoded code stream to other nodes in the video conference through the client. For example, if the client of the application layer is sharing the shot short video in the video sharing platform, the mobile terminal uploads the encoded code stream to the video sharing platform.
In the above embodiment, when the coding service is triggered, the mobile terminal creates the system encoder, and sends a message to the extension encoder chip through the system encoder, so as to turn on the auxiliary encoder in the extension encoder chip, and then hard-code the multimedia data by using the auxiliary encoder, thereby expanding the coding capability of the mobile system platform and enabling the mobile system platform to meet more video and audio service requirements. In addition, when the mobile terminal uses the auxiliary encoder to perform the encoder, the process of creating the system encoder is the same as the process of creating the system encoder when only using the system encoder to perform the encoding, and even if the system encoder and the auxiliary encoder are used for encoding at the same time, the complexity of creating the encoder is not increased.
In one embodiment, after the mobile terminal creates the system encoder, it further includes: setting parameters of a callback interface function; the parameters of the callback interface function comprise callback data type and cache area pointer of the callback data; responding to the callback interface instruction, the mobile terminal takes out the corresponding coded code stream from the data queue to perform corresponding service processing, which comprises the following steps: and responding to the callback interface instruction, the mobile terminal executes the callback interface function so as to take out the coded code stream corresponding to the callback data type from the data queue according to the buffer zone pointer and perform corresponding service processing.
And the callback interface function is used for executing the application layer which takes out the corresponding coded code stream from the data queue and sends the coded code stream to the mobile system platform to perform service processing.
The callback data type is the data type of the data fetched from the data queue through the callback interface function. A data type is a set of values defined in a data structure and operations defined on this set of values. The callback data type may be an original type, a tuple, a record unit, an algebraic data type, an abstract data type, etc.
The buffer pointer of the callback data points to the buffer address of the callback data. After the mobile terminal takes out the data through the callback interface function, the buffer area pointer of the callback data is correspondingly changed, so that the pointer points to the address of the residual data.
In one embodiment, after the mobile terminal creates the system encoder, it further includes: setting parameters of a system encoder; after sending a message to the extension encoder chip by the system encoder to cause the extension encoder chip to turn on the auxiliary encoder, the method further comprises: extracting parameters of a system encoder from the message; parameters of the auxiliary encoder are set according to parameters of the system encoder.
Parameters of the system encoder include code rate, bit rate, coding format, amplitude ratio, color space, etc.
The system encoder transmits the parameters of the system encoder to the auxiliary encoder by transmitting the message to the extension encoder chip. The auxiliary encoder uses the same parameters as the system encoder to encode, and the obtained encoded code stream is the same as the encoded code stream obtained by directly using the system encoder to encode.
In one embodiment, the parameters of the auxiliary encoder may also be different from those of the system encoder. The mobile terminal can adjust the parameters of the auxiliary encoder according to the encoding capability of the auxiliary encoder so as to obtain a higher-quality encoded code stream. For example, if the system encoder does not support the h.264 encoding format and the auxiliary encoder supports the h.264 encoding format, the mobile terminal may prompt whether to change the encoding format to h.264, and if a change instruction is received, set the encoding format in the parameters of the auxiliary encoder to the h.264 encoding format.
In one embodiment, the mobile terminal sets parameters of the system encoder including: displaying a coding parameter selection interface; receiving a coding parameter selection instruction triggered in a coding parameter selection interface; extracting coding parameters from the coding parameter selection instruction; parameters of a system encoder are set according to the coding parameters.
The mobile terminal prompts the selection of the coding parameters in the coding parameter selection interface.
The coding parameter selection instruction may be triggered by an external input device (such as a keyboard, a microphone, etc.), or may be triggered by a display device capable of receiving an input signal, such as a touch screen.
The mobile terminal displays a coding parameter selection interface, so that a user can select coding parameters and code according to the selection of the user so as to meet various different service requirements.
In one embodiment, the multimedia data is video data and the corresponding encoded code stream is a video encoded code stream; the method further comprises the steps of: decoding the video coding code stream; displaying the video obtained by decoding in a preview frame of an application interface; parameters of the auxiliary encoder are adjusted according to the display effect of the video in the preview frame.
When the multimedia data is video data, in order to preview the coding effect of coding by the auxiliary coder, the mobile terminal decodes the coded code stream, and then displays the video obtained after decoding in a preview frame of the application interface, so as to instruct a user to trigger an instruction for adjusting parameters of the auxiliary coder according to the display effect of the video in the preview frame. And after receiving a parameter adjustment instruction for adjusting the parameters of the auxiliary encoder, the mobile terminal adjusts the parameters of the auxiliary encoder according to the instruction.
For example, if the setting of the code rate in the parameters of the auxiliary encoder is too small, the video obtained after decoding the encoded code stream may have phenomena such as blurring or mosaic, so the mobile terminal adjusts the code rate according to the display effect in the preview frame, so as to improve the quality of the video obtained after decoding.
For example, if the ratio of the parameters of the auxiliary encoder is set to 4:3, the mobile terminal may adjust the ratio of the parameters to 16:9 according to the parameter adjustment instruction.
The mobile terminal displays the decoded video in a preview frame of an application interface, can verify whether the display effect of the coded code stream obtained by the coding of the auxiliary encoder can meet the service requirement, and adjusts the parameters of the auxiliary encoder according to the parameter adjustment instruction when the display effect cannot meet the service requirement.
In one embodiment, the mobile terminal sends a message to the extension encoder chip through the system encoder to cause the extension encoder chip to turn on the auxiliary encoder comprises: triggering a message sending instruction through a system encoder so that the system chip sends a message to an extension encoder chip according to the message sending instruction; the message comprises the type of the multimedia data; the auxiliary encoder corresponding to the type of the multimedia data is turned on by the extension encoder chip.
After the system encoder triggers the message sending instruction, the mobile system platform generates a control signaling, and the system chip sends the control signaling to the extension encoder chip so that the extension encoder chip starts the auxiliary encoder according to the control signaling.
The system chip and the extension encoder chip communicate through an inter-chip interconnection standard. Such as the HSIC (High Speed Inter Chip, high speed inter-chip interconnect) standard, the HIS (High Speed Synchronous Serial Interface, synchronous serial interface) standard, etc.
After receiving the information sent by the system chip, the extension encoder chip extracts the type of the multimedia data from the information, and starts a corresponding auxiliary encoder to encode the multimedia data according to the type of the multimedia data.
In one embodiment, the mobile terminal saving the encoded code stream to a data queue corresponding to a system encoder includes: the mobile terminal stores the coded code stream into a first buffer queue corresponding to the auxiliary encoder; transmitting the coded code stream in the first buffer queue to a second buffer queue corresponding to the system chip; and copying the coded code stream in the second buffer queue to a data queue corresponding to the system encoder.
The first buffer queue is stored in a storage area in the extended encoder chip and is used for storing the encoded code stream output after the encoding of the auxiliary encoder.
Wherein the second cache queue is stored in a memory area in the system chip.
The mobile terminal can send the code stream in the first buffer queue to the second buffer queue through PCI-E (Peripheral Component Interconnect-Express, external unit connection standard-professional version) high-speed serial computer expansion bus interface. Or the coded code stream in the first cache queue can be sent to the second cache queue through an inter-CPU network.
And the system encoder copies the coded code stream in the second buffer queue to a data queue corresponding to the system encoder through triggering a queue data filling function.
In one embodiment, when the encoding service is triggered, the mobile terminal creates a system encoder and divides multimedia data to be encoded into two parts after turning on an auxiliary encoder through an extension encoder chip. One part is encoded by a system encoder and the other part is encoded by an auxiliary encoder.
The mobile terminal may divide multimedia data to be encoded into two parts according to the type thereof. For example, the mobile terminal may encode video data by a system encoder and audio data by an auxiliary encoder. The mobile terminal may also select the encoder according to the client that triggers the encoding service. For example, when the client 1 triggers the encoding service, the multimedia data is encoded by the system encoder; when the client 2 triggers the encoding service, the multimedia data is encoded by the auxiliary encoder. The mobile terminal carries out coding simultaneously through the system coder and the auxiliary coder, thereby improving the coding speed.
In one embodiment, when the encoding service is triggered, the mobile terminal first creates a system encoder by which multimedia data is encoded. When the coding capability of the system encoder cannot meet the service requirement, a message is sent to the extension encoder chip through the system encoder, so that the extension encoder chip starts the auxiliary encoder and codes through the auxiliary encoder, and when the coding capability of the system encoder cannot meet a plurality of simultaneous coding services, the auxiliary encoder codes, so that the mobile terminal can simultaneously carry out more coding services.
In one embodiment, when the encoding service is triggered, the mobile terminal first creates a system encoder by which multimedia data is encoded. When the coding capability of the system encoder can meet the service requirement, but the system encoder does not support the type of the multimedia data or does not support the coding parameters extracted from the coding parameter selection instruction, the mobile terminal sends a message to the extension encoder chip through the system encoder so that the extension encoder chip starts the auxiliary encoder and codes through the auxiliary encoder.
In one embodiment, as shown in fig. 2, the process of encoding multimedia data by the mobile terminal includes the following steps:
s202, when the coding service is triggered, the mobile terminal creates a system coder.
S204, the mobile terminal sets parameters of a system encoder.
S206, the mobile terminal sets parameters of the callback interface function; the parameters of the callback interface function comprise callback data type and buffer pointers of the callback data.
S208, the mobile terminal sends a message to the extension encoder chip through the system encoder so that the extension encoder chip starts the auxiliary encoder.
S210, the mobile terminal extracts parameters of a system encoder from the message.
S212, the mobile terminal sets parameters of the auxiliary encoder according to the parameters of the system encoder.
S214, the mobile terminal uses the auxiliary encoder to carry out hard coding on the multimedia data to obtain a coded code stream
S216, the mobile terminal stores the coded code stream into a first buffer queue corresponding to the auxiliary encoder.
S218, the mobile terminal transmits the coded code stream in the first buffer queue to a second buffer queue corresponding to the system chip.
S220, the mobile terminal copies the coded code stream in the second buffer queue to a data queue corresponding to the system encoder.
And S222, responding to the callback interface instruction, and executing the callback interface function by the mobile terminal so as to take out the coded code stream corresponding to the callback data type from the data queue according to the buffer area pointer to carry out corresponding service processing.
The details of S202 to S222 described above may refer to the specific implementation procedure described above.
In one embodiment, as shown in fig. 3, when the encoding service is triggered, the application layer of the mobile system platform of the mobile terminal creates a system encoder, then sets the system encoder parameters, and finally sets the parameters of the callback interface function. The application layer triggers a message sending instruction to send a message to the extension encoder chip by calling an interface of a frame layer of the mobile system platform, and informs the extension encoder chip to start an auxiliary encoder so as to encode the multimedia data through the auxiliary encoder. After the auxiliary encoder encodes the multimedia data, the encoded code stream is stored in a first buffer queue, then the encoded code stream is sent to a system chip, the system chip stores the encoded code stream in a second buffer queue, and then the encoded code stream in the second buffer queue is copied to a data queue corresponding to the system encoder. And finally, responding to the callback interface instruction, executing the callback interface function by the mobile terminal, taking out the coded code stream corresponding to the callback data type from the data queue according to the buffer zone pointer, and sending the coded code stream to the application layer for corresponding service processing.
It should be understood that, although the steps in the flowcharts of fig. 1-3 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 1-3 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
In one embodiment, as shown in fig. 4, there is provided an encoding apparatus including: a creation module 402, a transmission module 404, a hard coding module 406, a saving module 408, and a retrieval module 410, wherein:
a creation module 402, configured to create a system encoder when the encoding service is triggered;
a transmitting module 404, configured to transmit a message to the extension encoder chip through the system encoder, so that the extension encoder chip turns on the auxiliary encoder;
A hard coding module 406, configured to hard code the multimedia data by using an auxiliary encoder to obtain a coded code stream;
a saving module 408, configured to save the encoded code stream to a data queue corresponding to the system encoder;
and the fetching module 410 is configured to, in response to the callback interface instruction, fetch the corresponding encoded code stream from the data queue to perform corresponding service processing.
In the above embodiment, when the coding service is triggered, the mobile terminal creates the system encoder, and sends a message to the extension encoder chip through the system encoder, so as to turn on the auxiliary encoder in the extension encoder chip, and then hard-code the multimedia data by using the auxiliary encoder, thereby expanding the coding capability of the mobile system platform and enabling the mobile system platform to meet more video and audio service requirements.
In one embodiment, as shown in fig. 5, the apparatus further comprises:
a setting module 412, configured to set parameters of the callback interface function; the parameters of the callback interface function comprise callback data type and cache area pointer of the callback data;
the extraction module 410 is further configured to:
and executing the callback interface function in response to the callback interface instruction, and taking out the coded code stream corresponding to the callback data type from the data queue according to the buffer zone pointer to perform corresponding service processing.
In one embodiment, the apparatus further comprises:
a setting module 412, configured to set parameters of the system encoder;
an extracting module 414, configured to extract parameters of the system encoder from the message;
the setting module 412 is further configured to set parameters of the auxiliary encoder according to parameters of the system encoder.
In one embodiment, the setting module 412 is further configured to:
displaying a coding parameter selection interface;
receiving a coding parameter selection instruction triggered in a coding parameter selection interface;
extracting coding parameters from the coding parameter selection instruction;
parameters of a system encoder are set according to the coding parameters.
In one embodiment, the multimedia data is video data and the corresponding encoded code stream is a video encoded code stream; the apparatus further comprises:
a decoding module 416, configured to decode the video encoded code stream;
the display module 418 is configured to display the decoded video in a preview box of the application interface;
the adjusting module 420 is configured to adjust parameters of the auxiliary encoder according to the display effect of the video in the preview frame.
In one embodiment, the sending module 404 is further configured to:
triggering a message sending instruction through a system encoder so that the system chip sends a message to an extension encoder chip according to the message sending instruction; the message comprises the type of the multimedia data;
The auxiliary encoder corresponding to the type of the multimedia data is turned on by the extension encoder chip.
In one embodiment, the save module 408 is further configured to:
storing the coded code stream into a first buffer queue corresponding to the auxiliary encoder;
transmitting the coded code stream in the first buffer queue to a second buffer queue corresponding to the system chip;
copying the coded code stream in the second buffer queue to a data queue corresponding to the system encoder.
The specific limitation of the encoding device may be referred to as limitation of the encoding method hereinabove, and will not be described herein. The respective modules in the above-described encoding apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement an encoding method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 6 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of: creating a system encoder when the encoding service is triggered; transmitting a message to the extension encoder chip through the system encoder to enable the extension encoder chip to turn on the auxiliary encoder; hard coding the multimedia data by using an auxiliary encoder to obtain a coded code stream; storing the coded code stream into a data queue corresponding to a system encoder; and responding to the callback interface instruction, and taking out the corresponding coded code stream from the data queue to perform corresponding service processing.
In one embodiment, the processor when executing the computer program further performs the steps of: setting parameters of a callback interface function; the parameters of the callback interface function comprise callback data type and cache area pointer of the callback data; responding to the callback interface instruction, and extracting the corresponding coded code stream from the data queue to perform corresponding service processing comprises the following steps: and executing the callback interface function in response to the callback interface instruction, and taking out the coded code stream corresponding to the callback data type from the data queue according to the buffer zone pointer to perform corresponding service processing.
In one embodiment, the processor when executing the computer program further performs the steps of: setting parameters of a system encoder; extracting parameters of a system encoder from the message; parameters of the auxiliary encoder are set according to parameters of the system encoder.
In one embodiment, the processor when executing the computer program further performs the steps of: displaying a coding parameter selection interface; receiving a coding parameter selection instruction triggered in a coding parameter selection interface; extracting coding parameters from the coding parameter selection instruction; parameters of a system encoder are set according to the coding parameters.
In one embodiment, the processor when executing the computer program further performs the steps of: the multimedia data are video data, and the corresponding code stream is a video code stream; the method further comprises the steps of: decoding the video coding code stream; displaying the video obtained by decoding in a preview frame of an application interface; parameters of the auxiliary encoder are adjusted according to the display effect of the video in the preview frame.
In one embodiment, the processor when executing the computer program further performs the steps of: triggering a message sending instruction through a system encoder so that the system chip sends a message to an extension encoder chip according to the message sending instruction; the message comprises the type of the multimedia data; the auxiliary encoder corresponding to the type of the multimedia data is turned on by the extension encoder chip.
In one embodiment, the processor when executing the computer program further performs the steps of: storing the coded code stream into a first buffer queue corresponding to the auxiliary encoder; transmitting the coded code stream in the first buffer queue to a second buffer queue corresponding to the system chip; copying the coded code stream in the second buffer queue to a data queue corresponding to the system encoder.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of: creating a system encoder when the encoding service is triggered; transmitting a message to the extension encoder chip through the system encoder to enable the extension encoder chip to turn on the auxiliary encoder; hard coding the multimedia data by using an auxiliary encoder to obtain a coded code stream; storing the coded code stream into a data queue corresponding to a system encoder; and responding to the callback interface instruction, and taking out the corresponding coded code stream from the data queue to perform corresponding service processing.
In one embodiment, the computer program when executed by the processor further performs the steps of: setting parameters of a callback interface function; the parameters of the callback interface function comprise callback data type and cache area pointer of the callback data; responding to the callback interface instruction, and extracting the corresponding coded code stream from the data queue to perform corresponding service processing comprises the following steps: and executing the callback interface function in response to the callback interface instruction, and taking out the coded code stream corresponding to the callback data type from the data queue according to the buffer zone pointer to perform corresponding service processing.
In one embodiment, the computer program when executed by the processor further performs the steps of: setting parameters of a system encoder; extracting parameters of a system encoder from the message; parameters of the auxiliary encoder are set according to parameters of the system encoder.
In one embodiment, the computer program when executed by the processor further performs the steps of: displaying a coding parameter selection interface; receiving a coding parameter selection instruction triggered in a coding parameter selection interface; extracting coding parameters from the coding parameter selection instruction; parameters of a system encoder are set according to the coding parameters.
In one embodiment, the computer program when executed by the processor further performs the steps of: the multimedia data are video data, and the corresponding code stream is a video code stream; the method further comprises the steps of: decoding the video coding code stream; displaying the video obtained by decoding in a preview frame of an application interface; parameters of the auxiliary encoder are adjusted according to the display effect of the video in the preview frame.
In one embodiment, the computer program when executed by the processor further performs the steps of: triggering a message sending instruction through a system encoder so that the system chip sends a message to an extension encoder chip according to the message sending instruction; the message comprises the type of the multimedia data; the auxiliary encoder corresponding to the type of the multimedia data is turned on by the extension encoder chip.
In one embodiment, the computer program when executed by the processor further performs the steps of: storing the coded code stream into a first buffer queue corresponding to the auxiliary encoder; transmitting the coded code stream in the first buffer queue to a second buffer queue corresponding to the system chip; copying the coded code stream in the second buffer queue to a data queue corresponding to the system encoder.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. A method of encoding, the method comprising:
when the coding service is triggered, creating a system encoder provided by the mobile system platform;
sending a message to an extension encoder chip by the system encoder to cause the extension encoder chip to turn on an auxiliary encoder;
extracting parameters of the system encoder from the message;
Setting parameters of the auxiliary encoder according to the parameters of the system encoder;
dividing video data into two parts, and respectively utilizing the auxiliary encoder and the system encoder to carry out hard coding on the video data of the two parts at the same time to obtain a video coding code stream; the hard coding is a mode of coding by calling the bottom hardware of the mobile system platform;
decoding the video coding code stream;
displaying the video obtained by decoding in a preview frame of an application interface;
adjusting parameters of the auxiliary encoder according to the display effect of the video in the preview frame;
respectively utilizing the auxiliary encoder and the system encoder after parameter adjustment to carry out hard coding on the video data of the two parts at the same time to obtain a high-quality coded code stream;
storing the high-quality coded code stream into a data queue corresponding to the system encoder;
and responding to the callback interface instruction, and taking out the corresponding coded code stream from the data queue to perform corresponding service processing.
2. The method of claim 1, wherein after the creating the system encoder, the method further comprises:
Setting parameters of a callback interface function; the parameters of the callback interface function comprise callback data types and cache area pointers of the callback data;
the responding to the callback interface instruction, the extracting the corresponding code stream from the data queue to perform corresponding service processing comprises the following steps:
and responding to a callback interface instruction, executing the callback interface function, and taking out the coded code stream corresponding to the callback data type from the data queue according to the buffer area pointer to perform corresponding service processing.
3. The method of claim 1, wherein after creating a system encoder provided by a mobile system platform, the method further comprises:
setting parameters of the system encoder.
4. A method according to claim 3, wherein said setting parameters of said system encoder comprises:
displaying a coding parameter selection interface;
receiving a coding parameter selection instruction triggered in the coding parameter selection interface;
extracting coding parameters from the coding parameter selection instruction;
and setting parameters of the system encoder according to the coding parameters.
5. The method of claim 1, wherein after said saving said high quality encoded code stream in a data queue corresponding to said system encoder, said method further comprises:
Detecting the data packet of the coded code stream in the data queue through the system encoder;
and triggering a callback interface instruction when detecting that the number of the data packets stored in the data queue reaches a preset number.
6. The method of claim 1, wherein the sending, by the system encoder, a message to an extension encoder chip to cause the extension encoder chip to turn on an auxiliary encoder comprises:
triggering a message sending instruction through the system encoder so that a system chip sends a message to the extension encoder chip according to the message sending instruction; the message comprises the type of the video data;
and starting an auxiliary encoder corresponding to the type of the video data through the extension encoder chip.
7. The method of claim 1, wherein the saving the encoded code stream into a data queue corresponding to the system encoder comprises:
storing the coded code stream into a first buffer queue corresponding to the auxiliary encoder;
transmitting the coded code stream in the first cache queue to a second cache queue corresponding to a system chip;
Copying the coded code stream in the second buffer queue to a data queue corresponding to the system encoder.
8. An encoding apparatus, the apparatus comprising:
the creation module is used for creating a system encoder provided by the mobile system platform when the coding service is triggered;
a transmitting module, configured to transmit a message to an extension encoder chip through the system encoder, so that the extension encoder chip turns on an auxiliary encoder;
an extracting module, configured to extract parameters of the system encoder from the message;
the setting module is used for setting the parameters of the auxiliary encoder according to the parameters of the system encoder;
the hard coding module is used for dividing the video data into two parts and respectively utilizing the auxiliary encoder and the system encoder to carry out hard coding on the video data of the two parts at the same time to obtain a video coding code stream; the hard coding is a mode of coding by calling the bottom hardware of the mobile system platform;
the decoding module is used for decoding the video coding code stream;
the display module is used for displaying the video obtained by decoding in a preview frame of the application interface;
The adjusting module is used for adjusting parameters of the auxiliary encoder according to the display effect of the video in the preview frame;
the hard coding module is further used for hard coding the video data of the two parts by using the auxiliary encoder and the system encoder after parameter adjustment respectively to obtain a high-quality coding code stream;
the storage module is used for storing the high-quality coded code stream into a data queue corresponding to the system encoder;
and the extraction module is used for responding to the callback interface instruction and extracting the corresponding coded code stream from the data queue so as to carry out corresponding service processing.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202010818050.6A 2020-08-14 2020-08-14 Encoding method, apparatus, computer device, and storage medium Active CN112188213B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010818050.6A CN112188213B (en) 2020-08-14 2020-08-14 Encoding method, apparatus, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010818050.6A CN112188213B (en) 2020-08-14 2020-08-14 Encoding method, apparatus, computer device, and storage medium

Publications (2)

Publication Number Publication Date
CN112188213A CN112188213A (en) 2021-01-05
CN112188213B true CN112188213B (en) 2023-06-20

Family

ID=73919202

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010818050.6A Active CN112188213B (en) 2020-08-14 2020-08-14 Encoding method, apparatus, computer device, and storage medium

Country Status (1)

Country Link
CN (1) CN112188213B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100444640C (en) * 2006-11-21 2008-12-17 北京中星微电子有限公司 A network pick-up device
EP2127391A2 (en) * 2007-01-09 2009-12-02 Nokia Corporation Adaptive interpolation filters for video coding
CN101360060B (en) * 2008-09-18 2011-05-11 中兴通讯股份有限公司 Processing unit implementing inter-system data interaction, data transmitting/receiving method
CN107306354A (en) * 2016-04-25 2017-10-31 北京欣博电子科技有限公司 A kind of method and system of video real-time coding
CN108366288A (en) * 2018-03-01 2018-08-03 厦门普杰信息科技有限公司 A kind of efficient decoding and playback method and system for HD video

Also Published As

Publication number Publication date
CN112188213A (en) 2021-01-05

Similar Documents

Publication Publication Date Title
CN109257646B (en) Video processing method, apparatus, electronic device and computer readable medium
CN106056530B (en) Method and device for displaying picture content in application
US20190342241A1 (en) Systems and methods for manipulating and/or concatenating videos
JP2018513583A (en) Audio video file live streaming method, system and server
EP3267331B1 (en) Method and apparatus for cloud streaming service
CN107465954A (en) The generation method and Related product of dynamic thumbnail
US20080291209A1 (en) Encoding Multi-media Signals
CN111629214A (en) Transcoding method, apparatus, device and medium for video file
CN112363791A (en) Screen recording method and device, storage medium and terminal equipment
CN113096218A (en) Dynamic image playing method, device, storage medium and computer equipment
CN112188213B (en) Encoding method, apparatus, computer device, and storage medium
CN116916071B (en) Video screen display method, system, device, electronic device and storage medium
CN103701854A (en) Network real-time audio transmission method based on application virtualization
CN111447490A (en) Streaming media file processing method and device
WO2024088132A1 (en) Target-image display method and display apparatus, and electronic device and storage medium
CN105469433B (en) Picture compression method and equipment thereof
KR20040054115A (en) Thumbnail image generation and browsing method for mobile communication device
CN114793295A (en) Video processing method and device, electronic equipment and computer readable storage medium
US10025550B2 (en) Fast keyboard for screen mirroring
CN111813969A (en) Multimedia data processing method and device, electronic equipment and computer storage medium
CN114040198B (en) Image data optimization device and method
AU2022433628B2 (en) Auxiliary mpds for mpeg dash to support prerolls, midrolls and endrolls with stacking properties
KR20240126443A (en) Method and device for signaling CMAF switching set of ISOBMFF
CN117762545A (en) Wallpaper processing method and device, storage medium and electronic equipment
CN119364058A (en) Video processing method, device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant