and added to MACROBLOCKD.

Change-Id: I0e60aaa9f84bcc9f2376d71bd934f251baee38db
This commit is contained in:
Scott LaVarnway 2015-06-16 06:38:34 -07:00
Родитель 1395b56a1d
Коммит 86f4a3d8af
10 изменённых файлов: 43 добавлений и 54 удалений

Просмотреть файл

@ -23,6 +23,7 @@
#include "vp9/common/vp9_mv.h" #include "vp9/common/vp9_mv.h"
#include "vp9/common/vp9_scale.h" #include "vp9/common/vp9_scale.h"
#include "vp9/common/vp9_seg_common.h" #include "vp9/common/vp9_seg_common.h"
#include "vp9/common/vp9_tile_common.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -149,7 +150,10 @@ typedef struct RefBuffer {
typedef struct macroblockd { typedef struct macroblockd {
struct macroblockd_plane plane[MAX_MB_PLANE]; struct macroblockd_plane plane[MAX_MB_PLANE];
FRAME_COUNTS *counts; FRAME_COUNTS *counts;
TileInfo tile;
int mi_stride; int mi_stride;
MODE_INFO **mi; MODE_INFO **mi;

Просмотреть файл

@ -14,7 +14,6 @@
// This function searches the neighbourhood of a given MB/SB // This function searches the neighbourhood of a given MB/SB
// to try and find candidate reference vectors. // to try and find candidate reference vectors.
static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd, static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
const TileInfo *const tile,
MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame, MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
int_mv *mv_ref_list, int_mv *mv_ref_list,
int block, int mi_row, int mi_col, int block, int mi_row, int mi_col,
@ -27,6 +26,7 @@ static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
int context_counter = 0; int context_counter = 0;
const MV_REF *const prev_frame_mvs = cm->use_prev_frame_mvs ? const MV_REF *const prev_frame_mvs = cm->use_prev_frame_mvs ?
cm->prev_frame->mvs + mi_row * cm->mi_cols + mi_col : NULL; cm->prev_frame->mvs + mi_row * cm->mi_cols + mi_col : NULL;
const TileInfo *const tile = &xd->tile;
// Blank the reference vector list // Blank the reference vector list
memset(mv_ref_list, 0, sizeof(*mv_ref_list) * MAX_MV_REF_CANDIDATES); memset(mv_ref_list, 0, sizeof(*mv_ref_list) * MAX_MV_REF_CANDIDATES);
@ -147,13 +147,12 @@ static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
} }
void vp9_find_mv_refs(const VP9_COMMON *cm, const MACROBLOCKD *xd, void vp9_find_mv_refs(const VP9_COMMON *cm, const MACROBLOCKD *xd,
const TileInfo *const tile,
MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame, MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
int_mv *mv_ref_list, int_mv *mv_ref_list,
int mi_row, int mi_col, int mi_row, int mi_col,
find_mv_refs_sync sync, void *const data, find_mv_refs_sync sync, void *const data,
uint8_t *mode_context) { uint8_t *mode_context) {
find_mv_refs_idx(cm, xd, tile, mi, ref_frame, mv_ref_list, -1, find_mv_refs_idx(cm, xd, mi, ref_frame, mv_ref_list, -1,
mi_row, mi_col, sync, data, mode_context); mi_row, mi_col, sync, data, mode_context);
} }
@ -181,7 +180,6 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd, int allow_hp,
} }
void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd, void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
const TileInfo *const tile,
int block, int ref, int mi_row, int mi_col, int block, int ref, int mi_row, int mi_col,
int_mv *nearest_mv, int_mv *near_mv, int_mv *nearest_mv, int_mv *near_mv,
uint8_t *mode_context) { uint8_t *mode_context) {
@ -192,7 +190,7 @@ void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
assert(MAX_MV_REF_CANDIDATES == 2); assert(MAX_MV_REF_CANDIDATES == 2);
find_mv_refs_idx(cm, xd, tile, mi, mi->mbmi.ref_frame[ref], mv_list, block, find_mv_refs_idx(cm, xd, mi, mi->mbmi.ref_frame[ref], mv_list, block,
mi_row, mi_col, NULL, NULL, mode_context); mi_row, mi_col, NULL, NULL, mode_context);
near_mv->as_int = 0; near_mv->as_int = 0;

Просмотреть файл

@ -209,7 +209,6 @@ static INLINE void clamp_mv2(MV *mv, const MACROBLOCKD *xd) {
typedef void (*find_mv_refs_sync)(void *const data, int mi_row); typedef void (*find_mv_refs_sync)(void *const data, int mi_row);
void vp9_find_mv_refs(const VP9_COMMON *cm, const MACROBLOCKD *xd, void vp9_find_mv_refs(const VP9_COMMON *cm, const MACROBLOCKD *xd,
const TileInfo *const tile,
MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame, MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
int_mv *mv_ref_list, int mi_row, int mi_col, int_mv *mv_ref_list, int mi_row, int mi_col,
find_mv_refs_sync sync, void *const data, find_mv_refs_sync sync, void *const data,
@ -222,7 +221,6 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd, int allow_hp,
int_mv *mvlist, int_mv *nearest_mv, int_mv *near_mv); int_mv *mvlist, int_mv *nearest_mv, int_mv *near_mv);
void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd, void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
const TileInfo *const tile,
int block, int ref, int mi_row, int mi_col, int block, int ref, int mi_row, int mi_col,
int_mv *nearest_mv, int_mv *near_mv, int_mv *nearest_mv, int_mv *near_mv,
uint8_t *mode_context); uint8_t *mode_context);

