Data encoding method, data decoding method, server and terminal equipment

By dynamically adjusting the quantization parameters and strategies of image encoding, the problem of low image encoding efficiency in the prior art is solved according to the visual sensitivity of the macroblock, and a more efficient image encoding and decoding effect is achieved.

CN119299709APending Publication Date: 2025-01-10XIAN WANXIANG ELECTRONICS TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411470993.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

Existing image encoding methods ignore differences in human visual sensitivity in different areas of the image, resulting in low encoding efficiency and degradation of quality in areas with rich details.

Method used

By calculating the visual sensitivity value of each macroblock, dynamically adjusting the quantization parameters and coding strategies, retaining more details and texture information in high-sensitivity areas, reducing the code rate in low-sensitivity areas, and adopting different coding strategies to improve overall coding efficiency.

Benefits of technology

Without affecting the size of the code stream, the visual quality and encoding efficiency of the image are significantly improved, especially suitable for network video transmission and mobile devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299709A_ABST
    Figure CN119299709A_ABST
Patent Text Reader

Abstract

The invention provides a data encoding method, a data decoding method, terminal equipment and a server, relates to the technical field of electronic information, and can solve the problem of low image encoding processing efficiency. According to the specific technical scheme, the coding parameter of each macro block is dynamically adjusted according to the visual sensitive value of the image content, so that the characteristics of a human visual system can be more effectively utilized, the visual quality is maintained or improved, the coding time length and the code stream size are reduced, and the transmission speed is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of electronic information technology, and in particular to data encoding, decoding methods, servers and terminal devices. Background Art

[0002] With the rapid development of image processing technology, image coding is a key link in image processing. Its goal is to reduce the amount of data storage and transmission as much as possible while ensuring image quality. Traditional image coding methods often use a unified quantization parameter to process the entire image, ignoring the differences in human visual sensitivity in different areas of the image, resulting in low coding efficiency and quality degradation in areas with rich details. Summary of the invention

[0003] The disclosed embodiment provides a data encoding and decoding method, a server and a terminal device, which can solve the problem of large data volume in the existing data encoding process. The technical solution is as follows:

[0004] According to a first aspect of an embodiment of the present disclosure, a data encoding method is provided, the method comprising:

[0005] Acquire a target frame image, where the target frame image includes M*N macroblocks;

[0006] Traversing the M*N macroblocks, and determining the visual sensitivity value of each macroblock one by one;

[0007] Determining a target quantization parameter value in encoding processing of each macroblock according to the visual sensitivity value of each macroblock;

[0008] According to the target quantization parameter value in the encoding process of each macroblock, encoding and processing each macroblock to generate target data;

[0009] The encoding process for each macroblock includes:

[0010] If the target quantization parameter value of the current macroblock is greater than a preset threshold, the current macroblock is processed using a first encoding strategy, otherwise, the current macroblock is processed using a second encoding strategy, wherein the encoding quality of the second encoding strategy is higher than the encoding quality of the first encoding strategy.

[0011] The encoding method provided in the embodiment of the present application determines the encoding strategies for different macroblocks by calculating the human eye perception degree matched by each macroblock in different frame images. A smaller quantization parameter (QP) is used in areas with higher human eye perception, which can retain more details and texture information and reduce distortion in the encoding process. A larger QP value is used in areas with lower perception, which can greatly reduce the bit rate without significantly affecting the visual quality, thereby improving the overall encoding efficiency.

[0012] According to a second aspect of an embodiment of the present disclosure, a data decoding method is provided, the method comprising:

[0013] Acquire target data, where the target data includes at least first coded data and second coded data;

[0014] Decoding and processing the target data to obtain a first type of macroblock and a second type of macroblock;

[0015] The first type of macroblock and the second type of macroblock are merged to obtain a target frame image;

[0016] The first coded data refers to data generated by encoding a first type of macroblock, and a target quantization parameter value of the first type of macroblock is greater than a preset threshold;

[0017] The second coded data refers to data generated by encoding the first type of macroblock, and the target quantization parameter value of the first type of macroblock is less than or equal to the preset threshold;

