The Present application claims priority from Japanese application JP2007-308347 filed on Nov. 29, 2007, the content of which is hereby incorporated by reference into this application.
The present invention relates to a technique of a stream process in which a data string is processed.
Patent Document 1 discloses a method as a related art according to the present invention. The Patent Document 1 describes an apparatus for realizing rewriting of program/data sets in an instruction memory and a data memory of a processor in accordance with a request from the processor in a data stream processing unit.
[Patent Document 1] Japanese Unexamined patent Publication No. 2004-179809
In the case where a plurality of data streams are continuously processed, if the time required from completion of processing one data stream to starting of processing the next data stream is long, the time is waste, and thus, the effective performance of a stream processing apparatus is deteriorated. In the case where a processor is used in a data stream process in the stream processing apparatus, if most of programs used for the data stream process differ from each other, or necessary parameters largely differ from each other, it takes a long time until these programs and parameters are available for use in the stream processing apparatus prior to starting of each data stream process, which largely affects on the performance. In addition, in the case where the streams are stored in an external memory, it takes time until an initial part of the streams is read from the memory when starting a new stream process, and the operation of the stream processing apparatus is stopped during the time. This fact largely affects on the performance especially when the streams are frequently switched.
An object of the present invention is to improve the processing performance in the case where a plurality of data streams are continuously processed.
The above-described and the other objects and novel characteristics of the present invention will be apparent from the description of the present specification and the accompanying drawings.
Summarized description of the representative outlines of the present invention disclosed in the application is as follows.
Specifically, a control stream, different from a data stream, is prepared for control, a rewriting process of a program and a parameter held by a memory that is accessible by a processor for a stream process at a high speed in accordance with the control stream is performed prior to a data stream process. In other words, a data transfer control apparatus controls data transfer of the data stream and the control stream between the outside of the data transfer control apparatus and the buffer memory in parallel to an arithmetic process performed by the processor for the data stream in a buffer memory.
Summarized description of effects obtained by the representative aspects of the present invention disclosed in the application is as follows.
Specifically, during a data stream process in a processor which performs a stream process, the entire or an initial part of the data stream to be processed next can be prepared in advance in an embedded memory accessible by the processor for performing a data stream process at a high speed. In addition, even in the case where different processing contents and different processing parameters for each data stream are necessary, necessary programs and parameters can be prepared in advance in the embedded memory accessible by the processor for performing the data stream process at a high speed by the control stream. Accordingly, in the case where a plurality of data streams are continuously processed, it is possible to reduce a waiting time of the processor for performing the data stream process during a transition period between one stream process and the next stream process, and to enhance the effective performance of the stream processing apparatus.
First of all, the outlines of the representative embodiments of the present invention disclosed in this application will be described first. It should be noted that parenthetic reference numerals of the drawings which are referred to in the outlined description for the representative embodiments merely exemplify constituent elements included in the concept of the constituent elements to which the reference numerals are given.
According to this, during the data stream process by the processor, the entire or an initial part of the data stream to be processed next or necessary programs and parameters can be prepared in advance in the buffer memory or the like by the control stream. Accordingly, it is possible to reduce awaiting time of the processor for performing the data stream process during a transition period between one stream process and the next stream process, and to enhance the effective performance of the stream processing apparatus.
According to this, the information of the parameter and the arithmetic procedure necessary for the process of the next data stream and the data stream are stored in the buffer memory in advance for use in parallel to the arithmetic process of the data stream. Accordingly, in the case where a plurality of data streams are continuously processed, it is possible to reduce a waiting time of the processor for performing the data stream process during a transition period between one stream process and the next stream process, and to enhance the effective performance of the stream processing apparatus.
The embodiment will be described in more detail. Hereinafter, the preferred embodiment of the present invention will be described in detail on the basis of the drawings. It should be noted that constituent elements having the same functions are given the same reference numerals throughout the all drawings for explaining the preferred embodiment of the present invention, and the explanations thereof will not be repeated.
In
The stream processing apparatus 100 is capable of simultaneously referring to one or more input streams, and simultaneously outputting one or more output streams. The stream processing apparatus 100 refers to the control stream 700 independently from input/output processes of the input streams and the output streams.
In
The memory 350 serves as a main storage apparatus in the system configuration shown in
Next, an internal configuration of the stream processing apparatus 100 will be described. A bus interface 110 is an interface through which the bus 500 is coupled to the inside of the stream processing apparatus 100. A control register 140 is a register to which control information for controlling the entire operation of the stream processing apparatus 100 is set, and is accessible from the bus 500 side. The control register 140 is configured using a plurality of registers, if needed, in some cases.
A DMA controller 120 performs data transfer along with the input/output of the stream, and data transfer between an instruction memory 160 and the bus 500 side and between a data memory 170 and the bus 500 side. In addition, the DMA controller 120 has a function of bypass transfer of data, so that a direct access from the bus 500 side to the instruction memory 160 and the data memory 170 is possible. The host processor 200 and a control stream analysis unit set transfer control information to the DMA controller 120. In addition, a stream processing processor 180 can set the transfer control information to the DMA controller 120, and if needed in the stream process, the stream processing processor 180 can flexibly control the input/output of the stream.
A stream buffer 130 is a buffer memory that temporarily stores the content of the stream for the input/output processes. The control stream 700 is also temporarily stored in the stream buffer 130. When the stream is input or output, the DMA controller 120 transfers the stream between the stream buffer 130 and the bus 500 side.
The stream processing processor 180 is a processor that mainly processes the data stream, and operates in accordance with programs stored in the instruction memory 160. Further, the data memory 170 is arranged as a working data memory of the stream processing processor 180. The stream processing processor 180 detects that the data of the data stream are stored in the stream buffer 130, so that the stream processing processor 180 performs a predetermined data process (stream process) by reading the data from the stream buffer 130, and writes the result into the stream buffer.
A bit processing engine 190 provides functions of sequentially retrieving data from the data stream with a specified bit width and writing data into the data stream with a specified bit width. The bit processing engine 190 is utilized when the stream processing processor 180 handles continuous data having various bit lengths, and functions as a so-called accelerator. The bit processing engine 190 is coupled to the stream buffer 130, and can read or write the stream data from/into the stream buffer 130 all together in units such as 32 bits and 64 bits by which the bit processing engine 190 accesses the stream buffer 130.
A control stream address queue 155 is a FIFO buffer that holds an initial address at which the control stream 700 is stored via the control register 140. The control stream 700 is usually generated by the host processor 200 to be stored into the memory 350 prior to starting of the stream processing apparatus 100, and the stream processing apparatus 100 processes in accordance with the control stream 700. Accordingly, at the time of starting of the stream processing apparatus 100, the stream processing apparatus 100 needs an initial address indicating the location of the control stream 700 stored in the memory 350. The control stream analysis unit controls setting or starting of the DMA controller 120 in order to obtain the necessary control stream using such an address. Further, the control stream analysis unit 150 controls setting or starting of the DMA controller 120 or the stream processing processor 180 in accordance with the content of the control stream 700. Furthermore, the control stream analysis unit 150 also has a function of writing a part of the content of the control stream 700 into the instruction memory 160 or the data memory 170 if needed.
Here, the outline of a process using the control stream performed by the stream processing apparatus 100 will be described before describing below the details of the stream processing apparatus 100. The address of the memory 350 at which the control stream is stored is written into the control register 140 by the host processor 200, and the control stream analysis unit 150 initializes a control stream transfer channel of the DMA controller 120 using the address via the control stream address queue 155. The control stream is transferred to the stream buffer 130 in accordance with the initialization. The control stream analysis unit 150 analyzes the control stream transferred to the stream buffer 130, stores a parameter and the like accompanied by the control stream into the data memory 170, the instruction memory 160, or the like, and stores the data stream into the stream buffer 130 using the DMA controller 120 in accordance with address information specified in an input stream address field accompanied by the control stream. A group of streams include the control stream and the data stream corresponding to the control stream. When the data stream is input to the stream buffer 130, the stream processing processor 180 that executes the programs in the instruction memory 160 sequentially performs the stream process that is a predetermined data process, such as decoding, for the data of the data stream input to the stream buffer 130, and the processing result is stored into an area of the memory 350 specified by the control stream under the control of the DMA controller 120. Such a process is repeated for the streams comprised of a group of streams including the control stream and the data stream. Especially, when the stream processing processor 180 performs the stream process for the data stream of the streams composing a group of streams, the stream processing processor 180 inputs the control stream and the data stream composing the next group of streams in advance in parallel to the stream process. Specifically, during the stream process of the data stream performed by the stream processing processor 180, the stream processing processor 180 reads the control stream and the data stream of the streams composing the next group of streams in advance. The respective units of the stream processing apparatus 100 for realizing such a function will be described below in detail.
In
As input stream storage areas, there are representatively shown portions of areas A (area group A) including a first input stream storage area A811 to an n-th input stream storage area A813, portions of areas B (area group B) including a first input stream storage area B821 to an n-th input stream storage area B813, and a portion of an area C (area group C) including a first input stream storage area C831. However, necessary area groups of the input streams are present thereafter in the same manner in accordance with a system. The stream processing apparatus 100 has a function of simultaneously inputting a plurality of streams, and handles the input streams on an area group basis. If a plurality of area groups are prepared as input stream storage areas, the stream process can be continuously performed after various input streams are stored into a plurality of area groups.
Although the same number of input stream storage areas is prepared for each area group of the input streams, the number of input streams to be simultaneously referred to for each stream process may differ. In this case, the input stream storage areas left are unused.
As a matter of convenience, the explanation is given while the input stream storage areas to be simultaneously referred to for each area group are integrated. However, if the area management of the memory 350 is possible, it is not necessary to integrally arrange the input stream storage areas in one place. In addition, the number of input stream storage areas belonging to each area group can be dynamically managed, if needed.
At the time the stream processing apparatus 100 completes the process of the input streams stored in the input stream storage areas, the input stream storage areas are reused as stream areas for the streams that are newly input from the input/output apparatus 400.
Further, as output stream storage areas, there are representatively shown, in
Although the same number of output stream storage areas is prepared for each area group of the output streams, the number of streams to be output for each stream process may be changed.
As a matter of convenience, an explanation is given while the output stream storage areas are integrated for each area group. However, if the area management of the memory 350 is possible, it is not necessary to integrally arrange the output stream storage areas in one place. In addition, the number of output stream storage areas belonging to each area group can be dynamically managed, if needed.
Results are written into the output stream storage areas from the stream processing apparatus 100 so that there is no possibility that new data are written from the stream processing apparatus 100 by outputting the results from the input/output apparatus 400. In addition, at the time the storage of the output results is not necessary, the output stream storage areas are reused as areas into which the stream processing apparatus 100 writes new results.
Into a control stream storage area 710, the control stream 700 to be passed to the stream processing apparatus when starting the stream processing apparatus 100 is stored. The control stream 700 is generated by the host processor 200. When a new data stream is input and the stream processing apparatus 100 is ready to process during a period the stream processing apparatus 100 is performing a process in accordance with one control stream 700, there arises the need for generating another control stream 700 to process the new data stream. In such a case, while the control stream storage area 710 is divided into a plurality of areas, the new control stream 700 is generated into another area so as not to rewrite the control stream 700 being currently used for the process.
When all the processes of one control stream 700 are completed, the control stream analysis unit 150 notifies the host processor 200 via the control register 140 and the bus interface 110. By using the notification, the host processor 200 determines whether or not it is possible to reuse the area into which the control stream 700 is stored.
In
Registers existing in the control register 140 and registers for DMA control existing in the DMA controller 120 are mapped in the control register space 5140, and the host processor 200 can control the stream processing apparatus 100 through these registers.
The instruction memory 160 is mapped in the instruction memory space 5160, and programs of the stream processing processor 180 can be written into the instruction memory space 5160 by the host processor 200 prior to the operation of the stream processing apparatus 100.
The data memory 170 is mapped in the data memory space 5170, and an initial parameter necessary for the stream processing apparatus 100 can be set to the data memory space 5170 by the host processor 200 prior to the operation of the stream processing apparatus 100.
In parts of the instruction memory space 5160 and the data memory space 5170, there exist spaces where actual memories are not mapped, so that the capacities of the instruction memory 160 and the data memory 170 can be extended.
In
The number of necessary DMA register sets is the maximum number of transfer streams or more that are possibly transferred by the DMA controller 120 at the same time. The number of necessary DMA register sets is calculated as follows. Specifically, “1” that is necessary for reading the control stream is added to the number obtained by doubling the sum of the maximum number of input streams that are possibly referred to at the same time when the stream processing apparatus 100 processes and the maximum number of streams that are possibly output at the same time when the stream processing apparatus 100 processes. The reason of necessity of the DMA register sets twice or more the sum of the maximum number of input streams that are possibly referred to at the same time and the maximum number of streams that are possibly output at the same time is to allow the input stream of the next processing target to be input in advance, and to allow an output of a processing result relating to the input stream to be processed next to start at the time the output stream that is a processing result relating to the current input stream is left in the stream buffer 130.
Degradation of the performance of the stream processing apparatus 100 caused by delay of starting the output of the output stream is usually smaller as compared to that caused by delay of reading the input stream. Accordingly, in consideration of the circuit size, it is conceivable that after the output stream that is a processing result relating to the current input stream is completely output from the stream buffer 130, setting of the DMA controller 120 necessary for output of a processing result relating to the next input stream to be processed is performed to start the output. In this case, the number of necessary DMA register sets is calculated as follows. Specifically, “1” that is necessary for reading the control stream is added to the sum of the number obtained by doubling the maximum number of input streams that are possibly referred to at the same time when the stream processing apparatus 100 processes and the maximum number of streams that are possibly output at the same time.
One DMA register set corresponds to one transfer channel for DMA transfer performed by the DMA controller 120. The buffer start address register 1201 holds the initial address of a storage area of the stream buffer 130 assigned to the corresponding transfer channel, and the buffer end address register 1202 holds an address just before the end address. The buffer write address register 1203 holds an address at which data are written into the buffer next, and the buffer read address register 1204 holds an address at which data are read from the buffer next, so that they are updated to indicate the next addresses for each of data writing and data reading. If the update allows the address to match the address held by the buffer end address register 1202, the address is restored to the address held by the buffer start address 1201.
The memory base address register 1205 holds the initial address of a source area or a destination area of the memory 350. The memory offset register 1206 holds difference between the next reading or writing address of the memory 350 and the value held by the memory base address register 1205. They are updated so as to indicate the next addresses every time reading or writing is performed on the corresponding transfer channel from/into the memory 350.
The maximum offset address register 1207 indicates the maximum allowable value held by the memory offset register 1206. In the case where the value of the memory offset register 1206 matches the maximum offset address register 1207, and then, a reading or writing process from/into the memory 350 occurs on the corresponding channel, the channel is stopped to notify the stream processing processor 180 and the host processor 200. This function can limit available areas of the memory 350 for each transfer channel of DMA, and realizes protection of the content of the memory 350.
The status flag register 1208 holds an operation status and a transfer direction of the corresponding transfer channel, and a buffer full status of an area assigned to the stream buffer 130.
In
In
Address mapping to the instruction memory space 6160 is alternately switched between the double buffer area C161 and the double buffer area D162 every time a process of one data stream is completed by the stream processing processor 180. For example, on the condition that the double buffer area C161 is assigned to addresses 00000-08000 and the double buffer area D162 is assigned to addresses 08000-10000, when the stream processing processor 180 executes a program in the double buffer area C161 with the addresses 00000-08000, another program used for the next stream process is stored into the double buffer area D162 in advance. At the time the execution of the program in the double buffer area C161 is completed, the mapping of the double buffer area D162 is switched to the addresses 00000-08000 and the mapping of the double buffer area C161 is switched to the addresses 08000-10000, so that the stream processing processor 180 can execute the program in the double buffer area D162 in the next stream process with the addresses 00000-08000. As described above, if a program being used for a process of one data stream is stored in one of the areas, the content of the other area can be rewritten during the process of the data stream, the data stream process performed by the stream processing processor 180 and the writing process of a program for the next data stream process can be simultaneously performed. The fixed area B163 is an area into which a program (subroutine) commonly used for various data stream processes is stored. A logic for alternate switching of the address mapping is held by, for example, the instruction memory, and a switching instruction may be issued in accordance with the processing state of the control stream and the processing state of the stream processing processor 180. In addition, the fixed area B163 is not possibly present in some configuration, and when it is not necessary to replace a program for each data stream, the double buffer area C161 and the double buffer area D162 are not necessary.
In
The data memory 170 is mapped only at a part of the data memory space 6170 in consideration of future extension. A double buffer area A171, a double buffer area B172, and a fixed area A173 are present in the data memory 170.
Address mapping to the data memory space 6170 is alternately switched between the double buffer area A171 and the double buffer area B172 every time a process of one data stream is completed by the stream processing processor 180. Accordingly, if a parameter being used for a process of one data stream is stored in one of the areas, the content of the other area can be rewritten during the process of the data stream, and the data stream process performed by the stream processing processor 180 and the writing of another parameter for the next data stream process can be simultaneously performed. The switching of the address mapping may be performed in the same manner as the case of the instruction memory 160.
The fixed area A173 is used as a working data memory necessary for various data stream processes. The fixed area A173 is not possibly present in some configuration, and when it is not necessary to replace a parameter for each data stream, the double buffer area A171 and the double buffer area B172 are not necessary.
The stream buffer 130 is mapped only at a part of the stream buffer space 6130 in consideration of future extension of the stream buffer 130. Although the size of the assigned buffer area is limited by mapping the stream buffer 130 to the memory space for data reading/writing of the stream processing processor 180, it is possible to randomly access the stream data within the range. A bunch of data are locally present in some cases, so that it is convenient if the local part where a bunch of stream data are present is randomly accessible from the stream processing processor 180. For example, this configuration can be used in application in which after a latter half of data is preliminarily produced within a randomly-accessible range, a former part of data is produced, or in which a stream is partially produced and outputting of the produced data is cancelled.
The stream buffer 130 is used while being divided into a plurality of areas, and is used while allowing the transfer channel of the DMA controller 120 to correspond to each area. Specifically, addresses ranging from the address specified in the buffer start address register 1201 of the DMA register set to the address just before the buffer end address register 1202 correspond to one area of the stream buffer 130. The stream buffer space 6130 is divided into spaces for transfer channels of DMA, and the areas of the stream buffer 130 used in the respective transfer channels are mapped to the respective divided spaces.
Focusing on an area of the stream buffer 130 assigned to one transfer channel,
In the case where data are directly read or written from/into the stream buffer 130 by the stream processing processor 180 using the stream buffer space 6130, it is necessary to manage a buffer management pointer of the DMA transfer channel corresponding to the target buffer where the data are directly read or written by using a part of a program operated by the stream processing processor 180.
In the transfer channel where the input stream process is performed, it is necessary to confirm that necessary and sufficient data are already read into the stream buffer 130 before referring the data. The following data in the stream have to be read after all the processes which refer the data in the stream buffer 130 are completed. The buffer full flag 1293, the buffer write address register 1203, and the buffer read address register 1204 of the DMA transfer channel are used to confirm whether the data are already read. The next data in the stream is read when the value of the buffer read address register 1204 of the DMA transfer channel is updated by adding the length of data which are already referred. However, in the case of the value of the buffer read address register 1204 subsequent to the value of the buffer end address register 1202, the value is subtracted by the result of subtraction the value of the buffer start register 1201 from that of the buffer end address register 1202. The buffer full flag 1293 is updated at the same time the buffer read address register 1204 is updated.
In the transfer channel where the output stream process is performed, it is necessary to confirm that a necessary and sufficient space is spared in the stream buffer 130 before writing. After the writing process into the stream buffer 130 is completed, the data have to be write to the stream. The buffer full flag 1293, the buffer write address register 1203, and the buffer read address register 1204 of the DMA transfer channel are used to confirm whether a necessary and sufficient space is spared in the stream buffer 130. The stream is continuously written when the value of the buffer write address register 1203 of the DMA transfer channel is updated by adding the length of the data to be written. However, in the case of the value of the buffer write address register 1203 subsequent to the value of the buffer end address register 1202, the value is subtracted by the result of subtraction the value of the buffer start register 1201 from that of the buffer end address register 1202. The buffer full flag 1293 is updated at the same time the buffer write address register 1203 is updated.
In
In
The boundary flag field 6100 is a flag used for showing the last control command of one control command group. In the case of the last control command of one control command group, 1 is specified, and 0 is specified otherwise. The number of control commands configuring one control command group varies, so that the control stream analysis unit 150 refers to the boundary flag field 6100 to determine the last of one control command group.
The command type field 6200 is a field used for specifying a command type, and specifies a value for specifying the function of the control command. The control stream analysis unit 150 determines the content of a process and a parameter configuration included in the control command on the basis of the value of the command type field 6200.
The parameter field 6300 is a field used for storing a parameter configuring a command, and the meaning of the parameter field 6300 differs depending on the value of the command type field 6200.
In
A command type 0 has a function of, when processing the stream corresponding to the control command group belonging to the command header, specifying an address into which the target input stream is stored. The control command header of the command type 0 has a configuration shown in
A reserved area is an area being not used. An input stream group ID is specified in an input stream group ID field 6301. In the command type 0, it is necessary to specify a first control parameter 7226, and an input stream address field 6305 is present in the first control parameter 7226. In the input stream address field 6305, the address at which the target input stream is stored is specified. The address is an address in the address space shown in
The input stream group ID is an identification number of each input stream, and is used when identifying each input stream in the case where one set of input streams to be simultaneously referred to in the stream process includes a plurality of input streams. When the control stream analysis unit 150 processes the control command, assignment of the DMA transfer channel used for inputting the input stream is determined, so that the stream processing processor 180 can correctly refer to the input stream to be referred to at the time of processing.
In the case where one set of input streams to be simultaneously referred to in the stream process includes a plurality of input streams, all input streams are specified by using a plurality of command types 0 in which the input stream group IDs are different from each other in one control command group. In the case where one set of input streams to be simultaneously referred to includes a single input stream, 0 is usually specified in the input stream group ID.
The control command header of a command type 1 has a configuration shown in
In the command type 1, “1” is specified into the command type field 6200. A maximum stream length field 6312 is a field for specifying the size limit of the input stream. A value set in the maximum stream length field 6312 is written by the control stream analysis unit 150 into the maximum offset address register 1207 existing in the DMA register set of the transfer channel of the corresponding input stream. By specifying the maximum stream length, a memory area can be limited for each input stream, and the memory can be protected. Further, even in the case where the process is not normally performed because a part of an input stream is corrupted and the last part of the input stream can not be determined, the DMA controller 120 notifies the stream processing processor 180 at the time of processing the input stream by a specified length or larger in the maximum stream length, so that it is possible to avoid the risk of not terminating the process.
The control command header of a command type 4 has a configuration shown in
In the command type 4, “4” is specified in the command type field 6200. The length of data to be written is specified in a data length field 6311. The length is specified as the number of words, each word having 32 bits. However, the unit of length specification may be changed in accordance with a system. In the command type 4, the first control parameter has a data destination address field 6315. In the data destination address field 6315, the address corresponding to the address space shown in
Data to be written in the command type 4 are sequentially stored by the number specified in the data length field 6311 in the second control parameter and the control parameters subsequent to the second control parameter.
Setting of a destination of the output stream is also performed using the control command of the command type 4. In the command type 4, a parameter can be written in an arbitrary area of the data memory 170. Accordingly, if an address where the destination address of the output stream is stored in the data memory 170 is determined in advance, the destination address is written into the address using the control command of the command type 4, and the DMA control register existing in the DMA controller 120 is set by referring to the destination address with a program operated by the stream processing processor 180, the output stream can be written into the specified address.
The setting of the destination of the output stream and the DMA control register is performed by the program operated by the stream processing processor 180, so that the degree of freedom is high in an output stream outputting method. For example, the processing results relating to one set of plural input streams to be simultaneously referred to can be integrated into one output stream, or one input stream can be output by being divided into plural output streams for each type of information included in the stream. In addition, the processing results of the input streams specified by different control command groups can be output as one continuous output stream.
The division of one input stream into plural output streams for each type of information included in the stream is effective in a decoding process of image codec such as MPEG-2. At the time of decoding of the image codec, a process of converting a coefficient such as an iDCT process and a process of reading a reference image from an already-decoded image on the basis of a motion vector can be executed in parallel. The coefficient such as the iDCT process and the motion vector information are included in the input stream. Accordingly, if these parameters are converted into formats which are easily used in the iDCT process and the motion vector process by the stream processing apparatus 100, and the respective parameters are output as different streams, the iDCT process and the process of reading the reference image on the basis of the motion vector can be easily executed in parallel.
The input stream can not be started to be processed by the stream processing processor 180 during a period from the time when data are read from the memory 350 after the corresponding transfer channel is started to be operated in the DMA controller 120 to the time when the read content is written into the stream buffer 130. However, the output stream can be written into the stream buffer 130 after the DMA controller 120 is set. Accordingly, even if the setting of the DMA control register is performed for the output stream by the stream processing processor 180, the processing performance of the stream processing apparatus 100 is less affected.
In
Before using the stream processing apparatus 100, an initializing process of the stream processing apparatus 100 is performed by the host processor 200 in the first place (TR1). It is necessary to assign the area of the stream buffer 130 to the DMA transfer channel by setting the DMA control register. In addition, an initial program and a subroutine that is commonly used in performing the stream process are written into the instruction memory 160, and a parameter that is commonly used is written into the data memory 170, if needed.
Next, the control stream 700 necessary for processing the input stream stored in the memory 350 is generated by the host processor 200. If the generation of the control stream 700 is completed, the address of the control stream 700 is written into a register for specifying the initial address of the control stream 700 existing in the control register 140. This operation allows the stream processing apparatus 100 to start. When the address of the control stream 700 is written into the register for specifying the initial address of the control stream 700, the address is once written into the control stream address queue 155. If the control stream analysis unit 150 does not process the control stream 700 in a state where one or more addresses are held in the control stream address queue 155, the control stream analysis unit 150 initializes the DMA register set corresponding to the DMA transfer channel of the control stream 700, starts to read the control stream 700, and starts to process the control stream 700 (TR2).
The control stream analysis unit 150 proceeds to process in accordance with the control stream 700, and sets the DMA transfer necessary for reading the input stream at the time information necessary for reading the input stream is prepared to start reading of the input stream (TR3). Then, the stream process performed by the stream processing processor 180 is started at the time all the processes of one control command group are completed (TR4). At this time, information of the DMA transfer channel being used for reading the input stream is transmitted to the stream processing processor 180, and information of the DMA transfer channel available for outputting the output stream is also transmitted to the stream processing processor 180. In order to simultaneously output a plurality of output streams if needed, the predetermined number of channels as the DMA transfer channels available for outputting the output streams in the stream processing apparatus 100 is transmitted to the stream processing processor 180 as the DMA transfer channels available for outputting the output streams.
At the same time when the stream process is started by the stream processing processor 180, the control stream analysis unit 150 starts to process the next control command group (TR5). At this time, assignment of the double buffer areas used for writing into the instruction memory 160 and the data memory 170 with the control command is inverted so as not to affect on the process performed by the stream processing processor 180. By proceeding to process the next control command group, a program necessary for the process of the next input stream is written into the instruction memory 160, and a parameter is written into the data memory 170. In addition, setting of a register for DMA control necessary for reading the next input stream is also performed. At this time, DMA transfer channels other than those being used for reading the current input stream and those available for outputting the output stream, which are notified to the stream processing processor 180, are used.
At the time the process of the control command group corresponding to the next input stream is completed, the control stream analysis unit 150 starts the DMA transfer channel to be used for reading the next input stream, and starts the input stream in advance (TR6). At this time, in the case of a process of referring to a plurality of input streams, all the necessary input streams are read in advance.
At the time the process of the next control command group is completed and the process of the input stream executed by the stream processing processor 180 is completed, the control stream analysis unit 150 inverts the assignment of the double buffer areas of the instruction memory 160 and the data memory 170 viewed from the stream processing processor 180, notifies the stream processing processor 180 of the DMA transfer channel being used for reading the next input stream, and notifies the stream processing processor 180 of the DMA transfer channel available for outputting the output stream at the time of processing the next input stream. Then, the stream processing processor 180 is started again. At the time the stream processing processor 180 is started, reading of the initial portion of the input stream is completed and a program and a parameter are prepared, so that the stream processing processor 180 can immediately start the process (TR7).
Thereafter, the same process is repeated until the process of the last control command group of the control stream 700 is completed, so that the stream processing processor 180 can process without stopping.
During the operation of the stream processing apparatus 100, the next control stream 700 can be specified by the control stream address queue 155. It is necessary to generate the control stream 700 in a state where the input stream is stored in the memory 350. Even when the stream processing apparatus 100 is being operated, a new input stream is input from the input/output apparatus 400 to be stored into the memory 350 in some cases. In such a case, if the next control stream 700 is generated by the host processor 200 and is written into the register for specifying the initial address of the control stream 700 existing in the control register 140 even when the stream processing apparatus 100 is being operated, the address of the next control stream 700 can be stored into the control stream address queue 155, and the control stream analysis unit 150 can continuously process a plurality of control streams 700.
In the above description, the stream processing apparatus 100 is shown as one apparatus. However, the stream processing apparatus 100, the host processor 200, the memory control apparatus 300, and the input/output apparatus 400, and the bus 500 may be realized as a semiconductor device obtained by integrating them onto one semiconductor substrate.
In
The control command header of the command type 2 has a configuration shown in
In the command type 2, 2 is specified in the command type field 6200. The length of data to be written is specified in the data length field 6311. The length is specified as the number of words, each word having 32 bits. In the command type 2, the first control parameter has the data destination address field 6315. In the data destination address field 6315, the address corresponding to the address space shown in
In the command type 2, the second control parameter has a sub-control stream address field 6313. An initial address at which the sub-control stream 706 is stored is specified in the sub-control stream address field 6313. This address is the address in the address space shown in
The content of the sub-control stream 706 is a data string to be written into the instruction memory 160, the data memory 170, or the control register 140 in the command type 2. Accordingly, it is necessary to prepare the sub-control streams 706 corresponding to the types of programs which are written into the instruction memory 160 using the command type 2, or corresponding to a bunch of data to be written into the data memory 170.
When the control stream analysis unit 150 processes the control command of the command type 2, the control stream analysis unit 150 initializes and starts the DMA transfer channel assigned for reading the sub-control stream 706, and the content of the sub-control stream 706 is transferred to the instruction memory 160, the data memory 170, or the control register 140 by the DMA controller 120. After waiting for completion of the transfer of the sub-control stream 706, the control stream analysis unit 150 processes the next control command.
Due to the data transfer of the sub-control stream 706, it is necessary to have one more DMA transfer channel as compared to the case of
Using the command type 2 makes it easy, especially, to handle a program to be written into the instruction memory 160, as compared to generation of the control stream 700 only with the command type 4. In general, the format of an input stream to be handled is complied with a specification and a standard, so that the type of a program necessary in the stream process can be limited. In the case of using the command type 4, it is necessary to generate the control stream 700 by, for example, copying a data string corresponding to a program in the command stream for each control command group. However, in the case of using the command type 2, if a necessary program is stored in a predetermined area in advance, the initial address at which the program is stored may be specified by the command type 2. Accordingly, it is not necessary to copy the data string corresponding to the program, and the process of the host processor 200 and access to the memory 350 can be reduced.
The stream processing apparatus of the present invention can be applied to generation of a stream obtained by coding an image, sound, and the like, and to decoding of a stream obtained by coding an image, sound, and the like. There is a coding standard in each of an image and sound, and there are a plurality of coding standards in each of an image and sound. The stream processing apparatus of the present invention can be also used for encryption of various data streams containing a stream obtained by coding an image and sound and a decryption process of the encrypted data stream. There are many devices such as a digital television and a DVD capable of handling image/sound streams and encrypted streams. The stream processing apparatus in these devices needs to perform stream processes with various standards, and it is necessary to change a processing program and a parameter in accordance with the standard to which the stream belongs. The stream processing apparatus of the present invention allows the stream processing processor to continuously and efficiently process the streams in various formats while changing the program and the parameter, and many stream processes can be performed using the stream processing processors with the same performance.
The invention achieved by the inventor has been described in detail on the basis of the embodiment. However, it is obvious that the present invention is not limited to the embodiment, but can be variously changed in a range without departing from the gist of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2007-308347 | Nov 2007 | JP | national |