Device and method for determining sampling weight in anisotropic filtering processing, electronic equipment and storage medium

By designing a selector and multiplier in anisotropic filtering processing, and determining the sampling weight using a preset storage table, the problem of high hardware resource consumption in the prior art is solved, and simple and efficient determination of the sampling weight is achieved.

CN119559082APending Publication Date: 2025-03-04MOORE THREADS TECHNOLOGY (CHENGDU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411604596.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In anisotropic filtering processing, it is difficult for the prior art to effectively save hardware resources and implement a simple sampling weight determination scheme.

Method used

A device including a selector and a multiplier is designed to determine the first sampling weight of the sampling point in the anisotropic filtering process by looking up a preset storage table, and determine the second sampling weight based on the weight to ensure that the sum of the sampling weights is 1.

Benefits of technology

This solution effectively reduces circuit area, saves hardware resource consumption, and simplifies the process of determining sampling weights.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119559082A_ABST
    Figure CN119559082A_ABST
Patent Text Reader

Abstract

The invention relates to a device and method for determining a sampling weight in anisotropic filtering processing, electronic equipment and a storage medium. The device comprises a selector and a multiplier, and the output end of the selector is connected with the input end of the multiplier; the selector is used for determining first sampling weights corresponding to the first sampling point to the (n-2) th sampling point by searching a preset storage table, and n is the total number of the sampling points; and the multiplier is used for determining second sampling weights corresponding to the (n-1) th sampling point to the nth sampling point according to the first sampling weight, and the sum of the sampling weights of the n sampling points is 1. According to the embodiment of the invention, the overall circuit area of the device can be effectively reduced, and hardware resource consumption is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a device and method, an electronic device and a storage medium for determining sampling weights in anisotropic filtering processing. Background Art

[0002] Anisotropic filtering (AF) is a technique used in 3D graphics rendering and image processing to improve the visual effect of textures when viewed from different directions. Compared with traditional isotropic filtering (e.g., bilinear filtering, trilinear filtering, etc.), anisotropic filtering can make more detailed adjustments to textures according to the viewing angle and the directionality of the texture surface, thereby improving the quality of rendered images. In anisotropic filtering, there is an urgent need for a solution that saves hardware resources and is simple to implement for determining sampling weights in anisotropic filtering. Summary of the invention

[0003] The present disclosure proposes a technical solution of a device and method, an electronic device and a storage medium for determining sampling weights in anisotropic filtering processing.

[0004] According to one aspect of the present disclosure, a device for determining sampling weights in anisotropic filtering processing is provided, the device comprising: a selector and a multiplier, wherein an output end of the selector is connected to an input end of the multiplier; the selector is used to determine first sampling weights corresponding to the 1st to n-2nd sampling points by searching a preset storage table, wherein n is the total number of sampling points; the multiplier is used to determine second sampling weights corresponding to the n-1th to nth sampling points according to the first sampling weights, wherein the sum of the sampling weights of the n sampling points is 1.

[0005] In a possible implementation, the sampling direction of the anisotropic filtering processing is any direction passing through the center point of the target ellipse, wherein the major axis of the target ellipse is a and the minor axis is b; the value of n is an even integer rounded upward from the decimal number corresponding to {ratio.frac}, wherein ratio is an x-bit binary number of the integer position of a / b, and frac is a y-bit binary number of the decimal position of a / b; the preset storage table stores 2 x+y The reciprocal value of an x+y bit binary number.

[0006] In a possible implementation, the input of the selector is {ratio.frac}; the selector is used to search the reciprocal value 1 / {ratio.frac} of {ratio.frac} in the preset storage table, and determine 1 / {ratio.frac} as the first sampling weight.

[0007] In one possible implementation, the input of the multiplier is {odd.frac} and the first sampling weight 1 / {ratio.frac}, where odd is the least significant bit LSB of ratio; the multiplier is used to multiply {odd.frac} and 1 / {ratio.frac}, and output the most significant bit of the multiplication result to LSB-1, which is determined as the second sampling weight.

[0008] In a possible implementation, the target ellipse is obtained by performing preset processing on four pixel data of a 2×2 structure that needs to be anisotropically filtered in the target image.

[0009] In a possible implementation manner, the device is applied to a texture unit of a graphics processor GPU.

[0010] According to one aspect of the present disclosure, a method for determining sampling weights in anisotropic filtering processing is provided, the method being applied to a device for determining sampling weights in anisotropic filtering processing, the device comprising a selector and a multiplier, the output end of the selector being connected to the input end of the multiplier; the method comprising: using the selector to determine first sampling weights corresponding to the 1st to n-2nd sampling points by searching a preset storage table, wherein n is the total number of sampling points; using the multiplier to determine second sampling weights corresponding to the n-1th to nth sampling points according to the first sampling weights, wherein the sum of the sampling weights of the n sampling points is 1.

[0011] According to one aspect of the present disclosure, an electronic device is provided, comprising: the above-mentioned device for determining sampling weights in anisotropic filtering processing.

[0012] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the above method.

[0013] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor.

[0014] In an embodiment of the present disclosure, a device for determining sampling weights in anisotropic filtering processing includes: a selector and a multiplier, wherein an output end of the selector is connected to an input end of the multiplier; the selector is used to determine first sampling weights corresponding to the 1st to n-2nd sampling points by searching a preset storage table, wherein n is the total number of sampling points; and the multiplier is used to determine second sampling weights corresponding to the n-1st to nth sampling points according to the first sampling weights, wherein the sum of the sampling weights of the n sampling points is 1. The device for determining sampling weights in anisotropic filtering processing according to an embodiment of the present disclosure can determine the second sampling weight according to the first sampling weight determined by the selector by searching a preset storage table using only one multiplier, thereby effectively reducing the overall circuit area of ​​the device and saving hardware resource consumption.

[0015] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and do not limit the present disclosure. Other features and aspects of the present disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.

[0017] Figure 1 A schematic diagram showing a method of obtaining an ellipse based on a 2X2 dot matrix in the related art.

[0018] Figure 2 A block diagram of a device for determining sampling weights in anisotropic filtering processing according to an embodiment of the present disclosure is shown.

[0019] Figure 3 A schematic diagram of the operation of an apparatus for determining sampling weights in anisotropic filtering processing according to an embodiment of the present disclosure is shown.

[0020] Figure 4 A flowchart of a method for determining sampling weights in anisotropic filtering processing according to an embodiment of the present disclosure is shown.

[0021] Figure 5 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0022] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0023] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0024] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.

