Multimedia coding method, device, equipment, medium and product

By recording and utilizing the transformation mode information of residual blocks in multimedia encoding, the encoding mode is directly determined, which solves the problem of high complexity in the transformation mode selection in the prior art, and improves coding efficiency and resource utilization.

CN118900333APending Publication Date: 2024-11-05TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310503280.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-04
Publication Date
2024-11-05

AI Technical Summary

Technical Problem

Existing multimedia encoders have high computational complexity when selecting transformation modes, resulting in increased encoding time and resource consumption and poor efficiency.

Method used

During the multi-media encoding process, the transformation mode information of the residual block is recorded in the first encoding stage, and the transformation mode is determined in the non-first encoding stage based on the recorded information and the attributes of the currently coded residual block, and the encoding process is performed directly to avoid the Two modes are encoded simultaneously.

Benefits of technology

It effectively reduces the computational complexity of transform mode information selection, reduces the code stream encoding time and overhead of computing resources, and basically does not damage the encoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118900333A_ABST
    Figure CN118900333A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a multimedia coding method and device, equipment, a medium and a product, and the method comprises the steps: recording the transformation mode information of a residual block in a first coding stage in a multi-time coding process of multimedia; in a non-first-time coding stage, obtaining transformation mode information of each residual block recorded in the first-time coding stage; determining the transformation mode information of the current to-be-coded residual block according to the transformation mode information recorded in the first coding stage and the attribute information of the current to-be-coded residual block; and coding the current to-be-coded residual block according to the transformation mode information of the current to-be-coded residual block. According to the technical scheme provided by the embodiment of the invention, the calculation complexity of conversion mode information selection in multiple times of coding can be effectively reduced, so that the code stream coding time and the overhead of calculation resources are reduced, and meanwhile, the coding efficiency is basically not damaged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of multimedia coding technology, and in particular to a multimedia coding method, a multimedia coding device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] Currently, there are many encoders that use standardized video coding technology. The most common encoders must go through the main steps of prediction, transformation, quantization, entropy coding, etc. to obtain the compressed binary code stream. In some scenarios, for transform units that meet certain size restrictions, the transformation step is optional.

[0003] In the related art, the encoder determines whether to skip the transform by simultaneously encoding the normal transform mode and the transform skip mode, and then selecting the most appropriate mode. However, encoding both situations at the same time increases the computational complexity of the encoder, resulting in more computing resources and longer encoding time required for encoding. Summary of the invention

[0004] To solve the above technical problems, the embodiments of the present application provide a multimedia encoding method, a multimedia encoding device, an electronic device, a computer-readable storage medium and a computer program product, which can effectively reduce the computational complexity of selecting transformation mode information in multiple encodings, thereby reducing the bitstream encoding time and computing resource overhead, while basically not damaging the encoding efficiency.

[0005] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0006] According to one aspect of an embodiment of the present application, a multimedia encoding method is provided, comprising: in a first encoding stage in a multimedia multiple encoding process, recording transformation mode information of a residual block; in a non-first encoding stage, obtaining the transformation mode information of each residual block recorded in the first encoding stage; determining the transformation mode information of the current residual block to be encoded based on the transformation mode information recorded in the first encoding stage and attribute information of the current residual block to be encoded; and encoding the current residual block to be encoded based on the transformation mode information of the current residual block to be encoded.

[0007] According to one aspect of an embodiment of the present application, a multimedia encoding device is provided, including: a recording module, used to record the transformation mode information of the residual block in the first encoding stage of multiple multimedia encoding processes; an acquisition module, used to acquire the transformation mode information of each residual block recorded in the first encoding stage in a non-first encoding stage; a determination module, used to determine the transformation mode information of the residual block to be encoded currently based on the transformation mode information recorded in the first encoding stage and the attribute information of the residual block to be encoded currently; and an encoding module, used to encode the residual block to be encoded currently based on the transformation mode information of the residual block to be encoded currently.

[0008] In one embodiment of the present application, the recording module is further used to determine the size of each residual block and the transformation mode information of each residual block in the first encoding stage; according to the size of each residual block, the transformation mode information of each residual block is saved in the corresponding flag bit; the acquisition module is further used to obtain the transformation mode information of each residual block recorded in the first encoding stage from the flag bit.

[0009] In one embodiment of the present application, the recording module is further used to obtain the minimum size of the residual block; calculate the number of minimum sizes covered by the residual block based on the size of the residual block and the minimum size; determine the flag corresponding to the residual block based on the number of minimum sizes covered by the residual block, and save the transformation mode information of the residual block to the determined flag.

[0010] In one embodiment of the present application, the attribute information includes size and position; the determination module is further used to obtain the distribution of the flag bits of the current residual block to be encoded that did not use the transformation operation in the first encoding according to the transformation mode information recorded in the first encoding stage and the size and position of the current residual block to be encoded; determine the transformation mode information of the current residual block to be encoded based on the obtained distribution of the flag bits of the non-use transformation operation.

[0011] In one embodiment of the present application, the determination module further obtains the position of each flag bit of the unused transformation operation based on the transformation mode information recorded in the first encoding stage; determines the coverage area of ​​the current residual block to be encoded based on the size and position of the current residual block to be encoded; and selects the flag bit located in the coverage area from the various flag bits of the unused transformation operation to generate the distribution.

[0012] In one embodiment of the present application, the determination module is further used to calculate the proportion of the flag bit of the non-use transform operation in the current residual block to be encoded based on the obtained distribution of the flag bit of the non-use transform operation and the size of the current residual block to be encoded; and determine the transform mode information of the current residual block to be encoded based on the proportion.

[0013] In one embodiment of the present application, the determination module is further used to determine that the transformation mode information of the current residual block to be encoded is to skip the transformation operation if the proportion is greater than a first preset proportion threshold; if the proportion is less than or equal to a second preset proportion threshold, then determine that the transformation mode information of the current residual block to be encoded is to use the transformation operation, and the second preset proportion threshold is less than the first preset proportion threshold.

[0014] In one embodiment of the present application, the determination module is further used to obtain the target area of ​​the current residual block to be encoded if the proportion is less than the first preset proportion threshold and greater than the second preset proportion threshold; and determine the transformation mode information of the current residual block to be encoded based on the relationship between the position of the flag bit of the unused transformation operation and the target area.

[0015] In one embodiment of the present application, the determination module is further configured to determine that the transformation mode information of the current residual block to be encoded is to skip the transformation operation if the positions of the flag bits for not using the transformation operation are all within the target area.

[0016] In one embodiment of the present application, the determination module is further used to determine that the transform mode information of the current residual block to be encoded is to use the transform operation and skip the transform operation if there is at least one flag position for not using the transform operation and the position is outside the target area; and select the optimal encoding operation mode from using the transform operation and skipping the transform operation according to the coding rate distortion.

[0017] In one embodiment of the present application, the determination module is further used to calculate the target number of flag bits corresponding to the current residual block to be encoded based on the size of the current residual block to be encoded and the minimum size of the residual block; calculate the ratio of the number of flag bits that do not use the transformation operation to the target number to obtain the proportion.

[0018] In one embodiment of the present application, the encoding module is further used to perform a quantization operation on the current residual block to be encoded if the transform mode information of the current residual block to be encoded indicates skipping the transform operation; if the transform mode information of the current residual block to be encoded indicates using the transform operation, then perform a transform operation on the current residual block to be encoded.

[0019] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising one or more processors; a storage device for storing one or more computer programs, wherein when the one or more computer programs are executed by the one or more processors, the electronic device implements the multimedia encoding method as described above.

[0020] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor of an electronic device, the electronic device executes the multimedia encoding method as described above.

[0021] According to one aspect of an embodiment of the present application, a computer program product is provided, including a computer program, wherein the computer program is stored in a computer-readable storage medium, and a processor of an electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device performs the multimedia encoding method as described above.

