WO2021035715A1 - 数据处理方法和装置 - Google Patents

数据处理方法和装置 Download PDF

Info

Publication number
WO2021035715A1
WO2021035715A1 PCT/CN2019/103796 CN2019103796W WO2021035715A1 WO 2021035715 A1 WO2021035715 A1 WO 2021035715A1 CN 2019103796 W CN2019103796 W CN 2019103796W WO 2021035715 A1 WO2021035715 A1 WO 2021035715A1
Authority
WO
WIPO (PCT)
Prior art keywords
dwt
image data
data
unit
circuit
Prior art date
Application number
PCT/CN2019/103796
Other languages
English (en)
French (fr)
Inventor
任子木
韩彬
仇晓颖
吴迪
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2019/103796 priority Critical patent/WO2021035715A1/zh
Priority to CN201980029797.9A priority patent/CN112136128A/zh
Publication of WO2021035715A1 publication Critical patent/WO2021035715A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/14Fourier, Walsh or analogous domain transformations, e.g. Laplace, Hilbert, Karhunen-Loeve, transforms
    • G06F17/148Wavelet transforms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming

Definitions

  • a data processing method including: acquiring a first configuration instruction, where the first configuration instruction is used to instruct pre-configuration information for pre-configuring a DWT circuit; and based on the first configuration instruction, acquiring the Pre-configuration information; using the pre-configuration information to pre-configure the DWT circuit so that the pre-configured DWT circuit can process image data.
  • a data processing device including: an acquisition circuit for acquiring a first configuration instruction, the first configuration instruction being used for instructing the pre-configuration information for pre-configuration of the discrete wavelet transform DWT circuit;
  • the first configuration instruction is used to obtain the pre-configuration information;
  • the pre-configuration circuit is used to use the pre-configuration information to pre-configure the DWT circuit so that the pre-configured DWT circuit can process image data.
  • Fig. 2 is a schematic diagram of another DWP circuit according to an embodiment of the present application.
  • Fig. 3 is a schematic diagram of a data processing method according to an embodiment of the present application.
  • Fig. 4 is a schematic diagram of another data processing method according to an embodiment of the present application.
  • Fig. 5 is a schematic block diagram of a data processing device according to an embodiment of the present application.
  • Fig. 6 is a schematic block diagram of another data processing device according to an embodiment of the present application.
  • DWT is a mathematical analysis tool discovered in recent years with localized characteristics in the time and frequency domains. It has the function of "mathematical microscope” focusing, and can be applied to multiple signal processing fields, especially in the field of image compression, and can realize a still image compression scheme based on wavelet transform.
  • the first and third levels marked with numbers can be referred to as prediction parts, and the second and fourth levels can be referred to as update parts.
  • the structure of Prediction and update is basically the same, and both can be composed of two additions and one multiplication.
  • the output data is multiplied by 1/K and -K, and then output through port E and port F respectively.
  • the input port can be A/C and B/D.
  • port A and port B can be used, or port C and port D can be used.
  • Input ports A and B can be used as common ports, that is, they can be used for DWT circuits or other circuits. Input ports A and B can be used to input two channels of data required for DWT circuits.
  • the input ports C and D can be used as dedicated ports for the DWT circuit, and the input ports C and D can be used to input two channels of data required for the DWT circuit.
  • the input port or output port in the embodiment of the present application may be a crossbar port.
  • the data output by the output port E and the output port F in the embodiment of the present application may be stored in an on-chip buffer.
  • the encoder can read the data input by the DWT circuit in the on-chip buffer for compression processing.
  • the data input by the input port A/C and the input port B/D may be data in different rows or columns in the image.
  • input port A/C inputs data in odd columns
  • input port B/D inputs data in even columns.
  • the input port A/C is the data of the even number column
  • the input port B/D is the data of the odd number column.
  • the input port A/C is the odd-numbered line of data
  • the input port B/D is the even-numbered line of data.
  • the input port A/C is the even-numbered line of data
  • the input port B/D is the odd-numbered line of data.
  • the multiplied coefficients can be different.
  • composition of these 8 clock cycles is: 2 clock cycles of preprocessing, 3 clock cycles of Multiplier, accumulator of 1 clock cycle, post-processing of 2 clock cycles.
  • the data delays of ⁇ , ⁇ , and ⁇ phases are the same as the data delays of ⁇ phase, so I won't repeat them here.
  • DWT circuits for parallel processing, thereby improving the efficiency of data processing.
  • 8 DWT circuits can be used for parallel processing.
  • the ⁇ -stage circuit may be used for the ⁇ -stage processing
  • the ⁇ -stage circuit may be used for the ⁇ -stage processing
  • the ⁇ -stage circuit may be used for the ⁇ -stage processing.
  • the data enters the circuit of the ⁇ stage. After being processed by the circuit of the ⁇ stage, the data flows from the circuit of the ⁇ stage to the circuit of the ⁇ stage. After being processed by the circuit of the ⁇ stage, the data flows from the circuit of the ⁇ stage to the ⁇ stage. After the circuit is processed by the circuit of the ⁇ stage, it flows from the circuit of the ⁇ stage to the circuit of the ⁇ stage, and then outputs from the circuit of the ⁇ stage.
  • the ⁇ -stage circuit mentioned here can also be called the ⁇ -stage and ⁇ -stage circuit
  • the ⁇ -stage circuit mentioned here can be called the ⁇ -stage and ⁇ -stage circuit. .
  • the embodiments of the present application provide the following solutions, which can solve the problem of large power consumption and poor real-time performance in the DWT operation process.
  • FIG. 3 is a schematic flowchart of a data processing method 100 according to an embodiment of the present application. As shown in FIG. 3, the method 100 includes at least part of the following content.
  • a first configuration instruction is acquired, where the first configuration instruction may be used to indicate pre-configuration information for pre-configuration of the DWT circuit.
  • the acquisition circuit included in the data processing device can read the first configuration instruction from the memory, and after reading the first configuration instruction, can decode the first configuration instruction, In order to facilitate subsequent pre-configuration of the DWT circuit based on the decoded instruction, the pre-configuration circuit included in the data processing device.
  • the acquisition circuit may also acquire all or part of the information in the first configuration instruction through a bus connected to the CPU.
  • the acquiring circuit may also acquire all or part of the information in the first configuration instruction from the register.
  • the first pre-configuration instruction may be presented in the form of one or more instructions.
  • the first configuration instruction is a single instruction. Therefore, a single instruction can be used to pre-configure the DWT circuit before the DWT circuit is used, avoiding real-time instruction scheduling during the use of the DWT circuit, thereby reducing the execution time and power consumption of the DWT circuit operation.
  • pre-configuration information for pre-configuration of the DWT circuit is determined.
  • the data processing apparatus may determine the pre-configuration information for pre-configuring the DWT circuit based on the instruction of the first configuration instruction, so as to realize the pre-configuration of the DWT circuit based on the pre-configuration information.
  • the pre-configuration information mentioned in the embodiment of the present application may be obtained by decoding the first configuration instruction.
  • a second configuration instruction is obtained, and the second configuration instruction is used to instruct to decode the first configuration instruction.
  • the obtaining circuit may obtain the first configuration instruction in advance, but before receiving the second configuration instruction, it does not decode the first configuration instruction, but after receiving the second configuration instruction, it is based on the second configuration instruction. Triggered to decode the first configuration instruction.
  • the pre-configuration performed on the DWT circuit may include any pre-configuration that can affect the operation of the DWT circuit.
  • the pre-configuration of the data input of the DWT circuit the pre-configuration of the output of the DWT circuit, the pre-configuration of the internal operations of the DWT circuit, and the pre-configuration of which or how many DWT circuits perform operations, etc.
  • the pre-configuration information for pre-configuring the DWT circuit includes at least one of the following:
  • Each clock cycle is the amount of data read by at least one DWT circuit that needs to process image data
  • the pre-configuration information in the embodiment of the present application may also include other information, which is not specifically limited in the embodiment of the present application.
  • it may include pre-configuration information of the delay duration of the delay processing in the DWT circuit, and the like.
  • the number of DWT circuits that need to process image data can refer to the DWT circuits shown in Figures 1 and 2 (wherein Figures 1 and 2 are one DWT circuit).
  • the number of circuits), multiple DWT circuits can process image data in parallel.
  • the number of DWT circuits that process image data can be determined based on at least one of the following:
  • the number of DWT circuits can be determined based on all or part of these factors.
  • the available system bandwidth of the DWT circuit is divided by the amount of data processed by each DWT circuit in each clock cycle to obtain the number of DWT circuits.
  • each clock cycle is the data volume of data read by all DWT circuits that need to process image data divided by the data volume processed by each DWT circuit in each clock cycle, and the number of DWT circuits can be obtained.
  • connection relationship of the device unit in each DWT circuit that needs to process image data because the connection relationship of the device unit in the DWT circuit affects the processing result of the image data, it can be based on the desired processing result .
  • the connection relationship can indicate how the device units in the DWT circuit are connected and which device units are connected.
  • a DSP includes device units A, B, C, D, and E.
  • the arrangement order of these device units can be A, B, C, D, and E.
  • a and B can be connected.
  • the type of each DWT circuit that needs to process image data because the type of DWT circuit is distinguished by the maximum number of bits of image data that can be processed by each clock; that is, each type of DWT circuit
  • the maximum number of bits of image data processed by each clock is different.
  • the number of bits of image data processed by each clock of a single DWT circuit can refer to the bits occupied by the data input by a single input port, for example, as shown in Figure 1 or 2. It shows that the number of bits of data input by port A/C or port B/D in a clock is the number of bits of image data processed by each clock of the DWT circuit.
  • the type of each DWT circuit that needs to process image data can be determined according to at least one of the following:
  • the total data amount of image data that needs to be processed is divided by the data amount processed by all DWT circuits that need to process image data in each clock cycle to obtain the number of clock cycles.
  • the total amount of image data that needs to be processed, the system bandwidth available for the DWT circuits in the system, the amount of data that all DWT circuits that need to process image data can process per clock cycle, and all the DWT that need to process the image data The number of clock cycles for the circuit to read data.
  • the amount of data that can be processed by all DWT circuits that need to process image data in each clock cycle is determined as the data amount of data read by all DWT circuits that need to process image data in each clock cycle.
  • the amount of data corresponding to the available system bandwidth of the DWT circuit in the system is determined as the data amount of data read by all DWT circuits that need to process image data in each clock cycle.
  • the amount of data read by all DWT circuits that need to process image data for each clock cycle can be determined according to the size of the available registers. The amount of data.
  • the device unit that needs to be pre-configured mentioned here may include at least one of a pre-processing unit, a multiplication unit, an addition unit, and a post-processing unit.
  • the device unit that needs to be pre-configured as mentioned herein may include a device unit in at least one of the alpha stage, the beta stage, the gamma stage, and the delta stage.
  • the type of the device unit is distinguished by the maximum number of bits of image data that can be processed by each clock of the device unit.
  • the following first device unit is taken as an example to illustrate how to determine the pre-configuration information for pre-configuration of the first device unit.
  • the first device unit can be any device unit in the DWT circuit. For example, it can be a pre-processing unit, multiplication unit, Addition unit or post-processing unit.
  • the value range of the data output by the first device unit is determined according to the value range of the image data to be processed by the first device unit.
  • the data output by the first device unit is signed data according to whether the image data to be processed is signed data (for example, the signed data may be a negative number).
  • the first device unit is a preprocessing unit or an addition unit, which can support up to 32-bit+32-bit processing, it can be determined whether 32-bit+32-bit data or 16-bit+16-bit data needs to be processed.
  • the first device unit is a multiplication unit, which can support 32-bit*32-bit processing at most, it can be determined whether 32-bit 832-bit data or 16-bit*16-bit data needs to be processed.
  • the number of first device units is determined according to at least one of the following: the size of the system bandwidth available for the DWT circuit in the system, the amount of data processed by a single first device unit per clock cycle, and the first device The multiplexing mode of the unit and the number of the DWT circuits that need to process image data.
  • the number of first device units can be determined by multiplying the number of stages included in the DWT circuit by the DWT circuit that needs to process image data. For example, assuming that the DWT circuit includes four stages of processing, the number of multiplication units may be four times the number of DWT circuits. The number of first device units calculated at this time may be the number of first device units inside the DWT circuit.
  • the number of first device units can be determined according to the DWT circuit that needs to process image data and the multiplexing mode of the first device units. For example, suppose that the DWT circuit includes four stages of processing, but every two units performs multiplexing of device units (for example, the circuit of the ⁇ stage is multiplexed with the circuit of the ⁇ stage, and the circuit of the ⁇ stage is multiplexed with the circuit of the ⁇ stage) ,
  • the number of multiplication units can be 2 times the number of DWT circuits.
  • the number of first device units calculated at this time may be the number of first device units inside the DWT circuit.
  • the number of first device units that need to be processed in parallel in a single stage can be determined based on the available system bandwidth for the DWT circuit in the system and the amount of data processed by a single first device unit in each clock cycle.
  • the usable system bandwidth of the DWT circuit in is divided by the amount of data processed by a single first device unit in each clock cycle to obtain the number of device units that need to be processed in parallel in a single stage.
  • the total number of first device units required can be determined according to the number of stages included in the DWT circuit, for example, the number calculated in the previous step is multiplied by four.
  • the type to be adopted by the first device unit is determined according to at least one of the following:
  • the type of device unit is distinguished by the maximum number of bits of image data that can be processed by each clock of the device unit, it can be determined that the first device needs to use the type.
  • the data that needs to be processed is 32-bit*16-bit data, and a multiplier that can handle up to 32*32-bit data and a multiplier that can handle up to 32*16-bit data can be selected.
  • the preprocessing unit, multiplication unit, addition unit, and post-processing unit the number of bits that need to be processed is variable, for example, it is increased, at this time for different
  • the stages can be, for example, the pre-processing unit, multiplication unit, addition unit, and post-processing unit respectively to determine the type to be adopted.
  • the pre-configuration information of the device unit may also include other pre-configuration information, which is not specifically limited in the embodiment of the present application.
  • the pre-configuration information can indicate which or how many 16-bit*16-bit multiplications are used
  • the multipliers are spliced to form a 32*32-bit multiplier or a 32*16-bit multiplier.
  • the post-processing unit may include saturation processing, truncation processing, and truncation and rounding processing
  • the pre-configuration information indicates which type of post-processing the post-processing unit performs.
  • the pre-configuration information may also include coefficients that need to be multiplied when performing multiplication processing on each stage.
  • the specific values of the above factors used to determine the pre-configuration information may be carried in the first configuration instruction, or may not be carried in the first configuration instruction.
  • the first configuration instruction serves to trigger the pre-configuration. Function.
  • the data processing device uses the pre-configuration information to pre-configure the DWT circuit.
  • the acquiring circuit acquires pre-configuration information based on the first configuration instruction, and the pre-configuration circuit pre-configures the DWT circuit according to the instructions of the pre-configuration information, so that the pre-configured DWT circuit can process image data.
  • the CPU may send the first configuration instruction to the decoder (that is, the acquisition circuit mentioned above), and the decoder receives the first configuration instruction and decodes the first configuration instruction to Complete the decoding from the instruction to the control signal, and then send the control signal to the data channel through the pre-configuration circuit (which can be a part of the decoder) to complete the pre-configuration of the DWT circuit, that is, the register unit and the pre-processing unit can be pre-configured.
  • the pre-configuration of the register unit can be understood as the pre-configuration of the amount of data that needs to be read in each clock cycle and the number of clock cycles that need to be read.
  • the enable unit can generate a read and write enable signal to the on-chip buffer. Then, the data can be input from the register unit to the pre-processing unit, and then processed by the pre-processing unit, multiplication unit, addition unit and post-processing unit in turn, and output.
  • the CPU can also access the register and perform related register configuration.
  • the control register interface is the external interface of the register. Among them, the interrupt is used to notify the CPU of the following events: the DWT circuit has completed the task and sends a signal that the task is completed.
  • the output port C and the output port D are shown in FIG. 4, which means that the ports C and D can be used for input and output.
  • the input port C and the output port D may not be used for input and output sharing.
  • the numbers at the input ports represent the available bandwidth of each port.
  • the numbers (512 and 256) at the output port represent the amount of output data.
  • the input of port C and port D is 512 bits and 256 bits, which means that part of the 256 bits of the data input in port C is used for other processing, and the data processed by the preprocessing unit is 256 bits + 256 bits.
  • the first configuration instruction before pre-configuration of the DWT circuit, the first configuration instruction is obtained; based on the first configuration instruction, the pre-configuration information for pre-configuration of the DWT circuit is determined; using the pre-configuration information, To pre-configure the DWT circuit, the first configuration instruction can be used to pre-configure the DWT circuit before the DWT circuit is used, so as to avoid real-time instruction scheduling during the use of the DWT circuit, thereby reducing the execution time and work of the DWT circuit operation. Consumption.
  • FIG. 5 is a schematic block diagram of a data processing device 200 according to an embodiment of the present application.
  • the pre-configuration circuit 220 is configured to use the pre-configuration information to pre-configure the DWT circuit, so that the pre-configured DWT circuit can process image data.
  • the pre-configuration information includes at least one of the following:
  • connection relationship of the device units in each of the DWT circuits that need to process the image data
  • Each clock cycle is the amount of data read by at least one DWT circuit that needs to process the image data.
  • the device 200 may further include a processing circuit 230.
  • the processing circuit 230 may be a CPU.
  • the amount of data processed by each clock cycle of each DWT circuit, and each clock cycle, read for at least one of the DWT circuits that need to process the image data The amount of data.
  • the processing circuit 230 is configured to:
  • the processing circuit 230 is configured to:
  • the total data volume of the image data, the available system bandwidth for the DWT circuits in the system, the data volume processed by at least one of the DWT circuits that need to process the image data per clock cycle, and each clock cycle is The amount of data read by at least one of the DWT circuits that need to process the image data.
  • the processing circuit 230 is configured to:
  • the total data volume of the image data, the system bandwidth available for the DWT circuit in the system, the data volume that at least one of the DWT circuits that need to process the image data can process each clock cycle, and the amount of data that needs to be processed The number of clock cycles for at least one of the DWT circuits of the image data to perform data reading.
  • the processing circuit 230 is configured to:
  • the interval of the value of the data output by the first device unit is determined for generating the first configuration instruction.
  • the number of first device units is determined for generating the first configuration instruction:
  • the amount of data processed by a single first device unit per clock cycle, the multiplexing mode of the first device unit, and the number of image data that need to be processed The number of DWT circuits.
  • the image data is sequentially processed by the preprocessing unit, the multiplication unit, the addition unit, and the post-processing unit.
  • the acquiring circuit 210 is further configured to:
  • the acquiring circuit 210 is further configured to:
  • the acquiring circuit 210 is further configured to:
  • the device 200 further includes the DWT250 circuit for:
  • the image data After being pre-configured, the image data is processed.
  • the first configuration instruction is a single instruction.
  • the apparatus 200 is implemented by a digital signal processor DSP.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Computational Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Pure & Applied Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Algebra (AREA)
  • Databases & Information Systems (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Image Processing (AREA)

Abstract

一种数据处理方法和设备,可以解决DWT电路运算效率低,功耗大的问题。该方法包括:获取第一配置指令,所述第一配置指令用于指示对离散小波变换DWT电路进行预配置的预配置信息(110);基于所述第一配置指令,获取所述预配置信息(120);利用所述预配置信息,对所述DWT电路进行预配置,以便于预配置后的所述DWT电路处理图像数据(130)。

Description

数据处理方法和装置
版权申明
本专利文件披露的内容包含受版权保护的材料。该版权为版权所有人所有。版权所有人不反对任何人复制专利与商标局的官方记录和档案中所存在的该专利文件或者该专利披露。
技术领域
本申请涉及数据处理领域,并且更具体地,涉及一种数据处理方法和装置。
背景技术
离散小波变换(Discrete Wavelet Transform,DWT)具有良好的时频域局部化分析性能,在图像处理领域有广泛的应用。
DWT运算过程比较繁琐,在通用处理器中虽然可以实现,但需要使用多条指令实现,并且会读写多次片上缓存,造成DWT电路运算效率低,功耗大。
发明内容
本申请实施例提供一种数据处理方法和装置,可以解决DWT电路运算效率低,功耗大的问题。
一方面,提供了一种数据处理方法,包括:获取第一配置指令,所述第一配置指令用于指示对DWT电路进行预配置的预配置信息;基于所述第一配置指令,获取所述预配置信息;利用所述预配置信息,对所述DWT电路进行预配置,以便于预配置后的所述DWT电路处理图像数据。
另一方面,提供了一种数据处理装置,包括:获取电路,用于获取第一配置指令,所述第一配置指令用于指示对离散小波变换DWT电路进行预配置的预配置信息;基于所述第一配置指令,获取所述预配置信息;预配置电路,用于利用所述预配置信息,对所述DWT电路进行预配置,以便于预配置后的所述DWT电路处理图像数据。
因此,在本申请实施例中,在对DWT电路预配置之前,获取第一配置指令;基于所述第一配置指令,确定对DWT电路进行预配置的预配置信息; 利用所述预配置信息,对所述DWT电路进行预配置,可以采用第一配置指令在DWT电路使用之前对DWT电路进行预配置,避免在DWT电路使用过程中实时进行指令调度,从而可以降低DWT电路运算的执行时间和功耗。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是根据本申请实施例的一种DWP电路的示意性图。
图2是根据本申请实施例的另一种DWP电路的示意性图。
图3是根据本申请实施例的一种数据处理方法的示意性图。
图4是根据本申请实施例的另一种数据处理方法的示意性图。
图5是根据本申请实施例的一种数据处理装置的示意性框图。
图6是根据本申请实施例的另一种数据处理装置的示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
除非另有说明,本申请实施例所使用的所有技术和科学术语与本申请的技术领域的技术人员通常理解的含义相同。本申请中所使用的术语只是为了描述具体的实施例的目的,不是旨在限制本申请的范围。
DWT是近年来发现的具有时、频域局部化特性的数学分析工具。它具有“数学显微镜”聚焦的功能,可以应用于多个信号处理的领域,尤其在图像压缩领域,可以实现基于小波变换的静止图像压缩方案。
为了更加清楚地理解本申请,以下将以一维DWT提升(1D-DWT lifting)结构(9/7)为例,对DWT电路进行说明,应理解,图1所示的DWT电路仅仅是本申请实施例中的一种具体实现方式,不应对本申请构成特别限定, 本申请实施例中的DWT电路还可以具有其他的实现结构。
如图1所示,其中以数字标注的第一级和第三级可以称作为预测(prediction)部分,第二级和第四级可以称作为更新(update)部分。Prediction和update的结构基本一致,均可以由两个加法和一个乘法构成。在第五级和第六级分别针对输出的数据乘以1/K和-K,并之后分别通过端口E和端口F输出。
其中,输入端口可以是A/C以及B/D。每次输入时,可以采用端口A和端口B,或者采用端口C和端口D。输入端口A和B可以作为公用端口,即可以用于DWT电路,也可以用于其他的电路,输入端口A和B可以输入用于DWT电路所需的两路数据。输入端口C和D可以作为用于DWT电路的专用端口,输入端口C和D可以输入用于DWT电路所需的两路数据。
可选地,本申请实施例中的输入端口或输出端口可以为交叉开关矩阵(crossbar)端口。
可选地,本申请实施例中输出端口E和输出端口F输出的数据可以存储到片上缓存器。编码器可以在片上缓存器读取DWT电路输入的数据,以进行压缩处理。
可选地,输入端口A/C和输入端口B/D在同一时钟输入的数据(也即需要共同进行后续处理的数据)可以是两个图像的相同像素位置的数据,该两个图像可以是由同一原始图像生成的。
可选地,输入端口A/C和输入端口B/D输入的数据可以是图像中的不同行或不同列的数据。例如,输入端口A/C输入的是奇数列的数据,输入端口B/D输入的是偶数列的数据。或者,输入端口A/C输入的是偶数列的数据,输入端口B/D输入的是奇数列的数据。或者,输入端口A/C输入的是奇数行的数据,输入端口B/D输入的是偶数行的数据。或者,输入端口A/C输入的是偶数行的数据,输入端口B/D输入的是奇数行的数据。
如图2所示,可以将第一级称为α阶段,将第二级称为β阶段,将第三级称为γ阶段,以及将第四级称为δ阶段。每个阶段可以包括预处理单元(第一个加法器)、乘法单元、加法单元和后处理单元。
如图2所示,数据可以从两个输入端口输入,可以分别在寄存器ireg0(即,图2中的寄0)和ireg1(即,图2中的寄1)进行寄存,在一路中,延迟前的与延迟后的数据在预处理单元进行相加,相加后得到的数据在乘法 单元与一个系数α相乘,相乘后得到的数据与另一路中的数据在加法单元进行相加,相加后得到的数据在后处理单元进行处理,例如可以进行截断处理,截断和四舍五入处理,或饱和处理。类似于α阶段的处理,在β阶段,α阶段后处理的数据经过预处理单元、乘法单元的处理之后,与α阶段未处理的数据在加法单元进行加法处理。类似于α阶段和β阶段的处理,在γ阶段,β阶段后处理的数据经过预处理单元、乘法单元的处理之后,与α阶段后处理且β阶段未处理的数据在加法单元进行加法处理。类似于α阶段、β阶段和γ阶段的处理,在δ阶段,γ阶段后处理的数据经过预处理单元、乘法单元的处理之后,与β阶段后处理且γ阶段未处理的数据在加法单元进行加法处理,并继续在后处理阶段进行处理,并在输出端口E输出,其中,在输出端口F可以输出γ阶段后处理且δ阶段未处理的数据,具体可以输入到片上缓存器。
其中,图2示出的未在δ阶段之后进行乘以1/K和-K的处理,但是本申请实施例并不限于此,在本申请实施例中,可以进行该处理,具体可以根据乘法器的数量而定。
r0、r1、r2等用于表示延迟单元,以保证上方数据流与下方数据流对齐。
截断处理可以是指可以将数据中特定位数的数据进行截断(例如十进制数据100.01可以截断处理为100,二进制数据10101110可以截断为1010)。饱和处理是指当数据超出相应数据类型表达范围时,进行区最大/最小的操作,例如,输入的是0x1234,输入的数据类型是有符号字符型(signed char),由于0x1234已经超出了signed char的最大表示范围,0x1234经过饱和处理后,结果为signed char所能表示的最大值,也就是0x7f。截断和四舍五入处理可以是在将数据中特定位数的数据进行截断之后,如果被截断的(也即被舍弃的)高位的取值为1,可以入1,如果为0,则不入1。
各个阶段在进行乘法处理时,相乘的系数可以是不同的。
图2进一步示出了数据在各个阶段延迟的时长。对于α阶段的输入端口B/D输入的数据,要延迟5个时钟周期(图中的x延,代表延迟x个时钟周期),这是由于输入端口A/C进来的数据需要经过预处理单元和乘法单元,预处理单元的处理需要2个时钟周期,乘法单元的处理需要3个时钟周期,所以输入端口B/D输入的数据需要延迟5个时钟周期,才能与输入端口A/C的数据对齐。另外,由于从端口A/C进入的数据需要延迟1个时钟周期才能和下 一个数据相加,因此在预处理单元之前需要延迟1个时钟周期以在预处理单元实现有效的相加。例如端口A/C的数据流为A0->A1->A2,需要将A0和A1,A1和A2进行相加,如此,需要将A0延迟一个时钟周期才能与A1相加,将A1延迟一个时钟周期才能与A2相加。如此,端口B/D输入的数据对应需要再延迟1个时钟周期。α阶段有两个输出数据流,上方的数据流要和下方的数据流对齐,需要延迟8个时钟周期,这8个时钟周期的组成是:2个时钟周期的预处理,3个时钟周期的乘法器,1个时钟周期的累加器,2个时钟周期的后处理。对于β、γ和δ阶段的数据延迟,和α阶段的数据延迟相同,这里不再赘述。
在进行数据处理时,可以存在多个DWT电路进行并行处理,由此可以提高数据处理的效率。例如,可以由8个DWT电路进行并行处理。
从图1和图2可以看出,DWT电路存在的各个阶段的处理是一致的,由此可以实现对器件单元的复用,例如,假设存在少于四个阶段的电路,由于需要进行四个阶段的处理,则可以复用至少一个阶段的电路。
例如,可以包括α阶段和β阶段的电路,则可以将α阶段的电路用作γ阶段的处理,以及β阶段的电路用于δ阶段的处理。具体实现时,数据进入α阶段的电路,在由α阶段的电路处理之后,数据从α阶段的电路流向β阶段的电路,在由β阶段的电路处理之后,数据由β阶段的电路流向α阶段的电路,在由α阶段的电路处理后,然后从α阶段的电路流向β阶段的电路,然后从β阶段的电路输出。当然,在该种情况下,也可以将此处提到的α阶段的电路称为α阶段和γ阶段的电路,以及将此处提到的β阶段的电路称为β阶段和δ阶段的电路。
从图1和图2中可以看到在DWT电路中存在较多的乘法器和加法器,在进行运算时,如果调用通用处理器中的加法和乘法指令,需要调用12次,指令的调度是在软件层面进行的,由于软件的处理实时性很低,并且完成一次DWT运算需要调度12次,这大大增加了DWT运算执行的时间,所以这种实现方式的实时性很低;另外这种实现方式需要读写12次的片上缓存,而读写片上缓存的功耗很大,所以这种实现方式的功耗很大。
为此,本申请实施例提供了以下的方案,可以解决在DWT运算过程中功耗较大且实时性较差的问题。
图3是根据本申请实施例的数据处理方法100的示意性流程图。如图3 所示,该方法100包括以下内容中的至少部分内容。
其中,该数据处理方法可以由数字信号处理器DSP实现,当然,也可以由其他的数据处理装置实现,本申请实施例对此不做具体限定。DWT电路可以是DSP的一部分,也可以独立于该DSP。
在110中,获取第一配置指令,其中,所述第一配置指令可以用于指示对DWT电路进行预配置的预配置信息。
可选地,在本申请实施例中,数据处理装置包括的获取电路可以从内存读取第一配置指令,以及在读取该第一配置指令之后,可以对该第一配置指令进行译码,以便于后续基于译码后的指令,数据处理装置包括的预配置电路对DWT电路进行预配置。
可选地,在本申请实施例中,获取电路也可以通过连接于CPU的总线获取第一配置指令中的全部或部分信息。或者,获取电路也可以从寄存器获取第一配置指令中的全部或部分信息。
具体地,在本申请实施例中,第一配置指令中的一部分信息可以存储于寄存器中,另一部分信息可以通过连接于CPU的总线获取。
其中,该第一预配置指令可以通过一条或多条指令的方式呈现。
可选地,在本申请实施例中,所述第一配置指令为单条指令。从而可以采用单条指令在DWT电路使用之前对DWT电路进行预配置,避免在DWT电路使用过程中实时进行指令调度,从而可以降低DWT电路运算的执行时间和功耗。
在120中,基于所述第一配置指令,确定对DWT电路进行预配置的预配置信息。
具体地,数据处理装置在获取到第一配置指令之后,可以基于第一配置指令的指示,确定对DWT电路进行预配置的预配置信息,以实现基于该预配置信息对DWT电路进行预配置。
可选地,在本申请实施例中,可以通过对第一配置指令进行译码的方式,获取本申请实施例提到的预配置信息。
可选地,获取电路和预配置电路可以组成为译码器,也可以称为指令译码器。
可选地,在本申请实施例中,在译码所述第一配置指令之前,获取第二配置指令,所述第二配置指令用于指示译码所述第一配置指令。
具体地,获取电路可以预先获取第一配置指令,但在接收到第二配置指令之前,并不对第一配置指令进行译码,而是在接收到第二配置指令之后,基于第二配置指令的触发,对第一配置指令进行译码。
在本申请实施例中,对DWT电路进行的预配置可以包括能够影响DWT电路的运算方面的任意预配置。例如,关于DWT电路数据输入的预配置,关于DWT电路输出的预配置,关于DWT电路内部运算的预配置,以及关于哪些或多少个DWT电路进行运算的预配置等。
则具体地,对DWT电路进行预配置的预配置信息包括以下中的至少一种:
1)需要处理图像数据的DWT电路的数量;
2)需要处理图像数据的每个DWT电路中的器件单元的连接关系;
3)需要处理图像数据的每个DWT电路的类型,其中,DWT电路的类型由每个时钟可处理的图像数据的最大比特数区分;
4)为需要处理图像数据的至少一个DWT电路进行数据读取的时钟周期数;
5)每个时钟周期为需要处理图像数据的至少一个DWT电路读取的数据的数据量;
6)针对所述DWT电路中的至少一种器件单元的预配置信息。
应理解,除了以上提到的1)-6)项预配置信息,本申请实施例中的预配置信息还可以包括其他信息,本申请实施例对此不做具体限定。例如,可以包括DWT电路中的延迟处理的延迟时长的预配置信息等。
由于延迟时长与各个器件单元的处理速度和器件单元的连接关系有关,则可以根据各个器件单元的处理速度和器件单元之间的连接关系,确定处理处理的延迟时长。
为了更加清楚地理解本申请,以下将对以上提到的各种预配置信息进行详细说明。
对于预配置信息1)需要处理图像数据的DWT电路的数量而言,该DWT电路的数量可以是指如图1和2所示的DWT电路(其中,图1和图2所示的为一个DWT电路)的数量,多个DWT电路可以并行进行图像数据的处理。
基于此,处理图像数据的DWT电路的数量可以是基于以下中的至少一 种来确定:
针对系统中的DWT电路可用的系统带宽大小、每个DWT电路每个时钟周期处理的数据量、每个时钟周期为需要处理图像数据的全部DWT电路读取的数据的数据量。
具体而言,由于DWT电路可用的系统带宽大小、每个DWT电路每个时钟周期处理的数据量、每个时钟周期为需要处理图像数据的全部DWT电路读取的数据的数据量影响着能够同时并行进行图像数据处理的DWT电路,因此,可以基于这些因素的全部或部分确定DWT电路的数量。
例如,DWT电路可用的系统带宽大小除以每个DWT电路每个时钟周期处理的数据量,可以得到DWT电路的数量。
例如,每个时钟周期为需要处理图像数据的全部DWT电路读取的数据的数据量除以每个DWT电路每个时钟周期处理的数据量,可以得到DWT电路的数量。
对于预配置信息2)需要处理图像数据的每个DWT电路中的器件单元的连接关系而言,由于DWT电路中的器件单元的连接关系影响着图像数据的处理结果,可以基于期望达到的处理结果,来确定DWT电路的连接关系,其中,该连接关系可以表示DWT电路中的器件单元如何连接以及连接哪些器件单元。
其中,DSP中可以存在可以连接的所有器件单元,处理电路可以基于预配置信息选择其中的部分器件单元连接。例如,DSP包括器件单元A、B、C、D和E,其中,这些器件单元的排布顺序可以为A、B、C、D和E,在进行连接时,可以将A与B进行连接,将B与D进行连接,以及将D与E进行连接,也即可以跳过C,也即不连接C。
对于预配置信息3)需要处理图像数据的每个DWT电路的类型而言,由于DWT电路的类型由每个时钟可处理的图像数据的最大比特数区分;也就是说,不同类型的DWT电路每个时钟处理的图像数据的最大比特数是不同的,单个DWT电路每个时钟处理的图像数据的比特数可以是指单个输入端口输入的数据的所占的比特,例如,如图1或2所示,端口A/C,或端口B/D在一个时钟输入的数据所占的比特数是DWT电路每个时钟处理的图像数据的比特数。
其中,可以根据以下中的至少一种,确定需要处理图像数据的每个DWT 电路的类型:
需要处理图像数据的DWT电路的数量、每个DWT电路每个时钟周期需要处理的数据的比特数。
例如,可以根据需要处理图像数据的DWT电路的数量,按照最大比特数从大到小的方式来确定需要处理图像数据的DWT电路的类型,例如,需要处理图像数据的DWT电路的数量为8个,而DWT电路的类型可以包括类型1、类型2和类型3,类型1的数量为5个、类型2的数量为5个以及类型3的数量为5,类型1支持的最大比特数大于类型2,类型2支持的最大比特数大于类型3,则可以采用类型1的5个DWT电路,以及类型2的3个DWT电路。
例如,每个DWT电路每个时钟周期需要处理的数据的比特数为A,则可以将支持的最大比特数大于或等于A的DWT电路类型确定为需要处理图像数据的DWT电路的类型。
对于预配置信息4)为需要处理图像数据的全部DWT电路进行数据读取的时钟周期数而言,可以根据以下中的至少一种来确定:
需要处理的图像数据的总数据量、针对系统中的DWT电路可用的系统带宽大小、需要处理图像数据的全部DWT电路每个时钟周期处理的数据量、每个时钟周期为需要处理图像数据的全部DWT电路读取的数据的数据量。
具体而言,由于需要处理的图像数据的总数据量、针对系统中的DWT电路可用的系统带宽大小、需要处理图像数据的全部DWT电路每个时钟周期处理的数据量、每个时钟周期为需要处理图像数据的全部DWT电路读取的数据的数据量影响着为需要处理图像数据的全部DWT电路进行数据读取的时钟周期数,因此可以根据这些因素中的全部或部分来确定。
例如,需要处理的图像数据的总数据量除以可用的系统带宽大小,可以得到该时钟周期数。
例如,需要处理的图像数据的总数据量除以需要处理图像数据的全部DWT电路每个时钟周期处理的数据量,可以得到该时钟周期数。
例如,需要处理的图像数据的总数据量除以每个时钟周期为需要处理所述图像数据的全部所述DWT电路读取的数据的数据量,可以得到该时钟周期数。
对于预配置信息5)每个时钟周期为需要处理图像数据的全部DWT电 路读取的数据的数据量而言,可以根据根据以下中的至少一种来确定:
需要处理的图像数据的总数据量、针对系统中的DWT电路可用的系统带宽大小、需要处理图像数据的全部DWT电路每个时钟周期能够处理的数据量、为需要处理所述图像数据的全部DWT电路进行数据读取的时钟周期数。
例如,需要处理的图像数据的总数据量除以为需要处理所述图像数据的全部DWT电路进行数据读取的时钟周期数,可以确定每个时钟周期为需要处理图像数据的全部DWT电路读取的数据的数据量。
例如,将需要处理图像数据的全部DWT电路每个时钟周期能够处理的数据量确定为每个时钟周期为需要处理图像数据的全部DWT电路读取的数据的数据量。
例如,针对系统中的DWT电路可用的系统带宽大小对应的数据量确定为每个时钟周期为需要处理图像数据的全部DWT电路读取的数据的数据量。
例如,将需要处理图像数据的全部DWT电路每个时钟周期能够处理的数据量与针对系统中的DWT电路可用的系统带宽大小对应的数据量之间的较小者,确定为每个时钟周期为需要处理图像数据的全部DWT电路读取的数据的数据量。
除了以上因素,还可以通过其他的方式,确定每个时钟周期为需要处理图像数据的全部DWT电路读取的数据的数据量,例如,可以根据可用寄存器的大小,来确定需要读取的数据的数据量。
对于预配置信息6)针对DWT电路中的至少一种器件单元的预配置信息包括以下中的至少一种:
每种器件单元输出的数据的值的区间、每种器件单元需要采用的数量、每种器件单元的复用方式、每种器件单元需要采用的类型。其中,此处提到的需要预配置的器件单元可以包括预处理单元、乘法单元、加法单元和后处理单元中的至少一种。以及此处提到的需要预配置的器件单元可以包括α阶段、β阶段、γ阶段和δ阶段中的至少一种阶段的器件单元。
其中,所述器件单元的类型由所述器件单元每个时钟可处理的图像数据的最大比特数区分。
例如,例如对于预处理单元和加法单元中的加法器,可以包括最大可以 处理32比特+32比特的数据,最大可以处理32比特+16比特的数据,以及最大可以处理16比特+16比特的数据共三种类型。
例如,对于乘法单元中的乘法器,可以包括最大可以处理32比特*32比特的数据,最大可以处理32比特*16比特的数据,以及最大可以处理16比特*16比特的数据共三种类型。其中,最大可以处理32比特*32比特的数据,最大可以处理32比特*16比特的数据的乘法器可以由16比特*16比特的乘法器颗粒拼接而成。
以下第一器件单元为例说明如何确定对第一器件单元进行预配置的预配置信息,该第一器件单元可以为DWT电路中的任一器件单元,例如,可以为预处理单元、乘法单元、加法单元或后处理单元。
作为示例性地,根据第一器件单元需要处理的图像数据的数值区间,确定第一器件单元输出的数据的值的区间。
例如,可以根据需要处理的图像数据是否是有符号的数据(例如,有符号的数据可以为负数),确定第一器件单元输出的数据是否是有符号的数据。
例如,第一器件单元为预处理单元或加法单元,最大可以支持32比特+32比特的处理,则可以确定需要处理的是32比特+32比特的数据,还是16比特+16比特的数据。
例如,第一器件单元为乘法单元,最大可以支持32比特*32比特的处理,则可以确定需要处理的是32比特832比特的数据,还是16比特*16比特的数据。
作为示例性地,根据以下中的至少一种,确定第一器件单元的数量:针对系统中的DWT电路可用的系统带宽大小、单个第一器件单元每个时钟周期处理的数据量、第一器件单元的复用方式、需要处理图像数据的所述DWT电路的数量。
例如,可以根据需要处理图像数据的DWT电路乘以DWT电路包括的阶段数,确定第一器件单元的数量。例如,假设DWT电路包括四个阶段的处理,则乘法单元的数量可以为四乘以DWT电路的数量。此时计算的第一器件单元的数量可以是DWT电路内部的第一器件单元的数量。
例如,可以根据需要处理图像数据的DWT电路以及第一器件单元的复用方式,确定第一器件单元的数量。例如,假设DWT电路包括四个阶段的处理,但是每两个单元进行器件单元的复用(例如,α阶段的电路与γ阶段 电路复用,以及β阶段的电路与δ阶段的电路复用),则乘法单元的数量可以为2乘以DWT电路的数量。此时计算的第一器件单元的数量可以是DWT电路内部的第一器件单元的数量。
例如,可以根据针对系统中的DWT电路可用的系统带宽大小和单个第一器件单元每个时钟周期处理的数据量确定单个阶段需要并行进行处理的第一器件单元的数量,也即可以将针对系统中的DWT电路可用的系统带宽大小除以单个第一器件单元每个时钟周期处理的数据量,得到单个阶段需要并行进行处理的器件单元的数量。进一步地,可以根据DWT电路包括的阶段的数量,确定总共需要的第一器件单元的数量,例如,在前一步计算的数量的基础上乘以四。
作为示例性地,根据以下中的至少一种,确定第一器件单元需要采用的类型:
第一器件单元每个时钟周期处理的数据的比特数、第一器件单元的复用方式。
例如,由于器件单元的类型由所述器件单元每个时钟可处理的图像数据的最大比特数区分,则可以根据第一器件每个时钟周期需要处理的数据的比特数,确定第一器件需要采用的类型。例如,对于乘法单元而言,需要处理的数据为32比特*16比特的数据,则可以选择最大可处理32*32比特的数据的乘法器以及最大可处理32*16比特的乘法器。
由于对于不同的阶段,随着数据处理的进行,对于例如预处理单元、乘法单元、加法单元、后处理单元,需要处理的比特数是可变的,例如,是增加的,此时对于不同的阶段,可以分别为例如预处理单元、乘法单元、加法单元、后处理单元分别确定需要采用的类型。
正如以上所述,随着数据处理的进行,对于例如预处理单元、乘法单元、加法单元、后处理单元,需要处理的比特数是可变的,如果器件单元是复用的,则需要根据需要处理的比特数,确定乘法器的复用方式,例如32比特*16比特的乘法器和32比特*32比特的乘法器是由16比特*16比特的乘法器拼接而成的。如此,可以有效的节省乘法单元的面积。。
应理解,对于器件单元的预配置信息除了包括以上的预配置信息之外,还可以包括其他的预配置信息,本申请实施例对此不做具体限定。
例如,由于32*32比特的乘法器和32*16比特的乘法器可以由16比特 *16比特的乘法器拼接而言,则预配置信息可以指示采用哪些或多少个16比特*16比特的乘法器拼接形成32*32比特的乘法器或32*16比特的乘法器。
例如,由于后处理单元可以包括饱和处理、截断处理和截断和四舍五入处理,则预配置信息指示后处理单元进行哪种类型的后处理。
例如,预配置信息还可以包括对各个阶段进行乘法处理时需要乘的系数。
以上基于各种参数确定预配置信息的操作可以由处理电路(具体可以为CPU)实现,处理电路在确定这些预配置信息之后,可以生成第一配置指令,配置给寄存器和/或发送给获取电路。
应理解,对于以上用于确定预配置信息的因素的具体取值可以携带在第一配置指令中,也可以不携带在第一配置指令中,此时,第一配置指令起到了触发进行预配置的功能。
在130中,数据处理装置利用所述预配置信息,对所述DWT电路进行预配置。
具体地,获取电路在基于第一配置指令,获取预配置信息,预配置电路根据预配置信息的指示,对DWT电路进行预配置,从而预配置后的DWT电路,可以处理图像数据。
可选地,在本申请实施例中,对第一配置指令进行译码之后,可以得到多个控制信号,该多个控制信号可以分别预配置不同的器件单元,也即寄存单元、预处理单元、乘法单元、加法单元和后处理单元的预配置可以由不同的控制信号来预配置。
为了便于理解,以下结合图4对本申请实施例中数据处理方法进行详细说明。
如图4所示,CPU可以将第一配置指令发送给译码器(也即以上提到的获取电路),译码器接收第一配置指令,并对该第一配置指令进行译码,以完成从指令到控制信号的译码,然后通过预配置电路(可以是译码器的一部分)将该控制信号发送到数据通道,完成对DWT电路的预配置,即可以对寄存单元、预处理单元、乘法单元、加法单元和后处理的预配置,其中,对寄存单元的预配置可以理解为每个时钟周期需要读取的数据量和需要读取的时钟周期数的预配置。使能单元可以产生对片上缓存的读写使能信号。然后,数据可以从寄存单元输入到预处理单元,依次经过预处理单元、乘法单 元、加法单元和后处理单元的处理,并进行输出。
CPU也可访问寄存器,进行相关的寄存器配置,控制寄存器接口为寄存器的对外接口。其中,中断用于通知CPU如下事件:DWT电路已完成任务,并发出任务完成的信号。
图4中示出了输出端口C和输出端口D,这意味着端口C和D即可以用于输入又可以用于输出。当然,本申请实施例中,输入端口C和输出端口D也可以不用于输入和输出的共享。输入端口处的数字(例如,512和256)代表着每个端口的可用带宽。输出端口处的数字(512和256)代表输出的数据量。其中,端口C和端口D输入的是512比特和256比特,这意味着端口C中输入的数据有一部分256比特用于其他的处理,预处理单元处理的数据为256比特+256比特。
应理解,数据通路仅示出了一个阶段的器件单元,仅为了图示的简单,不应对本申请实施例造成特别的限定。
因此,在本申请实施例中,在对DWT电路预配置之前,获取第一配置指令;基于所述第一配置指令,确定对DWT电路进行预配置的预配置信息;利用所述预配置信息,对所述DWT电路进行预配置,可以采用第一配置指令在DWT电路使用之前对DWT电路进行预配置,避免在DWT电路使用过程中实时进行指令调度,从而可以降低DWT电路运算的执行时间和功耗。
图5是根据本申请实施例的数据处理装置200的示意性框图。
如图5所示,该数据处理装置200可以包括:
获取电路210,用于获取第一配置指令,所述第一配置指令用于指示对离散小波变换DWT电路进行预配置的预配置信息;基于所述第一配置指令,获取所述预配置信息;
预配置电路220,用于利用所述预配置信息,对所述DWT电路进行预配置,以便于预配置后的所述DWT电路处理图像数据。
可选地,在本申请实施例中,所述预配置信息包括以下中的至少一个:
需要处理所述图像数据的所述DWT电路的数量;
需要处理所述图像数据的每个所述DWT电路中的器件单元的连接关系;
需要处理所述图像数据的每个所述DWT电路的类型,其中,所述DWT电路的类型由每个时钟可处理的图像数据的最大比特数区分;
为需要处理所述图像数据的至少一个所述DWT电路进行数据读取的时钟周期数;
每个时钟周期,为需要处理所述图像数据的至少一个所述DWT电路读取的数据的数据量。
可选地,在本申请实施例中,如图6所示,该装置200还可以包括处理电路230。其中,该处理电路230可以为CPU。
可选地,在本申请实施例中,处理电路230,用于:
根据以下中的至少一种,确定处理所述图像数据的所述DWT电路的数量,以用于生成所述第一配置指令:
针对系统中的所述DWT电路可用的系统带宽大小、每个所述DWT电路每个时钟周期处理的数据量、每个时钟周期,为需要处理所述图像数据的至少一个所述DWT电路读取的数据的数据量。
可选地,在本申请实施例中,处理电路230,用于:
根据以下中的至少一种,确定需要处理所述图像数据的每个所述DWT电路的类型,以用于生成所述第一配置指令:
需要处理所述图像数据的所述DWT电路的数量、每个所述DWT电路每个时钟周期处理的数据的比特数。
可选地,在本申请实施例中,处理电路230,用于:
根据以下中的至少一种,确定为需要处理所述图像数据的至少一个所述DWT电路进行数据读取的时钟周期数,以用于生成所述第一配置指令:
所述图像数据的总数据量、针对系统中的所述DWT电路可用的系统带宽大小、需要处理所述图像数据的至少一个所述DWT电路每个时钟周期处理的数据量、每个时钟周期为需要处理所述图像数据的至少一个所述DWT电路读取的数据的数据量。
可选地,在本申请实施例中,处理电路230,用于:
根据以下中的至少一种,确定每个时钟周期为需要处理所述图像数据的至少一个所述DWT电路读取的数据的数据量,以用于生成所述第一配置指令:
所述图像数据的总数据量、针对系统中的所述DWT电路可用的系统带宽大小、需要处理所述图像数据的至少一个所述DWT电路每个时钟周期能够处理的数据量、为需要处理所述图像数据的至少一个所述DWT电路进行 数据读取的时钟周期数。
可选地,在本申请实施例中,所述预配置信息包括:
针对所述DWT电路中的至少一种器件单元的预配置信息。
可选地,在本申请实施例中,针对所述DWT电路中的至少一种器件单元的预配置信息包括以下中的至少一种:
每种所述器件单元输出的数据的值的区间、每种所述器件单元需要采用的数量、每种所述器件单元的复用方式、每种所述器件单元需要采用的类型,其中,所述器件单元的类型由所述器件单元每个时钟可处理的图像数据的最大比特数区分。
可选地,在本申请实施例中,处理电路230,用于:
根据第一器件单元需要处理的所述图像数据的数值区间,确定所述第一器件单元输出的数据的值的区间,以用于生成所述第一配置指令。
可选地,在本申请实施例中,处理电路230,用于:
根据以下中的至少一种,确定第一器件单元的数量,以用于生成所述第一配置指令:
针对系统中的所述DWT电路可用的系统带宽大小、单个所述第一器件单元每个时钟周期处理的数据量、所述第一器件单元的复用方式、需要处理所述图像数据的所述DWT电路的数量。
可选地,在本申请实施例中,处理电路230,用于:
根据以下中的至少一种,确定第一器件单元需要采用的类型,以用于生成所述第一配置指令:
所述第一器件单元每个时钟周期处理的数据的比特数、所述第一器件单元的复用方式。
可选地,在本申请实施例中,处理电路230,用于:
根据以下中的至少一种,确定第一器件单元的复用方式,以用于生成所述第一配置指令:
所述第一器件单元需要采用的类型、系统对所述第一器件单元的使用情况。
可选地,在本申请实施例中,预配置的至少一种器件单元包括:预处理单元、乘法单元、加法单元和后处理单元中的至少一种;
其中,所述图像数据依次经过所述预处理单元、所述乘法单元、所述加 法单元和所述后处理单元的处理。
可选地,在本申请实施例中,针对单个DWT电路,对所述预处理单元、所述乘法单元、所述加法单元和所述后处理单元进行复用,其中,所述复用包括:
在所述图像数据在经过所述预处理单元、所述乘法单元、所述加法单元和所述后处理单元的处理之后,再次输入到已经进行过处理的所述预处理单元、所述乘法单元、所述加法单元和所述后处理单元,以用于对所述图像数据再次进行处理。
可选地,在本申请实施例中,所述获取电路210进一步用于:
译码所述第一配置指令,以获取所述预配置信息。
可选地,在本申请实施例中,所述获取电路210进一步用于:
在译码所述第一配置指令之前,获取第二配置指令,所述第二配置指令用于指示译码所述第一配置指令。
可选地,在本申请实施例中,所述获取电路210进一步用于:
通过连接于处理电路的总线和/或寄存器,获取所述第一配置指令。
可选地,在本申请实施例中,如图6所示,该装置200还包括所述寄存器240。
可选地,在本申请实施例中,如图6所示,该装置200还包括所述DWT250电路,用于:
在被预配置后,处理所述图像数据。
可选地,在本申请实施例中,所述第一配置指令为单条指令。
可选地,在本申请实施例中,所述装置200由数字信号处理器DSP实现。
应理解,在本申请实施例中,该数据处理装置200可以用于以上数据处理方法100,为了简洁,在此不再赘述。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。