[0025] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0026] In the texture unit of the Graphics Processing Unit (GPU), there is a filtering method called anisotropic filtering. Its physical meaning is to form an ellipse from a 2X2 dot matrix through relevant calculations, perform point sampling and interpolation in a certain direction of the ellipse, and the sum of the weights of each sampling point is 1. The interpolation result is used as the final output. Figure 1 FIG. 2 is a schematic diagram showing a method of obtaining an ellipse based on a 2X2 dot matrix in the related art. Figure 1 As shown, an ellipse is obtained by correlation calculation for a 2X2 dot matrix, and the major axis of the ellipse is a and the minor axis is b. The process of obtaining an ellipse based on a 2X2 dot matrix can refer to related technologies, and the present disclosure does not make specific limitations on this.

[0027] like Figure 1 As shown, sampling is performed along the dotted line direction passing through the center point in the ellipse to implement anisotropic filtering. An expression of anisotropic filtering can be the following formula (1):

[0028] result = a(0) × w t (0)+a(1)×w t (1)+…+a(n-1)×w t (n-1) (1).

[0029] The number of sampling points in the sampling direction is n, a(0) to a(n-1) are the sampling values ​​(e.g., pixel values, color values, etc.) of each sampling point, and w t (0) to w t(n-1) is the sampling weight of each sampling point, the value range of the sampling weight is (0, 1), and result is the anisotropic filtering result.

[0030] In order to implement the above-mentioned anisotropic filtering processing, the embodiment of the present disclosure provides a device for determining sampling weights in anisotropic filtering processing, which is used to determine the sampling weight of each sampling point in anisotropic filtering processing.

[0031] Figure 2 FIG. 1 is a block diagram of a device for determining sampling weights in anisotropic filtering according to an embodiment of the present disclosure. Figure 2 As shown, the device for determining the sampling weights in anisotropic filtering processing includes: a selector and a multiplier, wherein the output end of the selector is connected to the input end of the multiplier; the selector is used to determine the first sampling weights corresponding to the 1st to n-2nd sampling points by searching a preset storage table, wherein n is the total number of sampling points; the multiplier is used to determine the second sampling weights corresponding to the n-1st to nth sampling points according to the first sampling weights, wherein the sum of the sampling weights of the n sampling points is 1.

[0032] According to the device for determining sampling weights in anisotropic filtering processing disclosed in the present invention, only one multiplier is used to determine the second sampling weight according to the first sampling weight determined by the selector by searching a preset storage table, thereby effectively reducing the overall circuit area of ​​the device and saving hardware resource consumption.