[0022] In the technical solution provided in the embodiments of the present application, for multiple encodings of multimedia, in the first encoding stage of the multiple encoding process of multimedia, the transformation mode information of the residual block is recorded; in the non-first encoding stage, the transformation mode information of each residual block recorded in the first encoding stage is obtained; according to the transformation mode information recorded in the first encoding stage and the attribute information of the current residual block to be encoded, the transformation mode information of the current residual block to be encoded is determined; according to the transformation mode information of the current residual block to be encoded, the current residual block to be encoded is encoded; that is, the technical solution provided by the present application refers to the transformation mode information of each residual block in the first encoding, determines the corresponding transformation mode information for the current residual block to be encoded in the non-first encoding stage, and then performs corresponding encoding, without encoding two modes at the same time, effectively reducing the computational complexity of the selection of transformation mode information in multiple encodings, thereby reducing the bitstream encoding time and the overhead of computing resources, while basically not damaging the encoding efficiency.

[0023] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0025] Figure 1 It is a schematic diagram of an implementation environment involved in this application;

[0026] Figure 2 is a flowchart of a multimedia encoding method shown in an exemplary embodiment of the present application;

[0027] Figure 3 A schematic diagram of storing transformation mode information of a residual block is shown as an exemplary embodiment of the present application;

[0028] Figure 4 is a flowchart of another multimedia encoding method shown in an exemplary embodiment of the present application;

[0029] Figure 5 is a flowchart of another multimedia encoding method shown in an exemplary embodiment of the present application;

[0030] Figure 6 is a schematic diagram of marking a flag bit corresponding to a transformation mode information shown in an exemplary embodiment of the present application;

[0031] Figure 7 is a flowchart of another multimedia encoding method shown in an exemplary embodiment of the present application;

[0032] Figure 8 is a flowchart of another multimedia encoding method shown in an exemplary embodiment of the present application;

[0033] Fig. 9 is a flowchart of a multimedia encoding method shown in another exemplary embodiment of the present application;

[0034] Fig.10 is a flowchart of another multimedia encoding method shown in another exemplary embodiment of the present application;

[0035] Fig.11 is a flowchart of another multimedia encoding method shown in an exemplary embodiment of the present application;

[0036] Fig. 12A is a schematic diagram of a target area of ​​a residual block shown in an exemplary embodiment of the present application;

[0037] Fig. 12B is a schematic diagram of another target area of ​​a residual block shown in an exemplary embodiment of the present application;

[0038] Fig.13 is a flowchart of another multimedia encoding method shown in an exemplary embodiment of the present application;

[0039] Fig.14 is a flowchart of a multimedia encoding method shown in another exemplary embodiment of the present application;

[0040] Fig.15is a flowchart of another multimedia encoding method shown in another exemplary embodiment of the present application;

[0041] Fig.16 is a schematic diagram of a marking position corresponding to the first encoding of the current residual to be encoded, shown in another exemplary embodiment of the present application;

[0042] Fig.17 is a flowchart of a multimedia encoding method shown in another exemplary embodiment of the present application;

[0043] Fig.18 is a structural block diagram of a multimedia encoding device shown in another exemplary embodiment of the present application;

[0044] Fig.19 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0045] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0046] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0047] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0048] It should also be noted that the "multiple" mentioned in this application refers to two or more than two. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship.

[0049] The technical solution of the embodiment of the present application relates to the field of cloud technology. Before introducing the technical solution of the embodiment of the present application, a brief introduction to cloud technology is first given.

[0050] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.

[0051] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, allowing various application systems to obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". From the user's perspective, the resources in the "cloud" are infinitely scalable and can be obtained at any time, used on demand, expanded at any time, and paid for by use.

[0052] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.

[0053] The following is a detailed description of the technical solution of the embodiment of the present application in combination with cloud technology and implementation environment:

[0054] See also Figure 1 , Figure 1 1 is a schematic diagram of an implementation environment involved in the present application, including a content producer 10 and a server 20. In one example, the server 20 may be a computing device in the above-mentioned cloud computing resource pool, which has a large amount of computing and storage resources, and an encoder is provided in the server; wherein the content producer 10 may be a video website, a picture website, etc.

[0055] The content producer 10 is used to generate multimedia and send a request to the server 20, the request carrying the multimedia. In one example, the content producer 10 also needs to pay to request the server 20 to encode the multimedia multiple times using its own resources.

[0056] The server 20 is used to perform multiple encodings on the multimedia, wherein during the first encoding, main steps such as prediction, transformation, quantization, and entropy coding are performed, and then the transformation mode information of the predicted residual block is recorded. Specifically, in the first encoding stage of the multimedia multiple encoding process, the transformation mode information of the residual block is recorded, and in the non-first encoding stage, the transformation mode information of each residual block recorded in the first encoding stage is obtained; according to the transformation mode information recorded in the first encoding stage and the attribute information of the current residual block to be encoded, the transformation mode information of the current residual block to be encoded is determined; and the current residual block to be encoded is encoded according to the transformation mode information of the current residual block to be encoded.

[0057] In other embodiments, the multimedia encoding method can also be independently executed by the content producer 10. For example, the content producer is provided with an encoder. After generating multimedia through the media generator, the encoder performs multiple encodings. In the first encoding stage of the multimedia multiple encoding process, the encoder of the content producer records the transformation mode information of the residual block, and in the non-first encoding stage, obtains the transformation mode information of each residual block recorded in the first encoding stage, and then determines the transformation mode information of the current residual block to be encoded in combination with the attribute information of the current residual block to be encoded, and then encodes the current residual block to be encoded.

[0058] In other embodiments, the server 20 may also select multimedia by itself, for example, grab multimedia from the network, and then encode the multimedia multiple times.

[0059] In one example, the aforementioned content producer 10 can be any electronic device that can obtain the target video and the image to be processed, such as a smart phone, a tablet, a laptop computer, a computer, an intelligent voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, etc. The server 20 can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network) and big data and artificial intelligence platforms. No restrictions are imposed here.

[0060] like Figure 1 As shown, the content producer 10 and the server 20 establish a communication connection in advance through the network 30, so that the content producer 10 and the server 20 can communicate with each other through the network 30. The network 30 can be a wired network or a wireless network, which is not limited here.

[0061] It should be noted that in the specific implementation of this application, if the multimedia involves object-related, when the embodiment of this application is applied to a specific product or technology, it is necessary to obtain the object's permission or consent, and the collection, use and processing of relevant data need to comply with the relevant regulations and standards of the relevant countries and regions.

[0062] The following is a detailed description of various implementation details of the technical solution of the embodiment of the present application:

[0063] like Figure 2 As shown, Figure 2 is a flowchart of a multimedia encoding method shown in an embodiment of the present application, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by the content producer or the server, or can be executed by the content producer and the server together. In the embodiment of the present application, the method is executed by the server as an example for explanation. The multimedia encoding method can include steps S210 to S240, which are described in detail as follows:

[0064] S210 . In the first encoding stage of the multimedia multiple encoding process, record the transformation mode information of the residual block.

[0065] In the embodiment of the present application, multimedia will be encoded multiple times, that is, at least twice, wherein the multimedia includes but is not limited to any one of graphics, animation, and video, which are not limited here.

[0066] In the first encoding stage of the multiple encoding process of multimedia, prediction, transformation, quantization, entropy coding and other operations are performed. The prediction operation is used to reduce the amount of encoded information to obtain a residual block; the transformation operation is used to concentrate the energy of the residual signal in the frequency domain to improve the compression efficiency of subsequent entropy coding; the quantization operation is used to eliminate lossy information; and the entropy coding is used to compress the quantity.

[0067] In an embodiment of the present application, during the first encoding process, the server performs a transform operation on each residual block and records the transform mode information of each residual block, and the transform mode information is used to indicate whether the residual block uses a transform operation; wherein the server can obtain the transform mode information from the transform coefficient of each residual block. Specifically, the transform coefficient is a numerical value calculated during the transform process, which represents the expression of the residual block in the transform domain; different transform modes will produce different transform coefficients, so the transform mode information can be obtained by analyzing the transform coefficient. It can be understood that during the first encoding process, after the residual block is obtained by the prediction operation, some residual blocks may not be transformed when the transform operation is performed. For example, in JPEG compression, the commonly used transform operations are discrete cosine transform (DCT) and discrete wavelet transform (DWT). For DCT transform, the server can determine whether DCT transform is used by analyzing the distribution of transform coefficients. For DWT transform, since its transform coefficients are sparse, the server can determine whether DWT transform is used by detecting zero values ​​in the transform coefficients, and then the server can record which residual blocks use the transform and which residual blocks skip the transform.