Claims (41)

  1. 一种数据处理方法,其特征在于,包括:
    获取第一配置指令,所述第一配置指令用于指示对离散小波变换DWT电路进行预配置的预配置信息;
    基于所述第一配置指令,获取所述预配置信息;
    利用所述预配置信息,对所述DWT电路进行预配置,以便于预配置后的所述DWT电路处理图像数据。
  2. 根据权利要求1所述的方法,其特征在于,所述预配置信息包括以下中的至少一个:
    需要处理所述图像数据的所述DWT电路的数量;
    需要处理所述图像数据的每个所述DWT电路中的器件单元的连接关系;
    需要处理所述图像数据的每个所述DWT电路的类型,其中,所述DWT电路的类型由每个时钟可处理的图像数据的最大比特数区分;
    为需要处理所述图像数据的至少一个所述DWT电路进行数据读取的时钟周期数;
    每个时钟周期,为需要处理所述图像数据的至少一个所述DWT电路读取的数据的数据量。
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:
    根据以下中的至少一种,确定处理所述图像数据的所述DWT电路的数量,以用于生成所述第一配置指令:
    针对系统中的所述DWT电路可用的系统带宽大小、每个所述DWT电路每个时钟周期处理的数据量、每个时钟周期,为需要处理所述图像数据的至少一个所述DWT电路读取的数据的数据量。
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:
    根据以下中的至少一种,确定需要处理所述图像数据的每个所述DWT电路的类型,以用于生成所述第一配置指令:
    需要处理所述图像数据的所述DWT电路的数量、每个所述DWT电路每个时钟周期处理的数据的比特数。
  5. 根据权利要求2至4中任一项所述的方法,其特征在于,所述方法还包括:
    根据以下中的至少一种,确定为需要处理所述图像数据的至少一个所述DWT电路进行数据读取的时钟周期数,以用于生成所述第一配置指令:
    所述图像数据的总数据量、针对系统中的所述DWT电路可用的系统带宽大小、需要处理所述图像数据的至少一个所述DWT电路每个时钟周期处理的数据量、每个时钟周期为需要处理所述图像数据的至少一个所述DWT电路读取的数据的数据量。
  6. 根据权利要求2至5中任一项所述的方法,其特征在于,所述方法还包括:
    根据以下中的至少一种,确定每个时钟周期为需要处理所述图像数据的至少一个所述DWT电路读取的数据的数据量,以用于生成所述第一配置指令:
    所述图像数据的总数据量、针对系统中的所述DWT电路可用的系统带宽大小、需要处理所述图像数据的至少一个所述DWT电路每个时钟周期能够处理的数据量、为需要处理所述图像数据的至少一个所述DWT电路进行数据读取的时钟周期数。
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述预配置信息包括:
    针对所述DWT电路中的至少一种器件单元的预配置信息。
  8. 根据权利要求7所述的方法,其特征在于,针对所述DWT电路中的至少一种器件单元的预配置信息包括以下中的至少一种:
    每种所述器件单元输出的数据的值的区间、每种所述器件单元需要采用的数量、每种所述器件单元的复用方式、每种所述器件单元需要采用的类型,其中,所述器件单元的类型由所述器件单元每个时钟可处理的图像数据的最大比特数区分。
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:
    根据第一器件单元需要处理的所述图像数据的数值区间,确定所述第一器件单元输出的数据的值的区间,以用于生成所述第一配置指令。
  10. 根据权利要求8或9或所述的方法,其特征在于,所述方法还包括:
    根据以下中的至少一种,确定第一器件单元的数量,以用于生成所述第一配置指令:
    针对系统中的所述DWT电路可用的系统带宽大小、单个所述第一器件 单元每个时钟周期处理的数据量、所述第一器件单元的复用方式、需要处理所述图像数据的所述DWT电路的数量。
  11. 根据权利要求8至10中任一项所述的方法,其特征在于,所述方法还包括:
    根据以下中的至少一种,确定第一器件单元需要采用的类型,以用于生成所述第一配置指令:
    所述第一器件单元每个时钟周期处理的数据的比特数、所述第一器件单元的复用方式。
  12. 根据权利要求8至11中任一项所述的方法,其特征在于,所述方法还包括:
    根据以下中的至少一种,确定第一器件单元的复用方式,以用于生成所述第一配置指令:
    所述第一器件单元需要采用的类型、系统对所述第一器件单元的使用情况。
  13. 根据权利要求1至12中任一项所述的方法,其特征在于,预配置的至少一种器件单元包括:预处理单元、乘法单元、加法单元和后处理单元中的至少一种;
    其中,所述图像数据依次经过所述预处理单元、所述乘法单元、所述加法单元和所述后处理单元的处理。
  14. 根据权利要求13所述的方法,其特征在于,针对单个DWT电路,对所述预处理单元、所述乘法单元、所述加法单元和所述后处理单元进行复用,其中,所述复用包括:
    在所述图像数据在经过所述预处理单元、所述乘法单元、所述加法单元和所述后处理单元的处理之后,再次输入到已经进行过处理的所述预处理单元、所述乘法单元、所述加法单元和所述后处理单元,以用于对所述图像数据再次进行处理。
  15. 根据权利要求1至14中任一项所述的方法,其特征在于,基于所述第一配置指令,获取所述预配置信息,包括:
    译码所述第一配置指令,以获取所述预配置信息。
  16. 根据权利要求15所述的方法,其特征在于,所述方法还包括:
    在译码所述第一配置指令之前,获取第二配置指令,所述第二配置指令 用于指示译码所述第一配置指令。
  17. 根据权利要求1至16中任一项所述的方法,其特征在于,所述获取第一配置指令,包括:
    通过连接于处理电路的总线和/或寄存器,获取所述第一配置指令。
  18. 根据权利要求1至17中任一项所述的方法,其特征在于,所述方法还包括:
    利用预配置后的所述DWT电路,处理所述图像数据。
  19. 根据权利要求1至18中任一项所述的方法,其特征在于,所述第一配置指令为单条指令。
  20. 根据权利要求1至19中任一项所述的方法,其特征在于,所述方法由数字信号处理器DSP实现。
  21. 一种数据处理装置,其特征在于,包括:
    获取电路,用于获取第一配置指令,所述第一配置指令用于指示对离散小波变换DWT电路进行预配置的预配置信息;基于所述第一配置指令,获取所述预配置信息;
    预配置电路,用于利用所述预配置信息,对所述DWT电路进行预配置,以便于预配置后的所述DWT电路处理图像数据。
  22. 根据权利要求21所述的装置,其特征在于,所述预配置信息包括以下中的至少一个:
    需要处理所述图像数据的所述DWT电路的数量;
    需要处理所述图像数据的每个所述DWT电路中的器件单元的连接关系;
    需要处理所述图像数据的每个所述DWT电路的类型,其中,所述DWT电路的类型由每个时钟可处理的图像数据的最大比特数区分;
    为需要处理所述图像数据的至少一个所述DWT电路进行数据读取的时钟周期数;
    每个时钟周期,为需要处理所述图像数据的至少一个所述DWT电路读取的数据的数据量。
  23. 根据权利要求22所述的装置,其特征在于,所述装置还包括处理电路,用于:
    根据以下中的至少一种,确定处理所述图像数据的所述DWT电路的数 量,以用于生成所述第一配置指令:
    针对系统中的所述DWT电路可用的系统带宽大小、每个所述DWT电路每个时钟周期处理的数据量、每个时钟周期,为需要处理所述图像数据的至少一个所述DWT电路读取的数据的数据量。
  24. 根据权利要求23所述的装置,其特征在于,所述装置还包括处理电路,用于:
    根据以下中的至少一种,确定需要处理所述图像数据的每个所述DWT电路的类型,以用于生成所述第一配置指令:
    需要处理所述图像数据的所述DWT电路的数量、每个所述DWT电路每个时钟周期处理的数据的比特数。
  25. 根据权利要求22至24中任一项所述的装置,其特征在于,所述装置还包括处理电路,用于:
    根据以下中的至少一种,确定为需要处理所述图像数据的至少一个所述DWT电路进行数据读取的时钟周期数,以用于生成所述第一配置指令:
    所述图像数据的总数据量、针对系统中的所述DWT电路可用的系统带宽大小、需要处理所述图像数据的至少一个所述DWT电路每个时钟周期处理的数据量、每个时钟周期为需要处理所述图像数据的至少一个所述DWT电路读取的数据的数据量。
  26. 根据权利要求22至25中任一项所述的装置,其特征在于,所述装置还包括处理电路,用于:
    根据以下中的至少一种,确定每个时钟周期为需要处理所述图像数据的至少一个所述DWT电路读取的数据的数据量,以用于生成所述第一配置指令:
    所述图像数据的总数据量、针对系统中的所述DWT电路可用的系统带宽大小、需要处理所述图像数据的至少一个所述DWT电路每个时钟周期能够处理的数据量、为需要处理所述图像数据的至少一个所述DWT电路进行数据读取的时钟周期数。
  27. 根据权利要求21至26中任一项所述的装置,其特征在于,所述预配置信息包括:
    针对所述DWT电路中的至少一种器件单元的预配置信息。
  28. 根据权利要求27所述的装置,其特征在于,针对所述DWT电路中 的至少一种器件单元的预配置信息包括以下中的至少一种:
    每种所述器件单元输出的数据的值的区间、每种所述器件单元需要采用的数量、每种所述器件单元的复用方式、每种所述器件单元需要采用的类型,其中,所述器件单元的类型由所述器件单元每个时钟可处理的图像数据的最大比特数区分。
  29. 根据权利要求28所述的装置,其特征在于,所述装置还包括处理电路,用于:
    根据第一器件单元需要处理的所述图像数据的数值区间,确定所述第一器件单元输出的数据的值的区间,以用于生成所述第一配置指令。
  30. 根据权利要求28或29或所述的装置,其特征在于,所述装置还包括处理电路,用于:
    根据以下中的至少一种,确定第一器件单元的数量,以用于生成所述第一配置指令:
    针对系统中的所述DWT电路可用的系统带宽大小、单个所述第一器件单元每个时钟周期处理的数据量、所述第一器件单元的复用方式、需要处理所述图像数据的所述DWT电路的数量。
  31. 根据权利要求28至30中任一项所述的装置,其特征在于,所述装置还包括处理电路,用于:
    根据以下中的至少一种,确定第一器件单元需要采用的类型,以用于生成所述第一配置指令:
    所述第一器件单元每个时钟周期处理的数据的比特数、所述第一器件单元的复用方式。
  32. 根据权利要求28至31中任一项所述的装置,其特征在于,所装置还包括处理电路,用于:
    根据以下中的至少一种,确定第一器件单元的复用方式,以用于生成所述第一配置指令:
    所述第一器件单元需要采用的类型、系统对所述第一器件单元的使用情况。
  33. 根据权利要求21至32中任一项所述的装置,其特征在于,预配置的至少一种器件单元包括:预处理单元、乘法单元、加法单元和后处理单元中的至少一种;
    其中,所述图像数据依次经过所述预处理单元、所述乘法单元、所述加法单元和所述后处理单元的处理。
  34. 根据权利要求33所述的装置,其特征在于,针对单个DWT电路,对所述预处理单元、所述乘法单元、所述加法单元和所述后处理单元进行复用,其中,所述复用包括:
    在所述图像数据在经过所述预处理单元、所述乘法单元、所述加法单元和所述后处理单元的处理之后,再次输入到已经进行过处理的所述预处理单元、所述乘法单元、所述加法单元和所述后处理单元,以用于对所述图像数据再次进行处理。
  35. 根据权利要求21至34中任一项所述的装置,其特征在于,所述获取电路进一步用于:
    译码所述第一配置指令,以获取所述预配置信息。
  36. 根据权利要求35所述的装置,其特征在于,所述获取电路进一步用于:
    在译码所述第一配置指令之前,获取第二配置指令,所述第二配置指令用于指示译码所述第一配置指令。
  37. 根据权利要求21至36中任一项所述的装置,其特征在于,所述获取电路进一步用于:
    通过连接于处理电路的总线和/或寄存器,获取所述第一配置指令。
  38. 根据权利要求37所述的装置,其特征在于,所述装置还包括所述处理电路和/或所述寄存器。
  39. 根据权利要求21至38中任一项所述的装置,其特征在于,还包括所述DWT电路,用于:
    在被预配置后,处理所述图像数据。
  40. 根据权利要求21至39中任一项所述的装置,其特征在于,所述第一配置指令为单条指令。
  41. 根据权利要求21至40中任一项所述的装置,其特征在于,所述装置由数字信号处理器DSP实现。
