| Index: source/libvpx/vp8/encoder/rdopt.c
|
| ===================================================================
|
| --- source/libvpx/vp8/encoder/rdopt.c (revision 172621)
|
| +++ source/libvpx/vp8/encoder/rdopt.c (working copy)
|
| @@ -14,7 +14,7 @@
|
| #include <limits.h>
|
| #include <assert.h>
|
| #include "vpx_config.h"
|
| -#include "vpx_rtcd.h"
|
| +#include "vp8_rtcd.h"
|
| #include "vp8/common/pragmas.h"
|
| #include "tokenize.h"
|
| #include "treewriter.h"
|
| @@ -625,6 +625,7 @@
|
| d[12] = p[12];
|
| }
|
| static int rd_pick_intra4x4block(
|
| + VP8_COMP *cpi,
|
| MACROBLOCK *x,
|
| BLOCK *be,
|
| BLOCKD *b,
|
| @@ -700,7 +701,7 @@
|
| return best_rd;
|
| }
|
|
|
| -static int rd_pick_intra4x4mby_modes(MACROBLOCK *mb, int *Rate,
|
| +static int rd_pick_intra4x4mby_modes(VP8_COMP *cpi, MACROBLOCK *mb, int *Rate,
|
| int *rate_y, int *Distortion, int best_rd)
|
| {
|
| MACROBLOCKD *const xd = &mb->e_mbd;
|
| @@ -740,7 +741,7 @@
|
| }
|
|
|
| total_rd += rd_pick_intra4x4block(
|
| - mb, mb->block + i, xd->block + i, &best_mode, bmode_costs,
|
| + cpi, mb, mb->block + i, xd->block + i, &best_mode, bmode_costs,
|
| ta + vp8_block2above[i],
|
| tl + vp8_block2left[i], &r, &ry, &d);
|
|
|
| @@ -765,7 +766,8 @@
|
| }
|
|
|
|
|
| -static int rd_pick_intra16x16mby_mode(MACROBLOCK *x,
|
| +static int rd_pick_intra16x16mby_mode(VP8_COMP *cpi,
|
| + MACROBLOCK *x,
|
| int *Rate,
|
| int *rate_y,
|
| int *Distortion)
|
| @@ -867,8 +869,7 @@
|
| return RDCOST(x->rdmult, x->rddiv, *rate, *distortion);
|
| }
|
|
|
| -static void rd_pick_intra_mbuv_mode(MACROBLOCK *x, int *rate,
|
| - int *rate_tokenonly, int *distortion)
|
| +static void rd_pick_intra_mbuv_mode(VP8_COMP *cpi, MACROBLOCK *x, int *rate, int *rate_tokenonly, int *distortion)
|
| {
|
| MB_PREDICTION_MODE mode;
|
| MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(mode_selected);
|
| @@ -1738,18 +1739,18 @@
|
| {
|
| if (x->partition_info->bmi[i].mode == NEW4X4)
|
| {
|
| - x->MVcount[0][mv_max+((x->partition_info->bmi[i].mv.as_mv.row
|
| + cpi->MVcount[0][mv_max+((x->partition_info->bmi[i].mv.as_mv.row
|
| - best_ref_mv->as_mv.row) >> 1)]++;
|
| - x->MVcount[1][mv_max+((x->partition_info->bmi[i].mv.as_mv.col
|
| + cpi->MVcount[1][mv_max+((x->partition_info->bmi[i].mv.as_mv.col
|
| - best_ref_mv->as_mv.col) >> 1)]++;
|
| }
|
| }
|
| }
|
| else if (x->e_mbd.mode_info_context->mbmi.mode == NEWMV)
|
| {
|
| - x->MVcount[0][mv_max+((x->e_mbd.mode_info_context->mbmi.mv.as_mv.row
|
| + cpi->MVcount[0][mv_max+((x->e_mbd.mode_info_context->mbmi.mv.as_mv.row
|
| - best_ref_mv->as_mv.row) >> 1)]++;
|
| - x->MVcount[1][mv_max+((x->e_mbd.mode_info_context->mbmi.mv.as_mv.col
|
| + cpi->MVcount[1][mv_max+((x->e_mbd.mode_info_context->mbmi.mv.as_mv.col
|
| - best_ref_mv->as_mv.col) >> 1)]++;
|
| }
|
| }
|
| @@ -2119,7 +2120,7 @@
|
|
|
| if(!uv_intra_done && this_ref_frame == INTRA_FRAME)
|
| {
|
| - rd_pick_intra_mbuv_mode(x, &uv_intra_rate,
|
| + rd_pick_intra_mbuv_mode(cpi, x, &uv_intra_rate,
|
| &uv_intra_rate_tokenonly,
|
| &uv_intra_distortion);
|
| uv_intra_mode = x->e_mbd.mode_info_context->mbmi.uv_mode;
|
| @@ -2145,7 +2146,7 @@
|
| * coding the BPRED mode: x->mbmode_cost[x->e_mbd.frame_type][BPRED]
|
| */
|
| int distortion;
|
| - tmp_rd = rd_pick_intra4x4mby_modes(x, &rate, &rd.rate_y, &distortion, best_mode.yrd);
|
| + tmp_rd = rd_pick_intra4x4mby_modes(cpi, x, &rate, &rd.rate_y, &distortion, best_mode.yrd);
|
| rd.rate2 += rate;
|
| rd.distortion2 += distortion;
|
|
|
| @@ -2594,7 +2595,7 @@
|
| rd_update_mvcount(cpi, x, &best_ref_mv);
|
| }
|
|
|
| -void vp8_rd_pick_intra_mode(MACROBLOCK *x, int *rate_)
|
| +void vp8_rd_pick_intra_mode(VP8_COMP *cpi, MACROBLOCK *x, int *rate_)
|
| {
|
| int error4x4, error16x16;
|
| int rate4x4, rate16x16 = 0, rateuv;
|
| @@ -2606,13 +2607,15 @@
|
|
|
| x->e_mbd.mode_info_context->mbmi.ref_frame = INTRA_FRAME;
|
|
|
| - rd_pick_intra_mbuv_mode(x, &rateuv, &rateuv_tokenonly, &distuv);
|
| + rd_pick_intra_mbuv_mode(cpi, x, &rateuv, &rateuv_tokenonly, &distuv);
|
| rate = rateuv;
|
|
|
| - error16x16 = rd_pick_intra16x16mby_mode(x, &rate16x16, &rate16x16_tokenonly,
|
| + error16x16 = rd_pick_intra16x16mby_mode(cpi, x,
|
| + &rate16x16, &rate16x16_tokenonly,
|
| &dist16x16);
|
|
|
| - error4x4 = rd_pick_intra4x4mby_modes(x, &rate4x4, &rate4x4_tokenonly,
|
| + error4x4 = rd_pick_intra4x4mby_modes(cpi, x,
|
| + &rate4x4, &rate4x4_tokenonly,
|
| &dist4x4, error16x16);
|
|
|
| if (error4x4 < error16x16)
|
|
|