[0018] The encoding quality of the second encoded data is higher than the encoding quality of the first encoded data;

[0019] The target quantization parameter value of the macroblock is determined according to the visual sensitivity value of each macroblock.

[0020] According to a third aspect of an embodiment of the present disclosure, a server is provided, comprising: a processor and a memory storing a computer program executable on the processor, wherein the processor implements the steps of the data encoding method as described in the above example when executing the computer program.

[0021] According to a fourth aspect of an embodiment of the present disclosure, a terminal device is provided, comprising: a processor and a memory storing a computer program executable on the processor, wherein the processor implements the steps of the data decoding method as described in the above example when executing the computer program.

[0022] The decoding method provided in the embodiment of the present application can determine the human eye perception degree matched by each macroblock in different frame images, and classify and process different macroblocks according to the human eye perception. The decoding quality of areas with low visual sensitivity or fewer details will be set to a relatively low level to save decoding resources; while areas with high visual sensitivity or rich details will obtain higher decoding quality to ensure that the image maintains clarity and details in these key areas; different decoding strategies for different macroblocks can retain more effective information without affecting the size of the bitstream.

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

[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0025] Figure 1A is a framework diagram 1 of a data processing system provided by an embodiment of the present disclosure;

[0026] Figure 1B It is a framework of a data processing system provided by the embodiment of the present disclosure Figure 2 ;

[0027] Figure 2 is a flow chart of a data encoding method provided by an embodiment of the present disclosure;

[0028] Figure 3 It is a flowchart of a data decoding method provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numerals in different drawings represent the same or similar elements.

[0030] The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0031] Existing coding methods usually use fixed-size macroblocks for coding, ignoring the differences in visual importance of image content. The human eye has different visual sensitivity values ​​for different areas. It is more sensitive to distortion in high-sensitivity areas (such as edges and areas with rich textures), and has a higher tolerance for distortion in low-sensitivity areas (such as smooth areas). Therefore, adaptively adjusting the coding strategy and coding parameters according to the visual sensitivity value can more effectively utilize coding resources and improve coding efficiency and visual effects.

[0032] With the advancement of technology, the terminal side will develop in an increasingly lightweight direction, that is, the configuration and structure of the terminal will become simpler and the size will become smaller.

[0033] At present, various zero-terminal solutions have been proposed. The so-called zero-terminal means that the terminal only needs to have a screen, a simple CPU and memory, an image receiving and decoding module for processing images, and a reverse control processing module. This solution can greatly simplify the size and configuration of the mobile terminal. All programs of the zero-terminal run in the cloud server. The zero-terminal uses the corresponding application by accessing the cloud server and controls the corresponding application through reverse control. The server will send the real-time processing screen to the zero-terminal. In this way, for the zero-terminal, it is just like operating locally.

[0034] In the prior art, when using a zero terminal to display some videos, such as playing movies, animations or games, the server encodes the image and sends it to the zero terminal through the network for decoding and display. The existing video encoding scheme effectively removes spatial / temporal redundancy through intra-frame and inter-frame prediction methods, but does not consider the visual redundancy of the video. In real scenes, the human visual system (Human Visual System) HVS can perceive visual information such as brightness, color, texture, direction, spatial frequency, etc. in the video scene. It is selective in sensitivity to different scenes, and different areas or objects have different visual importance. Therefore, it is of great significance to introduce HVS into video encoding. It can compress videos more efficiently and achieve better visual perception effects.

[0035] The method provided in the embodiment of the present application is based on the human visual system, determines the human eye perception degree matched by each macroblock in different frame images, classifies and processes different macroblocks according to the human eye perception degree, and determines different quantization parameters and encoding strategies for different macroblocks, thereby retaining more effective information without affecting the size of the bit stream, so that the visual effect of the image reconstructed at the receiving end is better.

[0036] In the process of encoding and processing video data, the embodiments of the present application can be implemented through compression technology, transmission optimization, and visual perception algorithms. By performing difference encoding, depth information compression, or compression methods based on stereoscopic visual characteristics on stereoscopic video images, the amount of data can be reduced and the image quality can be maintained. At the same time, the bit rate adaptive technology can be used to dynamically adjust the transmission bit rate according to the network bandwidth to ensure smooth transmission under different network conditions.

