Encoding method, apparatus, device, and storage medium
Patent Information
- Application Number
- CN202310389239.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-03
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2043-04-03
AI Technical Summary
[0004]然而,每一路编码器独立编码,均采用上述全遍历的块划分方式编码,块划分过程的计算复杂度较高,需要较多的计算资源和较长的编码时间,编码效率较低
[0017] In summary, in this embodiment, by obtaining a first video obtained after encoding the target video, and the first encoding information and first resolution of the first video, and based on the first video, the second resolution to be used for encoding, the first resolution, and the first encoding information, second encoding information for encoding the target video is determined, wherein the second resolution is less than the first resolution. Based on the second encoding information, the target video is encoded to obtain a second video with the second resolution. Therefore, by utilizing the block partitioning process included in the first encoding information, the block partitioning process of similar encoding information in the second encoding information can be reduced, thereby reducing the computational complexity of the block partitioning process for low-resolution bitstream encoding in the multi-resolution transcoding system, thus reducing low-resolution bitstream encoding time and computational resources, and improving encoding efficiency.
Smart Images

Figure CN116405675B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video coding technology, and in particular to a coding method, apparatus, device and storage medium. Background Technology
[0002] Currently, to adapt to varying network bandwidths, it is often necessary to transcode the same video content according to business requirements, outputting video files of different formats, qualities, and resolutions. Specifically, this involves inputting the same video content, using a multi-channel encoder to encode the video content separately at different resolutions, and outputting multi-channel encoded video files.
[0003] The current mainstream coding standard H.265 uses a block-based coding framework. The encoder performs post-prediction, transform, quantization, and entropy coding on a per-coding-unit (CU) basis. For an image region, different block partitions often lead to different rate-distortion performance. To obtain the best rate-distortion performance, each encoder typically performs a full traversal of all possible block partitions and selects the block partition with the best rate-distortion performance for encoding.
[0004] However, each encoder encodes independently, using the aforementioned full-traversal block partitioning method. The block partitioning process has high computational complexity, requires more computing resources and longer encoding time, resulting in low encoding efficiency. Summary of the Invention
[0005] This application provides an encoding method, apparatus, device, and storage medium that can reduce encoding time and computing resources for low-resolution bitstreams and improve encoding efficiency.
[0006] Firstly, an encoding method is provided, including:
[0007] The first video, the first encoding information of the first video, and the first resolution of the first video are obtained. The first video is obtained by encoding the target video. The first encoding information includes the first block division information of each image frame of the target video. The first block division information includes the encoding unit (CU) obtained by dividing the image frame and the division depth information of each CU.
[0008] Based on the first video, the second resolution to be used for encoding, the first resolution, and the first encoding information, determine the second encoding information for encoding the target video, wherein the second resolution is smaller than the first resolution;
[0009] The target video is encoded according to the second encoding information to obtain a second video with the second resolution.
[0010] Secondly, an encoding device is provided, comprising:
[0011] The acquisition module is used to acquire a first video, first encoding information of the first video, and first resolution of the first video. The first video is obtained by encoding a target video. The first encoding information includes first block partitioning information of each image frame of the target video. The first block partitioning information includes encoding units (CUs) obtained by dividing the image frame and partitioning depth information of each CU.
[0012] The determining module is configured to determine, based on the first video, the second resolution to be used for encoding, the first resolution, and the first encoding information, the second encoding information for encoding the target video, wherein the second resolution is smaller than the first resolution;
[0013] The encoding module is used to encode the target video according to the second encoding information to obtain a second video with the second resolution.
[0014] Thirdly, an encoding device is provided, comprising: a processor and a memory for storing a computer program, the processor for calling and running the computer program stored in the memory to perform the method as described in the first aspect or its various embodiments.
[0015] Fourthly, a computer-readable storage medium is provided for storing a computer program that causes a computer to perform the methods as described in the first aspect or in various embodiments thereof.
[0016] Fifthly, a computer program product is provided, including computer program instructions that cause a computer to perform the methods as described in the first aspect or in various embodiments thereof.
[0017] In summary, in this embodiment, by obtaining a first video obtained after encoding the target video, and the first encoding information and first resolution of the first video, and based on the first video, the second resolution to be used for encoding, the first resolution, and the first encoding information, second encoding information for encoding the target video is determined, wherein the second resolution is less than the first resolution. Based on the second encoding information, the target video is encoded to obtain a second video with the second resolution. Therefore, by utilizing the block partitioning process included in the first encoding information, the block partitioning process of similar encoding information in the second encoding information can be reduced, thereby reducing the computational complexity of the block partitioning process for low-resolution bitstream encoding in the multi-resolution transcoding system, thus reducing low-resolution bitstream encoding time and computational resources, and improving encoding efficiency. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of a video image processing process provided in an embodiment of this application;
[0020] Figure 2 This is a schematic diagram of a video image processing process provided in an embodiment of this application;
[0021] Figure 3 This is a schematic diagram illustrating an application scenario of an encoding method provided in an embodiment of this application;
[0022] Figure 4 This is a schematic diagram of the structure of a multi-resolution transcoding system provided in an embodiment of this application;
[0023] Figure 5 A flowchart illustrating an encoding method provided in an embodiment of this application;
[0024] Figure 6a A schematic diagram of a 64x64CU partition provided for an embodiment of this application;
[0025] Figure 6b The 64x64CU shown covers a total of 16x16 4x4 depth storage cells;
[0026] Figure 7 This application provides a schematic diagram of a CU to be encoded being mapped to a first image frame.
[0027] Figure 8 A schematic diagram illustrating the position of a mapping region in a first image frame, as provided in this application;
[0028] Figure 9 This is a schematic diagram of the structure of a multi-resolution transcoding system provided in an embodiment of this application;
[0029] Figure 10 A schematic diagram illustrating the block partitioning process of a CU to be encoded for an image frame, provided in an embodiment of this application;
[0030] Figure 11 This is a schematic diagram of the structure of an encoding device provided in an embodiment of this application;
[0031] Figure 12 This is a schematic block diagram of the encoding device provided in the embodiments of this application. Detailed Implementation
[0032] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0034] Before introducing the technical solutions of the embodiments of this application, the relevant knowledge of the embodiments of this application will be introduced below:
[0035] 1. Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Cloud technology is a collective term for network technologies, information technologies, integration technologies, management platform technologies, and application technologies applied to cloud computing business models. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can only be achieved through cloud computing.
[0036] 2. Video encoding is a method of converting a file in an original video format into a file in another video format through compression technology. The converted data can be called a bitstream.
[0037] 3. H.265, also known as HEVC, is a current mainstream encoding standard that specifies the syntax and decoding process of HEVC bitstreams.
[0038] 4. Coding Unit (CU): The basic coding block in H.265.
[0039] 5. A Coding Tree Unit (CTU) consists of one or more Coding Units (CUs). A frame of image is first divided into a series of CTUs of equal size, and each CTU then determines its own CU division.
[0040] 6. Resolution is a parameter that measures the amount of data within a bitmap image. It is usually expressed as pixels per inch (ppi) and dots per inch (dpi). The more data contained, the larger the image file size, and the richer the details it can display. However, larger files require more computer resources, more memory, and more hard drive space.
[0041] In related technologies, each encoder encodes independently, using a full-traversal block partitioning method. The block partitioning process has high computational complexity, requires more computing resources and longer encoding time, resulting in low encoding efficiency.
[0042] To address this technical problem, in this embodiment, the similarity of video content at different resolutions is utilized. Specifically, the block division of identical image frames during the encoding of the target video into different resolution bitstreams is similar. Based on the already encoded high-resolution bitstream, the first encoding information of the high-resolution bitstream, and the low-resolution bitstream to be encoded, the second encoding information for low-resolution encoding of the target video is determined. Therefore, by utilizing the block division process included in the first encoding information based on both low and high resolution, the block division process of similar encoding information in the second encoding information can be reduced. This reduces the computational complexity of the block division process for low-resolution bitstream encoding in the multi-resolution transcoding system, thereby reducing low-resolution bitstream encoding time and computational resources, and improving encoding efficiency.
[0043] The technical solutions provided in this application can be applied to video-on-demand and live video streaming scenarios. Video-on-demand services with high transcoding loads require low encoding complexity, while for low-latency live video streaming services, high encoding complexity directly reduces the user's experience. The technical solutions in this application can reduce encoding complexity and improve encoder efficiency.
[0044] For video-on-demand (VOD) services, it is necessary to transcode the same source video at different resolutions to provide users with a choice. Specifically, in VOD services, it is often necessary to transcode the original video footage (i.e., the source video) provided by the content manufacturer according to business needs, outputting video streams of different formats, qualities, and resolutions. The following describes specific application scenarios of the technical solutions provided in the embodiments of this application.
[0045] It should be understood that the technical solutions of the embodiments of this application can be applied to the following scenarios, but are not limited to:
[0046] Currently, the video or image processing process in some video-on-demand business scenarios can be as follows: Figure 1 This is a schematic diagram of a video image processing process provided in an embodiment of this application. Figure 2 This is a schematic diagram of a video image processing process provided in an embodiment of this application. Figure 1 As shown, the cloud server acquires the target video, processes it, encodes it to obtain multiple bitstreams of different formats, qualities, and resolutions, and then sends these bitstreams to the terminal device. The terminal device selects the bitstream with the required resolution, decodes it, and finally displays the video image based on the decoding result.
[0047] Or, such as Figure 2 As shown, the target video is acquired, processed, and encoded to obtain multiple bitstreams with different formats, qualities, and resolutions. The cloud server can then send these bitstreams to the terminal device, which selects the bitstream with the desired resolution, decodes it, and processes the decoded video image, such as sharpening, blurring, and noise reduction. Finally, the processed video image is displayed.
[0048] For example, Figure 3 This is a schematic diagram illustrating an application scenario of an encoding method provided in an embodiment of this application, such as... Figure 3 As shown, terminal device 110 can communicate with server 120. Server 120 can be any independent physical server, or a cloud server providing basic cloud services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, and big data and artificial intelligence platforms. It can also be a server cluster or distributed system composed of multiple physical servers. This application embodiment does not limit this. Server 120 may include an encoding module for image encoding. The encoding module may include hardware devices / software code for compressing analog audio and video signals into encoded data (encoded files).
[0049] Terminal device 110 may be a device with basic streaming media playback capabilities, human-computer interaction capabilities, and communication capabilities, such as a smartphone, tablet, desktop computer, and smart TV. Terminal device 110 may have a game client installed and running, which may be an application running on terminal device 110. Alternatively, terminal device 110 may have an instant messaging client installed and running, or a client supporting audio and video conferencing. Terminal device 110 may include a decoding module for image decoding, which may include hardware devices / software code for converting encoded data (or encoded files) into analog audio and video signals.
[0050] In video-on-demand scenarios, a cloud server refers to a server running in the cloud that possesses functions such as video enhancement (pre-encoding processing) and video encoding, but is not limited to these. A terminal device refers to a type of device that has rich human-computer interaction methods, internet access capabilities, typically runs various operating systems, and possesses strong processing capabilities. Terminal devices can be smartphones, living room TVs, tablets, in-vehicle terminals, and game consoles such as handheld game consoles, but are not limited to these.
[0051] In some possible implementations Figure 3 The application scenarios shown can also include: base stations, core network side equipment, etc., in addition, Figure 3 An exemplary terminal device and a server are shown, but in practice, other numbers of terminal devices and servers may be included, and this application does not limit this.
[0052] For example, Figure 4 A schematic diagram of a multi-resolution transcoding system provided in this application embodiment is shown below. Figure 4 As shown, the system includes four encoders: a first encoder 1, a second encoder 2, a third encoder 3, and a fourth encoder 4. These four encoders encode the same target video at different resolutions. Given the same target video as input, the four encoders encode the target video at different resolutions, outputting four encoded bitstreams, each with a different resolution. The first encoder 1 has a higher resolution than the other three encoders. In an optional implementation, during encoding, the first encoder 1 first encodes the target video at a first resolution to obtain a first bitstream. When encoding the target video, the second encoder 2, third encoder 3, and fourth encoder 4 refer to the first bitstream and its first encoding information. The first encoding information includes the CUs (Complex Units) obtained by dividing the image frames and the division depth information of each CU, respectively, and outputs a second bitstream, a third bitstream, and a fourth bitstream. Specifically, the second encoder 2, third encoder 3, and fourth encoder 4 can use the encoding method provided in the embodiments of this application when encoding the target video.
[0053] Optionally, in one embodiment, the multi-resolution transcoding system provided in this application may further include an encoder, which encodes the input target video according to different resolutions and outputs multiple encoded bitstreams, each bitstream having a different resolution. Specifically, the encoder may first encode the target video according to the highest preset resolution to obtain a first bitstream. Then, when encoding according to the remaining preset resolutions, the encoder may refer to the first bitstream and the first encoding information of the first bitstream. The first encoding information includes the CUs obtained by dividing the image frame and the division depth information of each CU. Specifically, the encoding method provided in this application may be used.
[0054] The technical solutions of the embodiments of this application will be described in detail below:
[0055] Figure 5 A flowchart illustrating an encoding method provided in this application embodiment. This method can be executed by an encoder, for example, by... Figure 4 The second, third, or fourth encoder shown is used, but is not limited to, as shown in the example. Figure 5 As shown, the method includes the following steps:
[0056] S101. Obtain the first video, the first encoding information of the first video, and the first resolution of the first video. The first video is obtained by encoding the target video. The first encoding information includes the first block division information of each image frame of the target video. The first block division information includes the CU obtained by dividing the image frame and the division depth information of each CU.
[0057] Specifically, the method in this embodiment is applied to a multi-resolution transcoding system. After receiving a target video, the system encodes the target video into multiple videos of different resolutions according to multiple preset resolutions. After encoding the target video according to a first resolution to obtain a first video, when encoding the target video according to a second resolution to obtain a second video (since the second resolution is smaller than the first resolution), the system first acquires the first video, the first encoding information of the first video, and the first resolution of the first video, and then executes steps S102-S103 to encode the target video to obtain the second video. It can be understood that if there are more than two preset resolutions, the same method is used when encoding the target video according to a third resolution to obtain a third video.
[0058] The first encoded information includes the first block partitioning information for each image frame of the target video. For example, if the target video includes 50 image frames, the first encoded information includes the first block partitioning information for each of the 50 image frames. For each image frame, the first block partitioning information includes the CUs (Combined Units) obtained by partitioning the image frame and the partitioning depth information for each CU. The partitioning depth information for a CU includes the partitioning depth and partitioning size. The partitioning depth is used to characterize the number of partitions, and the partitioning size is the size of the CU. For example, the partitioning depth of a 64x64 CU is 0, and the partitioning size is 64x64. Then, the partitioning depth of a 32x32 CU is 1, and the partitioning size is 32x32; the partitioning depth of a 16x16 CU is 2; and the partitioning depth of an 8x8 CU is 3. An image frame is partitioned into at least one CU.
[0059] Optionally, if the multi-resolution transcoding system includes multiple encoders, for example, if the execution subject in this application embodiment is the second encoder, and the first encoder has encoded the target video according to the first resolution to obtain the first video, then in S101, obtaining the first video, the first encoding information of the first video, and the first resolution of the first video can be achieved by the second encoder receiving the first video, the first encoding information of the first video, and the first resolution of the first video sent by the first encoder.
[0060] Optionally, during the process of encoding the target video according to the first resolution to obtain the first video, the first encoder may use a depth storage unit of a preset size to store the first encoded information. Optionally, the location for storing the first encoded information may be memory or external storage; this embodiment of the application does not impose any limitations on this.
[0061] In one embodiment, this application uses a 4x4 depth storage unit to store the first encoding information. Taking an image frame as an example, a 4x4 depth storage unit is used to store the CUs obtained by dividing the image frame and the division depth information of each CU. Since the minimum CU size supported by H.265 is 8x8, all CUs can be divided into several 4x4 blocks. Figure 6a A schematic diagram of a 64x64CU partition provided for an embodiment of this application, as shown below. Figure 6a As shown, the partitioning result of the 64x64CU consists of 32x32 CU, 16x16 CU and 8x8 CU, with partitioning depths of 1, 2 and 3 corresponding to 3x32 CU, 16x16 CU and 8x8 CU respectively. Figure 6b for Figure 6a The diagram shows the storage format of the partitioning results, as follows: Figure 6b As shown, Figure 6b The 64x64CU shown covers a total of 16x16 4x4 depth storage cells, and the partition depth of each depth storage cell is as follows: Figure 6b As shown. (Through) Figure 6b The storage format shown is based on Figure 6b The partition depth stored in each depth storage unit shown indicates the partitioning result of the entire 64x64CU.
[0062] S102. Based on the first video, the second resolution to be encoded, the first resolution, and the first encoding information, determine the second encoding information for encoding the target video, wherein the second resolution is smaller than the first resolution.
[0063] Specifically, having obtained the first video, first resolution, and first encoding information, when encoding the target video at the second resolution, the second encoding information for encoding the target video can be determined based on the first video, the second resolution to be used for encoding, the first resolution, and the first encoding information. Since the second resolution is lower than the first resolution, the encoding information of the already encoded high-resolution first video can be used as a reference when encoding the target video at a lower resolution.
[0064] The following illustrates a specific implementation method for determining the second encoding information for encoding a target video based on a first video, a second resolution to be encoded, the first resolution, and the first encoding information.
[0065] Specifically, in one implementable manner, S102 can be:
[0066] S1021. For each image frame of the target video, determine the second block segmentation information of the image frame based on the first video, the second resolution, the first resolution, and the first block segmentation information of the image frame.
[0067] S1022. Obtain the second encoding information based on the second block segmentation information of each image frame of the target video.
[0068] Specifically, the first encoding information includes the first block partitioning information of each image frame of the target video, which includes the CUs obtained by dividing the image frame and the partitioning depth information of each CU. Therefore, the second encoding information also includes the second block partitioning information of each image frame of the target video. When determining the second encoding information for encoding the target video based on the first video, the second resolution to be encoded, the first resolution, and the first encoding information, the second block partitioning information of each image frame of the target video is determined sequentially.
[0069] For each image frame of the target video, the second block of the image frame can be determined by referring to the first block segmentation information of that image frame and combining it with the first video, the second resolution, and the first resolution.
[0070] As an implementable approach, S1021 can specifically be:
[0071] S1. For each CU to be encoded in the image frame, the CU to be encoded is mapped to the first image frame according to the second resolution to obtain the mapping area. The first image frame is the image frame in the first video that corresponds to the image frame.
[0072] Specifically, when an image frame is not divided, it can be regarded as a CU to be encoded. After being divided once, each of the multiple CUs is a CU to be encoded. For each CU obtained after the first division, it is further divided to obtain at least one CU. Each of the at least one CU is also a CU to be encoded. Therefore, the division of an image frame is an iterative division process.
[0073] The first image frame is the image frame in the first video that corresponds to the current image frame. When executing S1, the target video can be processed in the order of the image frames, so the image frame in the first video that corresponds to the current image frame can be found quickly. For example, the first image frame in the target video corresponds to the first image frame in the first video, and the second image frame in the target video corresponds to the second image frame in the first video.
[0074] In this embodiment, since encoding involves encoding the same target video at different resolutions, to accelerate the encoding of the low-resolution bitstream by utilizing the encoding information of the high-resolution bitstream after encoding the same target video, based on the content similarity of the same image frame at different resolutions, when encoding the target video to obtain the second video, for each CU to be encoded in each image frame of the target video, the CU to be encoded is mapped to the first image frame of the high-resolution bitstream according to the second resolution. When mapping the CU to be encoded to the first image frame according to the second resolution, for example, if the ratio of the second resolution to the first resolution is 2, the CU to be encoded is mapped to the first image frame by a 2x magnification, and the area falling in the first image frame is the mapping area. Figure 7 This application provides a schematic diagram of mapping a CU to be encoded to a first image frame, as shown in the embodiment. Figure 7 As shown, the mapped region obtained by mapping the CU to be encoded to the first image frame is: Figure 7 As shown in the dashed box, the segmentation result of the first image frame is as follows: Figure 7 As shown in the image.
[0075] S2. Based on the width and height of the CU to be encoded, as well as the first and second resolutions, determine the boundary of the mapping area including the CTU. Then, use the full traversal encoding method to determine the CUs obtained by dividing the CU to be encoded and the division depth information of each CU.
[0076] Specifically, for example, if the width and height of the CU to be encoded are both 'a', based on the first resolution and the second resolution, the width and height of the mapping region can be determined to be α times and β times 'a', respectively, where α and β are the ratios of the first resolution and the second resolution. For example, if the coordinates of a vertex of the CU to be encoded are (x, y), then the coordinates of the corresponding vertex in the mapping region are (αx, βy). Based on the width and height of the mapping region and the coordinates (αx, βy) of a vertex in the mapping region, it can be determined whether the mapping region includes the boundary of the CTU. In this process, an image frame is first divided into a series of CTUs of equal size, and each CTU then determines its own CU division. Therefore, it is crucial to first determine whether the mapping region includes the boundary of the CTU; the boundary of the CTU is its boundary line.
[0077] Optionally, in S2, the boundary of the mapping region, including the coding tree unit (CTU), is determined based on the width and height of the CU to be encoded, as well as the first and second resolutions. This can be achieved by determining that the mapping region overlaps with at least two CTUs in the first image frame, based on the width and height of the CU to be encoded, as well as the first and second resolutions. For example, Figure 7 In this embodiment, the mapped region overlaps with four CTUs. Since the CTUs are forcibly partitioned according to the standard, if the mapped region contains CTU boundaries, the characteristics of the current mapped region cannot be determined. Therefore, a full traversal encoding method is used to determine the CUs obtained from the partitioning of the CU to be encoded and the partitioning depth information of each CU.
[0078] The following illustrates a specific implementable method for determining whether a mapped region overlaps with at least two CTUs in a first image frame, based on the width and height of the CU to be encoded and a first and a second resolution. Optionally, S2 may specifically be:
[0079] S21. Based on the x-coordinate and y-coordinate of a vertex of the CU to be encoded and the ratio of the first resolution to the second resolution, calculate the x-coordinate and y-coordinate of the target vertex corresponding to the vertex in the mapping region.
[0080] Specifically, for example, if a vertex of the CU to be encoded is (x, y), and the ratio of the first resolution to the second resolution is α and β, then the target vertex corresponding to this vertex in the calculated mapping region is (αx, βy), that is, the horizontal coordinate and the vertical coordinate are αx and βy respectively.
[0081] S22. Calculate the width and height of the mapping region based on the width and height of the CU to be encoded and the ratio of the first resolution to the second resolution.
[0082] Specifically, the width and height of the CU are generally the same. For example, if the width and height of the CU to be encoded are 'a', and the ratio of the first resolution to the second resolution is α and β, then the width and height of the calculated mapping area are α times and β times a, respectively.
[0083] S23. The calculated x and y coordinates of the target vertex and the width and height of the mapping region are processed to make the x and y coordinates of the target vertex and the width and height of the mapping region multiples of M after the processing. M is determined according to the depth storage unit of the first encoded information.
[0084] Specifically, to ensure that the mapped region covers an integer number of depth storage units, the calculated x and y coordinates of the target vertex, as well as the width and height of the mapped region, need to be processed so that after processing, the x and y coordinates of the target vertex, as well as the width and height of the mapped region, are all multiples of M. M is determined based on the depth storage units of the first encoded information. Optionally, M can be the size of the depth storage unit; for example, if the size of the depth storage unit is 4x4, then M equals 4. Optionally, after processing, the x and y coordinates of the target vertex, as well as the width and height of the mapped region, are all multiples of the nearest M. For example, if the calculated x coordinate of the target vertex is 8.4, the processed x coordinate is 8; if the calculated height of the mapped region is 9.8, then the processed height of the mapped region is 8.
[0085] S24. Based on the x and y coordinates of the target vertex after value processing, the width and height of the mapped region, and the width of the CTU, determine that the mapped region overlaps with at least two CTUs in the first image frame.
[0086] Optionally, based on the x and y coordinates of the target vertex after value processing, the width and height of the mapped region, and the width of the CTU, it is determined that the mapped region overlaps with at least two CTUs in the first image frame. Specifically, this can be done as follows:
[0087] If the result of rounding the first value is equal to the result of rounding the second value, and the result of rounding the third value is equal to the result of rounding the fourth value, then it is determined that the mapped region overlaps with at least two CTUs in the first image frame, where rounding can be rounding down.
[0088] The first value is the ratio of the sum of the x-coordinate of the target vertex and the width of the mapped region to the width of the CTU; the second value is the ratio of the x-coordinate of the target vertex to the width of the CTU; the third value is the ratio of the sum of the y-coordinate of the target vertex and the height of the mapped region to the width of the CTU; and the fourth value is the ratio of the y-coordinate of the target vertex to the width of the CTU.
[0089] For example, if the target vertex coordinates after value processing are (m, n), the width and height of the mapped region after value processing are s and t respectively, and the height of the CTU is h, then... and If the mapped region overlaps with at least two CTUs in the first image frame, then the mapped region does not overlap with at least two CTUs in the first image frame.
[0090] S3. If the mapping area does not include the boundary of the CTU, obtain the maximum and minimum partitioning depths covered by the mapping area based on the first partitioning information, and determine the CU to be encoded and the partitioning depth information of each CU based on the maximum and minimum partitioning depths.
[0091] Specifically, the first block of partitioning information includes the CUs obtained from dividing the image frame and the partitioning depth information of each CU. Based on the first block of partitioning information and the position of the mapped region in the first image frame, the maximum and minimum partitioning depths covered by the mapped region can be obtained. Figure 8 A schematic diagram illustrating the location of a mapping region in a first image frame, as provided in this application, is shown below. Figure 8 As shown, the first block segmentation information of the first image frame is in Figure 8 It can be seen that, based on the first block of segmentation information and the position of the mapped region in the first image frame, the maximum segmentation depth covered by the mapped region is 3 and the minimum segmentation depth is 1.
[0092] Optionally, in one implementable approach, the CUs obtained by dividing the CU to be encoded and the partition depth information of each CU are determined based on the maximum partition depth and the minimum partition depth. Specifically, this can be:
[0093] S31. If the maximum partitioning depth is 0, then the CU to be encoded will no longer be iteratively partitioned.
[0094] Specifically, if the maximum partitioning depth is 0, it means that the CTU has not been partitioned, and the corresponding CTU is generally a low-texture region or a static background region. Since the content of the CU to be encoded is a downsampled map region, it should more closely satisfy the setting of a low-texture region or a static background region when some content details are lost. Therefore, it is determined that the CU to be encoded will no longer be iteratively partitioned.
[0095] S32. If the difference between the maximum partition depth and the minimum partition depth is less than or equal to 1, then the full traversal encoding method is used to determine the partitioned CUs and the partition depth information of each CU.
[0096] Specifically, if the difference between the maximum partition depth and the minimum partition depth is less than or equal to 1, considering the rate-distortion performance loss caused by misjudgment, no fast processing is performed in this case. Instead, the partitioning depth information of the CU to be encoded and the partitioned CU is determined according to the original full traversal encoding method.
[0097] S33. If the difference between the maximum partition depth and the minimum partition depth is greater than 1, then the CU to be encoded is determined to continue to be iteratively partitioned. The partitioning depth information of each CU is obtained by iteratively partitioning the CU to be encoded.
[0098] Specifically, if the difference between the maximum and minimum segmentation depths is greater than 1 (e.g., the maximum segmentation depth is 3 and the minimum segmentation depth is 0 or 1), then the difference is greater than 1. In this case, it means that the mapped region has been finely divided in the original first image frame, and this region often contains complex textures or intense motion. In this situation, the current CU to be encoded will skip the encoding of the current size and directly proceed to the next segmentation encoding; that is, the prediction, transformation, and quantization operations of the current-size CU will no longer be performed. In other words, the CU to be encoded will continue to be iteratively segmented, and through iterative segmentation, the resulting CUs and the segmentation depth information of each CU will be obtained.
[0099] S103. Encode the target video according to the second encoding information to obtain a second video with a second resolution.
[0100] Specifically, after obtaining the second encoding information for encoding the target video through S101-S102, the second encoding information includes the second block partitioning information for each image frame of the target video. The second block partitioning information includes the CUs obtained by dividing the image frame and the partitioning depth information of each CU. Therefore, when encoding each image frame of the target video, encoding can be performed according to the CUs obtained by dividing the image frame and the partitioning depth information of each CU. It is not necessary to determine the block partitioning form of the image frame and perform encoding in a full traversal manner. The block partitioning process included in the first encoding information can be utilized to reduce the block partitioning process of the encoding information in the second encoding information that is similar to that in the first encoding information. This reduces the computational complexity of the block partitioning process for low-resolution bitstream encoding in the multi-resolution transcoding system, thereby reducing the encoding time and computational resource overhead when encoding the target video to the second resolution.
[0101] The encoding method provided in this application involves obtaining a first video obtained after encoding a target video, along with first encoding information and a first resolution of the first video. Based on the first video, a second resolution to be used for encoding, the first resolution, and the first encoding information, second encoding information is determined for encoding the target video, where the second resolution is lower than the first resolution. The target video is then encoded according to the second encoding information to obtain a second video with the second resolution. Therefore, by utilizing the block partitioning process included in the first encoding information, the block partitioning process of similar encoding information in the second encoding information can be reduced, thereby lowering the computational complexity of the block partitioning process for low-resolution bitstream encoding in a multi-resolution transcoding system. This reduces low-resolution bitstream encoding time and computational resources, improving encoding efficiency.
[0102] The technical solution of the encoding method provided in this application will be described in detail below with reference to a specific embodiment.
[0103] For example, Figure 9 A schematic diagram of a multi-resolution transcoding system provided in this application embodiment is shown below. Figure 9 As shown, the target video is input into the multi-resolution transcoding system. The system first scales the target video according to different resolutions, such as 360P, 480P, and 540P, and then encodes each of these resolutions, outputting 360P, 480P, and 540P streams respectively. For example, using... Figure 9 Taking the system shown as an example with a maximum resolution of 540P, during encoding, the target video can be encoded first to obtain a 540P bitstream. Then, when encoding the target video to obtain 480P and 360P bitstreams, the encoding method provided in this application's embodiments can be used. The following is in conjunction with... Figure 10 A detailed explanation will be provided.
[0104] The following is a flowchart illustrating an encoding method provided in an embodiment of this application. The execution subject of this embodiment can be an encoder, and the method of this embodiment may include:
[0105] S201. Obtain a first video, the first encoding information of the first video, and the first resolution of the first video. The first video is obtained by encoding the target video. The first encoding information includes the first block partitioning information of each image frame of the target video. The first block partitioning information includes the CU obtained by dividing the image frame and the partitioning depth information of each CU.
[0106] Specifically, prior to S201, the method of this embodiment further includes:
[0107] Receive the target video, encode the target video according to the first resolution, and obtain the first video.
[0108] In the process of encoding the target video according to a first resolution to obtain the first video, the first encoded information can be stored using a depth storage unit of a preset size. Optionally, the location for storing the first encoded information can be memory or external storage; this embodiment of the application does not impose any limitations on this.
[0109] In one embodiment, this application uses a 4x4 depth storage unit to store the first encoding information. Taking an image frame as an example, a 4x4 depth storage unit is used to store the CUs obtained by dividing the image frame and the division depth information of each CU. Since the minimum CU size supported by H.265 is 8x8, all CUs can be divided into several 4x4 blocks. Figure 6a This is a schematic diagram of a 64x64CU partition provided in an embodiment of this application. Figure 6b for Figure 6a The diagram shown illustrates the storage format of the partitioning results, based on... Figure 6b The partition depth stored in each depth storage unit shown indicates the partitioning result of the entire 64x64CU.
[0110] S202. For each image frame of the target video, determine the second block partitioning information of the image frame based on the first video, the second resolution to be encoded, the first resolution, and the first block partitioning information of the image frame, and obtain the second encoding information based on the second partitioning information of each image frame of the target video.
[0111] Specifically, Figure 10 A specific implementation of S202 is shown. Figure 10 This is a schematic diagram illustrating the block partitioning process of a CU to be encoded for an image frame, as provided in an embodiment of this application. Figure 10 As shown, the block partitioning process may include:
[0112] S11. For the CU to be encoded, map the CU to be encoded onto the first image frame according to the second resolution to obtain the mapping area. The first image frame is the image frame in the first video that corresponds to the image frame.
[0113] Specifically, when an image frame is not divided, it can be regarded as a CU to be encoded. After being divided once, each of the multiple CUs is a CU to be encoded. For each CU obtained after the first division, it is further divided to obtain at least one CU. Each of the at least one CU is also a CU to be encoded. Therefore, the division of an image frame is an iterative division process.
[0114] S12. Based on the width and height of the CU to be encoded, as well as the first resolution and the second resolution, determine whether the mapping area includes the boundary of the CTU.
[0115] If yes, then execute S13; otherwise, execute S14.
[0116] S13. Use the full traversal encoding method to determine the CUs obtained by dividing the CU to be encoded and the division depth information of each CU.
[0117] S14. Obtain the maximum partition depth p and minimum partition depth q of the mapped region based on the first partition information.
[0118] S15. Determine if the maximum partitioning depth is 0.
[0119] If yes, then the CU to be encoded will no longer be iteratively divided. If no, then execute S16.
[0120] Specifically, if the maximum partitioning depth is 0, it means that the CTU has not been partitioned, and the corresponding CTU is generally a low-texture region or a static background region. Since the content of the CU to be encoded is a downsampled map region, it should more closely satisfy the setting of a low-texture region or a static background region when some content details are lost. Therefore, it is determined that the CU to be encoded will no longer be iteratively partitioned.
[0121] S16. Determine if pq is greater than 1.
[0122] If yes, then execute S17; otherwise, execute S13.
[0123] S17. Determine the CU to be encoded and continue iterative partitioning. Through iterative partitioning, obtain the CUs obtained by partitioning the CU to be encoded and the partitioning depth information of each CU.
[0124] Specifically, if the difference (pq) between the maximum and minimum segmentation depths is greater than 1 (e.g., the maximum segmentation depth is 3, and the minimum segmentation depth is 0 or 1), then the difference is greater than 1. In this case, it means that the mapped region has been finely segmented in the original first image frame, and this region often contains complex textures or intense motion. In this situation, the current CU to be encoded will skip the encoding of the current size and directly proceed to the next segmentation encoding; that is, the prediction, transformation, and quantization operations of the current-size CU will no longer be performed. In other words, the CU to be encoded will continue to be iteratively segmented, and through iterative segmentation, the resulting CUs and the segmentation depth information of each CU will be obtained.
[0125] S203. Encode the target video according to the second encoding information to obtain a second video with a second resolution.
[0126] Specifically, after obtaining the second encoding information for encoding the target video through S201-S202, the second encoding information includes the second block partitioning information for each image frame of the target video. The second block partitioning information includes the CUs obtained by dividing the image frame and the partitioning depth information of each CU. Therefore, when encoding each image frame of the target video, encoding can be performed according to the CUs obtained by dividing the image frame and the partitioning depth information of each CU. It is not necessary to determine the block partitioning form of the image frame and perform encoding in a full traversal manner. The block partitioning process included in the first encoding information can be utilized to reduce the block partitioning process of similar encoding information in the second encoding information to that in the first encoding information. This reduces the computational complexity of the block partitioning process for low-resolution bitstream encoding in the multi-resolution transcoding system, thereby reducing the encoding time and computational resource overhead when encoding the target video to the second resolution.
[0127] It should be noted that the specific implementation process or terminology of the relevant steps in this embodiment can be found in the description of the previous embodiments, and will not be repeated here.
[0128] Figure 11 This is a schematic diagram of the structure of an encoding device provided in an embodiment of this application, as shown below. Figure 11 As shown, the encoding device may include: an acquisition module 11, a determination module 12, and an encoding module 13.
[0129] The acquisition module 11 is used to acquire a first video, the first encoding information of the first video, and the first resolution of the first video. The first video is obtained by encoding the target video. The first encoding information includes the first block division information of each image frame of the target video. The first block division information includes the encoding unit (CU) obtained by dividing the image frame and the division depth information of each CU.
[0130] The determining module 12 is used to determine the second encoding information for encoding the target video based on the first video, the second resolution to be encoded, the first resolution, and the first encoding information, wherein the second resolution is smaller than the first resolution;
[0131] The encoding module 13 is used to encode the target video according to the second encoding information to obtain a second video with a second resolution.
[0132] In one embodiment, the determining module 12 is used to:
[0133] For each image frame of the target video, the second block segmentation information of the image frame is determined based on the first video, the second resolution, the first resolution, and the first block segmentation information of the image frame;
[0134] The second encoding information is obtained based on the second block segmentation information of each image frame of the target video.
[0135] In one embodiment, the determining module 12 is used to:
[0136] For each CU to be encoded in the image frame, the CU to be encoded is mapped to the first image frame according to the second resolution to obtain the mapping region. The first image frame is the image frame in the first video that corresponds to the image frame.
[0137] Based on the width and height of the CU to be encoded, as well as the first resolution and the second resolution, the boundary of the mapping region including the coding tree unit (CTU) is determined. Then, the full traversal encoding method is used to determine the CUs obtained by dividing the CU to be encoded and the division depth information of each CU.
[0138] If it is determined that the mapping region does not include the boundary of the CTU, the maximum and minimum partitioning depths covered by the mapping region are obtained according to the first block partitioning information, and the partitioning depth information of the CU to be encoded and the partitioned CU are determined according to the maximum and minimum partitioning depths.
[0139] In one embodiment, the determining module 12 is specifically used for:
[0140] Based on the width and height of the CU to be encoded, as well as the first resolution and the second resolution, it is determined that the mapping region overlaps with at least two CTUs in the first image frame.
[0141] In one embodiment, the determining module 12 is specifically used for:
[0142] Based on the x and y coordinates of a vertex of the CU to be encoded and the ratio of the first resolution to the second resolution, the x and y coordinates of the target vertex corresponding to the vertex in the mapping region are calculated.
[0143] The width and height of the mapping region are calculated based on the width and height of the CU to be encoded and the ratio of the first resolution to the second resolution.
[0144] The calculated x and y coordinates of the target vertex and the width and height of the mapping region are processed to make the x and y coordinates of the target vertex and the width and height of the mapping region multiples of M after the processing, where M is determined according to the depth storage unit of the first encoded information.
[0145] Based on the x and y coordinates of the target vertex after value processing, the width and height of the mapping region, and the width of the CTU, it is determined that the mapping region overlaps with at least two CTUs in the first image frame.
[0146] In one embodiment, the determining module 12 is specifically used for:
[0147] If the result of rounding the first value is equal to the result of rounding the second value, and the result of rounding the third value is equal to the result of rounding the fourth value, then it is determined that the mapping region overlaps with at least two CTUs in the first image frame.
[0148] Wherein, the first value is the ratio of the sum of the x-coordinate of the target vertex and the width of the mapping region to the width of the CTU; the second value is the ratio of the x-coordinate of the target vertex to the width of the CTU; the third value is the ratio of the sum of the y-coordinate of the target vertex and the height of the mapping region to the width of the CTU; and the fourth value is the ratio of the y-coordinate of the target vertex to the width of the CTU.
[0149] In one embodiment, the determining module 12 is specifically used for:
[0150] If the maximum partitioning depth is 0, then the CU to be encoded will no longer be iteratively partitioned;
[0151] If the difference between the maximum partition depth and the minimum partition depth is less than or equal to 1, then the full traversal encoding method is used to determine the partitioned CUs and the partition depth information of each CU.
[0152] If the difference between the maximum partition depth and the minimum partition depth is greater than 1, then it is determined that the CU to be encoded will continue to be iteratively partitioned, and the partition depth information of the CU to be encoded and the partition depth information of each CU will be obtained through iterative partitioning.
[0153] In one embodiment, the encoding module 13 is further configured to: store the first encoded information using a depth storage unit of a preset size during the process of encoding the target video to obtain the first video.
[0154] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details will not be provided here. Specifically, Figure 11 The encoding device shown can perform Figure 4 The corresponding method embodiments, and the foregoing and other operations and / or functions of each module in the encoding device are respectively for implementing Figure 4 For the sake of brevity, the corresponding processes in the method embodiments will not be described in detail here.
[0155] The encoding apparatus of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in the embodiments of this application can be directly manifested as execution by a hardware encoding processor, or execution by a combination of hardware and software modules in the encoding processor. Optionally, the software module can be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0156] Figure 12 This is a schematic block diagram of an encoding device provided in an embodiment of this application. The encoding device may be the server described in the above method embodiments.
[0157] like Figure 12 As shown, the encoding device may include:
[0158] The system includes a memory 210 and a processor 220. The memory 210 stores computer programs and transfers the program code to the processor 220. In other words, the processor 220 can retrieve and run the computer program from the memory 210 to implement the methods described in the embodiments of this application.
[0159] For example, the processor 220 can be used to execute the above-described method embodiments according to instructions in the computer program.
[0160] In some embodiments of this application, the processor 220 may include, but is not limited to:
[0161] General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0162] In some embodiments of this application, the memory 210 includes, but is not limited to:
[0163] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0164] In some embodiments of this application, the computer program may be divided into one or more modules, which are stored in the memory 210 and executed by the processor 220 to complete the method provided in this application. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the encoding device.
[0165] like Figure 12 As shown, the encoding device may further include:
[0166] Transceiver 230, which can be connected to processor 220 or memory 210.
[0167] The processor 220 can control the transceiver 230 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 230 may include a transmitter and a receiver. The transceiver 230 may further include antennas, and the number of antennas may be one or more.
[0168] It should be understood that the various components in the encoding device are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.
[0169] This application also provides a computer storage medium storing a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, this application also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.
[0170] When implemented using software, it can be implemented entirely or partially as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0171] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of the embodiments of this application.
[0172] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or modules may be electrical, mechanical, or other forms.
[0173] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0174] The above description is merely a specific implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the embodiments of this application should be included within the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application should be determined by the protection scope of the claims.
Claims
1. An encoding method, characterized in that, The method includes: The first video, the first encoding information of the first video, and the first resolution of the first video are obtained. The first video is obtained by encoding the target video. The first encoding information includes the first block division information of each image frame of the target video. The first block division information includes the encoding unit (CU) obtained by dividing the image frame and the division depth information of each CU. For each image frame of the target video, based on the first video, the second resolution, the first resolution, and the first block segmentation information of the image frame, the second block segmentation information of the image frame is determined, wherein the second resolution is less than the first resolution; The second encoding information is obtained based on the second block segmentation information of each image frame of the target video; The target video is encoded according to the second encoding information to obtain a second video with the second resolution; The step of determining the second block segmentation information of the image frame includes: For each CU to be encoded in the image frame, the CU to be encoded is mapped to the first image frame according to the second resolution to obtain the mapping region. The first image frame is the image frame in the first video that corresponds to the image frame. Based on the width and height of the CU to be encoded, as well as the first resolution and the second resolution, determine whether the mapping region includes the boundary of the coding tree unit (CTU). Based on whether the mapped region includes the boundary of the CTU, the corresponding method is selected to determine the second block segmentation information of the image frame.
2. The method according to claim 1, characterized in that, The step of determining the second block segmentation information of the image frame by selecting a corresponding method based on whether the mapped region includes the boundary of the CTU includes: If the mapping region includes the boundary of the coding tree unit (CTU), then the full traversal coding method is used to determine the CUs obtained by dividing the CU to be encoded and the division depth information of each CU. If it is determined that the mapping region does not include the boundary of the CTU, the maximum and minimum partitioning depths covered by the mapping region are obtained according to the first block partitioning information, and the partitioning depth information of the CU to be encoded and the partitioned CU are determined according to the maximum and minimum partitioning depths.
3. The method according to claim 1, characterized in that, The step of determining whether the mapping region includes the boundary of the coding tree unit (CTU) based on the width and height of the CU to be encoded, the first resolution, and the second resolution includes: Based on the width and height of the CU to be encoded, as well as the first resolution and the second resolution, if it is determined that the mapping region overlaps with at least two CTUs in the first image frame, then the boundary of the mapping region including the CTUs is determined.
4. The method according to claim 3, characterized in that, The step of determining that the mapped region overlaps with at least two CTUs in the first image frame based on the width and height of the CU to be encoded, as well as the first resolution and the second resolution, includes: Based on the x and y coordinates of a vertex of the CU to be encoded and the ratio of the first resolution to the second resolution, the x and y coordinates of the target vertex corresponding to the vertex in the mapping region are calculated. The width and height of the mapping region are calculated based on the width and height of the CU to be encoded and the ratio of the first resolution to the second resolution. The calculated x and y coordinates of the target vertex and the width and height of the mapping region are processed to make the x and y coordinates of the target vertex and the width and height of the mapping region multiples of M after the processing, where M is determined according to the depth storage unit of the first encoded information. Based on the x and y coordinates of the target vertex after value processing, the width and height of the mapping region, and the width of the CTU, it is determined that the mapping region overlaps with at least two CTUs in the first image frame.
5. The method according to claim 4, characterized in that, The step of determining that the mapped region overlaps with at least two CTUs in the first image frame based on the x and y coordinates of the target vertex after value processing, the width and height of the mapped region, and the width of the CTU includes: If the result of rounding the first value is equal to the result of rounding the second value, and the result of rounding the third value is equal to the result of rounding the fourth value, then it is determined that the mapping region overlaps with at least two CTUs in the first image frame. Wherein, the first value is the ratio of the sum of the x-coordinate of the target vertex and the width of the mapping region to the width of the CTU; the second value is the ratio of the x-coordinate of the target vertex to the width of the CTU; the third value is the ratio of the sum of the y-coordinate of the target vertex and the height of the mapping region to the width of the CTU; and the fourth value is the ratio of the y-coordinate of the target vertex to the width of the CTU.
6. The method according to claim 2, characterized in that, The step of determining the CUs obtained by dividing the CU to be encoded and the division depth information of each CU based on the maximum and minimum division depths covered by the mapped region includes: If the maximum partitioning depth is 0, then the CU to be encoded will no longer be iteratively partitioned; If the difference between the maximum partition depth and the minimum partition depth is less than or equal to 1, then the full traversal encoding method is used to determine the partitioned CUs and the partition depth information of each CU. If the difference between the maximum partition depth and the minimum partition depth is greater than 1, then it is determined that the CU to be encoded will continue to be iteratively partitioned, and the partition depth information of each CU is obtained by iterative partitioning.
7. The method according to any one of claims 1-6, characterized in that, The method further includes: During the process of encoding the target video to obtain the first video, the first encoded information is stored using a depth storage unit of a preset size.
8. An encoding device, characterized in that, include: The acquisition module is used to acquire a first video, first encoding information of the first video, and first resolution of the first video. The first video is obtained by encoding a target video. The first encoding information includes first block partitioning information of each image frame of the target video. The first block partitioning information includes encoding units (CUs) obtained by dividing the image frame and partitioning depth information of each CU. The determining module is configured to, for each image frame of the target video, determine the second block segmentation information of the image frame based on the first video, the second resolution, the first resolution, and the first block segmentation information of the image frame, wherein the second resolution is less than the first resolution; The second encoding information is obtained based on the second block segmentation information of each image frame of the target video; An encoding module is used to encode the target video according to the second encoding information to obtain a second video with a resolution of the second resolution; The step of determining the second block segmentation information of the image frame includes: For each CU to be encoded in the image frame, the CU to be encoded is mapped to the first image frame according to the second resolution to obtain the mapping region. The first image frame is the image frame in the first video that corresponds to the image frame. Based on the width and height of the CU to be encoded, as well as the first resolution and the second resolution, determine whether the mapping region includes the boundary of the coding tree unit (CTU). Based on whether the mapped region includes the boundary of the CTU, the corresponding method is selected to determine the second block segmentation information of the image frame.
9. An encoding device, characterized in that, include: A processor and a memory, the memory being used to store a computer program, the processor being used to invoke and run the computer program stored in the memory to perform the method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, Used to store a computer program that causes a computer to perform the method as described in any one of claims 1-7.
11. A computer program product containing instructions, characterized in that, When the instructions are executed on a computer, the computer performs the method according to any one of claims 1-7.
Citation Information
Patent Citations
Rapid inter-frame transcoding method for reducing video resolution based on HEVC
CN104581170A