[0068] S220. In a non-initial encoding stage, obtain transformation mode information of each residual block recorded in the initial encoding stage.

[0069] In the embodiment of the present application, the non-first encoding may be any encoding after the first encoding, and the server will obtain the transformation mode information of each residual block recorded in the first encoding stage.

[0070] In one example, after the server obtains the transform mode information of each residual block recorded in the first encoding stage, it integrates the obtained transform mode information of the residual blocks, for example, sorts and arranges the transform mode information of each residual block based on the position of each residual block, and obtains the transform mode information of the entire residual block of the multimedia for subsequent analysis. Figure 3 As shown, the prediction operation obtains residual blocks 1 to 4, which are located in the upper left corner, upper right corner, lower left corner and lower right corner respectively, and the respective transform mode information is correspondingly set in the upper left corner area 301, the upper right corner area 302, the lower left corner area 303 and the lower right corner area 304.

[0071] S230 . Determine the transform mode information of the current residual block to be encoded according to the transform mode information recorded in the first encoding stage and the attribute information of the current residual block to be encoded.

[0072] In the non-first encoding stage, the current residual block to be encoded is obtained through a prediction operation, and the block division results may be different in the prediction operations of the first encoding and the non-first encoding, so the current residual block to be encoded may be different from the residual block in the first encoding, and then the attribute information of the current residual block to be encoded is also different from the attribute information of the residual block in the first encoding; wherein, the attribute information of the current residual block to be encoded refers to information describing the characteristics of the current residual block to be encoded, which is used to describe various attributes of the object, such as size, position, etc. It can be understood that when the current residual block to be encoded is obtained through the prediction operation, the server has already learned the attribute information of the current residual block to be encoded.

[0073] In an embodiment of the present application, the transformation mode information recorded in the first encoding stage will be used as an important basis for judging whether the current residual to be encoded needs to be transformed. The server will determine the transformation mode information of the current residual block to be encoded based on the transformation mode information recorded in the first encoding stage and the attribute information of the current residual to be encoded, that is, determine whether the current residual block to be encoded needs to be transformed.

[0074] S240 . Perform encoding processing on the current residual block to be encoded according to the transformation mode information of the current residual block to be encoded.

[0075] In an embodiment of the present application, after determining the transform mode information of the current residual block to be encoded, if the transform mode information of the current residual block to be encoded is to use a transform operation, a transform operation is performed on the current residual block to be encoded, such as using a discrete cosine transform (DCT). This will convert the residual block from the pixel domain to the frequency domain, and make most of the energy in the residual block concentrated on a small number of frequency domain coefficients, so that these coefficients can be compressed and transmitted more efficiently. If the transform mode information of the current residual block to be encoded is to skip the transform operation, a quantization operation is performed on the current residual block to be encoded, which will approximate and round the coefficients in the residual block, making it easier to compress.

[0076] In an embodiment of the present application, for multiple encodings of multimedia, in the first encoding stage of the multiple encoding process of multimedia, the transformation mode information of the residual block is recorded; in the non-first encoding stage, the transformation mode information of each residual block recorded in the first encoding stage is obtained; according to the transformation mode information recorded in the first encoding stage and the attribute information of the current residual block to be encoded, the transformation mode information of the current residual block to be encoded is determined; according to the transformation mode information of the current residual block to be encoded, the current residual block to be encoded is encoded; that is, the technical solution provided by the present application refers to the transformation mode information of each residual block in the first encoding, determines the corresponding transformation mode information for the current residual block to be encoded in the non-first encoding stage, does not need to encode two modes at the same time, effectively reduces the computational complexity of the selection of the transformation mode information in multiple encodings, thereby reducing the bitstream encoding time and the overhead of computing resources, and basically does not damage the encoding efficiency.

[0077] It should be noted that, in other embodiments of the present application, in a non-first encoding stage, the transform mode information of the residual block to be encoded currently can be determined based on the transform mode information recorded in the previous encoding stage and the transform mode information of the residual block to be encoded currently; for example, in the second encoding stage, the transform mode information of the residual block to be encoded currently in the second encoding is determined based on the transform mode information recorded in the first encoding stage and the attribute information of the residual block to be encoded currently in the second encoding, and in the second encoding stage, the transform mode information of each residual block corresponding to the second encoding is recorded; in the third encoding stage, the transform mode information of the residual block to be encoded currently in the second encoding is determined based on the transform mode information recorded in the second encoding stage and the transform mode information of the residual block to be encoded currently in the third encoding, and so on.

[0078] In one embodiment of the present application, another multimedia encoding method is provided, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by the content producer or the server, or can be executed by the content producer and the server together. In the embodiment of the present application, the method is executed by the server as an example. Figure 4 As shown, the multimedia encoding method is Figure 2 On the basis of, step S210 is expanded into S410-S420, and S220 is expanded into S430. Steps S410-S430 are described in detail as follows:

[0079] S410: In the first encoding stage of the multimedia multiple encoding process, determine the size of each residual block and the transformation mode information of each residual block.

[0080] As described above, in the process of performing the first encoding, after performing the prediction operation on the multimedia, the size of each residual block can be obtained, wherein the size of each residual block can be different, for example, 8×8 pixel size, 16×16 pixel size, etc. After performing operations such as transformation and quantization on the residual block, the transformation mode information of each residual block can be obtained.

[0081] S420. According to the size of each residual block, save the transformation mode information of each residual block into a corresponding flag bit.

[0082] In the embodiment of the present application, in order to facilitate recording the transformation mode information of each residual block, the corresponding flag bit in the transformation mode information is saved. There is a corresponding relationship between the residual block and the flag bit, and then the server determines the flag bit corresponding to the residual block according to the size of the residual block, and then saves the corresponding transformation mode information to the flag bit. For example, if the residual block uses the transformation operation, the flag bit is marked as 1, and if the residual block skips the transformation operation, the flag bit is marked as 0.

[0083] It should be noted that different residual blocks have different corresponding flag bits, that is, there is no overlapping part in the flag bits corresponding to each residual block; in one example, there is a correspondence between the size of the residual block and the number of flag bits corresponding to the residual block, and thus the transformation mode information of a residual block can be saved in multiple corresponding flag bits.

[0084] In one example, the flag bit storing the transformation mode information may be stored in a memory, or may be stored in a disk in the form of a read-write file.

[0085] S430: In a non-initial encoding stage, obtain the transform mode information of each residual block recorded in the initial encoding stage from the flag bit.

[0086] In an embodiment of the present application, during non-initial encoding, the server may extract all flag bits from the memory and obtain the transformation mode information of each residual block recorded in the initial encoding stage from the content marked by each flag bit.

[0087] It should be noted that Figure 4 For more detailed description of steps S230 to S240 shown in Figure 2 Steps S230 to S240 are shown and will not be described in detail here.

[0088] In an embodiment of the present application, in the first encoding stage, the transformation mode information of each residual block is saved in the corresponding flag bit according to the size of each residual block, so as to facilitate storage and also facilitate subsequent acquisition of the flag bit corresponding to each residual block.

[0089] The present application embodiment provides another multimedia encoding method, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by the content producer or the server, or by the content producer and the server together. In the embodiment of the present application, the method is described by taking the server as an example. Figure 5 As shown, the multimedia encoding method is Figure 4 On the basis of, step S420 is expanded into steps S510 to S530. Steps S510 to S530 are described in detail as follows:

[0090] S510: Obtain the minimum size of the residual block.

[0091] In an embodiment of the present application, the minimum size of the residual block may be the minimum size at which the residual block can be split, for example, the minimum size of the residual block is 2×2 pixels. In other embodiments, the minimum size of the residual block may also be a size that is widely used in video coding and can provide sufficient information, for example, the minimum size of the residual block is usually 4×4 pixels.

[0092] S520: Calculate the number of minimum sizes covered by the residual block according to the size of the residual block and the minimum size.

[0093] In an embodiment of the present application, after knowing the size and minimum size of the residual block, it is possible to calculate how many minimum residual blocks the residual block is composed of. For example, if the size of the residual block is 8×8 pixels and the minimum size is 2×2 pixels, then the residual block covers 16 2×2 pixels.