[0033] In a possible implementation, the device for determining sampling weights in anisotropic filtering is applied to a GPU texture unit.

[0034] The device for determining sampling weights in anisotropic filtering processing is applied to a GPU texture unit, so that anisotropic filtering can be effectively implemented in the GPU texture unit and image rendering performance can be improved.

[0035] In a possible implementation manner, the target ellipse is obtained by performing preset processing on four pixel data of a 2×2 structure that needs to be anisotropically filtered in the target image.

[0036] After pre-processing the four pixel data of the 2x2 structure in the target image to obtain the target ellipse, anisotropic filtering can be implemented based on the target ellipse, thereby improving the visual effect of the texture when observing the target image in different directions.

[0037] The four pixel data of the 2x2 structure in the target image are processed by preset processing to obtain the target ellipse. You can refer to the above Figure 1 And related descriptions are not repeated here.

[0038] In a possible implementation, the sampling direction of the anisotropic filtering processing is any direction passing through the center point of the target ellipse, where the major axis of the target ellipse is a and the minor axis is b; the value of n is an even integer rounded upward from the decimal number corresponding to {ratio.frac}, where ratio is an x-bit binary number of the integer position of a / b, and frac is a y-bit binary number of the decimal position of a / b; the preset storage table stores 2 x+y The reciprocal value of an x+y bit binary number.

[0039] According to the ratio a / b between the major axis a and the minor axis b of the target ellipse, a binary number marked as {ratio.frac} is obtained, where ratio is the x-bit binary number of the integer position of a / b, and frac is the y-bit binary number of the decimal position of a / b.

[0040] According to the decimal number corresponding to {ratio.frac}, round up to an even integer to determine the number of sampling points n in the anisotropic filtering process. For example, if the decimal number corresponding to {ratio.frac} is 3.5, the number of sampling points in the anisotropic filtering process n=4; if the decimal number corresponding to {ratio.frac} is 4.5, the number of sampling points in the anisotropic filtering process n=6; if the decimal number corresponding to {ratio.frac} is 8.0, the number of sampling points in the anisotropic filtering process n=8.

[0041] According to the binary bit number x of ratio and the binary bit number y of frac in {ratio.frac}, a preset storage table can be pre-built, wherein the preset storage table stores 2 x+y The reciprocal value of an x+y bit binary number.

[0042] For example, in {ratio.frac}, the binary number of bits of ratio is x=4, and the binary number of bits of frac is y=4. In this case, we can determine 2 8 The reciprocal value of an 8-bit binary number (00000000 to 11111111), and then according to 2 8 The reciprocal value of an 8-bit binary number is used to construct a preset storage table.

[0043] In a possible implementation, the input of the selector is {ratio.frac}; the selector is used to search for the reciprocal value 1 / {ratio.frac} of {ratio.frac} in a preset storage table, and determine 1 / {ratio.frac} as the first sampling weight.

[0044] After {ratio.frac} is determined based on the ratio of the major and minor axes of the target ellipse, {ratio.frac} is input into the selector. The selector searches for the reciprocal value 1 / {ratio.frac} of {ratio.frac} in the preset storage table according to the specific value of {ratio.frac}, and determines 1 / {ratio.frac} as the first sampling weight corresponding to the 1st to n-2nd sampling points.

[0045] For example, {ratio.frac} = {0011.0101}, which can be included in the above 8 In a preset storage table of reciprocal values ​​of 8-bit binary numbers (00000000 to 11111111), the reciprocal value of 00110101 is determined as 1 / {0011.0101}, and 1 / {0011.0101} is determined as the first sampling weight corresponding to the 1st to n-2nd sampling points.

[0046] In the related art, after determining the first sampling weights w1 corresponding to the 1st to n-2nd sampling points, in order to ensure that the sum of the sampling weights of all sampling points is 1, the second sampling weights w2 corresponding to the n-1st to nth sampling points can be determined by the following formula (2):

[0047]

[0048] Based on formula (2), it can be seen that in the related art, four steps are required to determine the second sampling weights w2 corresponding to the n-1th to nth sampling points, namely subtraction, multiplication, subtraction and shift (division by 2 operation). The steps are cumbersome and the circuit timing is not easy to control.

[0049] In order to solve the above problem, based on {ratio.frac}, the determination of the second sampling weight w2 can be divided into the following two cases.

[0050] Case 1: frac is 0 and ratio is an even number.

[0051] When frac is 0 and ratio is an even number, n = the decimal number corresponding to ratio, at this time, the first sampling weight w1 = 1 / ratio = 1 / n. Combining the above formula (2), it can be seen that the second sampling weight w2 = w1 = 1 / n. That is, in the first case, the second sampling weight w2 can reuse the search result of the selector for the first sampling weight w1.

[0052] For example, {ratio.frac}={0100.0000}, that is, the decimal number corresponding to {ratio.frac} is 4. At this time, the number of sampling points n=4, and the sampling weight w1=w2=1 / 4=0.25 corresponding to each sampling point.

[0053] The second case: frac is not 0.

[0054] When frac is not 0, For analysis, since n is the decimal number corresponding to {ratio.frac} rounded up to an even integer, therefore, Where odd is the least significant bit of ratio, that is, the rightmost bit. Based on this, 1-w1×(n-2) can be rewritten as the following formula (3):

[0055]

[0056] Combining formulas (2) and (3), we can see that: Among them, >>1 represents a left shift of 1 bit (corresponding to a divide by 2 operation).

[0057] When ratio is an even number, odd=0. For example, when the decimal number corresponding to {ratio.frac} is 4.5, n = 6, odd = 0, {0.frac} = 0.5, then, The result is equal to the result of [1-(1 / 4.5)×(6-2)] / 2 determined based on formula (2).

[0058] When ratio is an odd number, odd=1. For example, when the decimal number corresponding to {ratio.frac} is 5.5, n = 6, odd = 1, {0.frac} = 1.5, then, The result is equal to the result of [1-(1 / 5.5)×(6-2)] / 2 determined based on formula (2).

[0059] In view of the second situation described above, the embodiment of the present disclosure designs a multiplier in a device for determining sampling weights in anisotropic filtering processing.

[0060] In one possible implementation, the input of the multiplier is {odd.frac} and the first sampling weight 1 / {ratio.frac}, where odd is the least significant bit LSB of ratio; the multiplier is used to multiply {odd.frac} and 1 / {ratio.frac}, and output the most significant bit of the multiplication result to LSB-1, which is determined as the second sampling weight.

[0061] The input of the multiplier is {odd.frac} and the first sampling weight 1 / {ratio.frac}. The multiplier multiplies {odd.frac} and 1 / {ratio.frac} to obtain the multiplication result At this time, the most significant bit in the multiplication result is cut off to the LSB-1 bit to implement the >>1 operation, thereby obtaining the second sampling weight w2.

[0062] Figure 3 A schematic diagram of the operation of an apparatus for determining sampling weights in anisotropic filtering processing according to an embodiment of the present disclosure is shown.

[0063] like Figure 3 As shown, the device for determining the sampling weights in anisotropic filtering processing includes a selector and a multiplier. The input of the selector is {ratio.frac}, and the selector determines the first sampling weights w1=1 / {ratio.frac} corresponding to the 1st to n-2nd sampling points by searching a preset storage table, and inputs w1 to the multiplier, and the input of the multiplier also includes {odd.frac}. Finally, after the above-mentioned related processing, the multiplier outputs the second sampling weights w2 corresponding to the n-1th to nth sampling points.

[0064] In an embodiment of the present disclosure, a device for determining sampling weights in anisotropic filtering processing includes: a selector and a multiplier, wherein an output end of the selector is connected to an input end of the multiplier; the selector is used to determine first sampling weights corresponding to the 1st to n-2nd sampling points by searching a preset storage table, wherein n is the total number of sampling points; and the multiplier is used to determine second sampling weights corresponding to the n-1st to nth sampling points according to the first sampling weights, wherein the sum of the sampling weights of the n sampling points is 1. The device for determining sampling weights in anisotropic filtering processing according to an embodiment of the present disclosure can determine the second sampling weight according to the first sampling weight determined by the selector by searching a preset storage table using only one multiplier, thereby effectively reducing the overall circuit area of ​​the device and saving hardware resource consumption.

[0065] Figure 4 A flowchart of a method for determining sampling weights in anisotropic filtering processing according to an embodiment of the present disclosure is shown. The method can be applied to Figure 2 The device for determining sampling weights in anisotropic filtering processing shown in the figure comprises a selector and a multiplier, wherein the output end of the selector is connected to the input end of the multiplier. Figure 4 As shown, the method includes:

[0066] In step S41, a selector is used to determine first sampling weights corresponding to the 1st to n-2nd sampling points by searching a preset storage table, where n is the total number of sampling points;

