Merged NEWNEAR experiment
This commit merges the NEWNEAR experiment such that it is effectively always on. The fact that there were changes in the threading code again highlights the need to strip out such features during the bitstream development phase as trying to maintain this code (especially as it is not being tested) slows the development cycle. Change-Id: I8b34950a1333231ced9928aa11cd6d6459984b65
This commit is contained in:
parent
82b865da94
commit
9c9300f56f
@ -136,7 +136,7 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
|
||||
oci->mi = oci->mip + oci->mode_info_stride + 1;
|
||||
|
||||
/* allocate memory for last frame MODE_INFO array */
|
||||
#if CONFIG_ERROR_CONCEALMENT || CONFIG_NEWNEAR
|
||||
|
||||
oci->prev_mip = vpx_calloc((oci->mb_cols + 1) * (oci->mb_rows + 1), sizeof(MODE_INFO));
|
||||
|
||||
if (!oci->prev_mip)
|
||||
@ -146,10 +146,6 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
|
||||
}
|
||||
|
||||
oci->prev_mi = oci->prev_mip + oci->mode_info_stride + 1;
|
||||
#else
|
||||
oci->prev_mip = NULL;
|
||||
oci->prev_mi = NULL;
|
||||
#endif
|
||||
|
||||
oci->above_context = vpx_calloc(sizeof(ENTROPY_CONTEXT_PLANES) * oci->mb_cols, 1);
|
||||
|
||||
|
@ -253,9 +253,7 @@ typedef struct MacroBlockD
|
||||
#endif /* CONFIG_DUALPRED */
|
||||
YV12_BUFFER_CONFIG dst;
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
MODE_INFO *prev_mode_info_context;
|
||||
#endif
|
||||
MODE_INFO *mode_info_context;
|
||||
int mode_info_stride;
|
||||
|
||||
|
@ -359,7 +359,6 @@ void vp8_entropy_mode_init()
|
||||
vp8_tokens_from_tree(vp8_small_mvencodings, vp8_small_mvtree);
|
||||
}
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
void vp8_init_mode_contexts(VP8_COMMON *pc)
|
||||
{
|
||||
vpx_memset(pc->mv_ref_ct, 0, sizeof(pc->mv_ref_ct));
|
||||
@ -491,6 +490,3 @@ void print_mv_ref_cts(VP8_COMMON *pc)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -21,7 +21,6 @@ const unsigned char vp8_mbsplit_offset[4][16] = {
|
||||
/* Predict motion vectors using those from already-decoded nearby blocks.
|
||||
Note that we only consider one 4x4 subblock from each candidate 16x16
|
||||
macroblock. */
|
||||
#if CONFIG_NEWNEAR
|
||||
void vp8_find_near_mvs
|
||||
(
|
||||
MACROBLOCKD *xd,
|
||||
@ -122,9 +121,7 @@ void vp8_find_near_mvs
|
||||
cnt[CNT_SPLITMV] = ((above->mbmi.mode == SPLITMV)
|
||||
+ (left->mbmi.mode == SPLITMV)) * 2
|
||||
+ (
|
||||
#if CONFIG_NEWNEAR
|
||||
lf_here->mbmi.mode == SPLITMV ||
|
||||
#endif
|
||||
aboveleft->mbmi.mode == SPLITMV);
|
||||
|
||||
/* Swap near and nearest if necessary */
|
||||
@ -154,130 +151,6 @@ void vp8_find_near_mvs
|
||||
vp8_clamp_mv2(best_mv, xd);
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
void vp8_find_near_mvs
|
||||
(
|
||||
MACROBLOCKD *xd,
|
||||
const MODE_INFO *here,
|
||||
int_mv *nearest,
|
||||
int_mv *nearby,
|
||||
int_mv *best_mv,
|
||||
int cnt[4],
|
||||
int refframe,
|
||||
int *ref_frame_sign_bias
|
||||
)
|
||||
{
|
||||
const MODE_INFO *above = here - xd->mode_info_stride;
|
||||
const MODE_INFO *left = here - 1;
|
||||
const MODE_INFO *aboveleft = above - 1;
|
||||
int_mv near_mvs[4];
|
||||
int_mv *mv = near_mvs;
|
||||
int *cntx = cnt;
|
||||
enum {CNT_ZEROMV, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV};
|
||||
|
||||
/* Zero accumulators */
|
||||
mv[0].as_int = mv[1].as_int = mv[2].as_int = 0;
|
||||
cnt[0] = cnt[1] = cnt[2] = cnt[3] = 0;
|
||||
|
||||
/* Process above */
|
||||
if (above->mbmi.ref_frame != INTRA_FRAME)
|
||||
{
|
||||
if (above->mbmi.mv.as_int)
|
||||
{
|
||||
(++mv)->as_int = above->mbmi.mv.as_int;
|
||||
mv_bias(ref_frame_sign_bias[above->mbmi.ref_frame],
|
||||
refframe, mv, ref_frame_sign_bias);
|
||||
++cntx;
|
||||
}
|
||||
*cntx += 2;
|
||||
}
|
||||
|
||||
/* Process left */
|
||||
if (left->mbmi.ref_frame != INTRA_FRAME)
|
||||
{
|
||||
if (left->mbmi.mv.as_int)
|
||||
{
|
||||
int_mv this_mv;
|
||||
|
||||
this_mv.as_int = left->mbmi.mv.as_int;
|
||||
mv_bias(ref_frame_sign_bias[left->mbmi.ref_frame],
|
||||
refframe, &this_mv, ref_frame_sign_bias);
|
||||
|
||||
if (this_mv.as_int != mv->as_int)
|
||||
{
|
||||
(++mv)->as_int = this_mv.as_int;
|
||||
++cntx;
|
||||
}
|
||||
|
||||
*cntx += 2;
|
||||
}
|
||||
else
|
||||
cnt[CNT_ZEROMV] += 2;
|
||||
}
|
||||
/* Process above left */
|
||||
if (aboveleft->mbmi.ref_frame != INTRA_FRAME)
|
||||
{
|
||||
if (aboveleft->mbmi.mv.as_int)
|
||||
{
|
||||
int_mv this_mv;
|
||||
|
||||
this_mv.as_int = aboveleft->mbmi.mv.as_int;
|
||||
mv_bias(ref_frame_sign_bias[aboveleft->mbmi.ref_frame],
|
||||
refframe, &this_mv, ref_frame_sign_bias);
|
||||
|
||||
if (this_mv.as_int != mv->as_int)
|
||||
{
|
||||
(++mv)->as_int = this_mv.as_int;
|
||||
++cntx;
|
||||
}
|
||||
|
||||
*cntx += 1;
|
||||
}
|
||||
else
|
||||
cnt[CNT_ZEROMV] += 1;
|
||||
}
|
||||
|
||||
/* If we have three distinct MV's ... */
|
||||
if (cnt[CNT_SPLITMV])
|
||||
{
|
||||
/* See if above-left MV can be merged with NEAREST */
|
||||
if (mv->as_int == near_mvs[CNT_NEAREST].as_int)
|
||||
cnt[CNT_NEAREST] += 1;
|
||||
}
|
||||
|
||||
cnt[CNT_SPLITMV] = ((above->mbmi.mode == SPLITMV)
|
||||
+ (left->mbmi.mode == SPLITMV)) * 2
|
||||
+ (aboveleft->mbmi.mode == SPLITMV);
|
||||
|
||||
/* Swap near and nearest if necessary */
|
||||
if (cnt[CNT_NEAR] > cnt[CNT_NEAREST])
|
||||
{
|
||||
int tmp;
|
||||
tmp = cnt[CNT_NEAREST];
|
||||
cnt[CNT_NEAREST] = cnt[CNT_NEAR];
|
||||
cnt[CNT_NEAR] = tmp;
|
||||
tmp = near_mvs[CNT_NEAREST].as_int;
|
||||
near_mvs[CNT_NEAREST].as_int = near_mvs[CNT_NEAR].as_int;
|
||||
near_mvs[CNT_NEAR].as_int = tmp;
|
||||
}
|
||||
|
||||
/* Use near_mvs[0] to store the "best" MV */
|
||||
if (cnt[CNT_NEAREST] >= cnt[CNT_ZEROMV])
|
||||
near_mvs[CNT_ZEROMV] = near_mvs[CNT_NEAREST];
|
||||
|
||||
/* Set up return values */
|
||||
best_mv->as_int = near_mvs[0].as_int;
|
||||
nearest->as_int = near_mvs[CNT_NEAREST].as_int;
|
||||
nearby->as_int = near_mvs[CNT_NEAR].as_int;
|
||||
|
||||
//TODO: move clamp outside findnearmv
|
||||
vp8_clamp_mv2(nearest, xd);
|
||||
vp8_clamp_mv2(nearby, xd);
|
||||
vp8_clamp_mv2(best_mv, xd);
|
||||
}
|
||||
#endif
|
||||
|
||||
vp8_prob *vp8_mv_ref_probs(VP8_COMMON *pc,
|
||||
vp8_prob p[VP8_MVREFS-1], const int near_mv_ref_ct[4]
|
||||
)
|
||||
|
@ -76,9 +76,7 @@ void vp8_find_near_mvs
|
||||
(
|
||||
MACROBLOCKD *xd,
|
||||
const MODE_INFO *here,
|
||||
#if CONFIG_NEWNEAR
|
||||
const MODE_INFO *lfhere,
|
||||
#endif
|
||||
int_mv *nearest, int_mv *nearby, int_mv *best,
|
||||
int near_mv_ref_cts[4],
|
||||
int refframe,
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
|
||||
#include "entropy.h"
|
||||
#if CONFIG_NEWNEAR
|
||||
const int default_vp8_mode_contexts[6][4] =
|
||||
{
|
||||
{ /* 0 */
|
||||
@ -41,32 +40,3 @@ const int default_vp8_mode_contexts_a[6][4] =
|
||||
{ /* 5 */
|
||||
234, 94, 128, 28},
|
||||
};
|
||||
#else
|
||||
const int default_vp8_mode_contexts[6][4] =
|
||||
{
|
||||
{
|
||||
/* 0 */
|
||||
7, 1, 1, 143,
|
||||
},
|
||||
{
|
||||
/* 1 */
|
||||
14, 18, 14, 107,
|
||||
},
|
||||
{
|
||||
/* 2 */
|
||||
135, 64, 57, 68,
|
||||
},
|
||||
{
|
||||
/* 3 */
|
||||
60, 56, 128, 65,
|
||||
},
|
||||
{
|
||||
/* 4 */
|
||||
159, 134, 128, 34,
|
||||
},
|
||||
{
|
||||
/* 5 */
|
||||
234, 188, 128, 28,
|
||||
},
|
||||
};
|
||||
#endif
|
@ -13,7 +13,5 @@
|
||||
#define __INC_MODECONT_H
|
||||
|
||||
extern const int default_vp8_mode_contexts[6][4];
|
||||
#if CONFIG_NEWNEAR
|
||||
extern const int default_vp8_mode_contexts_a[6][4];
|
||||
#endif
|
||||
#endif
|
||||
|
@ -249,13 +249,10 @@ typedef struct VP8Common
|
||||
FRAME_CONTEXT lfc; /* last frame entropy */
|
||||
FRAME_CONTEXT fc; /* this frame entropy */
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
int mv_ref_ct[6][4][2];
|
||||
int mode_context[6][4];
|
||||
int mv_ref_ct_a[6][4][2];
|
||||
int mode_context_a[6][4];
|
||||
#endif
|
||||
|
||||
int vp8_mode_contexts[6][4];
|
||||
|
||||
unsigned int current_video_frame;
|
||||
|
@ -618,10 +618,8 @@ static void read_mb_segment_id ( VP8D_COMP *pbi,
|
||||
}
|
||||
|
||||
static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
#if CONFIG_NEWNEAR
|
||||
MODE_INFO *prev_mi,
|
||||
#endif
|
||||
int mb_row, int mb_col)
|
||||
int mb_row, int mb_col)
|
||||
{
|
||||
VP8_COMMON *const cm = & pbi->common;
|
||||
vp8_reader *const bc = & pbi->bc;
|
||||
@ -697,9 +695,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
vp8_prob mv_ref_p [VP8_MVREFS-1];
|
||||
|
||||
vp8_find_near_mvs(xd, mi,
|
||||
#if CONFIG_NEWNEAR
|
||||
prev_mi,
|
||||
#endif
|
||||
&nearest, &nearby, &best_mv, rct,
|
||||
mbmi->ref_frame, pbi->common.ref_frame_sign_bias);
|
||||
vp8_mv_ref_probs(&pbi->common, mv_ref_p, rct);
|
||||
@ -715,9 +711,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
{
|
||||
mbmi->mode = read_mv_ref(bc, mv_ref_p);
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
vp8_accum_mv_refs(&pbi->common, mbmi->mode, rct);
|
||||
#endif
|
||||
}
|
||||
|
||||
mbmi->uv_mode = DC_PRED;
|
||||
@ -857,9 +851,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
if (mbmi->second_ref_frame)
|
||||
{
|
||||
vp8_find_near_mvs(xd, mi,
|
||||
#if CONFIG_NEWNEAR
|
||||
prev_mi,
|
||||
#endif
|
||||
&nearest, &nearby, &best_mv, rct,
|
||||
(int)mbmi->second_ref_frame,
|
||||
pbi->common.ref_frame_sign_bias);
|
||||
@ -985,9 +977,7 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi)
|
||||
int row_delta[4] = {-1, 0, +1, 0};
|
||||
int col_delta[4] = {+1, +1, -1, +1};
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
MODE_INFO *prev_mi = cm->prev_mi;
|
||||
#endif
|
||||
|
||||
mb_mode_mv_init(pbi);
|
||||
|
||||
@ -1023,9 +1013,7 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi)
|
||||
|
||||
if ((mb_row >= cm->mb_rows) || (mb_col >= cm->mb_cols))
|
||||
{
|
||||
#if CONFIG_NEWNEAR
|
||||
prev_mi += offset_extended;
|
||||
#endif
|
||||
mi += offset_extended; /* next macroblock */
|
||||
continue;
|
||||
}
|
||||
@ -1046,9 +1034,7 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi)
|
||||
vp8_kfread_modes(pbi, mi, mb_row, mb_col);
|
||||
else
|
||||
read_mb_modes_mv(pbi, mi, &mi->mbmi,
|
||||
#if CONFIG_NEWNEAR
|
||||
prev_mi,
|
||||
#endif
|
||||
mb_row, mb_col);
|
||||
|
||||
#if CONFIG_ERROR_CONCEALMENT
|
||||
@ -1064,9 +1050,7 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
prev_mi += offset_extended;
|
||||
#endif
|
||||
mi += offset_extended; /* next macroblock */
|
||||
}
|
||||
}
|
||||
@ -1079,9 +1063,7 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi)
|
||||
{
|
||||
MODE_INFO *mi = pbi->common.mi;
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
MODE_INFO *prev_mi = pbi->common.prev_mi;
|
||||
#endif
|
||||
|
||||
int mb_row = -1;
|
||||
|
||||
@ -1130,9 +1112,7 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi)
|
||||
vp8_kfread_modes(pbi, mi, mb_row, mb_col);
|
||||
else
|
||||
read_mb_modes_mv(pbi, mi, &mi->mbmi,
|
||||
#if CONFIG_NEWNEAR
|
||||
prev_mi,
|
||||
#endif
|
||||
mb_row, mb_col);
|
||||
|
||||
//printf("%3d", mi->mbmi.mode);
|
||||
@ -1169,15 +1149,11 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi)
|
||||
fprintf(statsfile, "%2d%2d%2d ",
|
||||
mi->mbmi.segment_id, mi->mbmi.ref_frame, mi->mbmi.mode );
|
||||
#endif
|
||||
#if CONFIG_NEWNEAR
|
||||
prev_mi++;
|
||||
#endif
|
||||
mi++; /* next macroblock */
|
||||
}
|
||||
// printf("\n");
|
||||
#if CONFIG_NEWNEAR
|
||||
prev_mi++;
|
||||
#endif
|
||||
mi++; /* skip left predictor each row */
|
||||
}
|
||||
|
||||
|
@ -947,17 +947,10 @@ static void init_frame(VP8D_COMP *pbi)
|
||||
vpx_memcpy(&pc->lfc, &pc->fc, sizeof(pc->fc));
|
||||
vpx_memcpy(&pc->lfc_a, &pc->fc, sizeof(pc->fc));
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
vp8_init_mode_contexts(&pbi->common);
|
||||
vpx_memcpy( pbi->common.vp8_mode_contexts,
|
||||
pbi->common.mode_context,
|
||||
sizeof(pbi->common.mode_context));
|
||||
|
||||
#else
|
||||
vpx_memcpy( pbi->common.vp8_mode_contexts,
|
||||
default_vp8_mode_contexts,
|
||||
sizeof(default_vp8_mode_contexts));
|
||||
#endif /* CONFIG_NEWNEAR */
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1366,20 +1359,16 @@ int vp8_decode_frame(VP8D_COMP *pbi)
|
||||
if(pc->refresh_alt_ref_frame)
|
||||
{
|
||||
vpx_memcpy(&pc->fc, &pc->lfc_a, sizeof(pc->fc));
|
||||
#if CONFIG_NEWNEAR
|
||||
vpx_memcpy( pc->vp8_mode_contexts,
|
||||
pc->mode_context_a,
|
||||
sizeof(pc->vp8_mode_contexts));
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
vpx_memcpy(&pc->fc, &pc->lfc, sizeof(pc->fc));
|
||||
#if CONFIG_NEWNEAR
|
||||
vpx_memcpy( pc->vp8_mode_contexts,
|
||||
pc->mode_context,
|
||||
sizeof(pc->vp8_mode_contexts));
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Buffer to buffer copy flags. */
|
||||
@ -1493,13 +1482,10 @@ int vp8_decode_frame(VP8D_COMP *pbi)
|
||||
pc->mb_no_coeff_skip = (int)vp8_read_bit(bc);
|
||||
|
||||
vp8_decode_mode_mvs(pbi);
|
||||
#if CONFIG_NEWNEAR
|
||||
if(pbi->common.frame_type != KEY_FRAME)
|
||||
{
|
||||
vp8_update_mode_context(&pbi->common);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if CONFIG_ERROR_CONCEALMENT
|
||||
if (pbi->ec_active &&
|
||||
|
@ -624,7 +624,6 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
if(cm->show_frame)
|
||||
{
|
||||
vpx_memcpy(cm->prev_mip, cm->mip,
|
||||
@ -635,7 +634,6 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign
|
||||
vpx_memset(cm->prev_mip, 0,
|
||||
(cm->mb_cols + 1) * (cm->mb_rows + 1)* sizeof(MODE_INFO));
|
||||
}
|
||||
#endif
|
||||
|
||||
/*vp8_print_modes_and_motion_vectors( cm->mi, cm->mb_rows,cm->mb_cols, cm->current_video_frame);*/
|
||||
|
||||
|
@ -1050,9 +1050,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
|
||||
int pred_context;
|
||||
|
||||
MODE_INFO *m = pc->mi;
|
||||
#if CONFIG_NEWNEAR
|
||||
MODE_INFO *prev_m = pc->prev_mi;
|
||||
#endif
|
||||
|
||||
const int mis = pc->mode_info_stride;
|
||||
int mb_row, mb_col;
|
||||
@ -1186,9 +1184,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
|
||||
|
||||
// Make sure the MacroBlockD mode info pointer is set correctly
|
||||
xd->mode_info_context = m;
|
||||
#if CONFIG_NEWNEAR
|
||||
xd->prev_mode_info_context = prev_m;
|
||||
#endif
|
||||
|
||||
#ifdef ENTROPY_STATS
|
||||
active_section = 9;
|
||||
@ -1280,9 +1276,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
|
||||
int ct[4];
|
||||
|
||||
vp8_find_near_mvs(xd, m,
|
||||
#if CONFIG_NEWNEAR
|
||||
prev_m,
|
||||
#endif
|
||||
&n1, &n2, &best_mv, ct, rf,
|
||||
cpi->common.ref_frame_sign_bias);
|
||||
vp8_mv_ref_probs(&cpi->common, mv_ref_p, ct);
|
||||
@ -1301,9 +1295,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
|
||||
if ( !segfeature_active( xd, segment_id, SEG_LVL_MODE ) )
|
||||
{
|
||||
write_mv_ref(w, mode, mv_ref_p);
|
||||
#if CONFIG_NEWNEAR
|
||||
vp8_accum_mv_refs(&cpi->common, mode, ct);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -1338,9 +1330,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
|
||||
int_mv n1, n2;
|
||||
int ct[4];
|
||||
vp8_find_near_mvs(xd, m,
|
||||
#if CONFIG_NEWNEAR
|
||||
prev_m,
|
||||
#endif
|
||||
&n1, &n2, &best_mv,
|
||||
ct, second_rf,
|
||||
cpi->common.ref_frame_sign_bias);
|
||||
@ -1416,11 +1406,9 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
prev_m += offset_extended;
|
||||
assert((prev_m-cpi->common.prev_mip)==(m-cpi->common.mip));
|
||||
assert((prev_m-cpi->common.prev_mi)==(m-cpi->common.mi));
|
||||
#endif
|
||||
|
||||
// skip to next MB
|
||||
mb_row += dy;
|
||||
@ -1461,9 +1449,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
|
||||
|
||||
|
||||
MODE_INFO *m = pc->mi;
|
||||
#if CONFIG_NEWNEAR
|
||||
MODE_INFO *prev_m = pc->prev_mi;
|
||||
#endif
|
||||
|
||||
const int mis = pc->mode_info_stride;
|
||||
int mb_row = -1;
|
||||
@ -1575,9 +1561,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
|
||||
// Make sure the MacroBlockD mode info pointer is set correctly
|
||||
xd->mode_info_context = m;
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
xd->prev_mode_info_context = prev_m;
|
||||
#endif
|
||||
|
||||
#ifdef ENTROPY_STATS
|
||||
active_section = 9;
|
||||
@ -1670,9 +1654,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
|
||||
int_mv n1, n2;
|
||||
|
||||
vp8_find_near_mvs(xd, m,
|
||||
#if CONFIG_NEWNEAR
|
||||
prev_m,
|
||||
#endif
|
||||
&n1, &n2, &best_mv, ct, rf, cpi->common.ref_frame_sign_bias);
|
||||
vp8_mv_ref_probs(&cpi->common, mv_ref_p, ct);
|
||||
|
||||
@ -1691,9 +1673,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
|
||||
if ( !segfeature_active( xd, segment_id, SEG_LVL_MODE ) )
|
||||
{
|
||||
write_mv_ref(w, mode, mv_ref_p);
|
||||
#if CONFIG_NEWNEAR
|
||||
vp8_accum_mv_refs(&cpi->common, mode, ct);
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
@ -1725,9 +1705,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
|
||||
int_mv n1, n2;
|
||||
int ct[4];
|
||||
vp8_find_near_mvs(xd, m,
|
||||
#if CONFIG_NEWNEAR
|
||||
prev_m,
|
||||
#endif
|
||||
&n1, &n2, &best_mv,
|
||||
ct, second_rf,
|
||||
cpi->common.ref_frame_sign_bias);
|
||||
@ -1802,19 +1780,14 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
|
||||
}
|
||||
|
||||
++m;
|
||||
#if CONFIG_NEWNEAR
|
||||
++prev_m;
|
||||
assert((prev_m-cpi->common.prev_mip)==(m-cpi->common.mip));
|
||||
assert((prev_m-cpi->common.prev_mi)==(m-cpi->common.mi));
|
||||
#endif
|
||||
|
||||
cpi->mb.partition_info++;
|
||||
}
|
||||
|
||||
++m; /* skip L prediction border */
|
||||
#if CONFIG_NEWNEAR
|
||||
++prev_m;
|
||||
#endif
|
||||
cpi->mb.partition_info++;
|
||||
}
|
||||
|
||||
@ -3020,9 +2993,7 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size)
|
||||
{
|
||||
pack_inter_mode_mvs(cpi);
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
vp8_update_mode_context(&cpi->common);
|
||||
#endif
|
||||
|
||||
#ifdef ENTROPY_STATS
|
||||
active_section = 1;
|
||||
|
@ -624,12 +624,10 @@ void encode_sb_row (VP8_COMP *cpi,
|
||||
x->partition_info += offset_extended;
|
||||
xd->mode_info_context += offset_extended;
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
xd->prev_mode_info_context += offset_extended;
|
||||
|
||||
assert((xd->prev_mode_info_context - cpi->common.prev_mip)
|
||||
==(xd->mode_info_context - cpi->common.mip));
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -787,12 +785,10 @@ void encode_sb_row (VP8_COMP *cpi,
|
||||
x->partition_info += offset_extended;
|
||||
xd->mode_info_context += offset_extended;
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
xd->prev_mode_info_context += offset_extended;
|
||||
|
||||
assert((xd->prev_mode_info_context - cpi->common.prev_mip)
|
||||
==(xd->mode_info_context - cpi->common.mip));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -806,9 +802,7 @@ void encode_sb_row (VP8_COMP *cpi,
|
||||
xd->dst.v_buffer + 8);*/
|
||||
|
||||
// this is to account for the border
|
||||
#if CONFIG_NEWNEAR
|
||||
xd->prev_mode_info_context += 1 - (cm->mb_cols & 0x1) + xd->mode_info_stride;
|
||||
#endif
|
||||
xd->mode_info_context += 1 - (cm->mb_cols & 0x1) + xd->mode_info_stride;
|
||||
x->partition_info += 1 - (cm->mb_cols & 0x1) + xd->mode_info_stride;
|
||||
x->gf_active_ptr += cm->mb_cols - (cm->mb_cols & 0x1);
|
||||
@ -1033,11 +1027,9 @@ void encode_mb_row(VP8_COMP *cpi,
|
||||
// skip to next mb
|
||||
xd->mode_info_context++;
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
xd->prev_mode_info_context++;
|
||||
assert((xd->prev_mode_info_context - cpi->common.prev_mip)
|
||||
==(xd->mode_info_context - cpi->common.mip));
|
||||
#endif
|
||||
x->partition_info++;
|
||||
|
||||
xd->above_context++;
|
||||
@ -1057,9 +1049,7 @@ void encode_mb_row(VP8_COMP *cpi,
|
||||
xd->dst.v_buffer + 8);
|
||||
|
||||
// this is to account for the border
|
||||
#if CONFIG_NEWNEAR
|
||||
xd->prev_mode_info_context++;
|
||||
#endif
|
||||
xd->mode_info_context++;
|
||||
x->partition_info++;
|
||||
|
||||
@ -1104,10 +1094,7 @@ void init_encode_frame_mb_context(VP8_COMP *cpi)
|
||||
|
||||
xd->mode_info_context = cm->mi;
|
||||
xd->mode_info_stride = cm->mode_info_stride;
|
||||
#if CONFIG_NEWNEAR
|
||||
xd->prev_mode_info_context = cm->prev_mi;
|
||||
#endif
|
||||
|
||||
|
||||
xd->frame_type = cm->frame_type;
|
||||
|
||||
@ -1274,10 +1261,7 @@ static void encode_frame_internal(VP8_COMP *cpi)
|
||||
|
||||
xd->mode_info_context = cm->mi;
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
xd->prev_mode_info_context = cm->prev_mi;
|
||||
#endif
|
||||
|
||||
|
||||
vp8_zero(cpi->MVcount);
|
||||
vp8_zero(cpi->coef_counts);
|
||||
@ -1338,10 +1322,8 @@ static void encode_frame_internal(VP8_COMP *cpi)
|
||||
|
||||
xd->mode_info_context += xd->mode_info_stride
|
||||
* cpi->encoding_thread_count;
|
||||
#if CONFIG_NEWNEAR
|
||||
xd->prev_mode_info_context += xd->mode_info_stride
|
||||
* cpi->encoding_thread_count;
|
||||
#endif
|
||||
|
||||
x->partition_info += xd->mode_info_stride * cpi->encoding_thread_count;
|
||||
x->gf_active_ptr += cm->mb_cols * cpi->encoding_thread_count;
|
||||
|
@ -247,9 +247,7 @@ THREAD_FUNCTION thread_encoding_proc(void *p_data)
|
||||
recon_uvoffset += 8;
|
||||
|
||||
// skip to next mb
|
||||
#if CONFIG_NEWNEAR
|
||||
xd->prev_mode_info_context++;
|
||||
#endif
|
||||
xd->mode_info_context++;
|
||||
x->partition_info++;
|
||||
xd->above_context++;
|
||||
@ -265,9 +263,7 @@ THREAD_FUNCTION thread_encoding_proc(void *p_data)
|
||||
xd->dst.v_buffer + 8);
|
||||
|
||||
// this is to account for the border
|
||||
#if CONFIG_NEWNEAR
|
||||
xd->prev_mode_info_context++;
|
||||
#endif
|
||||
|
||||
xd->mode_info_context++;
|
||||
x->partition_info++;
|
||||
@ -278,10 +274,8 @@ THREAD_FUNCTION thread_encoding_proc(void *p_data)
|
||||
|
||||
xd->mode_info_context += xd->mode_info_stride
|
||||
* cpi->encoding_thread_count;
|
||||
#if CONFIG_NEWNEAR
|
||||
xd->prev_mode_info_context += xd->mode_info_stride
|
||||
* cpi->encoding_thread_count;
|
||||
#endif
|
||||
|
||||
x->partition_info += xd->mode_info_stride * cpi->encoding_thread_count;
|
||||
x->gf_active_ptr += cm->mb_cols * cpi->encoding_thread_count;
|
||||
@ -459,10 +453,8 @@ void vp8cx_init_mbrthread_data(VP8_COMP *cpi,
|
||||
|
||||
mbd->mode_info_context = cm->mi
|
||||
+ x->e_mbd.mode_info_stride * (i + 1);
|
||||
#if CONFIG_NEWNEAR
|
||||
mbd->prev_mode_info_context = cm->prev_mi
|
||||
+ x->e_mbd.mode_info_stride * (i + 1);
|
||||
#endif
|
||||
mbd->mode_info_stride = cm->mode_info_stride;
|
||||
|
||||
mbd->frame_type = cm->frame_type;
|
||||
|
@ -2705,7 +2705,7 @@ void vp8_remove_compressor(VP8_PTR *ptr)
|
||||
- cpi->first_time_stamp_ever) / 10000000.000;
|
||||
double total_encode_time = (cpi->time_receive_data + cpi->time_compress_data) / 1000.000;
|
||||
double dr = (double)cpi->bytes * (double) 8 / (double)1000 / time_encoded;
|
||||
#if CONFIG_NEWNEAR&&defined(MODE_STATS)
|
||||
#if defined(MODE_STATS)
|
||||
print_mode_contexts(&cpi->common);
|
||||
#endif
|
||||
if (cpi->b_calculate_psnr)
|
||||
@ -5393,7 +5393,6 @@ static void encode_frame_to_data_rate
|
||||
vp8_write_yuv_rec_frame(cm);
|
||||
#endif
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
if(cm->show_frame)
|
||||
{
|
||||
vpx_memcpy(cm->prev_mip, cm->mip,
|
||||
@ -5404,9 +5403,6 @@ static void encode_frame_to_data_rate
|
||||
vpx_memset(cm->prev_mip, 0,
|
||||
(cm->mb_cols + 1) * (cm->mb_rows + 1)* sizeof(MODE_INFO));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -472,9 +472,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
|
||||
YV12_BUFFER_CONFIG *lst_yv12 = &cpi->common.yv12_fb[cpi->common.lst_fb_idx];
|
||||
|
||||
vp8_find_near_mvs(&x->e_mbd, x->e_mbd.mode_info_context,
|
||||
#if CONFIG_NEWNEAR
|
||||
x->e_mbd.prev_mode_info_context,
|
||||
#endif
|
||||
&nearest_mv[LAST_FRAME], &near_mv[LAST_FRAME],
|
||||
&frame_best_ref_mv[LAST_FRAME], MDCounts[LAST_FRAME], LAST_FRAME, cpi->common.ref_frame_sign_bias);
|
||||
|
||||
@ -490,10 +488,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
|
||||
YV12_BUFFER_CONFIG *gld_yv12 = &cpi->common.yv12_fb[cpi->common.gld_fb_idx];
|
||||
|
||||
vp8_find_near_mvs(&x->e_mbd, x->e_mbd.mode_info_context,
|
||||
#if CONFIG_NEWNEAR
|
||||
x->e_mbd.prev_mode_info_context,
|
||||
#endif
|
||||
|
||||
&nearest_mv[GOLDEN_FRAME], &near_mv[GOLDEN_FRAME],
|
||||
&frame_best_ref_mv[GOLDEN_FRAME], MDCounts[GOLDEN_FRAME], GOLDEN_FRAME, cpi->common.ref_frame_sign_bias);
|
||||
|
||||
@ -509,9 +504,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
|
||||
YV12_BUFFER_CONFIG *alt_yv12 = &cpi->common.yv12_fb[cpi->common.alt_fb_idx];
|
||||
|
||||
vp8_find_near_mvs(&x->e_mbd, x->e_mbd.mode_info_context,
|
||||
#if CONFIG_NEWNEAR
|
||||
x->e_mbd.prev_mode_info_context,
|
||||
#endif
|
||||
&nearest_mv[ALTREF_FRAME], &near_mv[ALTREF_FRAME],
|
||||
&frame_best_ref_mv[ALTREF_FRAME], MDCounts[ALTREF_FRAME], ALTREF_FRAME, cpi->common.ref_frame_sign_bias);
|
||||
|
||||
|
@ -267,16 +267,13 @@ void vp8_setup_key_frame(VP8_COMP *cpi)
|
||||
vpx_memcpy(&cpi->common.lfc, &cpi->common.fc, sizeof(cpi->common.fc));
|
||||
vpx_memcpy(&cpi->common.lfc_a, &cpi->common.fc, sizeof(cpi->common.fc));
|
||||
|
||||
#if CONFIG_NEWNEAR
|
||||
vp8_init_mode_contexts(&cpi->common);
|
||||
vpx_memcpy( cpi->common.vp8_mode_contexts,
|
||||
cpi->common.mode_context,
|
||||
sizeof(cpi->common.mode_context));
|
||||
#else
|
||||
vpx_memcpy( cpi->common.vp8_mode_contexts,
|
||||
default_vp8_mode_contexts,
|
||||
sizeof(default_vp8_mode_contexts));
|
||||
#endif /* CONFIG_NEWNEAR */
|
||||
}
|
||||
void vp8_setup_inter_frame(VP8_COMP *cpi)
|
||||
{
|
||||
@ -285,22 +282,18 @@ void vp8_setup_inter_frame(VP8_COMP *cpi)
|
||||
vpx_memcpy( &cpi->common.fc,
|
||||
&cpi->common.lfc_a,
|
||||
sizeof(cpi->common.fc));
|
||||
#if CONFIG_NEWNEAR
|
||||
vpx_memcpy( cpi->common.vp8_mode_contexts,
|
||||
cpi->common.mode_context_a,
|
||||
sizeof(cpi->common.vp8_mode_contexts));
|
||||
#endif /* CONFIG_NEWNEAR */
|
||||
}
|
||||
else
|
||||
{
|
||||
vpx_memcpy( &cpi->common.fc,
|
||||
&cpi->common.lfc,
|
||||
sizeof(cpi->common.fc));
|
||||
#if CONFIG_NEWNEAR
|
||||
vpx_memcpy( cpi->common.vp8_mode_contexts,
|
||||
cpi->common.mode_context,
|
||||
sizeof(cpi->common.vp8_mode_contexts));
|
||||
#endif /* CONFIG_NEWNEAR */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2178,9 +2178,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
|
||||
YV12_BUFFER_CONFIG *lst_yv12 = &cpi->common.yv12_fb[cpi->common.lst_fb_idx];
|
||||
|
||||
vp8_find_near_mvs(&x->e_mbd, x->e_mbd.mode_info_context,
|
||||
#if CONFIG_NEWNEAR
|
||||
x->e_mbd.prev_mode_info_context,
|
||||
#endif
|
||||
&frame_nearest_mv[LAST_FRAME], &frame_near_mv[LAST_FRAME],
|
||||
&frame_best_ref_mv[LAST_FRAME], frame_mdcounts[LAST_FRAME], LAST_FRAME, cpi->common.ref_frame_sign_bias);
|
||||
|
||||
@ -2194,9 +2192,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
|
||||
YV12_BUFFER_CONFIG *gld_yv12 = &cpi->common.yv12_fb[cpi->common.gld_fb_idx];
|
||||
|
||||
vp8_find_near_mvs(&x->e_mbd, x->e_mbd.mode_info_context,
|
||||
#if CONFIG_NEWNEAR
|
||||
x->e_mbd.prev_mode_info_context,
|
||||
#endif
|
||||
&frame_nearest_mv[GOLDEN_FRAME], &frame_near_mv[GOLDEN_FRAME],
|
||||
&frame_best_ref_mv[GOLDEN_FRAME], frame_mdcounts[GOLDEN_FRAME], GOLDEN_FRAME, cpi->common.ref_frame_sign_bias);
|
||||
|
||||
@ -2210,9 +2206,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
|
||||
YV12_BUFFER_CONFIG *alt_yv12 = &cpi->common.yv12_fb[cpi->common.alt_fb_idx];
|
||||
|
||||
vp8_find_near_mvs(&x->e_mbd, x->e_mbd.mode_info_context,
|
||||
#if CONFIG_NEWNEAR
|
||||
x->e_mbd.prev_mode_info_context,
|
||||
#endif
|
||||
&frame_nearest_mv[ALTREF_FRAME], &frame_near_mv[ALTREF_FRAME],
|
||||
&frame_best_ref_mv[ALTREF_FRAME], frame_mdcounts[ALTREF_FRAME], ALTREF_FRAME, cpi->common.ref_frame_sign_bias);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user