A data processing method, device, apparatus, and readable storage medium
By configuring encoding templates for different business scenario types and obtaining frame encoding parameters based on the target business scenario type for encoding processing, the problem of poor multimedia data encoding effect is solved, and high-efficiency encoding compression performance is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2021-12-29
- Publication Date
- 2026-07-24
AI Technical Summary
In existing technologies, when encoding multimedia data, different data have different quality requirements, and using fixed encoding parameters results in poor encoding effect and insufficient encoding performance.
Different encoding configuration templates are configured according to different business scenario types. The encoding configuration template corresponding to the target business scenario type is obtained through the mapping relationship. The frame encoding parameters are determined for encoding processing to generate media data of the target media quality.
It improves encoding efficiency and compression performance, reduces computation during encoding, shortens encoding time, and ensures that the encoding results match the business scenario type, thus improving compression performance.
Smart Images

Figure CN116095359B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data processing method, apparatus, device, and readable storage medium. Background Technology
[0002] With the rapid development of mobile internet and multimedia technology, watching multimedia data (such as videos, music, and text) has gradually become a daily form of entertainment. For the same multimedia data, different encoding processes can produce media data with different qualities; for example, different encoding processes can output media data with different bitrates (or resolutions).
[0003] Currently, when encoding multimedia data, different multimedia data can only use the same fixed encoding parameters. Since different multimedia data have different quality requirements, this method greatly affects the encoding effect of the media data, and the encoding performance is not high. Summary of the Invention
[0004] This application provides a data processing method, apparatus, device, and readable storage medium, which can improve encoding efficiency and enhance encoding compression performance.
[0005] One embodiment of this application provides a data processing method, including:
[0006] Obtain the media data to be encoded, and the target business scenario type to which the media data to be encoded belongs;
[0007] Based on the mapping relationship between at least two encoding configuration templates and at least two configuration business scenario types in the configuration template set, obtain the target encoding configuration template corresponding to the target business scenario type; there is a mapping relationship between one encoding configuration template and one configuration business scenario type; at least two encoding configuration templates include the target encoding configuration template;
[0008] The frame encoding parameters of the media data to be encoded are determined based on the target encoding configuration template. The media data to be encoded is then encoded according to the frame encoding parameters to obtain target media data with target media quality. The target media quality matches the target business scenario type.
[0009] One embodiment of this application provides a data processing apparatus, including:
[0010] The data acquisition module is used to acquire the media data to be encoded, as well as the target business scenario type to which the media data to be encoded belongs;
[0011] The template acquisition module is used to obtain the target encoding configuration template corresponding to the target business scenario type based on the mapping relationship between at least two encoding configuration templates and at least two configuration business scenario types in the configuration template set; there is a mapping relationship between an encoding configuration template and a configuration business scenario type; at least two encoding configuration templates include the target encoding configuration template;
[0012] The parameter determination module is used to determine the frame encoding parameters of the media data to be encoded based on the target encoding configuration template.
[0013] The data encoding module is used to encode the media data to be encoded according to the frame encoding parameters to obtain target media data with target media quality; the target media quality matches the target business scenario type.
[0014] In one embodiment, the template acquisition module includes:
[0015] Type traversal unit, used to traverse at least two configuration business scenario types in the configuration template collection;
[0016] The template determination unit is used to determine the coding configuration template that has a mapping relationship with the target configuration business scenario type among the at least two coding configuration templates if there is a target configuration business scenario type that is the same as the target business scenario type.
[0017] The template determination unit is also used to determine the scenario similarity between at least two configuration business scenario types and the target business scenario type if there is no target configuration business scenario type that is the same as the target business scenario type among at least two configuration business scenario types.
[0018] The template determination unit is also used to determine the target encoding configuration template corresponding to the target business scenario type based on the similarity of at least two scenarios.
[0019] In one embodiment, the template determining unit includes:
[0020] The matching subunit is used to obtain the maximum scene similarity among at least two scene similarities and match the maximum scene similarity with a scene similarity threshold;
[0021] The template determination subunit is used to determine the configuration business scenario type corresponding to the maximum scenario similarity among at least two configuration business scenario types as the matching business scenario type if the maximum scenario similarity is greater than the scenario similarity threshold, and to determine the encoding configuration template that has a mapping relationship with the matching business scenario type among at least two encoding configuration templates as the target encoding configuration template corresponding to the target business scenario type.
[0022] In one embodiment, frame coding parameters include frame coding structure and frame coding quality parameters;
[0023] The parameter determination module includes:
[0024] The template distribution acquisition unit is used to acquire the frame type distribution and frame hierarchy distribution in the target encoding configuration template;
[0025] The coding structure determination unit is used to determine the frame coding structure corresponding to the media data to be encoded based on the frame type distribution and frame hierarchy distribution.
[0026] The quality parameter determination unit is used to obtain the configuration coding quality parameters in the target coding configuration template, configure the quality parameters of the media data to be encoded according to the configuration coding quality parameters, and obtain the frame coding quality parameters corresponding to the media data to be encoded.
[0027] In one embodiment, the encoding structure determination unit includes:
[0028] The unit frame group acquisition subunit is used to acquire the unit data frame group corresponding to the media data to be encoded; the unit data frame group consists of N consecutive data frames to be encoded, and the media data to be encoded includes the data frames to be encoded; N is a positive integer;
[0029] The type distribution determination subunit is used to obtain the frame group frame type distribution corresponding to the unit data frame group in the frame type distribution, and to divide the data frames to be encoded in the unit data frame group into types according to the frame group frame type distribution to obtain type-divided data frames.
[0030] The coding structure determination subunit is used to obtain the frame group frame hierarchy distribution corresponding to the unit data frame group in the frame hierarchy distribution. Based on the frame hierarchy distribution, the type-classified data frames are hierarchically divided to obtain the hierarchical coding structure corresponding to the unit data frame group.
[0031] The coding structure determines the sub-units and is also used to determine the layered coding structure as the frame coding structure corresponding to the media data to be encoded.
[0032] In one embodiment, the frame coding structure is a layered coding structure, which includes a first level and a second level, with the second level being higher than the first level; the configuration coding quality parameters include a first configuration coding quality parameter corresponding to the first level and a second configuration coding quality parameter corresponding to the second level.
[0033] The quality parameter determination unit includes:
[0034] The encoding frame acquisition subunit is used to acquire, from the media data to be encoded, the first data frame to be encoded at the first level of the layered coding structure and the second data frame to be encoded at the second level of the layered coding structure.
[0035] The device information acquisition subunit is used to acquire the device indicator information of the target terminal; the target terminal refers to the terminal waiting to play the media data to be encoded.
[0036] The first quality parameter determination subunit is used to determine the frame coding quality parameter corresponding to the first data frame to be encoded based on the equipment indicator information and the first configured coding quality parameter if the equipment indicator information meets the parameter adjustment conditions, and to determine the frame coding quality parameter corresponding to the second data frame to be encoded based on the equipment indicator information and the second configured coding quality parameter.
[0037] In one embodiment, the device performance information includes network quality parameters and decoding computing power information;
[0038] The quality parameter determination unit also includes:
[0039] The device information matching subunit is used to match network quality parameters with network parameter thresholds and to match decoding computing power information with computing power thresholds.
[0040] The condition determination subunit is used to determine that the equipment index information does not meet the parameter adjustment conditions if the network quality parameters are greater than the network parameter threshold and the decoding computing power information is greater than the computing power threshold.
[0041] The condition determination subunit is also used to determine whether the equipment index information meets the parameter adjustment conditions if the network quality parameters are less than the network parameter threshold or the decoding computing power information is less than the computing power threshold.
[0042] In one embodiment, the quality parameter determination unit further includes:
[0043] The second quality parameter determination subunit is used to determine the first configured coding quality parameter as the frame coding quality parameter corresponding to the first data frame to be encoded, and the second configured coding quality parameter as the frame coding quality parameter corresponding to the second data frame to be encoded, if the equipment indicator information does not meet the parameter adjustment conditions.
[0044] In one embodiment, the first configuration coding quality parameter includes a scenario configuration bitrate control parameter; the device indicator information includes network quality parameters.
[0045] The first quality parameter determination subunit is also specifically used to obtain a parameter mapping table; the parameter mapping table contains the mapping relationship between the set of network quality intervals and the set of adaptive bit rate control parameters, and there is a mapping relationship between a network quality interval and an adaptive bit rate control parameter;
[0046] The first quality parameter determination subunit is also specifically used to obtain the network quality parameters corresponding to the target terminal, obtain the target network quality interval to which the network quality parameters belong in the network quality interval set, and obtain the network adaptation bit rate control parameters that have a mapping relationship with the target network interval.
[0047] The first quality parameter determination subunit is also specifically used to determine the frame coding quality parameters corresponding to the first data frame to be encoded based on the scenario-configured bitrate control parameters and the network-adapted bitrate control parameters.
[0048] In one embodiment, the first quality parameter determining subunit is further specifically used to obtain the first operation coefficient corresponding to the target business scenario type and the second operation coefficient corresponding to the network quality parameter;
[0049] The first quality parameter determination subunit is also specifically used to perform calculations on the first operation coefficient and the scene configuration bitrate control parameter to obtain the first operation bitrate control parameter.
[0050] The first quality parameter determination subunit is also specifically used to perform calculations on the second operation coefficients and the network adaptation bitrate control parameters to obtain the second operation bitrate control parameters.
[0051] The first quality parameter determination subunit is also specifically used to determine the average value between the first operational bit rate control parameter and the second operational bit rate control parameter, and to determine the average value as the frame coding quality parameter corresponding to the first data frame to be encoded.
[0052] In one embodiment, the first quality parameter determining subunit is further specifically used to compare the scene configuration bitrate control parameter with the network adaptation bitrate control parameter to determine the minimum bitrate control parameter between the scene configuration bitrate control parameter and the network adaptation bitrate control parameter.
[0053] The first quality parameter determination subunit is also specifically used to determine the minimum bit rate control parameter as the frame coding quality parameter corresponding to the first data frame to be encoded.
[0054] One embodiment of this application provides a computer device, including: a processor and a memory;
[0055] The memory stores a computer program, which, when executed by a processor, causes the processor to perform the methods described in the embodiments of this application.
[0056] One aspect of this application provides a computer-readable storage medium storing a computer program, which includes program instructions. When executed by a processor, the program instructions perform the methods described in this application.
[0057] One aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method provided in one aspect of the embodiments of this application.
[0058] In this embodiment, different encoding configuration templates can be configured for different business scenario types to generate a configuration template set. This configuration template set can include each business scenario type and its corresponding (mapped) encoding configuration template. When the media data to be encoded is obtained, the target encoding configuration template corresponding to the target business scenario type can be quickly obtained from the configuration template set according to the target business scenario type. Subsequently, the frame encoding parameters of the media data to be encoded can be determined according to the target encoding configuration template, and then the media data to be encoded can be encoded according to the frame encoding parameters to obtain target media data with target media quality that matches the target business scenario type. In other words, by pre-configuring different encoding configuration templates for different business scenario types, the target encoding configuration template for the target business scenario type can be found through querying during the encoding process. The frame encoding parameters of the media data to be encoded can be quickly determined using the target encoding configuration template, effectively reducing the computational load and encoding time, and improving the encoding efficiency of the media data to be encoded. Simultaneously, the adaptive selection of encoding configuration templates based on business scenario types ensures that the selected target encoding configuration template matches the target business scenario type. The target media quality of the encoded target media data matches the target business scenario type; that is, the frame encoding parameters determined based on the target encoding configuration template meet the encoding requirements of the target business scenario type, demonstrating scenario adaptability. The compression performance of the target media data obtained using these frame encoding parameters is also high. In summary, this application can improve encoding efficiency and enhance encoding compression performance. Attached Figure Description
[0059] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0060] Figure 1 This is a network architecture diagram provided in an embodiment of this application;
[0061] Figure 2This is a schematic diagram of a data encoding scenario provided in an embodiment of this application;
[0062] Figure 3 This is a flowchart illustrating a data processing method provided in an embodiment of this application;
[0063] Figure 4 This is a schematic diagram of a scenario provided by an embodiment of this application, which configures an encoding configuration template for a business scenario type;
[0064] Figure 5 This is a schematic diagram of an encoding process provided in an embodiment of this application;
[0065] Figure 6 This is a schematic diagram of a process for determining frame encoding parameters based on a target encoding configuration template, provided in an embodiment of this application.
[0066] Figure 7 This is a system flowchart provided in an embodiment of this application;
[0067] Figure 8 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;
[0068] Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0069] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0070] Please see Figure 1 , Figure 1 This is a schematic diagram of a network architecture provided in an embodiment of this application. Figure 1 As shown, this network architecture may include a service server 1000 and a terminal device cluster (i.e., a user terminal cluster). This terminal device cluster may include one or more terminal devices; the number of terminal devices is not limited here. Figure 1 As shown, the multiple terminal devices may specifically include terminal device 100a, terminal device 100b, terminal device 100c, ..., terminal device 100n. For example... Figure 1As shown, terminal devices 100a, 100b, 100c, ..., 100n can each connect to the aforementioned service server 1000 via a network, enabling each terminal device to interact with the service server 1000 through this network connection. The network connection method is not limited; it can be a direct or indirect connection via wired communication, a direct or indirect connection via wireless communication, or other methods. This application does not impose any restrictions on this method.
[0071] Each terminal device can have the target application installed. When the target application runs on each terminal device, it can interact with the above-mentioned... Figure 1 The business servers 1000 shown interact with each other. The target application can include applications capable of displaying text, images, audio, and video data. This application can include social applications, multimedia applications (e.g., video applications), entertainment applications (e.g., game applications), educational applications, live streaming applications, and other applications with media data encoding capabilities (such as video encoding). Of course, the application can also be other applications with data display and video encoding capabilities, which will not be listed here. This application can be a standalone application or an embedded sub-application integrated into an application (e.g., social applications, educational applications, and multimedia applications), and is not limited here.
[0072] For ease of understanding, the embodiments of this application may be described in detail below. Figure 1 From the multiple user terminals shown, one user terminal is selected as the target user terminal. For example, in the embodiments of this application, a user terminal can be selected as the target user terminal. Figure 1 The user terminal 100a shown serves as the target user terminal, which may integrate a target application with video encoding capabilities. In this case, the target user terminal can interact with the business server 1000 through the business data platform corresponding to the application client.
[0073] It should be understood that the computer equipment (e.g., user terminal 100a, business server 1000) with media data encoding function (e.g., video encoding function) in the embodiments of this application can realize data encoding and data transmission of multimedia data (e.g., video data) through cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to realize data computation, storage, processing, and sharing.
[0074] Cloud technology can be a general term encompassing network technology, information technology, integration technology, management platform technology, and application technology. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will all require robust system support, which can only be achieved through cloud computing.
[0075] For example, the data processing method provided in this application can be applied to high-resolution, high-frame-rate scenarios such as video viewing, video calls, video transmission, cloud conferencing, and live streaming. Cloud conferencing, in particular, is an efficient, convenient, and low-cost conferencing format based on cloud computing technology. Currently, domestic cloud conferencing mainly focuses on services based on the SaaS (Software as a Service) model, including telephone, internet, and video services. Video conferencing based on cloud computing is called cloud conferencing. Cloud conferencing systems support dynamic cluster deployment of multiple servers and provide multiple high-performance servers, greatly improving the stability, security, and availability of the meeting. In recent years, video conferencing has been widely used in various fields such as transportation, logistics, finance, telecommunications, education, and enterprises due to its ability to significantly improve communication efficiency, continuously reduce communication costs, and upgrade internal management. Undoubtedly, with the application of cloud computing, video conferencing will have even greater appeal in terms of convenience, speed, and ease of use, and will surely stimulate a new wave of video conferencing applications.
[0076] It should be understood that computer equipment with media data encoding capabilities (e.g., user terminal 100a with video encoding capabilities) can encode media data using a media data encoder (e.g., a video encoder) to obtain the corresponding data bitstream (e.g., the video bitstream corresponding to the video data), thereby improving the transmission efficiency of media data. When the media data encoder is a video encoder, it can be an AV1 video encoder, an H.266 video encoder, an AVS3 video encoder, etc., which will not be listed here. The AV1 video encoder uses the first-generation video coding standard developed by the Alliance for Open Media (AOM).
[0077] In this application embodiment, the media data to be encoded can be referred to as the media data to be encoded, and the business scenario type to which the media data to be encoded belongs can be referred to as the target business scenario type. It is understood that, to improve the encoding efficiency and compression performance of media data, this application can configure different encoding configuration templates for different business scenario types. Different target business scenario types result in different target encoding configuration templates for the media data to be encoded, and consequently, different frame encoding parameters when encoding the media data to be encoded. In this application, when the business server 1000 obtains the media data to be encoded, it can encode the media data to be encoded (e.g., by using a media data encoder) to obtain the target media data. Before encoding, the business server 1000 can determine the corresponding target encoding configuration template based on the target business scenario type to which the media data to be encoded belongs, then determine the corresponding frame encoding parameters based on the target encoding configuration template, and finally encode the media data to be encoded based on these frame encoding parameters. This results in target media data with the target media quality (which is adapted to the target business scenario). The specific implementation methods for determining the target encoding configuration template based on the target business scenario type, and for determining the frame encoding parameters of the media data to be encoded based on the target encoding configuration template, can be found in the following sections. Figure 3 The description in the corresponding embodiments.
[0078] It is understood that the methods provided in this application embodiment can be executed by computer devices, including but not limited to terminal devices or business servers. The business server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0079] Optionally, and understandably, the aforementioned computer devices (such as the aforementioned business server 1000, terminal device 100a, terminal device 100b, etc.) can be nodes in a distributed system. This distributed system can be a blockchain system, formed by connecting multiple nodes through network communication. The nodes can form a peer-to-peer (P2P) network, where the P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP). In this distributed system, any type of computer device, such as a business server or terminal device, can become a node in the blockchain system by joining this peer-to-peer network. For ease of understanding, the concept of blockchain is explained below: Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. It is mainly used to organize data in chronological order and encrypt it into a ledger, making it tamper-proof and forgery-proof, while also enabling data verification, storage, and updating. When a computer device is a blockchain node, the immutability and anti-counterfeiting characteristics of the blockchain can ensure the authenticity and security of the data in this application (such as media data to be encoded, target media data after encoding, frame encoding parameters, etc.), thereby making the results obtained after relevant data processing based on these data more reliable.
[0080] The embodiments of this application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving. For ease of understanding, please refer to [link to relevant documentation]. Figure 2 , Figure 2 This is a schematic diagram illustrating a data encoding scenario provided in an embodiment of this application. The terminal device 2a can be used to send video data (e.g., Figure 2 The terminal device 2a shown is the one that sends video data 1), and the user corresponding to this terminal device 2a can be user a. Terminal device 2b can be used to receive video data (e.g., ...). Figure 2 The receiving terminal for the video data 1) shown, the user corresponding to this terminal device 2b, can be user b. Wherein, Figure 2 The service server 200 shown can be a server with a network connection to the terminal device 2a, and the service server 200 can be the one described above. Figure 1 The business server shown is 1000.
[0081] It should be understood that in a video transmission scenario, terminal device 2a can acquire video data 1 associated with user a, captured by an image acquisition device (e.g., a camera) (acquiring video data associated with user a requires authorization from user a). Further, terminal device 2a can encode the video data 1 using a video encoder (e.g., an AV1 video encoder) to generate a video stream 1 associated with the video data 1. At this time, terminal device 2a can send the video stream 1 to service server 200. Upon receiving the video stream 1, service server 200 can decode it to obtain video data in pixel image format (also known as YUV format) (also known as YUV video data, decoded video data, or video data to be encoded). Then, service server 200 can encode the video data to be encoded (e.g., by encoding it using a video encoder).
[0082] The process of encoding the video data to be encoded by the business server 200 can be as follows: The business server 200 can first obtain the business scenario type (which can be called the target business scenario type) to which the video data to be encoded belongs. That is, it can obtain the target business scenario type to which the video data 1 belongs. When the terminal device 2a transmits the video stream 1 to the business server 1000, it can also transmit the target business scenario type to which the video data 1 belongs. Thus, the business server 200 can quickly and accurately obtain the target business scenario type of the video data 1.
[0083] Furthermore, the business server 200 can obtain a set of configuration templates, which may include mapping relationships between at least two business scenario types and at least two encoding configuration templates (a business scenario type can have a mapping relationship with one encoding configuration template). The business server 200 can obtain the target encoding configuration template corresponding to the target business scenario type based on these mapping relationships in the configuration template set. For example, ... Figure 2 As shown, the configuration template set includes the mapping relationship between business scenario type 1 and encoding configuration template 1, the mapping relationship between business scenario type 2 and encoding configuration template 2, and the mapping relationship between business scenario type 3 and encoding configuration template 3. The target business scenario type to which video data 1 belongs is business scenario type 2. Therefore, the business server 200 can use the encoding configuration template 2 that has a mapping relationship with business scenario type 2 as the target encoding configuration template.
[0084] Furthermore, the service server 200 can determine the frame encoding parameters of the video data to be encoded based on the target encoding configuration template. The service server 200 can then encode the video data according to these frame encoding parameters, thereby obtaining target video data with the target media quality. The service server 200 can then send the target video data to the terminal device 2b waiting to play the video. The terminal device 2b can then decode and output the target video data, allowing user b to view the video data 1 through the terminal device 2b.
[0085] In this context, it can be understood that encoding the video data to be encoded can be understood as encoding the video frames (referred to as the video frames to be encoded) of the video data to be encoded. The aforementioned frame encoding parameters may include frame encoding structure and frame encoding quality parameters (such as bitrate, resolution, quantization coefficients, etc.). This application can encode each video frame to be encoded according to the frame encoding structure and frame encoding quality parameters. It can also be understood that when encoding the video data to be encoded, the video frames to be encoded (referred to as target video frames) can be obtained from the video data to be encoded, and then the coding unit (CU) can be obtained from the target video frames. Further, the service server 200 can perform prediction processing on the CU based on the encoding strategy of the video encoder to obtain the optimal prediction mode corresponding to the CU, and then perform encoding processing on the CU based on the optimal prediction mode and the aforementioned frame encoding parameters to obtain the compressed bitstream corresponding to the CU. It should be understood that when the service server 200 completes the encoding process for each unit to be encoded in the target video frame, it can obtain the compressed bitstream corresponding to each unit to be encoded. These compressed bitstreams can then be encapsulated into a video bitstream associated with the video data to be encoded. This video bitstream can be referred to as... Figure 2 The target video data is shown.
[0086] The encoding strategy here can include intra-frame prediction modes and inter-frame prediction modes. It can be understood that, during the process of the service server 200 determining the optimal prediction mode, the service server 200 can select the prediction mode with the optimal rate-distortion cost from the intra-frame prediction modes, and then use the selected prediction mode as the optimal intra-frame prediction mode. Similarly, the service server 200 can select the prediction mode with the optimal rate-distortion cost from the inter-frame prediction modes, and then use the selected prediction mode as the optimal inter-frame prediction mode. Furthermore, the service server 200 can perform mode optimization processing based on the rate-distortion costs of the optimal intra-frame prediction mode and the optimal inter-frame prediction mode to obtain the optimal prediction mode. In other words, the service server 200 can select the prediction mode with the minimum rate-distortion cost from the optimal intra-frame prediction mode and the optimal inter-frame prediction mode, and then use the prediction mode with the minimum rate-distortion cost as the optimal prediction mode.
[0087] It should be understood that, in order to improve encoding efficiency, this application can pre-configure an encoding configuration template for different business scenario types according to different business scenario requirements. The encoding configuration template can include the frame encoding structure and frame encoding quality parameters of media data (such as video data) under different business scenario types. Thus, when a certain media data to be encoded is obtained, the amount of calculation in the encoding process can be reduced, and the target encoding configuration template corresponding to the target business scenario type to which the media data to be encoded belongs can be directly obtained. This allows the frame encoding structure and frame encoding quality parameters corresponding to the media data to be encoded to be quickly determined. Then, the media data to be encoded can be encoded according to the frame encoding structure and frame encoding quality parameters, which can greatly improve encoding efficiency.
[0088] Optionally, in a feasible embodiment, this application can also adaptively adjust the target encoding configuration template according to the network status (or decoding capability) of the decoding end (such as terminal device 2b). For example, after obtaining the target encoding configuration template corresponding to the media data to be encoded, the frame encoding quality parameters in the target encoding configuration template include the bitrate encoding quality parameter. If the network status corresponding to terminal device 2b is poor at this time, the bitrate can be adaptively reduced, thereby enabling the decoding end to still quickly receive video data even when the network status is poor.
[0089] Further, please see Figure 3 , Figure 3 This is a flowchart illustrating a data processing method provided in an embodiment of this application. The method can be implemented by a terminal device (as described above). Figure 1 The method can be executed by any terminal device in the terminal device cluster in the corresponding embodiment, such as terminal device 100a; the method can also be executed by a service server (as described above). Figure 1 The method is executed by the service server 1000 in the corresponding embodiment; the method can also be executed jointly by the terminal device and the service server. Taking the method executed by the service server as an example, such as... Figure 3 As shown, the method flow may include at least the following steps S101-S103:
[0090] Step S101: Obtain the media data to be encoded and the target business scenario type to which the media data to be encoded belongs.
[0091] In this application, a computer device (e.g., a terminal device) with media data encoding capabilities (such as video encoding) can acquire media data (such as video data) captured by an image acquisition device (e.g., the terminal device's camera) in a data transmission scenario. Furthermore, the terminal device can encode the media data to obtain a corresponding data stream (such as a video stream). The terminal device can then send this data stream to a service server, which can decode the data stream to obtain media data in YUV format. This media data can be referred to as the media data to be encoded.
[0092] It is understandable that when a terminal device transmits a data stream to a business server, it can also transmit the business scenario type to which the media data belongs. This business scenario type is the same as the business scenario type of the media data to be encoded, which can be referred to as the target business scenario type. It is also understandable that the business scenario type of the media data to be encoded can be determined based on the application type of the target application. For example, if the target application installed on the terminal device is an offline short video application, and the terminal device acquires video data through its camera while running this offline short video application, then the business scenario type of this video data can be offline short video, and the target business scenario type of the corresponding media data to be encoded is offline short video. Similarly, if the target application installed on the terminal device is a live streaming application, and the terminal device acquires live video data through its camera while running the live streaming application (acquiring live video data with the authorization of the user corresponding to the terminal device), then the business scenario type of this live video data can be live streaming, and the target business scenario type of the corresponding media data to be encoded is live streaming. In other words, if the media data to be encoded is obtained through the target application, then the target business scenario type to which the media data to be encoded belongs can be the application type of the target application.
[0093] The target applications here can include social applications, multimedia applications (such as offline short video applications, live streaming applications, audio and video applications), entertainment applications (such as game applications), educational applications, and other applications with media data encoding functions. Of course, it can also be other applications with data display functions and video encoding functions, which will not be listed here.
[0094] Optionally, the solutions provided in this application embodiment may involve machine learning technology in artificial intelligence. Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, and other disciplines. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning techniques. Specifically, the following embodiment illustrates this: When a business server determines the target business scenario type to which the media data to be encoded belongs, it can generate scene features corresponding to the media data to be encoded based on a scene prediction model. Then, the scene prediction model outputs the predicted scene type corresponding to the scene features, which can be used as the target business scenario type corresponding to the media data to be encoded. The scene prediction model can be a machine learning model trained on historical media data with real scene labels, which can be used to infer the predicted scene type to which a certain media data belongs.
[0095] Step S102: Based on the mapping relationship between at least two encoding configuration templates and at least two configuration business scenario types in the configuration template set, obtain the target encoding configuration template corresponding to the target business scenario type; there is a mapping relationship between an encoding configuration template and a configuration business scenario type; at least two encoding configuration templates include the target encoding configuration template.
[0096] In this application, different encoding configuration templates can be pre-configured for different business scenario types, creating a mapping relationship between each business scenario type and its corresponding encoding configuration template, thereby obtaining a set of configuration templates containing multiple mapping relationships. Therefore, once the target business scenario type to which the media data to be encoded belongs is determined, the target encoding configuration template corresponding to the target business scenario type can be determined based on the mapping relationships between at least two encoding configuration templates in the configuration template set and at least two configured business scenario types.
[0097] For easier understanding, please refer to Figure 4 , Figure 4This is a schematic diagram illustrating a scenario where a coding configuration template is configured for a business scenario type, as provided in an embodiment of this application. For example... Figure 4 The business scenario shown is an offline short video scenario. First, we can obtain the encoding requirements for this offline short video scenario. The main goal of this offline short video is compression performance, but its processing latency requirements are not high. Therefore, the encoding requirements for this offline short video scenario are: high compression performance and low processing latency. Based on these requirements, we can configure an encoding template for this offline short video. When configuring the template for this offline short video scenario, we can understand it as configuring the frame type, frame encoding structure, and frame encoding quality parameters for the video frames of the offline short video scenario.
[0098] When configuring video frames, configuration can be done on a frame group basis (hence, a frame group is called a unit video frame group). A frame group can be a group of consecutive video frames (Group of Pictures, GOP) within the video data, and a frame group can include multiple video frames. It should be understood that the frame type of a frame can be determined based on encoding parameter settings and bitrate control strategies. The frame type can include Type 1, Type 2, and Type 3. In this application embodiment, the frame type of intra-picture (I-frame) can be referred to as the first type, the frame type of bi-directional interpolated prediction frame (B-frame, which is a bi-directional difference frame that records the difference between the current frame and the preceding and following frames, and can be used as a reference frame for other B-frames or not) can be referred to as the second type, and the frame type of predictive-frame (P-frame, which represents the difference between this frame and a previous keyframe (or P-frame), and during decoding, the difference defined in this frame needs to be superimposed on the previously cached image to generate the final image) can be referred to as the third type. A GOP can be understood as the interval between two I-frames. For example, if a video consists of 20 frames, where the first frame is an I-frame, frames 2-8 are B-frames, the ninth frame is a P-frame, the tenth frame is an I-frame, frames 11-19 are B-frames, and the twentieth frame is a P-frame, then a GOP (group of video frames) can be formed with the first frame as the start frame and the ninth frame as the end frame; or it can be formed with the tenth frame as the start frame and the twentieth frame as the end frame.
[0099] It's important to note that when a Group of Pictures (GOP) and its frame sequence are fixed, the frame sequence within each GOP is fixed. For example, if a GOP is fixed at 120 frames, an I-frame is generated every 120 frames, with a fixed GOP frame sequence like: IBBPBBP…BB I. When the GOP size is fixed but the frame sequence is not, the frame sequence within each GOP is not fixed. For example, if a GOP is fixed at 120 frames, an I-frame is generated every 120 frames. The GOP frame sequence can determine whether a frame is a P-frame or a B-frame based on the image complexity and the associated P and B frame generation weights. When both the GOP size and frame sequence are not fixed, they can be automatically generated based on image texture, motion complexity, and the I, P, and B frame generation strategies and weight configurations. The above-described GOP division process (e.g., using frame 1 as the starting frame and frame 9 as the ending frame to form a GOP) is merely an example illustrating how to divide GOPs and does not have practical reference value.
[0100] It is understood that the embodiments of this application can be configured at the GOP (Group of Pictures) granularity, configuring each video frame included in a GOP. For example, the frame type distribution, frame coding structure, and frame coding quality parameters (such as quantization coefficients, bitrate, etc.) of each frame can be reconfigured. For example, for offline short video scenarios, taking a GOP size of 16 as an example, the I, B, and P frame distribution and frame coding structure (such as quantization coefficients, bitrate, etc.) of the video frames within a GOP can be reconfigured. Figure 4 The layered coding structure 40 shown can be further configured with quantization parameters (QP) and bitrate control parameters (also known as bitrate control algorithms) for each layer after the layered coding structure 40 is determined. The above-mentioned I, B, and P frame type distribution, frame coding structure, quantization parameters of each layer, and bitrate control parameters can be referred to as the coding configuration template corresponding to this offline short video scenario. Specifically, the configuration parameters included in the encoding configuration template are not limited to the frame type distribution, frame coding structure, quantization coefficients of each layer, and bitrate control parameters (the quantization coefficients and bitrate control parameters of each layer can be called frame coding quality parameters). For example, the reference groups within a GOP (MinGOP, a group within a GOP, where frames within a group are only referenced intra-frame and inter-frame within the group) can also be configured. The MinGOP can be controlled to a maximum of 16. The maximum value varies for different resolutions. For specific details, refer to the standard RFC document, such as the level 4.1 specification, where the maximum value is 9 and 4 for 720P and 1080P video, respectively, to ensure more precise and reasonable bitrate control and QP adjustments.
[0101] It is understandable that using layered coding allows for the maintenance of a logical set of dependencies between frames. Therefore, video frames that satisfy these dependencies can be encoded simultaneously, enabling parallel processing and significantly improving coding performance. For ease of understanding, let's take... Figure 4 Taking the layered coding structure shown as an example, this layered coding structure can be divided into 5 layers. Frame 0 is an I-frame, frame 16 is a P-frame, and the remaining frames are B-frames. Figure 6 As shown, data frame 8 (i.e., the data frame to be encoded, such as a video frame) needs to refer to data frame 0 and data frame 16 during the encoding process. Therefore, when data frame 16 is encoded, the business server can encode data frame 8. The frame type of data frame 8 can be called a B-frame.
[0102] Data frame 4 requires reference to data frames 0 and 8 during encoding, and data frame 12 requires reference to data frames 8 and 16 during encoding. Therefore, once data frame 8 is encoded, the service server can encode data frames 4 and 12 separately. Both data frames 4 and 12 can be referred to as B-frames.
[0103] Data frame 2 requires reference to data frames 0 and 4 during encoding, and data frame 6 requires reference to data frames 4 and 8 during encoding. Therefore, when data frame 4 is encoded, the server can encode data frames 2 and 6 separately. Data frame 10 requires reference to data frames 8 and 12 during encoding, and data frame 14 requires reference to data frames 12 and 16 during encoding. Therefore, when data frame 12 is encoded, data frames 10 and 14 can be encoded. Data frames 2, 6, 10, and 14 can all be referred to as B-frames.
[0104] Data frame 1 requires reference to data frames 0 and 2 during encoding, and data frame 3 requires reference to data frames 2 and 4 during encoding. Therefore, when data frame 2 is encoded, the service server can encode data frames 1 and 3 separately. Data frame 5 requires reference to data frames 4 and 6 during encoding, and data frame 7 requires reference to data frames 6 and 8 during encoding. Therefore, when data frame 6 is encoded, the computer can encode data frames 5 and 7 separately. Data frame 9 requires reference to data frames 8 and 10 during encoding, and data frame 11 requires reference to data frames 10 and 12 during encoding. Therefore, when data frame 10 is encoded, the service server can encode data frames 9 and 11 separately. Data frame 13 requires reference to data frames 12 and 14 during encoding, and data frame 15 requires reference to data frames 14 and 16 during encoding. Therefore, once data frame 14 is encoded, the service server can encode data frames 13 and 15 separately. Data frames 1, 3, 5, 7, 9, 11, 13, and 15 are not referenced; these eight reference frames can all be referred to as B-frames.
[0105] Based on the above description, this application can configure different encoding configuration templates for different business scenario types (e.g., using a GOP as the granularity, configuring frame type distribution, layered encoding structure, quantization coefficients and bitrate control parameters for each layer, etc.). After configuring templates for each business scenario type, a mapping relationship can be established between each business scenario type and its corresponding encoding configuration template, thereby obtaining a set of configuration templates containing multiple mapping relationships. Then, after obtaining the media data to be encoded and its target business scenario type, the target encoding configuration template corresponding to the target business scenario type can be determined based on the set of configuration templates.
[0106] Specifically, the implementation of obtaining the target encoding configuration template corresponding to the target business scenario type based on the mapping relationship between at least two encoding configuration templates and at least two configuration business scenario types in the configuration template set can be as follows: At least two configuration business scenario types in the configuration template set can be traversed; if there is a target configuration business scenario type that is the same as the target business scenario type among the at least two configuration business scenario types, then the encoding configuration template that has a mapping relationship with the target configuration business scenario type among the at least two encoding configuration templates can be determined as the target encoding configuration template corresponding to the target business scenario type; if there is no target configuration business scenario type that is the same as the target business scenario type among the at least two configuration business scenario types, then the scenario similarity between the at least two configuration business scenario types and the target business scenario type can be determined, and the target encoding configuration template corresponding to the target business scenario type can be determined based on the scenario similarity between the at least two scenarios.
[0107] The specific implementation method for determining the target encoding configuration template corresponding to the target business scenario type based on the similarity of at least two scenarios can be as follows: the maximum scenario similarity can be obtained from the at least two scenario similarities, and the maximum scenario similarity can be matched with the scenario similarity threshold; if the maximum scenario similarity is greater than the scenario similarity threshold, the configuration business scenario type corresponding to the maximum scenario similarity among the at least two configuration business scenario types can be determined as the matching business scenario type, and the encoding configuration template that has a mapping relationship with the matching business scenario type among the at least two encoding configuration templates can be determined as the target encoding configuration template corresponding to the target business scenario type.
[0108] It should be understood that after obtaining the target business scenario type to which the media data to be encoded belongs, the configuration template set can be traversed. If there is a business scenario type in the configuration template set that is the same as the target business scenario type (i.e., a template has been configured for the target business scenario type), the encoding configuration template corresponding to the business scenario type can be directly determined as the target encoding configuration template. If there is no business scenario type in the configuration template set that is the same as the target business scenario type (i.e., no template has been configured for the target business scenario type), the business scenario type in the configuration template set that is most similar to the target business scenario type (i.e., the matching business scenario type) can be determined. If the scenario similarity between the two is greater than (or equal to) the scenario similarity threshold, the encoding configuration template corresponding to the most similar business scenario type can be used as the target encoding configuration template. Optionally, if the target business scenario type is not included in the configuration template set, and the scenario similarity threshold between the most similar business scenario type and the target business scenario type is also lower than the scenario similarity threshold, then the template can be configured in real time according to the scenario coding requirements of the target business scenario type. A mapping relationship between the configured template and the target business scenario type can be established and stored in the configuration template set for later use.
[0109] Step S103: Determine the frame encoding parameters of the media data to be encoded according to the target encoding configuration template, and encode the media data to be encoded according to the frame encoding parameters to obtain target media data with target media quality; the target media quality matches the target business scenario type.
[0110] In this application, after determining the target encoding configuration template corresponding to the target business scenario type, the frame encoding parameters of the media data to be encoded can be determined based on the target encoding configuration template. These frame encoding parameters may include frame encoding structure and frame encoding quality parameters. The frame encoding structure can refer to the encoding structure of the data frame to be encoded (e.g., when the media data to be encoded is video data, the data frame to be encoded can refer to the video frame waiting to be encoded). The frame encoding quality parameters may include quantization coefficients (QP), bitrate control parameters, resolution, etc. It should be understood that this application can configure the frame encoding structure and frame encoding quality parameters for each data frame to be encoded within a Group of Pictures (GOP). For a detailed explanation of the specific implementation method for determining the frame encoding parameters of the media data to be encoded, please refer to the subsequent sections. Figure 6 The description in the corresponding embodiments.
[0111] Furthermore, after determining the frame coding parameters of the media data to be encoded (that is, determining the frame coding structure and frame coding quality parameters of the data frame to be encoded), the media data to be encoded can be encoded according to the frame coding parameters. In other words, the data frame to be encoded can be encoded according to the frame coding structure and frame coding quality parameters, thereby obtaining target media data with target media quality (i.e., with a certain resolution, bit rate, and compression performance).
[0112] To better understand the process of encoding data frames, please refer to [link / reference]. Figure 5 , Figure 5 This is a schematic diagram of an encoding process provided in an embodiment of this application.
[0113] like Figure 5 As shown, a frame of image (such as Figure 5 The F shown n The current frame is fed into the video encoder. It can first be divided into 64×64 blocks into coding tree units (CTUs). After depthwise partitioning, coding units (CUs) are obtained. Each CU can contain a prediction unit (PU) and a transform unit (TU). It can be understood that the video encoder can extract values from the current frame (F). n The process involves obtaining the unit to be encoded (i.e., a certain CU), and then performing prediction processing on this unit to obtain a predicted unit. At this point, the degree of content variation between the predicted unit and the unit to be encoded can be determined, and based on this degree of content variation, the residual between the predicted unit and the unit to be encoded can be determined (e.g., based on...). Figure 5 The current frame F shown n With reference frame F' n-1 Intra-frame and inter-frame predictions are performed, along with motion estimation (ME) and motion compensation (MC) as shown in the diagram. Then, the service server can perform transformation processing (such as Discrete Cosine Transform (DCT)) and quantization on the residual to obtain quantization coefficients (also called residual coefficients). Furthermore, entropy coding can be performed on the quantization parameters to obtain the compressed bitstream corresponding to the unit to be encoded (i.e., ...). Figure 5 (See the arrow output). The prediction method for the coded unit can include intra-frame prediction and inter-frame prediction.
[0114] At the same time, the business server can perform inverse quantization processing on the quantization coefficients (such as...). Figure 5The inverse quantization shown) and inverse transform processing (such as...) Figure 5 After the inverse transform shown, the residual value corresponding to the reconstructed image is obtained. Then, based on the residual value and the prediction unit, the reconstructed image (which can correspond to the reconstructed frame F' shown in the figure) can be obtained. n For example, the residual value can be added to the predicted value, and the reconstructed image can be obtained based on DB (DeBlock Filter) and SAO (Sample Adaptive Offset). Furthermore, the service server can perform filtering processing on the reconstructed image (such as in-loop filtering) to obtain the filtered image. That is, in the current frame F... n After encoding, the current frame F can be obtained based on the filtered image. n The corresponding reconstructed frame can then be added to the reference frame queue as the reference frame for the next frame, so that encoding processing can proceed sequentially.
[0115] During prediction, the calculation can start from the largest code unit (LCU), and proceed recursively by dividing each level into quadtrees and performing calculations.
[0116] First, we can divide it from top to bottom. Starting at depth = 0, the 64×64 block is divided into four 32×32 sub-CUs. Then, one of the 32×32 sub-CUs is further divided into four 16×16 sub-CUs, and so on, until depth = 3, at which point the CU size is 8×8.
[0117] Then, pruning can be performed from bottom to top. The RDcost (Rate Distortion Optimization, also known as rate distortion cost) of the four 8×8 CUs is summed (denoted as cost1) and compared with the RDcost (denoted as cost2) of the corresponding 16×16 CU at the next higher level. If cost1 is less than cost2, the 8×8 CU partition can be retained; otherwise, pruning continues upwards, comparing layer by layer. Finally, the optimal CU depth partitioning can be found.
[0118] Understandably, PU prediction can be divided into intra-frame prediction and frame-level prediction. First, within the same prediction type, comparisons can be made between different PUs to find the optimal segmentation mode. Then, comparisons can be made between intra-frame and inter-frame modes to find the optimal prediction mode for the current CU. Simultaneously, an adaptive quad-tree transformation (RQT) based on a quadtree structure can be performed on the CU to find the optimal TU mode. Finally, a frame of image can be divided into individual CUs, and the corresponding PUs and TUs for each CU.
[0119] Understandably, before encoding, a series of encoding parameters (such as frame encoding structure, bitrate control parameters, etc.) corresponding to the media data to be encoded can be quickly determined based on the template configured for the scenario. This ensures that the encoded media data can meet the required bitrate limit and minimize encoding distortion. Bitrate control falls under the category of rate-distortion optimization, which mainly involves determining the quantization coefficients that match the bitrate. This requires a large amount of computation. However, this application can effectively reduce the amount of computation in the encoding process and improve encoding efficiency by configuring the parameters in advance according to the scenario.
[0120] Optionally, when a terminal device collects media data (such as video data), it needs to encode the media data. This collected media data can also be referred to as the media data to be encoded. Alternatively, the terminal device can obtain a target encoding configuration template from the configuration template set based on the target service scenario type, determine the frame encoding parameters corresponding to the media data to be encoded based on the target encoding configuration template, and encode the media data according to these frame encoding parameters. The specific process will not be elaborated here.
[0121] In this embodiment, different encoding configuration templates can be configured for different business scenario types to generate a configuration template set. This configuration template set can include each business scenario type and its corresponding (mapped) encoding configuration template. When the media data to be encoded is obtained, the target encoding configuration template corresponding to the target business scenario type can be quickly obtained from the configuration template set according to the target business scenario type. Subsequently, the frame encoding parameters of the media data to be encoded can be determined according to the target encoding configuration template, and then the media data to be encoded can be encoded according to the frame encoding parameters to obtain target media data with target media quality that matches the target business scenario type. In other words, by pre-configuring different encoding configuration templates for different business scenario types, the target encoding configuration template for the target business scenario type can be found through querying during the encoding process. The frame encoding parameters of the media data to be encoded can be quickly determined using the target encoding configuration template, effectively reducing the computational load and encoding time, and improving the encoding efficiency of the media data to be encoded. Simultaneously, the adaptive selection of encoding configuration templates based on business scenario types ensures that the selected target encoding configuration template matches the target business scenario type. The target media quality of the encoded target media data matches the target business scenario type; that is, the frame encoding parameters determined based on the target encoding configuration template meet the encoding requirements of the target business scenario type, demonstrating scenario adaptability. The compression performance of the target media data obtained using these frame encoding parameters is also high. In summary, this application can improve encoding efficiency and enhance encoding compression performance.
[0122] Further, please see Figure 6 , Figure 6 This is a schematic diagram illustrating a process for determining frame encoding parameters based on a target encoding configuration template, as provided in an embodiment of this application. This process can correspond to the above-described... Figure 3 In the corresponding embodiment, for the process of determining the frame coding parameters of the media data to be encoded based on the target coding configuration template, the frame coding parameters in this process may include frame coding structure and frame coding quality parameters. For example... Figure 6 As shown, the process may include at least the following steps S601-S603:
[0123] Step S601: Obtain the frame type distribution and frame level distribution in the target encoding configuration template.
[0124] Specifically, the frame types here can include a first type, a second type, and a third type. In this embodiment, the intra-picture (I-frame) can be referred to as the first type, the bi-directional interpolated prediction frame (B-frame) as the second type, and the predictive-frame (P-frame) as the third type. The frame hierarchy distribution can refer to a hierarchical coding structure (total number of layers, number of frames per layer, etc.), for example, as described above. Figure 4 The hierarchical coding structure 40 in the corresponding embodiment can be a frame-level distribution. The total number of layers in the hierarchical coding structure is 5. The number of frames in the first layer is 2 (including the first frame and the 16th frame, the first frame is an I frame and the 16th frame is a P frame), the number of frames in the second layer is 1 (including the 8th frame, which is a B frame), and the number of frames in the third layer is 2 (including the 4th frame and the 12th frame, both of which are B frames). The hierarchical coding structure also includes a fourth layer and a fifth layer. The hierarchical coding structure 40 will not be described further here.
[0125] Step S602: Determine the frame coding structure corresponding to the media data to be encoded based on the frame type distribution and frame level distribution.
[0126] Specifically, this application can configure frame types and hierarchical coding structures at the GOP (Group of Pictures) granularity. Therefore, this application can determine the frame coding structure corresponding to each GOP (which can be referred to as a unit data frame group) based on the target coding configuration template, using the GOP as the granularity. The specific method is as follows: First, obtain the unit data frame group corresponding to the media data to be encoded; where the unit data frame group consists of N consecutive data frames to be encoded, and the media data to be encoded includes these data frames; N is a positive integer. Then, obtain the frame type distribution of the frame group corresponding to the unit data frame group in the frame type distribution (that is, the frame type distribution configured for the frames in each GOP). Based on the frame type distribution of the frame group, classify the data frames to be encoded in the unit data frame group by type to obtain type-classified data frames. Next, obtain the frame level distribution of the frame group corresponding to the unit data frame group in the frame level distribution. Based on the frame level distribution, classify the type-classified data frames by level to obtain the hierarchical coding structure corresponding to the unit data frame group. Finally, determine the hierarchical coding structure as the frame coding structure corresponding to the media data to be encoded.
[0127] For example, taking the frame hierarchy distribution corresponding to a GOP as a hierarchical coding structure 40, after classifying the frames in a GOP into I, B, and P types, these frames can be filled into the hierarchical coding structure 40. For instance, if the first frame is an I frame, it can be placed in the position of the first frame in the first layer of the hierarchical coding structure 40. After determining the frame type and hierarchy of each frame, the hierarchical coding structure including all frames can be determined as the frame coding structure corresponding to the GOP.
[0128] Step S603: Obtain the configuration encoding quality parameters in the target encoding configuration template, configure the quality parameters of the media data to be encoded according to the configuration encoding quality parameters, and obtain the frame encoding quality parameters corresponding to the media data to be encoded.
[0129] Specifically, as described above, the frame coding structure can be a layered coding structure. Here, we can take an example where the layered coding structure includes a first level and a second level, with the second level being higher than the first level. This application can also configure frame coding quality parameters (such as quantization coefficients QP, rate control parameters, etc.) for each level. Taking the configuration of coding quality parameters including a first configured coding quality parameter corresponding to the first level and a second configured coding quality parameter corresponding to the second level as an example, the specific method for configuring the quality parameters of the media data to be encoded according to the configured coding quality parameters to obtain the frame coding quality parameters corresponding to the media data to be encoded can be as follows: A first data frame to be encoded at the first level of the layered coding structure and a second data frame to be encoded at the second level of the layered coding structure can be obtained from the media data to be encoded. This application can directly use the first configured coding quality parameter as the frame coding quality parameter corresponding to the first data frame to be encoded and the second configured coding quality parameter as the frame coding quality parameter corresponding to the second data frame to be encoded.
[0130] Optionally, it is understood that this application may also adjust the template configured according to the scenario based on the device information of the decoding end (such as the terminal device waiting to play media data). For example, the device information may include network status information, terminal decoding capabilities, etc., so this application may adjust the template (e.g., adjust the encoding quality parameters, the number of layers in the layered encoding structure, etc.) based on the network status information and terminal decoding capabilities of the terminal device.
[0131] Taking the adjustment of encoding quality parameters as an example, the specific method of this application for configuring the quality parameters of the media data to be encoded according to the configured encoding quality parameters to obtain the frame encoding quality parameters corresponding to the media data to be encoded can also be as follows: a first data frame to be encoded in the first level of the layered encoding structure and a second data frame to be encoded in the second level of the layered encoding structure can be obtained from the media data to be encoded; subsequently, the device indicator information of the target terminal can be obtained; wherein, the target terminal refers to the terminal waiting to play the media data to be encoded; if the device indicator information meets the parameter adjustment conditions, the frame encoding quality parameters corresponding to the first data frame to be encoded can be determined according to the device indicator information and the first configured encoding quality parameters, and the frame encoding quality parameters corresponding to the second data frame to be encoded can be determined according to the device indicator information and the second configured encoding quality parameters.
[0132] Taking equipment indicator information, including network quality parameters and decoding computing power information, as an example, the specific method for determining whether the equipment indicator information meets the parameter adjustment conditions is as follows: the network quality parameters can be matched with network parameter thresholds, and the decoding computing power information can be matched with computing power thresholds. If the network quality parameters are greater than (or equal to) the network parameter thresholds, and the decoding computing power information is greater than (or equal to) the computing power thresholds, then it can be determined that the equipment indicator information does not meet the parameter adjustment conditions. If the network quality parameters are less than the network parameter thresholds, or the decoding computing power information is less than the computing power thresholds, then it can be determined that the equipment indicator information meets the parameter adjustment conditions.
[0133] Optionally, and understandably, if the device indicator information does not meet the parameter adjustment conditions, the first configured coding quality parameter can be directly determined as the frame coding quality parameter corresponding to the first data frame to be encoded, and the second configured coding quality parameter can be determined as the frame coding quality parameter corresponding to the second data frame to be encoded.
[0134] Specifically, when the device indicator information meets the parameter adjustment conditions, the specific implementation process for determining the frame coding quality parameters corresponding to the first data frame to be encoded based on the device indicator information and the first configured coding quality parameters can be as follows: A parameter mapping table can be obtained; wherein, the parameter mapping table may contain the mapping relationship between a set of network quality intervals and a set of adaptive bitrate control parameters, and there is a mapping relationship between a network quality interval and an adaptive bitrate control parameter; subsequently, the network quality parameters corresponding to the target terminal can be obtained, the target network quality interval to which the network quality parameter belongs can be obtained from the set of network quality intervals, and the network adaptive bitrate control parameters that have a mapping relationship with the target network quality interval can be obtained; based on the scenario configured bitrate control parameters and the network adaptive bitrate control parameters, the frame coding quality parameters corresponding to the first data frame to be encoded can be determined.
[0135] In one feasible embodiment, the specific implementation method for determining the frame coding quality parameter corresponding to the first data frame to be encoded based on the scenario-configured bitrate control parameters and the network-adapted bitrate control parameters can be as follows: A first operational coefficient corresponding to the target service scenario type and a second operational coefficient corresponding to the network quality parameter can be obtained; subsequently, the first operational coefficient and the scenario-configured bitrate control parameters can be processed to obtain the first operational bitrate control parameter; the second operational coefficient and the network-adapted bitrate control parameter can be processed to obtain the second operational bitrate control parameter; the average value between the first operational bitrate control parameter and the second operational bitrate control parameter can be determined, and this average value can be used as the frame coding quality parameter corresponding to the first data frame to be encoded.
[0136] Understandably, when device metrics meet the parameter adjustment conditions—that is, when the terminal device's network condition or decoding capability is poor—the frame encoding quality parameters (such as reducing the bitrate) can be appropriately reduced to match the terminal device's network condition or decoding capability. Different bitrate control parameters (referred to as network adaptation bitrate control parameters) can be pre-configured for different network conditions (such as network quality ranges) or different decoding capabilities. When the device metrics meet the parameter adjustment conditions, the network condition (or decoding capability) at the terminal device can be obtained. Based on the terminal device's network condition, its corresponding network adaptation bitrate control parameters can be obtained. Subsequently, the average value between the scenario-configured bitrate control parameters (i.e., the bitrate control parameters configured for different service scenario types) and the network adaptation bitrate control parameters can be determined. This average value can be used as the frame encoding quality parameter for the data frame to be encoded.
[0137] In one feasible embodiment, computational coefficients (which can be understood as weights) can be configured for the network status (or decoding capability) of the scene and the terminal device. After determining the scene configuration bitrate control parameters and the network adaptation bitrate control parameters, when performing the operation, the scene configuration bitrate control parameters and their corresponding first computational coefficients can be processed (e.g., multiplied) to obtain the first computational bitrate control parameters (product result). At the same time, the network adaptation bitrate control parameters and the second computational coefficients can be processed (e.g., multiplied) to obtain the second computational bitrate control parameters. Then, the average value between the first and second computational bitrate control parameters is determined as the frame coding quality parameter of the data frame to be encoded.
[0138] Optionally, in a feasible embodiment, the specific implementation of determining the frame coding quality parameter corresponding to the first data frame to be encoded based on the scenario-configured bitrate control parameter and the network-adapted bitrate control parameter can be as follows: the scenario-configured bitrate control parameter and the network-adapted bitrate control parameter can be compared to determine the minimum bitrate control parameter between the scenario-configured bitrate control parameter and the network-adapted bitrate control parameter; the minimum bitrate control parameter can be determined as the frame coding quality parameter corresponding to the first data frame to be encoded.
[0139] It should be understood that when the terminal device has poor network conditions or poor decoding capabilities, the minimum bitrate control parameter between the scenario configuration bitrate control parameter and the network adaptation bitrate control parameter can be used as the frame encoding quality parameter of the data frame to be encoded. This ensures that the terminal device can decode successfully.
[0140] Optionally, in a feasible embodiment, the specific implementation of determining the frame coding quality parameter corresponding to the first data frame to be encoded based on the scenario configuration bitrate control parameter and the network adaptation bitrate control parameter can be as follows: after obtaining the network adaptation bitrate control parameter, the network adaptation bitrate control parameter can be directly determined as the frame coding quality parameter of the data frame to be encoded (that is, the scenario configuration bitrate control parameter is replaced with the network adaptation bitrate control parameter).
[0141] In this application, computing power information can refer to the hardware or network resources required by computer equipment (such as business servers or terminal equipment) to perform computing tasks. It can typically include central processing unit (CPU) computing power information, graphics processing unit (GPU), memory resources, network bandwidth resources, disk resources, etc.
[0142] Optionally, and understandably, this application can also pre-configure different templates for the same service scenario type based on different network conditions. For example, for the same service scenario type, three network configuration scenarios can be subdivided. For a configuration network scenario with good network conditions (e.g., network quality parameters are greater than a certain first threshold), the frame encoding quality parameters (e.g., bitrate) in the template can be set to a larger value. For a configuration network scenario with medium network conditions (e.g., network quality parameters are between the second and first thresholds, with the second threshold being less than the first threshold), the frame encoding quality parameters (e.g., bitrate) in the template can be set to a slightly smaller value if the network conditions are relatively good. For a configuration network scenario with poor network conditions, the frame encoding quality parameters in the template can be set to a smaller value. Therefore, after determining the target service scenario type of the media data to be encoded, the network condition of the terminal device can be obtained first, and the corresponding target encoding configuration template can be determined based on the target service scenario type and the network condition.
[0143] In this embodiment, different encoding configuration templates can be configured for different business scenario types to generate a configuration template set. This configuration template set can include each business scenario type and its corresponding (mapped) encoding configuration template. When the media data to be encoded is obtained, the target encoding configuration template corresponding to the target business scenario type can be quickly obtained from the configuration template set according to the target business scenario type. Subsequently, the target encoding configuration template can be appropriately adjusted according to the real-time network status (or terminal decoding capability) to finally determine the frame encoding parameters of the media data to be encoded. Then, the media data to be encoded is encoded according to the frame encoding parameters to obtain target media data with target media quality that matches the target business scenario type. In other words, by pre-configuring different encoding configuration templates for different business scenario types, the target encoding configuration template for the target business scenario type can be found through querying during the encoding process. The frame encoding parameters of the media data to be encoded can be quickly determined based on the target encoding configuration template and network status (or terminal decoding capability), effectively reducing the computational load and encoding time, and improving the encoding efficiency of the media data to be encoded. Simultaneously, the adaptive selection and adjustment of the encoding configuration template based on the business scenario type and network status (or terminal decoding capability) ensures that the determined target encoding configuration template matches the target business scenario type and network status. The target media quality of the encoded target media data matches the target business scenario type and network status; that is, the frame encoding parameters determined based on the target encoding configuration template meet the encoding requirements of the target business scenario type, demonstrating scenario adaptability, and also meeting network status requirements. The compression performance of the target media data obtained using these frame encoding parameters is also high. In summary, this application can improve encoding efficiency and enhance encoding compression performance.
[0144] Further, please see Figure 7 , Figure 7 This is a system flowchart provided in an embodiment of this application. For example... Figure 7 As shown, the process can include at least the following steps S71-S76:
[0145] Step S71: Input the encoding scene parameters.
[0146] Specifically, the encoding scenario parameters here refer to the business scenario type of the media data to be encoded, and the corresponding parameters. These encoding scenario parameters can be input after the media data encoder (such as a video encoder) is initialized.
[0147] Step S72: Select the layered template configuration according to the scenario.
[0148] Specifically, different encoding configuration templates can be configured for different business scenario types. Here, the encoding configuration template can refer to a hierarchical encoding configuration template. After inputting the encoding scenario parameters, the corresponding hierarchical encoding configuration template can be obtained based on the scenario parameters.
[0149] Step S73: Receive terminal network status.
[0150] Step S74: Adjust the layered template configuration in real time.
[0151] Specifically, the selected layered template configuration can be adjusted in real time based on the terminal network status. For example, the number of layers in the layered coding structure, the number of frames in each layer, and the frame coding quality parameters (such as quantization coefficients, code control parameters, etc.) corresponding to each layer can be adjusted in the template configuration.
[0152] Step S75: Perform encoding processing.
[0153] Specifically, the data frames to be encoded in the media data to be encoded can be encoded according to the adjusted layered template configuration.
[0154] Step S76: Output the encoding result.
[0155] For the specific implementation methods of steps S71-S76, please refer to the above. Figure 3 The descriptions of steps S101-S103 in the corresponding embodiments will not be repeated here. The beneficial effects they bring will also not be repeated here.
[0156] Further, please see Figure 8 , Figure 8 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application. The data processing apparatus can be a computer program (including program code) running on a computer device; for example, the data processing apparatus is an application software. The data processing apparatus can be used to execute... Figure 3 The method shown. (As illustrated) Figure 8 As shown, the data processing device 1 may include: a data acquisition module 11, a template acquisition module 12, a parameter determination module 13, and a data encoding module 14.
[0157] The data acquisition module 11 is used to acquire the media data to be encoded, as well as the target business scenario type to which the media data to be encoded belongs;
[0158] The template acquisition module 12 is used to obtain the target encoding configuration template corresponding to the target business scenario type based on the mapping relationship between at least two encoding configuration templates and at least two configuration business scenario types in the configuration template set; there is a mapping relationship between an encoding configuration template and a configuration business scenario type; at least two encoding configuration templates include the target encoding configuration template;
[0159] Parameter determination module 13 is used to determine the frame encoding parameters of the media data to be encoded based on the target encoding configuration template;
[0160] The data encoding module 14 is used to encode the media data to be encoded according to the frame encoding parameters to obtain target media data with target media quality; the target media quality matches the target business scenario type.
[0161] The specific implementation methods of the data acquisition module 11, template acquisition module 12, parameter determination module 13, and data encoding module 14 can be found in the above description. Figure 3 The descriptions of steps S101-S103 in the corresponding embodiments will not be repeated here.
[0162] In one embodiment, the template acquisition module 12 may include a type traversal unit 121 and a template determination unit 122.
[0163] Type traversal unit 121 is used to traverse at least two configuration business scenario types in the configuration template set;
[0164] The template determination unit 122 is used to determine the coding configuration template that has a mapping relationship with the target configuration business scenario type among the at least two coding configuration templates if there is a target configuration business scenario type that is the same as the target business scenario type.
[0165] The template determination unit 122 is further configured to determine the scenario similarity between at least two configuration business scenario types and the target business scenario type if there is no target configuration business scenario type that is the same as the target business scenario type among at least two configuration business scenario types.
[0166] The template determination unit 122 is also used to determine the target encoding configuration template corresponding to the target business scenario type based on the similarity of at least two scenarios.
[0167] The specific implementation methods of the type traversal unit 121 and the template determination unit 122 can be found in the above description. Figure 3 The description of step S102 in the corresponding embodiment will not be repeated here.
[0168] In one embodiment, the template determination unit 122 may include a matching subunit 1221 and a template determination subunit 1222.
[0169] Matching subunit 1221 is used to obtain the maximum scene similarity among at least two scene similarities and match the maximum scene similarity with a scene similarity threshold;
[0170] Template determination subunit 1222 is used to determine the configuration business scenario type corresponding to the maximum scenario similarity among at least two configuration business scenario types as the matching business scenario type if the maximum scenario similarity is greater than the scenario similarity threshold, and to determine the encoding configuration template that has a mapping relationship with the matching business scenario type among at least two encoding configuration templates as the target encoding configuration template corresponding to the target business scenario type.
[0171] The specific implementation methods of the matching subunit 1221 and the template determining subunit 1222 can be found in the above description. Figure 3 The description of step S102 in the corresponding embodiment will not be repeated here.
[0172] In one embodiment, frame coding parameters include frame coding structure and frame coding quality parameters;
[0173] The parameter determination module 13 may include: a template distribution acquisition unit 131, an encoding structure determination unit 132, and a quality parameter determination unit 133.
[0174] Template distribution acquisition unit 131 is used to acquire the frame type distribution and frame level distribution in the target encoding configuration template;
[0175] The coding structure determination unit 132 is used to determine the frame coding structure corresponding to the media data to be encoded based on the frame type distribution and frame level distribution.
[0176] The quality parameter determination unit 133 is used to obtain the configuration coding quality parameters in the target coding configuration template, configure the quality parameters of the media data to be encoded according to the configuration coding quality parameters, and obtain the frame coding quality parameters corresponding to the media data to be encoded.
[0177] The specific implementation methods of the template distribution acquisition unit 131, the coding structure determination unit 132, and the quality parameter determination unit 133 can be found in the above description. Figure 3 The description of step S103 in the corresponding embodiment will not be repeated here.
[0178] In one embodiment, the coding structure determination unit 132 may include: a unit frame group acquisition subunit 1321, a type distribution determination subunit 1322, and a coding structure determination subunit 1323.
[0179] Unit frame group acquisition subunit 1321 is used to acquire the unit data frame group corresponding to the media data to be encoded; the unit data frame group consists of N consecutive data frames to be encoded, and the media data to be encoded includes the data frames to be encoded; N is a positive integer;
[0180] The type distribution determination subunit 1322 is used to obtain the frame group frame type distribution corresponding to the unit data frame group in the frame type distribution, and to divide the data frames to be encoded in the unit data frame group into types according to the frame group frame type distribution to obtain type-divided data frames.
[0181] The coding structure determination subunit 1323 is used to obtain the frame group frame hierarchy distribution corresponding to the unit data frame group in the frame hierarchy distribution, and to perform hierarchical division of the type-classified data frames according to the frame hierarchy distribution to obtain the hierarchical coding structure corresponding to the unit data frame group.
[0182] The coding structure determination subunit 1323 is also used to determine the layered coding structure as the frame coding structure corresponding to the media data to be encoded.
[0183] The specific implementation methods of the unit frame group acquisition subunit 1321, the type distribution determination subunit 1322, and the coding structure determination subunit 1323 can be found in the above description. Figure 3 The description of step S103 in the corresponding embodiment will not be repeated here.
[0184] In one embodiment, the frame coding structure is a layered coding structure, which includes a first level and a second level, with the second level being higher than the first level; the configuration coding quality parameters include a first configuration coding quality parameter corresponding to the first level and a second configuration coding quality parameter corresponding to the second level.
[0185] The quality parameter determination unit 133 may include: an encoded frame acquisition subunit 1331, a device information acquisition subunit 1332, and a first quality parameter determination subunit 1333.
[0186] The encoding frame acquisition subunit 1331 is used to acquire, from the media data to be encoded, a first data frame to be encoded at the first level of the layered coding structure and a second data frame to be encoded at the second level of the layered coding structure.
[0187] The device information acquisition subunit 1332 is used to acquire the device indicator information of the target terminal; the target terminal refers to the terminal waiting to play the media data to be encoded.
[0188] The first quality parameter determination subunit 1333 is used to determine the frame coding quality parameter corresponding to the first data frame to be encoded based on the equipment indicator information and the first configured coding quality parameter if the equipment indicator information meets the parameter adjustment conditions, and to determine the frame coding quality parameter corresponding to the second data frame to be encoded based on the equipment indicator information and the second configured coding quality parameter.
[0189] The specific implementation methods of the encoded frame acquisition subunit 1331, the device information acquisition subunit 1332, and the first quality parameter determination subunit 1333 can be found in the above description. Figure 3 The description of step S103 in the corresponding embodiment will not be repeated here.
[0190] In one embodiment, the device performance information includes network quality parameters and decoding computing power information;
[0191] The quality parameter determination unit 133 may also include: equipment information matching subunit 1334 and condition determination subunit 1335.
[0192] The device information matching subunit 1334 is used to match network quality parameters with network parameter thresholds and to match decoding computing power information with computing power thresholds.
[0193] The condition determination subunit 1335 is used to determine that the device index information does not meet the parameter adjustment conditions if the network quality parameters are greater than the network parameter threshold and the decoding computing power information is greater than the computing power threshold.
[0194] The condition determination subunit 1335 is also used to determine whether the equipment index information meets the parameter adjustment conditions if the network quality parameters are less than the network parameter threshold or the decoding computing power information is less than the computing power threshold.
[0195] The specific implementation methods of the device information matching subunit 1334 and the condition determination subunit 1335 can be found in the above description. Figure 3 The description of step S103 in the corresponding embodiment will not be repeated here.
[0196] In one embodiment, the mass parameter determination unit 133 may further include a second mass parameter determination subunit 1336.
[0197] The second quality parameter determination subunit 1336 is used to determine the first configured coding quality parameter as the frame coding quality parameter corresponding to the first data frame to be encoded and the second configured coding quality parameter as the frame coding quality parameter corresponding to the second data frame to be encoded if the equipment indicator information does not meet the parameter adjustment conditions.
[0198] The specific implementation of the second mass parameter determination subunit 1336 can be found in the above description. Figure 3The description of step S103 in the corresponding embodiment will not be repeated here.
[0199] In one embodiment, the first configuration coding quality parameter includes a scenario configuration bitrate control parameter; the device indicator information includes network quality parameters.
[0200] The first quality parameter determination subunit 1333 is also specifically used to obtain a parameter mapping table; the parameter mapping table contains the mapping relationship between the set of network quality intervals and the set of adaptive bit rate control parameters, and there is a mapping relationship between a network quality interval and an adaptive bit rate control parameter;
[0201] The first quality parameter determination subunit 1333 is also specifically used to obtain the network quality parameters corresponding to the target terminal, obtain the target network quality interval to which the network quality parameters belong in the network quality interval set, and obtain the network adaptation bit rate control parameters that have a mapping relationship with the target network interval.
[0202] The first quality parameter determination subunit 1333 is also specifically used to determine the frame coding quality parameters corresponding to the first data frame to be encoded based on the scenario configuration bitrate control parameters and network adaptation bitrate control parameters.
[0203] In one embodiment, the first quality parameter determining subunit 1333 is further specifically used to obtain the first operation coefficient corresponding to the target service scenario type and the second operation coefficient corresponding to the network quality parameter.
[0204] The first quality parameter determination subunit 1333 is also specifically used to perform calculations on the first operation coefficient and the scene configuration bitrate control parameter to obtain the first operation bitrate control parameter.
[0205] The first quality parameter determination subunit 1333 is also specifically used to perform calculations on the second operation coefficient and the network adaptation bitrate control parameter to obtain the second operation bitrate control parameter.
[0206] The first quality parameter determination subunit 1333 is also specifically used to determine the average value between the first operational bit rate control parameter and the second operational bit rate control parameter, and to determine the average value as the frame coding quality parameter corresponding to the first data frame to be encoded.
[0207] In one embodiment, the first quality parameter determining subunit 1333 is further specifically used to compare the scene configuration bitrate control parameter with the network adaptation bitrate control parameter to determine the minimum bitrate control parameter between the scene configuration bitrate control parameter and the network adaptation bitrate control parameter.
[0208] The first quality parameter determination subunit 1333 is also specifically used to determine the minimum bit rate control parameter as the frame coding quality parameter corresponding to the first data frame to be encoded.
[0209] In this embodiment, different encoding configuration templates can be configured for different business scenario types to generate a configuration template set. This configuration template set can include each business scenario type and its corresponding (mapped) encoding configuration template. When the media data to be encoded is obtained, the target encoding configuration template corresponding to the target business scenario type can be quickly obtained from the configuration template set according to the target business scenario type. Subsequently, the target encoding configuration template can be appropriately adjusted according to the real-time network status (or terminal decoding capability) to finally determine the frame encoding parameters of the media data to be encoded. Then, the media data to be encoded is encoded according to the frame encoding parameters to obtain target media data with target media quality that matches the target business scenario type. In other words, by pre-configuring different encoding configuration templates for different business scenario types, the target encoding configuration template for the target business scenario type can be found through querying during the encoding process. The frame encoding parameters of the media data to be encoded can be quickly determined based on the target encoding configuration template and network status (or terminal decoding capability), effectively reducing the computational load and encoding time, and improving the encoding efficiency of the media data to be encoded. Simultaneously, the adaptive selection and adjustment of the encoding configuration template based on the business scenario type and network status (or terminal decoding capability) ensures that the determined target encoding configuration template matches the target business scenario type and network status. The target media quality of the encoded target media data matches the target business scenario type and network status; that is, the frame encoding parameters determined based on the target encoding configuration template meet the encoding requirements of the target business scenario type, demonstrating scenario adaptability, and also meeting network status requirements. The compression performance of the target media data obtained using these frame encoding parameters is also high. In summary, this application can improve encoding efficiency and enhance encoding compression performance.
[0210] Further, please see Figure 9 , Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 9 As shown above, Figure 7The device 1 in the corresponding embodiment can be applied to the aforementioned computer device 8000. The computer device 8000 may include a processor 8001, a network interface 8004, and a memory 8005. Furthermore, the computer device 8000 also includes a user interface 8003 and at least one communication bus 8002. The communication bus 8002 is used to enable communication between these components. The user interface 8003 may include a display screen and a keyboard; optionally, the user interface 8003 may also include a standard wired interface or a wireless interface. The network interface 8004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 8005 may be high-speed RAM or non-volatile memory, such as at least one disk storage device. Optionally, the memory 8005 may also be at least one storage device located remotely from the aforementioned processor 8001. Figure 9 As shown, the memory 8005, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a device control application program.
[0211] exist Figure 9 In the computer device 8000 shown, the network interface 8004 provides network communication functionality; the user interface 8003 is mainly used to provide an input interface for the user; and the processor 8001 can be used to call the device control application program stored in the memory 8005 to achieve:
[0212] Obtain the media data to be encoded, and the target business scenario type to which the media data to be encoded belongs;
[0213] Based on the mapping relationship between at least two encoding configuration templates and at least two configuration business scenario types in the configuration template set, obtain the target encoding configuration template corresponding to the target business scenario type; there is a mapping relationship between one encoding configuration template and one configuration business scenario type; at least two encoding configuration templates include the target encoding configuration template;
[0214] The frame encoding parameters of the media data to be encoded are determined based on the target encoding configuration template. The media data to be encoded is then encoded according to the frame encoding parameters to obtain target media data with target media quality. The target media quality matches the target business scenario type.
[0215] It should be understood that the computer device 8000 described in the embodiments of this application can execute the foregoing text. Figures 3 to 7 The description of the data processing method in the corresponding embodiment can also be performed as described above. Figure 8The description of the data processing apparatus 1 in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated here.
[0216] Furthermore, it should be noted that this application embodiment also provides a computer-readable storage medium, which stores a computer program executed by the aforementioned data processing computer device 1000. The computer program includes program instructions, and when the processor executes the program instructions, it can execute the aforementioned... Figures 3 to 7 The description of the data processing method in the corresponding embodiments is already provided and will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer-readable storage medium embodiments related to this application, please refer to the description of the method embodiments of this application.
[0217] The aforementioned computer-readable storage medium can be an internal storage unit of the data processing apparatus or computer device provided in any of the foregoing embodiments, such as a hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Furthermore, the computer-readable storage medium can include both internal and external storage units of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0218] One aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method provided in one aspect of the embodiments of this application.
[0219] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.
[0220] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0221] The methods and related apparatuses provided in this application are described with reference to the method flowcharts and / or structural diagrams provided in this application. Specifically, each block of the method flowchart and / or structural diagram, as well as combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to create a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the process. Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 A process or multiple processes and / or structures illustrate the steps of the functions specified in one or more boxes.
[0222] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A data processing method, characterized in that, include: Obtain the media data to be encoded, and the target business scenario type to which the media data to be encoded belongs; The target business scenario type is determined based on the application type of the target application; Based on the mapping relationship between at least two encoding configuration templates and at least two configuration business scenario types in the configuration template set, obtain the target encoding configuration template corresponding to the target business scenario type; There is a mapping relationship between a coding configuration template and a configuration business scenario type; The at least two encoding configuration templates include the target encoding configuration template; The target coding configuration template includes: the frame type distribution, frame coding structure, and frame coding quality parameters of each frame within the unit frame group; The frame encoding parameters of the media data to be encoded are determined according to the target encoding configuration template, and the media data to be encoded is processed according to the frame encoding parameters to obtain target media data with target media quality; the target media quality matches the target business scenario type.
2. The method according to claim 1, characterized in that, The step of obtaining the target encoding configuration template corresponding to the target business scenario type based on the mapping relationship between at least two encoding configuration templates and at least two configuration business scenario types in the configuration template set includes: Iterate through the at least two configuration business scenario types in the configuration template set; If among the at least two configured business scenario types, there is a target configured business scenario type that is the same as the target business scenario type, then the encoding configuration template among the at least two encoding configuration templates that has a mapping relationship with the target configured business scenario type is determined as the target encoding configuration template corresponding to the target business scenario type; If none of the at least two configured business scenario types is the same as the target business scenario type, then the scenario similarity between the at least two configured business scenario types and the target business scenario type is determined, and the target encoding configuration template corresponding to the target business scenario type is determined based on the at least two scenario similarities.
3. The method according to claim 2, characterized in that, The step of determining the target encoding configuration template corresponding to the target business scenario type based on at least two scenario similarities includes: The maximum scene similarity is obtained from the at least two scene similarities, and the maximum scene similarity is matched with a scene similarity threshold. If the maximum scene similarity is greater than the scene similarity threshold, then the configuration business scene type corresponding to the maximum scene similarity among the at least two configuration business scene types is determined as the matching business scene type, and the encoding configuration template that has a mapping relationship with the matching business scene type among the at least two encoding configuration templates is determined as the target encoding configuration template corresponding to the target business scene type.
4. The method according to claim 1, characterized in that, The frame coding parameters include frame coding structure and frame coding quality parameters; Determining the frame encoding parameters of the media data to be encoded according to the target encoding configuration template includes: Obtain the frame type distribution and frame hierarchy distribution in the target encoding configuration template; Based on the frame type distribution and the frame hierarchy distribution, determine the frame coding structure corresponding to the media data to be encoded; Obtain the configuration encoding quality parameters in the target encoding configuration template, configure the quality parameters of the media data to be encoded according to the configuration encoding quality parameters, and obtain the frame encoding quality parameters corresponding to the media data to be encoded.
5. The method according to claim 4, characterized in that, The step of determining the frame coding structure corresponding to the media data to be encoded based on the frame type distribution and the frame hierarchy distribution includes: Obtain the unit data frame group corresponding to the media data to be encoded; the unit data frame group consists of N consecutive data frames to be encoded, and the media data to be encoded includes the data frames to be encoded; N is a positive integer; Obtain the frame group frame type distribution corresponding to the unit data frame group in the frame type distribution, and perform type division on the data frame to be encoded in the unit data frame group according to the frame group frame type distribution to obtain type-divided data frames; Obtain the frame group frame hierarchy distribution corresponding to the unit data frame group in the frame hierarchy distribution, and perform hierarchical division of the type data frames according to the frame hierarchy distribution to obtain the hierarchical coding structure corresponding to the unit data frame group; The layered coding structure is determined as the frame coding structure corresponding to the media data to be encoded.
6. The method according to claim 4, characterized in that, The frame coding structure is a layered coding structure, which includes a first level and a second level, with the second level being higher than the first level; the configured coding quality parameters include a first configured coding quality parameter corresponding to the first level and a second configured coding quality parameter corresponding to the second level. The step of configuring the quality parameters of the media data to be encoded according to the configured encoding quality parameters to obtain the frame encoding quality parameters corresponding to the media data to be encoded includes: Obtain from the media data to be encoded a first data frame to be encoded at the first level of the layered coding structure, and a second data frame to be encoded at the second level of the layered coding structure; Obtain the device specification information of the target terminal; the target terminal refers to the terminal waiting to play the media data to be encoded. If the device indicator information meets the parameter adjustment conditions, then based on the device indicator information and the first configured coding quality parameter, the frame coding quality parameter corresponding to the first data frame to be encoded is determined, and based on the device indicator information and the second configured coding quality parameter, the frame coding quality parameter corresponding to the second data frame to be encoded is determined.
7. The method according to claim 6, characterized in that, The equipment specifications include network quality parameters and decoding computing power information; The method further includes: The network quality parameters are matched with network parameter thresholds, and the decoding computing power information is matched with computing power thresholds. If the network quality parameter is greater than the network parameter threshold, and the decoding computing power information is greater than the computing power threshold, then it is determined that the device indicator information does not meet the parameter adjustment conditions. If the network quality parameter is less than the network parameter threshold, or the decoding computing power information is less than the computing power threshold, then it is determined that the device indicator information meets the parameter adjustment conditions.
8. The method according to claim 6, characterized in that, The method further includes: If the device indicator information does not meet the parameter adjustment conditions, then the first configured encoding quality parameter is determined as the frame encoding quality parameter corresponding to the first data frame to be encoded, and the second configured encoding quality parameter is determined as the frame encoding quality parameter corresponding to the second data frame to be encoded.
9. The method according to claim 6, characterized in that, The first configuration encoding quality parameters include scene configuration bitrate control parameters; the device indicator information includes network quality parameters. The step of determining the frame coding quality parameters corresponding to the first data frame to be encoded based on the device indicator information and the first configured coding quality parameters includes: Obtain the parameter mapping table; the parameter mapping table contains the mapping relationship between the set of network quality intervals and the set of adaptive bitrate control parameters, and there is a mapping relationship between a network quality interval and an adaptive bitrate control parameter; Obtain the network quality parameters corresponding to the target terminal, obtain the target network quality interval to which the network quality parameters belong from the network quality interval set, and obtain the network adaptation bit rate control parameters that have a mapping relationship with the target network interval; Based on the scenario configuration bitrate control parameters and the network adaptation bitrate control parameters, the frame encoding quality parameters corresponding to the first data frame to be encoded are determined.
10. The method according to claim 9, characterized in that, The step of determining the frame encoding quality parameters corresponding to the first data frame to be encoded based on the configured bitrate control parameters for the scenario and the network-adapted bitrate control parameters includes: Obtain the first operational coefficient corresponding to the target service scenario type, and the second operational coefficient corresponding to the network quality parameter; The first operation coefficient is processed with the scene configuration bitrate control parameter to obtain the first operation bitrate control parameter; The second operation coefficient is processed in conjunction with the network adaptation bitrate control parameter to obtain the second operation bitrate control parameter; The average value between the first operational bitrate control parameter and the second operational bitrate control parameter is determined, and the average value is determined as the frame coding quality parameter corresponding to the first data frame to be encoded.
11. The method according to claim 9, characterized in that, The step of determining the frame encoding quality parameters corresponding to the first data frame to be encoded based on the configured bitrate control parameters for the scenario and the network-adapted bitrate control parameters includes: The scene configuration bitrate control parameter is compared with the network adaptation bitrate control parameter to determine the minimum bitrate control parameter between the scene configuration bitrate control parameter and the network adaptation bitrate control parameter; The minimum bit rate control parameter is determined as the frame coding quality parameter corresponding to the first data frame to be encoded.
12. A data processing apparatus, characterized in that, include: The data acquisition module is used to acquire the media data to be encoded, as well as the target business scenario type to which the media data to be encoded belongs; The target business scenario type is determined based on the application type of the target application; The template acquisition module is used to obtain the target encoding configuration template corresponding to the target business scenario type based on the mapping relationship between at least two encoding configuration templates and at least two configuration business scenario types in the configuration template set; There is a mapping relationship between a coding configuration template and a configuration business scenario type; The at least two encoding configuration templates include the target encoding configuration template; The target coding configuration template includes: the frame type distribution, frame coding structure, and frame coding quality parameters of each frame within the unit frame group; The parameter determination module is used to determine the frame encoding parameters of the media data to be encoded based on the target encoding configuration template. The data encoding module is used to encode the media data to be encoded according to the frame encoding parameters to obtain target media data with target media quality; the target media quality matches the target business scenario type.
13. A computer device, characterized in that, include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide network communication functions, the memory is used to store program code, and the processor is used to call the program code to cause the computer device to execute the method according to any one of claims 1-11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and to execute the method according to any one of claims 1-11.
15. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium, the computer instructions being adapted to be read and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1-11.