Просмотреть файл

@ -698,7 +698,6 @@ static void dec_build_inter_predictors_sb(VP9Decoder *const pbi,
} }
static MB_MODE_INFO *set_offsets(VP9_COMMON *const cm, MACROBLOCKD *const xd, static MB_MODE_INFO *set_offsets(VP9_COMMON *const cm, MACROBLOCKD *const xd,
const TileInfo *const tile,
BLOCK_SIZE bsize, int mi_row, int mi_col) { BLOCK_SIZE bsize, int mi_row, int mi_col) {
const int bw = num_8x8_blocks_wide_lookup[bsize]; const int bw = num_8x8_blocks_wide_lookup[bsize];
const int bh = num_8x8_blocks_high_lookup[bsize]; const int bh = num_8x8_blocks_high_lookup[bsize];
@ -706,6 +705,7 @@ static MB_MODE_INFO *set_offsets(VP9_COMMON *const cm, MACROBLOCKD *const xd,
const int y_mis = MIN(bh, cm->mi_rows - mi_row); const int y_mis = MIN(bh, cm->mi_rows - mi_row);
const int offset = mi_row * cm->mi_stride + mi_col; const int offset = mi_row * cm->mi_stride + mi_col;
int x, y; int x, y;
const TileInfo *const tile = &xd->tile;
xd->mi = cm->mi_grid_visible + offset; xd->mi = cm->mi_grid_visible + offset;
xd->mi[0] = &cm->mi[offset]; xd->mi[0] = &cm->mi[offset];
@ -726,12 +726,11 @@ static MB_MODE_INFO *set_offsets(VP9_COMMON *const cm, MACROBLOCKD *const xd,
} }
static void decode_block(VP9Decoder *const pbi, MACROBLOCKD *const xd, static void decode_block(VP9Decoder *const pbi, MACROBLOCKD *const xd,
const TileInfo *const tile,
int mi_row, int mi_col, int mi_row, int mi_col,
vp9_reader *r, BLOCK_SIZE bsize) { vp9_reader *r, BLOCK_SIZE bsize) {
VP9_COMMON *const cm = &pbi->common; VP9_COMMON *const cm = &pbi->common;
const int less8x8 = bsize < BLOCK_8X8; const int less8x8 = bsize < BLOCK_8X8;
MB_MODE_INFO *mbmi = set_offsets(cm, xd, tile, bsize, mi_row, mi_col); MB_MODE_INFO *mbmi = set_offsets(cm, xd, bsize, mi_row, mi_col);
if (bsize >= BLOCK_8X8 && (cm->subsampling_x || cm->subsampling_y)) { if (bsize >= BLOCK_8X8 && (cm->subsampling_x || cm->subsampling_y)) {
const BLOCK_SIZE uv_subsize = const BLOCK_SIZE uv_subsize =
@ -741,7 +740,7 @@ static void decode_block(VP9Decoder *const pbi, MACROBLOCKD *const xd,
VPX_CODEC_CORRUPT_FRAME, "Invalid block size."); VPX_CODEC_CORRUPT_FRAME, "Invalid block size.");
} }
vp9_read_mode_info(pbi, xd, tile, mi_row, mi_col, r); vp9_read_mode_info(pbi, xd, mi_row, mi_col, r);
if (less8x8) if (less8x8)
bsize = BLOCK_8X8; bsize = BLOCK_8X8;
@ -795,7 +794,6 @@ static PARTITION_TYPE read_partition(MACROBLOCKD *xd, int mi_row, int mi_col,
} }
static void decode_partition(VP9Decoder *const pbi, MACROBLOCKD *const xd, static void decode_partition(VP9Decoder *const pbi, MACROBLOCKD *const xd,
const TileInfo *const tile,
int mi_row, int mi_col, int mi_row, int mi_col,
vp9_reader* r, BLOCK_SIZE bsize) { vp9_reader* r, BLOCK_SIZE bsize) {
VP9_COMMON *const cm = &pbi->common; VP9_COMMON *const cm = &pbi->common;
@ -811,27 +809,27 @@ static void decode_partition(VP9Decoder *const pbi, MACROBLOCKD *const xd,
partition = read_partition(xd, mi_row, mi_col, bsize, r, has_rows, has_cols); partition = read_partition(xd, mi_row, mi_col, bsize, r, has_rows, has_cols);
subsize = get_subsize(bsize, partition); subsize = get_subsize(bsize, partition);
if (bsize == BLOCK_8X8) { if (bsize == BLOCK_8X8) {
decode_block(pbi, xd, tile, mi_row, mi_col, r, subsize); decode_block(pbi, xd, mi_row, mi_col, r, subsize);
} else { } else {
switch (partition) { switch (partition) {
case PARTITION_NONE: case PARTITION_NONE:
decode_block(pbi, xd, tile, mi_row, mi_col, r, subsize); decode_block(pbi, xd, mi_row, mi_col, r, subsize);
break; break;
case PARTITION_HORZ: case PARTITION_HORZ:
decode_block(pbi, xd, tile, mi_row, mi_col, r, subsize); decode_block(pbi, xd, mi_row, mi_col, r, subsize);
if (has_rows) if (has_rows)
decode_block(pbi, xd, tile, mi_row + hbs, mi_col, r, subsize); decode_block(pbi, xd, mi_row + hbs, mi_col, r, subsize);
break; break;
case PARTITION_VERT: case PARTITION_VERT:
decode_block(pbi, xd, tile, mi_row, mi_col, r, subsize); decode_block(pbi, xd, mi_row, mi_col, r, subsize);
if (has_cols) if (has_cols)
decode_block(pbi, xd, tile, mi_row, mi_col + hbs, r, subsize); decode_block(pbi, xd, mi_row, mi_col + hbs, r, subsize);
break; break;
case PARTITION_SPLIT: case PARTITION_SPLIT:
decode_partition(pbi, xd, tile, mi_row, mi_col, r, subsize); decode_partition(pbi, xd, mi_row, mi_col, r, subsize);
decode_partition(pbi, xd, tile, mi_row, mi_col + hbs, r, subsize); decode_partition(pbi, xd, mi_row, mi_col + hbs, r, subsize);
decode_partition(pbi, xd, tile, mi_row + hbs, mi_col, r, subsize); decode_partition(pbi, xd, mi_row + hbs, mi_col, r, subsize);
decode_partition(pbi, xd, tile, mi_row + hbs, mi_col + hbs, r, subsize); decode_partition(pbi, xd, mi_row + hbs, mi_col + hbs, r, subsize);
break; break;
default: default:
assert(0 && "Invalid partition type"); assert(0 && "Invalid partition type");
@ -1315,7 +1313,6 @@ static const uint8_t *decode_tiles(VP9Decoder *pbi,
// Load all tile information into tile_data. // Load all tile information into tile_data.
for (tile_row = 0; tile_row < tile_rows; ++tile_row) { for (tile_row = 0; tile_row < tile_rows; ++tile_row) {
for (tile_col = 0; tile_col < tile_cols; ++tile_col) { for (tile_col = 0; tile_col < tile_cols; ++tile_col) {
TileInfo tile;
const TileBuffer *const buf = &tile_buffers[tile_row][tile_col]; const TileBuffer *const buf = &tile_buffers[tile_row][tile_col];
tile_data = pbi->tile_data + tile_cols * tile_row + tile_col; tile_data = pbi->tile_data + tile_cols * tile_row + tile_col;
tile_data->cm = cm; tile_data->cm = cm;
@ -1323,7 +1320,7 @@ static const uint8_t *decode_tiles(VP9Decoder *pbi,
tile_data->xd.corrupted = 0; tile_data->xd.corrupted = 0;
tile_data->xd.counts = cm->frame_parallel_decoding_mode ? tile_data->xd.counts = cm->frame_parallel_decoding_mode ?
NULL : &cm->counts; NULL : &cm->counts;
vp9_tile_init(&tile, tile_data->cm, tile_row, tile_col); vp9_tile_init(&tile_data->xd.tile, tile_data->cm, tile_row, tile_col);
setup_token_decoder(buf->data, data_end, buf->size, &cm->error, setup_token_decoder(buf->data, data_end, buf->size, &cm->error,
&tile_data->bit_reader, pbi->decrypt_cb, &tile_data->bit_reader, pbi->decrypt_cb,
pbi->decrypt_state); pbi->decrypt_state);
@ -1345,8 +1342,8 @@ static const uint8_t *decode_tiles(VP9Decoder *pbi,
vp9_zero(tile_data->xd.left_seg_context); vp9_zero(tile_data->xd.left_seg_context);
for (mi_col = tile.mi_col_start; mi_col < tile.mi_col_end; for (mi_col = tile.mi_col_start; mi_col < tile.mi_col_end;
mi_col += MI_BLOCK_SIZE) { mi_col += MI_BLOCK_SIZE) {
decode_partition(pbi, &tile_data->xd, &tile, mi_row, decode_partition(pbi, &tile_data->xd, mi_row, mi_col,
mi_col, &tile_data->bit_reader, BLOCK_64X64); &tile_data->bit_reader, BLOCK_64X64);
} }
pbi->mb.corrupted |= tile_data->xd.corrupted; pbi->mb.corrupted |= tile_data->xd.corrupted;
if (pbi->mb.corrupted) if (pbi->mb.corrupted)
@ -1419,7 +1416,7 @@ static int tile_worker_hook(TileWorkerData *const tile_data,
for (mi_col = tile->mi_col_start; mi_col < tile->mi_col_end; for (mi_col = tile->mi_col_start; mi_col < tile->mi_col_end;
mi_col += MI_BLOCK_SIZE) { mi_col += MI_BLOCK_SIZE) {
decode_partition(tile_data->pbi, &tile_data->xd, decode_partition(tile_data->pbi, &tile_data->xd,
tile, mi_row, mi_col, &tile_data->bit_reader, mi_row, mi_col, &tile_data->bit_reader,
BLOCK_64X64); BLOCK_64X64);
} }
} }
@ -1543,6 +1540,7 @@ static const uint8_t *decode_tiles_mt(VP9Decoder *pbi,
tile_data->xd.counts = cm->frame_parallel_decoding_mode ? tile_data->xd.counts = cm->frame_parallel_decoding_mode ?
0 : &tile_data->counts; 0 : &tile_data->counts;
vp9_tile_init(tile, cm, 0, buf->col); vp9_tile_init(tile, cm, 0, buf->col);
vp9_tile_init(&tile_data->xd.tile, cm, 0, buf->col);
setup_token_decoder(buf->data, data_end, buf->size, &cm->error, setup_token_decoder(buf->data, data_end, buf->size, &cm->error,
&tile_data->bit_reader, pbi->decrypt_cb, &tile_data->bit_reader, pbi->decrypt_cb,
pbi->decrypt_state); pbi->decrypt_state);

Просмотреть файл

@ -464,7 +464,6 @@ static void fpm_sync(void *const data, int mi_row) {
static void read_inter_block_mode_info(VP9Decoder *const pbi, static void read_inter_block_mode_info(VP9Decoder *const pbi,
MACROBLOCKD *const xd, MACROBLOCKD *const xd,
const TileInfo *const tile,
MODE_INFO *const mi, MODE_INFO *const mi,
int mi_row, int mi_col, vp9_reader *r) { int mi_row, int mi_col, vp9_reader *r) {
VP9_COMMON *const cm = &pbi->common; VP9_COMMON *const cm = &pbi->common;
@ -482,13 +481,14 @@ static void read_inter_block_mode_info(VP9Decoder *const pbi,
for (ref = 0; ref < 1 + is_compound; ++ref) { for (ref = 0; ref < 1 + is_compound; ++ref) {
const MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref]; const MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref];
RefBuffer *ref_buf = &cm->frame_refs[frame - LAST_FRAME]; RefBuffer *ref_buf = &cm->frame_refs[frame - LAST_FRAME];
xd->block_refs[ref] = ref_buf; xd->block_refs[ref] = ref_buf;
if ((!vp9_is_valid_scale(&ref_buf->sf))) if ((!vp9_is_valid_scale(&ref_buf->sf)))
vpx_internal_error(xd->error_info, VPX_CODEC_UNSUP_BITSTREAM, vpx_internal_error(xd->error_info, VPX_CODEC_UNSUP_BITSTREAM,
"Reference frame has invalid dimensions"); "Reference frame has invalid dimensions");
vp9_setup_pre_planes(xd, ref, ref_buf->buf, mi_row, mi_col, vp9_setup_pre_planes(xd, ref, ref_buf->buf, mi_row, mi_col,
&ref_buf->sf); &ref_buf->sf);
vp9_find_mv_refs(cm, xd, tile, mi, frame, ref_mvs[frame], vp9_find_mv_refs(cm, xd, mi, frame, ref_mvs[frame],
mi_row, mi_col, fpm_sync, (void *)pbi, inter_mode_ctx); mi_row, mi_col, fpm_sync, (void *)pbi, inter_mode_ctx);
} }
@ -531,7 +531,7 @@ static void read_inter_block_mode_info(VP9Decoder *const pbi,
if (b_mode == NEARESTMV || b_mode == NEARMV) { if (b_mode == NEARESTMV || b_mode == NEARMV) {
uint8_t dummy_mode_ctx[MAX_REF_FRAMES]; uint8_t dummy_mode_ctx[MAX_REF_FRAMES];
for (ref = 0; ref < 1 + is_compound; ++ref) for (ref = 0; ref < 1 + is_compound; ++ref)
vp9_append_sub8x8_mvs_for_idx(cm, xd, tile, j, ref, mi_row, mi_col, vp9_append_sub8x8_mvs_for_idx(cm, xd, j, ref, mi_row, mi_col,
&nearest_sub8x8[ref], &nearest_sub8x8[ref],
&near_sub8x8[ref], &near_sub8x8[ref],
dummy_mode_ctx); dummy_mode_ctx);
@ -567,7 +567,6 @@ static void read_inter_block_mode_info(VP9Decoder *const pbi,
static void read_inter_frame_mode_info(VP9Decoder *const pbi, static void read_inter_frame_mode_info(VP9Decoder *const pbi,
MACROBLOCKD *const xd, MACROBLOCKD *const xd,
const TileInfo *const tile,
int mi_row, int mi_col, vp9_reader *r) { int mi_row, int mi_col, vp9_reader *r) {
VP9_COMMON *const cm = &pbi->common; VP9_COMMON *const cm = &pbi->common;
MODE_INFO *const mi = xd->mi[0]; MODE_INFO *const mi = xd->mi[0];
@ -582,13 +581,12 @@ static void read_inter_frame_mode_info(VP9Decoder *const pbi,
mbmi->tx_size = read_tx_size(cm, xd, !mbmi->skip || !inter_block, r); mbmi->tx_size = read_tx_size(cm, xd, !mbmi->skip || !inter_block, r);
if (inter_block) if (inter_block)
read_inter_block_mode_info(pbi, xd, tile, mi, mi_row, mi_col, r); read_inter_block_mode_info(pbi, xd, mi, mi_row, mi_col, r);
else else
read_intra_block_mode_info(cm, xd, mi, r); read_intra_block_mode_info(cm, xd, mi, r);
} }
void vp9_read_mode_info(VP9Decoder *const pbi, MACROBLOCKD *xd, void vp9_read_mode_info(VP9Decoder *const pbi, MACROBLOCKD *xd,
const TileInfo *const tile,
int mi_row, int mi_col, vp9_reader *r) { int mi_row, int mi_col, vp9_reader *r) {
VP9_COMMON *const cm = &pbi->common; VP9_COMMON *const cm = &pbi->common;
MODE_INFO *const mi = xd->mi[0]; MODE_INFO *const mi = xd->mi[0];
@ -602,7 +600,7 @@ void vp9_read_mode_info(VP9Decoder *const pbi, MACROBLOCKD *xd,
if (frame_is_intra_only(cm)) { if (frame_is_intra_only(cm)) {
read_intra_frame_mode_info(cm, xd, mi_row, mi_col, r); read_intra_frame_mode_info(cm, xd, mi_row, mi_col, r);
} else { } else {
read_inter_frame_mode_info(pbi, xd, tile, mi_row, mi_col, r); read_inter_frame_mode_info(pbi, xd, mi_row, mi_col, r);
for (h = 0; h < y_mis; ++h) { for (h = 0; h < y_mis; ++h) {
MV_REF *const frame_mv = frame_mvs + h * cm->mi_cols; MV_REF *const frame_mv = frame_mvs + h * cm->mi_cols;

Просмотреть файл

@ -18,10 +18,7 @@
extern "C" { extern "C" {
#endif #endif
struct TileInfo;
void vp9_read_mode_info(VP9Decoder *const pbi, MACROBLOCKD *xd, void vp9_read_mode_info(VP9Decoder *const pbi, MACROBLOCKD *xd,
const struct TileInfo *const tile,
int mi_row, int mi_col, vp9_reader *r); int mi_row, int mi_col, vp9_reader *r);
#ifdef __cplusplus #ifdef __cplusplus

Просмотреть файл

@ -230,6 +230,9 @@ static void set_offsets(VP9_COMP *cpi, const TileInfo *const tile,
mbmi->segment_id = 0; mbmi->segment_id = 0;
x->encode_breakout = cpi->encode_breakout; x->encode_breakout = cpi->encode_breakout;
} }
// required by vp9_append_sub8x8_mvs_for_idx() and vp9_find_best_ref_mvs()
xd->tile = *tile;
} }
static void duplicate_mode_info_in_sb(VP9_COMMON *cm, MACROBLOCKD *xd, static void duplicate_mode_info_in_sb(VP9_COMMON *cm, MACROBLOCKD *xd,
@ -2930,7 +2933,7 @@ static void nonrd_pick_sb_modes(VP9_COMP *cpi,
vp9_pick_inter_mode(cpi, x, tile_data, mi_row, mi_col, vp9_pick_inter_mode(cpi, x, tile_data, mi_row, mi_col,
rd_cost, bsize, ctx); rd_cost, bsize, ctx);
else else
vp9_pick_inter_mode_sub8x8(cpi, x, tile_data, mi_row, mi_col, vp9_pick_inter_mode_sub8x8(cpi, x, mi_row, mi_col,
rd_cost, bsize, ctx); rd_cost, bsize, ctx);
duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, bsize); duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, bsize);

Просмотреть файл

@ -1179,7 +1179,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
sf, sf); sf, sf);
if (cm->use_prev_frame_mvs) if (cm->use_prev_frame_mvs)
vp9_find_mv_refs(cm, xd, tile_info, xd->mi[0], ref_frame, vp9_find_mv_refs(cm, xd, xd->mi[0], ref_frame,
candidates, mi_row, mi_col, NULL, NULL, candidates, mi_row, mi_col, NULL, NULL,
xd->mi[0]->mbmi.mode_context); xd->mi[0]->mbmi.mode_context);
else else
@ -1623,11 +1623,9 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
} }
void vp9_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x, void vp9_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
TileDataEnc *tile_data,
int mi_row, int mi_col, RD_COST *rd_cost, int mi_row, int mi_col, RD_COST *rd_cost,
BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) { BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) {
VP9_COMMON *const cm = &cpi->common; VP9_COMMON *const cm = &cpi->common;
TileInfo *const tile_info = &tile_data->tile_info;
SPEED_FEATURES *const sf = &cpi->sf; SPEED_FEATURES *const sf = &cpi->sf;
MACROBLOCKD *const xd = &x->e_mbd; MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi; MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
@ -1659,7 +1657,7 @@ void vp9_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
&cm->frame_refs[ref_frame - 1].sf; &cm->frame_refs[ref_frame - 1].sf;
vp9_setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col, vp9_setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col,
sf, sf); sf, sf);
vp9_find_mv_refs(cm, xd, tile_info, xd->mi[0], ref_frame, vp9_find_mv_refs(cm, xd, xd->mi[0], ref_frame,
candidates, mi_row, mi_col, NULL, NULL, candidates, mi_row, mi_col, NULL, NULL,
xd->mi[0]->mbmi.mode_context); xd->mi[0]->mbmi.mode_context);
@ -1733,7 +1731,7 @@ void vp9_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
b_mv[ZEROMV].as_int = 0; b_mv[ZEROMV].as_int = 0;
b_mv[NEWMV].as_int = INVALID_MV; b_mv[NEWMV].as_int = INVALID_MV;
vp9_append_sub8x8_mvs_for_idx(cm, xd, tile_info, i, 0, mi_row, mi_col, vp9_append_sub8x8_mvs_for_idx(cm, xd, i, 0, mi_row, mi_col,
&b_mv[NEARESTMV], &b_mv[NEARESTMV],
&b_mv[NEARMV], &b_mv[NEARMV],
xd->mi[0]->mbmi.mode_context); xd->mi[0]->mbmi.mode_context);

Просмотреть файл

@ -27,7 +27,6 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
PICK_MODE_CONTEXT *ctx); PICK_MODE_CONTEXT *ctx);
void vp9_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x, void vp9_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
TileDataEnc *tile_data,
int mi_row, int mi_col, RD_COST *rd_cost, int mi_row, int mi_col, RD_COST *rd_cost,
BLOCK_SIZE bsize, BLOCK_SIZE bsize,
PICK_MODE_CONTEXT *ctx); PICK_MODE_CONTEXT *ctx);

Просмотреть файл

@ -1732,7 +1732,6 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
} }
static int64_t rd_pick_best_sub8x8_mode(VP9_COMP *cpi, MACROBLOCK *x, static int64_t rd_pick_best_sub8x8_mode(VP9_COMP *cpi, MACROBLOCK *x,
const TileInfo * const tile,
int_mv *best_ref_mv, int_mv *best_ref_mv,
int_mv *second_best_ref_mv, int_mv *second_best_ref_mv,
int64_t best_rd, int *returntotrate, int64_t best_rd, int *returntotrate,
@ -1802,7 +1801,7 @@ static int64_t rd_pick_best_sub8x8_mode(VP9_COMP *cpi, MACROBLOCK *x,
for (ref = 0; ref < 1 + has_second_rf; ++ref) { for (ref = 0; ref < 1 + has_second_rf; ++ref) {
const MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref]; const MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref];
frame_mv[ZEROMV][frame].as_int = 0; frame_mv[ZEROMV][frame].as_int = 0;
vp9_append_sub8x8_mvs_for_idx(cm, xd, tile, i, ref, mi_row, mi_col, vp9_append_sub8x8_mvs_for_idx(cm, xd, i, ref, mi_row, mi_col,
&frame_mv[NEARESTMV][frame], &frame_mv[NEARESTMV][frame],
&frame_mv[NEARMV][frame], &frame_mv[NEARMV][frame],
xd->mi[0]->mbmi.mode_context); xd->mi[0]->mbmi.mode_context);
@ -2199,7 +2198,6 @@ static void store_coding_context(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx,
} }
static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x, static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x,
const TileInfo *const tile,
MV_REFERENCE_FRAME ref_frame, MV_REFERENCE_FRAME ref_frame,
BLOCK_SIZE block_size, BLOCK_SIZE block_size,
int mi_row, int mi_col, int mi_row, int mi_col,
@ -2220,7 +2218,7 @@ static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x,
vp9_setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col, sf, sf); vp9_setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col, sf, sf);
// Gets an initial list of candidate vectors from neighbours and orders them // Gets an initial list of candidate vectors from neighbours and orders them
vp9_find_mv_refs(cm, xd, tile, mi, ref_frame, candidates, mi_row, mi_col, vp9_find_mv_refs(cm, xd, mi, ref_frame, candidates, mi_row, mi_col,
NULL, NULL, xd->mi[0]->mbmi.mode_context); NULL, NULL, xd->mi[0]->mbmi.mode_context);
// Candidate refinement carried out at encoder and decoder // Candidate refinement carried out at encoder and decoder
@ -2982,7 +2980,7 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi,
x->pred_mv_sad[ref_frame] = INT_MAX; x->pred_mv_sad[ref_frame] = INT_MAX;
if (cpi->ref_frame_flags & flag_list[ref_frame]) { if (cpi->ref_frame_flags & flag_list[ref_frame]) {
assert(get_ref_frame_buffer(cpi, ref_frame) != NULL); assert(get_ref_frame_buffer(cpi, ref_frame) != NULL);
setup_buffer_inter(cpi, x, tile_info, ref_frame, bsize, mi_row, mi_col, setup_buffer_inter(cpi, x, ref_frame, bsize, mi_row, mi_col,
frame_mv[NEARESTMV], frame_mv[NEARMV], yv12_mb); frame_mv[NEARESTMV], frame_mv[NEARMV], yv12_mb);
} }
frame_mv[NEWMV][ref_frame].as_int = INVALID_MV; frame_mv[NEWMV][ref_frame].as_int = INVALID_MV;
@ -3714,7 +3712,6 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi,
PICK_MODE_CONTEXT *ctx, PICK_MODE_CONTEXT *ctx,
int64_t best_rd_so_far) { int64_t best_rd_so_far) {
VP9_COMMON *const cm = &cpi->common; VP9_COMMON *const cm = &cpi->common;
TileInfo *const tile_info = &tile_data->tile_info;
RD_OPT *const rd_opt = &cpi->rd; RD_OPT *const rd_opt = &cpi->rd;
SPEED_FEATURES *const sf = &cpi->sf; SPEED_FEATURES *const sf = &cpi->sf;
MACROBLOCKD *const xd = &x->e_mbd; MACROBLOCKD *const xd = &x->e_mbd;
@ -3778,8 +3775,7 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi,
for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) { for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) {
if (cpi->ref_frame_flags & flag_list[ref_frame]) { if (cpi->ref_frame_flags & flag_list[ref_frame]) {
setup_buffer_inter(cpi, x, tile_info, setup_buffer_inter(cpi, x, ref_frame, bsize, mi_row, mi_col,
ref_frame, bsize, mi_row, mi_col,
frame_mv[NEARESTMV], frame_mv[NEARMV], frame_mv[NEARESTMV], frame_mv[NEARMV],
yv12_mb); yv12_mb);
} else { } else {
@ -3971,7 +3967,7 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi,
int newbest, rs; int newbest, rs;
int64_t rs_rd; int64_t rs_rd;
mbmi->interp_filter = switchable_filter_index; mbmi->interp_filter = switchable_filter_index;
tmp_rd = rd_pick_best_sub8x8_mode(cpi, x, tile_info, tmp_rd = rd_pick_best_sub8x8_mode(cpi, x,
&mbmi->ref_mvs[ref_frame][0], &mbmi->ref_mvs[ref_frame][0],
second_ref, best_yrd, &rate, second_ref, best_yrd, &rate,
&rate_y, &distortion, &rate_y, &distortion,
@ -4037,7 +4033,7 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi,
if (!pred_exists) { if (!pred_exists) {
// Handles the special case when a filter that is not in the // Handles the special case when a filter that is not in the
// switchable list (bilinear, 6-tap) is indicated at the frame level // switchable list (bilinear, 6-tap) is indicated at the frame level
tmp_rd = rd_pick_best_sub8x8_mode(cpi, x, tile_info, tmp_rd = rd_pick_best_sub8x8_mode(cpi, x,
&mbmi->ref_mvs[ref_frame][0], &mbmi->ref_mvs[ref_frame][0],
second_ref, best_yrd, &rate, &rate_y, second_ref, best_yrd, &rate, &rate_y,
&distortion, &skippable, &total_sse, &distortion, &skippable, &total_sse,