From 4fbd678f99ddf6c08676db01f6f6bc719ad303f6 Mon Sep 17 00:00:00 2001 From: Julia Robson Date: Mon, 1 Feb 2016 15:44:50 +0000 Subject: [PATCH] Supertx fix for 422 colour subsampling Fixes assertion for football_422_4sif.y4m when supertx, var_tx and ext_tx are all enabled. Problem was after subsampling, the u and v blocks being encoded were no longer square. Change-Id: Ie626f30a2e64538d33343a26d5124a79a6f2b985 --- vp10/encoder/bitstream.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/vp10/encoder/bitstream.c b/vp10/encoder/bitstream.c index db2e8ee10..5c20c2c28 100644 --- a/vp10/encoder/bitstream.c +++ b/vp10/encoder/bitstream.c @@ -1513,9 +1513,18 @@ static void write_modes_sb(VP10_COMP *cpi, !m->mbmi.skip) { assert(*tok < tok_end); for (plane = 0; plane < MAX_MB_PLANE; ++plane) { + const int mbmi_txb_size = txsize_to_bsize[m->mbmi.tx_size]; + const int num_4x4_w = num_4x4_blocks_wide_lookup[mbmi_txb_size]; + const int num_4x4_h = num_4x4_blocks_high_lookup[mbmi_txb_size]; + int row, col; TX_SIZE tx = plane ? get_uv_tx_size(&m->mbmi, &xd->plane[plane]) : m->mbmi.tx_size; - pack_mb_tokens(w, tok, tok_end, cm->bit_depth, tx); + BLOCK_SIZE txb_size = txsize_to_bsize[tx]; + int bw = num_4x4_blocks_wide_lookup[txb_size]; + + for (row = 0; row < num_4x4_h; row += bw) + for (col = 0; col < num_4x4_w; col += bw) + pack_mb_tokens(w, tok, tok_end, cm->bit_depth, tx); assert(*tok < tok_end && (*tok)->token == EOSB_TOKEN); (*tok)++; } -- 2.40.0