Skip to content

Commit e34970f

Browse files
kenmcgaughtedwaine
authored andcommitted
When encoding video without specifying any colorspace info, ffmpeg defaults to Rec.601. However xSTUDIO was defaulting to Rec.709 when decoding video with unspecified colourspace info. This fixes that discrepancy and and now round-trips with ffmpeg and also matches the behaviour of OpenRV.
Signed-off-by: Ken McGaugh <[email protected]> Signed-off-by: Ted Waine <[email protected]>
1 parent cc473a5 commit e34970f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/plugin/media_reader/ffmpeg/src/ffmpeg_stream.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,19 +130,20 @@ void set_shader_pix_format_info(
130130
Imath::M33f yuv_to_rgb;
131131

132132
switch (colorspace) {
133-
case AVCOL_SPC_BT470BG:
134-
case AVCOL_SPC_SMPTE170M:
135-
yuv_to_rgb = YCbCr_to_RGB_601;
136-
break;
137133
case AVCOL_SPC_BT2020_NCL:
138134
case AVCOL_SPC_BT2020_CL:
139135
// TODO: ColSci
140136
// Handle BT2020 CL
141137
yuv_to_rgb = YCbCr_to_RGB_2020;
142138
break;
143139
case AVCOL_SPC_BT709:
144-
default:
145140
yuv_to_rgb = YCbCr_to_RGB_709;
141+
break;
142+
case AVCOL_SPC_BT470BG:
143+
case AVCOL_SPC_SMPTE170M:
144+
default:
145+
yuv_to_rgb = YCbCr_to_RGB_601;
146+
break;
146147
}
147148

148149
switch (color_range) {

0 commit comments

Comments
 (0)