A video encoding method and device based on JND algorithm, medium and computing device
By employing the JND algorithm in video encoding and combining it with a non-JND algorithm for dual encoding, the problems of visual redundancy and bitrate control failure in traditional video encoding are solved, achieving a reduction in the amount of encoded data and effective bitrate control.
Patent Information
- Application Number
- CN202111301894.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-04
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2041-11-04
AI Technical Summary
Traditional video coding techniques fail to effectively consider the characteristics of the human visual system, resulting in a large amount of visual redundancy, and the bitrate control algorithm may cause the JND algorithm to fail.
Video encoding is performed using the JND algorithm, combined with a non-JND algorithm as input to the rate control algorithm. Two encoding calculations are performed to output the actual encoded data and determine the encoding parameters of subsequent video frames, thus avoiding the influence of the rate control algorithm on the JND algorithm.
By reducing visual redundancy and decreasing the amount of encoded data in video frames, while avoiding JND algorithm failure caused by the bitrate control algorithm, effective bitrate control is achieved.
Smart Images

Figure CN114189684B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present disclosure relate to the field of video coding, and more particularly, to a JND algorithm based video coding method, device, medium and computing equipment. BACKGROUND
[0002] This section is intended to provide background information to the embodiments of the present disclosure recited in the claims. The description herein does not constitute admission of prior art.
[0003] Video coding refers to converting a file in an original video format into another video format file through compression technology. Video is a sequence of continuous images, which is composed of continuous frames, and a frame is an image. Since the similarity between consecutive frames is very high, we need to compress and encode the original video to remove the redundant information in the video data for the purpose of storage and transmission.
[0004] Traditional video coding technology mainly compresses and encodes spatial domain redundancy, temporal domain redundancy and statistical redundancy, and rarely considers the characteristics of human visual system and psychological effects, so there is a lot of visual redundancy. SUMMARY
[0005] In this context, embodiments of the present disclosure aim to provide a JND algorithm based video coding method and device.
[0006] In a first aspect of the embodiments of the present disclosure, a JND algorithm based video coding method is provided, comprising:
[0007] calculating the residual error of each to-be-encoded coding unit in a to-be-encoded video frame in the video;
[0008] obtaining the coding result of any video frame before the to-be-encoded video frame; wherein the coding result of the any video frame at least includes first coding data, the first coding data includes coding data obtained by encoding the residual error of each to-be-encoded coding unit in the any video frame based on a non-JND algorithm using parameters corresponding to the any video frame; and the parameters include parameters for coding calculated based on a preset rate control algorithm;
[0009] using the first coding data as the input of the preset rate control algorithm to calculate the parameters corresponding to the video frame;
[0010] based on the preset JND algorithm, encode the residual of each to-be-encoded coding unit in the video frame using parameters corresponding to the video frame to obtain second encoding data, and output the second encoding data as actual encoding data; and based on a non-JND algorithm, encode the residual of each to-be-encoded coding unit in the video frame using parameters corresponding to the video frame to obtain third encoding data; wherein the third encoding data is used as an input of the preset rate control algorithm to calculate encoding parameters corresponding to any video frame after the video frame.
[0011] In an embodiment of the present disclosure, the calculating the residual of each to-be-encoded coding unit in the to-be-encoded video frame in the video comprises:
[0012] In an embodiment of the present disclosure, the calculating the residual of each to-be-encoded coding unit in the to-be-encoded video frame in the video comprises:
[0013] In an embodiment of the present disclosure, the calculating the residual of each to-be-encoded coding unit in the to-be-encoded video frame in the video comprises:
[0014] In an embodiment of the present disclosure, the coding unit comprises a macroblock or a CTU (coding tree unit).
[0015] In an embodiment of the present disclosure, the preset JND algorithm comprises a JND algorithm applied to a pixel domain.
[0016] In an embodiment of the present disclosure, the encoding the residual of each to-be-encoded coding unit in the video frame using parameters corresponding to the video frame based on the preset JND algorithm to obtain second encoding data comprises:
[0017] In an embodiment of the present disclosure, the calculating the JND coefficient of each to-be-encoded coding unit in the video frame based on the JND algorithm applied to the pixel domain comprises:
[0018] In an embodiment of the present disclosure, the calculating the residual of each to-be-encoded coding unit in the video frame and the difference value of the JND coefficient, and using parameters corresponding to the video frame to transform, quantize and entropy encode the difference value to determine the encoding data corresponding to each to-be-encoded coding unit in the video frame comprises:
[0019] In an embodiment of the present disclosure, the preset JND algorithm comprises a JND algorithm applied to a transform domain.
[0020] In an embodiment of the present disclosure, the encoding the residual of each to-be-encoded coding unit in the video frame using parameters corresponding to the video frame based on the preset JND algorithm to obtain second encoding data comprises:
[0021] performing DCT (Discrete Cosine Transform) on the residual of each to-be-encoded coding unit in the video frame to determine a DCT coefficient corresponding to each to-be-encoded coding unit in the video frame;
[0022] determining a JND coefficient corresponding to each to-be-encoded coding unit in the video frame according to the DCT coefficient based on the JND algorithm in the transform domain;
[0023] calculating a difference between the DCT coefficient and the JND coefficient corresponding to each to-be-encoded coding unit in the video frame, and quantizing and entropy encoding the difference using a parameter corresponding to the video frame to determine encoding data corresponding to each to-be-encoded coding unit in the video frame.
[0024] In an embodiment of the present disclosure, the parameter includes a quantization parameter.
[0025] The inputting the first encoding data into the preset rate control algorithm to calculate the parameter corresponding to the video frame includes:
[0026] obtaining first encoding data of any video frame before the to-be-encoded video frame, inputting the first encoding data into the preset rate control algorithm to predict encoding data of the to-be-encoded video frame by the preset rate control algorithm;
[0027] calculating a quantization parameter corresponding to the video frame according to the predicted encoding data of the to-be-encoded video frame.
[0028] In a second aspect of the embodiments of the present disclosure, a video encoding device based on a JND algorithm is provided, which includes:
[0029] a residual calculation module configured to calculate a residual of each to-be-encoded coding unit in a to-be-encoded video frame in a video;
[0030] an obtaining module configured to obtain an encoding result of any video frame before the to-be-encoded video frame; wherein the encoding result of the any video frame at least includes first encoding data, the first encoding data including encoding data obtained by encoding a residual of each to-be-encoded coding unit in the any video frame based on a non-JND algorithm using a parameter corresponding to the any video frame; and the parameter including a parameter for encoding calculated based on a preset rate control algorithm;
[0031] a rate control module configured to input the first encoding data into the preset rate control algorithm to calculate a parameter corresponding to the video frame;
[0032] The encoding module encodes the residual of each to-be-encoded coding unit in the video frame based on a preset JND algorithm using parameters corresponding to the video frame to obtain second encoding data, and outputs the second encoding data as actual encoding data; and encodes the residual of each to-be-encoded coding unit in the video frame based on a non-JND algorithm using parameters corresponding to the video frame to obtain third encoding data; wherein the third encoding data is used as an input of the preset rate control algorithm to calculate encoding parameters corresponding to any subsequent video frame of the video frame.
[0033] In a third aspect of the embodiments of the present disclosure, a storage medium is provided; computer instructions are stored on the storage medium, and the instructions are executed by a processor to implement the steps of the following method:
[0034] The residual of each to-be-encoded coding unit in the to-be-encoded video frame is calculated.
[0035] The encoding result of any video frame before the to-be-encoded video frame is obtained; wherein the encoding result of the any video frame at least includes first encoding data, and the first encoding data includes encoding data obtained by encoding the residual of each to-be-encoded coding unit in the any video frame based on a non-JND algorithm using parameters corresponding to the any video frame; and the parameters include parameters calculated based on a preset rate control algorithm for encoding.
[0036] The first encoding data is used as an input of the preset rate control algorithm to calculate parameters corresponding to the video frame.
[0037] The residual of each to-be-encoded coding unit in the video frame is encoded based on a preset JND algorithm using parameters corresponding to the video frame to obtain second encoding data, and the second encoding data is outputted as actual encoding data; and the residual of each to-be-encoded coding unit in the video frame is encoded based on a non-JND algorithm using parameters corresponding to the video frame to obtain third encoding data; wherein the third encoding data is used as an input of the preset rate control algorithm to calculate encoding parameters corresponding to any subsequent video frame of the video frame.
[0038] In a fourth aspect of the embodiments of the present disclosure, a computing device is provided, comprising:
[0039] A processor; and a memory for storing processor-executable instructions.
[0040] The processor implements the steps of the following method by running the executable instructions.
[0041] residuals of each to-be-encoded coding unit in a to-be-encoded video frame in a video are calculated;
[0042] an encoding result of any video frame before the to-be-encoded video frame is obtained; wherein the encoding result of the any video frame at least comprises first encoding data, the first encoding data comprises encoding data obtained by encoding residuals of each to-be-encoded coding unit in the any video frame based on a non-JND algorithm using parameters corresponding to the any video frame; the parameters comprise parameters used for encoding calculated based on a preset rate control algorithm;
[0043] the first encoding data is used as input of the preset rate control algorithm to calculate parameters corresponding to the video frame;
[0044] the residuals of each to-be-encoded coding unit in the video frame are encoded based on a preset JND algorithm using parameters corresponding to the video frame to obtain second encoding data, and the second encoding data is output as actual encoding data; and the residuals of each to-be-encoded coding unit in the video frame are encoded based on a non-JND algorithm using parameters corresponding to the video frame to obtain third encoding data; wherein the third encoding data is used as input of the preset rate control algorithm to calculate encoding parameters corresponding to any video frame after the video frame.
[0045] The above embodiments of the present disclosure have at least the following beneficial effects:
[0046] On the one hand, since the encoding data obtained based on the JND algorithm is used when the actual encoding data is output, visual redundancy can be reduced and the amount of encoding data of the video frame can be reduced; on the other hand, since the encoding data obtained based on the non-JND algorithm is used as input of the rate control algorithm, the problem that the rate control algorithm causes the JND algorithm to fail can be avoided, and at the same time, the encoding parameters corresponding to the subsequent video frame can be determined by the rate control algorithm, so that the rate is controlled within a certain range. BRIEF DESCRIPTION OF DRAWINGS
[0047] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will be more apparent from the following detailed description taken in conjunction with the accompanying drawings, in which:
[0048] FIG. 1 a schematic diagram of a rate control process according to an embodiment of the present disclosure is schematically shown;
[0049] FIG. 2A flow chart of a JND algorithm based video encoding method according to an embodiment of the present disclosure is schematically shown;
[0050] FIG. 3 A block diagram of a JND algorithm based video encoding apparatus according to an embodiment of the present disclosure is schematically shown;
[0051] FIG. 4 A schematic view of a JND algorithm based video encoding medium according to an embodiment of the present disclosure is schematically shown;
[0052] FIG. 5 A schematic view of an electronic device capable of implementing the above method according to an embodiment of the present disclosure is schematically shown.
[0053] In the drawings, identical or corresponding reference signs indicate identical or corresponding parts. DETAILED DESCRIPTION
[0054] The principles and spirits of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are given only to enable those skilled in the art to better understand and implement the present disclosure, and not to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0055] Those skilled in the art know that the embodiments of the present disclosure can be implemented as a system, apparatus, device, method or computer readable storage medium. Therefore, the present disclosure can be embodied in the form of a complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0056] According to embodiments of the present disclosure, a JND algorithm based video encoding method, apparatus, medium and computing device are provided.
[0057] In this document, it should be understood that any number of elements in the drawings are used to illustrate rather than to limit, and any naming is only for distinction and does not have any limiting meaning.
[0058] The principles and spirits of the present disclosure will be described below with reference to several representative embodiments of the present disclosure. SUMMARY
[0060] The inventor finds that when the JND algorithm is used for video encoding, although the visual redundancy can be reduced and the encoding data amount of the video frame can be reduced, due to the existence of the code rate control algorithm, the video data is encoded according to the specified output code rate, and therefore, when the code rate control algorithm finds that the encoding data amount is less than the specified output code rate, the encoding data amount is increased to the specified output code rate to realize the adaptive adjustment of the output code rate. It can be seen that the adaptive adjustment of the code rate control algorithm can cause the JND algorithm to fail.
[0061] Therefore, the present specification provides a technical solution that performs twice calculation when encoding the video frame, once based on the JND algorithm to obtain the encoding data used as the actual encoding data for output, and once based on the non-JND algorithm to obtain the encoding data used as the input of the code rate control algorithm to determine the encoding parameters used when encoding the subsequent video frame, thereby avoiding the failure of the JND algorithm caused by the existence of the code rate control algorithm, and realizing the technical solution of reducing the visual redundancy and the encoding data amount by using the JND algorithm.
[0062] The core technical concept of the present specification is that:
[0063] Since the encoding data obtained by using the JND algorithm as the input of the code rate control algorithm can cause the adaptive adjustment of the code rate control algorithm, an additional encoding based on the non-JND algorithm can be performed, and the encoding data obtained by using the non-JND algorithm as the input of the code rate control algorithm, so that the failure problem caused by the adjustment of the encoding data obtained by using the JND algorithm as the input of the code rate control algorithm can be avoided. The JND algorithm is introduced to effectively reduce the visual redundancy and the encoding data amount of the video frame, and therefore, the encoding data obtained by using the JND algorithm can be output as the actual encoding data.
[0064] Through the above technical solution, on the one hand, since the encoding data obtained by using the JND algorithm is used as the actual encoding data for output, the visual redundancy can be reduced and the encoding data amount of the video frame can be reduced; on the other hand, since the encoding data obtained by using the non-JND algorithm is used as the input of the code rate control algorithm, the problem that the JND algorithm fails due to the code rate control algorithm can be avoided, and at the same time, the encoding parameters corresponding to the subsequent video frame can be determined by the code rate control algorithm, so that the code rate can be controlled within a certain range.
[0065] After introducing the basic principle of the present disclosure, the various non-limiting embodiments of the present disclosure will be specifically introduced below.
[0066] Overview of Application Scenarios
[0067] When transmitting compressed video, the video quality and transmission bandwidth need to be considered. If the bandwidth is large, the video with higher quality is transmitted as much as possible, and the code rate can be increased. If the bandwidth is low, the compression ratio needs to be increased to reduce the code rate. If the bandwidth dynamically changes, the code rate also needs to dynamically change to adapt to the change of the bandwidth. It can be seen that, limited by the transmission bandwidth, the encoding code rate needs to be controlled so that the encoding code rate matches the upper limit of the transmission bandwidth, and the distortion of the encoded video is as small as possible.
[0068] The factors affecting the encoding code rate mainly include two aspects, one is the characteristics of the video itself, such as spatial resolution and video content, and the other is the encoding parameters, such as quantization parameter and encoding structure.
[0069] Therefore, in an example, the encoding code rate can be controlled by changing the quantization parameter. Please refer to FIG. 1 , FIG. 1 FIG. 1 is a schematic diagram of a rate control process provided by an exemplary embodiment.
[0070] As shown in FIG. 1 , after the quantization parameter is input into the encoder, the encoder can encode the current video frame according to the quantization parameter, and output the actual encoded data after encoding; the actual encoded data is input into the rate control algorithm to predict the target encoded data amount allocated for the next video frame, and calculate the quantization parameter corresponding to the next video frame according to the target encoded data amount; then the quantization parameter corresponding to the next video frame is input into the encoder, so that the encoder encodes the next video frame according to the quantization parameter corresponding to the next video frame, and outputs the actual encoded data after encoding the next video frame. This is a loop control, so that the actual encoded data amount after encoding the video frame is as close as possible to the target encoded data amount.
[0071] For example, when the actual encoded data amount is less than the target encoded data amount, the rate control algorithm increases the actual encoded data amount, and vice versa.
[0072] In the initialization, the rate control algorithm can estimate a quantization parameter according to the content of the input video, the upper limit of the bandwidth in the transmission channel, and the state of the buffer, and input the quantization parameter into the encoder, and then perform the loop as shown in FIG. 1 .
[0073] At present, in order to further improve the coding efficiency, the perceptual coding technology (PVC, Perceptual Video Coding) is introduced into the traditional video coding technology according to some characteristics of the human visual system (HVS, Human Vision System), so as to eliminate the human subjective visual redundancy by exploiting the subjective perception state of the human eye to the image and the human innate visual selective attention mechanism, etc.
[0074] Among them, the just noticeable distortion (JND) used to measure the sensitivity of the human eye to the distortion of different regions in the image is the current research hotspot, and the JND is used to represent the maximum image distortion that the human eye cannot perceive, that is, the change that the human eye cannot perceive, which embodies the tolerance of the human eye to the image change. In other words, due to various shielding effects of the human eye, the human eye can only perceive noise exceeding a certain threshold, and the threshold is the minimum perceptible error of the human eye. Common JND algorithms can be mainly divided into two categories: pixel domain-based JND algorithm and transform domain-based JND algorithm.
[0075] Due to the introduction of the JND algorithm, the visual redundancy of the video frame can be reduced, and the coding data amount of the video frame can be reduced.
[0076] For example, in ordinary video coding, the coding code rate = E(dct(x, y)), where dct(x, y) represents the calculation result after converting a two-dimensional image from a spatial domain (also referred to as a pixel domain in the image) to a frequency domain, also known as a discrete cosine transform (DCT, Discrete Cosine Transform) coefficient, representing the amplitude of a two-dimensional wave with a frequency of (x, y); x represents the horizontal direction frequency of the two-dimensional wave, and y represents the vertical direction frequency of the two-dimensional wave; E represents entropy coding of the dct coefficient to obtain a binary coding code rate.
[0077] For example, when the transform domain-based JND algorithm is introduced, a JND value can be calculated for each dct coefficient, and at this time the coding code rate = E(dct(x, y)-JND), so the coding code rate is reduced, that is, the coding data amount is reduced.
[0078] And according to the foregoing, since the code rate control algorithm is used in coding, although the actual coding data amount of the current frame is reduced by introducing the JND algorithm, the actual coding data amount of the current frame reduced by the JND algorithm will be input to the code rate control algorithm, resulting in that the code rate control algorithm finds that the actual coding data amount is less than the target coding data amount, so that the actual coding data amount of the subsequent video frame is increased to the specified coding data amount again through the calculated quantization parameter, and finally the JND algorithm is invalid.
[0079] It is to be noted that the above-mentioned application scenarios are merely shown for facilitating the understanding of the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.
[0080] Exemplary Method
[0081] The technical concept of the present specification will be described in detail below through specific embodiments.
[0082] The present disclosure aims to provide a technical solution that performs two calculations when encoding a video frame, one based on a JND algorithm to obtain encoding data used as actual encoding data for output, and the other based on a non-JND algorithm to obtain encoding data used as input for a rate control algorithm to determine the encoding parameters used when encoding the subsequent video frame, thereby avoiding the invalidation of the JND algorithm due to the existence of the rate control algorithm, and achieving the reduction of visual redundancy and the reduction of the amount of encoding data by using the JND algorithm.
[0083] In implementation, the residual errors of each to-be-encoded coding unit in the to-be-encoded video frame in the video can be calculated.
[0084] For example, the to-be-encoded video frame in the video can be obtained, and each to-be-encoded coding unit in the to-be-encoded video frame can be determined. Then, the residual errors of each to-be-encoded coding unit and the already-encoded coding units in any video frame before the to-be-encoded video frame can be calculated.
[0085] Then, the encoding result of any video frame before the to-be-encoded video frame can be obtained.
[0086] The encoding result of the any video frame at least includes first encoding data, and the first encoding data includes the encoding data obtained by encoding the residual errors of each to-be-encoded coding unit in the any video frame based on a non-JND algorithm using parameters corresponding to the any video frame; and the parameters include the parameters for encoding calculated based on a preset rate control algorithm.
[0087] Then, the first encoding data can be used as the input of the preset rate control algorithm to calculate the parameters corresponding to the video frame.
[0088] For example, the first encoding data can be used as the input of the preset rate control algorithm to predict the encoding data of the to-be-encoded video frame by the preset rate control algorithm; and the quantization parameters corresponding to the video frame can be calculated according to the predicted encoding data of the to-be-encoded video frame.
[0089] Based on the preset JND algorithm, the residual of each to-be-encoded coding unit in the video frame is encoded using parameters corresponding to the video frame to obtain second encoding data, and the second encoding data is output as actual encoding data.
[0090] Furthermore, based on a non-JND algorithm, the residual of each to-be-encoded coding unit in the video frame is encoded using parameters corresponding to the video frame to obtain third encoding data; wherein the third encoding data is used as an input of the preset rate control algorithm to calculate encoding parameters corresponding to any subsequent video frame of the video frame.
[0091] By the above technical solution, on one hand, since the encoding data obtained based on the JND algorithm is used when the actual encoding data is output, visual redundancy can be reduced and the amount of encoding data of the video frame can be reduced; on the other hand, since the encoding data obtained based on the non-JND algorithm is used as an input of the rate control algorithm, the problem that the JND algorithm is disabled due to the rate control algorithm can be avoided, and meanwhile, the encoding parameters corresponding to the subsequent video frame can be determined through the rate control algorithm, so that the rate can be controlled within a certain range.
[0092] Please refer to FIG. 2 , FIG. 2 is a flowchart of a video encoding method based on a JND algorithm provided by an exemplary embodiment, and the method comprises the following steps:
[0093] In step 201, the residual of each to-be-encoded coding unit in a to-be-encoded video frame in a video is calculated.
[0094] As known from the foregoing, a video is composed of continuous video frames, and each video frame is an image. When encoding a video, the video can be divided into two types, i.e., intra-frame encoding and inter-frame encoding.
[0095] The coding unit is the most basic unit for encoding processing. Since an image is composed of pixels, one pixel can be a coding unit. However, if the coding unit is encoded according to the pixel, the amount of data will be large, so generally the image can be divided into blocks containing multiple pixels.
[0096] Preferably, in an exemplary embodiment, the coding unit comprises a macroblock or a CTU (coding tree unit).
[0097] For example, in the H264 standard, a macroblock has a size of 16*16, and contains a 16*16 luminance block, and for a commonly used 4:2:0 sampling format, it also contains two 8*8 chrominance blocks.
[0098] For example, in the HEVC standard, a structure similar to the macroblock is the coding tree unit (CTU), the size of which can be specified by the encoder, and can be up to 64*64 or as small as 16*16.
[0099] Specifically, after determining each coding unit in the video frame to be encoded, the residual of each coding unit to be encoded can be calculated.
[0100] In one embodiment, the video frame to be encoded can be obtained, and each coding unit to be encoded in the video frame to be encoded can be determined. Then, the residual of each coding unit to be encoded and the coding unit in any video frame before the video frame to be encoded that has been encoded can be calculated.
[0101] For example, for inter-frame encoding, the video frame to be encoded can be obtained, and each coding unit to be encoded in the video frame to be encoded can be determined. Then, any video frame before the video frame to be encoded that has been encoded can be obtained, and the coding unit in the video frame before the video frame to be encoded that has been encoded can be determined. The difference between the coding unit to be encoded and the coding unit that has been encoded can be taken as the residual.
[0102] It should be noted that the selection method of any video frame before the video frame to be encoded can be determined by the person skilled in the art as needed.
[0103] In addition, for intra-frame encoding, each coding unit to be encoded and the coding unit that has been encoded in the video frame can be obtained, and the difference between the coding unit to be encoded and the coding unit that has been encoded can be taken as the residual.
[0104] If the residual obtained in step 201 is to be encoded, the parameters corresponding to the video frame also need to be determined according to steps 202 and 203.
[0105] In step 202, the encoding result of any video frame before the video frame to be encoded is obtained.
[0106] The encoding result of any video frame includes at least first encoding data, and the first encoding data includes the encoding data obtained by encoding the residual of each coding unit to be encoded in the any video frame based on a non-JND algorithm using the parameters corresponding to the any video frame. The parameters include the parameters for encoding calculated based on a preset rate control algorithm.
[0107] Specifically, any video frame before the to-be-encoded video frame is a completed encoded video frame. The encoding result of the completed encoded video frame includes two parts, one is that based on the non-JND algorithm, using the parameters corresponding to the video frame, the residual of each to-be-encoded coding unit in the video frame is encoded to obtain the encoding data; the other is that based on the preset JND algorithm, using the parameters corresponding to the video frame, the residual of each to-be-encoded coding unit in the video frame is encoded to obtain another encoding data. Wherein, the above-mentioned parameters corresponding to the video frame include the parameters used for encoding calculated based on the preset rate control algorithm.
[0108] As can be known from the foregoing, in order to avoid the problem that the JND algorithm is invalid due to the existence of the rate control algorithm, the encoding data calculated based on the non-JND algorithm needs to be taken as the input of the preset rate control algorithm to replace the encoding data calculated based on the preset JND algorithm to calculate the parameters corresponding to the video frame.
[0109] In step 203, the first encoding data is taken as the input of the preset rate control algorithm to calculate the parameters corresponding to the video frame.
[0110] Specifically, the first encoding data can be taken as the input of the preset rate control algorithm to predict the target encoding data amount of the to-be-encoded video frame by the preset rate control algorithm; and then the quantization parameter corresponding to the video frame is calculated according to the predicted target encoding data amount of the to-be-encoded video frame.
[0111] Wherein, the above-mentioned process can be referred to the related description of FIG. 1 , which will not be described here in detail.
[0112] Preferably, in the embodiment shown, the parameters include quantization parameters;
[0113] Further, the first encoding data of any video frame before the to-be-encoded video frame can be obtained, the first encoding data is taken as the input of the preset rate control algorithm to predict the encoding data of the to-be-encoded video frame by the preset rate control algorithm; and the quantization parameter corresponding to the video frame is calculated according to the predicted encoding data of the to-be-encoded video frame.
[0114] It should be noted that video encoding at least includes three processes of transformation, quantization and entropy encoding. Through the transformation from time domain to frequency domain, the correlation between adjacent data can be removed, that is, the spatial redundancy is removed; through the quantization process which reduces the image encoding length without reducing the visual effect, the unnecessary information in the visual recovery is reduced, that is, the visual redundancy is reduced; and the entropy encoding can reduce the coding redundancy according to the probability characteristics of the to-be-encoded data.
[0115] The quantization process can be performed according to a quantization parameter QP, which is a sequence number of a quantization step Qstep. For luminance coding, the quantization step Qstep has 52 values, and the QP has values from 0 to 51. For chrominance coding, the quantization step Qstep has 40 values, and the QP has values from 0 to 39.
[0116] Next, the residual of each to-be-coded coding unit in the video frame can be encoded according to the parameters corresponding to the video frame determined above.
[0117] In step 204, the residual of each to-be-coded coding unit in the video frame is encoded based on the preset JND algorithm using the parameters corresponding to the video frame to obtain second encoding data, and the second encoding data is output as actual encoding data. In addition, the residual of each to-be-coded coding unit in the video frame is encoded based on a non-JND algorithm using the parameters corresponding to the video frame to obtain third encoding data. The third encoding data is used as an input of the preset rate control algorithm to calculate the encoding parameters corresponding to any subsequent video frame of the video frame.
[0118] Specifically, the residual of each to-be-coded coding unit in the video frame can be encoded twice as follows.
[0119] First, the residual of each to-be-coded coding unit in the video frame is encoded based on the preset JND algorithm using the parameters corresponding to the video frame to obtain second encoding data.
[0120] Second, the residual of each to-be-coded coding unit in the video frame is encoded based on a non-JND algorithm using the parameters corresponding to the video frame to obtain third encoding data.
[0121] As described above, the second encoding data is used as actual encoding data for output, and the third encoding data is used as an input of the preset rate control algorithm to calculate the encoding parameters corresponding to any subsequent video frame of the video frame.
[0122] The preset JND algorithm, the preset rate control algorithm, and the non-JND algorithm can be selected by those skilled in the art, and the specific algorithm is not limited in the present disclosure.
[0123] It should be noted that the JND algorithm can be mainly divided into a JND algorithm applied to a pixel domain and a JND algorithm applied to a transform domain. Therefore, for video coding, the difference between the two algorithms mainly lies in the transform process, and the steps taken also differ.
[0124] In one embodiment, the preset JND algorithm includes a JND algorithm applied to a pixel domain;
[0125] Further, the JND coefficients of each to-be-encoded coding unit in the video frame can be calculated based on the JND algorithm of the pixel domain;
[0126] The difference between the residual and the JND coefficient of each to-be-encoded coding unit in the video frame is calculated, and the difference is transformed, quantized and entropy encoded using parameters corresponding to the video frame to determine the encoding data corresponding to each to-be-encoded coding unit in the video frame.
[0127] Specifically, the JND coefficients of each to-be-encoded coding unit in the video frame can be calculated based on the JND algorithm of the pixel domain first; then the difference between the residual and the JND coefficient of each to-be-encoded coding unit in the video frame is calculated; then the difference between the residual and the JND coefficient is transformed, quantized and entropy encoded using parameters corresponding to the video frame; finally, the encoding data corresponding to each to-be-encoded coding unit is determined.
[0128] In another embodiment, the preset JND algorithm includes a JND algorithm applied to a transform domain;
[0129] Further, the DCT coefficients corresponding to each to-be-encoded coding unit in the video frame can be determined by performing DCT discrete cosine transform on the residual of each to-be-encoded coding unit in the video frame; the JND coefficients corresponding to each to-be-encoded coding unit in the video frame can be determined based on the JND algorithm of the transform domain according to the DCT coefficients; the difference between the DCT coefficient and the JND coefficient corresponding to each to-be-encoded coding unit in the video frame is calculated, and the difference is quantized and entropy encoded using parameters corresponding to the video frame to determine the encoding data corresponding to each to-be-encoded coding unit in the video frame.
[0130] Specifically, the DCT coefficients corresponding to each to-be-encoded coding unit can be determined by performing DCT discrete cosine transform on the residual of each to-be-encoded coding unit first; then the JND coefficients corresponding to each to-be-encoded coding unit are determined based on the JND algorithm of the transform domain according to the DCT coefficients; then the difference between the DCT coefficient and the JND coefficient corresponding to each to-be-encoded coding unit is calculated, and the difference between the DCT coefficient and the JND coefficient is quantized and entropy encoded using parameters corresponding to the video frame; finally, the encoding data corresponding to each to-be-encoded coding unit is determined.
[0131] The DCT transform is mainly used for data or image compression, and can convert a signal in a spatial domain to a frequency domain, and has good decorrelation performance. In addition, the determination formulas of the DCT coefficients and the JND coefficients are irrelevant to the present disclosure, and are not described herein.
[0132] In the above embodiment, when encoding the video frame, two calculations are performed, one based on the JND algorithm to obtain the encoding data used as the actual encoding data for output, and the other based on the non-JND algorithm to obtain the encoding data used as the input of the rate control algorithm to determine the encoding parameters used when encoding the subsequent video frame. Through the above technical solution, on the one hand, since the encoding data obtained based on the JND algorithm is used when the actual encoding data is output, the visual redundancy can be reduced and the amount of encoding data of the video frame can be reduced; on the other hand, since the encoding data obtained based on the non-JND algorithm is used as the input of the rate control algorithm, the problem that the JND algorithm is disabled due to the rate control algorithm can be avoided, and at the same time, the encoding parameters corresponding to the subsequent video frame can be determined through the rate control algorithm, so that the rate is controlled within a certain range.
[0133] Exemplary Apparatus
[0134] After introducing the method of the exemplary embodiment of the present disclosure, next, please see FIG. 3 , FIG. 3 is a block diagram of a video encoding device based on the JND algorithm provided by an exemplary embodiment.
[0135] The implementation process of the functions and roles of each module in the following device is specifically described in the implementation process of the corresponding steps in the above method, and will not be described here. For the device embodiment, since it basically corresponds to the method embodiment, the related parts can be referred to the part of the method embodiment.
[0136] As shown in FIG. 3 , the video encoding device based on the JND algorithm 300 can include a residual calculation module 301, an acquisition module 302, a rate control module 303, and an encoding module 304. Wherein:
[0137] The residual calculation module 301 is configured to calculate the residual of each to-be-encoded coding unit in the to-be-encoded video frame in the video;
[0138] The obtaining module 302 is configured to obtain an encoding result of any video frame before the video frame to be encoded; wherein the encoding result of the any video frame at least comprises first encoding data, the first encoding data comprising encoding data obtained by encoding, based on a non-JND algorithm, residuals of each to-be-encoded coding unit in the any video frame using parameters corresponding to the any video frame; the parameters comprising parameters for encoding calculated based on a preset rate control algorithm;
[0139] The rate control module 303 is configured to take the first encoding data as an input of the preset rate control algorithm to calculate the parameters corresponding to the video frame;
[0140] The encoding module 304 is configured to encode, based on a preset JND algorithm, residuals of each to-be-encoded coding unit in the video frame using the parameters corresponding to the video frame to obtain second encoding data, and take the second encoding data as actual encoding data for output; and encode, based on a non-JND algorithm, residuals of each to-be-encoded coding unit in the video frame using the parameters corresponding to the video frame to obtain third encoding data; wherein the third encoding data is used as an input of the preset rate control algorithm to calculate encoding parameters corresponding to any video frame after the video frame.
[0141] In an embodiment, the residual calculation module 301 further:
[0142] obtains a video frame to be encoded in the video, and determines each to-be-encoded coding unit in the video frame to be encoded;
[0143] calculates residuals of the each to-be-encoded coding unit and a coding unit that has been encoded in a previous video frame of the video frame.
[0144] In an embodiment, the coding unit comprises a macroblock or a CTU (coding tree unit).
[0145] In an embodiment, the preset JND algorithm comprises a JND algorithm applied to a pixel domain;
[0146] The encoding module 304 further:
[0147] encodes, based on a preset JND algorithm, residuals of each to-be-encoded coding unit in the video frame using the parameters corresponding to the video frame to obtain second encoding data, comprising:
[0148] calculates JND coefficients of each to-be-encoded coding unit in the video frame based on the JND algorithm applied to the pixel domain;
[0149] The difference between the residual of each to-be-encoded coding unit in the video frame and the JND coefficient is calculated, and the difference is transformed, quantized and entropy-encoded using the parameters corresponding to the video frame to determine the encoding data corresponding to each to-be-encoded coding unit in the video frame.
[0150] In an embodiment, the preset JND algorithm includes a JND algorithm applied to a transform domain.
[0151] The encoding module 304 further:
[0152] The residual of each to-be-encoded coding unit in the video frame is encoded using the parameters corresponding to the video frame based on the preset JND algorithm to obtain second encoding data, including:
[0153] The residual of each to-be-encoded coding unit in the video frame is subjected to DCT discrete cosine transform to determine the DCT coefficient corresponding to each to-be-encoded coding unit in the video frame.
[0154] The JND coefficient corresponding to each to-be-encoded coding unit in the video frame is determined according to the DCT coefficient based on the JND algorithm of the transform domain.
[0155] The difference between the DCT coefficient corresponding to each to-be-encoded coding unit in the video frame and the JND coefficient is calculated, and the difference is quantized and entropy-encoded using the parameters corresponding to the video frame to determine the encoding data corresponding to each to-be-encoded coding unit in the video frame.
[0156] In an embodiment, the encoding parameters include quantization parameters.
[0157] The rate control module 303 further:
[0158] The first encoding data is taken as the input of the preset rate control algorithm, and the parameters corresponding to the video frame are calculated, including:
[0159] The first encoding data of any previous video frame of the to-be-encoded video frame is obtained, the first encoding data is taken as the input of the preset rate control algorithm, and the encoding data of the to-be-encoded video frame is predicted by the preset rate control algorithm.
[0160] The quantization parameters corresponding to the video frame are calculated according to the predicted encoding data of the to-be-encoded video frame.
[0161] The specific details of each module of the JND algorithm-based video encoding device 300 have been described in detail in the previous description of the frequency domain transform-based word vector compression method flow, and thus will not be described here.
[0162] It should be noted that although several modules or units of the video encoding apparatus 300 based on JND algorithm are mentioned in the foregoing detailed description, such division is not mandatory. Indeed, according to embodiments of the present disclosure, features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, features and functions of one module or unit described above can be further divided into embodied by a plurality of modules or units.
[0163] Exemplary Medium
[0164] Having introduced the apparatus of the exemplary embodiments of the present disclosure, next, see FIG. 4 , FIG. 4 is a schematic diagram of a video encoding medium based on JND algorithm provided by an exemplary embodiment.
[0165] In the exemplary embodiments of the present disclosure, a computer readable storage medium having stored thereon a program product capable of implementing the above-mentioned method of the present disclosure is also provided. In some possible embodiments, various aspects of the present disclosure can also be implemented in the form of a program product including program codes for causing an end device to perform the steps described in the above-mentioned "Exemplary Methods" section according to various exemplary embodiments of the present disclosure when the program product is run on the end device.
[0166] Referring to FIG. 4 , a readable storage medium 40 for implementing the above-mentioned method according to embodiments of the present disclosure is described, which can adopt a portable compact disc read-only memory (CD-ROM) and include program codes, and can be run on an end device such as a personal computer. However, the readable storage medium of the present disclosure is not limited thereto, and in the present document, the readable storage medium can be any tangible medium containing or storing a program which can be used by or in conjunction with an instruction execution system, apparatus or device.
[0167] The readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples (non-exhaustive list) of the readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0168] Computer readable signal media can include a propagated data signal with instructions readable by a machine and encompass all manner of medium that are suitable for storing and / or communicating software in the form of instructions or data structures.
[0169] Program code embodied on a computer readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0170] Program code, used by or in connection with the described embodiments, can be written in any of a number of suitable programming languages and implementing methods, including an object-oriented programming language such as Java, C++, or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on a user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device such as through the Internet using an Internet Service Provider. In some embodiments, electronic circuitry including, for example, programmable logic circuitry, application specific circuitry, or field programmable gate array (FPGA) circuitry, includes the circuitry described herein.
[0171] Exemplary Computing Device
[0172] Having now described some illustrative implementations of a method, medium, and apparatus for implementing the methods of the present disclosure, instrumentalities such as FIG. 5 , FIG. 5 are illustrated and will be further described by way of example with reference to the drawings.
[0173] The electronic device 500 according to such an embodiment of the present disclosure will be described below with reference to FIG. 5 . FIG. 5 The electronic device 500 shown is merely an example and should not limit the scope of functionality or use of the embodiments of the present disclosure.
[0174] As FIG. 5As shown, the electronic device 500 is in the form of a general computing device. The components of the electronic device 500 can include, but are not limited to, the at least one processing unit 501, the at least one storage unit 502, and a bus 503 that connects the various system components, including the storage unit 502 and the processing unit 501.
[0175] The storage unit stores programming code that can be executed by the processing unit 501 to cause the processing unit 501 to perform the steps of the various embodiments described in the present specification.
[0176] The storage unit 502 can include a readable medium in the form of volatile storage such as random access memory (RAM) 5021 and / or cache memory 5022, and also can include a non-volatile storage such as read only memory (ROM) 5023.
[0177] The storage unit 502 also can include a program / utility 5024 having a set of program modules 5025, including but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which can give the electronic device 500 its functionality, at least in part. Each of these examples can include elements of a network operating system.
[0178] The bus 503 can represent one or more of several types of bus structures, including a storage bus or bus controller, a peripheral bus, a graphics bus (e.g., an Accelerated Graphics Port, or AGP bus) and a local bus using any of a variety of bus architectures.
[0179] The electronic device 500 also can communicate with one or more external devices 504 such as a keyboard or pointing device, using one or more communication ports 505. Communication can occur over the communication ports 505 with one or more devices using any one of a variety of communication protocols, such as the Internet Protocol (IP) and / or the Bluetooth protocol. One or more communication ports 505 can enable the electronic device 500 to communicate with one or more devices that enable user interaction with the electronic device 500, and / or one or more devices that enable the electronic device 500 to communicate with one or more other computing devices. Such communication can occur, for example, using the network adapter 506. As shown, the network adapter 506 can be communicatively coupled to the other components of the electronic device 500 through the bus 503. It will be appreciated that other hardware and / or software modules can be used in conjunction with the electronic device 500, including but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc.
[0180] Through the above description of the embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the disclosure can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, or the like) or a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to perform the methods according to the embodiments of the disclosure.
[0181] It should be noted that although several units / modules or sub-units / modules of the apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. In fact, according to the embodiments of the disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into units / modules embodied by multiple units / modules.
[0182] In addition, although the operations of the methods of the disclosure are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in that particular order, or that all of the illustrated operations must be performed to achieve the desired result. Additionally or alternatively, certain steps can be omitted, combined into one step, and / or split into multiple steps.
[0183] Although the spirit and principles of the disclosure have been described with reference to several specific embodiments, it should be understood that the disclosure is not limited to the disclosed specific embodiments, and the division of aspects does not mean that the features in these aspects cannot be combined for benefit, but only for the convenience of expression. The disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the appended claims.
Claims
1. A method for video encoding based on JND algorithm, comprising: calculating residuals of each to-be-encoded coding unit in a to-be-encoded video frame in a video; obtaining an encoding result of any video frame before the to-be-encoded video frame; wherein the encoding result of the any video frame at least comprises first encoding data, the first encoding data comprising encoding data obtained by encoding residuals of each to-be-encoded coding unit in the any video frame based on a non-JND algorithm using parameters corresponding to the any video frame; the parameters comprising parameters for encoding calculated based on a preset rate control algorithm; using the first encoding data as input of the preset rate control algorithm to calculate parameters corresponding to the video frame; encoding the residuals of each to-be-encoded coding unit in the video frame based on a preset JND algorithm using parameters corresponding to the video frame to obtain second encoding data, and outputting the second encoding data as actual encoding data; and encoding the residuals of each to-be-encoded coding unit in the video frame based on a non-JND algorithm using parameters corresponding to the video frame to obtain third encoding data; wherein the third encoding data is used as input of the preset rate control algorithm to calculate encoding parameters corresponding to any video frame after the video frame. 2.The method of claim 1, wherein the calculating residuals of each to-be-encoded coding unit in a to-be-encoded video frame in a video comprises: obtaining the to-be-encoded video frame, and determining each to-be-encoded coding unit in the to-be-encoded video frame; calculating residuals of each to-be-encoded coding unit in the to-be-encoded video frame and each coding unit in any video frame before the to-be-encoded video frame that has completed encoding. 3.The method of claim 1, wherein the coding unit comprises a macroblock or a CTU coding tree unit. 4.The method of claim 1, wherein the preset JND algorithm comprises a JND algorithm applied to a pixel domain; the encoding the residuals of each to-be-encoded coding unit in the video frame based on a preset JND algorithm using parameters corresponding to the video frame to obtain second encoding data comprises: calculating JND coefficients of each to-be-encoded coding unit in the video frame based on the JND algorithm applied to the pixel domain; calculating differences between the residuals of each to-be-encoded coding unit in the video frame and the JND coefficients, and transforming, quantizing and entropy encoding the differences using parameters corresponding to the video frame to determine encoding data corresponding to each to-be-encoded coding unit in the video frame. 5.The method of claim 1, wherein the preset JND algorithm comprises a JND algorithm applied to a transform domain; the encoding the residuals of each to-be-encoded coding unit in the video frame based on a preset JND algorithm using parameters corresponding to the video frame to obtain second encoding data comprises: performing DCT (Discrete Cosine Transform) on the residual of each to-be-encoded coding unit in the video frame to determine a DCT coefficient corresponding to each to-be-encoded coding unit in the video frame; determining a JND (Just Noticeable Difference) coefficient corresponding to each to-be-encoded coding unit in the video frame according to the DCT coefficient based on the JND algorithm in the transform domain; calculating a difference between the DCT coefficient and the JND coefficient corresponding to each to-be-encoded coding unit in the video frame, and quantizing and entropy encoding the difference using a parameter corresponding to the video frame to determine encoded data corresponding to each to-be-encoded coding unit in the video frame.
6. The method of claim 1, wherein the parameter comprises a quantization parameter. The inputting the first encoded data into the preset rate control algorithm to calculate the parameter corresponding to the video frame comprises: obtaining first encoded data of any previous video frame of the to-be-encoded video frame, inputting the first encoded data into the preset rate control algorithm to predict encoded data of the to-be-encoded video frame by the preset rate control algorithm; and calculating a quantization parameter corresponding to the video frame according to the predicted encoded data of the to-be-encoded video frame.
7. A video encoding device based on a JND algorithm, comprising: a residual calculation module configured to calculate a residual of each to-be-encoded coding unit in a to-be-encoded video frame in a video; an obtaining module configured to obtain an encoding result of any previous video frame of the to-be-encoded video frame, wherein the encoding result of the any previous video frame at least comprises first encoded data, the first encoded data comprising encoded data of each to-be-encoded coding unit in the any previous video frame obtained by encoding the residual of each to-be-encoded coding unit in the any previous video frame based on a non-JND algorithm using a parameter corresponding to the any previous video frame, and the parameter comprising a parameter for encoding calculated based on a preset rate control algorithm; a rate control module configured to input the first encoded data into the preset rate control algorithm to calculate the parameter corresponding to the video frame; an encoding module configured to encode the residual of each to-be-encoded coding unit in the video frame based on a preset JND algorithm using the parameter corresponding to the video frame to obtain second encoded data, and output the second encoded data as actual encoded data, and encode the residual of each to-be-encoded coding unit in the video frame based on a non-JND algorithm using the parameter corresponding to the video frame to obtain third encoded data, wherein the third encoded data is used as input of the preset rate control algorithm to calculate an encoding parameter corresponding to any subsequent video frame of the video frame.
8. The device of claim 7, wherein the residual calculation module is further configured to: obtain the to-be-encoded video frame, and determine each to-be-encoded coding unit in the to-be-encoded video frame; calculate a residual of each to-be-encoded coding unit in the to-be-encoded video frame and an already-encoded coding unit in a previous video frame of the to-be-encoded video frame. 9. The apparatus of claim 7, wherein the coding unit comprises a macroblock or a CTU coding tree unit.
10. The apparatus of claim 7, wherein the preset JND algorithm comprises a JND algorithm applied to a pixel domain; the encoding module further: encodes, based on the preset JND algorithm, residuals of each to-be-encoded coding unit in the video frame using parameters corresponding to the video frame, to obtain second encoding data, comprising: calculates JND coefficients of each to-be-encoded coding unit in the video frame based on the JND algorithm applied to the pixel domain; calculates differences between the residuals of each to-be-encoded coding unit in the video frame and the JND coefficients, and transforms, quantizes and entropy encodes the differences using parameters corresponding to the video frame, to determine the encoding data corresponding to each to-be-encoded coding unit in the video frame.
11. The apparatus of claim 7, wherein the preset JND algorithm comprises a JND algorithm applied to a transform domain; the encoding module further: encodes, based on the preset JND algorithm, residuals of each to-be-encoded coding unit in the video frame using parameters corresponding to the video frame, to obtain second encoding data, comprising: performs DCT discrete cosine transform on the residuals of each to-be-encoded coding unit in the video frame, to determine DCT coefficients corresponding to each to-be-encoded coding unit in the video frame; determines JND coefficients corresponding to each to-be-encoded coding unit in the video frame based on the DCT coefficients according to the JND algorithm applied to the transform domain; calculates differences between the DCT coefficients corresponding to each to-be-encoded coding unit in the video frame and the JND coefficients, and quantizes and entropy encodes the differences using parameters corresponding to the video frame, to determine the encoding data corresponding to each to-be-encoded coding unit in the video frame.
12. The apparatus of claim 7, wherein the encoding parameters comprise quantization parameters; the rate control module further: the inputting of the first encoding data as the input of the preset rate control algorithm, the calculation of the parameters corresponding to the video frame, comprising: obtains first encoding data of any previous video frame of the to-be-encoded video frame, and inputs the first encoding data as the input of the preset rate control algorithm, to predict the encoding data of the to-be-encoded video frame by the preset rate control algorithm; calculates the quantization parameters corresponding to the video frame according to the predicted encoding data of the to-be-encoded video frame.
13. A storage medium having computer instructions stored thereon, the instructions being executed by a processor to implement the steps of the method of any one of claims 1-6.
14. A computing device, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements the method of any one of claims 1-6 by running the executable instructions.
Citation Information
Patent Citations
Method and device for coding video based on ROI and JND
CN103379326A
Video bitrate control method based on frame loss and quantization parameter adjustment
CN104469367A