ref: 61e65862308aa8de88fb4eca93195d3c4f461265
parent: 30226a658f7e9c36aa8bb259af167b07ab4e2f25
parent: f04b15486ad70d198ab8a319f3eb9986d5ee24a8
author: Jingning Han <[email protected]>
date: Wed Jun 5 17:47:00 EDT 2013
Merge "Fix UV intra coding rd loop" into experimental
--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -622,6 +622,7 @@
BLOCK_SIZE_TYPE bsize,
int ss_txfrm_size,
void *arg);
+
static INLINE void foreach_transformed_block_in_plane(
const MACROBLOCKD* const xd, BLOCK_SIZE_TYPE bsize, int plane,
foreach_transformed_block_visitor visit, void *arg) {
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -871,7 +871,10 @@
int *skippable, BLOCK_SIZE_TYPE bsize,
TX_SIZE uv_tx_size) {
MACROBLOCKD *const xd = &x->e_mbd;
- vp9_xform_quant_sbuv(cm, x, bsize);
+ if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
+ vp9_encode_intra_block_uv(cm, x, bsize);
+ else
+ vp9_xform_quant_sbuv(cm, x, bsize);
*distortion = block_error_sbuv(x, bsize, uv_tx_size == TX_32X32 ? 0 : 2);
*rate = rdcost_uv(cm, x, bsize, uv_tx_size);
@@ -884,7 +887,8 @@
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi;
- vp9_subtract_sbuv(x, bsize);
+ if (mbmi->ref_frame > INTRA_FRAME)
+ vp9_subtract_sbuv(x, bsize);
if (mbmi->txfm_size >= TX_32X32 && bsize >= BLOCK_SIZE_SB64X64) {
super_block_uvrd_for_txfm(cm, x, rate, distortion, skippable, bsize,
@@ -913,8 +917,6 @@
for (mode = DC_PRED; mode <= TM_PRED; mode++) {
x->e_mbd.mode_info_context->mbmi.uv_mode = mode;
- vp9_build_intra_predictors_sbuv_s(&x->e_mbd, bsize);
-
super_block_uvrd(&cpi->common, x, &this_rate_tokenonly,
&this_distortion, &s, bsize);
this_rate = this_rate_tokenonly +
@@ -2565,6 +2567,7 @@
if (cpi->speed == 0
|| (cpi->speed > 0 && (ref_frame_mask & (1 << INTRA_FRAME)))) {
mbmi->mode = DC_PRED;
+ mbmi->ref_frame = INTRA_FRAME;
for (i = 0; i <= (bsize < BLOCK_SIZE_MB16X16 ? TX_4X4 :
(bsize < BLOCK_SIZE_SB32X32 ? TX_8X8 :
(bsize < BLOCK_SIZE_SB64X64 ? TX_16X16 : TX_32X32)));