summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_encodemb.c
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2013-05-17 12:50:40 -0700
committerPaul Wilkins <paulwilkins@google.com>2013-05-22 11:53:19 +0100
commit8ba92a0bed9f05b79851b364c4fafd97ac88e824 (patch)
tree7992dafde6cea94a4b38cceb6dce02df628354c3 /vp9/encoder/vp9_encodemb.c
parent232d90d8fd47cdc07625036bdd0e4c8f009b8c10 (diff)
downloadlibvpx-8ba92a0bed9f05b79851b364c4fafd97ac88e824.tar
libvpx-8ba92a0bed9f05b79851b364c4fafd97ac88e824.tar.gz
libvpx-8ba92a0bed9f05b79851b364c4fafd97ac88e824.tar.bz2
libvpx-8ba92a0bed9f05b79851b364c4fafd97ac88e824.zip
changes intra coding to be based on txfm block
This commit changed the encoding and decoding of intra blocks to be based on transform block. In each prediction block, the intra coding iterates thorough each transform block based on raster scan order. This commit also fixed a bug in D135 prediction code. TODO next: The RD mode/txfm_size selection should take this into account when computing RD values. Change-Id: I6d1be2faa4c4948a52e830b6a9a84a6b2b6850f6
Diffstat (limited to 'vp9/encoder/vp9_encodemb.c')
-rw-r--r--vp9/encoder/vp9_encodemb.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c
index d9cd09163..a4991f21a 100644
--- a/vp9/encoder/vp9_encodemb.c
+++ b/vp9/encoder/vp9_encodemb.c
@@ -628,16 +628,23 @@ static void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
const int txfm_b_size = 4 << tx_size;
int ib = raster_block;
+ int tx_ib = ib >> tx_size;
+ int plane_b_size;
TX_TYPE tx_type;
+ int mode, b_mode;
- if (tx_size <= TX_16X16)
- tx_type = txfm_map(xd->mode_info_context->bmi[ib].as_mode.first);
+ mode = plane == 0? xd->mode_info_context->mbmi.mode:
+ xd->mode_info_context->mbmi.uv_mode;
+ if (bsize <= BLOCK_SIZE_SB8X8 && mode == I4X4_PRED && plane == 0)
+ b_mode = xd->mode_info_context->bmi[ib].as_mode.first;
else
- tx_type = DCT_DCT;
+ b_mode = mode;
- vp9_predict_intra_block(&x->e_mbd, ib, bsize, tx_size,
- xd->mode_info_context->bmi[ib].as_mode.first,
+ assert(b_mode >= B_DC_PRED && b_mode <= B_TM_PRED);
+
+ plane_b_size = b_width_log2(bsize) - xd->plane[plane].subsampling_x;
+ vp9_predict_intra_block(xd, tx_ib, plane_b_size, tx_size, b_mode,
dst, xd->plane[plane].dst.stride);
vp9_subtract_block(txfm_b_size, txfm_b_size,
src_diff, bw,
@@ -650,7 +657,6 @@ static void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
if (x->optimize)
vp9_optimize_b(plane, block, bsize, ss_txfrm_size, args->cm, x, args->ctx);
*/
-
switch (ss_txfrm_size / 2) {
case TX_32X32:
vp9_short_idct32x32_add(BLOCK_OFFSET(xd->plane[plane].dqcoeff,
@@ -695,8 +701,8 @@ static void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
}
}
-void vp9_encode_intra4x4mby(VP9_COMMON *const cm, MACROBLOCK *x,
- BLOCK_SIZE_TYPE bsize) {
+void vp9_encode_intra_block_y(VP9_COMMON *const cm, MACROBLOCK *x,
+ BLOCK_SIZE_TYPE bsize) {
MACROBLOCKD* const xd = &x->e_mbd;
struct optimize_ctx ctx;
struct encode_b_args arg = {cm, x, &ctx};
@@ -704,4 +710,12 @@ void vp9_encode_intra4x4mby(VP9_COMMON *const cm, MACROBLOCK *x,
foreach_transformed_block_in_plane(xd, bsize, 0,
encode_block_intra, &arg);
}
+void vp9_encode_intra_block_uv(VP9_COMMON *const cm, MACROBLOCK *x,
+ BLOCK_SIZE_TYPE bsize) {
+ MACROBLOCKD* const xd = &x->e_mbd;
+ struct optimize_ctx ctx;
+ struct encode_b_args arg = {cm, x, &ctx};
+
+ foreach_transformed_block_uv(xd, bsize, encode_block_intra, &arg);
+}