Bug fixes in the partial gamma-correction procedure.

Signed-off-by: ban.hiroshi <ban.hiroshi@gmail.com>