# Division-Free Multiquantization Scheme for Modern Video Codecs

Authors: Mousumi Das; Atahar Mostafa; Khan Wahid
Journal: Advances in Multimedia
 (2012)

---

## Abstract

The current trend of digital convergence leads to the need of the video encoder/decoder (codec) that should support multiple video standards on a single platform as it is expensive to use dedicated video codec chip for each standard. The paper presents a high performance circuit shared architecture that can perform the quantization of five popular video codecs such as H.264/AVC, AVS, VC-1, MPEG-2/4, and JPEG. The proposed quantizer architecture is completely division-free as the division operation is replaced by shift and addition operations for all the standards. The design is implemented on FPGA and later synthesized in CMOS 0.18μm technology. The results show that the proposed design satisfies the requirement of all five codecs with a maximum decoding capability of 60 fps at 187 MHz on Xilinx FPGA platform for 1080 p HD video.


---

## Body

## 1. Introduction

An evident trend in modern world is the digital convergence in the current electronic consumer products. People want the portable devices to have various functions like Video on Demand (VOD), Digital Multimedia Broadcasting (DMB), Global Positioning System (GPS) or the navigation system, Portable Multimedia Player (PMP), and so on. Due to such demand, it is necessary to support the widely used video compression standards in a single system-on-chip (SoC) platform. So the goal is to find a way so that the multicodec system achieves high performance, as well as low cost.Most modern multimedia codecs (both encoder and decoder) employ transform-quantization pair as shown in Figure1. A significant research has been conducted to combine and efficiently implement the transform units for multiple codecs, but little research is focused on the implementation of multiquantizer unit. A unified Inverse Discrete Cosine Transform (IDCT) architecture to support five standards (such as, AVS, H.264, VC-1, MPEG-2/4, and JPEG) is presented in [1]. A design to support the 4 × 4 transform and quantization of H.264 has been presented in [2]. The 8 × 8 transform and quantization for H.264 is presented in [3] and [4]. Several other designs based on H.264 codec have been reported in [5–10]. The authors in [11] present a design for the quantization for AVS. The design in [12] describes an MPEG-2 encoder. In [13], another JPEG encoder is implemented for images where the quantization block is designed using multiplication and shift operation instead of division. The design in [14] describes a multistandard video decoder to support four codecs—AVS, H.264, VC-1, and MPEG-2. Silicon Image Inc. currently supplies a Multi-standard High-Definition Video Decoder (MSVD-HD) core that supports H.264, VC-1, and MPEG- 1/2 codecs [15]. Their multiplexed decoder chip costs 970 K gates using TSMC 90 nm technology (including complete memory interfacing, stream reader functionality, and extra logic for context switch support).Figure 1
Functional block diagram of a modern video encoder.However, none of the existing designs can compute the quantization of any video codecs. In this paper, we present a new division-free quantization algorithm (DFQA) and its efficient implementation to compute the quantization units for five multimedia codecs: JPEG [16], MPEG-2/4 [17], VC-1 [18], H.264/AVC [19], and AVS [20].While developing the architecture, we have carefully considered all the quantization (Q) coefficients of the Q-tables of different standards and established a relationship between them. The quantization in MPEG-2/4 and JPEG is defined as the division of the DCT coefficient by the corresponding Q-values specified by the Q-matrices. On the other hand, the two most popular video standards, H.264/AVC and AVS exploit multiplication and shift operation for the purpose of quantization to avoid the division operation for reduced computational complexity. The quantization in VC-1 is user-defined and similar to the process in MPEG-2 [21]. Based on the observation, we propose a new multiquantizer architecture to support these five codecs. The architecture is later synthesized into both FPGA and ASIC level and the cost is compared with existing designs. The design serves as a key unit in a multicodec system in transcoding applications [22] and [23].


## 2. Proposed Division-Free Quantization  Algorithm (DFQA)

Quantization (Q) is defined as the division of the DCT coefficient by the corresponding Q-value. But in H.264 and AVS, it is done by multiplication and right shift operation. Hence these standards define their own Multiplication Factors (MF). These MFs are multiplied with the transform coefficients and finally right shifted. However, the quantization in VC-1, MPEG-2/4, and JPEG is defined as division operation only (using 8 × 8 matrices). As a result, it is challenge to establish a relationship that is general enough to merge all these schemes. After careful observation, a novel generalized algorithm is developed that is divided into three steps given as follows.Step 1.
(1)
p
=
(
w
[
i
,
j
]
≪
r
)
·
MF
[
i
,
j
]
,
for
i
,
j
=
0
,
…
,
7
,
where
≪
r
=
left
shift
by
r
bits
.Step 2.
(2)
q
=
p
+
(
o
f
f
s
e
t
≪
q
bits
)
.Step 3.
(3)
y
=
q
≫
(
n
+
q
s
bit
)
,
where
≫
(
n
+
q
s
_
bit
)
=
right
shift
by
(
n
+
q
s
_
bit
)
bits
,
where w denotes the transform coefficient, MF is the Multiplying factor, and y denotes the corresponding quantized value (level). The description of the rest of the parameters is listed in Table 1.Table 1
Description of different parameters of the proposed DFQA.
Parameters
AVS
H.264
VC-1
MPEG-2/4
JPEG
r
0
0
4
4
0
offset
1
0–0.5
0
0
0
qbits
14
16 + (QP mod 6)
0
0
0
n
15
16 + (QP mod 6)
8
8
8
qs_bit
0
0
5
5
0Moreover,QP is the quantization parameter which specifies MFs. In the next sections, we apply the general DFQA to individual codecs.