[0037] The following is a brief description of the application environment of the data encoding and decoding method provided in the embodiment of the present application:

[0038] See also Figure 1AThe system shown in the figure, a data encoding and decoding method provided in the embodiment of the present application is applied to a data processing system, the system 10 includes: a server 101 and a terminal device 102; the server 101 and the terminal device 102 can be connected by wire or wirelessly;

[0039] Server 101, which has image encoding and decoding functions, and the encoding part in this solution is implemented here;

[0040] The terminal device 102 may be a receiving device such as a computer, a mobile phone or a PAD, which is used for the interface and display of images, and the decoding part of this solution is implemented here.

[0041] Please refer to Figure 1B The data stream encoding and decoding process is shown:

[0042] The encoding end (server 101) collects video frame data through the image acquisition module, and then pre-processes the frame data through the encoding module. Through the visual sensitivity value detection and block marking module, the visual sensitivity value of each macroblock is identified, the quantization parameter value of each macroblock is calculated, and the block marking is transmitted to the encoding module. The encoding module encodes and processes according to the size of different macroblocks, generates an encoded code stream, and sends the encoded code stream to the terminal device.

[0043] The decoding end (terminal device 102) obtains the bitstream data sent by the encoding end through the bitstream receiving module, and caches the video bitstream pushed by the encoding end as the data source for decoding; the bitstream cached by the decoding processing module is decoded by the decoding module, and finally the image frame decoded by the module is rendered and displayed.

[0044] In an optional embodiment, the data processing device 102 can be used to display 3D video data, such as a VR device.

[0045] See also Figure 2 The following embodiments take the above-mentioned server or data encoding device as the execution subject, and apply the method provided in the embodiment of the present application to data encoding processing as an example for specific description. The data encoding method provided in the embodiment of the present application includes the following steps 201-203:

[0046] Step 201: Acquire a target frame image.

[0047] The target frame image is the image to be encoded, and its resolution consists of M rows and N columns, forming M*N macroblocks. Each macroblock can be a pixel block of a fixed size. For example, the entire frame image can be initially divided into several initial macroblocks of equal size (such as 16x16, 32x32, etc.). The size of the macroblock can be adjusted according to the specific application scenario, encoding requirements, encoding algorithm and image characteristics.

[0048] The target frame image may be a frame in a target video, and the target video may include data in a 2D format or data in a 3D format.

[0049] Step 202: traverse the M*N macroblocks and determine the visual sensitivity of each macroblock one by one.

[0050] The visual sensitivity value of each macroblock is determined one by one according to the visual sensitivity detection algorithm of the target user. The algorithm can be based on a variety of visual characteristics, such as contrast sensitivity, brightness adaptability, texture masking effect, etc. The output of the algorithm is a numerical value that measures the visual sensitivity value of the macroblock.

[0051] Step 203: Determine a target quantization parameter value in the encoding process of each macroblock according to the visual sensitivity value of each macroblock.

[0052] The QP value (Quantizer Parameter) is a quantization parameter that reflects the compression of spatial details. The smaller the QP value, the finer the quantization, the higher the image quality, and the longer the bitstream generated; as the QP value increases, some details are lost, the bit rate is reduced, but the image distortion is enhanced and the quality is reduced.

[0053] The human eye has different sensitivities to different areas in an image, such as edges, textures, and motion areas. Therefore, adaptively adjusting the QP values ​​of these areas based on visual sensitivity can make the encoded video closer to the original video in subjective perception, thereby improving the viewing experience.

[0054] Different visual elements (such as color, brightness, texture, motion, etc.) are quantized to different degrees according to the visual sensitivity values ​​of different macroblocks. Coarser quantization steps are used in areas with lower visual importance, while finer quantization is used in important areas to reduce the impact of quantization noise on visual quality.

[0055] Step 204: Encode each macroblock according to the target quantization parameter value in the encoding process of each macroblock to generate target data.

[0056] The encoding process for each macroblock includes:

