• 沒有找到結果。

Chapter 3 Design

3.2 False-overlap Detection by Approximate Method

3.2.3 Elimination by Table Lookup

For the sub BBoxes, we can use the height and width of a sub BBox to look up a differential table through a converter shown in Fig. 3-20 to know the difference of the numbers of false-overlap tiles between two adjacent rows. An example is shown in Fig. 3-21.

i

The differenceof the numbers of false-overlap tiles between two adjacent rows

1

i

Figure 3-21 Example of eliminating false-overlap tiles with differential table

Differential table

The differential table is pre-computed offline. Each field of an entry of the table records the difference of the numbers of false-overlap tiles between two adjacent rows. In the differential table, the first field of an entry means the difference between the row 0 and row 1 of a sub BBox, and so on. Here the row 0 is the first row in the sub BBox.

To reduce the number of entries of the differential table, we use three skills described as follows and apply i for antecedent and j for back tern to explain ratio :

(a) If i1:j1 = i2:j2, then these two ratios map to the same entry of the differential table.

Ex: 1:2 and 3:6 map to the same entry of table, as Fig.3-22(a) shown.

(b) If i1:j1 = j2:i2, these two ratios to the same entry of the differential table.

Ex: 2:1 and 1:2 map to the same entry of table, as Fig.3-22(b) shown.

(c) Adopt the approximation of the reciprocal of slope. Let the denominator d of the approximate ratio be a specific integer, such are 8, 16, 32, or 64, to approximate the original ratio. Then,

d

slopes, and thus the number of entries of the approximated table may be reduced to d (8, 16, 32, or 64). For example, 2:3, the ratio is

3

2. We can use 8

5 to represent it when the

denominator is 8. Since 8 5 3

2 =



× , as shown in Fig. 3-19(c). And Table 3-1 shows the

errors and and table sizes in different number of differential table entries.

Equation 3-1 is the mathematic equation of the inputs and outputs of the converter. Here i and j may excahnge to preserve that j is larger than i.

(3-1)

0 1 0 1

0 1

0 1

(a) (b) (c)

Figure 3-22 Example of differential table reduction. (a) 1:2 and 3:6 have the same differential of false-overlap tile pattern. (b) 2:1 and 1:2 have the same differential of false-overlap tile pattern. (c) 2:3, the ratio is

3

2. We can use 8 5

to represent it when the denominator is 8.

 

 

 ×

= entry number

j input

i input

output

index

_

_

_

Table 3-1 Error of different table entry. Screen size is 1200 x 1600, and tile size is 32 x 32 ( Field[0] ) of the entry in a differential table is the number of false-overlap tiles in the second row of the sub BBox as Fig. 3-23 shown. We let the larger one of the height and width of the sub BBox be the specific entry numbe and adjust the samller one to be index which come from the outputindex of equation 3-1. The Field[0] can be represent as equation 3-2. The second bit ( Field[1] ) of the entry is the difference of fasle-overlap tiles between row 1 and row 2.

And the number of false-overlap tiles in row 2 is the floor of double of

number entry

index

_ . Thus,

Field[2] can be represent as equation 3-3. The number of the false-overlap tiles in row n is the floor of n times of

number entry

index

_ . Therefore, Field[n-1] is as equation 3-4 shown.



8

4

8 0 4=



 1 8 2

4 =



 × 1 8 3

4 =



 × 3 8 7

4 =



×

...

Field[0]=0 Field[2]= 0

Field[1]= 1

Figure 3-23 Difference of false-overlap tiles between adjacent rows

Converter

The inputs of the converter are the width and height of a sub BBox, and the output is the index of the differential table. To reduce the complexity of circuit of the converter, we let i be the width of the sub BBox and j be the height, and exchange i and j to make j is larger than i.

When i and j are equal, we know that the difference of nubmer of false-overlap tiles in adjacent rows is one without table lookup. The circuit is as Fig.3-24.

i j

Index m Index 0 Index 1

...

Differential Table

Index n 1,1,1,....

...

0,1,1,....

...

0,0,1....

0,0,0,....

1,1,1,....

...

0,1,1,....

...

0,0,1....

0,0,0,....

k k

i

j

Figure 3-24 Circuit in front of Converter

Because the output of the converter is the index of the differential table, reducing the entries of the table also may simplify the complexity of the converter. The entry of the differential table records the difference of false-overlap tiles in adjacent rows for specific slope. And the differential table is pre-computed off-line. Table 3-2 is an example of the converter. The input i’and j’ in Table 3-2 are the inputs of converter as shown in Fig.3-21. We can use approximate ratio to approach i’/j’ and get the outputindex through the converter according to equation 3-1.

False-overlap Tiles Elimination

In presevered region, let the vertex on the hypotenuse with the smaller edge of the width and height be point Start, the other one be point End. If the width (i) of a sub BBox is smaller its than height (j), we eliminate false-overlap tiles from point Start to point End row by row as Fig. 3-25(a) shown. Otherwise, we eliminate false-overlap tiles from point Start to point End column by column as Fig 3-25(b) shown. By the width and height of a sub BBox, we may look up the differential table and get the differenec pattern of false-overlap tiles in rows.

Table 3-2 Inputs and output of converter

Figure 3-25 Direction for eliminating false-overlap tiles

With the direction for eliminating false-overlap tiles and the difference pattern of false-overlap tiles in rows (columns), we can accumulate the bits of difference pattern to get the number of false-overlap tiles in each row (column) from the second row (column). For

example, there is a primitive (with black line) in Fig. 3-26, and its width is 8 and height is 10.

Let the table size be 8. Through our convreter, we can use the entry which record the false-overlap tile with approximate difference of 6/8 to eliminate the false-overlap tiles. We make the first row in the primitve be row 0, and so on. The initial value of false-overlap_tile is zero for row 0 and accmulate the value of field in the entry to false-overlap_tile. The value of accmulated false-overlap_tile is the number of false-overlap tiles in each row.

8

Differential pattern of 6/8

row 9 6

+

Initial of false-overlap_tile False-overlap_tile

Value of Field

Figure 3-26 Example of eliminating rows larger the differential pattern

相關文件