﻿ 一种低面积低功耗RGB到YCbCr色彩空间转换电路实现方法 Low-Area and Low-Power Circuit Implementation of Color Space Conversion between RGB and YCbCr

Open Journal of Circuits and Systems
Vol.05 No.04(2016), Article ID:19200,9 pages
10.12677/OJCS.2016.54007

Low-Area and Low-Power Circuit Implementation of Color Space Conversion between RGB and YCbCr

Fei Lu1, Hu Cao2

1Shanghai IC Technology Industry Promotion Center, Shanghai

Received: Nov. 21st, 2016; accepted: Dec. 9th, 2016; published: Dec. 13th, 2016

ABSTRACT

This paper presents a low-area and low-power circuit implementation of high-precision color space conversion from RGB to YCbCr. Firstly, an efficient circuit implementation combining common-subexpression-elimination (CSE) with reduced-adder-graph (RAG) is presented. Secondly, a compensation method is proposed to enhance the precision. Finally, the synthesized results of a TSMC 0.18 um standard cell library are given. By using the proposed circuit implementation of color space conversion from RGB to YCbCr combining CSE and RAG without compensation, the results show that the area and power are reduced by about 20% than the traditional Canonic Signed Digital (CSD) method. With the compensation algorithm, the precision is much higher.

Keywords:RGB, YCbCr, Common-Subexpression-Elimination (CSE), Reduced-Adder-Graph (RAG), Compensation

1上海集成电路技术与产业促进中心，上海

2中国科学院上海高等研究院，上海

1. 引言

CSE [5] 算法和基于图(Graph-dependence, GD)的算法是更为高效的算法，CSE算法的思想是找到系数集的公共子表达式，为实现上文的乘法器运算，令{E = A − B}，那么表达式变成{D = A<<3 + E<<2 + E + B<<6 + C<<6 + C<<3 + C<<1 + C}，需要6个移位寄存器和8个加法器，比CSD编码方式节省了1个移位寄存器和1个加法器。而GD算法中的n维简化加法器图(n-dimensional reduced adder graph, RAG-n) [6] [7] 算法用最少的加法器数量产生乘法器。例如为了实现乘法器集合{F1 = 13A; F2 = 59A; F3 = 75A}，基于CSD编码的一般方法表示为{13A = A<<3 + A<<2 + A}，{59A = A<<6 − A<<2 − A}和{75A = A<<6 + A<<3 + A<<1 + A}，需要四个移位寄存器和7个加法器。2005年改进的算法RAG-05选择将中项{15A = A<<4 − A}表示为{13A = 15A − A<<1}，{59A = (15A)<<2 − A}和{75A = (15A)<<2 + 15A}，只需要3个移位寄存器和4个加法器，相比CSD编码方式节省了1个移位寄存器和3个加法器。RAG算法虽然高效，但找到最优解却非常困难，尤其系数比较大的时候。

2. 改进方法

2.1. RGB到YCbCr的颜色空间转换

YCbCr与RGB之间的转换公式 [8] 定位为：

(1)

(2)

(3)

(4)

2.2. 寻找显著的公共子表达式

CSD编码具有最小数量的1(-1)，因此，第一步是把所有系数转换成CSD编码格式。文献 [10] 主要考虑输入信号的组合，然后尝试找到一种使用最少加法器数量的方法。对于一个乘法器集，加法器的数量减少大概50%。虽然有研究尝试找出最优公共子表达式，但是当系数很大的时候是很难找出最优公共子表达式的。在本文提出的算法中，只需要找出显著的公共子表达式。

(5)

2.3. RAG-05算法

(i) 将输入集合中的所有系数简化为正奇基数，将结果保存到输入集；

Figure 1. Relationship between MSE and n

Figure 2. CSD coding and common sub expressions of coefficients

(ii) 利用MAG表来计算所有系数的单系数的加法器成本；

(iii) 删除输入集合中所有2的幂的值和重复的基数；

(iv) 创建能用一个用加法器构造的所有系数图集，然后从输入集合中删除这些满足条件的系数；

(v) 检查图集中是否有一对基数用一个加法器在输入集合生成一个系数；

(vi) 重复步骤v，知道没有系数添加到图集中为止。

2.4. 提高精度的补偿方法

(6)

Table 1. Realization of coefficients based on RAG-05 algorithm

