Commit 2d5fd742 authored by Hui Su's avatar Hui Su

Do not use hash-me for high bit-depth

Hash-me currently does not support high bit-depth.

BUG=aomedia:1276

Change-Id: I00a2abf17c1c00c91b1ba471f6ef0515410a67dc
parent 59dd91b0
......@@ -4278,7 +4278,7 @@ static void encode_frame_internal(AV1_COMP *cpi) {
#endif // CONFIG_INTRABC
#if CONFIG_HASH_ME
if (cpi->oxcf.pass != 1 && cpi->common.allow_screen_content_tools) {
if (cpi->oxcf.pass != 1 && av1_use_hash_me(cm)) {
// add to hash table
const int pic_width = cpi->source->y_crop_width;
const int pic_height = cpi->source->y_crop_height;
......
......@@ -4807,8 +4807,10 @@ static void init_ref_frame_bufs(AV1_COMMON *cm) {
pool->frame_bufs[i].ref_count = 0;
}
#if CONFIG_HASH_ME
for (i = 0; i < FRAME_BUFFERS; ++i) {
av1_hash_table_init(&pool->frame_bufs[i].hash_table);
if (av1_use_hash_me(cm)) {
for (i = 0; i < FRAME_BUFFERS; ++i) {
av1_hash_table_init(&pool->frame_bufs[i].hash_table);
}
}
#endif
}
......
......@@ -690,8 +690,13 @@ static INLINE int get_ref_frame_buf_idx(const AV1_COMP *cpi,
}
#if CONFIG_HASH_ME
static INLINE hash_table *get_ref_frame_hash_map(const AV1_COMP *cpi,
MV_REFERENCE_FRAME ref_frame) {
// TODO(huisu@google.com, youzhou@microsoft.com): enable hash-me for HBD.
static INLINE int av1_use_hash_me(const AV1_COMMON *const cm) {
return cm->allow_screen_content_tools && cm->bit_depth == 8;
}
static INLINE hash_table *av1_get_ref_frame_hash_map(
const AV1_COMP *cpi, MV_REFERENCE_FRAME ref_frame) {
const AV1_COMMON *const cm = &cpi->common;
const int buf_idx = get_ref_frame_buf_idx(cpi, ref_frame);
return buf_idx != INVALID_IDX
......
......@@ -2630,9 +2630,8 @@ int av1_full_pixel_search(const AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize,
#if CONFIG_HASH_ME
do {
if (!cpi->common.allow_screen_content_tools) {
break;
}
if (!av1_use_hash_me(&cpi->common)) break;
// already single ME
// get block size and original buffer of current block
const int block_height = block_size_high[bsize];
......@@ -2649,8 +2648,8 @@ int av1_full_pixel_search(const AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize,
// for the hashMap
hash_table *ref_frame_hash =
intra ? &cpi->common.cur_frame->hash_table
: get_ref_frame_hash_map(cpi,
x->e_mbd.mi[0]->mbmi.ref_frame[0]);
: av1_get_ref_frame_hash_map(
cpi, x->e_mbd.mi[0]->mbmi.ref_frame[0]);
av1_get_block_hash_value(what, what_stride, block_width, &hash_value1,
&hash_value2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment