[vlc-commits] [Git][videolan/vlc][master] packetizer: av1: always set subsampling_x/y
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Thu May 5 16:18:46 UTC 2022
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
b1e684c7 by Steve Lhomme at 2022-05-05T16:04:08+00:00
packetizer: av1: always set subsampling_x/y
Especially since it's mostly 1 (4:2:0) and we were supposed to read the
chroma_sample_position in that case.
- - - - -
1 changed file:
- modules/packetizer/av1_obu.c
Changes:
=====================================
modules/packetizer/av1_obu.c
=====================================
@@ -194,6 +194,8 @@ static bool av1_parse_color_config(bs_t *p_bs,
{
p_cc->color_range = bs_read1(p_bs) ? COLOR_RANGE_FULL : COLOR_RANGE_LIMITED;
p_cc->i_chroma = VLC_CODEC_GREY;
+ p_cc->subsampling_x = 1;
+ p_cc->subsampling_y = 1;
}
else if( p_cc->color_primaries == 1 &&
p_cc->transfer_characteristics == 13 &&
@@ -201,6 +203,8 @@ static bool av1_parse_color_config(bs_t *p_bs,
{
p_cc->color_range = COLOR_RANGE_FULL;
p_cc->i_chroma = VLC_CODEC_I444;
+ p_cc->subsampling_x = 0;
+ p_cc->subsampling_y = 0;
}
else
{
@@ -210,12 +214,12 @@ static bool av1_parse_color_config(bs_t *p_bs,
if(BitDepth == 12)
{
p_cc->subsampling_x = bs_read1(p_bs);
- if(p_cc->subsampling_x)
- p_cc->subsampling_y = bs_read1(p_bs);
+ p_cc->subsampling_y = p_cc->subsampling_x ? bs_read1(p_bs) : 0;
}
else
{
p_cc->subsampling_x = 1;
+ p_cc->subsampling_y = 0;
}
p_cc->i_chroma = p_cc->subsampling_x ?
p_cc->subsampling_y ? VLC_CODEC_I420 :
@@ -223,9 +227,17 @@ static bool av1_parse_color_config(bs_t *p_bs,
VLC_CODEC_I444;
}
else if(seq_profile == 1)
+ {
p_cc->i_chroma = VLC_CODEC_I444;
+ p_cc->subsampling_x = 0;
+ p_cc->subsampling_y = 0;
+ }
else
+ {
p_cc->i_chroma = VLC_CODEC_I420;
+ p_cc->subsampling_x = 1;
+ p_cc->subsampling_y = 1;
+ }
if(p_cc->subsampling_x && p_cc->subsampling_y)
p_cc->chroma_sample_position = bs_read(p_bs, 2);
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b1e684c77a725884d315989a5341d0522d16d1db
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b1e684c77a725884d315989a5341d0522d16d1db
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list