PCT/CN2019/103796 2019-08-30 2019-08-30 数据处理方法和装置 WO2021035715A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/103796 WO2021035715A1 (zh) 2019-08-30 2019-08-30 数据处理方法和装置
CN201980029797.9A CN112136128A (zh) 2019-08-30 2019-08-30 数据处理方法和装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/103796 WO2021035715A1 (zh) 2019-08-30 2019-08-30 数据处理方法和装置

Publications (1)

Publication Number Publication Date
WO2021035715A1 true WO2021035715A1 (zh) 2021-03-04

Family

ID=73849174

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103796 WO2021035715A1 (zh) 2019-08-30 2019-08-30 数据处理方法和装置

Country Status (2)

Country Link
CN (1) CN112136128A (zh)
WO (1) WO2021035715A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1588451A (zh) * 2004-07-22 2005-03-02 华中科技大学 一种实现直接二维离散小波变换的电路
JP2007251968A (ja) * 2007-04-02 2007-09-27 Ricoh Co Ltd 画像処理装置及び画像処理方法
CN101534439A (zh) * 2008-03-13 2009-09-16 中国科学院声学研究所 一种低功耗并行的小波变换的vlsi结构
CN102333222A (zh) * 2011-10-24 2012-01-25 哈尔滨工业大学 二维离散小波变换电路及应用该电路的图像压缩方法
CN102751963A (zh) * 2012-07-18 2012-10-24 上海交通大学 基于乘累加器环的可配置离散小波变换电路及其实现方法
CN103067023A (zh) * 2012-11-29 2013-04-24 天津大学 基于提升的高效dwt编码方法及编码器

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4166530B2 (ja) * 2002-08-22 2008-10-15 株式会社リコー 画像処理装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1588451A (zh) * 2004-07-22 2005-03-02 华中科技大学 一种实现直接二维离散小波变换的电路
JP2007251968A (ja) * 2007-04-02 2007-09-27 Ricoh Co Ltd 画像処理装置及び画像処理方法
CN101534439A (zh) * 2008-03-13 2009-09-16 中国科学院声学研究所 一种低功耗并行的小波变换的vlsi结构
CN102333222A (zh) * 2011-10-24 2012-01-25 哈尔滨工业大学 二维离散小波变换电路及应用该电路的图像压缩方法
CN102751963A (zh) * 2012-07-18 2012-10-24 上海交通大学 基于乘累加器环的可配置离散小波变换电路及其实现方法
CN103067023A (zh) * 2012-11-29 2013-04-24 天津大学 基于提升的高效dwt编码方法及编码器