[0094] S530 . Determine a flag bit corresponding to the residual block according to the number of minimum sizes covered by the residual block, and save the transformation mode information of the residual block to the determined flag bit.

[0095] In the embodiment of the present application, there is a corresponding relationship between the number of minimum sizes covered by the residual block and the number of flag bits corresponding to the residual block, which can be a one-to-one correspondence, that is, a residual block of a minimum size corresponds to one flag bit; the corresponding relationship can also be one-to-many, for example, a residual block of a minimum size corresponds to 2 flag bits. The specific corresponding relationship can be flexibly adjusted according to actual conditions and is not limited here.

[0096] The position of a residual block relative to other residual blocks is the same as the position of the flag bit corresponding to the residual block relative to the positions of other flag bits; for example, if residual block A is located to the left of residual block B, then the flag bit corresponding to residual block A is equivalent to the flag bit corresponding to residual block B being located to the left.

[0097] In an embodiment of the present application, after determining the flag bit corresponding to the residual block, the transformation mode of the residual block is saved to the determined flag bit. For example, the residual block covers 16 2×2 pixels, and a 2×2 pixel residual block corresponds to one flag bit, then the transformation mode information of the residual block is saved to the 16 flag bits. Assuming that the transformation mode information of the residual block is to skip the transformation operation, the flag bits at the 16 corresponding positions will be marked as no transformation operation is performed.

[0098] like Figure 6 As shown, the black squares represent the flag bits storing whether the transformation operation is used for each 2×2 pixel, and the whole forms a flag bit distribution diagram. Assuming that the residual block 601 chooses not to perform the transformation operation, it corresponds to 16 flag bits, and the residual block 602 performs the transformation operation, which corresponds to 9 flag bits, then the 16 flag bits corresponding to the residual block 601 are marked in white, and the 9 flag bits corresponding to the residual block 602 are marked in shades to distinguish the different choices of different residual blocks.

[0099] It should be noted that Figure 5 For a detailed description of steps S410, S430, S230 to S240, see Figure 4 The steps S410, S430, and S230-S240 shown are not described in detail here.

[0100] In an embodiment of the present application, based on the size of the residual block and the minimum size of the residual block, the number of minimum sizes covered by the residual block is calculated, and then the corresponding flag bit is determined to adapt to residual blocks of various sizes, ensuring that the corresponding flag bit can be determined for residual blocks of various sizes.

[0101] The present application also provides another multimedia encoding method, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by the content producer or the server, or by the content producer and the server together. In the embodiment of the present application, the method is described by taking the server as an example. Figure 7 As shown, the multimedia encoding method is Figure 4 Based on the above, S230 is expanded to S710-S720. Steps S710-S720 are described in detail as follows:

[0102] S710 . Obtain distribution of flag bits of the residual block to be encoded that do not use a transform operation in the first encoding, corresponding to the residual block to be encoded, according to the transform mode information recorded in the first encoding stage and the size and position of the residual block to be encoded.

[0103] The transformation mode information of each residual block is recorded in the first encoding stage, including the number and position of the flag bits corresponding to the transformation mode information of each residual block; then, according to the number and position of the flag bits corresponding to the transformation mode information of each residual block recorded in the first encoding stage, the distribution of each flag bit for which the transformation operation is not used in the first encoding can be obtained, and based on the size and position of the current residual block to be encoded, the distribution of the flag bits for which the transformation operation is not used in the first encoding corresponding to the current residual block to be encoded can be known, including the number and position of the flag bits for which the transformation operation is not used in the first encoding corresponding to the current residual block to be encoded.

[0104] S720: Determine the transform mode information of the current residual block to be encoded according to the obtained distribution of the flag bits of the unused transform operation.

[0105] In an example, the transform mode information of the current residual block to be encoded may be determined by the number of flag bits corresponding to the current residual block to be encoded that do not use the transform operation in the first encoding.

[0106] In another example, the transform mode information of the current residual block to be encoded may be determined by the number and position of flag bits corresponding to the current residual block to be encoded that do not use the transform operation in the first encoding and the position of the current residual block to be encoded.

[0107] It should be noted that Figure 7 For other detailed descriptions of steps S410 to S430 and S240 shown in Figure 4 Steps S410 to S430 and S240 shown in FIG. 2 are not described in detail here.

[0108] In an embodiment of the present application, the distribution of flag bits corresponding to the current residual block to be encoded and not using the transform operation in the first encoding is obtained through the transform mode information recorded in the first encoding stage and the size and position of the current residual block to be encoded, so as to determine the influence of the distribution of flag bits for not using the transform operation in the first encoding on the current residual block to be encoded, thereby ensuring the accuracy of the transform mode information of the current residual block to be encoded.

[0109] In one embodiment of the present application, another multimedia encoding method is also provided. The multimedia encoding method can be applied to Figure 1 In the implementation environment shown, the method can be executed by the content producer or the server, or by the content producer and the server together. In the embodiment of the present application, the method is described by taking the server as an example. Figure 8 As shown, the multimedia encoding method is Figure 7 Based on the information shown in , S710 is expanded to S810 to S830. Steps S810 to S830 are described in detail as follows:

[0110] S810: Obtain the position of each flag bit of the unused transform operation according to the transform mode information recorded in the first encoding stage.

[0111] In the embodiment of the present application, the transformation mode information of each residual block is recorded in the first encoding stage. In one example, the transformation mode information of each residual block is marked by a flag bit distribution map, such as Figure 6 As shown, the position of each flag bit that does not use the transformation operation can be determined from all flag bits through the flag bit distribution map, wherein the position of each flag bit that does not use the transformation operation refers to the position of the flag bit in the flag bit distribution map.

[0112] S820: Determine a coverage area of ​​the current residual block to be encoded according to the size and position of the current residual block to be encoded.

[0113] It can be understood that the position of the flag corresponding to the transformation mode information of the residual block in the flag distribution map matches the corresponding position of the residual block in the flag distribution map, and the area corresponding to the current residual block to be encoded can be determined through the size of the current residual block to be encoded, such as an 8×8 pixel current residual block to be encoded, and the area in the flag distribution map is 16 2×2 pixels corresponding to the area; through the position of the current residual block to be encoded, it can be determined at which position in the flag distribution map the area corresponding to the current residual block to be encoded corresponds, and then the coverage area of ​​the current residual block to be encoded in the flag distribution map is obtained.

[0114] S830 , selecting a flag bit located in the coverage area from each flag bit of the unused transformation operation to generate a distribution.

[0115] In an embodiment of the present application, from among the flag bits that have not used the transformation operation, a flag bit located within the coverage area of ​​the current residual block to be encoded is selected, thereby obtaining the distribution of the flag bits that have not used the transformation operation in the first encoding and are covered by the current residual block to be encoded.

[0116] It should be noted that Figure 8 For other detailed descriptions of steps S410 to S430, S720, and S240 shown in Figure 7 The steps S410 to S430, S720, and S240 shown are not repeated here.

[0117] In the embodiment of the present application, the coverage area of ​​the current residual block to be encoded is determined according to the size and position of the current residual block to be encoded, and then each flag bit of the unused transformation operation located in the coverage area is selected to preserve the accuracy of distribution generation.

[0118] The embodiment of the present application provides a multimedia encoding method, which includes a method that can be applied to Figure 1 In the implementation environment shown, the method can be executed by the content producer or the server, or by the content producer and the server together. In the embodiment of the present application, the method is described by taking the server as an example. Fig. 9 As shown, the multimedia encoding method is Figure 7 Based on the above, S720 is expanded to S910-S920. Steps S910-S920 are described in detail as follows:

[0119] S910 . Calculate the proportion of the flag bits that do not use the transform operation in the current residual block to be encoded according to the obtained distribution of the flag bits that do not use the transform operation and the size of the current residual block to be encoded.

[0120] In an embodiment of the present application, the distribution of the flag bits of the current residual block to be encoded that were not used in the first encoding and covered by the flag bits of the transformation operation can be used to obtain the area of ​​the flag bits of the current residual block to be encoded that were not used. The size of the current residual block to be encoded can be used to obtain the area corresponding to the current residual block to be encoded. Then, by comparing the area of ​​the flag bits of the transformation operation not used with the area corresponding to the current residual block to be encoded, the proportion of the flag bits of the transformation operation not used in the current residual block to be encoded can be calculated.

