From e931dac733665970949138933b73621e55b321cd Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Thu, 2 May 2013 13:00:33 -0700 Subject: Fix i4x4 mode reading and writing in sb8x8 bitstream. Don't allow i4x4 except for sb8x8 recursion step. Read only 4 (not 16) i4x4 submodes if we are i4x4. Change-Id: Iaaaced1a134006b2c96eed66f014300eae41e0ed --- vp9/decoder/vp9_decodemv.c | 9 +++++++-- vp9/encoder/vp9_bitstream.c | 4 ++++ vp9/encoder/vp9_encodeframe.c | 7 ++++++- 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'vp9') diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c index 55c67374a..6c3aad5f4 100644 --- a/vp9/decoder/vp9_decodemv.c +++ b/vp9/decoder/vp9_decodemv.c @@ -968,7 +968,12 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, // required for left and above block mv mv0->as_int = 0; - if (mbmi->sb_type > BLOCK_SIZE_MB16X16) { +#if CONFIG_SB8X8 + if (mbmi->sb_type > BLOCK_SIZE_SB8X8) +#else + if (mbmi->sb_type > BLOCK_SIZE_MB16X16) +#endif + { mbmi->mode = read_sb_ymode(r, cm->fc.sb_ymode_prob); cm->fc.sb_ymode_counts[mbmi->mode]++; } else { @@ -986,7 +991,7 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, if (m == B_CONTEXT_PRED) m -= CONTEXT_PRED_REPLACEMENTS; #endif cm->fc.bmode_counts[m]++; - } while (++j < 16); + } while (++j < (16 >> (2 * CONFIG_SB8X8))); } #if !CONFIG_SB8X8 diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c index f8e273364..197a49939 100644 --- a/vp9/encoder/vp9_bitstream.c +++ b/vp9/encoder/vp9_bitstream.c @@ -722,7 +722,11 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m, active_section = 6; #endif +#if CONFIG_SB8X8 + if (m->mbmi.sb_type > BLOCK_SIZE_SB8X8) +#else if (m->mbmi.sb_type > BLOCK_SIZE_MB16X16) +#endif write_sb_ymode(bc, mode, pc->fc.sb_ymode_prob); else write_ymode(bc, mode, pc->fc.ymode_prob); diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 0642c31bd..9e77f8125 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -2073,7 +2073,12 @@ static void sum_intra_stats(VP9_COMP *cpi, MACROBLOCK *x) { #endif #endif - if (xd->mode_info_context->mbmi.sb_type > BLOCK_SIZE_MB16X16) { +#if CONFIG_SB8X8 + if (xd->mode_info_context->mbmi.sb_type > BLOCK_SIZE_SB8X8) +#else + if (xd->mode_info_context->mbmi.sb_type > BLOCK_SIZE_MB16X16) +#endif + { ++cpi->sb_ymode_count[m]; } else { ++cpi->ymode_count[m]; -- cgit v1.2.3