[mono-video, bugfix] Don't signal uv_mode in monochrome mode BUG=aomedia:1337 Change-Id: I8ee53feb83cee8f722d76fd050a477ffe230a433
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c index 543fd56..9af2aa3 100644 --- a/av1/decoder/decodemv.c +++ b/av1/decoder/decodemv.c
@@ -1077,8 +1077,15 @@ mbmi->mode = read_intra_mode(r, get_y_mode_cdf(ec_ctx, above_mi, left_mi)); +#if CONFIG_MONO_VIDEO + if (!cm->seq_params.monochrome && + is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, + xd->plane[1].subsampling_y)) +#else if (is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, - xd->plane[1].subsampling_y)) { + xd->plane[1].subsampling_y)) +#endif // CONFIG_MONO_VIDEO + { #if !CONFIG_CFL mbmi->uv_mode = read_intra_mode_uv(ec_ctx, r, mbmi->mode); #else @@ -1384,8 +1391,15 @@ mbmi->mode = read_intra_mode(r, ec_ctx->y_mode_cdf[size_group_lookup[bsize]]); +#if CONFIG_MONO_VIDEO + if (!cm->seq_params.monochrome && + is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, + xd->plane[1].subsampling_y)) +#else if (is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, - xd->plane[1].subsampling_y)) { + xd->plane[1].subsampling_y)) +#endif // CONFIG_MONO_VIDEO + { #if !CONFIG_CFL mbmi->uv_mode = read_intra_mode_uv(ec_ctx, r, mbmi->mode); #else
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c index 289bb28..e7c6200 100644 --- a/av1/encoder/bitstream.c +++ b/av1/encoder/bitstream.c
@@ -1330,8 +1330,15 @@ if (!is_inter) { write_intra_mode(ec_ctx, bsize, mode, w); +#if CONFIG_MONO_VIDEO + if (!cm->seq_params.monochrome && + is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, + xd->plane[1].subsampling_y)) +#else if (is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, - xd->plane[1].subsampling_y)) { + xd->plane[1].subsampling_y)) +#endif // CONFIG_MONO_VIDEO + { #if !CONFIG_CFL write_intra_uv_mode(ec_ctx, mbmi->uv_mode, mode, w); #else @@ -1643,8 +1650,15 @@ write_intra_mode_kf(ec_ctx, mi, above_mi, left_mi, mbmi->mode, w); +#if CONFIG_MONO_VIDEO + if (!cm->seq_params.monochrome && + is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, + xd->plane[1].subsampling_y)) +#else if (is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, - xd->plane[1].subsampling_y)) { + xd->plane[1].subsampling_y)) +#endif // CONFIG_MONO_VIDEO + { #if !CONFIG_CFL write_intra_uv_mode(ec_ctx, mbmi->uv_mode, mbmi->mode, w); #else