2010-05-18 17:58:33 +02:00
|
|
|
/*
|
2010-09-09 14:16:39 +02:00
|
|
|
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
2010-05-18 17:58:33 +02:00
|
|
|
*
|
2010-06-18 18:39:21 +02:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
2010-06-04 22:19:40 +02:00
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
2010-06-18 18:39:21 +02:00
|
|
|
* in the file PATENTS. All contributing project authors may
|
2010-06-04 22:19:40 +02:00
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2010-05-18 17:58:33 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "vpx_ports/config.h"
|
2012-10-28 18:38:23 +01:00
|
|
|
#include "vpx_rtcd.h"
|
2012-11-01 19:09:58 +01:00
|
|
|
#include "vp9/common/idct.h"
|
2010-05-18 17:58:33 +02:00
|
|
|
#include "quantize.h"
|
2012-11-01 19:09:58 +01:00
|
|
|
#include "vp9/common/reconintra.h"
|
|
|
|
#include "vp9/common/reconintra4x4.h"
|
2010-05-18 17:58:33 +02:00
|
|
|
#include "encodemb.h"
|
2012-11-01 19:09:58 +01:00
|
|
|
#include "vp9/common/invtrans.h"
|
2010-05-18 17:58:33 +02:00
|
|
|
#include "encodeintra.h"
|
|
|
|
|
|
|
|
#if CONFIG_RUNTIME_CPU_DETECT
|
|
|
|
#define IF_RTCD(x) (x)
|
|
|
|
#else
|
|
|
|
#define IF_RTCD(x) NULL
|
|
|
|
#endif
|
2011-05-20 03:37:13 +02:00
|
|
|
|
2012-10-31 01:53:32 +01:00
|
|
|
int vp9_encode_intra(VP9_COMP *cpi, MACROBLOCK *x, int use_16x16_pred) {
|
2012-07-14 00:21:29 +02:00
|
|
|
int i;
|
|
|
|
int intra_pred_var = 0;
|
2012-08-10 15:12:43 +02:00
|
|
|
MB_MODE_INFO * mbmi = &x->e_mbd.mode_info_context->mbmi;
|
2012-07-14 00:21:29 +02:00
|
|
|
(void) cpi;
|
2011-06-14 12:39:06 +02:00
|
|
|
|
2012-07-14 00:21:29 +02:00
|
|
|
if (use_16x16_pred) {
|
2012-08-10 15:12:43 +02:00
|
|
|
mbmi->mode = DC_PRED;
|
2012-02-29 02:12:08 +01:00
|
|
|
#if CONFIG_COMP_INTRA_PRED
|
2012-08-10 15:12:43 +02:00
|
|
|
mbmi->second_mode = (MB_PREDICTION_MODE)(DC_PRED - 1);
|
2012-02-29 02:12:08 +01:00
|
|
|
#endif
|
2012-08-10 15:12:43 +02:00
|
|
|
mbmi->uv_mode = DC_PRED;
|
|
|
|
mbmi->ref_frame = INTRA_FRAME;
|
2012-07-14 00:21:29 +02:00
|
|
|
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_encode_intra16x16mby(IF_RTCD(&cpi->rtcd), x);
|
2012-07-14 00:21:29 +02:00
|
|
|
} else {
|
|
|
|
for (i = 0; i < 16; i++) {
|
|
|
|
x->e_mbd.block[i].bmi.as_mode.first = B_DC_PRED;
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_encode_intra4x4block(IF_RTCD(&cpi->rtcd), x, i);
|
2011-06-14 12:39:06 +02:00
|
|
|
}
|
2012-07-14 00:21:29 +02:00
|
|
|
}
|
2011-06-14 12:39:06 +02:00
|
|
|
|
2012-10-30 20:58:42 +01:00
|
|
|
intra_pred_var = vp9_get_mb_ss(x->src_diff);
|
2011-06-14 12:39:06 +02:00
|
|
|
|
2012-07-14 00:21:29 +02:00
|
|
|
return intra_pred_var;
|
2011-06-14 12:39:06 +02:00
|
|
|
}
|
2011-05-20 03:37:13 +02:00
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
void vp9_encode_intra4x4block(const VP9_ENCODER_RTCD *rtcd,
|
2012-07-14 00:21:29 +02:00
|
|
|
MACROBLOCK *x, int ib) {
|
|
|
|
BLOCKD *b = &x->e_mbd.block[ib];
|
|
|
|
BLOCK *be = &x->block[ib];
|
2012-10-16 01:41:41 +02:00
|
|
|
TX_TYPE tx_type;
|
2011-05-20 03:37:13 +02:00
|
|
|
|
2012-02-29 02:12:08 +01:00
|
|
|
#if CONFIG_COMP_INTRA_PRED
|
2012-07-14 00:21:29 +02:00
|
|
|
if (b->bmi.as_mode.second == (B_PREDICTION_MODE)(B_DC_PRED - 1)) {
|
2012-02-29 02:12:08 +01:00
|
|
|
#endif
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_intra4x4_predict(b, b->bmi.as_mode.first, b->predictor);
|
2012-02-29 02:12:08 +01:00
|
|
|
#if CONFIG_COMP_INTRA_PRED
|
2012-07-14 00:21:29 +02:00
|
|
|
} else {
|
2012-10-31 22:40:53 +01:00
|
|
|
vp9_comp_intra4x4_predict(b, b->bmi.as_mode.first, b->bmi.as_mode.second,
|
2012-10-14 03:49:44 +02:00
|
|
|
b->predictor);
|
2012-07-14 00:21:29 +02:00
|
|
|
}
|
2012-02-29 02:12:08 +01:00
|
|
|
#endif
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_subtract_b(be, b, 16);
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-10-16 01:41:41 +02:00
|
|
|
tx_type = get_tx_type(&x->e_mbd, b);
|
|
|
|
if (tx_type != DCT_DCT) {
|
2012-10-31 17:38:51 +01:00
|
|
|
vp9_fht(be->src_diff, 32, be->coeff, tx_type, 4);
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_ht_quantize_b_4x4(be, b, tx_type);
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_ihtllm_c(b->dqcoeff, b->diff, 32, tx_type, 4);
|
2012-10-22 20:55:29 +02:00
|
|
|
} else {
|
2012-10-30 22:25:33 +01:00
|
|
|
x->vp9_short_fdct4x4(be->src_diff, be->coeff, 32);
|
2012-10-13 06:41:58 +02:00
|
|
|
x->quantize_b_4x4(be, b) ;
|
2012-11-01 00:09:17 +01:00
|
|
|
vp9_inverse_transform_b_4x4(IF_RTCD(&rtcd->common->idct), b, 32);
|
2012-09-10 07:42:35 +02:00
|
|
|
}
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_recon_b(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
void vp9_encode_intra4x4mby(const VP9_ENCODER_RTCD *rtcd, MACROBLOCK *mb) {
|
2012-07-14 00:21:29 +02:00
|
|
|
int i;
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-07-14 00:21:29 +02:00
|
|
|
for (i = 0; i < 16; i++)
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_encode_intra4x4block(rtcd, mb, i);
|
2012-07-14 00:21:29 +02:00
|
|
|
return;
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
void vp9_encode_intra16x16mby(const VP9_ENCODER_RTCD *rtcd, MACROBLOCK *x) {
|
2012-10-13 18:27:54 +02:00
|
|
|
MACROBLOCKD *xd = &x->e_mbd;
|
2012-07-14 00:21:29 +02:00
|
|
|
BLOCK *b = &x->block[0];
|
2012-10-13 18:27:54 +02:00
|
|
|
TX_SIZE tx_size = xd->mode_info_context->mbmi.txfm_size;
|
2012-10-16 01:41:41 +02:00
|
|
|
TX_TYPE tx_type;
|
2011-11-04 19:29:51 +01:00
|
|
|
|
2012-02-29 02:12:08 +01:00
|
|
|
#if CONFIG_COMP_INTRA_PRED
|
2012-10-13 18:27:54 +02:00
|
|
|
if (xd->mode_info_context->mbmi.second_mode == (MB_PREDICTION_MODE)(DC_PRED - 1))
|
2012-02-29 02:12:08 +01:00
|
|
|
#endif
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_build_intra_predictors_mby(xd);
|
2012-02-29 02:12:08 +01:00
|
|
|
#if CONFIG_COMP_INTRA_PRED
|
2012-07-14 00:21:29 +02:00
|
|
|
else
|
2012-10-31 22:40:53 +01:00
|
|
|
vp9_build_comp_intra_predictors_mby(xd);
|
2012-02-29 02:12:08 +01:00
|
|
|
#endif
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_subtract_mby(x->src_diff, *(b->base_src), xd->predictor, b->src_stride);
|
2011-11-04 19:29:51 +01:00
|
|
|
|
2012-10-13 18:27:54 +02:00
|
|
|
if (tx_size == TX_16X16) {
|
2012-10-16 01:41:41 +02:00
|
|
|
BLOCKD *bd = &xd->block[0];
|
|
|
|
tx_type = get_tx_type(xd, bd);
|
|
|
|
if (tx_type != DCT_DCT) {
|
2012-10-31 17:38:51 +01:00
|
|
|
vp9_fht(b->src_diff, 32, b->coeff, tx_type, 16);
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_quantize_mby_16x16(x);
|
2012-10-13 18:27:54 +02:00
|
|
|
if (x->optimize)
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_optimize_mby_16x16(x, rtcd);
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_ihtllm_c(bd->dqcoeff, bd->diff, 32, tx_type, 16);
|
2012-10-22 20:55:29 +02:00
|
|
|
} else {
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_transform_mby_16x16(x);
|
|
|
|
vp9_quantize_mby_16x16(x);
|
2012-10-13 18:27:54 +02:00
|
|
|
if (x->optimize)
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_optimize_mby_16x16(x, rtcd);
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_inverse_transform_mby_16x16(IF_RTCD(&rtcd->common->idct), xd);
|
2012-10-13 18:27:54 +02:00
|
|
|
}
|
|
|
|
} else if (tx_size == TX_8X8) {
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_transform_mby_8x8(x);
|
|
|
|
vp9_quantize_mby_8x8(x);
|
2012-10-13 18:27:54 +02:00
|
|
|
if (x->optimize)
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_optimize_mby_8x8(x, rtcd);
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_inverse_transform_mby_8x8(IF_RTCD(&rtcd->common->idct), xd);
|
2012-10-13 18:27:54 +02:00
|
|
|
} else {
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_transform_mby_4x4(x);
|
|
|
|
vp9_quantize_mby_4x4(x);
|
2012-10-13 18:27:54 +02:00
|
|
|
if (x->optimize)
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_optimize_mby_4x4(x, rtcd);
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_inverse_transform_mby_4x4(IF_RTCD(&rtcd->common->idct), xd);
|
2012-07-14 00:21:29 +02:00
|
|
|
}
|
|
|
|
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_recon_mby(xd);
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
void vp9_encode_intra16x16mbuv(const VP9_ENCODER_RTCD *rtcd, MACROBLOCK *x) {
|
2012-10-13 18:27:54 +02:00
|
|
|
MACROBLOCKD *xd = &x->e_mbd;
|
|
|
|
TX_SIZE tx_size = xd->mode_info_context->mbmi.txfm_size;
|
|
|
|
|
2012-02-29 02:12:08 +01:00
|
|
|
#if CONFIG_COMP_INTRA_PRED
|
2012-10-13 18:27:54 +02:00
|
|
|
if (xd->mode_info_context->mbmi.second_uv_mode == (MB_PREDICTION_MODE)(DC_PRED - 1)) {
|
2011-11-04 19:29:51 +01:00
|
|
|
#endif
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_build_intra_predictors_mbuv(xd);
|
2012-02-29 02:12:08 +01:00
|
|
|
#if CONFIG_COMP_INTRA_PRED
|
2012-07-14 00:21:29 +02:00
|
|
|
} else {
|
2012-10-31 22:40:53 +01:00
|
|
|
vp9_build_comp_intra_predictors_mbuv(xd);
|
2012-07-14 00:21:29 +02:00
|
|
|
}
|
2012-02-29 02:12:08 +01:00
|
|
|
#endif
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_subtract_mbuv(x->src_diff, x->src.u_buffer, x->src.v_buffer,
|
2012-10-28 18:38:23 +01:00
|
|
|
xd->predictor, x->src.uv_stride);
|
|
|
|
|
2012-10-13 18:27:54 +02:00
|
|
|
if (tx_size == TX_4X4) {
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_transform_mbuv_4x4(x);
|
|
|
|
vp9_quantize_mbuv_4x4(x);
|
2012-10-13 18:27:54 +02:00
|
|
|
if (x->optimize)
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_optimize_mbuv_4x4(x, rtcd);
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_inverse_transform_mbuv_4x4(IF_RTCD(&rtcd->common->idct), xd);
|
2012-10-13 18:27:54 +02:00
|
|
|
} else /* 16x16 or 8x8 */ {
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_transform_mbuv_8x8(x);
|
|
|
|
vp9_quantize_mbuv_8x8(x);
|
2012-10-13 18:27:54 +02:00
|
|
|
if (x->optimize)
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_optimize_mbuv_8x8(x, rtcd);
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_inverse_transform_mbuv_8x8(IF_RTCD(&rtcd->common->idct), xd);
|
2012-07-14 00:21:29 +02:00
|
|
|
}
|
|
|
|
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_recon_intra_mbuv(xd);
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|
2011-08-05 01:30:27 +02:00
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
void vp9_encode_intra8x8(const VP9_ENCODER_RTCD *rtcd,
|
2012-07-14 00:21:29 +02:00
|
|
|
MACROBLOCK *x, int ib) {
|
2012-10-11 02:18:22 +02:00
|
|
|
MACROBLOCKD *xd = &x->e_mbd;
|
|
|
|
BLOCKD *b = &xd->block[ib];
|
2012-07-14 00:21:29 +02:00
|
|
|
BLOCK *be = &x->block[ib];
|
|
|
|
const int iblock[4] = {0, 1, 4, 5};
|
|
|
|
int i;
|
2012-10-16 01:41:41 +02:00
|
|
|
TX_TYPE tx_type;
|
2011-08-05 01:30:27 +02:00
|
|
|
|
2012-02-29 02:12:08 +01:00
|
|
|
#if CONFIG_COMP_INTRA_PRED
|
2012-07-14 00:21:29 +02:00
|
|
|
if (b->bmi.as_mode.second == (MB_PREDICTION_MODE)(DC_PRED - 1)) {
|
2012-02-29 02:12:08 +01:00
|
|
|
#endif
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_intra8x8_predict(b, b->bmi.as_mode.first, b->predictor);
|
2012-02-29 02:12:08 +01:00
|
|
|
#if CONFIG_COMP_INTRA_PRED
|
2012-07-14 00:21:29 +02:00
|
|
|
} else {
|
2012-10-31 22:40:53 +01:00
|
|
|
vp9_comp_intra8x8_predict(b, b->bmi.as_mode.first, b->bmi.as_mode.second,
|
2012-10-14 03:49:44 +02:00
|
|
|
b->predictor);
|
2012-07-14 00:21:29 +02:00
|
|
|
}
|
2012-02-29 02:12:08 +01:00
|
|
|
#endif
|
2011-08-05 01:30:27 +02:00
|
|
|
|
2012-10-13 18:27:54 +02:00
|
|
|
if (xd->mode_info_context->mbmi.txfm_size == TX_8X8) {
|
2012-08-01 19:18:25 +02:00
|
|
|
int idx = (ib & 0x02) ? (ib + 2) : ib;
|
|
|
|
|
|
|
|
// generate residual blocks
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_subtract_4b_c(be, b, 16);
|
2012-08-02 18:07:33 +02:00
|
|
|
|
2012-10-20 00:12:12 +02:00
|
|
|
tx_type = get_tx_type(xd, xd->block + idx);
|
2012-10-16 01:41:41 +02:00
|
|
|
if (tx_type != DCT_DCT) {
|
2012-10-31 17:38:51 +01:00
|
|
|
vp9_fht(be->src_diff, 32, (x->block + idx)->coeff,
|
2012-10-16 01:41:41 +02:00
|
|
|
tx_type, 8);
|
|
|
|
x->quantize_b_8x8(x->block + idx, xd->block + idx);
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_ihtllm_c(xd->block[idx].dqcoeff, xd->block[ib].diff, 32,
|
2012-10-16 01:41:41 +02:00
|
|
|
tx_type, 8);
|
|
|
|
} else {
|
2012-10-30 20:58:42 +01:00
|
|
|
x->vp9_short_fdct8x8(be->src_diff, (x->block + idx)->coeff, 32);
|
2012-10-16 01:41:41 +02:00
|
|
|
x->quantize_b_8x8(x->block + idx, xd->block + idx);
|
2012-10-31 22:40:53 +01:00
|
|
|
vp9_idct_idct8(xd->block[idx].dqcoeff, xd->block[ib].diff, 32);
|
2012-10-16 01:41:41 +02:00
|
|
|
}
|
2012-10-11 02:18:22 +02:00
|
|
|
} else {
|
2012-08-01 19:18:25 +02:00
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
b = &xd->block[ib + iblock[i]];
|
2012-10-11 02:18:22 +02:00
|
|
|
be = &x->block[ib + iblock[i]];
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_subtract_b(be, b, 16);
|
|
|
|
x->vp9_short_fdct4x4(be->src_diff, be->coeff, 32);
|
2012-10-13 06:41:58 +02:00
|
|
|
x->quantize_b_4x4(be, b);
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_inverse_transform_b_4x4(IF_RTCD(&rtcd->common->idct), b, 32);
|
2012-08-01 19:18:25 +02:00
|
|
|
}
|
|
|
|
}
|
2012-10-11 02:18:22 +02:00
|
|
|
|
|
|
|
// reconstruct submacroblock
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
b = &xd->block[ib + iblock[i]];
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_recon_b_c(b->predictor, b->diff, *(b->base_dst) + b->dst,
|
2012-10-11 02:18:22 +02:00
|
|
|
b->dst_stride);
|
|
|
|
}
|
2011-08-05 01:30:27 +02:00
|
|
|
}
|
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
void vp9_encode_intra8x8mby(const VP9_ENCODER_RTCD *rtcd, MACROBLOCK *x) {
|
2012-07-14 00:21:29 +02:00
|
|
|
int i, ib;
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++) {
|
2012-10-31 01:12:12 +01:00
|
|
|
ib = vp9_i8x8_block[i];
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_encode_intra8x8(rtcd, x, ib);
|
2012-07-14 00:21:29 +02:00
|
|
|
}
|
2011-08-05 01:30:27 +02:00
|
|
|
}
|
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
void vp9_encode_intra_uv4x4(const VP9_ENCODER_RTCD *rtcd,
|
2012-07-14 00:21:29 +02:00
|
|
|
MACROBLOCK *x, int ib,
|
|
|
|
int mode, int second) {
|
|
|
|
BLOCKD *b = &x->e_mbd.block[ib];
|
|
|
|
BLOCK *be = &x->block[ib];
|
2011-08-05 01:30:27 +02:00
|
|
|
|
2012-02-29 02:12:08 +01:00
|
|
|
#if CONFIG_COMP_INTRA_PRED
|
2012-07-14 00:21:29 +02:00
|
|
|
if (second == -1) {
|
2012-02-29 02:12:08 +01:00
|
|
|
#endif
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_intra_uv4x4_predict(b, mode, b->predictor);
|
2012-02-29 02:12:08 +01:00
|
|
|
#if CONFIG_COMP_INTRA_PRED
|
2012-07-14 00:21:29 +02:00
|
|
|
} else {
|
2012-10-31 22:40:53 +01:00
|
|
|
vp9_comp_intra_uv4x4_predict(b, mode, second, b->predictor);
|
2012-07-14 00:21:29 +02:00
|
|
|
}
|
2012-02-29 02:12:08 +01:00
|
|
|
#endif
|
2011-08-05 01:30:27 +02:00
|
|
|
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_subtract_b(be, b, 8);
|
2011-08-05 01:30:27 +02:00
|
|
|
|
2012-10-30 20:58:42 +01:00
|
|
|
x->vp9_short_fdct4x4(be->src_diff, be->coeff, 16);
|
2012-10-13 06:41:58 +02:00
|
|
|
x->quantize_b_4x4(be, b);
|
2012-10-31 00:25:53 +01:00
|
|
|
vp9_inverse_transform_b_4x4(IF_RTCD(&rtcd->common->idct), b, 16);
|
2011-08-05 01:30:27 +02:00
|
|
|
|
2012-11-01 00:09:17 +01:00
|
|
|
vp9_recon_uv_b_c(b->predictor, b->diff, *(b->base_dst) + b->dst,
|
|
|
|
b->dst_stride);
|
2011-08-05 01:30:27 +02:00
|
|
|
}
|
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
void vp9_encode_intra8x8mbuv(const VP9_ENCODER_RTCD *rtcd, MACROBLOCK *x) {
|
2012-07-14 00:21:29 +02:00
|
|
|
int i, ib, mode, second;
|
|
|
|
BLOCKD *b;
|
2012-10-13 18:27:54 +02:00
|
|
|
|
2012-07-14 00:21:29 +02:00
|
|
|
for (i = 0; i < 4; i++) {
|
2012-10-31 01:12:12 +01:00
|
|
|
ib = vp9_i8x8_block[i];
|
2012-07-14 00:21:29 +02:00
|
|
|
b = &x->e_mbd.block[ib];
|
|
|
|
mode = b->bmi.as_mode.first;
|
2012-02-29 02:12:08 +01:00
|
|
|
#if CONFIG_COMP_INTRA_PRED
|
2012-07-14 00:21:29 +02:00
|
|
|
second = b->bmi.as_mode.second;
|
2012-02-29 02:12:08 +01:00
|
|
|
#else
|
2012-07-14 00:21:29 +02:00
|
|
|
second = -1;
|
2012-02-29 02:12:08 +01:00
|
|
|
#endif
|
2012-07-14 00:21:29 +02:00
|
|
|
/*u */
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_encode_intra_uv4x4(rtcd, x, i + 16, mode, second);
|
2012-07-14 00:21:29 +02:00
|
|
|
/*v */
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_encode_intra_uv4x4(rtcd, x, i + 20, mode, second);
|
2012-07-14 00:21:29 +02:00
|
|
|
}
|
2011-08-05 01:30:27 +02:00
|
|
|
}
|