Coding method, coding device, electronic equipment and storage medium
By analyzing the encoding mode of the video source and performing mode mapping, it is possible to support video encoding of different encoding formats without increasing hardware resources, solving the problem of increased hardware costs due to changes in encoding formats in the existing technology, and meeting the needs of real-time Coding requirements.
Patent Information
- Application Number
- CN202310160436.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2024-08-23
AI Technical Summary
In the existing technology, in order to implement encoding of different encoding formats, different video encoding co-processors need to be equipped, which leads to the need to spend additional hardware resources and costs on the basis of the main chip.
By obtaining the video source, analyzing its encoding mode, determining the mode selection information that has a mapping relationship with it, and re-encoding the image to be encoded based on this information, the target code stream is generated, supporting video encoding in different formats, and does not require replacement. chip or add a coprocessor.
Without increasing hardware resources, it achieves support for different encoding formats, reduces equipment upgrade costs, and meets real-time encoding efficiency requirements.
Smart Images

Figure CN118540487A
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a coding method, a coding device, an electronic device and a storage medium. Background Art
[0002] In the related art, in order to realize the encoding of different encoding formats, the interface of the video main chip is used to equip it with different video encoding coprocessors, and the encoding of other formats is completed by different coprocessors. The coprocessor is usually a field programmable gate array (FPGA) or a dedicated chip, which requires additional hardware resources and costs on the basis of the main chip. Summary of the invention
[0003] The present application provides an encoding method, an encoding device, an electronic device and a storage medium to solve the problem in the related art that in order to realize encoding of different encoding formats, different video encoding coprocessors need to be equipped, resulting in the need to spend additional hardware resources and costs on the basis of the main chip. The present application supports video encoding of different formats through the optimization of a series of encoding strategies without replacing the chip or adding a coprocessor.
[0004] The technical solution of this application is implemented as follows:
[0005] In a first aspect, the present application provides an encoding method, the method comprising:
[0006] Acquire a video source, and parse the encoding mode of the video source to obtain first mode selection information under a first encoding format;
[0007] Determine second mode selection information having a mapping relationship with the first mode selection information;
[0008] Based on the second mode selection information, the to-be-encoded image of the video source is re-encoded to obtain a target bitstream.
[0009] In a second aspect, the present application provides an encoding device, comprising:
[0010] An acquisition module is used to acquire video sources;
[0011] A parsing unit, configured to parse the encoding mode of the video source to obtain first mode selection information in a first encoding format;
[0012] a processing unit, configured to determine second mode selection information having a mapping relationship with the first mode selection information;
[0013] The encoding unit is used to re-encode the to-be-encoded image of the video source based on the second mode selection information to obtain a target code stream.
[0014] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program stored in the memory, and executing the steps of the encoding method as described above.
[0015] In a fourth aspect, a storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the encoding method of the first aspect as described above.
[0016] The present application provides an encoding method, which obtains a video source and parses the encoding mode of the video source to obtain first mode selection information under a first encoding format; determines second mode selection information having a mapping relationship with the first mode selection information; and re-encodes the image to be encoded of the video source based on the second mode selection information to obtain a target bit stream; solves the problem in the related art that different video encoding coprocessors need to be equipped to achieve encoding of different encoding formats, resulting in the need to spend additional hardware resources and costs on the basis of the main chip. The present application supports video encoding of different formats by optimizing a series of encoding strategies without replacing the chip or adding a coprocessor. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A schematic diagram of a flow chart of an encoding method provided in an embodiment of the present application;
[0018] Figure 2 A schematic diagram of a video coding-dependent hybrid coding framework provided in an embodiment of the present application;
[0019] Figure 3 A schematic diagram of the structure of a main chip provided in an embodiment of the present application;
[0020] Figure 4 A module flow chart for encoding a video source input into an SVAC code stream provided in an embodiment of the present application;
[0021] Figure 5 A schematic diagram of coding unit segmentation in a frame of image provided by an embodiment of the present application;
[0022] Figure 6 A parallel timing diagram of each module of the software implementation part provided in the embodiment of the present application;
[0023] Figure 7 A schematic diagram of image texture information provided by an embodiment of the present application;
[0024] Figure 8 A schematic diagram of an intra-frame prediction mode of HEVC provided in an embodiment of the present application;
[0025] Fig. 9 A schematic diagram of an intra-frame prediction mode of SVAC2 provided in an embodiment of the present application;
[0026] Fig.10 A schematic diagram of the structure of an encoding device provided in an embodiment of the present application;
[0027] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0029] It should be understood that the "embodiments of the present application" or "the aforementioned embodiments" mentioned throughout the specification mean that specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, "in the embodiments of the present application" or "in the aforementioned embodiments" appearing throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. In the various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.
[0030] The present application provides a coding method applied to electronic equipment, referring to Figure 1 As shown, the method comprises the following steps:
[0031] Step 101: Acquire a video source, and parse the encoding mode of the video source to obtain first mode selection information under a first encoding format.
[0032] Here, the video source includes but is not limited to the video captured by the electronic device; of course, the video source may also be the video captured by other devices and transmitted to the electronic device.
[0033] In the embodiments of the present application, electronic equipment includes but is not limited to security equipment, and security equipment includes but is not limited to security cameras. Security scenarios of security equipment include but are not limited to: closed-circuit monitoring scenario, anti-theft alarm scenario, building intercom scenario, parking lot management scenario, community card scenario, infrared perimeter alarm scenario, electronic scenario, patrol scenario, attendance access control scenario, security room scenario, and smart door lock scenario. When security equipment is connected to the Internet, it will continuously report data, such as real-time images (including image changes), sounds (including sound changes), etc.
[0034] Video coding refers to the process of compressing the original video data to generate a bitstream. The detailed compression process is specified by the specific video coding standard. At present, different encoders can be used to generate bitstreams that meet different video coding standards for different formats / types of coding scenarios.
[0035] See also Figure 2 As shown, video coding relies on a hybrid coding framework. The basic process is as follows Figure 2 As shown. Combined Figure 2 It can be seen that from the video source to the encoded bitstream, different types of encoding processes are implemented by similar codec internal modules, including block division, intra-frame prediction, inter-frame prediction (motion estimation), transformation / quantization, inverse transformation / inverse quantization, entropy coding, and filtering. Among them, filtering is a module that improves subjective quality and can be turned off separately, so in Figure 2 Not shown.
[0036] At present, security cameras are widely used in the market. For the devices that are already in the hands of users and in use, the existing encoding capabilities are single, such as only supporting H265 encoding. However, with the emergence of different needs and scenarios, devices are often required to support more encoding formats. However, the actual situation is that users cannot add coprocessors to each device one by one, and the cost of replacing all new devices is too high. For some software encoding schemes in related technologies, the encoding bit rate is usually around 10 frames per second, which cannot meet the real-time requirements of security cameras (25 frames per second).
[0037] In the embodiments of the present application, the encoding types involved include but are not limited to: H264 encoding, H265 encoding, Audio Video Coding Standard (AVS) encoding, Surverillance Video and Audio Coding (SVAC) encoding, and VPx series encoding.
[0038] Step 102: Determine second mode selection information that has a mapping relationship with the first mode selection information.
[0039] In the embodiment of the present application, the second encoding format corresponding to the second mode selection information is different from the first encoding format. Here, it can be understood that the first encoding format is an encoding format supported by the main chip of the electronic device, and the second encoding format is an encoding format not supported by the main chip of the electronic device. It can be seen that the present application can replace the complex mode selection process in the related art by mode mapping, thereby improving the encoding efficiency.
[0040] In an achievable encoding scenario, exemplarily, the first encoding format is H265 encoding, and the second encoding format is AVS encoding or SVAC encoding. Figure 3 The structure diagram of a main chip is shown as an example, in which the video subsystem (VideoSubsystem) supports encoding and decoding of H264, HEVC, H265, and Moving Picture Experts Group (MPEG) / Joint Photographic Experts Group (JPEG). Figure 3 Only H264 and HEVC are shown, and others can be selected according to actual needs, and no further limitation is made here. The processor subsystem (ARMSubsystem) includes four cores, for example, there are two groups of A73 cores and A53 cores, and the image subsystem (Image Subsystem) includes a digital signal processing (Digital Signal Processing, DSP) module for processing image data. Exemplarily, the main chip provides digital video recording with 8K30 / 4K120 broadcast-level image quality, supports H.265 encoding output or film-level original image file (RAW) data output, and integrates high-performance image signal processing (Image Signal Processing, ISP), and the main chip can also receive external data. This application can use the H265 encoding / decoding module, ARM and DSP modules to complete the encoding of the encoding method not supported in the Video Subsystem, such as SVAC encoding or AVS encoding. The main chip can also integrate an intelligent sensor hub (Sensor hub). The various parts on the main chip can communicate through the on-chip network bus.
[0041] Step 103: Based on the second mode selection information, re-encode the image to be encoded of the video source to obtain a target bit stream.
[0042] In the embodiment of the present application, when the electronic device parses the encoding mode of the video source and obtains the first mode selection information under the first encoding format, it can quickly determine the second mode selection information that has a mapping relationship with the first mode selection information, and then re-encode the image to be encoded of the video source based on the second mode selection information to obtain the target code stream. In this way, when facing different application scenarios and / or different user needs, the electronic device has the ability to generate code streams in other encoding formats. For example, the aforementioned electronic device that originally supports the H265 encoding format can support AVS, SVAC and other encoding formats based on the encoding method provided by the present application, and realize a specific video encoding function. It can be seen that the encoding method provided by the present application can enable the camera already in use to support new encoding types through software upgrades without consuming hardware resources.
[0043] In other words, the encoding method provided in this application utilizes the existing encoding and decoding capabilities in the chip and the software resources of the chip to provide feasibility for the device to support new encoding formats while ensuring real-time performance. Users only need to upgrade the software package used by the current device to enable the device in their hands to have the ability of the new encoding format. The encoding method provided in this application focuses on video communication, video surveillance, video review, video distribution, and extended reality (Extended Reality, XR) technology value-added services, operations and ecology. Support a low-cost way to enable cameras to support new encoding formats.
[0044] The present application provides an encoding method, which obtains a video source and parses the encoding mode of the video source to obtain first mode selection information under a first encoding format; determines second mode selection information having a mapping relationship with the first mode selection information; based on the second mode selection information, re-encodes the image to be encoded of the video source to obtain a target bit stream; solves the problem in the related art that different video encoding coprocessors need to be equipped to achieve encoding of different encoding formats, resulting in the need to spend additional hardware resources and costs on the basis of a main chip. The present application supports video encoding of different formats by optimizing a series of encoding strategies without replacing the chip or adding a coprocessor.
[0045] In some embodiments of the present application, the first mode selection information includes intra / inter prediction mode and block partitioning information.
[0046] In some embodiments of the present application, step 102 of determining the second mode selection information having a mapping relationship with the first mode selection information may be implemented by the following steps:
[0047] Get the mode selection information mapping table;
[0048] The second mode selection information having a mapping relationship with the first mode selection information is searched from the mode selection information mapping table.
[0049] In the embodiment of the present application, a mode selection information mapping table can be derived / obtained based on texture information and / or motion information, so that the second mode selection information having a mapping relationship with the first mode selection information can be quickly determined by looking up the table.
[0050] In some embodiments of the present application, step 103 re-encodes the to-be-encoded image of the video source based on the second mode selection information to obtain a target bitstream, which can be implemented by the following steps:
[0051] Based on the second mode selection information, a coding tree unit line of a to-be-encoded image is used as a coding unit, and each module is controlled in parallel according to a parallel timing diagram to re-encode the to-be-encoded image of the video source to obtain a target bitstream.
[0052] The parallel timing diagram includes the following timing relationship: the transform / quantization module lags behind the mode mapping module by one coding tree unit row, the entropy coding module lags behind the transform / quantization module by one coding tree unit row, and the filter module lags behind the entropy coding module by one coding tree unit row. In other words, the present application can improve the coding efficiency through the parallelization between different software modules, so that the coding efficiency can meet the real-time requirements.
[0053] In some embodiments, the first mode selection information includes mode selection information corresponding to high-efficiency video coding, and the second mode selection information includes mode selection information corresponding to security and monitoring digital audio and video codec.
[0054] In a feasible coding scenario, Figure 3 Taking the example of using the existing H265 encoding and decoding capabilities and ARM+DSP resources on the main chip to support SVAC encoding, the encoding method of the present application is further explained. Figure 4 As shown, the module flow chart for encoding the video source input into the SVAC code stream is as follows:
[0055] Mode selection: Mode selection refers to selecting the best coding block division method and prediction mode for the current coding unit. The traditional mode selection process often includes intra-frame mode selection and inter-frame mode selection. Intra-frame mode selection needs to traverse different division methods of the current coding unit, and select an optimal intra-frame prediction mode under each division method. The comparison and selection between modes needs to be determined by the rate-distortion optimization (RDO) cost. The RDO process of each mode needs to be completed through prediction, transformation / quantization, and entropy coding. Inter-frame mode selection is similar to intra-frame, so the mode selection process is very complicated and is the most time-consuming module in the encoding process.
[0056] In the embodiment of the present application, the similarity of each module in different encoding types is fully utilized, and the Figure 4 As shown in the dotted box of the mode selection stage, the coding mode (intra-frame / inter-frame prediction mode + block division information) in the H265 code stream is parsed, for example, the HEVC code stream is decoded to obtain the adopted mode information, and then the mode mapping is performed to derive the mode information used in SVAC, which is used as the result of the mode selection to directly perform subsequent transform quantization and other processes. The mode mapping table used in the mode mapping process is derived by comparing and calculating the two coding mode algorithms; the derivation process involves the analysis and comparison of the intra-frame / inter-frame prediction mode + block division information.
[0057] Taking the mapping of some prediction modes of inter-frame blocks and the prediction block division method as an example, the mode mapping can be performed with reference to the following mode selection information mapping table.
[0058]
[0059] Mode selection information mapping table
[0060] Combined with the above-mentioned mode selection information mapping table, by parsing the coding mode in the H265 code stream, and obtaining the prediction mode + prediction block division information of HEVC intra-frame / inter-frame, the prediction mode + prediction block division information of SVAC2 can be determined through the mode selection information mapping table. Among them, AMVP refers to advanced motion vector prediction technology (Advanced Motion Vector Predictor), MVD refers to vector difference, Merge refers to motion information fusion technology, MV = MVP (prediction vector) + MVD (vector difference). Here, the specific mode and block division content are shown in the above table, which will not be repeated here.
[0061] Transformation and quantization: Video signals contain DC and low-frequency components that account for most of the energy, i.e., the flat part of the image, and a small amount of high-frequency components, i.e., the details of the image. Therefore, the video can be encoded in the frequency domain to achieve the purpose of compression. In addition, quantization technology can further reduce the bit rate and achieve a balance between bit rate and distortion according to application requirements.
[0062] Entropy coding: Entropy is a quantity that represents the degree of disorder of a system. In information theory, the entropy of a system also represents the amount of information it contains. To put it more precisely, it is the average number of bits of information contained in all symbols of the system. In video coding, redundancy should be reduced as much as possible to make it close to entropy itself, that is, using less code to express more information. Entropy coding is an algorithm that uses the probability model of the video in data compression to minimize the entropy of the compression result.
[0063] Filtering: After prediction, quantization, encoding, etc., certain distortion is also introduced. In order to solve this problem, a loop filtering module is added. The loop filtering is placed after the inverse quantization and inverse transformation modules and before the reconstruction of the motion compensation reference frame.
[0064] Software Encoding Data Parallel Process:
[0065] In the embodiment of the present application, during the video image encoding process, the image is divided into coding units for encoding. Figure 5 and Figure 6 As shown, the software part responsible for the encoding module includes 4 cores (core 1, core 2, core 3 and core 4), exemplarily, they can be two ARM cores and two DSP cores. In order to enable the four cores to operate simultaneously, considering that the encoding process is based on the coding unit, and each module has data dependency on its previous module, a parallel solution based on a coding tree unit (CodingTreeUnit, CTU) behavior unit is adopted. Figure 5 The following is a schematic diagram of the division of coding units in a frame of image. The parallel timing diagram of each module in the software implementation part is as follows: Figure 6 As shown below, the transform / quantization module lags behind the mode mapping module by one CTU row, the entropy coding module lags behind the transform / quantization module by one CTU row, and similarly, the filter module lags behind the entropy coding module by one CTU row. In this way, it can be ensured that valid dependency data can be obtained during the execution of each module of each CTU.
[0066] In an embodiment of the present application, the derivation / obtaining of the mode selection information mapping table can be carried out with the help of texture information and / or motion information. For example, in intra-frame prediction, the texture information of the corresponding coding unit in the original image is inferred through the High Efficiency Video Coding (HEVC) mode, and based on such texture information, the intra-frame prediction mode used in SVAC2 can be derived; in inter-frame prediction, the motion information of the corresponding coding unit in the original image is inferred through the HEVC mode, and based on such motion information, the inter-frame prediction mode used in SVAC2 can be derived.
[0067] Taking intra mode as an example, mode 19 in HEVC, the image texture information is as follows Figure 7 As shown, it can be deduced that the final mapping is mode 21 in SVAC2. For the intra-frame prediction mode of HEVC, see Figure 8In HEVC, the luminance component has 35 intra-frame prediction modes, including Planar mode, DC mode, and 33 angle modes. The chrominance component has 5 intra-frame prediction modes, including Planar mode, DC mode, horizontal direction mode, vertical direction mode, and intra-frame prediction mode corresponding to the luminance component. In special cases, to avoid signal redundancy, when the intra-frame prediction mode corresponding to the luminance component is one of the four modes of horizontal, vertical, Planar and DC, the corresponding luminance prediction mode is replaced by angle mode 34. Figure 8 The directions and mode numbers of various angle modes are given. Planar mode is numbered 0, DC mode is numbered 1, and the other 33 angle modes are numbered 2 to 34. Among the angle modes, the angles of modes 2 to 17 are approximately horizontal, called horizontal mode; the angles of modes 18 to 34 are approximately vertical, called vertical mode. For CUs using intra-frame prediction mode, TUs are not allowed to cross PU boundaries because PUs use adjacent reconstructed pixels when predicting. Although the intra-frame prediction mode is defined based on PUs, the actual prediction process is completed on each TU separately.
[0068] For intra prediction modes of SVAC2, see Fig. 9 The main technical features of the SVAC 2.0 standard include: support for high-precision video data encoding, support for diversified intra-frame and inter-frame prediction, transform quantization, binary arithmetic coding and other technologies, support for region of interest (ROI) variable quality coding, Scalable Video Coding (SVC) technology, support for dual-core audio coding switching between Algebraic-code-excitation-linear-prediction (ACELP) and Transform audio coding (TAC), support for encoding of sound recognition feature parameters, support for monitoring-specific information such as absolute time reference information and intelligent analysis information, support for data security protection, support for video data encryption and authentication functions. The image space segmentation of SVAC 2.0 no longer supports multiple strips, but supports the division of coding slices (Tile). An image can be divided into several Tile areas in the horizontal and vertical directions. Based on this, SVAC 2.0 adds parallel computing support, and multiple tiles are encoded simultaneously, which speeds up the encoding speed. The size of the basic operation unit of SVAC2.0 is increased from 16X16 to 128X128, and can be further divided into prediction units (PUs) and transform units (TUs). The division method is determined by the coding tree. The intra-frame prediction mode is increased from 5 in SVAC 1.0 to 37, such as Fig. 9Refine the prediction direction to better adapt to the textures in different directions of the video content and make the prediction more accurate.
[0069] From the above content, it can be seen that the present application is aimed at cameras that do not have the second encoding format, also known as certain encoding capabilities (such as SVAC encoding), and utilizes the existing other types of hardware video encoding capabilities of its internal chip, that is, the ability to support the first encoding format (such as H265 codec), and the ARM+DSP resources in the chip. Without replacing the chip or adding a coprocessor, through the optimization of a series of encoding strategies, only using existing software resources, the current camera can complete the SVAC encoding function by upgrading the software package, and the encoding efficiency can be achieved in real time.
[0070] By comparison, it can be seen that in the related technology, coprocessors are used to implement different encoding types. The essence of coprocessors is still hardware resources such as FPGA circuits or chips, which requires increasing resource overhead; and for devices that users are already using, it is not possible to simply add coprocessors to support more encoding types.
[0071] The present application has at least the following beneficial effects: the ARM+DSP software capabilities in the chip can be utilized to process different modules separately, thereby realizing real-time SVAC encoding without consuming expensive hardware resources; the software package is convenient for updating and upgrading, especially for devices already in use, support for new encoding types can be achieved by upgrading the software, thereby reducing the upgrade cost of existing devices.
[0072] The embodiment of the present application provides a coding device, which can be applied to Figure 1 In a coding method provided in a corresponding embodiment, referring to Fig.10 As shown, the encoding device 300 includes:
[0073] An acquisition module 301 is used to acquire a video source;
[0074] The parsing unit 302 is used to parse the encoding mode of the video source to obtain first mode selection information in a first encoding format;
[0075] The processing unit 303 is used to determine the second mode selection information having a mapping relationship with the first mode selection information;
[0076] The encoding unit 304 is used to re-encode the to-be-encoded image of the video source based on the second mode selection information to obtain a target bitstream.
[0077] In some embodiments of the present application, the first mode selection information includes intra / inter prediction mode and block partitioning information.
[0078] In some embodiments of the present application, the acquisition module 301 is used to acquire a mode selection information mapping table;
[0079] The processing unit 303 is configured to search the mode selection information mapping table for second mode selection information that has a mapping relationship with the first mode selection information.
[0080] In some embodiments of the present application, the encoding unit 304 is used to select information based on the second mode, take the encoding tree unit behavior of the image to be encoded as the encoding unit, and control each module in parallel to re-encode the image to be encoded of the video source according to the parallel timing diagram to obtain the target code stream.
[0081] In some embodiments of the present application, the parallel timing diagram includes the following timing relationship: the transform / quantization module lags behind the mode mapping module by one coding tree unit row, the entropy coding module lags behind the transform / quantization module by one coding tree unit row, and the filtering module lags behind the entropy coding module by one coding tree unit row.
[0082] In some embodiments of the present application, the first mode selection information includes mode selection information corresponding to high-efficiency video coding, and the second mode selection information includes mode selection information corresponding to security and monitoring digital audio and video coding and decoding.
[0083] The present application provides an encoding device, which obtains a video source and parses the encoding mode of the video source to obtain first mode selection information under a first encoding format; determines second mode selection information having a mapping relationship with the first mode selection information; and re-encodes the image to be encoded of the video source based on the second mode selection information to obtain a target bit stream; solves the problem in the related art that different video encoding coprocessors need to be equipped to achieve encoding of different encoding formats, resulting in the need to spend additional hardware resources and costs on the basis of the main chip. The present application supports video encoding of different formats by optimizing a series of encoding strategies without replacing the chip or adding a coprocessor.
[0084] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.
[0085] The embodiment of the present application provides an electronic device, which can be applied to Figure 1 In a coding method provided in a corresponding embodiment, referring to Fig.11 As shown, the electronic device 400 includes: a processor 401, a memory 402 and a communication bus 403, wherein: the communication bus 403 is used to realize the communication connection between the processor 401 and the memory 402;
[0086] The processor 401 is used to execute the coding program stored in the memory 402 to implement the following steps:
[0087] Acquire a video source, and parse the encoding mode of the video source to obtain first mode selection information under a first encoding format;
[0088] Determine second mode selection information having a mapping relationship with the first mode selection information;
[0089] Based on the second mode selection information, the to-be-encoded image of the video source is re-encoded to obtain a target bitstream.
[0090] In some embodiments of the present application, the first mode selection information includes intra / inter prediction mode and block partitioning information.
[0091] In some embodiments of the present application, the processor 401 is used to execute the coding program stored in the memory 402 to implement the following steps:
[0092] Get the mode selection information mapping table;
[0093] The second mode selection information having a mapping relationship with the first mode selection information is searched from the mode selection information mapping table.
[0094] In some embodiments of the present application, the processor 401 is used to execute the coding program stored in the memory 402 to implement the following steps:
[0095] Based on the second mode selection information, a coding tree unit line of a to-be-encoded image is used as a coding unit, and each module is controlled in parallel according to a parallel timing diagram to re-encode the to-be-encoded image of the video source to obtain a target bitstream.
[0096] In some embodiments of the present application, the parallel timing diagram includes the following timing relationship: the transform / quantization module lags behind the mode mapping module by one coding tree unit row, the entropy coding module lags behind the transform / quantization module by one coding tree unit row, and the filtering module lags behind the entropy coding module by one coding tree unit row.
[0097] In some embodiments of the present application, the first mode selection information includes mode selection information corresponding to high-efficiency video coding, and the second mode selection information includes mode selection information corresponding to security and monitoring digital audio and video coding and decoding.
[0098] The present application provides an electronic device, which obtains a video source and parses the encoding mode of the video source to obtain first mode selection information under a first encoding format; determines second mode selection information having a mapping relationship with the first mode selection information; and re-encodes the image to be encoded of the video source based on the second mode selection information to obtain a target code stream; solves the problem in the related art that different video encoding coprocessors need to be equipped to achieve encoding of different encoding formats, resulting in the need to spend additional hardware resources and costs on the basis of the main chip. The present application supports video encoding of different formats by optimizing a series of encoding strategies without replacing the chip or adding a coprocessor.
[0099] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.
[0100] An embodiment of the present application provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the following steps:
[0101] Acquire a video source, and parse the encoding mode of the video source to obtain first mode selection information under a first encoding format;
[0102] Determine second mode selection information having a mapping relationship with the first mode selection information;
[0103] Based on the second mode selection information, the to-be-encoded image of the video source is re-encoded to obtain a target bitstream.
[0104] In some embodiments of the present application, the first mode selection information includes intra / inter prediction mode and block partitioning information.
[0105] In some embodiments of the present application, the one or more programs may be executed by one or more processors to implement the following steps:
[0106] Get the mode selection information mapping table;
[0107] The second mode selection information having a mapping relationship with the first mode selection information is searched from the mode selection information mapping table.
[0108] In some embodiments of the present application, the one or more programs may be executed by one or more processors to implement the following steps:
[0109] Based on the second mode selection information, a coding tree unit line of a to-be-encoded image is used as a coding unit, and each module is controlled in parallel according to a parallel timing diagram to re-encode the to-be-encoded image of the video source to obtain a target bitstream.
[0110] In some embodiments of the present application, the parallel timing diagram includes the following timing relationship: the transform / quantization module lags behind the mode mapping module by one coding tree unit row, the entropy coding module lags behind the transform / quantization module by one coding tree unit row, and the filtering module lags behind the entropy coding module by one coding tree unit row.
[0111] In some embodiments of the present application, the first mode selection information includes mode selection information corresponding to high-efficiency video coding, and the second mode selection information includes mode selection information corresponding to security and monitoring digital audio and video coding and decoding.
[0112] The present application provides a storage medium, which obtains a video source and parses the encoding mode of the video source to obtain first mode selection information under a first encoding format; determines second mode selection information having a mapping relationship with the first mode selection information; and re-encodes the image to be encoded of the video source based on the second mode selection information to obtain a target code stream; solves the problem in the related art that different video encoding coprocessors need to be equipped to achieve encoding of different encoding formats, resulting in the need to spend additional hardware resources and costs on the basis of the main chip. The present application supports video encoding of different formats by optimizing a series of encoding strategies without replacing the chip or adding a coprocessor.
[0113] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.
[0114] The processor may be any conventional processor, such as a commercially available central processing unit (CPU). The processor may be a dedicated device such as an application specific integrated circuit (ASIC) or other hardware based processor. Fig.11 The processor and memory are functionally illustrated, but it should be understood by those skilled in the art that the processor or memory may actually include multiple processors or memories that may be stored in the same physical housing, or multiple processors or memories that may not be stored in the same physical housing. For example, the memory may be a hard drive or other storage medium located in a housing different from the computer system. Therefore, references to processors or computers will be understood to include references to a collection of processors or computers or memories that may or may not operate in parallel. Different from using a single processor to perform the steps described herein.
[0115] The processor can also be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any of the above conventional processors.
[0116] It should be noted that the above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM) and other memories; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0117] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0118] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.
[0119] In addition, all functional units in the embodiments of the present application can be integrated into one processing module, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units. A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memory (ROM), random access memory (RAM), disks or optical disks, and other media that can store program codes.
[0120] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0121] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0122] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0123] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A coding method, characterized in that: The method comprises: Acquire a video source, and parse the encoding mode of the video source to obtain first mode selection information under a first encoding format; Determine second mode selection information having a mapping relationship with the first mode selection information; Based on the second mode selection information, the to-be-encoded image of the video source is re-encoded to obtain a target bitstream.
2. The method according to claim 1, characterized in that: The first mode selection information includes intra / inter prediction mode and block partitioning information.
3. The method according to claim 1 or 2, characterized in that: The determining the second mode selection information having a mapping relationship with the first mode selection information includes: Get the mode selection information mapping table; The second mode selection information having a mapping relationship with the first mode selection information is searched from the mode selection information mapping table.
4. The method according to claim 1, characterized in that: The step of re-encoding the to-be-encoded image of the video source based on the second mode selection information to obtain a target bitstream includes: Based on the second mode selection information, a coding tree unit line of a to-be-encoded image is used as a coding unit, and each module is controlled in parallel according to a parallel timing diagram to re-encode the to-be-encoded image of the video source to obtain the target code stream.
5. The method according to claim 4, characterized in that The parallel timing diagram includes the following timing relationship: the transform / quantization module lags behind the mode mapping module by one coding tree unit row, the entropy coding module lags behind the transform / quantization module by one coding tree unit row, and the filtering module lags behind the entropy coding module by one coding tree unit row.
6. The method according to any one of claims 1 to 5, characterized in that The first mode selection information includes mode selection information corresponding to high-efficiency video coding, and the second mode selection information includes mode selection information corresponding to security and monitoring digital audio and video coding and decoding.
7. A coding device, characterized in that: include: An acquisition module is used to acquire video sources; A parsing unit, configured to parse the encoding mode of the video source to obtain first mode selection information in a first encoding format; a processing unit, configured to determine second mode selection information having a mapping relationship with the first mode selection information; The encoding unit is used to re-encode the to-be-encoded image of the video source based on the second mode selection information to obtain a target code stream.
8. The encoding device according to claim 7, characterized in that The processing unit is configured to obtain a mode selection information mapping table; and search the mode selection information mapping table for second mode selection information corresponding to the first mode selection information.
9. An electronic device, characterized in that: include: A processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program stored in the memory to execute the method according to any one of claims 1 to 6.
10. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the encoding method according to any one of claims 1 to 6.
Citation Information
Cited By
Video transcoding method and device, equipment and storage medium
CN121099058A
A video transcoding method, device, apparatus and storage medium
CN121099058B