[0067] In step S42, a multiplier is used to determine second sampling weights corresponding to the n-1th to nth sampling points according to the first sampling weights, wherein the sum of the sampling weights of the n sampling points is 1.

[0068] application Figure 2 The bilinear difference operation device shown performs Figure 4 For the specific process of the bilinear difference calculation method shown in FIG. Figures 2 to 3 The relevant embodiments are not described in detail here.

[0069] It can be understood that the above-mentioned embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.

[0070] This method has a specific technical connection with the internal structure of the computer system, and can solve the technical problem of how to improve the hardware computing efficiency or execution effect (including reducing the amount of data storage, reducing the amount of data transmission, increasing the hardware processing speed, etc.), thereby obtaining the technical effect of improving the internal performance of the computer system in accordance with the laws of nature.

[0071] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0072] The embodiment of the present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.

[0073] The disclosed embodiment also provides an electronic device, comprising: the above-mentioned device for determining sampling weights in anisotropic filtering processing.

[0074] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory to execute the above method.

[0075] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0076] The electronic device may be provided as a terminal, a server, or a device in other forms.

[0077] Figure 5 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. Figure 5 , the electronic device 1900 can be provided as a server or a terminal device. Figure 5 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions that can be executed by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0078] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as a Microsoft Server operating system (Windows Server 2003). TM ), a graphical user interface operating system launched by Apple (Mac OS X TM ), a multi-user, multi-process computer operating system (Unix TM ), a free and open source Unix-like operating system (Linux TM ), an open source Unix-like operating system (FreeBSD TM ) or similar.

[0079] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.

[0080] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0081] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, (but not limited to) an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.

[0082] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0083] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may 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 may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0084] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0085] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0086] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0087] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0088] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) and the like.

[0089] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0090] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0091] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.

[0092] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A device for determining sampling weights in anisotropic filtering, characterized in that: The device comprises: a selector and a multiplier, wherein the output end of the selector is connected to the input end of the multiplier; The selector is used to determine the first sampling weights corresponding to the 1st to n-2nd sampling points by searching a preset storage table, where n is the total number of sampling points; The multiplier is used to determine the second sampling weights corresponding to the n-1th to nth sampling points according to the first sampling weights, wherein the sum of the sampling weights of the n sampling points is 1.

2. The device according to claim 1, characterized in that The sampling direction of the anisotropic filtering process is any direction passing through the center point of the target ellipse, wherein the major axis of the target ellipse is a and the minor axis is b; The value of n is the decimal number corresponding to {ratio.frac}, rounded up to an even integer, where ratio is the x-bit binary number of the integer position a / b, and frac is the y-bit binary number of the decimal position a / b; The preset storage table stores 2 x+y The reciprocal value of an x+y bit binary number.

3. The device according to claim 2, characterized in that The input of the selector is {ratio.frac}; The selector is used to search the reciprocal value 1 / {ratio.frac} of {ratio.frac} in the preset storage table, and determine 1 / {ratio.frac} as the first sampling weight.

4. The device according to claim 3, characterized in that The input of the multiplier is {odd.frac}, the first sampling weight 1 / {ratio.frac}, wherein odd is the least significant bit LSB of ratio; The multiplier is used to perform a multiplication operation on {odd.frac} and 1 / {ratio.frac}, and then output the most significant bit of the multiplication result to the LSB-1 bit, which is determined as the second sampling weight.

5. The device according to claim 2, characterized in that The target ellipse is obtained by pre-processing four pixel data of a 2×2 structure that needs to be anisotropically filtered in the target image.

6. The device according to any one of claims 1 to 5, characterized in that The device is applied to a texture unit of a graphics processor (GPU).

7. A method for determining sampling weights in anisotropic filtering, characterized in that: The method is applied to a device for determining sampling weights in anisotropic filtering processing, the device comprising a selector and a multiplier, wherein the output end of the selector is connected to the input end of the multiplier; the method comprises: Using the selector, by searching a preset storage table, the first sampling weights corresponding to the 1st to n-2nd sampling points are determined, where n is the total number of sampling points; The multiplier is used to determine second sampling weights corresponding to the n-1th to nth sampling points according to the first sampling weights, wherein the sum of the sampling weights of the n sampling points is 1.

8. An electronic device, characterized in that: include: The device for determining sampling weights in anisotropic filtering processing as claimed in any one of claims 1 to 6.

9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to call the instructions stored in the memory to execute the method of claim 7.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method of claim 7 is implemented.