[0057] If the target quantization parameter value of the current macroblock is greater than a preset threshold, the current macroblock is processed using a first encoding strategy, otherwise, the current macroblock is processed using a second encoding strategy, wherein the encoding quality of the second encoding strategy is higher than the encoding quality of the first encoding strategy.

[0058] Among them, the target encoding algorithm can be an existing one such as H.264, HEVC, AV1, etc.

[0059] During the encoding process, the bit rate allocation is dynamically adjusted according to the visual importance of each area: more bits are allocated to important areas to ensure their quality, while less important areas are allocated fewer bits to save bit rate.

[0060] Different types of macroblocks are encoded using a preset encoding algorithm: the encoding quality of the first type of macroblocks (i.e., areas with lower visual sensitivity or fewer details) will be set relatively low to save encoding resources; while the second type of macroblocks (i.e., areas with higher visual sensitivity or rich details) will receive higher encoding quality to ensure that the image maintains clarity and details in these key areas.

[0061] After preliminary encoding, the QP allocation can be further adjusted based on the encoding results. For example, by comparing the difference between the original frame and the encoded frame, the QP value of those areas with large differences can be adjusted to achieve better encoding effects.

[0062] The QP value can also be dynamically adjusted according to the network bandwidth and the real-time processing capability of the device to ensure the smoothness and quality of video transmission.

[0063] The encoding process of the target macroblock can be achieved at least through compression technology, transmission optimization and visual perception. By performing differential encoding, depth information compression or compression methods based on stereoscopic visual characteristics on stereoscopic video images, the amount of data can be reduced and the image quality can be maintained. At the same time, the bit rate adaptation technology can dynamically adjust the transmission bit rate according to the network bandwidth to ensure smooth transmission under different network conditions.

[0064] The encoded macroblocks are combined into complete encoded frames, and necessary post-processing (such as deblocking filtering, intra-frame prediction optimization, etc.) is performed, and finally the encoded video stream is output for transmission or storage.

[0065] The coded macroblocks are combined into complete coded frames and output for transmission or storage.

[0066] At the same time, increasing quantization and reducing the amount of data in areas with lower perception can help reduce the size of video files and the bandwidth required for transmission without sacrificing key visual information. This is particularly suitable for storage-constrained scenarios such as network video transmission and mobile devices.

[0067] The data encoding method provided in this embodiment combines the visual characteristics of the human eye to perform adaptive macroblock division and encoding, thereby achieving the goal of improving video quality while ensuring the size of the bitstream. The encoding algorithm provided in this application does not simply use fixed-size blocks for encoding, but dynamically adjusts the size of the encoded bitstream according to the visual sensitivity value of the image content, thereby more effectively utilizing the characteristics of the human visual system to reduce the encoding time and bitstream size while maintaining or improving visual quality.

[0068] In an optional embodiment, step 202 of the encoding method provided by the present application, determining a target quantization parameter value for each macroblock, includes:

[0069] Step 301: Calculate the brightness information of the pixel position in the current macroblock, and obtain a first visual sensitivity value of the brightness information according to the brightness information;

[0070] Step 302: Calculate texture information of the pixel position in the current macroblock, and obtain a second visual sensitivity value of the brightness information according to the texture information;

[0071] Step 303: Obtain a visual sensitivity value of a current pixel according to the first visual sensitivity value and the second visual sensitivity value.

[0072] Each macroblock includes multiple pixels, and the visual sensitivity value of each pixel can be calculated one by one, and then the visual sensitivity value of the macroblock can be obtained after averaging processing.

[0073] The sensitivity of the human visual system to visual information is not evenly distributed, but depends on multiple factors, including: brightness adaptation, brightness adaptation, texture masking effect, motion masking and visual attention. When judging the perception of the current frame image, multiple factors need to be considered comprehensively.

[0074] For example, the human eye has different sensitivities to different brightness levels, and in particular has a weaker ability to perceive details in dark and bright areas.

[0075] For example, the human eye has different sensitivities to colors. It is usually most sensitive to the green band and relatively less sensitive to blue and red.