[0121] S920: Determine the transformation mode information of the current residual block to be encoded according to the proportion.

[0122] In an embodiment of the present application, the proportion of the flag bit of the unused transform operation in the current residual block to be encoded can reflect the degree of influence of not using the transform operation on the current residual block to be encoded. The larger the proportion, the greater the influence of not using the transform operation on the current residual block to be encoded, and the greater the probability that the transform mode information of the current residual block to be encoded is to skip the transform operation.

[0123] In one example, the corresponding transformation mode information may be selected for the current residual block to be encoded by comparing the proportion with a preset proportion threshold.

[0124] It should be noted that Fig. 9 For other detailed descriptions of steps S410 to S430, S710, and S240 shown in Figure 7 The steps S410 to S430, S710, and S240 shown are not repeated here.

[0125] In an embodiment of the present application, the proportion of the flag bits of the unused transform operation in the current residual block to be encoded is calculated, and the proportion is used to reflect the degree of influence of not using the transform operation on the current residual block to be encoded, thereby determining the transform mode information of the current residual block to be encoded, thereby ensuring the accuracy and reliability of the determination.

[0126] The embodiment of the present application provides another multimedia encoding method, which includes a method that can be applied to Figure 1 In the implementation environment shown, the method can be executed by the content producer or the server, or by the content producer and the server together. In the embodiment of the present application, the method is described by taking the server as an example. Fig.10 As shown, the multimedia encoding method is Fig. 9 On the basis of, S920 is extended to S1010 to S1020. Among them, steps S1010 to S1020 are described in detail as follows:

[0127] S1010: If the proportion is greater than a first preset proportion threshold, determine that the transformation mode information of the current residual block to be encoded is a skip transformation operation.

[0128] S1020. If the proportion is less than or equal to a second preset proportion threshold, determine that the transformation mode information of the current residual block to be encoded is to use a transformation operation, and the second preset proportion threshold is less than the first preset proportion threshold.

[0129] In an embodiment of the present application, based on the comparison relationship between the proportion and the preset proportion threshold, the corresponding transformation mode information is selected for the current residual block to be encoded; wherein, if the proportion is greater than the first preset proportion threshold, it means that the current residual block to be encoded covers more flag bits of unused transformation operations, indicating that the image content in this area contains more high-frequency components after prediction, and the possibility that the transformation operation cannot have the effect of concentrating residual energy for the residual block to be encoded is greater, and therefore, the transformation mode information of the current residual block to be encoded is determined to skip the transformation operation.

[0130] If the proportion is the second preset proportion threshold, and the second preset proportion threshold is less than the first preset proportion threshold, it means that the flag bit of the unused transformation operation covered by the current residual block to be encoded is too small to affect the transformation operation. Therefore, it is determined that the transformation mode information of the current residual block to be encoded is to use the transformation operation.

[0131] In one example, the first preset proportion threshold can be flexibly adjusted according to actual conditions. For example, the first preset proportion threshold is 30%. In some scenarios, the first preset proportion threshold can also be adjusted according to the area of ​​the current residual block to be encoded. For example, a standard first preset proportion threshold is set. The standard first preset proportion threshold corresponds to the standard area of ​​the residual block. The larger the area of ​​the current residual block to be encoded is equivalent to the standard area, the larger the first preset proportion threshold is.

[0132] In one example, the second preset proportion threshold is 0, and in another example, the second preset proportion threshold is 2%, which can be flexibly adjusted according to actual conditions and is not limited here.

[0133] It should be noted that Fig.10 For other detailed descriptions of steps S410 to S430, S710, S910, and S240 shown in Fig. 9 The steps S410 to S430, S710, S910, and S240 shown are not repeated here.

[0134] In the embodiment of the present application, if the proportion is greater than the first preset proportion threshold, it means that the current residual block to be encoded covers more flag bits of unused transformation operations, and then the transformation mode information of the current residual block to be encoded is determined to skip the transformation operation; if the proportion is less than or equal to the second preset proportion threshold, the transformation mode information of the current residual block to be encoded is determined to use the transformation operation, thereby ensuring the rationality of the determination of the transformation mode information.

[0135] The embodiment of the present application provides another multimedia encoding method, which includes a method that can be applied to Figure 1 In the implementation environment shown, the method can be executed by the content producer or the server, or can be executed by the content producer and the server together. In the embodiment of the present application, the method is executed by the server as an example. Fig.11 As shown, the multimedia encoding method is Fig.10 Based on the above, steps S1110 to S1120 are added. Steps S1110 to S1120 are described in detail as follows:

[0136] S1110. If the proportion is less than the first preset proportion threshold and greater than the second preset proportion threshold, obtain the target area of ​​the current residual block to be encoded.

[0137] In an embodiment of the present application, if the proportion is less than the first preset proportion threshold and greater than the second preset proportion threshold, it means that the residual of the image content in this area after prediction contains neither too many nor too few high-frequency components. In order to accurately determine the transformation mode information of the current residual block to be encoded, the transformation mode information of the current residual block to be encoded is further determined based on the position of the flag bit of the aforementioned unused transformation operation. At this time, the target area of ​​the current residual block to be encoded will be obtained.

[0138] In one example, the target area of ​​the current residual block to be encoded is the area corresponding to one quarter of the upper left corner of the residual block to be encoded. This is because according to the encoding rules of the quantization coefficients, the closer the transform coefficient with a large absolute value is to the upper left corner of the transform block, the fewer bits are required. The encoding order of the coefficients is scanned in a "Z" shape from the upper left corner to the lower right corner. The smaller coefficients are all 0 after quantization, and it is only necessary to encode a subsequent all-0 flag after the non-zero coefficient encoding is completed. Therefore, the upper left corner of the residual block to be encoded has a transform coefficient with a large absolute value, and no transform operation may have better rate-distortion performance.

[0139] In one example, when determining the area corresponding to the upper left quarter of the residual block to be encoded, the residual block to be encoded is evenly divided into four parts to determine the area corresponding to the upper left corner, such as Fig. 12A As shown, the residual block to be encoded 1201 is evenly divided into four parts, and the area in the upper left corner is used as the target area 1202.

[0140] In another example, the target area of ​​the current residual block to be encoded may be smaller than the area corresponding to one quarter of the upper left corner of the residual block to be encoded; Fig. 12B As shown, the target area 1203 of the residual block to be encoded 1201 is smaller than the target area 1202. The specific range of the target area can be flexibly adjusted according to actual conditions and is not limited here.

[0141] S1120 . Determine the transform mode information of the current residual block to be encoded according to the relationship between the position of the flag bit of the unused transform operation and the target area.

[0142] In an embodiment of the present application, the relationship between the position of the flag bit for not using the transform operation and the target area refers to whether the position of the flag bit for not using the transform operation is located within the target area, so as to determine whether the residual block to be encoded has a transform coefficient with a large absolute value, and then determine the corresponding transform mode information for the current residual block to be encoded.

[0143] It should be noted that Fig.11 For other detailed descriptions of steps S410 to S430, S710, S910, S1010 to S1020, and S240 shown in Fig.10 The steps S410 to S430, S710, S910, S1010 to S1020, and S240 shown are not repeated here.

[0144] In an embodiment of the present application, if the proportion is less than the first preset proportion threshold and greater than the second preset proportion threshold, the transformation mode information of the current residual block to be encoded is determined based on the relationship between the position of the flag bit of the unused transformation operation and the target area, thereby further improving the reliability of the determination of the transformation mode information.

[0145] It is worth noting that the embodiment of the present application provides another multimedia encoding method, which can be applied to Figure 1 In the implementation environment shown, the method can be executed by the content producer or the server, or by the content producer and the server together. In the embodiment of the present application, the method is described by taking the server as an example. Fig.13 As shown, in Fig.11 Based on the method shown in FIG. 1 , S1120 is expanded to step S1310, which is described in detail as follows:

[0146] S1310: If the positions of the flag bits for not using the transform operation are all within the target area, it is determined that the transform mode information of the current residual block to be encoded is to skip the transform operation.

