Video encoding method and device, electronic equipment and readable storage medium
By determining the initial JND threshold and mapping function in video encoding, the image quality-related JND threshold is adaptively adjusted, solving the distortion problem caused by the linear relationship between JND and texture gradient, and improving encoding efficiency and quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
- Filing Date
- 2021-04-22
- Publication Date
- 2026-04-14
AI Technical Summary
In existing video encoding processes, the application of the linear relationship between JND and texture gradient leads to perceptible and objective distortion, making it difficult to effectively improve the efficiency and quality of video image encoding.
By determining the initial minimum perceptible difference (JND) threshold and mapping function for the video to be encoded, the image quality-associated JND threshold is adaptively adjusted, and encoding is performed using the image quality-associated JND threshold, adapting to the current macroblock quality for adaptive adjustment.
It effectively reduces perceptible and objective distortion, improves coding efficiency, and increases compression bitrate.
Smart Images

Figure CN115239824B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and more specifically, to a video encoding method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] To save transmission bandwidth and storage space, and to support applications such as digital television broadcasting, remote monitoring, digital video-on-demand, and wireless multimedia communication, video image coding has become one of the hot topics in research and industrial applications both domestically and internationally.
[0003] JND (Just Noticeable Distortion) can effectively improve the efficiency and quality of video image coding, representing the visual redundancy in an image. JND is often used to guide perceptual coding and processing of images or videos, such as preprocessing, adaptive quantization, bitstream control, and motion estimation.
[0004] The current JND in the encoding process has a simple linear relationship with the texture gradient. Applying JND to the encoding prediction residual may cause perceptible distortion and objective distortion. Summary of the Invention
[0005] The purpose of this application is to at least solve one of the aforementioned technical deficiencies, and the following technical solution is proposed:
[0006] Firstly, a video encoding method is provided, including:
[0007] Determine the initial minimum perceptible difference (JND) threshold for the video to be encoded;
[0008] Determine the mapping function; the mapping function is used to represent the mapping relationship between the initial JND threshold and the image quality-related JND threshold;
[0009] Determine the image quality-related JND threshold based on the initial JND threshold and the mapping function;
[0010] The video to be encoded is encoded based on the JND threshold associated with image quality.
[0011] In an alternative embodiment of the first aspect, determining the mapping function includes:
[0012] Obtain the first relationship function between the image gradient change space and the initial JND threshold; the first relationship function is related to image quality.
[0013] The mapping function is determined based on the first relation function.
[0014] In an optional embodiment of the first aspect, obtaining a first relationship function between the image gradient change space and the initial JND threshold includes:
[0015] Obtain the derivative of the second relational function; the second relational function is used to represent the relationship between the image quality of the video to be encoded and the average gradient texture value.
[0016] The first relation function is determined based on the derivative function.
[0017] In an alternative embodiment of the first aspect, the first relational function is negatively correlated with the derivative function.
[0018] In an alternative embodiment of the first aspect, the first relational function is positively correlated with the reciprocal of the derivative function.
[0019] In an optional embodiment of the first aspect, before obtaining the derivative of the second relational function, the method further includes:
[0020] Obtain the texture gradient dataset of video frame images from the video to be encoded;
[0021] Obtain the second relational function based on the texture gradient dataset.
[0022] In an alternative embodiment of the first aspect, obtaining the second relational function based on the texture gradient dataset includes:
[0023] The image quality in the texture gradient dataset is determined based on a preset image quality evaluation index.
[0024] Determine the average gradient texture value of the video frame image;
[0025] The second relational function is obtained by fitting the image quality and the average gradient texture value.
[0026] In an optional embodiment of the first aspect, determining the mapping function based on the first relational function includes:
[0027] Obtain the third relationship function between the initial JND threshold, the image quality-related JND threshold, and the image gradient change space;
[0028] The mapping function is determined based on the third relation function and the first relation function.
[0029] Secondly, a video encoding apparatus is provided, comprising:
[0030] The first determining module is used to determine the initial minimum perceptible difference (JND) threshold of the video to be encoded.
[0031] The second determining module is used to determine the mapping function; the mapping function is used to represent the mapping relationship between the initial JND threshold and the image quality-related JND threshold.
[0032] The third determination module is used to determine the image quality-related JND threshold based on the initial JND threshold and the mapping function;
[0033] The encoding module is used to encode the video to be encoded based on the JND threshold associated with image quality.
[0034] In an optional embodiment of the second aspect, the second determining module, when determining the mapping function, is specifically used for:
[0035] Obtain the first relationship function between the image gradient change space and the initial JND threshold; the first relationship function is related to image quality.
[0036] The mapping function is determined based on the first relation function.
[0037] In an optional embodiment of the second aspect, when the second determining module obtains the first relationship function between the image gradient change space and the initial JND threshold, it is specifically used for:
[0038] Obtain the derivative of the second relational function; the second relational function is used to represent the relationship between the image quality of the video to be encoded and the average gradient texture value.
[0039] The first relation function is determined based on the derivative function.
[0040] In an alternative embodiment of the second aspect, the first relational function is negatively correlated with the derivative function.
[0041] In an alternative embodiment of the second aspect, the first relational function is positively correlated with the reciprocal of the derivative function.
[0042] In an alternative embodiment of the second aspect, an acquisition module is further included, for:
[0043] Obtain the texture gradient dataset of video frame images from the video to be encoded;
[0044] Obtain the second relational function based on the texture gradient dataset.
[0045] In an optional embodiment of the second aspect, when the acquisition module acquires the second relational function based on the texture gradient dataset, it is specifically used for:
[0046] The image quality in the texture gradient dataset is determined based on a preset image quality evaluation index.
[0047] Determine the average gradient texture value of the video frame image;
[0048] The second relational function is obtained by fitting the image quality and the average gradient texture value.
[0049] In an optional embodiment of the second aspect, when determining the mapping function based on the first relational function, the second determining module is specifically used for:
[0050] Obtain the third relationship function between the initial JND threshold, the image quality-related JND threshold, and the image gradient change space;
[0051] The mapping function is determined based on the third relation function and the first relation function.
[0052] Thirdly, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the video encoding method shown in the first aspect of this application.
[0053] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the video encoding method shown in the first aspect of this application.
[0054] The beneficial effects of the technical solution provided in this application are:
[0055] By first calculating the initial JND threshold, and then determining the image quality-related JND threshold by defining the mapping function between the initial JND threshold and the image quality-related JND threshold, the image quality-related JND threshold is determined. Encoding is performed using the image quality-related JND threshold. The higher the quality of the current macroblock, the larger the corresponding JND threshold can be adaptively adjusted, resulting in a larger compressible bit rate. This can effectively reduce perceptible distortion and objective distortion.
[0056] Additional aspects and advantages of this application will be set forth in part in the description which follows, and will become apparent from the description or may be learned by practice of this application. Attached Figure Description
[0057] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0058] Figure 1 This application provides an illustration of a video encoding method according to an embodiment of the present application.
[0059] Figure 2 A flowchart illustrating a video encoding method provided in an embodiment of this application;
[0060] Figure 3 A schematic diagram illustrating the video encoding scheme provided in an embodiment of this application;
[0061] Figure 4 A flowchart illustrating a video encoding method provided in an embodiment of this application;
[0062] Figure 5 A schematic diagram illustrating a video coding scheme provided as an example in this application;
[0063] Figure 6 This is a schematic diagram of the structure of a video encoding device provided in an embodiment of this application;
[0064] Figure 7 This is a schematic diagram of the structure of a video encoding electronic device provided in an embodiment of this application. Detailed Implementation
[0065] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0066] Those skilled in the art will understand that, unless explicitly stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in the specification of this application means the presence of features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.
[0067] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0068] Traditional JND (Judges-Nutrition Filter) measures the masking effect of different background brightness and textures to obtain the perceptual threshold of the human eye. For texture masking, the JND threshold is linearly related to the calculated texture gradient value. When applying JND to coding prediction residuals, for a block (macroblock), if all residuals within the entire block do not exceed the JND threshold, then this block (macroblock) can be treated as an all-zero block, simplifying compression; if only some residuals are below the JND threshold, the variance of the DCT (Discrete Cosine Transform) coefficients will decrease after passing through the residual filter. From a rate-distortion perspective, given a bit rate, a low-variance signal will have a reconstructed signal with low objective distortion.
[0069] The solutions provided in this application involve video coding technology based on artificial intelligence, and are intended to solve the aforementioned technical problems.
[0070] The solutions provided in this application relate to video coding technology based on artificial intelligence, and are specifically illustrated through the following embodiments.
[0071] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0072] like Figure 1 As shown, the video encoding method of this application can be applied to... Figure 1 In the scenario shown, specifically, terminal 101 receives the video to be encoded, determines the initial minimum perceptible difference (JND) threshold, and determines the mapping function. Based on the initial JND threshold and the mapping function, it determines the image quality associated JND threshold. Based on the image quality associated JND threshold, it encodes the video to be encoded and outputs the encoded video.
[0073] Figure 1 In the scenario shown, the video encoding method described above can be performed on the terminal; in other scenarios, it can also be performed on the server.
[0074] Those skilled in the art will understand that the “terminal” used herein can be a mobile phone, tablet computer, PDA (Personal Digital Assistant), MID (Mobile Internet Device), etc.; and the “server” can be implemented using a standalone server or a server cluster composed of multiple servers.
[0075] This application provides one possible implementation method, such as... Figure 2 As shown, a video encoding method is provided, which is applied to... Figure 1 Taking the server shown as an example, the following steps may be included:
[0076] Step S201: Determine the initial JND threshold for the video to be encoded.
[0077] The Just Noticeable Distortion (JND) is used to represent the maximum image distortion that the human eye cannot perceive, reflecting the human eye's tolerance to changes in an image. In the field of image processing, JND can be used to measure the human eye's sensitivity to distortion in different regions of an image.
[0078] Specifically, step S201, determining the initial JND threshold of the video to be encoded, may include:
[0079] Determine the pixel values of the video frame images of the video to be encoded, and determine the initial JND threshold based on the pixel values.
[0080] In practical implementation, the initial minimum perceptible difference (JND) threshold can be determined in various ways, such as using a pixel-domain-based JND model or a transform-domain-based JND model. The classic nonlinear additively masking model (NAMM) can be used to determine the initial JND threshold, taking into account the overlapping effects of brightness-adaptive masking and contrast masking. Alternatively, total variation (TV) decomposition can be used to assign different weights to the texture and structural components in the image, giving the pixel-domain JND model better computational accuracy. Furthermore, when calculating texture masking, the different sensitivities of the human eye to regular and irregular regions can be considered, leading to a JND model based on brightness adaptation and structural similarity. The specific method for calculating the initial JND threshold is not limited here.
[0081] Step S202: Determine the mapping function.
[0082] The mapping function is used to represent the mapping relationship between the initial JND threshold and the image quality-related JND threshold.
[0083] Among them, the image quality associated JND threshold is the JND threshold corresponding to the texture mask that is adaptively adjusted according to the image quality of the current macroblock when encoding each macroblock during the residual calculation process.
[0084] Specifically, after determining the initial JND threshold, the image quality-related JND threshold can be determined by combining the mapping function. The process of determining the mapping function will be explained in detail below.
[0085] Step S203: Determine the image quality-related JND threshold based on the initial JND threshold and the mapping function.
[0086] Specifically, the initial JND threshold can be substituted into the mapping function to obtain the image quality-related JND threshold.
[0087] For example, the mapping function is JND texture = k*T, where JND texture The image quality associated JND threshold is T, where T is the initial JND threshold. The coefficient k can be calculated, and the initial JND threshold is substituted into the coefficient k to obtain the image quality associated JND threshold.
[0088] Step S204: Encode the video to be encoded based on the JND threshold associated with image quality.
[0089] Specifically, the image quality-related JND threshold is used to replace the initial JND threshold used in the existing technology for encoding. The higher the quality of the current macroblock, the larger the corresponding JND threshold can be adaptively adjusted, resulting in a higher compressible bit rate.
[0090] In practice, the above steps of calculating the image quality associated JND threshold and encoding are performed on each video frame in the video to be encoded, thereby achieving the encoding of the video to be encoded.
[0091] like Figure 3 As shown, in this embodiment, an initial JND threshold is determined, and a mapping function between the initial JND threshold and the image quality associated JND threshold is determined. The image quality associated JND threshold is determined through the mapping function, and the video to be encoded is encoded based on the image quality associated JND threshold.
[0092] In the above embodiments, by first calculating the initial JND threshold, and then determining the image quality associated JND threshold by determining the mapping function between the initial JND threshold and the image quality associated JND threshold, the image quality associated JND threshold is determined. Encoding is performed using the image quality associated JND threshold. The higher the quality of the current macroblock, the larger the corresponding JND threshold can be adaptively adjusted, resulting in a larger compressible bit rate. This can effectively reduce perceptible distortion and objective distortion.
[0093] The specific process of determining the mapping function will be further explained below with reference to the accompanying drawings and specific embodiments.
[0094] This application provides one possible implementation method, such as... Figure 4 As shown, determining the mapping function in step S202 may include:
[0095] Step S410: Obtain the first relationship function between the image gradient change space and the initial JND threshold.
[0096] The first relational function is associated with image quality.
[0097] Specifically, the relationship between the image quality of the video to be encoded and the average gradient texture value can be determined first, and the first relationship function can be determined based on the relationship between the image quality of the video to be encoded and the average gradient texture value.
[0098] In one implementation, the first relationship function between the image gradient change space and the initial JND threshold in step S410 may include:
[0099] (1) Obtain the derivative of the second relation function.
[0100] The second relational function is used to represent the relationship between the image quality of the video to be encoded and the average gradient texture value.
[0101] Specifically, we can first obtain the texture gradient dataset of the video frame images of the video to be encoded, and then obtain the second relational function based on the texture gradient dataset.
[0102] (2) Determine the first relation function based on the derivative function.
[0103] Specifically, the first relational function is the relationship between the image gradient change space and the initial JND threshold, and it is related to image quality. When the image gradient change is constant, the image quality change is greater; that is, for the same image quality change, the gradient change is greater. Therefore, for areas with larger derivative values, to ensure that the image quality remains unchanged after pixel changes, the gradient change space (delta_T) is smaller. In other words, the first relational function is negatively correlated with the derivative function, meaning that the first relational function decreases as the derivative function increases.
[0104] In some embodiments, the first relational function is positively correlated with the reciprocal of the derivative function.
[0105] For example, let a denote the first relational function, f'(T) avg If f'(T) represents the derivative function, then a can take the value f'(T). avg The reciprocal of f(T) can also be f'(T) avg Multiples of the reciprocal of ).
[0106] This application provides a possible implementation method, which may further include, before obtaining the derivative function of the second relational function:
[0107] (1) Obtain the texture gradient dataset of the video frame images of the video to be encoded.
[0108] (2) Obtain the second relation function based on the texture gradient dataset.
[0109] Specifically, obtaining the second relation function based on the texture gradient dataset can include:
[0110] a. Determine the image quality in the texture gradient dataset based on a preset image quality evaluation index;
[0111] b. Determine the average gradient texture value of the video frame image;
[0112] c. The second relational function is obtained by fitting the image quality and average gradient texture value.
[0113] Step S420: Determine the mapping function based on the first relational function.
[0114] Specifically, step S420, which involves determining the mapping function based on the first relational function, may include:
[0115] (1) Obtain the third relationship function between the initial JND threshold, the image quality-related JND threshold, and the image gradient change space;
[0116] (2) Determine the mapping function based on the third relation function and the first relation function.
[0117] Specifically, by substituting the first relationship function between the image gradient change space and the initial JND threshold into the third relationship function between the initial JND threshold, the image quality-related JND threshold, and the image gradient change space, the mapping relationship between the initial JND threshold and the image quality-related JND threshold can be obtained.
[0118] To better understand the video encoding methods described above, such as Figure 5 As shown, the following details an example of a video encoding method of the present invention:
[0119] In one example, the video encoding method provided in this application may include the following steps:
[0120] 1) Obtain the texture gradient dataset of the video frame images of the video to be encoded;
[0121] 2) Determine the image quality I in the texture gradient dataset based on a preset image quality evaluation index;
[0122] 3) Determine the average gradient texture value T of the video frame image. avg ;
[0123] 4) A second relational function is obtained by fitting the image quality and average gradient texture value. The second relational function can be as follows:
[0124] I = f(T) avg (1)
[0125] 5) Obtain the derivative of the second relation function f'(T) avg );
[0126] 6) Determine the first relational function 'a' based on the derivative function. The first relational function 'a' represents the relationship between the image gradient change space and the initial JND threshold, i.e.:
[0127] ΔT=aT (2)
[0128] In the above formula, ΔT represents the image gradient change space, T is the initial JND threshold, and the first relational function a is set as the derivative function f'(T). avg The reciprocal of ), that is:
[0129]
[0130] 7) Obtain the third relationship function between the initial JND threshold, the image quality-related JND threshold, and the image gradient change space, i.e.:
[0131] JND texture =T+ΔT (4)
[0132] 8) Determine the mapping function based on the third relation function and the first relation function, that is, by combining the above formulas (2)-(4), we can obtain:
[0133]
[0134] 9) According to formula (5), it can be determined Right now:
[0135]
[0136] The video coding method described above first calculates an initial JND threshold, then determines an image quality-related JND threshold by establishing a mapping function between the initial JND threshold and the image quality-related JND threshold. Encoding is performed using the image quality-related JND threshold. The higher the quality of the current macroblock, the larger the corresponding JND threshold can be adaptively adjusted, resulting in a higher compressible bitrate. This can effectively reduce perceptible distortion and objective distortion.
[0137] This application provides one possible implementation method, such as... Figure 6 As shown, a video encoding device 60 is provided, which may include: a first receiving module 601, an acquiring module 602, and a first returning module 603, wherein...
[0138] The first determining module 601 is used to determine the initial minimum perceptible difference (JND) threshold of the video to be encoded.
[0139] The second determining module 602 is used to determine the mapping function; the mapping function is used to represent the mapping relationship between the initial JND threshold and the image quality associated JND threshold;
[0140] The third determining module 603 is used to determine the image quality-related JND threshold based on the initial JND threshold and the mapping function;
[0141] Encoding module 604 is used to encode the video to be encoded based on the JND threshold associated with image quality.
[0142] This application embodiment provides a possible implementation, wherein the second determining module 602, when determining the mapping function, is specifically used for:
[0143] Obtain the first relationship function between the image gradient change space and the initial JND threshold; the first relationship function is related to image quality.
[0144] The mapping function is determined based on the first relation function.
[0145] This application embodiment provides a possible implementation method in which the second determining module 602, when obtaining the first relationship function between the image gradient change space and the initial JND threshold, is specifically used for:
[0146] Obtain the derivative of the second relational function; the second relational function is used to represent the relationship between the image quality of the video to be encoded and the average gradient texture value.
[0147] The first relation function is determined based on the derivative function.
[0148] This application provides a possible implementation method in which the first relational function is negatively correlated with the derivative function.
[0149] This application provides a possible implementation method in which the first relational function is positively correlated with the reciprocal of the derivative function.
[0150] This application provides a possible implementation, which also includes an acquisition module for:
[0151] Obtain the texture gradient dataset of video frame images from the video to be encoded;
[0152] Obtain the second relational function based on the texture gradient dataset.
[0153] This application provides a possible implementation method in which the acquisition module, when acquiring the second relation function based on the texture gradient dataset, is specifically used for:
[0154] The image quality in the texture gradient dataset is determined based on a preset image quality evaluation index.
[0155] Determine the average gradient texture value of the video frame image;
[0156] The second relational function is obtained by fitting the image quality and the average gradient texture value.
[0157] This application embodiment provides a possible implementation method in which the second determining module 602, when determining the mapping function based on the first relation function, is specifically used for:
[0158] Obtain the third relationship function between the initial JND threshold, the image quality-related JND threshold, and the image gradient change space;
[0159] The mapping function is determined based on the third relation function and the first relation function.
[0160] The aforementioned video encoding device first calculates an initial JND threshold, then determines an image quality-related JND threshold by determining a mapping function between the initial JND threshold and the image quality-related JND threshold, and uses the image quality-related JND threshold for encoding. The higher the quality of the current macroblock, the larger the corresponding JND threshold can be adaptively adjusted, resulting in a higher compressible bit rate, which can effectively reduce perceptible distortion and objective distortion.
[0161] The image video encoding device of this disclosure can execute an image video encoding method provided in the embodiments of this disclosure. The implementation principle is similar. The actions performed by each module in the image video encoding device in each embodiment of this disclosure correspond to the steps in the image video encoding method in each embodiment of this disclosure. For detailed functional descriptions of each module of the image video encoding device, please refer to the descriptions of the corresponding image video encoding methods shown above, which will not be repeated here.
[0162] Based on the same principles as the methods shown in the embodiments of this disclosure, the embodiments of this disclosure also provide an electronic device, which may include, but is not limited to: a processor and a memory; the memory for storing computer operation instructions; and the processor for executing the video encoding method shown in the embodiments by invoking the computer operation instructions. Compared with the prior art, the video encoding method in this application can effectively reduce perceptible distortion and reduce objective distortion.
[0163] In one alternative embodiment, an electronic device is provided, such as Figure 7 As shown, Figure 7 The illustrated electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of this electronic device 4000 does not constitute a limitation on the embodiments of this application.
[0164] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0165] Bus 4002 may include a pathway for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0166] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0167] The memory 4003 stores application code that executes the scheme of this application, and its execution is controlled by the processor 4001. The processor 4001 executes the application code stored in the memory 4003 to implement the content shown in the foregoing method embodiments.
[0168] Among them, electronic devices include, but are not limited to: mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (such as in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 7 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0169] This application provides a computer-readable storage medium storing a computer program that, when run on a computer, enables the computer to execute the corresponding content in the aforementioned method embodiments. Compared with the prior art, the video encoding method in this application can effectively reduce perceptible distortion and objective distortion.
[0170] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0171] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-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 of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0172] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0173] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0174] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the following actions:
[0175] Determine the initial minimum perceptible difference (JND) threshold for the video to be encoded;
[0176] Determine the mapping function; the mapping function is used to represent the mapping relationship between the initial JND threshold and the image quality-related JND threshold;
[0177] Determine the image quality-related JND threshold based on the initial JND threshold and the mapping function;
[0178] The video to be encoded is encoded based on the image quality-related JND threshold.
[0179] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0180] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0181] The modules described in the embodiments of this disclosure can be implemented in software or in hardware. The names of the modules are not necessarily limiting in certain circumstances; for example, the third determining module can also be described as "a module for determining the image quality associated JND threshold".
[0182] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
Claims
1. A video encoding method, characterized in that, include: Determine the initial minimum perceptible difference (JND) threshold for the video to be encoded; Determine the mapping function; the mapping function is used to represent the mapping relationship between the initial JND threshold and the image quality-related JND threshold; The image quality-related JND threshold is determined based on the initial JND threshold and the mapping function; Image quality associated JND threshold is an adaptive adjustment of the JND threshold corresponding to the texture mask based on the image quality of the current macroblock when encoding each macroblock during the residual calculation process. The video to be encoded is encoded based on the image quality associated JND threshold; The determination of the mapping function includes: Obtain a first relationship function between the image gradient change space and the initial JND threshold; the first relationship function is related to the degree of change in image quality. The mapping function is determined based on the first relational function.
2. The video encoding method according to claim 1, characterized in that, The first relationship function between obtaining the image gradient change space and the initial JND threshold includes: Obtain the derivative of the second relational function; the second relational function is used to represent the relationship between the image quality of the video to be encoded and the average gradient texture value. The first relational function is determined based on the derivative function.
3. The video encoding method according to claim 2, characterized in that, The first relational function is negatively correlated with the derivative function.
4. The video encoding method according to claim 3, characterized in that, The first relational function is positively correlated with the reciprocal of the derivative function.
5. The video encoding method according to claim 2, characterized in that, Before obtaining the derivative of the second relational function, the process further includes: Obtain the texture gradient dataset of the video frame images of the video to be encoded; The second relational function is obtained based on the texture gradient dataset.
6. The video encoding method according to claim 5, characterized in that, Obtaining the second relation function based on the texture gradient dataset includes: The image quality in the texture gradient dataset is determined based on a preset image quality evaluation index. Determine the average gradient texture value of the video frame image; The second relationship function is obtained by fitting the image quality and the average gradient texture value.
7. The video encoding method according to claim 1, characterized in that, Determining the mapping function based on the first relational function includes: Obtain the third relationship function between the initial JND threshold, the image quality-related JND threshold, and the image gradient change space; The mapping function is determined based on the third relation function and the first relation function.
8. A video encoding device, characterized in that, include: The first determining module is used to determine the initial minimum perceptible difference (JND) threshold of the video to be encoded. The second determining module is used to determine the mapping function; The mapping function is used to represent the mapping relationship between the initial JND threshold and the image quality-related JND threshold; Image quality associated JND threshold is an adaptive adjustment of the JND threshold corresponding to the texture mask based on the image quality of the current macroblock when encoding each macroblock during the residual calculation process. The third determining module is used to determine the image quality associated JND threshold based on the initial JND threshold and the mapping function; The encoding module is used to encode the video to be encoded based on the image quality associated JND threshold; The second determining module determines the mapping function, including: Obtain a first relationship function between the image gradient change space and the initial JND threshold; the first relationship function is related to the degree of change in image quality. The mapping function is determined based on the first relational function.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the video encoding method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the video encoding method according to any one of claims 1-7.
Citation Information
Patent Citations
Video coding method based on JND model
CN110139112A