[0076] For example, complex textured areas can mask small distortion or compression artifacts.

[0077] For example, in a dynamic scene, fast-moving objects can mask a certain degree of compression noise.

[0078] For example, when humans watch videos, they tend to pay more attention to certain areas in the picture (such as faces, text, moving objects, etc.).

[0079] Therefore, it is necessary to comprehensively consider multiple factors (brightness information, texture information, motion information, mask information or attention) to calculate the visual sensitivity value of the current macroblock.

[0080] When calculating the visual sensitivity value of the current macroblock, you can refer to the following calculation formula:

[0081] This paper uses JND (just noticeable difference) as a measure of the sensitivity of HVS to distortion. The JND value of a single pixel is calculated as follows.

[0082] P(i,j)=T L (i,j)+T t (i,j)

[0083] Where i and j represent the coordinate position information of the pixel in the current macroblock, P(i, j) is the JND value of a pixel in an image; L(i, j) is used to indicate the brightness information of the current macroblock; T t (i, j) is used to indicate the texture information of the current macroblock

[0084] In an optional embodiment, in step 302 of the encoding method provided by the present application, obtaining the first visual sensitivity value of the brightness information according to the brightness information includes:

[0085] The visual sensitivity value of the current macroblock is calculated according to the first calculation formula and the first factor (brightness value) of the pixels in the macroblock, wherein the first calculation formula includes:

[0086] In the first brightness interval, the first factor of the pixel is in increasing relationship with the visual sensitivity value;

[0087] In the second brightness range, the first factor of the pixel is in a decreasing relationship with the visual sensitivity value;

[0088] In the area where the first brightness interval and the second brightness interval overlap, the value of the first factor of the pixel, the visual sensitivity value, is the largest among all brightness intervals.

[0089] Here is a specific example, the first calculation formula includes:

[0090]

[0091] The functional relationship between the background brightness L(i, j) and is described as follows: in the low brightness area L(i, j) < 127, the sensitivity of the human eye and the background brightness are in an increasing relationship; in the high brightness area L(i, j) ≥ 127, the sensitivity of the human eye and the background brightness are in a linear decreasing relationship; when L(i, j) = 127, the sensitivity of the human eye reaches its maximum value.

[0092] The embodiment of the present application can more accurately determine the visual sensitivity value of a pixel by calculating the brightness information of a macroblock, thereby improving the efficiency of subsequent encoding processing.

[0093] In an optional embodiment, in step 302 of the encoding method provided by the present application, obtaining the second visual sensitivity value of the brightness information according to the position information includes:

[0094] Obtain the average gradient weight and pixel strength value within a preset range of pixels;

[0095] The visual sensitivity value of the current macroblock is calculated based on the average gradient weight within a preset range of pixels and the strength value of the pixel edge.

[0096] Here is a specific example, the second calculation formula includes a texture shielding model:

[0097] T t (i,j)=β×g(i,j)×e(i,j)

[0098] Where β is the control parameter, g(i,j) represents the average gradient weight near the pixel, and e(i,j) is the strength value of the pixel edge.

[0099] According to the above calculation results, it can be seen that the detail-rich area can hide more errors than the flat area, so the visual sensitivity value of the pixel in the detail-rich area is larger than the visual sensitivity value of the pixel in the flat area.

[0100] The embodiment of the present application can more accurately determine the visual sensitivity value of a pixel by calculating the texture information of a macroblock, thereby improving the efficiency of subsequent encoding processing.

[0101] In an optional embodiment, the step of obtaining the strength value of a pixel in the encoding method provided by the present application includes:

[0102] Get the weighting factor that matches the current pixel position;

[0103] The weighting factor is processed by a Gaussian low-pass filter to obtain the strength value of the pixel edge.

[0104] e(i,j) represents the edge strength of the pixel at position (i,j) in the image. Edge strength is an indicator of the degree of edge prominence at the pixel position. Edges usually appear where the grayscale value (or color value) in the image changes significantly.

[0105] For example, based on the following calculation model:

[0106]

[0107]

