An adaptation method and device of a video decoder, a test platform and a storage medium
By configuring the H265 video decoder in the client-side decoding library and comparing the similarity of the decoded data with that of a third-party decoding library, the verification problem of successful H265 decoder adaptation was solved, the client's decoding efficiency was improved, and display anomalies were avoided.
Patent Information
- Application Number
- CN202310481409.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-27
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2043-04-27
AI Technical Summary
Existing technologies lack an effective verification mechanism on the client side to determine whether the H265 video decoder is successfully adapted, resulting in low decoding efficiency.
By configuring the client's decoding library, the first decoder among multiple video decoders is called to decode the video encoded data, and then the data is sent to a third-party decoding library for decoding. The similarity between the first and second decoded data is compared to determine if the adaptation is successful.
It enables accurate verification of whether the client has successfully adapted to the H265 decoder, improves decoding efficiency, and avoids the occurrence of distorted images.
Smart Images

Figure CN116489435B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, testing platform, and storage medium for adapting a video decoder. Background Technology
[0002] Currently, to ensure high-quality video and image output while reducing bitrate and bandwidth, the H.265 video codec protocol has been introduced into client-side applications. However, after adding the H.265 video decoder to the client, there is no effective verification mechanism to determine whether the H.265 video decoder has been successfully adapted to the client. Summary of the Invention
[0003] To address the aforementioned issues, embodiments of the present invention provide a video decoder adaptation method, apparatus, testing platform, and storage medium, thereby at least resolving the problem that related technologies lack an effective verification mechanism to determine whether a video decoder has been successfully adapted in a client.
[0004] The technical solution of this invention is implemented as follows:
[0005] In a first aspect, embodiments of the present invention provide a video decoder adaptation method, the method comprising:
[0006] Configure the decoding library on the client side; the decoding library includes various video decoders;
[0007] The client is instructed to call the first decoder among the various video decoders to read and decode the video encoded data from the server to obtain the first decoded data; wherein the video encoded data is a first video compression format; the first video compression format is an H265 protocol format or an encoding protocol format evolved from the H265 protocol.
[0008] The client is instructed to send the video encoded data to a third-party decoding library for decoding and obtain second decoded data from the third-party decoding library; the third-party decoding library includes a standard H.265 decoder or an encoder evolved from the H.265 protocol.
[0009] Based on the first decoded data and the second decoded data, determine whether the client has successfully adapted to the first decoder.
[0010] In the above scheme, the configuration operation of the decoding library on the client includes:
[0011] In the decoding library, a decoding flag is set; the decoding flag is used to invoke the first decoder.
[0012] The client performs memory alignment settings for the decoded data; these memory alignment settings enable the client to read the video encoded data.
[0013] In the above scheme, the step of setting memory alignment for decoded data in the client includes:
[0014] Adjust the data alignment format of the video encoded data in memory according to the data format size corresponding to the first video compression format.
[0015] In the above scheme, adjusting the data alignment format of the video encoded data in memory according to the data format size corresponding to the first video compression format includes:
[0016] Based on the data format size corresponding to the first video compression format, the virtual width of the video encoded data is scaled while keeping the virtual height of the video encoded data unchanged to match the data format size corresponding to the first video compression format.
[0017] The scaling operation on the virtual width of the video encoded data described in the above scheme includes:
[0018] A set character is added to the end of each line of the video encoded data to make the virtual width of the video encoded data match the data format size corresponding to the first video compression format.
[0019] In the above scheme, determining whether the client has successfully adapted to the first decoder based on the first decoded data and the second decoded data includes:
[0020] Determine the similarity between the first decoded data and the second decoded data;
[0021] If the similarity is greater than or equal to the threshold, it is determined that the client has successfully adapted to the first decoder;
[0022] If the similarity is less than the threshold, it is determined that the client has not successfully adapted to the first decoder.
[0023] In the above scheme, setting the decoding flag in the decoding library includes:
[0024] Modify the original decoding flag bit of the client to the decoding flag bit corresponding to the first video compression format.
[0025] Secondly, embodiments of the present invention provide a video decoder adaptation device, the device comprising:
[0026] The first instruction module is used to instruct the client to call the first decoder in the decoding library to read and decode the video encoded data from the server to obtain the first decoded data; wherein, the video encoded data is a first video compression format; the first video compression format is an H265 protocol format or an encoding protocol format evolved from the H265 protocol.
[0027] The second instruction module is used to instruct the client to send the video encoded data to a third-party decoding library for decoding, and to obtain second decoded data from the third-party decoding library; the third-party decoding library includes a standard H.265 decoder or an encoder evolved from the H.265 protocol.
[0028] The determining module is used to determine whether the client has successfully adapted to the first decoder based on the first decoded data and the second decoded data.
[0029] Thirdly, embodiments of the present invention provide a test platform including a processor and a memory, the processor and the memory being interconnected, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is configured to invoke the program instructions to execute the steps of the adaptation method provided in the first aspect of the present invention.
[0030] Fourthly, embodiments of the present invention provide a computer-readable storage medium, comprising: the computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the steps of the adaptation method provided in the first aspect of the present invention.
[0031] This embodiment provides an adaptation mechanism based on a testing platform to verify whether a client has successfully adapted to the first decoder. By configuring the decoding library on the client, the client is instructed to call the first decoder in the decoding library to read and decode video encoded data from the server, obtaining first decoded data. The client is then instructed to send the video encoded data to a third-party decoding library for decoding, obtaining second decoded data from the third-party decoding library. Based on the first and second decoded data, it is determined whether the client has successfully adapted to the first decoder. The decoding library includes various video decoders, the video encoded data is in a first video compression format (H.265 protocol format or an evolved H.265 encoding protocol format), and the third-party decoding library includes a standard H.265 decoder or an evolved H.265 encoder. The adaptation mechanism provided in this embodiment can accurately verify whether the client has successfully adapted to the first decoder, facilitating timely maintenance of the client by testers, ensuring successful client adaptation, and thus improving the client's decoding efficiency. Attached Figure Description
[0032] Figure 1 This is a schematic diagram illustrating the implementation process of a video decoder adaptation method provided in an embodiment of the present invention;
[0033] Figure 2 This is a schematic diagram of a client displaying a distorted image according to an embodiment of the present invention;
[0034] Figure 3 This is a schematic diagram of an H.265 video decoder adaptation process provided in an embodiment of the present invention;
[0035] Figure 4 This is a schematic diagram of a video decoder adapter provided in an embodiment of the present invention;
[0036] Figure 5 This is a schematic diagram of a test platform provided in an embodiment of the present invention. Detailed Implementation
[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0038] With the rapid development of short videos, people are no longer satisfied with low-resolution and low-definition videos and images, and are constantly pursuing higher-quality video and image displays. However, high-quality video and images often mean higher bandwidth and bitrate consumption during transmission using the H.264 video codec protocol. To ensure high-quality video and image quality while reducing bitrate and bandwidth, the H.265 video codec protocol was introduced on the client side. Compared to H.264, H.265 has twice the video compression efficiency. This means that using the H.265 video codec protocol, videos of the same file size and bitrate can present better video quality. Furthermore, using the H.265 video codec protocol can also improve the encoding efficiency of server-side video and reduce encoding latency to below 15ms.
[0039] The related technology replaces the video decoder in the client with an H264 video decoder. However, after the client replaces the video decoder, the related technology does not have an effective verification mechanism to verify whether the client has successfully adapted to the H265 video decoder.
[0040] To address the shortcomings of the aforementioned related technologies, embodiments of the present invention provide an adaptation method capable of accurately verifying whether a client has successfully adapted to the video decoder. To illustrate the technical solution described in this invention, specific embodiments are provided below.
[0041] Figure 1 This is a schematic diagram illustrating the implementation process of a video decoder adaptation method provided in an embodiment of the present invention. The video decoder adaptation method is applied to a testing platform, and the client manufacturer can use the testing platform to test the client. The testing content includes: testing whether the client is adapted to the first decoder.
[0042] refer to Figure 1 The video decoder adaptation methods include:
[0043] S101, Configure the decoding library on the client; the decoding library includes various video decoders.
[0044] Here, the client can be a short video platform or other video playback software, or a cloud desktop client or other virtual software.
[0045] The client has a built-in decoding library, which includes various video decoders, such as H264 video decoders, H265 video decoders, and encoders evolved from the H265 protocol.
[0046] Configuring the decoding library on the client side includes adding decoders, setting decoding flags, and setting memory alignment for decoded data. For example, adding an H.265 video decoder to the decoding library; setting decoding flags to enable the H.265 video decoder to be called; and setting memory alignment for decoded data to enable the client to read encoded video data.
[0047] S102, instructing the client to call the first decoder in the decoding library to read and decode the video encoded data from the server to obtain the first decoded data; wherein, the video encoded data is a first video compression format; the first video compression format is an H265 protocol format or an encoding protocol format evolved from the H265 protocol.
[0048] Here, the first video compression format is the H.265 protocol format or the encoding protocol format evolved from the H.265 protocol. The test platform instructs the client to call the first decoder in the decoding library to read the video encoding data from the server and decode it to obtain the first decoded data.
[0049] The client code pre-configures decoding flags, and the client uses these flags to call the first decoder in the decoding library to decode the video encoded data. For example, the decoding library includes wrapper libraries implemented for both H.264 and H.265, corresponding to the classes MPP_VIDEO_CodingAVC and MPP_VIDEO_CodingHEVC, respectively. The decoding flag for H.264 is HW_DECODE_AVC, and for H.265 it is HW_DECODE_HEVC. Using the H.265 decoding flag HW_DECODE_HEVC, MPP_VIDEO_CodingHEVC can be called to decode the video encoded data.
[0050] In one embodiment, the first decoded data is in YUV data format. Similar to RGB encoding, YUV is also a color encoding method. Here, "Y" represents luminance, or grayscale value, while U and V represent chrominance.
[0051] S103, instructing the client to send the video encoded data to a third-party decoding library for decoding, and obtain second decoded data from the third-party decoding library; the third-party decoding library includes a standard H265 decoder or an encoder evolved from the H265 protocol.
[0052] For example, a third-party decoding library could be one of the following: ffmpeg library, x265 library, or VMAF library.
[0053] ffmpeg is an open-source computer program used to record, convert, and stream digital audio and video. It provides a complete solution for recording, converting, and streaming audio and video, including the libavcodec audio / video codec library. Through the video codec library within ffmpeg, encoded video data can be decoded to obtain second-decoded data.
[0054] X265 is an open-source software and library for encoding video conforming to the High Efficiency Video Coding (HEVC / H.265) standard. It provides a high-efficiency HEVC encoder. The HEVC encoder can decode encoded video data to obtain decoded data.
[0055] Video Multi-method Assessment Fusion (VMAF) is a video quality evaluation metric that combines human visual models with machine learning. It can assess differences between codecs and also evaluate video scaling distortion. The VMAF package includes a standalone C library and its wrapper Python library. The Python library also provides a set of tools that allow users to train and test custom VMAF models. The decoder in the VMAF model can decode the encoded video data to obtain a second decoded data.
[0056] In one embodiment, the second decoded data obtained by decoding through a third-party decoding library is also in YUV data format.
[0057] Decoding video encoded data using a third-party decoding library yields standard decoded data. In practical applications, clients typically use their own decoding library instead of a third-party one because calling a third-party library causes data to be forwarded multiple times between the client and the third-party library, resulting in low decoding efficiency and potential data security risks.
[0058] S104, Based on the first decoded data and the second decoded data, determine whether the client has successfully adapted to the first decoder.
[0059] By comparing the first decoded data and the second decoded data, we can determine whether the client has successfully adapted to the first decoder. If the client has successfully adapted to the first decoder, then the first decoded data and the second decoded data should be the same; if the client has not successfully adapted to the first decoder, then the first decoded data and the second decoded data will be different.
[0060] The first and second decoded data can be compared in various ways. For example, the similarity between the first and second decoded data can be calculated, and the client's successful adaptation to the first decoder can be determined based on the similarity. If the similarity is greater than a threshold, the client is considered to have successfully adapted to the first decoder. The similarity can be represented by Peak Signal-to-Noise Ratio (PSNR), Structural Similarity (SSIM) values, histograms, and cosine similarity.
[0061] This embodiment provides an adaptation mechanism based on a testing platform to verify whether a client has successfully adapted to the first decoder. By configuring the decoding library on the client, the client is instructed to call the first decoder in the decoding library to read and decode video encoded data from the server, obtaining first decoded data. The client is then instructed to send the video encoded data to a third-party decoding library for decoding, obtaining second decoded data from the third-party decoding library. Based on the first and second decoded data, it is determined whether the client has successfully adapted to the first decoder. The decoding library includes various video decoders, the video encoded data is in a first video compression format (H.265 protocol format or an evolved H.265 encoding protocol format), and the third-party decoding library includes a standard H.265 decoder or an evolved H.265 encoder. The adaptation mechanism provided in this embodiment can accurately verify whether the client has successfully adapted to the first decoder, facilitating timely maintenance of the client by testers, ensuring successful client adaptation, and thus improving the client's decoding efficiency.
[0062] In one embodiment, determining whether the client has successfully adapted to the first decoder based on the first decoded data and the second decoded data includes:
[0063] Determine the similarity between the first decoded data and the second decoded data;
[0064] If the similarity is greater than or equal to the threshold, it is determined that the client has successfully adapted to the first decoder;
[0065] If the similarity is less than the threshold, it is determined that the client has not successfully adapted to the first decoder.
[0066] Here, similarity can be represented by peak signal-to-noise ratio (PSNR), structural similarity (SSIM) value, histogram, and cosine similarity.
[0067] For example, similarity can be determined by calculating the SSIM value of the first and second decoded data, which are video data composed of many image frames. SSIM is an index that measures the similarity between two images. The SSIM value ranges from -1 to 1, where a value of +1 indicates that the two given images are very similar or identical, and a value of -1 indicates that the two given images are very different.
[0068] Here, the number of image frames in the first decoded data and the second decoded data is the same, and the SSIM value between all corresponding image frames in the first decoded data and the second decoded data is calculated.
[0069] SSIM extracts three key features from an image: brightness, contrast, and structure. The comparison between two image frames is based on these three features. Brightness is obtained by averaging all pixel values; contrast is measured by the standard deviation (square root of the variance) of all pixel values; and structure is measured by the covariance of all pixels. Then, brightness, contrast, and structure are combined to calculate the SSIM value between the two image frames.
[0070] The similarity between the first and second decoded data is determined based on the SSIM values between all corresponding image frames in the first and second decoded data. For example, the mean of the SSIM values between all corresponding image frames can be calculated; the smaller the mean, the lower the similarity; the larger the mean, the higher the similarity. For example, if the mean is greater than or equal to 0.9, it is determined that the client has successfully adapted to the first decoder.
[0071] This embodiment determines the similarity between the first decoded data and the second decoded data, and based on the similarity, it can accurately determine whether the client has successfully adapted to the first decoder.
[0072] In one embodiment, the configuration operation of the decoding library on the client includes:
[0073] In the decoding library, a decoding flag is set; the decoding flag is used to invoke the first decoder.
[0074] The client performs memory alignment settings for the decoded data; these memory alignment settings enable the client to read the video encoded data.
[0075] The decoding flag is used to call the video decoder. In this embodiment, the decoding flag needs to be set to call the first decoder.
[0076] Specifically, setting the decoding flag in the decoding library includes: modifying the original decoding flag of the client to the decoding flag corresponding to the first video compression format.
[0077] For example, a previous version of the client supported the H.264 video compression format. During a client upgrade, an H.265 video decoder was added to the encoding library. However, because the decoding flag in the client code still uses the original HW_DECODE_AVC flag for the H.264 compression format, the H.265 video decoder cannot be invoked using HW_DECODE_AVC. Therefore, the decoding flag in the client code needs to be changed from HW_DECODE_AVC to HW_DECODE_HEVC. Using the modified HW_DECODE_HEVC flag, the H.265 video decoder in the decoding library can be invoked to decode the encoded video data.
[0078] Memory alignment is a technique used in computer programming to improve performance. Computer memory is divided into bytes. Theoretically, it seems that access to any type of variable can start from any address. However, in reality, access to specific types of variables usually occurs at specific memory addresses. This necessitates restrictions on the location of this data in memory. Different data types are arranged in space according to certain rules, rather than being placed sequentially one after another. This is memory alignment. To enable the CPU to access variables quickly, the starting address of a variable should have certain characteristics, known as alignment. For example, a 4-byte `int` should start at a 4-byte boundary, meaning the starting address should be divisible by 4.
[0079] Each video compression format has a corresponding memory alignment method. For example, H.264 video uses 16-bit alignment, with a width of 1920 and a height of 1080 for the encoded video data. H.265 video uses 256-bit odd alignment, with a width of 2304 for the encoded video data and a height of 1080 for the encoded video data.
[0080] To ensure byte alignment, invalid data is padded to each line. Assuming 32-byte alignment, 1000 / 32 = 31.25, therefore each line is padded with 24 bytes of invalid data to reach 1024. When the decoder stores the decoded data in memory, it pads 24 bytes of invalid data for byte alignment for every 1000 actual pixel data stored. During rendering, there's no problem sending the first 1000 bytes of data to the graphics card to display the first line. However, when sending the second line of data to the graphics card, it starts from byte 1001. At this point, the 24 invalid bytes are used as the starting point of the second line, and then concatenated with the first 976 bytes of data. This causes a chain reaction of errors in subsequent lines, resulting in a distorted or garbled image displayed on the client side. Figure 2 As shown, Figure 2 This is a schematic diagram of a client displaying a distorted image, provided by an embodiment of the present invention.
[0081] In one embodiment, the step of setting memory alignment for decoded data in the client includes:
[0082] Adjust the data alignment format of the video encoded data in memory according to the data format size corresponding to the first video compression format.
[0083] To avoid displaying distorted images on the client side, this embodiment adjusts the data alignment format of the video encoded data in memory according to the data format size corresponding to the first video compression format.
[0084] For example, if the width and height of the video encoded data are 1920×1080, but the H.265 data format size is 2304×1080, then the data alignment format of the video encoded data needs to be adjusted from 1920×1080 to 2304×1080 to match the H.265 data format size. This way, during rendering, the client can send a complete 2304 bytes of data to the graphics card to display each line of data, preventing serial splicing and avoiding the display of distorted images on the client side.
[0085] In one embodiment, adjusting the data alignment format of the video encoded data in memory according to the data format size corresponding to the first video compression format includes:
[0086] Based on the data format size corresponding to the first video compression format, the virtual width of the video encoded data is scaled while keeping the virtual height of the video encoded data unchanged to match the data format size corresponding to the first video compression format.
[0087] For example, if the width and height of the video encoded data itself are 1920×1080, and the width of the H.265 memory data alignment format needs to be an odd multiple of 256, i.e. 2304, while the height remains unchanged at 1080, then the virtual width of the video encoded data needs to be scaled from 1920 to 2304 to match the size of the corresponding H.265 data format.
[0088] In one embodiment, the scaling operation on the virtual width of the video encoded data includes:
[0089] A set character is added to the end of each line of the video encoded data to make the virtual width of the video encoded data match the data format size corresponding to the first video compression format.
[0090] Here, the character is set to invalid data, which can be a meaningless character, for example, a meaningless character can be 0.
[0091] When increasing the virtual width of video encoded data, meaningless characters can be added to the end of each line of data to increase the virtual width. For example, in the above embodiment, meaningless characters are added to the end of data with a width of 1920, making the virtual width reach 2304.
[0092] In this embodiment, the data alignment format of the video encoded data in memory is adjusted according to the data format size corresponding to the first video compression format, so that the data alignment format of the video encoded data in memory matches the data format size corresponding to the first video compression format, which can prevent the client from displaying a distorted image.
[0093] refer to Figure 3 , Figure 3 This is a schematic diagram of an H.265 decoder adaptation process provided in an embodiment of the present invention. The H.265 decoder adaptation process includes:
[0094] This embodiment uses an Android system client as the adapted client. The client is debugged through an adaptation mechanism to achieve successful adaptation of the client to the H.265 decoder.
[0095] Taking the H.265 bitstream as an example, the H.265 bitstream corresponds to the video encoded data in the above embodiments. The H.265 bitstream is sent to the client's decoding library. This library contains encapsulation libraries that implement both H.264 and H.265, corresponding to the classes MPP_VIDEO_CodingAVC and MPP_VIDEO_CodingHEVC, respectively. The decoding flag HW_DECODE_AVC can be used to call MPP_VIDEO_CodingAVC for H.264 decoding; the decoding flag HW_DECODE_HEVC can be used to call MPP_VIDEO_CodingHEVC for H.265 decoding. The decoding flag in the client code is modified from HW_DECODE_AVC to HW_DECODE_HEVC.
[0096] After the decoding flag is modified, the H265 bitstream is decoded by calling MPP_VIDEO_CodingHEVC through HW_DECODE_HEVC to obtain a YUV data.
[0097] At the same time, the H265 bitstream is sent into the ffmpeg library, and the H265 decoder already encapsulated in the ffmpeg library is called to decode the H265 bitstream, which can also yield a YUV data.
[0098] Then, both YUV data sets are sent to the ffmpeg library to determine the SSIM value. If the SSIM value is greater than or equal to the threshold, it means that the client has successfully adapted to the H265 decoder; otherwise, the adaptation has failed.
[0099] This invention provides an adaptation mechanism to verify whether a client has successfully adapted to the H.265 decoder. This accurate verification facilitates timely client maintenance by testers, ensuring successful H.265 decoder adaptation and improving client decoding efficiency. Furthermore, this invention adjusts the data alignment format of the video encoded data in memory according to the data format size corresponding to the H.265 video compression format, preventing the client from displaying distorted images.
[0100] It should be understood that the sequence number of each step in the above embodiments does not imply 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 invention.
[0101] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0102] It should be noted that the technical solutions described in the embodiments of the present invention can be combined arbitrarily without conflict.
[0103] In addition, in the embodiments of the present invention, "first," "second," etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0104] refer to Figure 4 , Figure 4 This is a schematic diagram of a video decoder adaptation device provided in an embodiment of the present invention, as shown below. Figure 4 As shown, the device includes:
[0105] The configuration module is used to configure the decoding library on the client side; the decoding library includes various video decoders.
[0106] The first instruction module is used to instruct the client to call the first decoder in the decoding library to read and decode the video encoded data from the server to obtain the first decoded data; wherein, the video encoded data is a first video compression format; the first video compression format is an H265 protocol format or an encoding protocol format evolved from the H265 protocol.
[0107] The second instruction module is used to instruct the client to send the video encoded data to a third-party decoding library for decoding, and to obtain second decoded data from the third-party decoding library; the third-party decoding library includes a standard H.265 decoder or an encoder evolved from the H.265 protocol.
[0108] The determining module is used to determine whether the client has successfully adapted to the first decoder based on the first decoded data and the second decoded data.
[0109] In one embodiment, the configuration module performs a decoding library configuration operation on the client, including:
[0110] In the decoding library, a decoding flag is set; the decoding flag is used to invoke the first decoder.
[0111] The client performs memory alignment settings for the decoded data; these memory alignment settings enable the client to read the video encoded data.
[0112] In one embodiment, the configuration module performs memory alignment settings for decoded data in the client, including:
[0113] Adjust the data alignment format of the video encoded data in memory according to the data format size corresponding to the first video compression format.
[0114] In one embodiment, the configuration module adjusts the data alignment format of the video encoded data in memory according to the data format size corresponding to the first video compression format, including:
[0115] Based on the data format size corresponding to the first video compression format, the virtual width of the video encoded data is scaled while keeping the virtual height of the video encoded data unchanged to match the data format size corresponding to the first video compression format.
[0116] In one embodiment, the configuration module performs a scaling operation on the virtual width of the video encoded data, including:
[0117] A set character is added to the end of each line of the video encoded data to make the virtual width of the video encoded data match the data format size corresponding to the first video compression format.
[0118] In one embodiment, the determining module determines whether the client has successfully adapted to the first decoder based on the first decoded data and the second decoded data, including:
[0119] Determine the similarity between the first decoded data and the second decoded data;
[0120] If the similarity is greater than or equal to the threshold, it is determined that the client has successfully adapted to the first decoder;
[0121] If the similarity is less than the threshold, it is determined that the client has not successfully adapted to the first decoder.
[0122] In one embodiment, the configuration module sets the decoding flag bit in the decoding library, including:
[0123] Modify the original decoding flag bit of the client to the decoding flag bit corresponding to the first video compression format.
[0124] In practical applications, the configuration module, the first indication module, the second indication module, and the determination module can be implemented by processors in the test platform, such as central processing units (CPUs), digital signal processors (DSPs), microcontroller units (MCUs), or field-programmable gate arrays (FPGAs).
[0125] It should be noted that the adaptation device for the video decoder provided in the above embodiments is only illustrated by the division of the above modules. In practical applications, the above processing can be assigned to different modules as needed, that is, the internal structure of the device can be divided into different modules to complete all or part of the processing described above. In addition, the adaptation device and adaptation method embodiments of the video decoder provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0126] The aforementioned video decoder adaptation device can be in the form of an image file. After execution, the image file can run as a container or virtual machine to implement the video decoder adaptation method described in this application. However, it is not limited to the image file format; any software implementation capable of the adaptation method described in this application is within the scope of protection of this application.
[0127] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiments of this application, the embodiments of this application also provide a test platform. Figure 5 This is a schematic diagram of the hardware structure of the test platform in an embodiment of this application, as shown below. Figure 5 As shown, the test platform includes:
[0128] A communication interface enables information exchange with other devices, such as network devices.
[0129] The processor, connected to the communication interface, enables information interaction with other devices and, when running a computer program, executes the methods provided by one or more technical solutions on the test platform side. The computer program is stored in memory.
[0130] Of course, in practical applications, the various components in the test platform are coupled together through a bus system. It can be understood that the bus system is used to achieve communication and connection between these components. In addition to the data bus, the bus system also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 5 The general will label all buses as bus systems.
[0131] The aforementioned testing platform can be in cluster form, such as a cloud computing platform. A cloud computing platform is a business model that uses computing virtualization, network virtualization, and storage virtualization technologies to organize multiple independent server physical hardware resources into a pooled resource. It is a software-defined resource structure based on virtualization technology, providing resource capabilities in the form of virtual machines and containers. By eliminating the fixed relationship between hardware and operating systems, relying on network connectivity for unified resource scheduling, and then providing the necessary virtual resources and services, it represents a new IT software delivery model with characteristics such as flexibility, elasticity, distributed nature, multi-tenancy, and on-demand availability.
[0132] Current cloud computing platforms support several service models:
[0133] SaaS (Software as a Service): Cloud computing platform users do not need to purchase software, but instead rent software deployed on the cloud computing platform. Users do not need to maintain the software, as the software service provider will manage and maintain the software in its entirety.
[0134] PaaS (Platform as a Service): Cloud computing platform users (usually software developers) can build new applications or extend existing applications on the architecture provided by the cloud computing platform without having to purchase development, quality control or production servers.
[0135] IaaS (Infrastructure as a Service): Cloud computing platforms provide data centers, infrastructure hardware and software resources via the Internet. Cloud computing platforms under the IaaS model can provide servers, operating systems, disk storage, databases and / or information resources.
[0136] The memory in this application embodiment is used to store various types of data to support the operation of the test platform. Examples of such data include any computer programs used to operate on the test platform.
[0137] It is understood that memory can be volatile or non-volatile, or both. 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), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. 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 Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM). The memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memory.
[0138] The methods disclosed in the embodiments of this application can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in memory. The processor reads the program from the memory and, in conjunction with its hardware, completes the steps of the aforementioned method.
[0139] Optionally, when the processor executes the program, it implements the corresponding processes implemented by the test platform in the various methods of the embodiments of this application. For the sake of brevity, these will not be described in detail here.
[0140] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a first memory storing a computer program, which can be executed by a processor of a test platform to complete the steps described in the aforementioned method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.
[0141] In the several embodiments provided in this application, it should be understood that the disclosed apparatus, test platform, and method can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0142] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0143] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0144] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
[0145] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
[0146] It should be noted that the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.
[0147] In addition, in this application example, terms such as "first" and "second" are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0148] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for adapting a video decoder, characterized in that, include: Modify the original decoding flags in the client's decoding library to the decoding flags corresponding to the first video compression format; The decoding library includes a variety of video decoders; The first video compression format is the H.265 protocol format or the encoding protocol format evolved from the H.265 protocol; The client is instructed to call the first decoder among the various video decoders through the modified decoding flag to read and decode the video encoded data from the server to obtain the first decoded data; wherein the video encoded data is in a first video compression format; The client is instructed to send the video encoded data to a third-party decoding library for decoding and obtain second decoded data from the third-party decoding library; the third-party decoding library includes a standard H.265 decoder or an encoder evolved from the H.265 protocol. Based on the first decoded data and the second decoded data, determine whether the client has successfully adapted to the first decoder.
2. The method as described in claim 1, characterized in that, The method further includes: The client performs memory alignment settings for the decoded data; these memory alignment settings enable the client to read the video encoded data.
3. The method as described in claim 2, characterized in that, The memory alignment setting for decoding data in the client includes: Adjust the data alignment format of the video encoded data in memory according to the data format size corresponding to the first video compression format.
4. The method as described in claim 3, characterized in that, The step of adjusting the data alignment format of the video encoded data in memory according to the data format size corresponding to the first video compression format includes: Based on the data format size corresponding to the first video compression format, the virtual width of the video encoded data is scaled while keeping the virtual height of the video encoded data unchanged to match the data format size corresponding to the first video compression format.
5. The method as described in claim 4, characterized in that, The scaling operation on the virtual width of the video encoded data includes: Add a specified character to the end of each line of the video encoded data.
6. The adaptation method according to any one of claims 1-5, characterized in that, The step of determining whether the client has successfully adapted to the first decoder based on the first decoded data and the second decoded data includes: Determine the similarity between the first decoded data and the second decoded data; If the similarity is greater than or equal to the threshold, it is determined that the client has successfully adapted to the first decoder; If the similarity is less than the threshold, it is determined that the client has not successfully adapted to the first decoder.
7. An adapter for a video decoder, characterized in that, include: The configuration module is used to modify the original decoding flags in the client's decoding library to the decoding flags corresponding to the first video compression format; The decoding library includes a variety of video decoders; The first video compression format is the H.265 protocol format or the encoding protocol format evolved from the H.265 protocol; The first instruction module is used to instruct the client to call the first decoder in the decoding library through the modified decoding flag to read the video encoded data from the server and decode it to obtain the first decoded data; wherein the video encoded data is in the first video compression format; The second instruction module is used to instruct the client to send the video encoded data to a third-party decoding library for decoding, and to obtain second decoded data from the third-party decoding library; the third-party decoding library includes a standard H.265 decoder or an encoder evolved from the H.265 protocol. The determining module is used to determine whether the client has successfully adapted to the first decoder based on the first decoded data and the second decoded data.
8. A test platform, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the video decoder adaptation method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the adaptation method of the video decoder as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Hardware encoding and decoding support degree detection method, terminal and storage medium
CN111510706A