[0147] In an embodiment of the present application, if the positions of the flag bits for which the transform operation is not used are all within the target area, it indicates that the residual block to be encoded has the characteristic that coefficients with large absolute values ​​are concentrated in the upper left corner, and better rate-distortion performance may be achieved without transforming. Therefore, the transform mode information of the current residual block to be encoded is determined to skip the transform operation.

[0148] It should be noted that Fig.13 For other detailed descriptions of steps S410 to S430, S710, S910, S1010 to S1020, S1110, and S240 shown in Fig.11 Steps S410 to S430, S710, S910, S1010 to S1020, S1110, and S240 shown are not repeated here.

[0149] The embodiment of the present application provides another multimedia encoding method, which includes a method that can be applied to Figure 1 In the implementation environment shown, the method can be executed by the content producer or the server, or by the content producer and the server together. In the embodiment of the present application, the method is described by taking the server as an example. Fig.14 As shown, the multimedia encoding method is Fig.11 Based on the information shown in , S1120 is expanded into steps S1410 to S1420, which are described in detail as follows:

[0150] S1410: If there is at least one flag bit for not using a transform operation and the position thereof is outside the target area, determine the transform mode information of the current residual block to be encoded as using a transform operation and skipping a transform operation.

[0151] S1420: Select an optimal encoding operation mode from using a transform operation and skipping a transform operation according to a rate-distortion cost.

[0152] In an embodiment of the present application, if there is at least one flag bit for not using the transform operation and the position is outside the target area, it means that the flag bits for not using the transform operation are relatively scattered. At this time, the server may not make a quick judgment, but choose to use the transform operation or skip the transform operation for the current residual block to be encoded, that is, try the transform and no transform methods.

[0153] In order to ensure the reliability of the selection of the current coding residual block, the optimal coding operation mode is selected from using the transform operation and skipping the transform operation according to the rate-distortion cost. The calculated rate-distortion cost refers to the number of coding bits required to achieve a certain image quality. When selecting the most suitable mode, the encoder compares the calculated rate-distortion costs of the two modes and selects the mode with the smaller cost for encoding.

[0154] In one example, the server can also determine which encoder and decoder to use to implement compression and decompression, determine the range of bit rates based on the type of data to be compressed and the required compression rate, and then calculate the distortion cost at each bit rate for each bit rate; the distortion cost refers to the degree of difference between the compressed image and the original image, and the distortion costs at each bit rate in the two modes are compared, and the smallest distortion cost is selected as the most appropriate mode.

[0155] In other embodiments of the present application, if there is a flag bit for not using the transform operation and the position is outside the target area, and there is also a flag bit for not using the transform operation and the position is located within the target area, and the number of flag bits for not using the transform operation within the target area and outside the target area is equivalent, that is, the difference in number is not greater than the preset difference threshold, then the transform mode information of the current residual block to be encoded is determined to be using the transform operation and skipping the transform operation, and then the optimal encoding operation mode is selected from using the transform operation and skipping the transform operation through the rate-distortion cost.

[0156] In other embodiments of the present application, if the positions of the flag bits for not using the transform operation are all located outside the target area, it can be directly determined that the transform mode information of the current residual block to be encoded uses the transform operation without selecting through two operations.

[0157] It should be noted that Fig.14 For other detailed descriptions of steps S410 to S430, S710, S910, S1010 to S1020, S1110, and S240 shown in Fig.11 Steps S410 to S430, S710, S910, S1010 to S1020, S1110, and S240 shown are not repeated here.

[0158] In the embodiment of the present application, different transformation mode information determination methods are selected for the flag bit of the unused transformation operation being located outside the target area and outside the target area, so as to further improve the reliability of the transformation mode information determination.

[0159] See also Fig.15 , Fig.15 is a flowchart of a multimedia encoding method shown in an embodiment of the present application, which can be applied to Figure 1In the implementation environment shown, the method can be executed by the content producer or the server, or by the content producer and the server together. In the embodiment of the present application, the method is executed by the server as an example. The multimedia encoding method Fig. 9 The S910 is expanded to S1510~S1520, as detailed below:

[0160] S1510: Calculate a target number of flag bits corresponding to the current residual block to be encoded according to the size of the current residual block to be encoded and the minimum size of the residual block.

[0161] In an embodiment of the present application, in order to accurately calculate the proportion of flag bits that do not use transformation operations in the current residual block to be encoded, the current residual block to be encoded is split into multiple residual blocks of minimum size according to the size of the current residual block to be encoded and the minimum size of the residual block, and then based on the relationship between the residual block of the minimum size and the flag bits, the target number of flag bits corresponding to the current residual block to be encoded is calculated.

[0162] S1520. Calculate the ratio of the number of flag bits that do not use the transformation operation to the target number to obtain a proportion.

[0163] In the embodiment of the present application, the ratio obtained by dividing the number of flag bits for which the transform operation is not used by the target number is used as the proportion of the flag bits for which the transform operation is not used in the current residual block to be encoded.

[0164] It should be noted that Fig.15 For other detailed descriptions of steps S410 to S430, S710, S920, and S240 shown in Fig. 9 The steps S410 to S430, S710, S920, and S240 shown are not repeated here.

[0165] In an embodiment of the present application, based on the size of the current residual block to be encoded and the minimum size of the residual block, the number of corresponding flag bits of the current residual block to be encoded can be obtained, and combined with the number of flag bits covered by the current residual block to be encoded that did not use the transformation operation in the first encoding, the proportion of flag bits that did not use the transformation operation in the current residual block to be encoded is calculated.

[0166] For ease of understanding, the following is based on Figure 1 The implementation environment shown is used to describe in detail the multimedia encoding method provided in the embodiment of the present application, taking the multimedia as video as an example:

[0167] In the multimedia encoding method provided in this embodiment, the video is encoded multiple times to obtain higher bit rate accuracy and better coding rate distortion performance. When the video is encoded for the first time, the encoder performs main steps such as prediction, transformation, quantization, and entropy encoding on the video to obtain a compressed binary code stream.

[0168] It is worth noting that when the first encoding is performed, the transform mode information of each residual block will be saved, that is, whether the transform operation is used. Since the block division results of each encoded image may be different, in order to be able to use the transform mode information of the residual block at different divisions, the embodiment of the present application saves the transform mode information of each residual block in a 2×2 block size; this is because the minimum size of the residual block will not be less than 2×2 pixels. Although the residual block can have a variety of sizes, it can always be divided into several 2×2 sub-blocks. For ease of storage, in an embodiment of the present application, each 2×2 residual block corresponds to a flag bit. For example, for a frame of an image with a size of 1920×1080, 860×540 flag bits need to be saved, and the flag bits can be saved in the memory or in the disk system in the form of a read-write file.

[0169] Therefore, during the first encoding, the information of whether the residual block in each final division form adopts the transformation operation will be recorded in its corresponding flag. For example, if an 8×8 residual block chooses not to perform the transformation operation, since it covers 16 2×2 sub-blocks, its corresponding 16 flags will all be marked as not performing the transformation operation.

[0170] When performing subsequent multiple encodings, such as the second encoding, the transform mode information saved in the first encoding will be used as an important basis for determining whether the current residual block to be encoded needs to be transformed in the second encoding. For the current residual block to be encoded, the embodiment of the present application will first obtain the transform mode information saved in the first encoding, and count the proportion and position of the 2×2 blocks that skip the transformation. Fig.16 As shown, the black squares represent the flag bits storing whether the transformation operation is used for each 2×2 block. There are 16×16 flag bits saved in the first encoding, among which the 2×2 blocks that do not use the transformation operation are marked with shadows, and the 2×2 blocks that use the transformation operation are white.

[0171] It is worth noting that whether a residual block to be encoded is transformed or not is determined by the proportion of 2×2 blocks that are not transformed in the first pass of encoding and the position distribution of these 2×2 blocks. Fig.16As shown in the figure, 1601 is the transform mode information recorded in the first encoding stage, 1602 is the residual block to be encoded with a size of 16×16, and its target area 1603 is circled by a dotted frame. The residual block to be encoded covers 20 2×2 blocks that have not been transformed (the shaded part in the figure), accounting for 31.25% of all the 2×2 blocks it covers, and all the 2×2 blocks that have not been transformed are outside the target area.