[0108] In the above calculation model, H is a Gaussian low-pass filter with a size of mxm and a standard deviation of δ. A Gaussian low-pass filter is a filter used to smooth images and reduce noise. Its weight distribution follows the Gaussian function, that is, the center weight is large and the edge weight is small. The standard deviation δ determines the width of the weight distribution.

[0109] In the above calculation model, is a coefficient used to adjust the contribution of different regions to the edge strength calculation, for example:

[0110] In the flat area (i.e. the area with small gray value changes in the image), Assigned a smaller value (e.g. 0.1), indicating that these regions contribute less to the edge strength.

[0111] In the edge area (i.e. the area where the gray value of the image begins to change significantly), Moderate values ​​of (e.g., 0.3) indicate that these regions contribute moderately to the edge strength.

[0112] In texture pixels (i.e. areas in the image with very complex grayscale value changes and rich details), The maximum value (e.g. 1) is assigned to these regions, indicating that these regions contribute the most to the edge strength.

[0113] The embodiment of the present application introduces a weighting factor b and a Gaussian low-pass filter h to quantify the edge strength of each pixel in the image. The value of the weighting factor varies according to the different regions where the pixel is located, so that the strength of the edge in the image can be more accurately reflected, the visual sensitivity value of the pixel can be more accurately determined, and the efficiency of subsequent encoding processing is improved.

[0114] In an optional embodiment, determining the target quantization parameter value of each macroblock one by one in step 203 of the encoding method provided by the present application includes:

[0115] Step 401: Obtain the visual sensitivity value of each pixel in the current macroblock.

[0116] Visual sensitivity analysis mainly refers to the process of quantitatively evaluating the sensitivity of the human eye to visual stimuli, including the ability to perceive and distinguish small objects from a certain distance, the recognition of light brightness, distance, image front and back, and spatial relationships, etc. The calculation of visual sensitivity values ​​can include: HVS model (Human Visual System model), contrast sensitivity function (CSF) model, visual masking effect model, and artificial intelligence learning, etc. The subsequent steps are described in terms of the HVS model:

[0117] Step 402: Obtain the visual sensitivity value of the current macroblock according to the visual sensitivity value of each pixel in the current macroblock;

[0118] The visual sensitivity value of the macroblock can be obtained by calculating the average or weighted average of the JND values ​​of all pixels inside it.

[0119] For example, the visual sensitivity value of each pixel may be obtained according to a visual sensitivity calculation formula, wherein the visual sensitivity calculation formula includes:

[0120]

[0121] Among them, P(i,j) is used to indicate the visual sensitivity value of the pixel in the current macroblock, w and n are used to indicate the resolution of the current pixel, w is used to indicate the pixel point in the horizontal direction of the current pixel, and h is used to indicate the pixel point in the vertical direction of the current pixel.

[0122] Step 403: Calculate the target quantization parameter value of the current macroblock according to the mean value of the visual sensitivity value of the current macroblock and the target factor.

[0123] The target factors include at least: application scenario, target network and initial quantization parameters.

[0124] The encoding method provided in the embodiment of the present application dynamically adjusts encoding parameters (such as quantization parameters, transform size, etc.) according to parameters such as the visual sensitivity value and size of the macroblock, so as to reduce the bitstream size and encoding time while maintaining the visual quality. Finally, a video file or data stream containing the encoded image data is generated.

[0125] The macroblocks in the cache area are encoded by HEVC (High Efficiency Video Coding), AVC (Advanced Video Coding) and other coding algorithms, and the quantization parameter QP and the coding mode are dynamically adjusted according to the size of the block. Finally, the encoded macroblocks are combined into a complete coded frame and output to the video transmission system. The experimental results show that the method of the present invention can significantly improve the visual quality of the reconstructed image while keeping the code stream size similar.

[0126] For smaller macroblocks (high-sensitivity areas), more sophisticated coding parameters are used, such as higher quantization parameters QP, more coding modes, and more sophisticated motion estimation, to ensure the coding quality of these areas and reduce visual distortion.

[0127] For larger macroblocks (low-sensitivity areas), a higher compression rate is used to reduce the code stream size and improve coding efficiency by reducing coding information, using coarser quantization, skipping some coding steps, etc.