Also Published As

Publication number Publication date
CN112136128A (zh) 2020-12-25

Similar Documents

Publication Publication Date Title
Abbo et al. Xetal-II: a 107 GOPS, 600 mW massively parallel processor for video scene analysis
JP2022115959A (ja) 準同型暗号下での安全な計算を加速するための準同型処理ユニット(hpu)
US6367003B1 (en) Digital signal processor having enhanced utilization of multiply accumulate (MAC) stage and method
US9792118B2 (en) Vector processing engines (VPEs) employing a tapped-delay line(s) for providing precision filter vector processing operations with reduced sample re-fetching and power consumption, and related vector processor systems and methods
CN108073549B (zh) 卷积运算装置及方法
CN107680028B (zh) 用于缩放图像的处理器和方法
US20080307029A1 (en) Arithmetic device and arithmetic method
CN101640795B (zh) 一种视频解码优化方法及装置
WO2021035715A1 (zh) 数据处理方法和装置
US10127040B2 (en) Processor and method for executing memory access and computing instructions for host matrix operations
JP2000322235A (ja) 情報処理装置
JP2013239120A (ja) 画像処理装置
US9262123B2 (en) Data processing apparatus and method for performing a narrowing-and-rounding arithmetic operation
JP2002519957A (ja) 符号関数を処理する方法および装置
JP2008071170A (ja) 浮動小数点演算装置とこの装置を用いたレーダ信号処理装置
JP2014160393A (ja) マイクロプロセッサ及び演算処理方法
CN109445748B (zh) 一种快速求取中值方法及系统
WO2020211049A1 (zh) 数据处理方法和设备
TW201643746A (zh) 資料分配裝置、訊號處理裝置及其資料分配方法
JP5003070B2 (ja) デジタル信号処理装置
CN108140017B (zh) 用于线性相位有限脉冲响应抽取滤波器的方法和装置
Pham-Quoc et al. An efficient runtime adaptable floating-point Gaussian filtering core
JP3850150B2 (ja) デジタル信号処理動作を実行する方法およびデジタル信号プロセッサ
CN114492729A (zh) 卷积神经网络处理器、实现方法、电子设备及存储介质
KR100793799B1 (ko) 주소 생성 장치 및 이를 이용한 오디오 신호 처리 방법

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19943517

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19943517

Country of ref document: EP

Kind code of ref document: A1