X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=ycbcr.h;h=e4ca43fa3259f04bd84f27d826dcf5db362a1b02;hp=9179b1958a5cdcc73e1a5b74132a9b2bab45d3c8;hb=25162b5457057af3ebcc1649571eeeb923e90098;hpb=5f81c29e307735bbadb3c0cb06500af627b2e57a diff --git a/ycbcr.h b/ycbcr.h index 9179b19..e4ca43f 100644 --- a/ycbcr.h +++ b/ycbcr.h @@ -1,7 +1,8 @@ #ifndef _MOVIT_YCBCR_H #define _MOVIT_YCBCR_H 1 -// Shared utility functions between YCbCrInput and YCbCr422InterleavedInput. +// Shared utility functions between YCbCrInput, YCbCr422InterleavedInput +// and YCbCrConversionEffect. // // Conversion from integer to floating-point representation in case of // Y'CbCr is seemingly tricky: @@ -28,9 +29,10 @@ // range, 10-bit goes out of range (white gets to 942), while if you select // 10-bit range, 8-bit gets only to 234, making true white impossible. // -// We currently support the 8-bit ranges only, since all of our Y'CbCr -// handling effects happen to support only 8-bit at the moment. We will need -// to fix this eventually, though, with an added field to YCbCrFormat. +// Thus, you will need to specify the actual precision of the Y'CbCr source +// (or destination); the num_levels field is the right place. Most people +// will want to simply set this to 256, as 8-bit Y'CbCr is the most common, +// but the right value will naturally depend on your input. #include "image_format.h" @@ -47,8 +49,8 @@ struct YCbCrFormat { // JPEG uses the Rec. 601 luma coefficients, but full range. bool full_range; - // Currently unused, but should be set to 256 for future expansion, - // indicating 8-bit interpretation (see file-level comment). + // Set to 2^n for n-bit Y'CbCr (e.g. 256 for 8-bit Y'CbCr). + // See file-level comment. int num_levels; // Sampling factors for chroma components. For no subsampling (4:4:4),