Figure 3. Original color space conversion MSE and MSE with compensation

2.5. 专用电路实现

3. 实验结果

3.1. 联合CSE和RAG-05不带补偿下的实验结果

3.2. 补偿方法的实验结果

n值设为8，每一项的补偿限制为两个加数和一个加法器，原始的颜色空间转换如下所示：

(7)

(8)

Figure 4. Flow chart of color space conversion from RGB with compensation to YCbCr

Table 2. The traditional method and the proposed algorithm circuit to achieve the required number of adder

Figure 5. The comprehensive results of the area and power consumption of binary coding, CSD, RAG, CSE, and the proposed algorithm

Figure 6. The area and power consumption of the proposed algorithm with CSD coding and without compensation

Figure 7. The area and power consumption of the proposed algorithm with CSD coding

Table 3. Results with/without compensation

(9)

n = 12不带补偿的综合结果和n = 8带补偿的综合结果如表3所示，可以看到带补偿的精度大幅度提高。虽然加法器的数量增加了，但是不带补偿的Y’/CB’/CR’为20位而带补偿的Y’ + Y’’/CB’ + CB’’/CR’ + CR’’只有16位。更重要的是，补偿部分使用非常简单的加法器，使得带补偿的电路面积和功耗甚至更为低一些。

4. 结论

Low-Area and Low-Power Circuit Implementation of Color Space Conversion between RGB and YCbCr[J]. 电路与系统, 2016, 05(04): 51-59. http://dx.doi.org/10.12677/OJCS.2016.54007

1. 1. ElDahshan, K.A., Yourself, M.I., Masameer, E.H. and Hassan, M.A. (2015) Comparison of Segmentation Framework on Digital Microscope Images for Acute Lymphoblastic Leukemia Diagnosis Using RGB and HSV Color Spaces. Journal of Biomedical Engineering and Medical Imaging, 2, 26.

2. 2. Naskar, R. and Chakraborty, R.S. (2013) Histo-gram-Bin-Shifting-Based Reversible Watermarking for Colour Images. IET Image Processing, 7, 99. https://doi.org/10.1049/iet-ipr.2012.0232

3. 3. Logeshwari, N., Aarthi, B., Manikandan, K., Yogeswari, K., Vishnupriya, M. and Priya, S. (2015) Optimization of Area in Digit Serial Multiple Constant Multiplication at Gate Level. Digital Siginal Processing, 7, 50.

4. 4. Kim, S.M., Chung, J.G. and Parhi, K.K. (2003) Low Error Fixed-Width CSD Multiplier with Efficient Sign Extension. IEEE Transactions on Circuits and Systems II, 50, 984. https://doi.org/10.1109/TCSII.2003.820231

5. 5. Yao, C.Y., Chen, H.H., Lin, T.F., Chien, C.J. and Hsu, X.T. (2004) A Novel Common-Subexpression-Elimination Method for Synthesizing Fixed-Point FIR Filters. IEEE Transactions on Circuits and Systems I, 51, 2215. https://doi.org/10.1109/TCSI.2004.836853

6. 6. Dempster, A.G. and Macleod, M.D. (1995) Use of Minimum-Adder Multiplier Blocks in FIR Digital Filters. IEEE Transactions on Circuits and Systems II, 42, 569. https://doi.org/10.1109/82.466647

7. 7. Wang, Y. and Roy, K. (2005) CSDC: A New Complexity Reduction Technique for Multiplierless Implementation of Digital FIR Filters. IEEE Transactions on Circuits and Systems I, 52, 1845. https://doi.org/10.1109/TCSI.2005.852208

8. 8. Yang, Y., Peng, Y.H. and Liu, Z.G. (2007) A Fast Algorithm for YCbCr to RGB Conversion. IEEE Transactions on Consumer Electronics, 53, 1490. https://doi.org/10.1109/TCE.2007.4429242

9. 9. Wang, Z. and Bovik, A.C. (2002) A Universal Image Quality Index. IEEE Signal Processing Letters, 9, 81. https://doi.org/10.1109/97.995823

10. 10. Hartley, R.I. (1996) Subexpression Sharing in Filters Using Canonic Signed Digit Multipliers. IEEE Transactions on Circuits and Systems II, 43, 677. https://doi.org/10.1109/82.539000