[0128] The visual sensitivity value coding method of the present invention realizes the refined processing of image content by dynamically adjusting the macroblock coding strategy and coding parameters. The method can significantly improve the coding efficiency while ensuring the visual quality of the reconstructed image, and is particularly suitable for application scenarios where bandwidth resources are limited but high-quality video transmission is required.

[0129] See also Figure 3 The following embodiments take the above-mentioned terminal device or data decoding device as the execution subject, and apply the method provided in the embodiment of the present application to data decoding processing as an example for specific description. The data decoding method provided in the embodiment of the present application includes the following steps 701-703:

[0130] Step 701: Obtain target data;

[0131] The target data includes at least first encoded data and second encoded data.

[0132] The first coded data refers to data generated by encoding a first type of macroblock, and a target quantization parameter value of the first type of macroblock is greater than a preset threshold;

[0133] The second coded data refers to data generated by encoding the first type of macroblock, and the target quantization parameter value of the first type of macroblock is less than or equal to the preset threshold;

[0134] The encoding quality of the second encoded data is higher than the encoding quality of the first encoded data;

[0135] The target quantization parameter value of the macroblock is determined according to the visual sensitivity value of each macroblock.

[0136] As described in the above steps 201 to 205, both the first coded data and the second coded data are from the target frame data, which will not be described in detail here.

[0137] Step 702: Decode and process the target data to obtain a first type macroblock and a second type macroblock.

[0138] Step 703: The first-type macroblock and the second-type macroblock are merged to obtain a target frame image.

[0139] According to the position information of different macroblocks, the first type of macroblocks and the second type of macroblocks are fused to obtain the target frame image.

[0140] The visual sensitivity value-based decoding method of the present invention obtains different coded data of different types of macroblocks in the same frame image. The coded data of the macroblock is generated by dynamically adjusting the macroblock quantization parameter and coding strategy according to the visual sensitivity value of the macroblock, thereby realizing refined processing of the image content. The method can significantly improve the decoding efficiency while ensuring the visual quality of the reconstructed image, and is particularly suitable for application scenarios with limited bandwidth resources but requiring high-quality video transmission.

[0141] An embodiment of the present disclosure provides a server, comprising: a processor and a memory storing a computer program that can be run on the processor, wherein the processor implements the steps of the data encoding method in the above embodiment when executing the computer program.

[0142] For the specific definition of the above-mentioned server, please refer to the definition of the data encoding method above, which will not be repeated here. Each module in the above-mentioned data processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0143] In an embodiment of the present disclosure, a terminal device is provided, on which a computer program is stored. When the computer program is executed by a processor, any step in the above data decoding method can be implemented.

[0144] For the specific definition of the above-mentioned terminal device, please refer to the definition of the data encoding method above, which will not be repeated here. Each module in the above-mentioned data processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0145] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0146] The present application is described with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, and the combination of the process and / or box in the flowchart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.

[0147] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0148] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data encoding method, characterized in that: The method comprises: Acquire a target frame image, where the target frame image includes M*N macroblocks; Traversing the M*N macroblocks, and determining the visual sensitivity value of each macroblock one by one; Determining a target quantization parameter value in encoding processing of each macroblock according to the visual sensitivity value of each macroblock; According to the target quantization parameter value in the encoding process of each macroblock, encoding and processing each macroblock to generate target data; The encoding process for each macroblock includes: If the target quantization parameter value of the current macroblock is greater than a preset threshold, the current macroblock is processed using a first encoding strategy, otherwise, the current macroblock is processed using a second encoding strategy, wherein the encoding quality of the second encoding strategy is higher than the encoding quality of the first encoding strategy.

2. The data encoding method according to claim 1, characterized in that: The determining of the target quantization parameter value of each macroblock includes: Get the visual sensitivity value of each pixel in the current macroblock; According to the visual sensitivity value of each pixel in the current macroblock, obtain the mean visual sensitivity value of the current macroblock; Calculate the target quantization parameter value of the current macroblock according to the visual sensitivity value mean value of the current macroblock and the quantization parameter calculation formula, The quantization parameter calculation formula includes: Among them, QP is used to indicate the target quantization parameter value of the current macroblock; QP org Used to indicate the initial quantization parameter; C is used to indicate the target weight of the current scene; d is used to indicate the visual sensitivity value of the current macroblock; np is used to indicate the target network parameters of the current macroblock.

