Integrated static and dynamic companding

Abstract: A memory module, a partial address generator, and a controllable pseudo-random number generator are provided to a digital video system for generating values used to perform static/dynamic companding for transfer functions shifting/modifying digital video data. The memory module is used for storing an integrated collection of lookup tables comprising lookup tables having values used to perform linear/non-linear static and dynamic companding. The values used to perform static/dynamic companding are retrieved using composite addresses. During each access, the higher order bits are generated by the partial address generator, and the lower order bits are set to equal the current digital video data value being shifted/modified. The partial address generator generates the higher order bits of the composite address based on a number of companding scheme selection control signals and a pseudo-random number received as inputs. The controllable pseudo-random number generator generates the pseudo-random numbers based on the current value of a digital video control counter. Additionally, in the presently preferred embodiment, a quantization error detector is also provided to generate the dynamic companding scheme selection control signals when quantization errors are detected, thereby controlling and causing dynamic companding to be performed only when it is necessary.

Description: The present invention relates to the field of digital video systems. More specifically, the present invention relates to static and dynamic companding performed on these digital video systems. In digital video systems, it is common to find digital video data being shifted/modified from one range to another, for example from 0 - 255 to 16 - 235, or from 0 - 255 to 1 - 254. The digital video data may be shifted/modified for a variety of reasons including, but not limited to, filtering. In the process of shifting/modifying digital data, rounding errors will occur. In the example of shifting/modifying data from 0 - 255 to 16 - 235, the 8-bit output data would be computed from the transfer function Data_out = Truncated (Data_in x (219/255) + 16). Data_out would be 16 for both Data_in = 0 and Data_in = 1; Data_out would be 22 for both Data_in = 7 and Data_in = 8; etc. Very often dynamic companding or rounding will be employed to minimise the impact of rounding errors, a phenomenon which can manifest itself as visual banding. Dynamic companding is a process that varies quantisation ranges in order to mask the rounding errors, or visual banding, by rounding up or rounding down based on probability, rather than simply truncating. Such companding is described in, for example EP-A-0 345 977 and EP-A-0 270 259. The latter describes requantising 16-bit colour signals into 8-bit signals with the LSB being dithered by comparing the low bits of the original signal with a pseudo-random number. However, there is a tradeoff in usual dynamic companding to ameliorate the rounding error situation. Random noise is introduced into the video image as a result of rounding up or down based on probability. The additional random noise can reduce the clarity of the image, as an entire frame will have additional noise. Additionally, traditional dynamic companding or rounding approaches are typically uncontrollable. That is, identical dynamic companding, though random within a defined intra-frame area, cannot be identically replicated on another similar area. Therefore, the additional random noise also reduces the quality of the image as a result of their inter-frame independence. Thus, it is desirable if the digital video system would dynamically round the digital video data only when necessary (as rounding errors occur horizontally or vertically adjacent to each other). Furthermore, it is desirable if the dynamic companding is controllable within a horizontal line, an infra-frame area or a frame. Then, the rounding error situation can be ameliorated with minimal compromises to the video quality of the video image. While dynamic companding is often used to minimise the rounding errors, or visual banding, depending on the application, there are times linear or non-linear static companding may be more suitable to ameliorate the rounding error situation. Static companding is a process that varies quantisation ranges in order to mask the rounding errors, or visual banding, by rounding up or rounding down based on a predetermined manner. Thus, it is desirable if the digital video system can support multiple linear/non-linear static companding schemes and dynamic companding schemes in an integrated manner. As will be disclosed, the present invention provides a method and apparatus for selectively performing controllable dynamic companding, and linear/non-linear static companding in a digital video system that achieves the above-described desirable results. According to the present invention, there is provided a digital video system comprising an apparatus for selectively performing static and dynamic companding on a plurality of digital video data by using a plurality of transfer functions for shifting/modifying said digital video data from a first plurality of data ranges to a second plurality of corresponding data ranges, said apparatus comprising: (a) memory means (16) for storing an integrated collection of lookup tables (24a-24d, 26a-26ff) having values used to perform static and dynamic companding according to said transfer functions, said values used to perform static and dynamic companding being accessed using composite addresses, each of said composite addresses comprising a plurality of bits; (b) partial address generation means (14) coupled to said memory means (16) for receiving a plurality of static/dynamic companding scheme selection control signals and controllable pseudo-random numbers as inputs, and generating a plurality of higher order bits for each of said composite addresses, the remaining lower order bits for each of said composite addresses being set correspondingly to equal said digital video data by a processor of said digital video system coupled to said memory means (16); (c) companding scheme selection control signal generation means (14) coupled to said partial address generation means for generating said companding scheme selection control signals; and (d) pseudo-random number generation means (12) coupled to said partial address generation means (14) for receiving values of a video control counter, and generating said controllable pseudo-random numbers, said generated controllable pseudo-random numbers being replicable within a specified area of a video image controlled by said video control counter. A corresponding method as defined in claim 12 is also provided. Thus, the invention can selectively perform controllable dynamic companding, and linear/non-linear static companding in a digital video system in an integrated manner. Under the disclosed method and apparatus, both dynamic and static companding are advantageously supported. Furthermore, dynamic companding is controllable, and static companding may include linear as well as non-linear static companding. The advantageous results are achieved by providing the memory module, the partial address generator, and the controllable pseudo-random number generator to the digital video system for generating companding values of digital video data being shifted/modified, regardless of whether the digital video data are being shifted/modified by linear or non-linear static companding or dynamic companding. The lookup tables may have values used to perform linear/non-linear static companding. For each set of lookup tables having values used to perform dynamic companding, the values used to perform dynamic companding for a particular digital video data value, reflecting the weighted probabilities of rounding in the up or down direction, may be randomly dispersed among the lookup tables in the set. The values used to perform static/dynamic companding are retrieved using composite addresses. The higher order bits of a composite address may identify a particular lookup table in the collection, and the lower order bits of the composite address identify a particular value within the identified lookup table. If the companding scheme selection control signals select a particular lookup table having values used to perform static companding, the static companding scheme selection control signals may be outputted as the higher order bits of the composite address. On the other hand, if the companding scheme selection control signals select a particular set of lookup tables having values used to perform dynamic companding, the pseudo-random number may be outputted as the higher order bits of the composite address. The controllable pseudo-random number generator generates the pseudo-random numbers for the partial address generator based on the current value of a digital video control counter it received as input. Thus, the pseudo-random number sequence is replicated whenever the video control counter is reinitialised to a predetermined value, e.g. zero, and the shift register set in the pseudo-random number generator is reset to a predetermined state e.g. a zero state. Thus, the same dynamic companding may be replicated for different instances of the video image area controlled by the video control counter. In one embodiment, the controllable pseudo-random number generator generates the pseudo-random numbers based on the horizontal pixel counter. The pseudo-random number sequence is replicated whenever the horizontal pixel counter is reinitialised to zero for a new horizontal line, and the shift register set in the pseudo-random number generator is reset to a zero state. As a result, the same dynamic companding is replicated for each horizontal line of the video image. Additionally, in the presently preferred embodiment, a quantization error detector is also provided to the digital video system to provide the dynamic companding scheme selection control signals to the partial address generator. The quantization error detector provides the dynamic companding scheme selection control signals when quantization errors are detected, thereby controlling and causing dynamic companding to be performed for a particular data shift/modification only when it is necessary. The static companding scheme selection control signals are provided by the processor of the digital video system. The invention will be further described, by way of example only, in the following detailed description of the presently preferred and alternate embodiments of the invention, with reference to the drawings, in which:- Figure 1 illustrates one embodiment of the present invention for integrated linear/non-linear static and controllable dynamic companding. Figure 2 illustrates the integrated collection of lookup tables of the present invention for the embodiment illustrated in Figure 1, and accessing these lookup tables. Figure 3 illustrates an accessed lookup table and accessing its values used to perform static/dynamic companding. Figure 4 illustrates how the partial address generator of Figure 1 generates the higher order bits of the composite access address. A method and apparatus for selectively performing controllable dynamic companding, and linear/non-linear static companding in a digital video system in an integrated manner is disclosed. Under the disclosed method and apparatus, both dynamic and static companding are advantageously supported. Furthermore, dynamic companding is controllable, and static companding includes linear as well as non-linear static companding. In the following description for purposes of explanation, specific numbers, materials and configurations are set forth in order to provide a thorough understanding of the present invention. However, it will be apparent to one skilled in the art that the present invention may be practiced without the specific details. In other instances, well known systems are shown in diagrammatical or block diagram form in order not to obscure the present invention unnecessarily. Referring now to Figure 1 , a block diagram illustrating one embodiment of the present invention for integrated linear/non-linear static and controllable dynamic companding is shown. Shown is a memory module 16 coupled to a partial address generator 14 . The partial address generator 14 is in turn coupled to a quantization error detector 18 , and a controllable pseudo-random number generator 12 . Together, they cooperate to provide values used to perform static/dynamic companding for digital video data being shifted/modified. Each of these elements 12 - 18 and the manner they cooperate with each other will be described in order with periodic additional references to the remaining figures. The memory module 16 will first be described with additional references to Figures 2 - 3 . The memory module 16 is used for storing an integrated collection of lookup tables 20 comprising a plurality of lookup tables 24a - 24d having values used to perform linear/non-linear static companding, and at least one set of lookup tables 26a - 26ff having values used to perform dynamic companding. In this embodiment, the collection of lookup tables 20 comprises four lookup tables 24a - 24d having values used to perform linear/non-linear static companding, and a set of thirty-two lookup tables 26a - 26ff having values used to perform dynamic companding. Each of the four lookup tables 24a - 24d having values used to perform linear/non-linear static companding provides eight-bit values to perform static companding for a particular data shifting/modifying function of eight-bit digital video data. In each of the four cases, rounding is performed in a deterministic manner. The set of thirty-two lookup tables 26a - 26ff having values used to perform dynamic companding collectively provides eight-bit values to perform dynamic companding for a particular data shifting/modifying function of eight-bit digital video data. In this case, rounding is performed in a stochastic manner. For example, the first lookup table 24a having values used to perform static companding may provide values to perform linear static companding for digital video data being shifted/modified from 0 - 255 to 1 - 254 with rounding performed in a deterministic manner; the second lookup table 24b may provide a gamma type curve with distributed values to perform non-linear static companding for digital video data being shifted/modified from 0 - 255 to 16 - 235 with rounding also performed in a deterministic manner; etc. etc.; and the set of thirty-two dynamic companding look-up tables 26a - 26ff having values used to perform dynamic companding may provide values to perform dynamic companding for digital video data being shifted/modified from 0 - 255 to 16 - 235 with rounding performed in a stochastic manner. While the present invention is being described with an embodiment comprising four lookup tables having values used to perform static companding and one set of thirty-two lookup tables having values used to perform dynamic companding, based on the description to follow, it will be appreciated that the present invention may be practiced with additional lookup tables having values used to perform static companding as well as larger set and/or additional sets of lookup tables having values used to perform dynamic companding, provided other aspects of the present invention such as the size of the accessing composite address, and the number of companding scheme selection control signals are adjusted accordingly. Still referring to Figures 1 - 3 , in this embodiment, the values used to perform static/dynamic companding are accessed using composite addresses of thirteen bits. The five higher order bits of a composite address identify a particular lookup table, 24a ,... or 26ff , and the eight low order bits identify a value used to perform static/dynamic companding within the identified lookup table, 24* or 26* . The higher order bits are generated by the partial address generator 14 , and the lower order bits are set to equal the digital video data by the processor of the digital video system. The higher order bits are generated in such a manner that each of the lookup table within the set of lookup tables having values used to perform dynamic companding has an equal probability of being accessed when values used to perform dynamic companding are accessed. The partial address generator 14 and generation of the higher order bits will be described in further detail later. The values stored in the set of lookup tables 26a - 26ff to perform dynamic companding for a particular digital video data value reflect the weighted probabilities of rounding the shifted/modified digital video data value in either the up or down direction. These weighted probabilities are determined by the fractional value of the digital video data value being shifted/modified. For example, for the shifted/modified value of an exemplary input value of 10 in the above described example of shifting/modifying digital video data from 0-255 to 16-235, the weighted probability of rounding up is 59% (Fraction(10x219/255)), and the weighted probability of rounding down is 41% (1-Fraction(10x219/255)). The number of values rounding a shifted/modified digital video data value up or down are in turn determined by dividing the weighted probabilities with the lookup table access probability (3.125% or 1/32 for the set of 32 lookup tables in this embodiment). In other words, in the set of 32 lookup tables in this embodiment, for the exemplary digital video data value of 10 in the above described example, there are 19 values rounding the shifted/modified value up (19/32 ≅ 59%), and 13 companding values rounding the shifted/modified value down (13/32 ≅ 41%). The values are randomly dispersed among the lookup tables in the set, so as to be more true to the determined probability. One particular approach for achieving these characteristics is to store the values used to perform dynamic companding in the lookup tables, 26a - 26ff , by comparing a value X to a value Y, where X is the fractional value of n/N, and Y is the fractional value of the shifted/modified digital video data, n being a randomly selected integer between 1 and N, where the random selection is made without replacing the selected integers, and N being the number of lookup tables in the set. Thus, for the set of 32 lookup tables in this embodiment, N equals 32, and n is a randomly selected integer between 1 and 32. If X is greater than Y, a shifted/modified digital video data value having been rounded down is substituted. On the other hand, if X is less than or equal to Y, a shifted/modified digital video data value having been rounded up is substituted. For example, assume that the integer n for one of the 32 lookup tables is 3, the value X is 0.09375 (3/32). Therefore, the value stored in the lookup table for the exemplary value of 10 of the above described example is the shifted/modified value having been rounded up, i.e. the value of 25, since X is smaller than Y, Y being equal to 0.59 (Fraction (10 x 219/255)). On the other hand, if the integer n for the lookup table is 30, the value X is 0.9375 (30/32). Therefore, the value stored in the lookup table for the exemplary value 10 of the above described example is the shifted/modified value having been rounded down, i.e. the value 24, since X is greater than Y. Referring now to Figures 1 and 4 , the partial address generator 14 will now be described. As described earlier, the partial address generator 14 generates the higher order bits of the composite addresses for accessing the values of the lookup tables stored in the memory module 16 . For the embodiment illustrated in Figure 1 , the partial address generator 14 generates the five higher order bits based on a number of companding scheme selection control signals and a pseudo-random number it received as inputs. The partial address generator 14 receives a one-bit dynamic companding scheme selection control signal (dynamic rounding enable (DRE)) from the quantization error detector 18 , a two-bit static companding scheme selection control signal (B〈0〉 and B〈1〉) from the processor of the digital video system, and a five bit pseudo-random number (PRN〈0〉 - PRN〈4〉) from the pseudo-random number generator 12 . As illustrated in Figure 4 , if DRE is set to enable, the partial address generator 14 outputs the pseudo-random number as the higher order bits, i.e. A<9> - A<13> equal PRN<0> - PRN<4> respectively, otherwise, it outputs the padded static companding scheme selection control signal as the higher order bits i.e. A<9> - A<13> equal B<0>, B<1>,000 respectively. In the presently preferred embodiment, the partial address generator 14 is implemented with a field programmable gate array (FPGA) which is well known in the art and will not be described further. Alternatively, the partial address generator 14 may be implemented with other circuitry providing equivalent functions. Referring now to Figure 1, the quantisation error detector 18 will be described. In this embodiment, the quantisation error detector 18 generates the DRE signal for the partial address generator 14. The quantisation error detector 18 generates the DRE signal whenever it detects a potential companding error based on the 8-bit digital video data it received as inputs, thereby controlling and causing dynamic companding to be performed only when it is necessary. The quantisation error detector 18 is intended to represent a broad category of quantisation error detectors. E.g. Such a quantisation error detector generates a DRE signal when various value adjacency conditions, including but not limited to value adjacency in the horizontal and vertical dimensions of pixel adjacency, are detected. Additionally, while the present invention is being described with the dynamic companding scheme selection signal provided by a quantisation error detector, it will be appreciated that the present invention may be practised with the dynamic companding scheme selection signals provided in other manners. Still referring to Figure 1, the controllable pseudo-random number generator 12 will be described. The controllable pseudo-random number generator 12 generates the pseudo-random number based on the current value of a video control counter, thereby allowing the pseudo-random numbers and in turn the dynamic companding performed to be replicated within a particular area of the video image controlled by the video control counter. Particular examples of video control counter include a horizontal pixel counter, a line counter, a frame counter and a field counter. In this embodiment, the video control counter used is a 5-bit horizontal pixel counter. The 5-bit pseudo-random numbers are generated based on the current value of the 5-bit horizontal pixel counter, thereby allowing the pseudo-random numbers and in turn the dynamic companding performed to be replicated within a horizontal line of the video image. The controllable pseudo-random number generator 12 is intended to represent a broad category of controllable pseudo-random number generators.