### 2.1. DFQA Applied to H.264

In this section, we apply the generalized DFQA to perform the quantization operation in H.264. Firstly, the transform coefficients coming from the transform unit is directly multiplied byMF as the value of r is equal to 0 for this standard and hence no left shift operation is applied to the transform coefficients. In the second stage offset is left shifted by qbits and then added to the result coming from the first stage. This value is finally right shifted by n=(16+QPmod6) bits in the third stage, which is the final stage of the proposed DFQA. In case of H.264 as specified in [19], Multiplication Factor MF depends on m (= QPmod 6) and the position (i,j) of the element as follows: (4)MF[m;i,j]={Mm0for(i,j)withi=[0,4],j=[0,4],Mm1for(i,j)withi=[1,3,5,7],j=[1,3,5,7],Mm2for(i,j)withi=[2,6],j=[2,6],Mm3for(i,j)with(i=[0,4],j=[1,3,5,7])∩(i=[1,3,5,7],j=[0,4]),Mm4for(i,j)with(i=[0,4],j=[2,6])∩(i=[2,6],j=[0,4]),Mm5for(i,j)with(i=[2,6],j=[1,3,5,7])∩(i=[1,3,5,7],j=[2,6]).The matrix MF for H.264 is specified as(5)MF=[1310711428209721222216777154811191610826191741105814980142901008289431597896751271011985936282281491389311198411259819273461315977401048697777282642811570683091188640].


### 2.2. DFQA Applied to AVS

Next, we apply the DFQA to perform the quantization operation of AVS. In this case only the DFQA parameters are changed according to Table1. For AVS, based on [25], MF depends on QP. Each QP specifies one particular MF. The value of MF for the particular QP is given by Table 2. Once QP is specified the corresponding MF is multiplied with the transform coefficient in the first step of the DFQA. Again in case of AVS, the transform coefficient is not left shifted by r bits as the value of r is 0 which is similar to the case of  H.264. After that in second step this result is added to the 14 bits left shifted offset value, which is eventually right shifted by 15 bits in the final step.Table 2
Quantization table for AVS encoder.
QP
0
1
2
3
4
5
6
7
MF
32768
29775
27554
25268
23170
21247
19369
17770
QP
8
9
10
11
12
13
14
15
MF
16302
15024
13777
12634
11626
10624
9742
8958
QP
16
17
18
19
20
21
22
23
MF
8192
7512
6889
6305
5793
5303
4878
4467
QP
24
25
26
27
28
29
30
31
MF
4091
3756
3444
3161
2894
2654
2435
2235
QP
32
33
34
35
36
37
38
39
MF
2048
1878
1722
1579
1449
1329
1218
1117
QP
40
41
42
43
44
45
46
47
MF
1024
939
861
790
724
664
609
558
QP
48
49
50
51
52
53
54
55
MF
512
470
430
395
362
332
304
279
QP
56
57
58
59
60
61
62
63
MF
256
235
215
197
181
166
152
140


### 2.3. DFQA Applied to VC-1 and MPEG-2/4

VC-1 uses multiple transform sizes but the same quantization rule is applied to all the coefficients. This standard allows both dead-zone and regular uniform quantization. In uniform quantization, the quantization intervals are identical. A dead-zone is an interval on the number line around zero, such that unquantized coefficients lying in the interval are quantized to zero. All the quantization intervals except the dead-zone are of same size—the dead-zone being typically larger. The use of dead-zone leads to substantially bit savings at low bitrates. However, at a high level the quantization process (scalar quantization where each transform coefficient is independently quantized and coded) in VC-1 is similar to the corresponding process in MPEG-2 standard. As the quantization in VC-1 is user defined and according to [21] this process is similar to the corresponding process in MPEG-2 standard in this proposed architecture, the quantization parameters for VC-1 and MPEG-2/4 standards are the same. As specified by [26], the MPEG-2/4 standard uses two quantization matrices, Intra matrix and non-intra-matrix. Here we focus only on the Intramatrix. The intraquantization matrix is shown in Figure 2:Figure 2
Intra quantization matrix for VC-1 and MPEG-2/4.However, we generateMF for each of the coefficient of the quantization matrix specified in Figure 2. This MF is then right shifted by 8 bits. For example, dividing a DCT coefficient coming from transform unit by a quantization value 19 can be expressed as
(6)DCT19=DCT19*1414≈DCT*1428.
Hence for 19, the corresponding MF is 14. Moreover, the quantization in VC-1 and MPEG/2-4 needs the denominator of (6) to be multiplied by quantization step (QS), and in this proposed architecture for simplicity we choose QS=32=25, where 5 is denoted as qs_bit in Table 1. So the right-hand side of (6) can be characterized as
(7)DCT*1428*32=DCT*1428*25=DCT*14213.
The following matrix shows the MFs for the corresponding quantization matrix in Figure 2:
(8)MF=[31161412109981616121099871412109988712121099877121099876510998765410998754499775443].
As compared to the elements in the original intramatrix in Figure 2, the elements in (8) are smaller which helps to decrease the size of the RAM. Once MF is obtained, in the first step this MF is multiplied with the 4 bits left shifted transform coefficient as the value of r is 4 in this case. However, second step is not applicable to this standard and as a result the output of the first step is directly right shifted by (n+qs_bit)=(8+5)=13 bits in the third step.


### 2.4. DFQA Applied to JPEG

Similarly for JPEG codec, we calculateMFs for each of the coefficients of the quantization matrix. The JPEG standard does not define any fixed quantization matrix. It is the prerogative of the user to select a quantization matrix. There are two quantization matrices provided in Annex K of the JPEG standard for reference. Here we focus only on the Luminance quantization matrix shown in Figure 3.Figure 3
Luminance quantization matrix for JPEG.The following matrix shows theMFs for the corresponding quantization matrix of Figure 3:
(9)MF=[162225161065420201814104451820161064441815118533414117442231075432235433222243332222].
Again the elements in (9) are smaller than those of the original Luminance matrix in Figure 3, which reduces the size of the RAM. After we calculate the MF, each of them is directly multiplied by the corresponding transform coefficient in the first step. Similar to VC-1 and MPEG-2/4 codecs, the second step is not applied to the JPEG standard. Finally, in third step of the proposed DFQA, the multiplied output of the initial step is right shifted by 8 bits which gives the desired quantized level. To reduce the quantization error in VC-1, MPEG-2/4, and JPEG, we also calculate MF with different amount of right shift operation. But that approach increases the hardware cost and cannot reduce the quantization error significantly. Hence we implement the quantization by using the MF with fixed 8 bit right shift.


## 2.1. DFQA Applied to H.264

In this section, we apply the generalized DFQA to perform the quantization operation in H.264. Firstly, the transform coefficients coming from the transform unit is directly multiplied byMF as the value of r is equal to 0 for this standard and hence no left shift operation is applied to the transform coefficients. In the second stage offset is left shifted by qbits and then added to the result coming from the first stage. This value is finally right shifted by n=(16+QPmod6) bits in the third stage, which is the final stage of the proposed DFQA. In case of H.264 as specified in [19], Multiplication Factor MF depends on m (= QPmod 6) and the position (i,j) of the element as follows: (4)MF[m;i,j]={Mm0for(i,j)withi=[0,4],j=[0,4],Mm1for(i,j)withi=[1,3,5,7],j=[1,3,5,7],Mm2for(i,j)withi=[2,6],j=[2,6],Mm3for(i,j)with(i=[0,4],j=[1,3,5,7])∩(i=[1,3,5,7],j=[0,4]),Mm4for(i,j)with(i=[0,4],j=[2,6])∩(i=[2,6],j=[0,4]),Mm5for(i,j)with(i=[2,6],j=[1,3,5,7])∩(i=[1,3,5,7],j=[2,6]).The matrix MF for H.264 is specified as(5)MF=[1310711428209721222216777154811191610826191741105814980142901008289431597896751271011985936282281491389311198411259819273461315977401048697777282642811570683091188640].


## 2.2. DFQA Applied to AVS

Next, we apply the DFQA to perform the quantization operation of AVS. In this case only the DFQA parameters are changed according to Table1. For AVS, based on [25], MF depends on QP. Each QP specifies one particular MF. The value of MF for the particular QP is given by Table 2. Once QP is specified the corresponding MF is multiplied with the transform coefficient in the first step of the DFQA. Again in case of AVS, the transform coefficient is not left shifted by r bits as the value of r is 0 which is similar to the case of  H.264. After that in second step this result is added to the 14 bits left shifted offset value, which is eventually right shifted by 15 bits in the final step.Table 2
Quantization table for AVS encoder.
QP
0
1
2
3
4
5
6
7
MF
32768
29775
27554
25268
23170
21247
19369
17770
QP
8
9
10
11
12
13
14
15
MF
16302
15024
13777
12634
11626
10624
9742
8958
QP
16
17
18
19
20
21
22
23
MF
8192
7512
6889
6305
5793
5303
4878
4467
QP
24
25
26
27
28
29
30
31
MF
4091
3756
3444
3161
2894
2654
2435
2235
QP
32
33
34
35
36
37
38
39
MF
2048
1878
1722
1579
1449
1329
1218
1117
QP
40
41
42
43
44
45
46
47
MF
1024
939
861
790
724
664
609
558
QP
48
49
50
51
52
53
54
55
MF
512
470
430
395
362
332
304
279
QP
56
57
58
59
60
61
62
63
MF
256
235
215
197
181
166
152
140


## 2.3. DFQA Applied to VC-1 and MPEG-2/4

VC-1 uses multiple transform sizes but the same quantization rule is applied to all the coefficients. This standard allows both dead-zone and regular uniform quantization. In uniform quantization, the quantization intervals are identical. A dead-zone is an interval on the number line around zero, such that unquantized coefficients lying in the interval are quantized to zero. All the quantization intervals except the dead-zone are of same size—the dead-zone being typically larger. The use of dead-zone leads to substantially bit savings at low bitrates. However, at a high level the quantization process (scalar quantization where each transform coefficient is independently quantized and coded) in VC-1 is similar to the corresponding process in MPEG-2 standard. As the quantization in VC-1 is user defined and according to [21] this process is similar to the corresponding process in MPEG-2 standard in this proposed architecture, the quantization parameters for VC-1 and MPEG-2/4 standards are the same. As specified by [26], the MPEG-2/4 standard uses two quantization matrices, Intra matrix and non-intra-matrix. Here we focus only on the Intramatrix. The intraquantization matrix is shown in Figure 2:Figure 2
Intra quantization matrix for VC-1 and MPEG-2/4.However, we generateMF for each of the coefficient of the quantization matrix specified in Figure 2. This MF is then right shifted by 8 bits. For example, dividing a DCT coefficient coming from transform unit by a quantization value 19 can be expressed as
(6)DCT19=DCT19*1414≈DCT*1428.
Hence for 19, the corresponding MF is 14. Moreover, the quantization in VC-1 and MPEG/2-4 needs the denominator of (6) to be multiplied by quantization step (QS), and in this proposed architecture for simplicity we choose QS=32=25, where 5 is denoted as qs_bit in Table 1. So the right-hand side of (6) can be characterized as
(7)DCT*1428*32=DCT*1428*25=DCT*14213.
The following matrix shows the MFs for the corresponding quantization matrix in Figure 2:
(8)MF=[31161412109981616121099871412109988712121099877121099876510998765410998754499775443].
As compared to the elements in the original intramatrix in Figure 2, the elements in (8) are smaller which helps to decrease the size of the RAM. Once MF is obtained, in the first step this MF is multiplied with the 4 bits left shifted transform coefficient as the value of r is 4 in this case. However, second step is not applicable to this standard and as a result the output of the first step is directly right shifted by (n+qs_bit)=(8+5)=13 bits in the third step.


## 2.4. DFQA Applied to JPEG

Similarly for JPEG codec, we calculateMFs for each of the coefficients of the quantization matrix. The JPEG standard does not define any fixed quantization matrix. It is the prerogative of the user to select a quantization matrix. There are two quantization matrices provided in Annex K of the JPEG standard for reference. Here we focus only on the Luminance quantization matrix shown in Figure 3.Figure 3
Luminance quantization matrix for JPEG.The following matrix shows theMFs for the corresponding quantization matrix of Figure 3:
(9)MF=[162225161065420201814104451820161064441815118533414117442231075432235433222243332222].
Again the elements in (9) are smaller than those of the original Luminance matrix in Figure 3, which reduces the size of the RAM. After we calculate the MF, each of them is directly multiplied by the corresponding transform coefficient in the first step. Similar to VC-1 and MPEG-2/4 codecs, the second step is not applied to the JPEG standard. Finally, in third step of the proposed DFQA, the multiplied output of the initial step is right shifted by 8 bits which gives the desired quantized level. To reduce the quantization error in VC-1, MPEG-2/4, and JPEG, we also calculate MF with different amount of right shift operation. But that approach increases the hardware cost and cannot reduce the quantization error significantly. Hence we implement the quantization by using the MF with fixed 8 bit right shift.


## 3. Hardware Implementation of DFQA

The overall architecture of the proposed cost-sharing algorithm is shown in Figure4(a). It can perform the 8 × 8 quantization of any of the five different standards as selected by the user (or another master system) using the select_standard pin. The proposed architecture contains three main blocks with four-stage pipelining: (1) lookup tables to hold the multiplying factors (MF), (2) one multiquantization unit (composed of only one shared multiplier), and (3) one finite state machine to control all the standards. The description of these blocks and their operations are described below. However, QP processing is not necessary for hardware implementation as it does not process data but calculates parameters used for data processing in the quantization block. Hence we assume that QP processing is previously done by software.(a) Overall block diagram of the proposed architecture, (b) core unit with a multiplier, and (c) lookup tables and data flow diagram.
(a)
(b)
(c)The core unit of the multiquantizer unit, as shown in Figure4(b), contains one general-purpose multiplier, adder and shared right shifter. Right shift operation depends on the select_standard pin. The look-up tables in Figure 4(c) contain all the MF matrices for five standards. However, one look-up table is used at a time based on the specified standard. The multiplexer is used to select the valid data from the look-up tables. To reduce the power consumption, only one look-up table is activated at a time by the enable pin. Once the standard is chosen by the user, the desired look-up table is activated by the controller and all the other look-up tables go into the sleep mode. The control logic assigns the enable signal as well as the MUX selection signals accordingly.For H.264 standard according to Figure4(c), there are six look-up tables—LUT_H_0, LUT_H_1, LUT_H_2, LUT_H_3, LUT_H_4, and LUT_H_5 for QP=0,1,…,5. If QP is greater than 5 even then the same look-up tables will be used, only the qbits will be changed. For example, with QP=6 and QP=7, LUT_H_0 and LUT_H_1 will be used, respectively. Similarly the rest of the look-up tables will be reused as the value of QP is being increased. MUX1 selects the desired MF for H.264 standard from these six look-up tables based on QP. LUT_AVS, LUT_VC-1/MPEG, and LUT_JPEG contain MFs for AVS, VC-1/MPEG-2/4, and JPEG, respectively. The detailed block diagram of the entire operation with all the pipelining boundaries is shown in Figure 5.Figure 5
Detailed block diagram of the entire operation with all the pipelining boundaries.According to Figure5, the proposed architecture operates in four stages of pipeline, which consists of a row-column-generator to point the row and column of the look-up tables, several multiplexers to select the valid path, a shared multiplier for all five standards, a shared adder, and shared shifter. Here quantization is performed by multiplication and right shift operation rather than the division operation. In the first stage of pipelining, the value of row and col is generated to point to the row and column of the look-up table by the Row-Column-Generator with the help of the controller. This row and col is used to get the Multiplication Factor, MF from look-up table. After that in second stage of the pipeline operation the multiplexer selects the valid MF. Next in stage 3 the multiplier multiplies the transform coefficient w[i,j] coming from the transform unit with the desired MF[i,j]. Moreover, at the same time in this stage the offset value is left shifted by qbits by the left shifter only for H.264 and AVS standards. For VC-1, MPEG-2/4, and JPEG, this left shifter involved in stage 3 is not used. The output of the multiplier and the left shifter are added and finally right shifted in the fourth and final stage of the pipeline operation and the output register gives the quantized output. However, for VC-1, MPEG-2/4, and JPEG, the output of the multiplier is directly right shifted in this final stage and the output register returns the final quantized level. The left shift and right shift operation for AVS, H.264, VC-1, MPEG-2/4, or JPEG is chosen by the select_standard pin. In addition to the logic shown in Figure 5, there are pipelining registers between each stage of pipelining.The design of the shared multiplier along with the shifter instead of the divider is the key part of the entire process. Although quantization is defined as the division operation, the AVS and H.264 standards define quantization as the multiplication and the right shift operation. To integrate the old standards like MPEG-2/4 and JPEG with AVS and H.264, we propose the whole architecture as a shared multiplication and right shift operation. Due to this strategy, the proposed architecture needs only a shared multiplier rather than both the multiplier (for AVS and H.264) and the divider (for VC-1, MPEG-2/4, and JPEG), which reduces the hardware complexity as well as the cost. Moreover, the whole design shares only one control circuit rather than using specific control circuit for each standard, which makes the design more cost effective.


## 4. Hardware Comparison

### 4.1. Performance Comparison in FPGA

The proposed architecture is implemented in Verilog HDL, and the operation is verified using Xilinx Vertex4 LX60 FPGA. The design is later synthesized using 0.18μm CMOS technology. The proposed architecture costs 553 LUTs and 298 slices with a maximum operating frequency of 187.1 MHz. In Table 3, we summarize the performance (FPGA only) of our proposed multiquantizer supporting five standards in terms of hardware count, maximum working frequency, and supporting standards with other designs. The design in [2] has lesser hardware count than ours but supports only one standard, H.264.Table 3
Comparison with the existing designs (quantization only).
Arch.
Size
Tech.
No. of LUT
No. of slice
Freq. (MHz)
Supporting standards
H.264
MPEG-2/4
JPEG
VC-1
AVS
[2]
4 × 4
Virtex2(xc2vp7)
286
143
135
Y
o
o
o
o
[7]
4 × 4
XilinxV2P30FF896
956
—
108
Y
o
o
o
o
[8]
4 × 4
Virtex2(xc2vp7)
1954
977
94
Y
o
o
o
o
Proposed
8 × 8
Virtex4(LX60)
553
298
187
Y
Y
Y
Y
Y
Y: Yes; o:  No; —: No information.For better evaluation, we have integrated the multi-transform design (for five codecs) in [1] with the proposed multiquantization scheme. The combined design is implemented in Xilinx FPGA (Vertex4 LX60) and the results are shown in Table 4. This combined architecture costs 1722 LUTs (4-input), 972 slices, and 1036 registers with a maximum operating frequency of 187 MHz. Note that, the operating frequency of the multitransform design in [1] is 194 MHz. In Table 4, we compare the performance (FPGA only) of this combined multi-DCT and multiquantizer with the existing designs; those include both DCT and quantization block. The designs in [6] and [10] can support only one standard, H.264, and hence has lesser hardware than ours. Compared to the existing designs, our design has higher frequency of operation with comparable hardware count. Thus, it can be seen from the Tables 3 and 4 that the proposed design can support the highest number of popular and widely used video standards (i.e., AVS, H.264/AVC, VC-1, JPEG, and MPEG-2/4) and still consumes relatively lesser hardware cost and runs at higher operational frequency.Table 4
Comparison with existing designs (transform and quantization).
Arch.
Matrix size
Tech.
No. of LUT
No. of slice
Freq.  (MHz)
Supporting standards
H.264
MPEG-2/4
JPEG
VC-1
AVS
[3]
8 × 8
Virtex2(XC2VP30)
2887
1624
112
Y
o
o
o
o
[4]
8 × 8
Virtex2(XC2V4000)
29018
14509
69
Y
o
o
o
o
[5]
8 × 8
Startix II
7323
—
100
Y
o
o
o
o
[6]
4 × 4
Virtex2(XC2V1500)
246
123
115
Y
o
o
o
o
[9]
4 × 4
Virtex2(2V8000FF1157)
2498
1249
81
Y
o
o
o
o
[10]
4 × 4
Virtex2(XC2V1500)
1386
693
99
Y
o
o
o
o
Proposed
8 × 8
Virtex4(LX60)
1722
972
187
Y
Y
Y
Y
Y
Y: Yes; o: No; —: No information.


### 4.2. Performance Comparison in VLSI

The proposed design is synthesized in CMOS 0.18μm technology using Artisan library cells. It consumes 176,911 μm2 silicon area, 19.6 K gates, and 6.8 K standard cells. The frequency of operation is 88.5 MHz. As seen here, the operational frequency of our design is much higher in FPGA because of the use of optimized LUTs that are inherent to the type of FPGA chosen.In Table5, we compare the VLSI implementation of the proposed DFQA scheme with that of the estimated cost of the existing designs. Since, as of today, we have not come across to any design that can support all five codecs, we show an estimate of the projected cost. The costs of the standalone quantization units are added together to find the total estimated cost of five standalone codecs which is 31.1 K logic gates. The cost of the proposed circuit shared quantizer architecture is 19.6 K logic gates, which saves up to 36.7% than the estimated cost of five codecs. Figure 6 illustrates the comparison showing the percentage of reduction based on Table 5.Table 5
Comparison of multiquantization schemes (VLSI implementation).
Codecs
No. of gates
H.264 [2]
1.75 K
AVS [11]
7.2 K
MPEG-2/4 [12]
9 K
JPEG [24]
4.1 K
VC-1 [21]
9 K
Estimated total cost (5 codecs—standalone)
31.1 K
Proposed (all 5 codecs—shared)
19.6 KFigure 6
Comparison in terms gate count.


### 4.3. Estimated Area Saving in a Multicodec Design

In order to better assess the saving in hardware for the entire decoder, we have done a cost analysis as presented in Figure7 where the costs of standalone and shared design are shown. The cost of a decoder for four codecs (H.264, VC-1, AVS, MPEG2/4) is taken from [14]. The cost of JPEG codec is taken from [24] and added with the previous to calculate the total cost for all five codecs. Here, MC is motion compensation, IP is intra prediction, VLD is variable length decoder, IQ is inverse quantization, and IT is inverse transform. To calculate the hypothetical cost of shared implementation, we have used the implementation cost for MC, IP, and VLD units from the shared design presented in [14]. Then the cost for IT (for shared design taken from our previous work [1]) and the cost for IQ (taken from the current work) are added. Thus, we can see that the shared design (that includes the proposed multicodec DFQA scheme) is estimated to save overall 41.1% area of a decoder compared to standalone design for five codecs.Figure 7
Cost reduction map of a decoder using the proposed architecture.In Table6, we compare the decoding capability of the proposed multiquantization approach with other quantization only designs. While working at maximum capacity on Virtex4 LX60 FPGA, the proposed multiquantizer can achieve a frame rate of 60 fps (with 4 : 2 : 0 luma-chroma sampling, 187 × 106/(1,920 × 1,080 + 2 × 960 × 540) = 60.1 ≈ 60). The decoding capability of other designs is also calculated using 4 : 2 : 0 sampling. It is seen in Table 6 that the proposed scheme achieves the highest decoding capacity.Table 6
Comparison of decoding capability of the multiquantizer schemes.
Arch.
1920 × 1080
1280 × 720
Comments
Time to transmit 1 frame (msec)
Frame per second (fps)
Time to transmit 1 frame (msec)
Frame per second (fps)
[2]
23.3
43
10.2
97
Supports only H.264
[7]
28.8
34
12.8
78
Supports only H.264
[8]
33.1
30
14.7
67
Supports only H.264
Proposed
16.6
60
7.4
135
Supports five codecs


### 4.4. Performance Evaluation Using Standard Images

In order to verify the functional correctness, in this section, we present the performance evaluation of the proposed algorithm using several standard gray-scale images. The images are first coded with transform (used in [1]) and quantization (presented here) operations, followed by a decoding (inverse) process. The quantization parameter (or quality factor) is set to 10 in all cases. The results are shown in terms of peak-signal-to-noise-ratio (PSNR) and presented below in Table 7. Figure 8 presents the original and reconstruction images of “Lena” and “Mandrill” for all five codecs.Table 7
Performance measure using standard images for different standards.
Sample images
PSNR (dB)
H.264
VC-1/MPEG-2/4
JPEG
AVS
Peppers
38.62
32.09
34.81
50.64
House
38.97
33.36
35.51
50.64
Girl
38.67
33.03
35.56
50.64
Mandrill
36.20
27.46
28.91
50.69
Tree
36.78
29.09
31.11
50.60
Lena
38.81
31.73
34.14
50.65
Lake
37.28
29.47
31.74
50.64
Mean
37.91
30.89
33.11
50.64(a) Original Lena image; (b) reconstructed image using VC-1/MPEG-2/4; (c) using JPEG; (d) using H.264; (e) using AVS; (f) original Mandrill image; (g) reconstructed using VC-1/MPEG-2/4; (h) using JPEG; (i) using H.264; (j) using AVS.
(a)
(b)
PSNR: 31.73 dB
(c)
PSNR: 34.14 dB
(d)
PSNR: 38.81 dB
(e)
PSNR: 50.65 dB
(f)
(g)
PSNR: 27.46 dB
(h)
PSNR: 28.91 dB
(i)
PSNR: 36.20 dB
(j)
PSNR: 50.69 dB


## 4.1. Performance Comparison in FPGA

The proposed architecture is implemented in Verilog HDL, and the operation is verified using Xilinx Vertex4 LX60 FPGA. The design is later synthesized using 0.18μm CMOS technology. The proposed architecture costs 553 LUTs and 298 slices with a maximum operating frequency of 187.1 MHz. In Table 3, we summarize the performance (FPGA only) of our proposed multiquantizer supporting five standards in terms of hardware count, maximum working frequency, and supporting standards with other designs. The design in [2] has lesser hardware count than ours but supports only one standard, H.264.Table 3
Comparison with the existing designs (quantization only).
Arch.
Size
Tech.
No. of LUT
No. of slice
Freq. (MHz)
Supporting standards
H.264
MPEG-2/4
JPEG
VC-1
AVS
[2]
4 × 4
Virtex2(xc2vp7)
286
143
135
Y
o
o
o
o
[7]
4 × 4
XilinxV2P30FF896
956
—
108
Y
o
o
o
o
[8]
4 × 4
Virtex2(xc2vp7)
1954
977
94
Y
o
o
o
o
Proposed
8 × 8
Virtex4(LX60)
553
298
187
Y
Y
Y
Y
Y
Y: Yes; o:  No; —: No information.For better evaluation, we have integrated the multi-transform design (for five codecs) in [1] with the proposed multiquantization scheme. The combined design is implemented in Xilinx FPGA (Vertex4 LX60) and the results are shown in Table 4. This combined architecture costs 1722 LUTs (4-input), 972 slices, and 1036 registers with a maximum operating frequency of 187 MHz. Note that, the operating frequency of the multitransform design in [1] is 194 MHz. In Table 4, we compare the performance (FPGA only) of this combined multi-DCT and multiquantizer with the existing designs; those include both DCT and quantization block. The designs in [6] and [10] can support only one standard, H.264, and hence has lesser hardware than ours. Compared to the existing designs, our design has higher frequency of operation with comparable hardware count. Thus, it can be seen from the Tables 3 and 4 that the proposed design can support the highest number of popular and widely used video standards (i.e., AVS, H.264/AVC, VC-1, JPEG, and MPEG-2/4) and still consumes relatively lesser hardware cost and runs at higher operational frequency.Table 4
Comparison with existing designs (transform and quantization).
Arch.
Matrix size
Tech.
No. of LUT
No. of slice
Freq.  (MHz)
Supporting standards
H.264
MPEG-2/4
JPEG
VC-1
AVS
[3]
8 × 8
Virtex2(XC2VP30)
2887
1624
112
Y
o
o
o
o
[4]
8 × 8
Virtex2(XC2V4000)
29018
14509
69
Y
o
o
o
o
[5]
8 × 8
Startix II
7323
—
100
Y
o
o
o
o
[6]
4 × 4
Virtex2(XC2V1500)
246
123
115
Y
o
o
o
o
[9]
4 × 4
Virtex2(2V8000FF1157)
2498
1249
81
Y
o
o
o
o
[10]
4 × 4
Virtex2(XC2V1500)
1386
693
99
Y
o
o
o
o
Proposed
8 × 8
Virtex4(LX60)
1722
972
187
Y
Y
Y
Y
Y
Y: Yes; o: No; —: No information.


## 4.2. Performance Comparison in VLSI

The proposed design is synthesized in CMOS 0.18μm technology using Artisan library cells. It consumes 176,911 μm2 silicon area, 19.6 K gates, and 6.8 K standard cells. The frequency of operation is 88.5 MHz. As seen here, the operational frequency of our design is much higher in FPGA because of the use of optimized LUTs that are inherent to the type of FPGA chosen.In Table5, we compare the VLSI implementation of the proposed DFQA scheme with that of the estimated cost of the existing designs. Since, as of today, we have not come across to any design that can support all five codecs, we show an estimate of the projected cost. The costs of the standalone quantization units are added together to find the total estimated cost of five standalone codecs which is 31.1 K logic gates. The cost of the proposed circuit shared quantizer architecture is 19.6 K logic gates, which saves up to 36.7% than the estimated cost of five codecs. Figure 6 illustrates the comparison showing the percentage of reduction based on Table 5.Table 5
Comparison of multiquantization schemes (VLSI implementation).
Codecs
No. of gates
H.264 [2]
1.75 K
AVS [11]
7.2 K
MPEG-2/4 [12]
9 K
JPEG [24]
4.1 K
VC-1 [21]
9 K
Estimated total cost (5 codecs—standalone)
31.1 K
Proposed (all 5 codecs—shared)
19.6 KFigure 6
Comparison in terms gate count.


## 4.3. Estimated Area Saving in a Multicodec Design

In order to better assess the saving in hardware for the entire decoder, we have done a cost analysis as presented in Figure7 where the costs of standalone and shared design are shown. The cost of a decoder for four codecs (H.264, VC-1, AVS, MPEG2/4) is taken from [14]. The cost of JPEG codec is taken from [24] and added with the previous to calculate the total cost for all five codecs. Here, MC is motion compensation, IP is intra prediction, VLD is variable length decoder, IQ is inverse quantization, and IT is inverse transform. To calculate the hypothetical cost of shared implementation, we have used the implementation cost for MC, IP, and VLD units from the shared design presented in [14]. Then the cost for IT (for shared design taken from our previous work [1]) and the cost for IQ (taken from the current work) are added. Thus, we can see that the shared design (that includes the proposed multicodec DFQA scheme) is estimated to save overall 41.1% area of a decoder compared to standalone design for five codecs.Figure 7
Cost reduction map of a decoder using the proposed architecture.In Table6, we compare the decoding capability of the proposed multiquantization approach with other quantization only designs. While working at maximum capacity on Virtex4 LX60 FPGA, the proposed multiquantizer can achieve a frame rate of 60 fps (with 4 : 2 : 0 luma-chroma sampling, 187 × 106/(1,920 × 1,080 + 2 × 960 × 540) = 60.1 ≈ 60). The decoding capability of other designs is also calculated using 4 : 2 : 0 sampling. It is seen in Table 6 that the proposed scheme achieves the highest decoding capacity.Table 6
Comparison of decoding capability of the multiquantizer schemes.
Arch.
1920 × 1080
1280 × 720
Comments
Time to transmit 1 frame (msec)
Frame per second (fps)
Time to transmit 1 frame (msec)
Frame per second (fps)
[2]
23.3
43
10.2
97
Supports only H.264
[7]
28.8
34
12.8
78
Supports only H.264
[8]
33.1
30
14.7
67
Supports only H.264
Proposed
16.6
60
7.4
135
Supports five codecs


## 4.4. Performance Evaluation Using Standard Images

In order to verify the functional correctness, in this section, we present the performance evaluation of the proposed algorithm using several standard gray-scale images. The images are first coded with transform (used in [1]) and quantization (presented here) operations, followed by a decoding (inverse) process. The quantization parameter (or quality factor) is set to 10 in all cases. The results are shown in terms of peak-signal-to-noise-ratio (PSNR) and presented below in Table 7. Figure 8 presents the original and reconstruction images of “Lena” and “Mandrill” for all five codecs.Table 7
Performance measure using standard images for different standards.
Sample images
PSNR (dB)
H.264
VC-1/MPEG-2/4
JPEG
AVS
Peppers
38.62
32.09
34.81
50.64
House
38.97
33.36
35.51
50.64
Girl
38.67
33.03
35.56
50.64
Mandrill
36.20
27.46
28.91
50.69
Tree
36.78
29.09
31.11
50.60
Lena
38.81
31.73
34.14
50.65
Lake
37.28
29.47
31.74
50.64
Mean
37.91
30.89
33.11
50.64(a) Original Lena image; (b) reconstructed image using VC-1/MPEG-2/4; (c) using JPEG; (d) using H.264; (e) using AVS; (f) original Mandrill image; (g) reconstructed using VC-1/MPEG-2/4; (h) using JPEG; (i) using H.264; (j) using AVS.
(a)
(b)
PSNR: 31.73 dB
(c)
PSNR: 34.14 dB
(d)
PSNR: 38.81 dB
(e)
PSNR: 50.65 dB
(f)
(g)
PSNR: 27.46 dB
(h)
PSNR: 28.91 dB
(i)
PSNR: 36.20 dB
(j)
PSNR: 50.69 dB


## 5. Conclusion

In this paper, we present a high performance circuit shared architecture to perform the 8 × 8 quantization operation for five different multimedia codecs. The architecture replaces the hardware costly division operation with addition and shift operations. In addition only one control circuit is designed to control the entire architecture for all five standards. These strategies of using shared multiplier and shared control circuit result in a much lower hardware cost. The performance analysis shows that the proposed design satisfies the requirement of all codecs and achieves the competitive decoding capability. The scheme is later verified for functional correctness using standard images. Overall, the architecture is suitable for real-time application in modern multicodec systems.



---

*Source: 302893-2012-08-09.xml*