3. The data encoding method according to claim 2, characterized in that: Obtaining the visual sensitivity value of the current macroblock, including: According to the visual sensitivity calculation formula and the visual sensitivity value of each pixel in the current macroblock, the mean visual sensitivity value of the current macroblock is obtained; Among them, the visual sensitivity calculation formula includes: Among them, P(i, j) is used to indicate the visual sensitivity value of the pixel in the current macroblock, w and n are used to indicate the resolution of the current pixel, w is used to indicate the pixel point in the horizontal direction of the current pixel, and h is used to indicate the pixel point in the vertical direction of the current pixel.

4. The data encoding method according to claim 1, characterized in that: Determining the visual sensitivity value of each macroblock includes: Obtaining brightness information and texture information of each pixel in the initial macroblock; Processing the brightness information and texture information of each pixel in the initial macroblock by a target calculation formula to calculate the visual sensitivity value of the initial macroblock; Wherein, the target calculation formula includes: P(i,j)=T L (i,j)+T t (i,j) Among them, P(i,j) is used to indicate the visual sensitivity value of the current pixel; T L (i, j) is used to indicate the brightness information of the current pixel position. T t (i, j) is used to indicate the texture information of the current pixel location.

5. The data encoding method according to claim 4, characterized in that: Calculate the visual sensitivity value of the initial macroblock, including: The visual sensitivity value of the initial macroblock is calculated according to the first calculation formula and the brightness information of the pixel position in the macroblock, wherein the first calculation formula is used to indicate: In the first brightness interval, the brightness value of the pixel position is in an increasing relationship with the visual sensitivity value; In the second brightness interval, the brightness value of the pixel position is in a decreasing relationship with the visual sensitivity value; In the area where the first brightness interval and the second brightness interval overlap, the brightness value at the pixel location is the largest among all brightness intervals of the visual sensitivity value.

6. The data encoding method according to claim 4, characterized in that: Calculate the visual sensitivity value of the initial macroblock, including: The texture information of the pixel position in the macroblock is processed according to the second calculation formula to calculate the visual sensitivity value of the initial macroblock, wherein the second calculation formula includes: T t (i,j)=β×g(i,j)×e(i,j) Where β is used to indicate the preset control parameter; g(i,j) is used to indicate the average gradient weight near the current pixel; e(i,j) is used to indicate the strength of the pixel edge.

7. The data encoding method according to claim 1, characterized in that: The step of obtaining the strength value of the pixel edge includes: Get the weighting factor that matches the current pixel position; The weighting factor is processed by a Gaussian low-pass filter to obtain the strength value of the pixel edge.

8. A data decoding method, characterized in that: The method comprises: Acquire target data, where the target data includes at least first coded data and second coded data; Decoding and processing the target data to obtain a first type of macroblock and a second type of macroblock; The first type of macroblock and the second type of macroblock are merged to obtain a target frame image; The first coded data refers to data generated by encoding a first type of macroblock, and a target quantization parameter value of the first type of macroblock is greater than a preset threshold; The second coded data refers to data generated by encoding the first type of macroblock, and the target quantization parameter value of the first type of macroblock is less than or equal to the preset threshold; The encoding quality of the second encoded data is higher than the encoding quality of the first encoded data; The target quantization parameter value of the macroblock is determined according to the visual sensitivity value of each macroblock.

9. A server, characterized in that: The server comprises: a processor and a memory storing a computer program executable on the processor, wherein the processor implements the steps of the data encoding method according to any one of claims 1 to 7 when executing the computer program.

10. A terminal device, characterized in that: Computer executable instructions are stored, and the computer executable instructions are used to execute the data decoding method described in claim 8.

Citation Information

Cited By

  • Image compression method and device, equipment, medium and product

    CN121284254A