Commit a20943c5 authored by Yaowu Xu's avatar Yaowu Xu

misc-fix: colorspace/profile bits for intra-only

This commit merges the fix of adding colorspace and profile related
bits in intra-only frames.

Related tracking issue:
https://bugs.chromium.org/p/webm/issues/detail?id=1087
Original libvpx commit:
2a388b53

Change-Id: I9c4fc4efcb5ebdecd6bb15e804dbcc7cc1dfbe58
parent 27c67ac0
......@@ -1854,25 +1854,8 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
if (!av1_read_sync_code(rb))
aom_internal_error(&cm->error, AOM_CODEC_UNSUP_BITSTREAM,
"Invalid frame sync code");
#if CONFIG_MISC_FIXES
read_bitdepth_colorspace_sampling(cm, rb);
#else
if (cm->profile > PROFILE_0) {
read_bitdepth_colorspace_sampling(cm, rb);
} else {
// NOTE: The intra-only frame header does not include the specification
// of either the color format or color sub-sampling in profile 0. AV1
// specifies that the default color format should be YUV 4:2:0 in this
// case (normative).
cm->color_space = AOM_CS_BT_601;
cm->color_range = 0;
cm->subsampling_y = cm->subsampling_x = 1;
cm->bit_depth = AOM_BITS_8;
#if CONFIG_AOM_HIGHBITDEPTH
cm->use_highbitdepth = 0;
#endif
}
#endif
pbi->refresh_frame_flags = aom_rb_read_literal(rb, REF_FRAMES);
setup_frame_size(cm, rb);
......
......@@ -2087,15 +2087,7 @@ static void write_uncompressed_header(AV1_COMP *cpi,
if (cm->intra_only) {
write_sync_code(wb);
#if CONFIG_MISC_FIXES
write_bitdepth_colorspace_sampling(cm, wb);
#else
// Note for profile 0, 420 8bpp is assumed.
if (cm->profile > PROFILE_0) {
write_bitdepth_colorspace_sampling(cm, wb);
}
#endif
#if CONFIG_EXT_REFS
aom_wb_write_literal(wb, cpi->refresh_frame_mask, REF_FRAMES);
......
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