Claims: A digital video system comprising an apparatus for selectively performing static and dynamic companding on a plurality of digital video data by using a plurality of transfer functions for shifting/modifying said digital video data from a first plurality of data ranges to a second plurality of corresponding data ranges, said apparatus comprising: (a) memory means (16) for storing an integrated collection of lookup tables (24a-24d, 26a-26ff) having values used to perform static and dynamic companding according to said transfer functions, said values used to perform static and dynamic companding being accessed using composite addresses, each of said composite addresses comprising a plurality of bits; (b) partial address generation means (14) coupled to said memory means (16) for receiving a plurality of static/dynamic companding scheme selection control signals and controllable pseudo-random numbers as inputs, and generating a plurality of higher order bits for each of said composite addresses, the remaining lower order bits for each of said composite addresses being set correspondingly to equal said digital video data by a processor of said digital video system coupled to said memory means (16); (c) companding scheme selection control signal generation means coupled to said partial address generation means (14) for generating said companding scheme selection control signals; and (d) pseudo-random number generation means (12) coupled to said partial address generation means (14) for receiving values of a video control counter, and generating said controllable pseudo-random numbers, said generated controllable pseudo-random numbers being replicable within a specified area of a video image controlled by said video control counter. A digital video system as set forth in claim 1, wherein said integrated collection of lookup tables comprises four lookup tables (24a-d) having values used to perform linear/non-linear static companding for a first to fourth transfer function for shifting/modifying said digital video data from an input data range to a first to fourth corresponding data range, and a set of thirty-two lookup tables (26a-26ff) having values used to perform dynamic companding for a fifth transfer function for shifting/modifying said digital video data from said input data range to a fifth data range; each of said digital video data and said values used to perform static and dynamic companding are 8-bits in size; each of said composite addresses are 13-bits in size with the five higher order bits being generated by said partial address generation means (14), and the eight lower order bits being set to equal said digital video data by said processor of said digital video system. A digital video system as set forth in claim 1, wherein each of said composite addresses are 13-bits in size with the five higher order bits being generated by said partial address generation means (14), and the eight low order bits being set to equal said digital video data by said processor of said digital video system; each of said dynamic companding scheme selection control signals is one bit in size; and each of said controllable pseudo-random numbers being five bits in size. A digital video system as set forth in claim 1, 2 or 3, wherein said partial address generation means (14) comprises a field programmable gate array coupled to said companding scheme selection control signal generation means, said pseudo-random number generation means (12) and said memory means (16), for receiving said static/dynamic companding scheme selection control signals from said companding scheme selection control signal generation means, and pseudo-random numbers from said pseudo-random number generation means (12) as inputs, and generating the five higher order bits of each of said composite addresses for said memory means (16). A digital video system as set forth in claim 1, 2, 3 or 4, wherein said companding scheme selection control signal generation means comprises quantisation error detection means (18) coupled to said partial address generation means (14) for receiving said digital video data, and conditionally generating the dynamic companding scheme selection control signals of said plurality of static/dynamic companding scheme selection control signals for said partial address generation means (14), said quantisation error detection means (18) generating one of said dynamic companding selection control signals whenever it detects a potential quantisation error based on said received digital video data. A digital video system as set forth in claim 5, wherein said quantisation error detection means (18) generates one of said dynamic companding scheme selection control signals whenever it detects a value adjacency condition in at least one of a horizontal and a vertical dimension of pixel adjacency based on said received digital video data. A digital video system as set forth in claim 5 or 6, wherein each of said dynamic companding scheme selection control signals is a one-bit enable signal. A digital video system as set forth in claim 5, 6 or 7, wherein said companding scheme selection control signal generation means comprises processor means of said digital video system coupled to said partial address generation means (14) for generating the static companding scheme selection control signals of said plurality of static/dynamic companding scheme selection control signals for said partial address generation means (14). A digital video system according to any one of claims 1 to 8, wherein each of said static companding scheme selection control signals is a two-bit signal. A digital video system as set forth in any one of the preceding claims, wherein said video control counter providing values to said pseudo-random number generation means (12) is a five-bit horizontal pixel counter providing horizontal pixel counts of a horizontal line of a video image to said pseudo-random number generation means (12). A digital video system according to any one of claims 1 to 10 and further comprising: processor means for processing a plurality of digital video data; digital video control counter means coupled to said processor for controlling an area of a video image; the memory means (16) and companding scheme selection control signal apparatus means being coupled to said processor means; and the pseudo-random number generation means (12) being coupled to said video control counter. A method for selectively performing static and dynamic companding on a plurality of digital video data by using a plurality of transfer functions for shifting/modifying said digital video data from a first plurality of data ranges to a second plurality of corresponding data ranges, said method comprising the steps of: (a) storing an integrated collection of lookup tables (20) comprising a plurality of lookup tables (24a-24d, 26a-26ff) having values used to perform static and dynamic companding according to said transfer functions, said values used to perform static and dynamic companding being accessed using composite addresses, each of said composite addresses comprising a plurality of bits; (b) selectively generating static and dynamic companding scheme selection control signals; (c) generating controllable pseudo-random numbers based on values of a video control counter, said generated controllable pseudo-random numbers being replicable within a specified area of a video image controlled by said video control counter; (d) generating higher order bits for each of said composite addresses based on said companding scheme selection control signals and said generated controllable pseudo-random numbers; (e) setting lower order bits of each said composite addresses correspondingly to equal said digital video data; and (f) accessing said values used to perform static and dynamic companding using said composite addresses. The method as set forth in claim 12, wherein said integrated collection of lookup tables (20) comprise four lookup tables (24a-d) having values used to perform linear/non-linear static companding for a first to fourth transfer function for shifting/modifying said digital video data from an input data range to a first to fourth corresponding data range, and a set of thirty-two lookup tables (26a-ff) having values used to perform dynamic companding for a fifth transfer function for shifting/modifying said digital video data from said input data range to a fifth data range; each of said digital video data and said values used to perform static and dynamic companding are eight bits in size; each of said composite addresses are thirteen bits in size with the five higher order bits being generated based on said static/dynamic companding selection control signals and pseudo-random numbers, and the eight low order bits being set to equal said digital video data. The method as set forth in claim 12, wherein each of said composite addresses are thirteen bits in size with the five higher order bits being generated based on said static/dynamic companding selection control signals and pseudo-random numbers, and the eight low order bits being set to equal said digital video data; each of said dynamic companding scheme selection control signals is one bit in size; and each of said controllable pseudo-random numbers being five bits in size. The method as set forth in claim 12, 13 or 14, wherein said step (d) comprises the steps of receiving one bit dynamic companding scheme selection control signals, two-bit static companding scheme selection control signals, and five-bit pseudo-random numbers as inputs, and generating the five higher order bits of each of said composite addresses. The method as set forth in claim 12, 13, 14 or 15, wherein said step (b) comprises the steps of receiving said digital video data, and conditionally generating the dynamic companding scheme selection control signals of said plurality of static/dynamic companding scheme selection control signals, each of said dynamic companding scheme selection control signals being generated whenever a potential quantisation error is detected based on said received digital video data. The method as set forth in claim 16, wherein each of said dynamic companding scheme selection control signals is generated when a value adjacency condition is detected in at least a horizontal and a vertical dimension of pixel adjacency based on said received digital video data. The method as set forth in claim 16, wherein each of said dynamic companding scheme selection control signals generated in said step (b) is a one-bit enable signal. The method as set forth in any one of claims 12 to 18, wherein each of said static companding scheme selection control signals generated in said step (b) is a two-bit signal. The method as set forth in any one of claims 12 to 19, wherein said video control counter upon which said pseudo-random numbers are generated in said step (c) is a five-bit horizontal pixel counter upon whose horizontal pixel counts of a horizontal line of a video image said pseudo-random numbers are generated in said step (c).

Inventors: HERZ WILLIAM, ROSSMERE DAVID, HERZ, WILLIAM, ROSSMERE, DAVID
Applicants: SONY ELECTRONICS INC, SONY ELECTRONICS INC.
Application year: 1993
Main classification: H04N7
IPC codes: H04N7, G06T5, H03M7