[0172] Generally speaking, the more 2×2 blocks of skipped transform operations are covered in an area, the more high-frequency components the residual of the image content in this area contains after prediction, and the greater the possibility that the transform will not have the effect of concentrating the residual energy of this residual block. At the same time, according to the coding rules of quantization coefficients, the closer the transform coefficient with large absolute value is to the upper left corner of the transform block, the fewer bits are required. This is because the coding order of the coefficients is scanned from the upper left corner to the lower right corner in a "Z" shape, and the smaller coefficients are all 0 after quantization. It is only necessary to encode a subsequent all-0 flag after the non-zero coefficients are encoded. When all the 2×2 blocks of skipped transform fall in the target area of ​​the residual block to be encoded, the residual block to be encoded may already have the characteristic that the coefficients with large absolute values ​​are concentrated in the upper left corner of the block, and no transform may have better rate-distortion performance. Therefore, the transform mode information of the current residual block to be encoded can be determined by the following four situations:

[0173] a) When the proportion of the 2×2 blocks skipped in the residual block to be encoded is greater than k, the residual block to be encoded is not transformed and is directly quantized.

[0174] b) When the residual block to be encoded does not contain a 2×2 block for skipping the transform operation, that is, k is 0, the residual block to be encoded is only transformed and the transform skip mode is not attempted.

[0175] c) When the proportion of 2×2 blocks skipped in the residual block to be encoded is between 0 and k, and there are 2×2 blocks in the non-target area of ​​the residual block to be encoded, the encoder does not make a quick judgment, but tries both the transformation and non-transformation methods, and selects the best method based on the rate distortion.

[0176] d) When the proportion of the 2×2 blocks skipping transformation in the residual block to be encoded is between 0 and k, and all the 2×2 blocks are in the target area of ​​the residual block to be encoded, the residual block to be encoded is only coded without transformation.

[0177] In one example, k is set to 20% to have a better acceleration-loss ratio, and may also be set to other values ​​according to specific requirements.

[0178] Based on the above content, the embodiment of the present application also provides a multimedia encoding method, such as Fig.17 As shown, the method includes:

[0179] S1701. For the second encoding stage, obtain the current residual block to be encoded.

[0180] S1702: Obtain transformation mode information of a 2×2 sub-block corresponding to the current residual block to be encoded during the first encoding.

[0181] S1703 , counting the proportion of 2×2 sub-blocks that skip transformation operations.

[0182] S1704. Compare the proportion with a preset proportion threshold to determine whether the proportion is greater than the preset proportion threshold. If so, go to S1705; if not, go to S1706.

[0183] S1705: Perform a non-transform coding operation on the current residual block to be encoded.

[0184] S1706, determine whether the proportion is greater than 0 and the 2×2 skipped transforms are all in the target area of ​​the current residual block to be encoded, if so, go to S1705, if not, go to S1707.

[0185] S1707: Perform a transform coding operation on the current residual block to be encoded.

[0186] In the embodiment of the present application, when it is determined that the proportion is equal to 0, a transform coding operation is performed on the current residual block to be encoded.

[0187] In an embodiment of the present application, the transformation mode information of the first encoding is used to accelerate the selection process of the transformation mode information of the subsequent encoding in multiple encodings, which can reduce the calculation complexity and save server computing resources without substantially damaging the coding efficiency.

[0188] The device embodiment of the present application is introduced, which can be used to execute the multimedia encoding method in the above embodiment of the present application. For details not disclosed in the device embodiment of the present application, please refer to the above embodiment of the multimedia encoding method of the present application.

[0189] The present application embodiment provides a multimedia encoding device, such as Fig.18 As shown, the multimedia encoding device can be in a content producer or a server, and the device includes:

[0190] The recording module 1810 is used to record the transformation mode information of the residual block in the first encoding stage of the multimedia multiple encoding process;

[0191] An acquisition module 1820 is used to acquire, in a non-initial encoding stage, transform mode information of each residual block recorded in the initial encoding stage;

[0192] A determination module 1830, configured to determine the transformation mode information of the current residual block to be encoded according to the transformation mode information recorded in the first encoding stage and the attribute information of the current residual block to be encoded;

[0193] The encoding module 1840 is configured to perform encoding processing on the current residual block to be encoded according to the transformation mode information of the current residual block to be encoded.

[0194] In one embodiment of the present application, based on the aforementioned scheme, the recording module 1810 is further used to determine the size of each residual block and the transformation mode information of each residual block in the first encoding stage; according to the size of each residual block, the transformation mode information of each residual block is saved in the corresponding flag bit; the acquisition module is further used to obtain the transformation mode information of each residual block recorded in the first encoding stage from the flag bit.

[0195] In one embodiment of the present application, based on the aforementioned scheme, the recording module 1810 is further used to obtain the minimum size of the residual block; according to the size of the residual block and the minimum size, the number of minimum sizes covered by the residual block is calculated; according to the number of minimum sizes covered by the residual block, a flag corresponding to the residual block is determined, and the transformation mode information of the residual block is saved to the determined flag.

[0196] In one embodiment of the present application, based on the aforementioned scheme, the attribute information includes size and position; the determination module 1830 is further used to obtain the distribution of the flag bits corresponding to the current residual block to be encoded that did not use the transformation operation in the first encoding according to the transformation mode information recorded in the first encoding stage and the size and position of the current residual block to be encoded; determine the transformation mode information of the current residual block to be encoded based on the obtained distribution of the flag bits of the non-use transformation operation.

[0197] In one embodiment of the present application, based on the aforementioned scheme, the determination module 1830 further obtains the positions of the various flag bits of the unused transform operation according to the transform mode information recorded in the first encoding stage; determines the coverage area of ​​the current residual block to be encoded according to the size and position of the current residual block to be encoded; and selects the flag bit located in the coverage area from the various flag bits of the unused transform operation to generate the distribution.

[0198] In one embodiment of the present application, based on the aforementioned scheme, the determination module 1830 is further used to calculate the proportion of the flag bit of the non-use transform operation in the current residual block to be encoded according to the obtained distribution of the flag bit of the non-use transform operation and the size of the current residual block to be encoded; and determine the transform mode information of the current residual block to be encoded according to the proportion.

[0199] In one embodiment of the present application, based on the aforementioned scheme, the determination module 1830 is further used to determine that the transformation mode information of the current residual block to be encoded is to skip the transformation operation if the proportion is greater than a first preset proportion threshold; if the proportion is less than or equal to a second preset proportion threshold, then determine that the transformation mode information of the current residual block to be encoded is to use the transformation operation, and the second preset proportion threshold is less than the first preset proportion threshold.

[0200] In one embodiment of the present application, based on the aforementioned scheme, the determination module 1830 is further used to obtain the target area of ​​the current residual block to be encoded if the proportion is less than the first preset proportion threshold and greater than the second preset proportion threshold; and determine the transformation mode information of the current residual block to be encoded based on the relationship between the position of the flag bit of the unused transformation operation and the target area.

[0201] In one embodiment of the present application, based on the above-mentioned scheme, the determination module 1830 is further used to determine that the transformation mode information of the current residual block to be encoded is to skip the transformation operation if the positions of each flag bit of the non-transformation operation are all within the target area.

[0202] In one embodiment of the present application, based on the aforementioned scheme, the determination module 1830 is further used to determine that the transform mode information of the current residual block to be encoded is to use the transform operation and skip the transform operation if there is at least one flag position for not using the transform operation and the position is outside the target area; and select the optimal encoding operation mode from using the transform operation and skipping the transform operation according to the coding rate distortion.

[0203] In one embodiment of the present application, based on the aforementioned scheme, the determination module 1830 is further used to calculate the target number of flag bits corresponding to the current residual block to be encoded according to the size of the current residual block to be encoded and the minimum size of the residual block; calculate the ratio of the number of flag bits for which the transformation operation is not used to the target number to obtain the ratio.

[0204] In one embodiment of the present application, based on the aforementioned scheme, the encoding module 1840 is further used to perform a quantization operation on the current residual block to be encoded if the transform mode information of the current residual block to be encoded indicates skipping the transform operation; if the transform mode information of the current residual block to be encoded indicates using the transform operation, then perform a transform operation on the current residual block to be encoded.

