Color Space Conversion Module v2

Color Space Conversion Module v2

jpegenc.subblocks.color_converters.rgb2ycbcr_v2.rgb2ycbcr_v2

Color Space Conversion Module v2

This module is used to transform the rgb input to an other representation called YCbCr. The input interface is the RGB and the output is the Ycbcr_v2. The inputs and outputs are serial. According to the signal color_mode one of the 3 transformations occurs. If color_mode equals to 0 then the rgb to Y transformation occurs and so on.

Inputs:
Red, Green, Blue, data_valid, color_mode, clock, reset
Outputs:
data_out, data_valid
Parameters:
num_fractional_bits
class jpegenc.subblocks.color_converters.rgb2ycbcr.ColorSpace(red=0, green=0, blue=0)

Color Space Conversion Class

It is used to derive the integer coefficients and as a software reference for the conversion

_set_jfif_coefs()

The YCbCr special constants

The JFIF YCbCr conversion requires “special” constants defined by the standard. The constants are describe in a Wikipedia page: https://en.wikipedia.org/wiki/YCbCr

get_jfif_ycbcr()

RGB to YCbCr Conversion. Used as software reference.

get_jfif_ycbcr_int_coef(precision_factor=0)

Generate the integer (fixed-point) coefficients