File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ pub struct Image {
5050 pub depth : u8 ,
5151
5252 pub yuv_format : PixelFormat ,
53- pub full_range : bool ,
53+ pub full_range : bool , // VideoFullRangeFlag as specified in ISO/IEC 23091-2/ITU-T H.273.
5454 pub chroma_sample_position : ChromaSamplePosition ,
5555
5656 pub alpha_present : bool ,
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ enum Mode {
5555struct YuvColorSpaceInfo {
5656 channel_bytes : u32 ,
5757 depth : u32 ,
58- full_range : bool ,
58+ full_range : bool , // VideoFullRangeFlag as specified in ISO/IEC 23091-2/ITU-T H.273.
5959 max_channel : u16 ,
6060 bias_y : f32 ,
6161 bias_uv : f32 ,
@@ -100,6 +100,7 @@ impl YuvColorSpaceInfo {
100100 depth : image. depth as u32 ,
101101 full_range : image. full_range ,
102102 max_channel,
103+ // See the formulas in ISO/IEC 23091-2.
103104 bias_y : if image. full_range { 0.0 } else { ( 16 << ( image. depth - 8 ) ) as f32 } ,
104105 bias_uv : ( 1 << ( image. depth - 1 ) ) as f32 ,
105106 range_y : if image. full_range { max_channel } else { 219 << ( image. depth - 8 ) } as f32 ,
You can’t perform that action at this time.
0 commit comments