﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
832	CRC calculation incorrect for bit depths greater than 8	bheng		"There is currently a mismatch between the SEI picture hash CRC calculation in WD9 and HM-9.0.

When the bit depth is greater than 8, the WD text splits each pixel into two bytes.  The CRC is then calculated on each of these bytes, 16 bits total, in the following order.

{{{
MSB                                LSB
8 9 10 11 12 13 14 15  0 1 2 3 4 5 6 7
}}}

HM attempts to take the CRC of only the active bits.  So for 10-bit pixels it would try to process just 10 bits, with bits in the following order:

{{{
MSB                         LSB
X X X X X X 0 1 2 3 4 5 6 7 8 9
}}}

In addition, there is a bug in the code used to do this.  Specifically, the & operator being used below to replace a modulo operation only works for the 8-bit case.  This cannot be directly extended to 10-bits, etc... 

{{{
(dataMsbIdx - (bitIdx&dataMsbIdx))
}}}


I believe the attached patch would fix HM to match the WD text.
"	defect	closed	minor	HM-9.1	HM	HM-9.0	fixed		fbossen ksuehring davidf jct-vc@…
