Commit 36c95034 authored by Steve Lhomme's avatar Steve Lhomme

av1: read the color range as a video_color_range_t

parent e0fd9d2a
...@@ -136,7 +136,7 @@ static void UpdateDecoderFormat(decoder_t *p_dec) ...@@ -136,7 +136,7 @@ static void UpdateDecoderFormat(decoder_t *p_dec)
video_color_primaries_t prim; video_color_primaries_t prim;
video_color_space_t space; video_color_space_t space;
video_transfer_func_t xfer; video_transfer_func_t xfer;
bool full; video_color_range_t full;
if(p_dec->fmt_in.video.primaries == COLOR_PRIMARIES_UNDEF && if(p_dec->fmt_in.video.primaries == COLOR_PRIMARIES_UNDEF &&
AV1_get_colorimetry(p_sys->p_sequence_header, &prim, &xfer, &space, &full) && AV1_get_colorimetry(p_sys->p_sequence_header, &prim, &xfer, &space, &full) &&
prim != COLOR_PRIMARIES_UNDEF && prim != COLOR_PRIMARIES_UNDEF &&
...@@ -147,7 +147,7 @@ static void UpdateDecoderFormat(decoder_t *p_dec) ...@@ -147,7 +147,7 @@ static void UpdateDecoderFormat(decoder_t *p_dec)
p_dec->fmt_out.video.primaries = prim; p_dec->fmt_out.video.primaries = prim;
p_dec->fmt_out.video.transfer = xfer; p_dec->fmt_out.video.transfer = xfer;
p_dec->fmt_out.video.space = space; p_dec->fmt_out.video.space = space;
p_dec->fmt_out.video.color_range = full ? COLOR_RANGE_FULL : COLOR_RANGE_LIMITED; p_dec->fmt_out.video.color_range = full;
} }
if(!p_dec->fmt_in.i_extra && !p_dec->fmt_out.i_extra) if(!p_dec->fmt_in.i_extra && !p_dec->fmt_out.i_extra)
......
...@@ -535,14 +535,14 @@ bool AV1_get_colorimetry(const av1_OBU_sequence_header_t *p_seq, ...@@ -535,14 +535,14 @@ bool AV1_get_colorimetry(const av1_OBU_sequence_header_t *p_seq,
video_color_primaries_t *p_primaries, video_color_primaries_t *p_primaries,
video_transfer_func_t *p_transfer, video_transfer_func_t *p_transfer,
video_color_space_t *p_colorspace, video_color_space_t *p_colorspace,
bool *p_full_range) video_color_range_t *p_full_range)
{ {
if(!p_seq->color_config.color_description_present_flag) if(!p_seq->color_config.color_description_present_flag)
return false; return false;
*p_primaries = iso_23001_8_cp_to_vlc_primaries(p_seq->color_config.color_primaries); *p_primaries = iso_23001_8_cp_to_vlc_primaries(p_seq->color_config.color_primaries);
*p_transfer = iso_23001_8_tc_to_vlc_xfer(p_seq->color_config.transfer_characteristics); *p_transfer = iso_23001_8_tc_to_vlc_xfer(p_seq->color_config.transfer_characteristics);
*p_colorspace = iso_23001_8_mc_to_vlc_coeffs(p_seq->color_config.matrix_coefficients); *p_colorspace = iso_23001_8_mc_to_vlc_coeffs(p_seq->color_config.matrix_coefficients);
*p_full_range = p_seq->color_config.color_range == COLOR_RANGE_FULL; *p_full_range = p_seq->color_config.color_range ? COLOR_RANGE_FULL : COLOR_RANGE_LIMITED;
return true; return true;
} }
......
...@@ -165,7 +165,7 @@ void AV1_get_frame_max_dimensions(const av1_OBU_sequence_header_t *, unsigned *, ...@@ -165,7 +165,7 @@ void AV1_get_frame_max_dimensions(const av1_OBU_sequence_header_t *, unsigned *,
void AV1_get_profile_level(const av1_OBU_sequence_header_t *, int *, int *, int *); void AV1_get_profile_level(const av1_OBU_sequence_header_t *, int *, int *, int *);
bool AV1_get_colorimetry( const av1_OBU_sequence_header_t *, bool AV1_get_colorimetry( const av1_OBU_sequence_header_t *,
video_color_primaries_t *, video_transfer_func_t *, video_color_primaries_t *, video_transfer_func_t *,
video_color_space_t *, bool *); video_color_space_t *, video_color_range_t *);
bool AV1_get_frame_rate(const av1_OBU_sequence_header_t *, unsigned *, unsigned *); bool AV1_get_frame_rate(const av1_OBU_sequence_header_t *, unsigned *, unsigned *);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment