Pixel value acquisition method and device, storage medium and electronic equipment
By obtaining the reference pixel values in the video frame image and constructing a mapping relationship for overflow intervention processing, the problem of pixel value overflow in intra-frame prediction is solved, and the accuracy and consistency of the video coding results are achieved.
Patent Information
- Application Number
- CN202310298318.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-15
- Publication Date
- 2024-09-20
AI Technical Summary
Existing intra prediction methods are prone to pixel value overflow problems during the video compression process, resulting in abnormal encoding results, and lack effective solutions.
By obtaining the brightness reconstruction value and chroma reconstruction value of the reference pixel area adjacent to the target pixel area in the current video frame image, a candidate mapping relationship is constructed, and overflow intervention processing is performed when calculating the mapping prediction coefficient to ensure the representation of the target reference value. The number of bits is smaller than before overflow, thereby obtaining accurate chroma prediction values.
It effectively avoids numerical overflow during the calculation process, ensures the accuracy and consistency of the video encoding results, and solves the problem of abnormal encoding results.
Smart Images

Figure CN118678089A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a method and device for obtaining pixel values, a storage medium and an electronic device. Background Art
[0002] In the process of compressing video, you can usually choose between inter-frame compression and intra-frame compression. Among them, the key to the intra-frame compression technology lies in how to perform intra-frame prediction, that is, using the boundary pixels of the adjacent reconstructed blocks as reference pixels in the current frame to predict the pixels of the current block, thereby removing the spatial redundancy of the video signal. Especially when the use of inter-frame prediction is limited, intra-frame prediction ensures the efficiency of video compression.
[0003] However, in the existing intra-frame prediction methods, overflow often occurs in the intermediate results of the calculation and prediction process due to large pixel values. For example, the intermediate results will exceed the 64-bit wide representation range. Since the maximum signed integer that a computer can represent is 64 bits, and the elements in the matrix during the calculation process are all stored in 64-bit integer variables, overflow will occur at this time, and different compilers may handle overflow differently, which will lead to abnormal intra-frame prediction results. In other words, the existing encoding method will have the technical problem of abnormal encoding results.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a method and device for obtaining pixel values, a storage medium and an electronic device, so as to at least solve the technical problem of abnormal video frame encoding results in related processing technologies.
[0006] According to one aspect of an embodiment of the present invention, a method for obtaining pixel values is provided, comprising: obtaining a luminance reconstruction value and a chrominance reconstruction value corresponding to each reference pixel in a reference pixel region adjacent to a target pixel region in a current video frame image, wherein the reference pixel region is a pixel region in the current video frame image in which pixel encoding has been completed; constructing a candidate mapping relationship based on the luminance reconstruction value and the chrominance reconstruction value corresponding to each reference pixel, wherein the candidate mapping relationship is used to indicate a mapping relationship between the luminance reconstruction value and a chrominance prediction value matching the chrominance reconstruction value; in the process of determining a mapping prediction coefficient between the luminance reconstruction value and the chrominance prediction value using the candidate mapping relationship, performing overflow intervention processing on the target reference value, wherein the number of bits representing the target reference value after the overflow intervention processing is less than the number of bits representing the target reference value before the overflow intervention processing, and the target reference value is a parameter value of an intermediate parameter used to calculate the mapping prediction coefficient; when the mapping prediction coefficient is determined, obtaining a chrominance prediction value corresponding to each target pixel using the mapping prediction coefficient and the luminance reconstruction value corresponding to each target pixel in the target pixel region.
[0007] According to another aspect of an embodiment of the present invention, a device for acquiring pixel values is also provided, including: a first acquisition unit, used to acquire a brightness reconstruction value and a chrominance reconstruction value corresponding to each reference pixel in a reference pixel area adjacent to a target pixel area in a current video frame image, wherein the reference pixel area is a pixel area in the current video frame image that has completed pixel encoding; a construction unit, used to construct a candidate mapping relationship based on the brightness reconstruction value and the chrominance reconstruction value corresponding to each reference pixel, wherein the candidate mapping relationship is used to indicate a mapping relationship between the brightness reconstruction value and the chrominance prediction value matching the chrominance reconstruction value; an intervention unit, used to In the process of determining the mapping prediction coefficient between the brightness reconstruction value and the chrominance prediction value by using the candidate mapping relationship, an overflow intervention process is performed on the target reference value, wherein the number of representation bits of the target reference value after the overflow intervention process is smaller than the number of representation bits of the target reference value before the overflow intervention process, and the target reference value is a parameter value of an intermediate parameter for calculating the mapping prediction coefficient; a second acquisition unit is used to obtain the chrominance prediction value corresponding to each of the target pixels by using the mapping prediction coefficient and the brightness reconstruction value corresponding to each target pixel in the target pixel area after the mapping prediction coefficient is determined.
[0008] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for obtaining pixel values when running.
[0009] According to another aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above pixel value acquisition method.
[0010] According to another aspect of an embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned method for obtaining pixel values through the computer program.
[0011] In an embodiment of the present invention, a brightness reconstruction value and a chromaticity reconstruction value corresponding to each reference pixel in a reference pixel area adjacent to a target pixel area in a current video frame image are obtained; a candidate mapping relationship is constructed based on the brightness reconstruction value and the chromaticity reconstruction value corresponding to each reference pixel; in the process of determining a mapping prediction coefficient between a brightness reconstruction value and a chromaticity prediction value using the candidate mapping relationship, an overflow intervention process is performed on the target reference value, and the number of representation bits of the target reference value after the overflow intervention process is less than the number of representation bits of the target reference value before the overflow intervention process; the chromaticity prediction value corresponding to each target pixel is obtained using the mapping prediction coefficient and the brightness reconstruction value corresponding to each target pixel in the target pixel area, so that in the process of obtaining the mapping prediction coefficient for generating the chromaticity prediction value, the relevant reference value is intervened, thereby avoiding the overflow of the value in the calculation process, and obtaining an accurate encoding result based on the result after the intervention, thereby solving the technical problem of abnormal encoding results in the relevant processing technology during video encoding. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0013] Figure 1 is a schematic diagram of a hardware environment of an optional method for obtaining pixel values according to an embodiment of the present invention;
[0014] Figure 2 is a flowchart of an optional method for obtaining pixel values according to an embodiment of the present invention;
[0015] Figure 3 is a schematic diagram of an optional method for obtaining pixel values according to an embodiment of the present invention;
[0016] Figure 4 is a schematic diagram of another optional method for obtaining pixel values according to an embodiment of the present invention;
[0017] Figure 5 A schematic structural diagram of an optional device for obtaining pixel values according to an embodiment of the present invention;
[0018] Figure 6 is a schematic structural diagram of another optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0021] The following is a description of the terms used in this application:
[0022] CU (Coding Unit): coding unit.
[0023] PU (Prediction Unit): prediction unit.
[0024] TU (Transform Unit): Transform unit.
[0025] MSE (Mean Squared Error): mean square error.
[0026] According to one aspect of an embodiment of the present invention, a method for obtaining a pixel value is provided. As an optional implementation, the method for obtaining a pixel value can be applied to, but is not limited to, Figure 1 In the pixel value acquisition system composed of the terminal device 102, the server 104 and the network 110 shown in FIG. Figure 1 As shown, the terminal device 102 is connected and communicated with the server 104 through the network 110. The above network may include but is not limited to: wired network, wireless network, wherein the wired network includes: local area network, metropolitan area network and wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that realize wireless communication. The above terminal device may include but is not limited to at least one of the following: mobile phone (such as Android mobile phone, iOS mobile phone, etc.), laptop computer, tablet computer, PDA, MID (Mobile Internet Devices, mobile Internet device), PAD, desktop computer, smart TV, car-mounted device, etc. The above terminal device may be installed with a client, wherein the terminal device 102 may be installed with a client that can realize the video acquisition function or video upload function, such as a photography client, a video playback client (which can provide a video upload function), etc.
[0027] The terminal device 102 is also provided with a display, a processor and a memory. The display can be used to display the program interface of the video playback program, the processor can be used to pre-process the acquired video to be uploaded, and the memory is used to store the video to be uploaded. It can be understood that when the server 104 completes the video encoding of the video uploaded by the terminal device 102, the terminal device 102 can also receive the video that has completed the video encoding sent by the server 104 through the network 110. When the terminal device 102 receives the user's video playback request, the video playback program running in the terminal device 102 plays the video that has completed the video encoding.
[0028] The server 104 may be a single server, a server cluster consisting of multiple servers, or a cloud server. The server includes a database and a processing engine. The processing engine is used to encode the video; the database may be used to store videos to be encoded or videos that have completed video encoding.
[0029] According to one aspect of an embodiment of the present invention, the above-mentioned pixel value acquisition system may further perform the following steps: first, as in step S102, the terminal device 102 sends the video to be encoded to the server 104 via the network 110, and then the server 104 executes steps S102 to S110 to obtain the brightness reconstruction value and the chromaticity reconstruction value corresponding to each reference pixel in the reference pixel area adjacent to the target pixel area in the current video frame image, wherein the reference pixel area is a pixel area in the current video frame image in which pixel encoding has been completed; based on the brightness reconstruction value and the chromaticity reconstruction value corresponding to each reference pixel, a candidate mapping relationship is constructed, wherein the candidate mapping relationship Used to indicate the mapping relationship between the luminance reconstruction value and the chrominance prediction value matching the chrominance reconstruction value; in the process of determining the mapping prediction coefficient between the luminance reconstruction value and the chrominance prediction value using the candidate mapping relationship, the target reference value is subjected to overflow intervention processing, wherein the representation bit number of the target reference value after the overflow intervention processing is less than the representation bit number of the target reference value before the overflow intervention processing, and the target reference value is the parameter value of the intermediate parameter used to calculate the mapping prediction coefficient; when the mapping prediction coefficient is determined, the chrominance prediction value corresponding to each target pixel in the target pixel area is obtained using the mapping prediction coefficient and the luminance reconstruction value corresponding to each target pixel in the target pixel area. Finally, the server 104 executes step S112 to send the encoded video to the terminal device 102 through the network 110, so that the encoded video can be played on the terminal device 102.
[0030] In an embodiment of the present invention, a brightness reconstruction value and a chromaticity reconstruction value corresponding to each reference pixel in a reference pixel area adjacent to a target pixel area in a current video frame image are obtained; a candidate mapping relationship is constructed based on the brightness reconstruction value and the chromaticity reconstruction value corresponding to each reference pixel; in the process of determining a mapping prediction coefficient between a brightness reconstruction value and a chromaticity prediction value using the candidate mapping relationship, an overflow intervention process is performed on the target reference value, and the number of representation bits of the target reference value after the overflow intervention process is less than the number of representation bits of the target reference value before the overflow intervention process; the chromaticity prediction value corresponding to each target pixel is obtained using the mapping prediction coefficient and the brightness reconstruction value corresponding to each target pixel in the target pixel area, so that in the process of obtaining the mapping prediction coefficient for generating the chromaticity prediction value, the relevant reference value is intervened, thereby avoiding the overflow of the value in the calculation process, and obtaining an accurate encoding result based on the result after the intervention, thereby solving the technical problem of abnormal encoding results in the relevant processing technology during video encoding.
[0031] The above is only an example and is not limited in this embodiment.
[0032] As an optional implementation, Figure 2As shown, the above pixel value acquisition method may include the following steps:
[0033] S202, obtaining a luminance reconstruction value and a chrominance reconstruction value corresponding to each reference pixel in a reference pixel region adjacent to a target pixel region in a current video frame image, wherein the reference pixel region is a pixel region in the current video frame image for which pixel encoding has been completed;
[0034] S204, constructing a candidate mapping relationship based on the luminance reconstruction value and the chrominance reconstruction value corresponding to each reference pixel, wherein the candidate mapping relationship is used to indicate a mapping relationship between the luminance reconstruction value and the chrominance prediction value matching the chrominance reconstruction value;
[0035] S206, in the process of determining the mapping prediction coefficient between the luminance reconstruction value and the chrominance prediction value by using the candidate mapping relationship, performing overflow intervention processing on the target reference value, wherein the number of representation bits of the target reference value after the overflow intervention processing is less than the number of representation bits of the target reference value before the overflow intervention processing, and the target reference value is a parameter value of an intermediate parameter used to calculate the mapping prediction coefficient;
[0036] S208, when the mapping prediction coefficient is determined, the chrominance prediction value corresponding to each target pixel in the target pixel area is obtained by using the mapping prediction coefficient and the luminance reconstruction value corresponding to each target pixel.
[0037] It should be noted that the above pixel value acquisition method can be applied to the intra-frame prediction process of a video frame image. In this embodiment, prediction can be performed based on the correlation between the brightness value component and the chrominance value component of each pixel in the video frame. For example, the chrominance prediction value corresponding to the pixel can be determined based on the brightness reconstruction value obtained by fully encoding the pixel, and then encoding can be performed based on the predicted chrominance prediction value, so that image compression can be achieved.
[0038] As an optional method, the above-mentioned intra-frame prediction method can be specifically an intra-frame prediction method implemented by a CCCM model (convolutional cross-component model, CCCM, cross component model). The above-mentioned intra-frame prediction method can also be an intra-frame prediction method implemented according to a CCLM model (Cross Component Linear Model, CCLM, cross component linear model). In this embodiment, the above-mentioned specific method of performing intra-frame prediction and encoding is not limited.
[0039] The following is an explanation of the brightness reconstruction value, the chrominance reconstruction value in the above step S202 and the chrominance prediction value in S204. It can be understood that in the intra-frame prediction technology scenario, the pixels can be reconstructed by encoding to achieve the effect of compressing the image frame. For the reconstructed pixels, the pixel value of the corresponding brightness component is the above brightness reconstruction value, and the pixel value of the corresponding chrominance component is the above chrominance reconstruction value. Further, in this embodiment, since there is a certain correlation between the brightness component and the chrominance component of the pixel, a chrominance value can be predicted based on the brightness reconstruction value and the mapping prediction coefficient, and the chrominance value is the above chrominance prediction value. Further, in the above step S202, the brightness reconstruction value and the chrominance reconstruction value corresponding to each reference pixel in the reference area where pixel encoding has been completed can be obtained first to determine the mapping prediction coefficient for chrominance prediction in the target area. It should be noted that the above-mentioned reference area can be a pixel area adjacent to the target pixel area, and it can be considered that the mapping prediction coefficients used for pixel prediction in the two areas are close or similar, and then the chromaticity value of the target pixel in the target area is predicted based on the mapping prediction coefficients obtained by solving the pixel values of each reference pixel in the reference area.
[0040] It can be understood that since the pixels in the reference pixel area have all been encoded, it is possible to obtain the brightness reconstruction value and the chrominance reconstruction value of each reference pixel in the reference pixel area after encoding.
[0041] It can be understood that the above-mentioned reference pixel area can be a pixel area adjacent to the target pixel area and located above the target pixel area; it can also be a pixel area adjacent to the target pixel area and located on the left side of the target pixel area; it can also be a pixel area adjacent to the target pixel area and surrounding the target pixel area; it can also be all the pixel areas adjacent to the target pixel area that have been encoded. In this embodiment, the scope of the above-mentioned reference pixel area is not limited.
[0042] In the above step S204, the above candidate mapping relationship may be an error equation, specifically, it may be a matrix equation indicating the difference between the chrominance prediction value obtained by mapping the prediction coefficient of the luminance reconstruction value of each reference pixel and the actual chrominance reconstruction value of each reference pixel. It should be noted that in the above error equation, the mapping relationship between the luminance reconstruction value and the chrominance prediction value of the above reference pixel may be a linear mapping relationship or a nonlinear mapping relationship, and in this embodiment, the relationship between the luminance reconstruction value and the chrominance prediction value is not limited.
[0043] Next, in the above step S206, the mapping prediction coefficient between the luminance reconstruction value and the chrominance prediction value can be determined by the error equation indicated by the above candidate mapping relationship, and in the process of obtaining the above mapping prediction coefficient through the above candidate mapping relationship, the intermediate value that may have numerical overflow, that is, the above target reference value, is intervened, so as to ensure that a relatively accurate mapping prediction coefficient is obtained.
[0044] It can be understood that, when the mapping prediction coefficients are obtained through the above step S206, the chrominance prediction values corresponding to each pixel in the target pixel area can be further obtained according to the above mapping prediction coefficients.
[0045] The following combination Figure 3 The above implementation is described in detail. Figure 3 As shown, in this embodiment, the CCCM method can be used for intra-frame prediction. Specifically, the CCCM method is a video coding intra-frame prediction method for chrominance components. The method uses a PU level flag to indicate whether it is enabled. When enabled, the method uses a 7-tap convolution filter to implement a nonlinear mapping from a luminance reconstruction value to a chrominance prediction value.
[0046] First, if Figure 3 As shown, based on the prediction unit 301 (i.e., the target pixel area), the reference area 302 (i.e., the reference pixel area) adjacent to the prediction unit 301 is determined. Specifically, the reference area consists of 6 rows of chroma samples above and to the left of the PU prediction unit 301, extending to the right by 1 PU width, and extending below the PU boundary by 1 PU height, which only includes available sample areas. Figure 3 In order to use a 7-tap convolution filter for the boundary pixels of the reference area 302 when the adjacent pixels in the spatial domain are available, a row of reference pixels needs to be extended, and when these pixels are not available, they are filled with adjacent available pixels.
[0047] Next, based on all luma pixels in the reference region, filter coefficients (i.e., mapping prediction coefficients) for predicting chroma prediction values of chroma components of pixels in prediction unit 301 are determined, which includes two sub-steps: downsampling to adapt the size of chroma components and generating filter coefficients.
[0048] Specifically, during the downsampling process, for each brightness reference pixel to be generated, a 5-tap cross downsampling filter or a 6-tap square downsampling filter is used to downsample the brightness pixel at the corresponding position and the 4 or 5 brightness pixels around it to obtain the brightness reference pixel.
[0049] The filter coefficients are derived using a regression-based MSE minimization method, which minimizes the MSE of the chroma predicted pixels in the reference area and the chroma reconstructed pixels obtained after filtering, and the filter coefficients are derived for each chroma PU.
[0050] Let o[i] be the chrominance reconstructed pixel value in the reference area, where i∈I is the coordinate vector, I is the set of coordinates of all pixels in the reference area; r[i] is the encoded luminance reconstructed pixel value; f[i] is the chrominance predicted pixel value after CCCM filtering. Then the mean square error between the original pixel and the filtered pixel in the reference area is:
[0051]
[0052] Among them C n is the filter coefficient, p n is the coordinate offset of the filter coefficient position relative to the center position of the filter. Then the partial derivative of MSE with respect to each coefficient is:
[0053]
[0054] To minimize the MSE, let its partial derivative with respect to each coefficient be 0, then:
[0055]
[0056]
[0057]
[0058] Writing the above formula in matrix form, we can get:
[0059]
[0060] For convenience,
[0061]
[0062]
[0063]
[0064]
[0065] Then the above linear equations can be written as:
[0066]
[0067] Solving for the optimal filter coefficients can be simplified to solving the equation:
[0068] R T RC=R T O (12)
[0069] It is understandable that, in this embodiment, the specific value of the filter coefficient can be obtained by solving the above equation (12). In this embodiment, the process of solving the filter coefficient can be intervened to avoid overflow of the intermediate result.
[0070] Finally, when the filter coefficients are determined in the above manner, Figure 4 As shown, the chromaticity prediction value corresponding to each pixel in the target pixel area can be specifically determined in the following manner.
[0071] Specifically, the filter input consists of a 5-tap spatial neighboring luminance reconstruction pixel, a nonlinear term, and a bias term. The 5-tap spatial neighboring pixels include the center (C) luminance reconstruction pixel corresponding to the predicted chrominance pixel position, and its upper / north (N), lower / south (S), left / west juxtaposed (W), and right / east (E) luminance reconstruction pixels, such as Figure 4 As shown, the brightness reconstruction values of the spatial adjacent pixels required when the chrominance prediction value of the current pixel is generated by the above CCCM method.
[0072] The nonlinear term P is expressed as the second power of the center brightness reconstruction pixel C and is truncated to the pixel value range, as shown in formula (13):
[0073] P=(C*C+midVal)>>bitDepth (13)
[0074] For 10-bit input, the nonlinear term P = (C*C+512)>>10. The bias term B represents the scalar offset between the input and output and is set to the intermediate chroma value (set to 512 for 10-bit input). The chroma prediction value is obtained by calculating the convolution between the filter coefficients and the input value and restricting it to the range of valid chroma samples, as shown in formula (14):
[0075] predChromaVal=C0C+C1N+C2S+C3E+C4W+C5P+C6B (14)
[0076] Through the above-mentioned implementation mode of the present application, the brightness reconstruction value and the chrominance reconstruction value corresponding to each reference pixel in the reference pixel area adjacent to the target pixel area in the current video frame image are obtained; based on the brightness reconstruction value and the chrominance reconstruction value corresponding to each reference pixel, a candidate mapping relationship is constructed; in the process of determining the mapping prediction coefficient between the brightness reconstruction value and the chrominance prediction value by using the candidate mapping relationship, overflow intervention processing is performed on the target reference value, and the number of representation bits of the target reference value after the overflow intervention processing is less than the number of representation bits of the target reference value before the overflow intervention processing; using the mapping prediction coefficient and the brightness reconstruction value corresponding to each target pixel in the target pixel area, the chrominance prediction value corresponding to each target pixel is obtained, so that in the process of obtaining the mapping prediction coefficient for generating the chrominance prediction value, the relevant reference value is intervened, thereby avoiding the overflow of the value in the calculation process, and obtaining an accurate encoding result based on the result after the intervention, thereby solving the technical problem of abnormal encoding results in the related processing technology during video encoding.
[0077] As an optional implementation manner, in the process of determining the mapping prediction coefficient between the luminance reconstruction value and the chrominance prediction value by using the candidate mapping relationship, performing overflow intervention processing on the target reference value includes:
[0078] S1, determining a parameter matrix according to the brightness reconstruction value and the chrominance reconstruction value corresponding to each reference pixel;
[0079] S2, in the process of obtaining the first reference matrix and the second reference matrix matching the parameter matrix by means of matrix decomposition, when it is determined that the target reference values of the matrix elements included in the first reference matrix and the second reference matrix will have a numerical overflow, an overflow intervention process is performed on the target reference values, wherein the mapping prediction coefficient is a weight coefficient determined according to the first reference matrix and the second reference matrix.
[0080] It should be noted that, in this embodiment, the above mapping prediction coefficients can be solved by matrix decomposition. The specific method is as follows:
[0081] The current CCCM method generates reference pixels in units of PUs and uses the regression-based MSE minimization method to derive filter coefficients according to formula (12). Formula (12) can be simplified to:
[0082] AX=Y (15)
[0083] A=R T R (16)
[0084] Y=R T O (17)
[0085] Using LDLT The decomposition method decomposes the matrix A (i.e. the parameter matrix).
[0086] A=LDL T (18)
[0087] Solving formula (15) can be simplified to solving:
[0088] LDL T X=Y (19)
[0089] First solve
[0090] LB=Y (20)
[0091] Then solve
[0092] DL T X=B (21)
[0093] Get X, the filter coefficient that minimizes MSE.
[0094] It can be understood that in this embodiment, by solving the decomposition matrix related to matrix A (i.e., the parameter matrix), it is possible to pre-determine whether numerical overflow will occur in the subsequent calculation process. If it will occur, relevant intervention processing is performed to avoid numerical overflow.
[0095] Through the above-mentioned implementation mode of the present application, a parameter matrix is determined according to the brightness reconstruction value corresponding to each reference pixel; in the process of obtaining the first reference matrix and the second reference matrix matching the parameter matrix by means of matrix decomposition, when it is determined that the target reference values of the matrix elements included in the first reference matrix and the second reference matrix will have a numerical overflow, overflow intervention processing is performed on the target reference values, so that in the process of solving the mapping prediction coefficient, the intermediate result of the matrix decomposition is pre-judged to avoid the overflow of the intermediate result.
[0096] As an optional implementation manner, in the case where it is determined that target reference values of matrix elements included in the first reference matrix and the second reference matrix will overflow, performing overflow intervention processing on the target reference values includes:
[0097] S1, obtaining a first reference value and a second reference value for determining a target reference value of a current matrix element;
[0098] S2, when the number of bits representing the product of the first reference value and the second reference value is greater than the target number of bits, the reference value with the largest absolute value allowed to be indicated by the target number of bits is determined as the target reference value of the current matrix element.
[0099] As an optional implementation manner, the above-mentioned determining the reference value with the maximum absolute value allowed to be indicated by the target bit number as the target reference value of the current matrix element includes:
[0100] S1, when the number of digits indicated by the product value of the first reference value and the second reference value is greater than the target number of digits and the product value is a positive number, determining the maximum reference value indicated by the target number of digits as the target reference value;
[0101] S2, when the product value of the first reference value and the second reference value indicates that the number of bits is greater than the target number of bits and the product value is a negative number, determining the minimum reference value indicated by the target number of bits as the target reference value.
[0102] As an optional implementation manner, after obtaining the first reference value and the second reference value for determining the target reference value of the current matrix element, the method further includes:
[0103] S1, when the number of bits representing the product value of the first reference value and the second reference value is greater than the target number of bits, ending the matrix decomposition operation related to the product operation between the first reference value and the second reference value;
[0104] S2, obtain a reference constant value as a mapping prediction coefficient.
[0105] The specific process of solving the mapping prediction coefficient is further described below in combination with the above implementation.
[0106] According to formula (18), matrix A is subjected to LDL T When decomposing:
[0107]
[0108] The matrices L and D are calculated according to the formula:
[0109]
[0110]
[0111] In the existing CCCM implementation, for 10-bit input, the reconstructed pixel value has a bit width of 10. Let I be the number of all pixels in the reference area. Then the maximum bit width of each element in the matrix A is:
[0112] log2I+10+10=log2I+20 (25)
[0113] For the next generation video coding standard, the maximum size of a CU or PU is 256x256. Figure 3The maximum number of reference pixel areas is 9228 pixels, i.e., I = 9228. According to formulas (23), (24), and (25), the maximum bit width of each element of matrices D and L is also 34 bits. According to formula (18), the maximum bit width of matrix A is also 34 bits. When the elements in matrices D and L reach the maximum bit width, the intermediate results of formulas (23) and (24) will exceed the 64-bit wide representation range. Since the maximum signed integer that a computer can represent is 64 bits, the elements in the matrix are all stored in 64-bit integer variables, and overflow will occur at this time.
[0114] In this embodiment, when the intermediate result is about to overflow, it is truncated within the valid data range. Specifically, during the multiplication calculation in formulas (23) and (24), the bit width of the multiplication result is pre-determined, and when the bit width of the intermediate result of the multiplication exceeds the maximum range that can be represented by the data type, the intermediate result is truncated.
[0115] Specifically, the filter coefficient equations are constructed and solved according to formulas (15), (16), and (17).
[0116] Perform LDL on the matrix A in formula (15) T Decompose and calculate the decomposed matrices L and D according to formulas (23) and (24).
[0117] In one example, the intermediate result that is about to overflow is truncated within the valid data range and the filter parameters are continuously derived. Specifically, let bw be the maximum allowable bit width, a and b be two multipliers, and determine whether a multiplication overflow is about to occur according to formula (26):
[0118] log2a+log2b≥bw (26)
[0119] If it is determined that overflow is about to occur, the maximum data that can be represented by the maximum allowed bit width is directly used as the result of the multiplication, thereby decomposing the matrices L and D.
[0120] In one example, specifically, if the intermediate result is a negative number and exceeds the maximum bit width representation range, the smallest negative number that can be represented by the bit width is used as the intermediate result.
[0121] In another example, specifically, if the intermediate result is a positive number and exceeds the maximum bit width representation range, the maximum positive number that can be represented by the bit width is used as the intermediate result.
[0122] It is understandable that, through the above LDL T When the matrices L and D are obtained by decomposition, the optimal filtering parameters can be obtained by solving formulas (20) and (21) respectively.
[0123] In another example, for an intermediate result that is about to overflow, the LDL is terminated early.T Specifically, according to formula (26), it is determined whether an overflow is about to occur. If an overflow is about to occur, the LDL of formulas (23) and (24) is terminated. T break down.
[0124] As an optional implementation manner, the obtaining of the reference constant value as the mapping prediction coefficient includes one of the following:
[0125] 1) determining a mapping prediction coefficient according to the obtained first reference constant value;
[0126] 2) Obtaining second reference constant values corresponding to each target pixel in the target pixel area respectively, and determining the second reference constant as a mapping prediction coefficient corresponding to each target pixel.
[0127] It is understood that in the above embodiment, if LDL T If the decomposition is terminated prematurely, all filter parameters are set to arbitrary constant values.
[0128] In one example, the filter parameters may be set to all zeros.
[0129] In one example, the filter parameters can be set to arbitrary constant values that are common to the codec.
[0130] In one example, different constant values may be used for filter parameters at different locations.
[0131] In another example, the filter parameters at different locations may use the same constant value.
[0132] Through the above-mentioned implementation mode of the present application, in the process of decomposing the matrix, it is pre-determined whether the intermediate result will overflow. If it is determined that overflow will occur, corresponding processing is performed, such as terminating the matrix decomposition early, or directly assigning a value to the product result, so as to avoid overflow of the intermediate result.
[0133] As an optional implementation manner, in the process of determining the mapping prediction coefficient between the luminance reconstruction value and the chrominance prediction value by using the candidate mapping relationship, performing overflow intervention processing on the target reference value includes:
[0134] S1, obtaining a reference offset value corresponding to each reference pixel;
[0135] S2, determining a reference brightness reconstruction value according to the brightness reconstruction value and the reference offset value corresponding to each reference pixel;
[0136] S3, performing overflow intervention processing on the target reference value according to the reference brightness reconstruction value.
[0137] It can be understood that, in this embodiment, the brightness reconstruction values of the reference pixels used to solve the mapping prediction coefficients can be preprocessed, thereby avoiding the overflow of the intermediate values generated during the matrix decomposition process.
[0138] Specifically, the optimal CCCM filter parameters can be obtained by solving formula (15) using the regression-based MSE minimization method according to the adjusted filter input.
[0139] Specifically, the 5-tap spatially adjacent reference pixels input by the CCCM filter are respectively subtracted from the offset (offsetLuma).
[0140]
[0141] Through the above-mentioned implementation mode of the present application, a reference offset value corresponding to each reference pixel is obtained; a reference brightness reconstruction value is determined according to the brightness reconstruction value and the reference offset value corresponding to each reference pixel; and overflow intervention processing is performed on the target reference value according to the reference brightness reconstruction value, thereby reducing the data range of each element in the matrices R and A in formulas (16) and (17), and the data range of each element of each matrix in formulas (23) and (24) is reduced, thereby avoiding overflow in the process of calculating matrices D and L.
[0142] As an optional implementation manner, after obtaining the reference offset value corresponding to each reference pixel, the method further includes:
[0143] S1, subtracting the corresponding reference offset value from the brightness reconstruction value corresponding to each reference pixel in turn to obtain the reference brightness reconstruction value corresponding to each reference pixel;
[0144] S2, determining a mapping prediction coefficient using a reference brightness reconstruction value corresponding to each reference pixel and a candidate mapping relationship.
[0145] As an optional implementation manner, the obtaining of the reference offset value corresponding to each reference pixel includes:
[0146] S1, obtaining a first brightness reconstruction value of a first reference pixel adjacent to the reference pixel and located above the reference pixel;
[0147] S2, obtaining a second brightness reconstruction value of a second reference pixel adjacent to the reference pixel and located on the right side of the reference pixel;
[0148] S3, obtaining a third brightness reconstruction value of a third reference pixel that is adjacent to the reference pixel and located below the reference pixel;
[0149] S4, obtaining a fourth brightness reconstruction value of a fourth reference pixel that is adjacent to the reference pixel and located on the left side of the reference pixel;
[0150] S5, obtaining a fifth brightness reconstruction value of the reference pixel;
[0151] S6, determining an average value of the first brightness reconstruction value, the second brightness reconstruction value, the third brightness reconstruction value, the fourth brightness reconstruction value, and the fifth brightness reconstruction value as a reference offset value corresponding to the reference pixel.
[0152] Specifically, in this implementation, the above offset can be set to the average value of 5-tap spatial adjacent reference pixels:
[0153]
[0154] As an optional manner, the above-mentioned obtaining of the reference offset value corresponding to each reference pixel includes one of the following:
[0155] 1) determining a brightness reconstruction value corresponding to any reference pixel in the reference pixel area as a reference offset value corresponding to each reference pixel;
[0156] 2) Obtain a brightness reconstruction value of a reference pixel that is adjacent to the reference pixel and located at the upper left corner of the reference pixel as a reference offset value corresponding to the reference pixel.
[0157] Specifically, in another example, the offset may be set to a brightness reconstructed pixel value corresponding to any reconstructed position.
[0158] Specifically, the brightness corresponding to the upper left corner of the current chroma PU may be used to reconstruct the pixel.
[0159] Alternatively, the brightness of the pixels at any position can be used to reconstruct the pixels.
[0160] Through the above implementation of the present application, overflow can be avoided by reducing the data range of the elements in the matrix. Specifically, when filtering and generating predicted pixels using the reference area, the input of each filter is subtracted from the offset, thereby reducing the data range of generating the reference pixel, thereby avoiding data overflow in the process of solving the mapping prediction coefficient.
[0161] As an optional implementation manner, the above-mentioned using the mapping prediction coefficient and the brightness reconstruction value corresponding to each target pixel in the target pixel area to obtain the chrominance prediction value corresponding to each target pixel includes:
[0162] S1, obtaining a target offset value corresponding to each target pixel;
[0163] S2, subtracting the corresponding target offset value from the brightness reconstruction value corresponding to each target pixel in turn to obtain the target brightness reconstruction value corresponding to each target pixel;
[0164] S3, obtaining the chrominance prediction value corresponding to each target pixel according to the mapping prediction coefficient and the target brightness reconstruction value corresponding to each target pixel.
[0165] It should be noted that, in the present embodiment, in the process of calculating the chrominance prediction value of each pixel in the target pixel area, data overflow can also be avoided by preprocessing control of the offset.
[0166] Specifically, when filtering the prediction area to generate prediction pixels, the offset is subtracted from the input of each filter, thereby reducing the data range for generating reference pixels.
[0167] The complete process of two specific implementation methods of the present application is described in detail below.
[0168] In the first implementation, the input of the CCCM filter is not modified, and when the intermediate result is about to overflow, it is truncated within the valid data range. Specifically, during the multiplication calculation in formulas (23) and (24), the bit width of the multiplication result is pre-determined, and when the bit width of the intermediate result of the multiplication exceeds the maximum range that the data type can represent, the intermediate result is truncated. The specific implementation is as follows:
[0169] S1, taking CU or PU as a unit, construct a reference pixel area using its upper, left, upper-left and upper-right reference pixels.
[0170] S2, after the reference pixel area is constructed, a 5-tap cross downsampling filter or a 6-tap square downsampling filter is used to downsample the brightness reference pixel.
[0171] S3, using the regression-based MSE minimization method, by minimizing the MSE of the chrominance prediction pixels and the reconstructed pixels in the reference area, derives the CCCM model filter coefficients. Specifically, it includes the following steps:
[0172] S3-1, the 5-tap spatial adjacent reference pixels input to the CCCM filter, include the center (C) luminance reconstructed pixel corresponding to the predicted chrominance pixel position, and its four luminance reconstructed pixels above / north (N), below / south (S), left / west juxtaposed (W), and right / east (E).
[0173] S3-2, the nonlinear term P is expressed as the second power of the center brightness reconstruction pixel C and is truncated to the pixel value range.
[0174] S3-3, according to the filter input, the regression-based MSE minimization method is used to solve formula (15) to obtain the optimal CCCM filter parameters.
[0175] S3-3-1, construct and solve the filter coefficient equation according to formula (15)(16)(17).
[0176] S3-3-2, perform LDL on the matrix A in formula (15) T Decompose and calculate the decomposed matrices L and D according to formulas (23) and (24).
[0177] a) In one example, the intermediate result that is about to overflow is truncated within the valid data range and the filter parameters are further derived. Specifically, let bw be the maximum allowable bit width, a and b be two multipliers, and determine whether a multiplication overflow is about to occur according to the following formula (26):
[0178] log2a+log2b≥bw (26)
[0179] If it is determined that overflow is about to occur, the maximum data that can be represented by the maximum allowed bit width is directly used as the result of the multiplication, thereby decomposing the matrices L and D.
[0180] In one example, specifically, if the intermediate result is a negative number and exceeds the maximum bit width representation range, the smallest negative number that can be represented by the bit width is used as the intermediate result.
[0181] In another example, specifically, if the intermediate result is a positive number and exceeds the maximum bit width representation range, the maximum positive number that can be represented by the bit width is used as the intermediate result.
[0182] b) In another example, for an intermediate result that is about to overflow, end the LDL early T Specifically, according to formula (26), it is determined whether an overflow is about to occur. If an overflow is about to occur, the LDL of formulas (23) and (24) is terminated. T break down.
[0183] S3-3-3, generate optimal filtering parameters.
[0184] a) In one example, specifically, according to LDL T The decomposed matrices L and D are used to solve formulas (20) and (21) respectively to obtain the optimal filtering parameters.
[0185] b) In another example, specifically, if LDL T If the decomposition is terminated prematurely, all filter parameters are set to arbitrary constant values.
[0186] In one example, the filter parameters may be set to all zeros.
[0187] In one example, the filter parameters can be set to arbitrary constant values that are common to the codec.
[0188] In one example, different constant values may be used for filter parameters at different locations.
[0189] In another example, the filter parameters at different locations may use the same constant value.
[0190] S4, after the model filtering parameters are generated, this embodiment uses the CCCM model parameters to generate the chrominance prediction of the corresponding area.
[0191] In another example, overflow is avoided by reducing the data range of the elements in the matrix. Specifically, when filtering the prediction area to generate the prediction pixels, the input of each filter is subtracted by the offset, thereby reducing the data range of the generated reference pixels. The specific implementation is as follows:
[0192] S1, taking CU or PU as a unit, construct a reference pixel area using its upper, left, upper-left and upper-right reference pixels.
[0193] S2, after the reference pixel area is constructed, a 5-tap cross downsampling filter or a 6-tap square downsampling filter is used to downsample the brightness reference pixel.
[0194] S3, using the regression-based MSE minimization method, derives the CCCM model filter coefficients by minimizing the MSE of the chrominance predicted pixels and the reconstructed pixels in the reference region.
[0195] S3-1, the 5-tap spatial adjacent reference pixels input by the CCCM filter are subtracted from the offset (offsetLuma).
[0196]
[0197] a) In one example, specifically, the offset can be set to the average of 5-tap spatially adjacent reference pixels
[0198]
[0199] b) In another example, the offset may be set to a brightness reconstructed pixel value corresponding to any reconstructed position.
[0200] Specifically, the brightness corresponding to the upper left corner of the current chroma PU may be used to reconstruct the pixel.
[0201] Alternatively, the brightness of the pixels at any position can be used to reconstruct the pixels.
[0202] S3-2, adjusting the nonlinear term of the CCCM filter input according to the center (C) luminance reconstructed pixel corresponding to the adjusted predicted chrominance pixel position.
[0203] P=(C′*C′+midVal)>>bitDepth (29)
[0204] S3-3, based on the adjusted filter input, the regression-based MSE minimization method is used to solve formula (15) to obtain the optimal CCCM filter parameters.
[0205] S3-3-1, construct and solve the filter coefficient equation according to formula (15)(16)(17).
[0206] S3-3-2, perform LDL on the matrix A in formula (15) T Decompose and calculate the decomposed matrices L and D according to formulas (23) and (24).
[0207] Specifically, this embodiment reduces the data range of each element in the matrices R and A in formulas (16) and (17), and the data range of each element of each matrix in formulas (23) and (24) is reduced, thereby avoiding overflow in the process of calculating matrices D and L.
[0208] S3-3-3, solve formulas (20) and (21) respectively to obtain the optimal filtering parameters.
[0209] S4, after the model filtering parameters are generated, this embodiment uses the CCCM model parameters to generate the chrominance prediction of the corresponding area.
[0210] Through the above implementation of the present application, the brightness reconstruction value and the chromaticity reconstruction value corresponding to each reference pixel in the reference pixel area adjacent to the target pixel area in the current video frame image are obtained; based on the brightness reconstruction value and the chromaticity reconstruction value corresponding to each reference pixel, a candidate mapping relationship is constructed; in the process of determining the mapping prediction coefficient between the brightness reconstruction value and the chromaticity prediction value using the candidate mapping relationship, the target reference value is subjected to overflow intervention processing, and the number of bits of the target reference value after the overflow intervention processing is less than the number of bits of the target reference value before the overflow intervention processing; the mapping prediction coefficient and the brightness reconstruction value corresponding to each target pixel in the target pixel area are used to obtain the chromaticity prediction value corresponding to each target pixel, so that in the process of obtaining the mapping prediction coefficient for generating the chromaticity prediction value, the relevant reference value is subjected to intervention processing, thereby avoiding the overflow of the value in the calculation process, thereby obtaining an accurate encoding result based on the result after the intervention, and solving the technical problem of abnormal encoding results in the process of video encoding of the relevant processing technology. In addition, through a unified intervention processing method, the same encoding result can be ensured under different compilers.
[0211] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0212] According to another aspect of the embodiments of the present invention, a device for obtaining pixel values for implementing the above-mentioned method for obtaining pixel values is also provided. Figure 5 As shown, the device comprises:
[0213] A first acquisition unit 502 is used to acquire a luminance reconstruction value and a chrominance reconstruction value corresponding to each reference pixel in a reference pixel region adjacent to a target pixel region in a current video frame image, wherein the reference pixel region is a pixel region in the current video frame image in which pixel encoding has been completed;
[0214] A constructing unit 504 is configured to construct a candidate mapping relationship based on the luminance reconstruction value and the chrominance reconstruction value corresponding to each reference pixel, wherein the candidate mapping relationship is used to indicate a mapping relationship between the luminance reconstruction value and the chrominance prediction value matching the chrominance reconstruction value;
[0215] an intervention unit 506, configured to perform overflow intervention processing on a target reference value in a process of determining a mapping prediction coefficient between a luminance reconstruction value and a chrominance prediction value by using a candidate mapping relationship, wherein the number of representation bits of the target reference value after the overflow intervention processing is less than the number of representation bits of the target reference value before the overflow intervention processing, and the target reference value is a parameter value of an intermediate parameter used to calculate the mapping prediction coefficient;
[0216] The second acquisition unit 508 is used to acquire the chrominance prediction value corresponding to each target pixel by using the mapping prediction coefficient and the luminance reconstruction value corresponding to each target pixel in the target pixel area when the mapping prediction coefficient is determined.
[0217] Optionally, in this embodiment, the embodiments to be implemented by the above-mentioned various unit modules can refer to the above-mentioned various method embodiments, which will not be repeated here.
[0218] According to another aspect of the embodiments of the present invention, an electronic device for implementing the above-mentioned pixel value acquisition method is also provided. The electronic device may be Figure 6 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a terminal device as an example. Figure 6As shown, the electronic device includes a memory 602 and a processor 604. The memory 602 stores a computer program, and the processor 604 is configured to execute the steps in any of the above method embodiments through the computer program.
[0219] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0220] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0221] S1, obtaining a luminance reconstruction value and a chrominance reconstruction value corresponding to each reference pixel in a reference pixel region adjacent to a target pixel region in a current video frame image, wherein the reference pixel region is a pixel region in the current video frame image in which pixel encoding has been completed;
[0222] S2, constructing a candidate mapping relationship based on the luminance reconstruction value and the chrominance reconstruction value corresponding to each reference pixel, wherein the candidate mapping relationship is used to indicate a mapping relationship between the luminance reconstruction value and the chrominance prediction value matching the chrominance reconstruction value;
[0223] S3, in the process of determining the mapping prediction coefficient between the luminance reconstruction value and the chrominance prediction value by using the candidate mapping relationship, performing overflow intervention processing on the target reference value, wherein the number of representation bits of the target reference value after the overflow intervention processing is less than the number of representation bits of the target reference value before the overflow intervention processing, and the target reference value is a parameter value of an intermediate parameter used to calculate the mapping prediction coefficient;
[0224] S4, when the mapping prediction coefficient is determined, the chrominance prediction value corresponding to each target pixel in the target pixel area is obtained by using the mapping prediction coefficient and the brightness reconstruction value corresponding to each target pixel in the target pixel area.
[0225] Alternatively, a person skilled in the art may understand that: Figure 6 The structure shown is for illustration only, and the electronic device may also be a vehicle-mounted terminal, a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 6 The structure of the electronic device is not limited. Figure 6 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 6 Different configurations are shown.
[0226] Among them, the memory 602 can be used to store software programs and modules, such as the program instructions / modules corresponding to the pixel value acquisition method and device in the embodiment of the present invention. The processor 604 executes various functional applications and data processing by running the software programs and modules stored in the memory 602, that is, realizing the above-mentioned pixel value acquisition method. The memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 602 may further include a memory remotely arranged relative to the processor 604, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 602 can be specifically, but not limited to, used to store file information such as target logical files. As an example, such as Figure 6 As shown, the memory 602 may include, but is not limited to, the first acquisition unit 502, the construction unit 504, the intervention unit 506, and the second acquisition unit 508 in the pixel value acquisition device. In addition, it may also include, but is not limited to, other module units in the pixel value acquisition device, which will not be repeated in this example.
[0227] Optionally, the transmission device 606 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 606 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 606 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0228] In addition, the electronic device mentioned above further includes: a display 608, and a connection bus 610, which is used to connect various module components in the electronic device mentioned above.
[0229] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. Among them, the nodes may form a peer-to-peer (P2P, Peer To Peer) network, and any form of computing device, such as a server, terminal and other electronic devices, may become a node in the blockchain system by joining the peer-to-peer network.
[0230] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer program / instruction comprising a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions provided by the embodiments of the present application are executed.
[0231] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0232] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned method for obtaining pixel values.
[0233] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0234] S1, obtaining a luminance reconstruction value and a chrominance reconstruction value corresponding to each reference pixel in a reference pixel region adjacent to a target pixel region in a current video frame image, wherein the reference pixel region is a pixel region in the current video frame image in which pixel encoding has been completed;
[0235] S2, constructing a candidate mapping relationship based on the luminance reconstruction value and the chrominance reconstruction value corresponding to each reference pixel, wherein the candidate mapping relationship is used to indicate a mapping relationship between the luminance reconstruction value and the chrominance prediction value matching the chrominance reconstruction value;
[0236] S3, in the process of determining the mapping prediction coefficient between the luminance reconstruction value and the chrominance prediction value by using the candidate mapping relationship, performing overflow intervention processing on the target reference value, wherein the number of representation bits of the target reference value after the overflow intervention processing is less than the number of representation bits of the target reference value before the overflow intervention processing, and the target reference value is a parameter value of an intermediate parameter used to calculate the mapping prediction coefficient;
[0237] S4, when the mapping prediction coefficient is determined, the chrominance prediction value corresponding to each target pixel in the target pixel area is obtained by using the mapping prediction coefficient and the brightness reconstruction value corresponding to each target pixel in the target pixel area.
[0238] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0239] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to perform all or part of the steps of the above methods of various embodiments of the present invention.
[0240] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0241] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0242] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0243] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0244] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for obtaining a pixel value, characterized in that: include: Obtaining a luminance reconstruction value and a chrominance reconstruction value corresponding to each reference pixel in a reference pixel region adjacent to a target pixel region in a current video frame image, wherein the reference pixel region is a pixel region in the current video frame image in which pixel encoding has been completed; Based on the luminance reconstruction value and the chrominance reconstruction value corresponding to each reference pixel, a candidate mapping relationship is constructed, wherein the candidate mapping relationship is used to indicate a mapping relationship between the luminance reconstruction value and a chrominance prediction value matching the chrominance reconstruction value; In the process of determining the mapping prediction coefficient between the luma reconstruction value and the chroma prediction value by using the candidate mapping relationship, an overflow intervention process is performed on a target reference value, wherein the number of representation bits of the target reference value after the overflow intervention process is less than the number of representation bits of the target reference value before the overflow intervention process, and the target reference value is a parameter value of an intermediate parameter used to calculate the mapping prediction coefficient; When the mapping prediction coefficient is determined, the chrominance prediction value corresponding to each target pixel in the target pixel area is obtained by using the mapping prediction coefficient and the luminance reconstruction value corresponding to each target pixel.
2. The method according to claim 1, characterized in that In the process of determining the mapping prediction coefficient between the luminance reconstruction value and the chrominance prediction value by using the candidate mapping relationship, performing overflow intervention processing on the target reference value includes: Determine a parameter matrix according to the brightness reconstruction value and the chrominance reconstruction value corresponding to each reference pixel; In the process of obtaining a first reference matrix and a second reference matrix matching the parameter matrix by means of matrix decomposition, when it is determined that the target reference values of the matrix elements included in the first reference matrix and the second reference matrix will have a numerical overflow, overflow intervention processing is performed on the target reference values, wherein the mapping prediction coefficient is a weight coefficient determined based on the first reference matrix and the second reference matrix.
3. The method according to claim 2, characterized in that In the case where it is determined that the target reference values of the matrix elements included in the first reference matrix and the second reference matrix will have a numerical overflow, performing overflow intervention processing on the target reference values includes: Obtaining a first reference value and a second reference value for determining a target reference value of a current matrix element; When the number of bits representing the product of the first reference value and the second reference value is greater than the target number of bits, the reference value with the largest absolute value allowed to be indicated by the target number of bits is determined as the target reference value of the current matrix element.
4. The method according to claim 3, characterized in that The step of determining the reference value having the maximum absolute value allowed to be indicated by the target number of bits as the target reference value of the current matrix element comprises: When the number of bits indicated by the product value of the first reference value and the second reference value is greater than the target number of bits and the product value is a positive number, the maximum reference value indicated by the target number of bits is determined as the target reference value; When the product value of the first reference value and the second reference value indicates that the number of bits is greater than the target number of bits and the product value is a negative number, the minimum reference value indicated by the target number of bits is determined as the target reference value.
5. The method according to claim 3, characterized in that: After obtaining the first reference value and the second reference value for determining the target reference value of the current matrix element, the method further includes: When the number of bits representing the product value of the first reference value and the second reference value is greater than the target number of bits, ending the matrix decomposition operation related to the product operation between the first reference value and the second reference value; A reference constant value is obtained as the mapping prediction coefficient.
6. The method according to claim 5, characterized in that The obtaining of the reference constant value as the mapping prediction coefficient comprises one of the following: Determine the mapping prediction coefficient according to the acquired first reference constant value; The second reference constant value corresponding to each target pixel in the target pixel area is respectively obtained, and the second reference constant is determined as the mapping prediction coefficient corresponding to each target pixel.
7. The method according to claim 1, characterized in that In the process of determining the mapping prediction coefficient between the luminance reconstruction value and the chrominance prediction value by using the candidate mapping relationship, performing overflow intervention processing on the target reference value includes: Obtaining a reference offset value corresponding to each reference pixel; Determine a reference brightness reconstruction value according to the brightness reconstruction value and the reference offset value corresponding to each reference pixel; An overflow intervention process is performed on the target reference value according to the reference brightness reconstruction value.
8. The method according to claim 7, characterized in that After obtaining the reference offset value corresponding to each reference pixel, the method further includes: Subtract the corresponding reference offset value from the brightness reconstruction value corresponding to each reference pixel in sequence to obtain the reference brightness reconstruction value corresponding to each reference pixel; The mapping prediction coefficient is determined by using the reference brightness reconstruction value corresponding to each reference pixel and the candidate mapping relationship.
9. The method according to claim 7, characterized in that: The acquiring of the reference offset value corresponding to each reference pixel comprises: Acquire a first brightness reconstruction value of a first reference pixel that is adjacent to the reference pixel and located above the reference pixel; Acquire a second brightness reconstruction value of a second reference pixel adjacent to the reference pixel and located on the right side of the reference pixel; Acquire a third brightness reconstruction value of a third reference pixel that is adjacent to the reference pixel and located below the reference pixel; Acquire a fourth brightness reconstruction value of a fourth reference pixel that is adjacent to the reference pixel and located on the left side of the reference pixel; Obtaining a fifth brightness reconstruction value of the reference pixel; An average value of the first brightness reconstruction value, the second brightness reconstruction value, the third brightness reconstruction value, the fourth brightness reconstruction value, and the fifth brightness reconstruction value is determined as the reference offset value corresponding to the reference pixel.
10. The method according to claim 8, characterized in that The acquiring of the reference offset value corresponding to each reference pixel comprises one of the following: Determine the brightness reconstruction value corresponding to any one of the reference pixels in the reference pixel area as the reference offset value corresponding to each of the reference pixels; The brightness reconstruction value of a reference pixel adjacent to the reference pixel and located at the upper left corner of the reference pixel is obtained as the reference offset value corresponding to the reference pixel.
11. A device for obtaining pixel values, characterized in that: include: A first acquisition unit is used to acquire a luminance reconstruction value and a chrominance reconstruction value corresponding to each reference pixel in a reference pixel area adjacent to a target pixel area in a current video frame image, wherein the reference pixel area is a pixel area in the current video frame image for which pixel encoding has been completed; A constructing unit, configured to construct a candidate mapping relationship based on the luminance reconstruction value and the chrominance reconstruction value corresponding to each reference pixel, wherein the candidate mapping relationship is used to indicate a mapping relationship between the luminance reconstruction value and a chrominance prediction value matching the chrominance reconstruction value; an intervention unit, configured to perform overflow intervention processing on a target reference value in a process of determining a mapping prediction coefficient between the luminance reconstruction value and the chrominance prediction value by using the candidate mapping relationship, wherein the number of representation bits of the target reference value after the overflow intervention processing is less than the number of representation bits of the target reference value before the overflow intervention processing, and the target reference value is a parameter value of an intermediate parameter used to calculate the mapping prediction coefficient; The second acquisition unit is used to obtain the chrominance prediction value corresponding to each target pixel in the target pixel area by using the mapping prediction coefficient and the brightness reconstruction value corresponding to each target pixel in the target pixel area when the mapping prediction coefficient is determined.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 11 when executed.
13. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
14. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 11 through the computer program.
Citation Information
Patent Citations
Method and device for integer transform of image residual matrix, and method and device for inverse transform of image residual matrix
CN101742328A
Intra-frame prediction method, device and electronic device
CN109005408A