[0205] It should be noted that the device provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here.

[0206] An embodiment of the present application also provides an electronic device, comprising one or more processors and a storage device, wherein the storage device is used to store one or more computer programs, and when the one or more computer programs are executed by one or more processors, the electronic device implements the multimedia encoding method as described above.

[0207] Fig.19 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.

[0208] It should be noted that Fig.19 The computer system 1900 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application, wherein the electronic device may be a client or a server.

[0209] like Fig.19 As shown, the computer system 1900 includes a processor (Central Processing Unit, CPU) 1901, which can perform various appropriate actions and processes according to the program stored in the read-only memory (Read-Only Memory, ROM) 1902 or the program loaded from the storage part 1908 to the random access memory (Random Access Memory, RAM) 1903, such as executing the method in the above embodiment. In RAM 1903, various programs and data required for system operation are also stored. CPU 1901, ROM 1902 and RAM 1903 are connected to each other through bus 1904. Input / output (Input / Output, I / O) interface 1905 is also connected to bus 1904.

[0210] In some embodiments, the following components are connected to the I / O interface 1905: an input section 1906 including a keyboard, a mouse, etc.; an output section 1907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 1908 including a hard disk, etc.; and a communication section 1909 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1909 performs communication processing via a network such as the Internet. A drive 1910 is also connected to the I / O interface 1905 as needed. A removable medium 1911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1910 as needed, so that a computer program read therefrom is installed into the storage section 1908 as needed.

[0211] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1909, and / or installed from a removable medium 1911. When the computer program is executed by a processor (CPU) 1901, various functions defined in the system of the present application are executed.

[0212] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (Erasable Programmable Read Only Memory), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0213] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the devices, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and a computer program.

[0214] The units or modules involved in the embodiments described in this application may be implemented by software or hardware, and the units or modules described may also be set in a processor. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.

[0215] Another aspect of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the method described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0216] Another aspect of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of an electronic device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the electronic device executes the method provided in the above-mentioned embodiments.

[0217] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0218] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

[0219] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person of ordinary skill in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.

Claims

1. A multimedia encoding method, characterized in that: include: In the first encoding stage of the multimedia multiple encoding process, the transformation mode information of the residual block is recorded; In a non-initial encoding stage, obtaining transform mode information of each residual block recorded in the initial encoding stage; Determining the transform mode information of the current residual block to be encoded according to the transform mode information recorded in the first encoding stage and the attribute information of the current residual block to be encoded; The current residual block to be encoded is encoded according to the transformation mode information of the current residual block to be encoded.

2. The method according to claim 1, characterized in that Record the transformation mode information of the residual block, including: In the first encoding stage, determining the size of each residual block and the transform mode information of each residual block; According to the size of each residual block, the transform mode information of each residual block is saved in a corresponding flag bit; The obtaining the transformation mode information of each residual block recorded in the first encoding stage includes: The transform mode information of each residual block recorded in the first encoding stage is obtained from the flag bit.

3. The method according to claim 2, characterized in that The step of saving the transform mode information of the residual block to a corresponding flag bit according to the size of the residual block includes: Get the minimum size of the residual block; Calculating the number of minimum sizes covered by the residual block according to the size of the residual block and the minimum size; A flag bit corresponding to the residual block is determined according to the number of minimum sizes covered by the residual block, and the transformation mode information of the residual block is saved to the determined flag bit.

4. The method according to claim 2, characterized in that: The attribute information includes size and position; the determining the transform mode information of the current residual block to be encoded according to the transform mode information recorded in the first encoding stage and the attribute information of the current residual block to be encoded includes: According to the transform mode information recorded in the first encoding stage and the size and position of the current residual block to be encoded, obtaining the distribution of the flag bits corresponding to the current residual block to be encoded and not using the transform operation in the first encoding; According to the obtained distribution of the flag bits of the unused transform operation, the transform mode information of the current residual block to be encoded is determined.

5. The method according to claim 4, characterized in that The obtaining, according to the transform mode information recorded in the first encoding stage and the size and position of the current residual block to be encoded, the distribution of the flag bit corresponding to the current residual block to be encoded that does not use the transform operation in the first encoding includes: According to the transformation mode information recorded in the first encoding stage, obtaining the position of each flag bit of the unused transformation operation; Determining a coverage area of ​​the current to-be-encoded residual block according to the size and position of the current to-be-encoded residual block; The flag bits located in the coverage area are selected from the flag bits that do not use the transformation operation to generate the distribution.

6. The method according to claim 4, characterized in that The determining, according to the obtained distribution of the flag bits of the unused transform operation, the transform mode information of the current residual block to be encoded includes: Calculating the proportion of the flag bit of the non-transformation operation in the current residual block to be encoded according to the obtained distribution of the flag bit of the non-transformation operation and the size of the current residual block to be encoded; According to the proportion, the transformation mode information of the current residual block to be encoded is determined.

7. The method according to claim 6, characterized in that The determining, according to the proportion, the transform mode information of the current residual block to be encoded includes: If the proportion is greater than a first preset proportion threshold, determining that the transformation mode information of the current residual block to be encoded is a skip transformation operation; If the proportion is less than or equal to a second preset proportion threshold, it is determined that the transformation mode information of the current residual block to be encoded is to use a transformation operation, and the second preset proportion threshold is less than the first preset proportion threshold.

8. The method according to claim 7, characterized in that The determining, according to the proportion, the transform mode information of the current residual block to be encoded further includes: If the proportion is less than the first preset proportion threshold and greater than the second preset proportion threshold, obtaining the target area of ​​the current residual block to be encoded; The transform mode information of the current residual block to be encoded is determined according to the relationship between the position of the flag bit of the unused transform operation and the target area.

9. The method according to claim 8, characterized in that The determining, according to the relationship between the position of the flag bit of the unused transform operation and the target area, the transform mode information of the current residual block to be encoded includes: If the positions of the flag bits for not using the transform operation are all within the target area, it is determined that the transform mode information of the current residual block to be encoded is to skip the transform operation.

10. The method according to claim 8, characterized in that The determining, according to the relationship between the position of the flag bit of the unused transform operation and the target area, the transform mode information of the current residual block to be encoded includes: If there is at least one flag bit for not using the transform operation and the position thereof is outside the target area, determining the transform mode information of the current residual block to be encoded as using the transform operation and skipping the transform operation; The optimal encoding operation mode is selected from using transform operation and skipping transform operation according to the coding rate distortion.

11. The method according to claim 6, characterized in that The calculating, according to the obtained distribution of the flag bit of the non-transformation operation and the size of the current residual block to be encoded, a proportion of the flag bit of the non-transformation operation in the current residual block to be encoded, comprises: Calculating a target number of flag bits corresponding to the current residual block to be encoded according to the size of the current residual block to be encoded and the minimum size of the residual block; The ratio of the number of flag bits that do not use the transformation operation to the target number is calculated to obtain the proportion.

12. The method according to claim 1, characterized in that The encoding process of the current residual block to be encoded according to the transformation mode information of the current residual block to be encoded includes: If the transform mode information of the current residual block to be encoded indicates skipping the transform operation, performing a quantization operation on the current residual block to be encoded; If the transform mode information of the current residual block to be encoded indicates that a transform operation is used, a transform operation is performed on the current residual block to be encoded.

13. A multimedia encoding device, characterized in that: include: A recording module, used for recording the transformation mode information of the residual block in the first encoding stage of the multimedia multiple encoding process; An acquisition module, used for acquiring, in a non-first encoding stage, transform mode information of each residual block recorded in the first encoding stage; A determination module, configured to determine the transformation mode information of the current residual block to be encoded according to the transformation mode information recorded in the first encoding stage and the attribute information of the current residual block to be encoded; The encoding module is used to encode the current residual block to be encoded according to the transformation mode information of the current residual block to be encoded.

14. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to execute the method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of an electronic device, the electronic device executes the method according to any one of claims 1 to 12.

16. A computer program product, characterized in that The computer program product comprises a computer program, wherein the computer program is stored in a computer-readable storage medium, and a processor of an electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device executes the method according to any one of claims 1 to 12.