blob: 2f897bdc7a35a61917ae02cfc3dd283060ddfe4e [file] [log] [blame]
/*
* Copyright (c) 2016, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include "./aom_config.h"
#include "av1/common/alloccommon.h"
#if CONFIG_CDEF
#include "av1/common/cdef.h"
#endif // CONFIG_CDEF
#include "av1/common/filter.h"
#include "av1/common/idct.h"
#include "av1/common/reconinter.h"
#include "av1/common/reconintra.h"
#include "av1/common/resize.h"
#include "av1/common/tile_common.h"
#include "av1/encoder/aq_complexity.h"
#include "av1/encoder/aq_cyclicrefresh.h"
#include "av1/encoder/aq_variance.h"
#include "av1/encoder/bitstream.h"
#if CONFIG_BGSPRITE
#include "av1/encoder/bgsprite.h"
#endif // CONFIG_BGSPRITE
#if CONFIG_ANS
#include "aom_dsp/buf_ans.h"
#endif
#include "av1/encoder/context_tree.h"
#include "av1/encoder/encodeframe.h"
#include "av1/encoder/encodemv.h"
#include "av1/encoder/encoder.h"
#if CONFIG_LV_MAP
#include "av1/encoder/encodetxb.h"
#endif
#include "av1/encoder/ethread.h"
#include "av1/encoder/firstpass.h"
#if CONFIG_HASH_ME
#include "av1/encoder/hash_motion.h"
#endif
#include "av1/encoder/mbgraph.h"
#if CONFIG_NCOBMC_ADAPT_WEIGHT
#include "av1/common/ncobmc_kernels.h"
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#include "av1/encoder/picklpf.h"
#if CONFIG_LOOP_RESTORATION
#include "av1/encoder/pickrst.h"
#endif // CONFIG_LOOP_RESTORATION
#include "av1/encoder/random.h"
#include "av1/encoder/ratectrl.h"
#include "av1/encoder/rd.h"
#include "av1/encoder/segmentation.h"
#include "av1/encoder/speed_features.h"
#include "av1/encoder/temporal_filter.h"
#include "./av1_rtcd.h"
#include "./aom_dsp_rtcd.h"
#include "./aom_scale_rtcd.h"
#include "aom_dsp/psnr.h"
#if CONFIG_INTERNAL_STATS
#include "aom_dsp/ssim.h"
#endif
#include "aom_dsp/aom_dsp_common.h"
#include "aom_dsp/aom_filter.h"
#include "aom_ports/aom_timer.h"
#include "aom_ports/mem.h"
#include "aom_ports/system_state.h"
#include "aom_scale/aom_scale.h"
#if CONFIG_BITSTREAM_DEBUG
#include "aom_util/debug_util.h"
#endif // CONFIG_BITSTREAM_DEBUG
#if CONFIG_ENTROPY_STATS
FRAME_COUNTS aggregate_fc;
// Aggregate frame counts per frame context type
FRAME_COUNTS aggregate_fc_per_type[FRAME_CONTEXTS];
#endif // CONFIG_ENTROPY_STATS
#define AM_SEGMENT_ID_INACTIVE 7
#define AM_SEGMENT_ID_ACTIVE 0
#define SHARP_FILTER_QTHRESH 0 /* Q threshold for 8-tap sharp filter */
#define ALTREF_HIGH_PRECISION_MV 1 // Whether to use high precision mv
// for altref computation.
#define HIGH_PRECISION_MV_QTHRESH 200 // Q threshold for high precision
// mv. Choose a very high value for
// now so that HIGH_PRECISION is always
// chosen.
// #define OUTPUT_YUV_REC
#ifdef OUTPUT_YUV_DENOISED
FILE *yuv_denoised_file = NULL;
#endif
#ifdef OUTPUT_YUV_SKINMAP
FILE *yuv_skinmap_file = NULL;
#endif
#ifdef OUTPUT_YUV_REC
FILE *yuv_rec_file;
#define FILE_NAME_LEN 100
#endif
#if 0
FILE *framepsnr;
FILE *kf_list;
FILE *keyfile;
#endif
#if CONFIG_CFL
CFL_CTX NULL_CFL;
#endif
#if CONFIG_INTERNAL_STATS
typedef enum { Y, U, V, ALL } STAT_TYPE;
#endif // CONFIG_INTERNAL_STATS
static INLINE void Scale2Ratio(AOM_SCALING mode, int *hr, int *hs) {
switch (mode) {
case NORMAL:
*hr = 1;
*hs = 1;
break;
case FOURFIVE:
*hr = 4;
*hs = 5;
break;
case THREEFIVE:
*hr = 3;
*hs = 5;
break;
case ONETWO:
*hr = 1;
*hs = 2;
break;
default:
*hr = 1;
*hs = 1;
assert(0);
break;
}
}
// Mark all inactive blocks as active. Other segmentation features may be set
// so memset cannot be used, instead only inactive blocks should be reset.
static void suppress_active_map(AV1_COMP *cpi) {
unsigned char *const seg_map = cpi->segmentation_map;
int i;
if (cpi->active_map.enabled || cpi->active_map.update)
for (i = 0; i < cpi->common.mi_rows * cpi->common.mi_cols; ++i)
if (seg_map[i] == AM_SEGMENT_ID_INACTIVE)
seg_map[i] = AM_SEGMENT_ID_ACTIVE;
}
static void apply_active_map(AV1_COMP *cpi) {
struct segmentation *const seg = &cpi->common.seg;
unsigned char *const seg_map = cpi->segmentation_map;
const unsigned char *const active_map = cpi->active_map.map;
int i;
assert(AM_SEGMENT_ID_ACTIVE == CR_SEGMENT_ID_BASE);
if (frame_is_intra_only(&cpi->common)) {
cpi->active_map.enabled = 0;
cpi->active_map.update = 1;
}
if (cpi->active_map.update) {
if (cpi->active_map.enabled) {
for (i = 0; i < cpi->common.mi_rows * cpi->common.mi_cols; ++i)
if (seg_map[i] == AM_SEGMENT_ID_ACTIVE) seg_map[i] = active_map[i];
av1_enable_segmentation(seg);
av1_enable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_SKIP);
#if CONFIG_LOOPFILTER_LEVEL
av1_enable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_Y_H);
av1_enable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_Y_V);
av1_enable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_U);
av1_enable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_V);
av1_set_segdata(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_Y_H,
-MAX_LOOP_FILTER);
av1_set_segdata(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_Y_V,
-MAX_LOOP_FILTER);
av1_set_segdata(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_U,
-MAX_LOOP_FILTER);
av1_set_segdata(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_V,
-MAX_LOOP_FILTER);
#else
av1_enable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF);
// Setting the data to -MAX_LOOP_FILTER will result in the computed loop
// filter level being zero regardless of the value of seg->abs_delta.
av1_set_segdata(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF,
-MAX_LOOP_FILTER);
#endif // CONFIG_LOOPFILTER_LEVEL
} else {
av1_disable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_SKIP);
#if CONFIG_LOOPFILTER_LEVEL
av1_disable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_Y_H);
av1_disable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_Y_V);
av1_disable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_U);
av1_disable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_V);
#else
av1_disable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF);
#endif // CONFIG_LOOPFILTER_LEVEL
if (seg->enabled) {
seg->update_data = 1;
seg->update_map = 1;
}
}
cpi->active_map.update = 0;
}
}
int av1_set_active_map(AV1_COMP *cpi, unsigned char *new_map_16x16, int rows,
int cols) {
if (rows == cpi->common.mb_rows && cols == cpi->common.mb_cols) {
unsigned char *const active_map_8x8 = cpi->active_map.map;
const int mi_rows = cpi->common.mi_rows;
const int mi_cols = cpi->common.mi_cols;
const int row_scale = mi_size_high[BLOCK_16X16] == 2 ? 1 : 2;
const int col_scale = mi_size_wide[BLOCK_16X16] == 2 ? 1 : 2;
cpi->active_map.update = 1;
if (new_map_16x16) {
int r, c;
for (r = 0; r < mi_rows; ++r) {
for (c = 0; c < mi_cols; ++c) {
active_map_8x8[r * mi_cols + c] =
new_map_16x16[(r >> row_scale) * cols + (c >> col_scale)]
? AM_SEGMENT_ID_ACTIVE
: AM_SEGMENT_ID_INACTIVE;
}
}
cpi->active_map.enabled = 1;
} else {
cpi->active_map.enabled = 0;
}
return 0;
} else {
return -1;
}
}
int av1_get_active_map(AV1_COMP *cpi, unsigned char *new_map_16x16, int rows,
int cols) {
if (rows == cpi->common.mb_rows && cols == cpi->common.mb_cols &&
new_map_16x16) {
unsigned char *const seg_map_8x8 = cpi->segmentation_map;
const int mi_rows = cpi->common.mi_rows;
const int mi_cols = cpi->common.mi_cols;
const int row_scale = mi_size_high[BLOCK_16X16] == 2 ? 1 : 2;
const int col_scale = mi_size_wide[BLOCK_16X16] == 2 ? 1 : 2;
memset(new_map_16x16, !cpi->active_map.enabled, rows * cols);
if (cpi->active_map.enabled) {
int r, c;
for (r = 0; r < mi_rows; ++r) {
for (c = 0; c < mi_cols; ++c) {
// Cyclic refresh segments are considered active despite not having
// AM_SEGMENT_ID_ACTIVE
new_map_16x16[(r >> row_scale) * cols + (c >> col_scale)] |=
seg_map_8x8[r * mi_cols + c] != AM_SEGMENT_ID_INACTIVE;
}
}
}
return 0;
} else {
return -1;
}
}
static void set_high_precision_mv(AV1_COMP *cpi, int allow_high_precision_mv
#if CONFIG_AMVR
,
int cur_frame_force_integer_mv
#endif
) {
MACROBLOCK *const mb = &cpi->td.mb;
cpi->common.allow_high_precision_mv = allow_high_precision_mv;
#if CONFIG_AMVR
if (cpi->common.allow_high_precision_mv && cur_frame_force_integer_mv == 0) {
#else
if (cpi->common.allow_high_precision_mv) {
#endif
int i;
for (i = 0; i < NMV_CONTEXTS; ++i) {
mb->mv_cost_stack[i] = mb->nmvcost_hp[i];
}
} else {
int i;
for (i = 0; i < NMV_CONTEXTS; ++i) {
mb->mv_cost_stack[i] = mb->nmvcost[i];
}
}
}
static BLOCK_SIZE select_sb_size(const AV1_COMP *const cpi) {
#if CONFIG_EXT_PARTITION
if (cpi->oxcf.superblock_size == AOM_SUPERBLOCK_SIZE_64X64)
return BLOCK_64X64;
if (cpi->oxcf.superblock_size == AOM_SUPERBLOCK_SIZE_128X128)
return BLOCK_128X128;
assert(cpi->oxcf.superblock_size == AOM_SUPERBLOCK_SIZE_DYNAMIC);
assert(IMPLIES(cpi->common.tile_cols > 1,
cpi->common.tile_width % MAX_MIB_SIZE == 0));
assert(IMPLIES(cpi->common.tile_rows > 1,
cpi->common.tile_height % MAX_MIB_SIZE == 0));
// TODO(any): Possibly could improve this with a heuristic.
return BLOCK_128X128;
#else
(void)cpi;
return BLOCK_64X64;
#endif // CONFIG_EXT_PARTITION
}
static void setup_frame(AV1_COMP *cpi) {
AV1_COMMON *const cm = &cpi->common;
// Set up entropy context depending on frame type. The decoder mandates
// the use of the default context, index 0, for keyframes and inter
// frames where the error_resilient_mode or intra_only flag is set. For
// other inter-frames the encoder currently uses only two contexts;
// context 1 for ALTREF frames and context 0 for the others.
if (frame_is_intra_only(cm) || cm->error_resilient_mode) {
av1_setup_past_independence(cm);
} else {
#if CONFIG_NO_FRAME_CONTEXT_SIGNALING
// Just use frame context from first signaled reference frame.
// This will always be LAST_FRAME for now.
#else
const GF_GROUP *gf_group = &cpi->twopass.gf_group;
if (gf_group->update_type[gf_group->index] == INTNL_ARF_UPDATE)
cm->frame_context_idx = EXT_ARF_FRAME;
else if (cpi->refresh_alt_ref_frame)
cm->frame_context_idx = ARF_FRAME;
else if (cpi->rc.is_src_frame_alt_ref)
cm->frame_context_idx = OVERLAY_FRAME;
else if (cpi->refresh_golden_frame)
cm->frame_context_idx = GLD_FRAME;
else if (cpi->refresh_bwd_ref_frame)
cm->frame_context_idx = BRF_FRAME;
else
cm->frame_context_idx = REGULAR_FRAME;
#endif // CONFIG_NO_FRAME_CONTEXT_SIGNALING
}
if (cm->frame_type == KEY_FRAME) {
cpi->refresh_golden_frame = 1;
cpi->refresh_alt_ref_frame = 1;
av1_zero(cpi->interp_filter_selected);
set_sb_size(cm, select_sb_size(cpi));
#if CONFIG_REFERENCE_BUFFER
set_use_reference_buffer(cm, 0);
#endif // CONFIG_REFERENCE_BUFFER
} else {
#if CONFIG_NO_FRAME_CONTEXT_SIGNALING
if (frame_is_intra_only(cm) || cm->error_resilient_mode ||
cm->frame_refs[0].idx < 0) {
*cm->fc = cm->frame_contexts[FRAME_CONTEXT_DEFAULTS];
} else {
*cm->fc = cm->frame_contexts[cm->frame_refs[0].idx];
}
#else
*cm->fc = cm->frame_contexts[cm->frame_context_idx];
#endif // CONFIG_NO_FRAME_CONTEXT_SIGNALING
av1_zero(cpi->interp_filter_selected[0]);
}
#if CONFIG_ONE_SIDED_COMPOUND && \
!CONFIG_EXT_COMP_REFS // No change to bitstream
if (cpi->sf.recode_loop == DISALLOW_RECODE) {
cpi->refresh_bwd_ref_frame = cpi->refresh_last_frame;
cpi->rc.is_bipred_frame = 1;
}
#endif // CONFIG_ONE_SIDED_COMPOUND && !CONFIG_EXT_COMP_REFS
#if CONFIG_NO_FRAME_CONTEXT_SIGNALING
if (frame_is_intra_only(cm) || cm->error_resilient_mode ||
cm->frame_refs[0].idx < 0) {
// use default frame context values
cm->pre_fc = &cm->frame_contexts[FRAME_CONTEXT_DEFAULTS];
} else {
*cm->fc = cm->frame_contexts[cm->frame_refs[0].idx];
cm->pre_fc = &cm->frame_contexts[cm->frame_refs[0].idx];
}
#else
cm->pre_fc = &cm->frame_contexts[cm->frame_context_idx];
#endif // CONFIG_NO_FRAME_CONTEXT_SIGNALING
cpi->vaq_refresh = 0;
}
static void enc_setup_mi(AV1_COMMON *cm) {
int i;
cm->mi = cm->mip + cm->mi_stride + 1;
memset(cm->mip, 0, cm->mi_stride * (cm->mi_rows + 1) * sizeof(*cm->mip));
cm->prev_mi = cm->prev_mip + cm->mi_stride + 1;
// Clear top border row
memset(cm->prev_mip, 0, sizeof(*cm->prev_mip) * cm->mi_stride);
// Clear left border column
for (i = 1; i < cm->mi_rows + 1; ++i)
memset(&cm->prev_mip[i * cm->mi_stride], 0, sizeof(*cm->prev_mip));
cm->mi_grid_visible = cm->mi_grid_base + cm->mi_stride + 1;
cm->prev_mi_grid_visible = cm->prev_mi_grid_base + cm->mi_stride + 1;
memset(cm->mi_grid_base, 0,
cm->mi_stride * (cm->mi_rows + 1) * sizeof(*cm->mi_grid_base));
}
static int enc_alloc_mi(AV1_COMMON *cm, int mi_size) {
cm->mip = aom_calloc(mi_size, sizeof(*cm->mip));
if (!cm->mip) return 1;
cm->prev_mip = aom_calloc(mi_size, sizeof(*cm->prev_mip));
if (!cm->prev_mip) return 1;
cm->mi_alloc_size = mi_size;
cm->mi_grid_base = (MODE_INFO **)aom_calloc(mi_size, sizeof(MODE_INFO *));
if (!cm->mi_grid_base) return 1;
cm->prev_mi_grid_base =
(MODE_INFO **)aom_calloc(mi_size, sizeof(MODE_INFO *));
if (!cm->prev_mi_grid_base) return 1;
return 0;
}
static void enc_free_mi(AV1_COMMON *cm) {
aom_free(cm->mip);
cm->mip = NULL;
aom_free(cm->prev_mip);
cm->prev_mip = NULL;
aom_free(cm->mi_grid_base);
cm->mi_grid_base = NULL;
aom_free(cm->prev_mi_grid_base);
cm->prev_mi_grid_base = NULL;
cm->mi_alloc_size = 0;
}
static void swap_mi_and_prev_mi(AV1_COMMON *cm) {
// Current mip will be the prev_mip for the next frame.
MODE_INFO **temp_base = cm->prev_mi_grid_base;
MODE_INFO *temp = cm->prev_mip;
cm->prev_mip = cm->mip;
cm->mip = temp;
// Update the upper left visible macroblock ptrs.
cm->mi = cm->mip + cm->mi_stride + 1;
cm->prev_mi = cm->prev_mip + cm->mi_stride + 1;
cm->prev_mi_grid_base = cm->mi_grid_base;
cm->mi_grid_base = temp_base;
cm->mi_grid_visible = cm->mi_grid_base + cm->mi_stride + 1;
cm->prev_mi_grid_visible = cm->prev_mi_grid_base + cm->mi_stride + 1;
}
void av1_initialize_enc(void) {
static volatile int init_done = 0;
if (!init_done) {
av1_rtcd();
aom_dsp_rtcd();
aom_scale_rtcd();
av1_init_intra_predictors();
av1_init_me_luts();
#if !CONFIG_XIPHRC
av1_rc_init_minq_luts();
#endif
av1_entropy_mv_init();
av1_encode_token_init();
av1_init_wedge_masks();
init_done = 1;
}
}
static void dealloc_context_buffers_ext(AV1_COMP *cpi) {
if (cpi->mbmi_ext_base) {
aom_free(cpi->mbmi_ext_base);
cpi->mbmi_ext_base = NULL;
}
}
static void alloc_context_buffers_ext(AV1_COMP *cpi) {
AV1_COMMON *cm = &cpi->common;
int mi_size = cm->mi_cols * cm->mi_rows;
dealloc_context_buffers_ext(cpi);
CHECK_MEM_ERROR(cm, cpi->mbmi_ext_base,
aom_calloc(mi_size, sizeof(*cpi->mbmi_ext_base)));
}
static void dealloc_compressor_data(AV1_COMP *cpi) {
AV1_COMMON *const cm = &cpi->common;
dealloc_context_buffers_ext(cpi);
aom_free(cpi->tile_data);
cpi->tile_data = NULL;
// Delete sementation map
aom_free(cpi->segmentation_map);
cpi->segmentation_map = NULL;
av1_cyclic_refresh_free(cpi->cyclic_refresh);
cpi->cyclic_refresh = NULL;
aom_free(cpi->active_map.map);
cpi->active_map.map = NULL;
aom_free(cpi->td.mb.above_pred_buf);
cpi->td.mb.above_pred_buf = NULL;
aom_free(cpi->td.mb.left_pred_buf);
cpi->td.mb.left_pred_buf = NULL;
aom_free(cpi->td.mb.wsrc_buf);
cpi->td.mb.wsrc_buf = NULL;
aom_free(cpi->td.mb.mask_buf);
cpi->td.mb.mask_buf = NULL;
#if CONFIG_MFMV
aom_free(cm->tpl_mvs);
cm->tpl_mvs = NULL;
#endif
av1_free_ref_frame_buffers(cm->buffer_pool);
#if CONFIG_LV_MAP
av1_free_txb_buf(cpi);
#endif
av1_free_context_buffers(cm);
aom_free_frame_buffer(&cpi->last_frame_uf);
#if CONFIG_LOOP_RESTORATION
av1_free_restoration_buffers(cm);
aom_free_frame_buffer(&cpi->trial_frame_rst);
#endif // CONFIG_LOOP_RESTORATION
aom_free_frame_buffer(&cpi->scaled_source);
aom_free_frame_buffer(&cpi->scaled_last_source);
aom_free_frame_buffer(&cpi->alt_ref_buffer);
av1_lookahead_destroy(cpi->lookahead);
aom_free(cpi->tile_tok[0][0]);
cpi->tile_tok[0][0] = 0;
av1_free_pc_tree(&cpi->td);
aom_free(cpi->td.mb.palette_buffer);
#if CONFIG_ANS
aom_buf_ans_free(&cpi->buf_ans);
#endif // CONFIG_ANS
}
static void save_coding_context(AV1_COMP *cpi) {
CODING_CONTEXT *const cc = &cpi->coding_context;
AV1_COMMON *cm = &cpi->common;
int i;
// Stores a snapshot of key state variables which can subsequently be
// restored with a call to av1_restore_coding_context. These functions are
// intended for use in a re-code loop in av1_compress_frame where the
// quantizer value is adjusted between loop iterations.
for (i = 0; i < NMV_CONTEXTS; ++i) {
av1_copy(cc->nmv_vec_cost[i], cpi->td.mb.nmv_vec_cost[i]);
av1_copy(cc->nmv_costs, cpi->nmv_costs);
av1_copy(cc->nmv_costs_hp, cpi->nmv_costs_hp);
}
av1_copy(cc->last_ref_lf_deltas, cm->lf.last_ref_deltas);
av1_copy(cc->last_mode_lf_deltas, cm->lf.last_mode_deltas);
cc->fc = *cm->fc;
}
static void restore_coding_context(AV1_COMP *cpi) {
CODING_CONTEXT *const cc = &cpi->coding_context;
AV1_COMMON *cm = &cpi->common;
int i;
// Restore key state variables to the snapshot state stored in the
// previous call to av1_save_coding_context.
for (i = 0; i < NMV_CONTEXTS; ++i) {
av1_copy(cpi->td.mb.nmv_vec_cost[i], cc->nmv_vec_cost[i]);
av1_copy(cpi->nmv_costs, cc->nmv_costs);
av1_copy(cpi->nmv_costs_hp, cc->nmv_costs_hp);
}
av1_copy(cm->lf.last_ref_deltas, cc->last_ref_lf_deltas);
av1_copy(cm->lf.last_mode_deltas, cc->last_mode_lf_deltas);
*cm->fc = cc->fc;
}
static void configure_static_seg_features(AV1_COMP *cpi) {
AV1_COMMON *const cm = &cpi->common;
const RATE_CONTROL *const rc = &cpi->rc;
struct segmentation *const seg = &cm->seg;
int high_q = (int)(rc->avg_q > 48.0);
int qi_delta;
// Disable and clear down for KF
if (cm->frame_type == KEY_FRAME) {
// Clear down the global segmentation map
memset(cpi->segmentation_map, 0, cm->mi_rows * cm->mi_cols);
seg->update_map = 0;
seg->update_data = 0;
cpi->static_mb_pct = 0;
// Disable segmentation
av1_disable_segmentation(seg);
// Clear down the segment features.
av1_clearall_segfeatures(seg);
} else if (cpi->refresh_alt_ref_frame) {
// If this is an alt ref frame
// Clear down the global segmentation map
memset(cpi->segmentation_map, 0, cm->mi_rows * cm->mi_cols);
seg->update_map = 0;
seg->update_data = 0;
cpi->static_mb_pct = 0;
// Disable segmentation and individual segment features by default
av1_disable_segmentation(seg);
av1_clearall_segfeatures(seg);
// Scan frames from current to arf frame.
// This function re-enables segmentation if appropriate.
av1_update_mbgraph_stats(cpi);
// If segmentation was enabled set those features needed for the
// arf itself.
if (seg->enabled) {
seg->update_map = 1;
seg->update_data = 1;
qi_delta =
av1_compute_qdelta(rc, rc->avg_q, rc->avg_q * 0.875, cm->bit_depth);
av1_set_segdata(seg, 1, SEG_LVL_ALT_Q, qi_delta - 2);
#if CONFIG_LOOPFILTER_LEVEL
av1_set_segdata(seg, 1, SEG_LVL_ALT_LF_Y_H, -2);
av1_set_segdata(seg, 1, SEG_LVL_ALT_LF_Y_V, -2);
av1_set_segdata(seg, 1, SEG_LVL_ALT_LF_U, -2);
av1_set_segdata(seg, 1, SEG_LVL_ALT_LF_V, -2);
av1_enable_segfeature(seg, 1, SEG_LVL_ALT_LF_Y_H);
av1_enable_segfeature(seg, 1, SEG_LVL_ALT_LF_Y_V);
av1_enable_segfeature(seg, 1, SEG_LVL_ALT_LF_U);
av1_enable_segfeature(seg, 1, SEG_LVL_ALT_LF_V);
#else
av1_set_segdata(seg, 1, SEG_LVL_ALT_LF, -2);
av1_enable_segfeature(seg, 1, SEG_LVL_ALT_LF);
#endif // CONFIG_LOOPFILTER_LEVEL
av1_enable_segfeature(seg, 1, SEG_LVL_ALT_Q);
// Where relevant assume segment data is delta data
seg->abs_delta = SEGMENT_DELTADATA;
}
} else if (seg->enabled) {
// All other frames if segmentation has been enabled
// First normal frame in a valid gf or alt ref group
if (rc->frames_since_golden == 0) {
// Set up segment features for normal frames in an arf group
if (rc->source_alt_ref_active) {
seg->update_map = 0;
seg->update_data = 1;
seg->abs_delta = SEGMENT_DELTADATA;
qi_delta =
av1_compute_qdelta(rc, rc->avg_q, rc->avg_q * 1.125, cm->bit_depth);
av1_set_segdata(seg, 1, SEG_LVL_ALT_Q, qi_delta + 2);
av1_enable_segfeature(seg, 1, SEG_LVL_ALT_Q);
#if CONFIG_LOOPFILTER_LEVEL
av1_set_segdata(seg, 1, SEG_LVL_ALT_LF_Y_H, -2);
av1_set_segdata(seg, 1, SEG_LVL_ALT_LF_Y_V, -2);
av1_set_segdata(seg, 1, SEG_LVL_ALT_LF_U, -2);
av1_set_segdata(seg, 1, SEG_LVL_ALT_LF_V, -2);
av1_enable_segfeature(seg, 1, SEG_LVL_ALT_LF_Y_H);
av1_enable_segfeature(seg, 1, SEG_LVL_ALT_LF_Y_V);
av1_enable_segfeature(seg, 1, SEG_LVL_ALT_LF_U);
av1_enable_segfeature(seg, 1, SEG_LVL_ALT_LF_V);
#else
av1_set_segdata(seg, 1, SEG_LVL_ALT_LF, -2);
av1_enable_segfeature(seg, 1, SEG_LVL_ALT_LF);
#endif // CONFIG_LOOPFILTER_LEVEL
// Segment coding disabled for compred testing
if (high_q || (cpi->static_mb_pct == 100)) {
av1_set_segdata(seg, 1, SEG_LVL_REF_FRAME, ALTREF_FRAME);
av1_enable_segfeature(seg, 1, SEG_LVL_REF_FRAME);
av1_enable_segfeature(seg, 1, SEG_LVL_SKIP);
}
} else {
// Disable segmentation and clear down features if alt ref
// is not active for this group
av1_disable_segmentation(seg);
memset(cpi->segmentation_map, 0, cm->mi_rows * cm->mi_cols);
seg->update_map = 0;
seg->update_data = 0;
av1_clearall_segfeatures(seg);
}
} else if (rc->is_src_frame_alt_ref) {
// Special case where we are coding over the top of a previous
// alt ref frame.
// Segment coding disabled for compred testing
// Enable ref frame features for segment 0 as well
av1_enable_segfeature(seg, 0, SEG_LVL_REF_FRAME);
av1_enable_segfeature(seg, 1, SEG_LVL_REF_FRAME);
// All mbs should use ALTREF_FRAME
av1_clear_segdata(seg, 0, SEG_LVL_REF_FRAME);
av1_set_segdata(seg, 0, SEG_LVL_REF_FRAME, ALTREF_FRAME);
av1_clear_segdata(seg, 1, SEG_LVL_REF_FRAME);
av1_set_segdata(seg, 1, SEG_LVL_REF_FRAME, ALTREF_FRAME);
// Skip all MBs if high Q (0,0 mv and skip coeffs)
if (high_q) {
av1_enable_segfeature(seg, 0, SEG_LVL_SKIP);
av1_enable_segfeature(seg, 1, SEG_LVL_SKIP);
}
// Enable data update
seg->update_data = 1;
} else {
// All other frames.
// No updates.. leave things as they are.
seg->update_map = 0;
seg->update_data = 0;
}
}
}
static void update_reference_segmentation_map(AV1_COMP *cpi) {
AV1_COMMON *const cm = &cpi->common;
MODE_INFO **mi_8x8_ptr = cm->mi_grid_visible;
uint8_t *cache_ptr = cm->last_frame_seg_map;
int row, col;
for (row = 0; row < cm->mi_rows; row++) {
MODE_INFO **mi_8x8 = mi_8x8_ptr;
uint8_t *cache = cache_ptr;
for (col = 0; col < cm->mi_cols; col++, mi_8x8++, cache++)
cache[0] = mi_8x8[0]->mbmi.segment_id;
mi_8x8_ptr += cm->mi_stride;
cache_ptr += cm->mi_cols;
}
}
static void alloc_raw_frame_buffers(AV1_COMP *cpi) {
AV1_COMMON *cm = &cpi->common;
const AV1EncoderConfig *oxcf = &cpi->oxcf;
if (!cpi->lookahead)
cpi->lookahead = av1_lookahead_init(oxcf->width, oxcf->height,
cm->subsampling_x, cm->subsampling_y,
#if CONFIG_HIGHBITDEPTH
cm->use_highbitdepth,
#endif
oxcf->lag_in_frames);
if (!cpi->lookahead)
aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
"Failed to allocate lag buffers");
// TODO(agrange) Check if ARF is enabled and skip allocation if not.
if (aom_realloc_frame_buffer(&cpi->alt_ref_buffer, oxcf->width, oxcf->height,
cm->subsampling_x, cm->subsampling_y,
#if CONFIG_HIGHBITDEPTH
cm->use_highbitdepth,
#endif
AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL,
NULL, NULL))
aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
"Failed to allocate altref buffer");
}
static void alloc_util_frame_buffers(AV1_COMP *cpi) {
AV1_COMMON *const cm = &cpi->common;
if (aom_realloc_frame_buffer(&cpi->last_frame_uf, cm->width, cm->height,
cm->subsampling_x, cm->subsampling_y,
#if CONFIG_HIGHBITDEPTH
cm->use_highbitdepth,
#endif
AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL,
NULL, NULL))
aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
"Failed to allocate last frame buffer");
#if CONFIG_LOOP_RESTORATION
if (aom_realloc_frame_buffer(
&cpi->trial_frame_rst,
#if CONFIG_FRAME_SUPERRES
cm->superres_upscaled_width, cm->superres_upscaled_height,
#else
cm->width, cm->height,
#endif // CONFIG_FRAME_SUPERRES
cm->subsampling_x, cm->subsampling_y,
#if CONFIG_HIGHBITDEPTH
cm->use_highbitdepth,
#endif
AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL, NULL, NULL))
aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
"Failed to allocate trial restored frame buffer");
#endif // CONFIG_LOOP_RESTORATION
if (aom_realloc_frame_buffer(&cpi->scaled_source, cm->width, cm->height,
cm->subsampling_x, cm->subsampling_y,
#if CONFIG_HIGHBITDEPTH
cm->use_highbitdepth,
#endif
AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL,
NULL, NULL))
aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
"Failed to allocate scaled source buffer");
if (aom_realloc_frame_buffer(&cpi->scaled_last_source, cm->width, cm->height,
cm->subsampling_x, cm->subsampling_y,
#if CONFIG_HIGHBITDEPTH
cm->use_highbitdepth,
#endif
AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL,
NULL, NULL))
aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
"Failed to allocate scaled last source buffer");
}
static void alloc_compressor_data(AV1_COMP *cpi) {
AV1_COMMON *cm = &cpi->common;
av1_alloc_context_buffers(cm, cm->width, cm->height);
#if CONFIG_LV_MAP
av1_alloc_txb_buf(cpi);
#endif
alloc_context_buffers_ext(cpi);
aom_free(cpi->tile_tok[0][0]);
{
unsigned int tokens = get_token_alloc(cm->mb_rows, cm->mb_cols);
CHECK_MEM_ERROR(cm, cpi->tile_tok[0][0],
aom_calloc(tokens, sizeof(*cpi->tile_tok[0][0])));
}
av1_setup_pc_tree(&cpi->common, &cpi->td);
}
void av1_new_framerate(AV1_COMP *cpi, double framerate) {
cpi->framerate = framerate < 0.1 ? 30 : framerate;
#if CONFIG_XIPHRC
if (!cpi->od_rc.cur_frame) return;
cpi->od_rc.framerate = cpi->framerate;
od_enc_rc_resize(&cpi->od_rc);
#else
av1_rc_update_framerate(cpi, cpi->common.width, cpi->common.height);
#endif
}
#if CONFIG_MAX_TILE
static void set_tile_info_max_tile(AV1_COMP *cpi) {
AV1_COMMON *const cm = &cpi->common;
int i, start_sb;
av1_get_tile_limits(cm);
// configure tile columns
if (cpi->oxcf.tile_width_count == 0 || cpi->oxcf.tile_height_count == 0) {
cm->uniform_tile_spacing_flag = 1;
cm->log2_tile_cols = AOMMAX(cpi->oxcf.tile_columns, cm->min_log2_tile_cols);
cm->log2_tile_cols = AOMMIN(cm->log2_tile_cols, cm->max_log2_tile_cols);
} else {
int mi_cols = ALIGN_POWER_OF_TWO(cm->mi_cols, MAX_MIB_SIZE_LOG2);
int sb_cols = mi_cols >> MAX_MIB_SIZE_LOG2;
int size_sb, j = 0;
cm->uniform_tile_spacing_flag = 0;
for (i = 0, start_sb = 0; start_sb < sb_cols && i < MAX_TILE_COLS; i++) {
cm->tile_col_start_sb[i] = start_sb;
size_sb = cpi->oxcf.tile_widths[j++];
if (j >= cpi->oxcf.tile_width_count) j = 0;
start_sb += AOMMIN(size_sb, MAX_TILE_WIDTH_SB);
}
cm->tile_cols = i;
cm->tile_col_start_sb[i] = sb_cols;
}
av1_calculate_tile_cols(cm);
// configure tile rows
if (cm->uniform_tile_spacing_flag) {
cm->log2_tile_rows = AOMMAX(cpi->oxcf.tile_rows, cm->min_log2_tile_rows);
cm->log2_tile_rows = AOMMIN(cm->log2_tile_rows, cm->max_log2_tile_rows);
} else {
int mi_rows = ALIGN_POWER_OF_TWO(cm->mi_rows, MAX_MIB_SIZE_LOG2);
int sb_rows = mi_rows >> MAX_MIB_SIZE_LOG2;
int size_sb, j = 0;
for (i = 0, start_sb = 0; start_sb < sb_rows && i < MAX_TILE_ROWS; i++) {
cm->tile_row_start_sb[i] = start_sb;
size_sb = cpi->oxcf.tile_heights[j++];
if (j >= cpi->oxcf.tile_height_count) j = 0;
start_sb += AOMMIN(size_sb, cm->max_tile_height_sb);
}
cm->tile_rows = i;
cm->tile_row_start_sb[i] = sb_rows;
}
av1_calculate_tile_rows(cm);
}
#endif
static void set_tile_info(AV1_COMP *cpi) {
AV1_COMMON *const cm = &cpi->common;
#if CONFIG_DEPENDENT_HORZTILES
int tile_row, tile_col, num_tiles_in_tg;
int tg_row_start, tg_col_start;
#endif
#if CONFIG_EXT_TILE
if (cpi->oxcf.large_scale_tile) {
#if CONFIG_EXT_PARTITION
if (cpi->oxcf.superblock_size != AOM_SUPERBLOCK_SIZE_64X64) {
cm->tile_width = clamp(cpi->oxcf.tile_columns, 1, 32);
cm->tile_height = clamp(cpi->oxcf.tile_rows, 1, 32);
cm->tile_width <<= MAX_MIB_SIZE_LOG2;
cm->tile_height <<= MAX_MIB_SIZE_LOG2;
} else {
cm->tile_width = clamp(cpi->oxcf.tile_columns, 1, 64);
cm->tile_height = clamp(cpi->oxcf.tile_rows, 1, 64);
cm->tile_width <<= MAX_MIB_SIZE_LOG2 - 1;
cm->tile_height <<= MAX_MIB_SIZE_LOG2 - 1;
}
#else
cm->tile_width = clamp(cpi->oxcf.tile_columns, 1, 64);
cm->tile_height = clamp(cpi->oxcf.tile_rows, 1, 64);
cm->tile_width <<= MAX_MIB_SIZE_LOG2;
cm->tile_height <<= MAX_MIB_SIZE_LOG2;
#endif // CONFIG_EXT_PARTITION
cm->tile_width = AOMMIN(cm->tile_width, cm->mi_cols);
cm->tile_height = AOMMIN(cm->tile_height, cm->mi_rows);
assert(cm->tile_width >> MAX_MIB_SIZE_LOG2 <= 32);
assert(cm->tile_height >> MAX_MIB_SIZE_LOG2 <= 32);
// Get the number of tiles
cm->tile_cols = 1;
while (cm->tile_cols * cm->tile_width < cm->mi_cols) ++cm->tile_cols;
cm->tile_rows = 1;
while (cm->tile_rows * cm->tile_height < cm->mi_rows) ++cm->tile_rows;
} else {
#endif // CONFIG_EXT_TILE
#if CONFIG_MAX_TILE
set_tile_info_max_tile(cpi);
#else
int min_log2_tile_cols, max_log2_tile_cols;
av1_get_tile_n_bits(cm->mi_cols, &min_log2_tile_cols, &max_log2_tile_cols);
cm->log2_tile_cols =
clamp(cpi->oxcf.tile_columns, min_log2_tile_cols, max_log2_tile_cols);
cm->log2_tile_rows = cpi->oxcf.tile_rows;
cm->tile_width =
get_tile_size(cm->mi_cols, cm->log2_tile_cols, &cm->tile_cols);
cm->tile_height =
get_tile_size(cm->mi_rows, cm->log2_tile_rows, &cm->tile_rows);
#endif // CONFIG_MAX_TILE
#if CONFIG_EXT_TILE
}
#endif // CONFIG_EXT_TILE
#if CONFIG_DEPENDENT_HORZTILES
cm->dependent_horz_tiles = cpi->oxcf.dependent_horz_tiles;
#if CONFIG_EXT_TILE
if (cm->large_scale_tile) {
// May not needed since cpi->oxcf.dependent_horz_tiles is already adjusted.
cm->dependent_horz_tiles = 0;
} else {
#endif // CONFIG_EXT_TILE
if (cm->log2_tile_rows == 0) cm->dependent_horz_tiles = 0;
#if CONFIG_EXT_TILE
}
#endif // CONFIG_EXT_TILE
#if CONFIG_EXT_TILE
if (!cm->large_scale_tile) {
#endif // CONFIG_EXT_TILE
if (cpi->oxcf.mtu == 0) {
cm->num_tg = cpi->oxcf.num_tile_groups;
} else {
// Use a default value for the purposes of weighting costs in probability
// updates
cm->num_tg = DEFAULT_MAX_NUM_TG;
}
num_tiles_in_tg =
(cm->tile_cols * cm->tile_rows + cm->num_tg - 1) / cm->num_tg;
tg_row_start = 0;
tg_col_start = 0;
for (tile_row = 0; tile_row < cm->tile_rows; ++tile_row) {
for (tile_col = 0; tile_col < cm->tile_cols; ++tile_col) {
if ((tile_row * cm->tile_cols + tile_col) % num_tiles_in_tg == 0) {
tg_row_start = tile_row;
tg_col_start = tile_col;
}
cm->tile_group_start_row[tile_row][tile_col] = tg_row_start;
cm->tile_group_start_col[tile_row][tile_col] = tg_col_start;
}
}
#if CONFIG_EXT_TILE
}
#endif // CONFIG_EXT_TILE
#endif
#if CONFIG_LOOPFILTERING_ACROSS_TILES
cm->loop_filter_across_tiles_enabled =
cpi->oxcf.loop_filter_across_tiles_enabled;
#endif // CONFIG_LOOPFILTERING_ACROSS_TILES
}
static void update_frame_size(AV1_COMP *cpi) {
AV1_COMMON *const cm = &cpi->common;
MACROBLOCKD *const xd = &cpi->td.mb.e_mbd;
av1_set_mb_mi(cm, cm->width, cm->height);
av1_init_context_buffers(cm);
av1_init_macroblockd(cm, xd,
#if CONFIG_CFL
&NULL_CFL,
#endif
NULL);
memset(cpi->mbmi_ext_base, 0,
cm->mi_rows * cm->mi_cols * sizeof(*cpi->mbmi_ext_base));
set_tile_info(cpi);
}
static void init_buffer_indices(AV1_COMP *cpi) {
int fb_idx;
for (fb_idx = 0; fb_idx < LAST_REF_FRAMES; ++fb_idx)
cpi->lst_fb_idxes[fb_idx] = fb_idx;
cpi->gld_fb_idx = LAST_REF_FRAMES;
cpi->bwd_fb_idx = LAST_REF_FRAMES + 1;
cpi->alt2_fb_idx = LAST_REF_FRAMES + 2;
cpi->alt_fb_idx = LAST_REF_FRAMES + 3;
cpi->ext_fb_idx = LAST_REF_FRAMES + 4;
for (fb_idx = 0; fb_idx < MAX_EXT_ARFS + 1; ++fb_idx)
cpi->arf_map[fb_idx] = LAST_REF_FRAMES + 2 + fb_idx;
#if CONFIG_AMVR
cpi->rate_index = 0;
cpi->rate_size = 0;
cpi->cur_poc = -1;
#endif
}
static void init_config(struct AV1_COMP *cpi, AV1EncoderConfig *oxcf) {
AV1_COMMON *const cm = &cpi->common;
cpi->oxcf = *oxcf;
cpi->framerate = oxcf->init_framerate;
cm->profile = oxcf->profile;
cm->bit_depth = oxcf->bit_depth;
#if CONFIG_HIGHBITDEPTH
cm->use_highbitdepth = oxcf->use_highbitdepth;
#endif
cm->color_space = oxcf->color_space;
#if CONFIG_COLORSPACE_HEADERS
cm->transfer_function = oxcf->transfer_function;
cm->chroma_sample_position = oxcf->chroma_sample_position;
#endif
cm->color_range = oxcf->color_range;
cm->width = oxcf->width;
cm->height = oxcf->height;
alloc_compressor_data(cpi);
// Single thread case: use counts in common.
cpi->td.counts = &cm->counts;
// change includes all joint functionality
av1_change_config(cpi, oxcf);
cpi->static_mb_pct = 0;
cpi->ref_frame_flags = 0;
// Reset resize pending flags
cpi->resize_pending_width = 0;
cpi->resize_pending_height = 0;
init_buffer_indices(cpi);
}
static void set_rc_buffer_sizes(RATE_CONTROL *rc,
const AV1EncoderConfig *oxcf) {
const int64_t bandwidth = oxcf->target_bandwidth;
const int64_t starting = oxcf->starting_buffer_level_ms;
const int64_t optimal = oxcf->optimal_buffer_level_ms;
const int64_t maximum = oxcf->maximum_buffer_size_ms;
rc->starting_buffer_level = starting * bandwidth / 1000;
rc->optimal_buffer_level =
(optimal == 0) ? bandwidth / 8 : optimal * bandwidth / 1000;
rc->maximum_buffer_size =
(maximum == 0) ? bandwidth / 8 : maximum * bandwidth / 1000;
}
#if CONFIG_HIGHBITDEPTH
#define HIGHBD_BFP(BT, SDF, SDAF, VF, SVF, SVAF, SDX3F, SDX8F, SDX4DF) \
cpi->fn_ptr[BT].sdf = SDF; \
cpi->fn_ptr[BT].sdaf = SDAF; \
cpi->fn_ptr[BT].vf = VF; \
cpi->fn_ptr[BT].svf = SVF; \
cpi->fn_ptr[BT].svaf = SVAF; \
cpi->fn_ptr[BT].sdx3f = SDX3F; \
cpi->fn_ptr[BT].sdx8f = SDX8F; \
cpi->fn_ptr[BT].sdx4df = SDX4DF;
#define MAKE_BFP_SAD_WRAPPER(fnname) \
static unsigned int fnname##_bits8(const uint8_t *src_ptr, \
int source_stride, \
const uint8_t *ref_ptr, int ref_stride) { \
return fnname(src_ptr, source_stride, ref_ptr, ref_stride); \
} \
static unsigned int fnname##_bits10( \
const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, \
int ref_stride) { \
return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 2; \
} \
static unsigned int fnname##_bits12( \
const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, \
int ref_stride) { \
return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 4; \
}
#define MAKE_BFP_SADAVG_WRAPPER(fnname) \
static unsigned int fnname##_bits8( \
const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, \
int ref_stride, const uint8_t *second_pred) { \
return fnname(src_ptr, source_stride, ref_ptr, ref_stride, second_pred); \
} \
static unsigned int fnname##_bits10( \
const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, \
int ref_stride, const uint8_t *second_pred) { \
return fnname(src_ptr, source_stride, ref_ptr, ref_stride, second_pred) >> \
2; \
} \
static unsigned int fnname##_bits12( \
const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, \
int ref_stride, const uint8_t *second_pred) { \
return fnname(src_ptr, source_stride, ref_ptr, ref_stride, second_pred) >> \
4; \
}
#define MAKE_BFP_SAD3_WRAPPER(fnname) \
static void fnname##_bits8(const uint8_t *src_ptr, int source_stride, \
const uint8_t *ref_ptr, int ref_stride, \
unsigned int *sad_array) { \
fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \
} \
static void fnname##_bits10(const uint8_t *src_ptr, int source_stride, \
const uint8_t *ref_ptr, int ref_stride, \
unsigned int *sad_array) { \
int i; \
fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \
for (i = 0; i < 3; i++) sad_array[i] >>= 2; \
} \
static void fnname##_bits12(const uint8_t *src_ptr, int source_stride, \
const uint8_t *ref_ptr, int ref_stride, \
unsigned int *sad_array) { \
int i; \
fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \
for (i = 0; i < 3; i++) sad_array[i] >>= 4; \
}
#define MAKE_BFP_SAD8_WRAPPER(fnname) \
static void fnname##_bits8(const uint8_t *src_ptr, int source_stride, \
const uint8_t *ref_ptr, int ref_stride, \
unsigned int *sad_array) { \
fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \
} \
static void fnname##_bits10(const uint8_t *src_ptr, int source_stride, \
const uint8_t *ref_ptr, int ref_stride, \
unsigned int *sad_array) { \
int i; \
fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \
for (i = 0; i < 8; i++) sad_array[i] >>= 2; \
} \
static void fnname##_bits12(const uint8_t *src_ptr, int source_stride, \
const uint8_t *ref_ptr, int ref_stride, \
unsigned int *sad_array) { \
int i; \
fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \
for (i = 0; i < 8; i++) sad_array[i] >>= 4; \
}
#define MAKE_BFP_SAD4D_WRAPPER(fnname) \
static void fnname##_bits8(const uint8_t *src_ptr, int source_stride, \
const uint8_t *const ref_ptr[], int ref_stride, \
unsigned int *sad_array) { \
fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \
} \
static void fnname##_bits10(const uint8_t *src_ptr, int source_stride, \
const uint8_t *const ref_ptr[], int ref_stride, \
unsigned int *sad_array) { \
int i; \
fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \
for (i = 0; i < 4; i++) sad_array[i] >>= 2; \
} \
static void fnname##_bits12(const uint8_t *src_ptr, int source_stride, \
const uint8_t *const ref_ptr[], int ref_stride, \
unsigned int *sad_array) { \
int i; \
fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array); \
for (i = 0; i < 4; i++) sad_array[i] >>= 4; \
}
#if CONFIG_EXT_PARTITION
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad128x128)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad128x128_avg)
MAKE_BFP_SAD3_WRAPPER(aom_highbd_sad128x128x3)
MAKE_BFP_SAD8_WRAPPER(aom_highbd_sad128x128x8)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad128x128x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad128x64)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad128x64_avg)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad128x64x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad64x128)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad64x128_avg)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad64x128x4d)
#endif // CONFIG_EXT_PARTITION
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad32x16)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad32x16_avg)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad32x16x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad16x32)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad16x32_avg)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad16x32x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad64x32)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad64x32_avg)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad64x32x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad32x64)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad32x64_avg)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad32x64x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad32x32)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad32x32_avg)
MAKE_BFP_SAD3_WRAPPER(aom_highbd_sad32x32x3)
MAKE_BFP_SAD8_WRAPPER(aom_highbd_sad32x32x8)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad32x32x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad64x64)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad64x64_avg)
MAKE_BFP_SAD3_WRAPPER(aom_highbd_sad64x64x3)
MAKE_BFP_SAD8_WRAPPER(aom_highbd_sad64x64x8)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad64x64x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad16x16)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad16x16_avg)
MAKE_BFP_SAD3_WRAPPER(aom_highbd_sad16x16x3)
MAKE_BFP_SAD8_WRAPPER(aom_highbd_sad16x16x8)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad16x16x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad16x8)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad16x8_avg)
MAKE_BFP_SAD3_WRAPPER(aom_highbd_sad16x8x3)
MAKE_BFP_SAD8_WRAPPER(aom_highbd_sad16x8x8)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad16x8x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad8x16)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad8x16_avg)
MAKE_BFP_SAD3_WRAPPER(aom_highbd_sad8x16x3)
MAKE_BFP_SAD8_WRAPPER(aom_highbd_sad8x16x8)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad8x16x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad8x8)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad8x8_avg)
MAKE_BFP_SAD3_WRAPPER(aom_highbd_sad8x8x3)
MAKE_BFP_SAD8_WRAPPER(aom_highbd_sad8x8x8)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad8x8x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad8x4)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad8x4_avg)
MAKE_BFP_SAD8_WRAPPER(aom_highbd_sad8x4x8)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad8x4x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad4x8)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad4x8_avg)
MAKE_BFP_SAD8_WRAPPER(aom_highbd_sad4x8x8)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad4x8x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad4x4)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad4x4_avg)
MAKE_BFP_SAD3_WRAPPER(aom_highbd_sad4x4x3)
MAKE_BFP_SAD8_WRAPPER(aom_highbd_sad4x4x8)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad4x4x4d)
#if CONFIG_EXT_PARTITION_TYPES
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad4x16)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad4x16_avg)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad4x16x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad16x4)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad16x4_avg)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad16x4x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad8x32)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad8x32_avg)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad8x32x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad32x8)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad32x8_avg)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad32x8x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad16x64)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad16x64_avg)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad16x64x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad64x16)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad64x16_avg)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad64x16x4d)
#if CONFIG_EXT_PARTITION
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad32x128)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad32x128_avg)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad32x128x4d)
MAKE_BFP_SAD_WRAPPER(aom_highbd_sad128x32)
MAKE_BFP_SADAVG_WRAPPER(aom_highbd_sad128x32_avg)
MAKE_BFP_SAD4D_WRAPPER(aom_highbd_sad128x32x4d)
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_EXT_PARTITION_TYPES
#define HIGHBD_MBFP(BT, MCSDF, MCSVF) \
cpi->fn_ptr[BT].msdf = MCSDF; \
cpi->fn_ptr[BT].msvf = MCSVF;
#define MAKE_MBFP_COMPOUND_SAD_WRAPPER(fnname) \
static unsigned int fnname##_bits8( \
const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, \
int ref_stride, const uint8_t *second_pred_ptr, const uint8_t *m, \
int m_stride, int invert_mask) { \
return fnname(src_ptr, source_stride, ref_ptr, ref_stride, \
second_pred_ptr, m, m_stride, invert_mask); \
} \
static unsigned int fnname##_bits10( \
const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, \
int ref_stride, const uint8_t *second_pred_ptr, const uint8_t *m, \
int m_stride, int invert_mask) { \
return fnname(src_ptr, source_stride, ref_ptr, ref_stride, \
second_pred_ptr, m, m_stride, invert_mask) >> \
2; \
} \
static unsigned int fnname##_bits12( \
const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, \
int ref_stride, const uint8_t *second_pred_ptr, const uint8_t *m, \
int m_stride, int invert_mask) { \
return fnname(src_ptr, source_stride, ref_ptr, ref_stride, \
second_pred_ptr, m, m_stride, invert_mask) >> \
4; \
}
#if CONFIG_EXT_PARTITION
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad128x128)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad128x64)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad64x128)
#endif // CONFIG_EXT_PARTITION
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad64x64)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad64x32)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad32x64)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad32x32)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad32x16)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad16x32)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad16x16)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad16x8)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad8x16)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad8x8)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad8x4)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad4x8)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad4x4)
#if CONFIG_EXT_PARTITION_TYPES
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad4x16)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad16x4)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad8x32)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad32x8)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad16x64)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad64x16)
#if CONFIG_EXT_PARTITION
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad32x128)
MAKE_MBFP_COMPOUND_SAD_WRAPPER(aom_highbd_masked_sad128x32)
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_EXT_PARTITION_TYPES
#define HIGHBD_OBFP(BT, OSDF, OVF, OSVF) \
cpi->fn_ptr[BT].osdf = OSDF; \
cpi->fn_ptr[BT].ovf = OVF; \
cpi->fn_ptr[BT].osvf = OSVF;
#define MAKE_OBFP_SAD_WRAPPER(fnname) \
static unsigned int fnname##_bits8(const uint8_t *ref, int ref_stride, \
const int32_t *wsrc, \
const int32_t *msk) { \
return fnname(ref, ref_stride, wsrc, msk); \
} \
static unsigned int fnname##_bits10(const uint8_t *ref, int ref_stride, \
const int32_t *wsrc, \
const int32_t *msk) { \
return fnname(ref, ref_stride, wsrc, msk) >> 2; \
} \
static unsigned int fnname##_bits12(const uint8_t *ref, int ref_stride, \
const int32_t *wsrc, \
const int32_t *msk) { \
return fnname(ref, ref_stride, wsrc, msk) >> 4; \
}
#if CONFIG_EXT_PARTITION
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad128x128)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad128x64)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad64x128)
#endif // CONFIG_EXT_PARTITION
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad64x64)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad64x32)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad32x64)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad32x32)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad32x16)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad16x32)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad16x16)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad16x8)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad8x16)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad8x8)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad8x4)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad4x8)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad4x4)
#if CONFIG_EXT_PARTITION_TYPES
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad4x16)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad16x4)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad8x32)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad32x8)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad16x64)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad64x16)
#if CONFIG_EXT_PARTITION
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad32x128)
MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad128x32)
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_EXT_PARTITION_TYPES
static void highbd_set_var_fns(AV1_COMP *const cpi) {
AV1_COMMON *const cm = &cpi->common;
if (cm->use_highbitdepth) {
switch (cm->bit_depth) {
case AOM_BITS_8:
#if CONFIG_EXT_PARTITION_TYPES
#if CONFIG_EXT_PARTITION
HIGHBD_BFP(BLOCK_128X32, aom_highbd_sad128x32_bits8,
aom_highbd_sad128x32_avg_bits8, aom_highbd_8_variance128x32,
aom_highbd_8_sub_pixel_variance128x32,
aom_highbd_8_sub_pixel_avg_variance128x32, NULL, NULL,
aom_highbd_sad128x32x4d_bits8)
HIGHBD_BFP(BLOCK_32X128, aom_highbd_sad32x128_bits8,
aom_highbd_sad32x128_avg_bits8, aom_highbd_8_variance32x128,
aom_highbd_8_sub_pixel_variance32x128,
aom_highbd_8_sub_pixel_avg_variance32x128, NULL, NULL,
aom_highbd_sad32x128x4d_bits8)
#endif // CONFIG_EXT_PARTITION
HIGHBD_BFP(BLOCK_64X16, aom_highbd_sad64x16_bits8,
aom_highbd_sad64x16_avg_bits8, aom_highbd_8_variance64x16,
aom_highbd_8_sub_pixel_variance64x16,
aom_highbd_8_sub_pixel_avg_variance64x16, NULL, NULL,
aom_highbd_sad64x16x4d_bits8)
HIGHBD_BFP(BLOCK_16X64, aom_highbd_sad16x64_bits8,
aom_highbd_sad16x64_avg_bits8, aom_highbd_8_variance16x64,
aom_highbd_8_sub_pixel_variance16x64,
aom_highbd_8_sub_pixel_avg_variance16x64, NULL, NULL,
aom_highbd_sad16x64x4d_bits8)
HIGHBD_BFP(BLOCK_32X8, aom_highbd_sad32x8_bits8,
aom_highbd_sad32x8_avg_bits8, aom_highbd_8_variance32x8,
aom_highbd_8_sub_pixel_variance32x8,
aom_highbd_8_sub_pixel_avg_variance32x8, NULL, NULL,
aom_highbd_sad32x8x4d_bits8)
HIGHBD_BFP(BLOCK_8X32, aom_highbd_sad8x32_bits8,
aom_highbd_sad8x32_avg_bits8, aom_highbd_8_variance8x32,
aom_highbd_8_sub_pixel_variance8x32,
aom_highbd_8_sub_pixel_avg_variance8x32, NULL, NULL,
aom_highbd_sad8x32x4d_bits8)
HIGHBD_BFP(BLOCK_16X4, aom_highbd_sad16x4_bits8,
aom_highbd_sad16x4_avg_bits8, aom_highbd_8_variance16x4,
aom_highbd_8_sub_pixel_variance16x4,
aom_highbd_8_sub_pixel_avg_variance16x4, NULL, NULL,
aom_highbd_sad16x4x4d_bits8)
HIGHBD_BFP(BLOCK_4X16, aom_highbd_sad4x16_bits8,
aom_highbd_sad4x16_avg_bits8, aom_highbd_8_variance4x16,
aom_highbd_8_sub_pixel_variance4x16,
aom_highbd_8_sub_pixel_avg_variance4x16, NULL, NULL,
aom_highbd_sad4x16x4d_bits8)
#endif
HIGHBD_BFP(BLOCK_32X16, aom_highbd_sad32x16_bits8,
aom_highbd_sad32x16_avg_bits8, aom_highbd_8_variance32x16,
aom_highbd_8_sub_pixel_variance32x16,
aom_highbd_8_sub_pixel_avg_variance32x16, NULL, NULL,
aom_highbd_sad32x16x4d_bits8)
HIGHBD_BFP(BLOCK_16X32, aom_highbd_sad16x32_bits8,
aom_highbd_sad16x32_avg_bits8, aom_highbd_8_variance16x32,
aom_highbd_8_sub_pixel_variance16x32,
aom_highbd_8_sub_pixel_avg_variance16x32, NULL, NULL,
aom_highbd_sad16x32x4d_bits8)
HIGHBD_BFP(BLOCK_64X32, aom_highbd_sad64x32_bits8,
aom_highbd_sad64x32_avg_bits8, aom_highbd_8_variance64x32,
aom_highbd_8_sub_pixel_variance64x32,
aom_highbd_8_sub_pixel_avg_variance64x32, NULL, NULL,
aom_highbd_sad64x32x4d_bits8)
HIGHBD_BFP(BLOCK_32X64, aom_highbd_sad32x64_bits8,
aom_highbd_sad32x64_avg_bits8, aom_highbd_8_variance32x64,
aom_highbd_8_sub_pixel_variance32x64,
aom_highbd_8_sub_pixel_avg_variance32x64, NULL, NULL,
aom_highbd_sad32x64x4d_bits8)
HIGHBD_BFP(BLOCK_32X32, aom_highbd_sad32x32_bits8,
aom_highbd_sad32x32_avg_bits8, aom_highbd_8_variance32x32,
aom_highbd_8_sub_pixel_variance32x32,
aom_highbd_8_sub_pixel_avg_variance32x32,
aom_highbd_sad32x32x3_bits8, aom_highbd_sad32x32x8_bits8,
aom_highbd_sad32x32x4d_bits8)
HIGHBD_BFP(BLOCK_64X64, aom_highbd_sad64x64_bits8,
aom_highbd_sad64x64_avg_bits8, aom_highbd_8_variance64x64,
aom_highbd_8_sub_pixel_variance64x64,
aom_highbd_8_sub_pixel_avg_variance64x64,
aom_highbd_sad64x64x3_bits8, aom_highbd_sad64x64x8_bits8,
aom_highbd_sad64x64x4d_bits8)
HIGHBD_BFP(BLOCK_16X16, aom_highbd_sad16x16_bits8,
aom_highbd_sad16x16_avg_bits8, aom_highbd_8_variance16x16,
aom_highbd_8_sub_pixel_variance16x16,
aom_highbd_8_sub_pixel_avg_variance16x16,
aom_highbd_sad16x16x3_bits8, aom_highbd_sad16x16x8_bits8,
aom_highbd_sad16x16x4d_bits8)
HIGHBD_BFP(
BLOCK_16X8, aom_highbd_sad16x8_bits8, aom_highbd_sad16x8_avg_bits8,
aom_highbd_8_variance16x8, aom_highbd_8_sub_pixel_variance16x8,
aom_highbd_8_sub_pixel_avg_variance16x8, aom_highbd_sad16x8x3_bits8,
aom_highbd_sad16x8x8_bits8, aom_highbd_sad16x8x4d_bits8)
HIGHBD_BFP(
BLOCK_8X16, aom_highbd_sad8x16_bits8, aom_highbd_sad8x16_avg_bits8,
aom_highbd_8_variance8x16, aom_highbd_8_sub_pixel_variance8x16,
aom_highbd_8_sub_pixel_avg_variance8x16, aom_highbd_sad8x16x3_bits8,
aom_highbd_sad8x16x8_bits8, aom_highbd_sad8x16x4d_bits8)
HIGHBD_BFP(
BLOCK_8X8, aom_highbd_sad8x8_bits8, aom_highbd_sad8x8_avg_bits8,
aom_highbd_8_variance8x8, aom_highbd_8_sub_pixel_variance8x8,
aom_highbd_8_sub_pixel_avg_variance8x8, aom_highbd_sad8x8x3_bits8,
aom_highbd_sad8x8x8_bits8, aom_highbd_sad8x8x4d_bits8)
HIGHBD_BFP(BLOCK_8X4, aom_highbd_sad8x4_bits8,
aom_highbd_sad8x4_avg_bits8, aom_highbd_8_variance8x4,
aom_highbd_8_sub_pixel_variance8x4,
aom_highbd_8_sub_pixel_avg_variance8x4, NULL,
aom_highbd_sad8x4x8_bits8, aom_highbd_sad8x4x4d_bits8)
HIGHBD_BFP(BLOCK_4X8, aom_highbd_sad4x8_bits8,
aom_highbd_sad4x8_avg_bits8, aom_highbd_8_variance4x8,
aom_highbd_8_sub_pixel_variance4x8,
aom_highbd_8_sub_pixel_avg_variance4x8, NULL,
aom_highbd_sad4x8x8_bits8, aom_highbd_sad4x8x4d_bits8)
HIGHBD_BFP(
BLOCK_4X4, aom_highbd_sad4x4_bits8, aom_highbd_sad4x4_avg_bits8,
aom_highbd_8_variance4x4, aom_highbd_8_sub_pixel_variance4x4,
aom_highbd_8_sub_pixel_avg_variance4x4, aom_highbd_sad4x4x3_bits8,
aom_highbd_sad4x4x8_bits8, aom_highbd_sad4x4x4d_bits8)
HIGHBD_BFP(BLOCK_2X2, NULL, NULL, aom_highbd_8_variance2x2, NULL, NULL,
NULL, NULL, NULL)
HIGHBD_BFP(BLOCK_4X2, NULL, NULL, aom_highbd_8_variance4x2, NULL, NULL,
NULL, NULL, NULL)
HIGHBD_BFP(BLOCK_2X4, NULL, NULL, aom_highbd_8_variance2x4, NULL, NULL,
NULL, NULL, NULL)
#if CONFIG_EXT_PARTITION
HIGHBD_BFP(BLOCK_128X128, aom_highbd_sad128x128_bits8,
aom_highbd_sad128x128_avg_bits8,
aom_highbd_8_variance128x128,
aom_highbd_8_sub_pixel_variance128x128,
aom_highbd_8_sub_pixel_avg_variance128x128,
aom_highbd_sad128x128x3_bits8, aom_highbd_sad128x128x8_bits8,
aom_highbd_sad128x128x4d_bits8)
HIGHBD_BFP(BLOCK_128X64, aom_highbd_sad128x64_bits8,
aom_highbd_sad128x64_avg_bits8, aom_highbd_8_variance128x64,
aom_highbd_8_sub_pixel_variance128x64,
aom_highbd_8_sub_pixel_avg_variance128x64, NULL, NULL,
aom_highbd_sad128x64x4d_bits8)
HIGHBD_BFP(BLOCK_64X128, aom_highbd_sad64x128_bits8,
aom_highbd_sad64x128_avg_bits8, aom_highbd_8_variance64x128,
aom_highbd_8_sub_pixel_variance64x128,
aom_highbd_8_sub_pixel_avg_variance64x128, NULL, NULL,
aom_highbd_sad64x128x4d_bits8)
#endif // CONFIG_EXT_PARTITION
#if CONFIG_EXT_PARTITION
HIGHBD_MBFP(BLOCK_128X128, aom_highbd_masked_sad128x128_bits8,
aom_highbd_8_masked_sub_pixel_variance128x128)
HIGHBD_MBFP(BLOCK_128X64, aom_highbd_masked_sad128x64_bits8,
aom_highbd_8_masked_sub_pixel_variance128x64)
HIGHBD_MBFP(BLOCK_64X128, aom_highbd_masked_sad64x128_bits8,
aom_highbd_8_masked_sub_pixel_variance64x128)
#endif // CONFIG_EXT_PARTITION
HIGHBD_MBFP(BLOCK_64X64, aom_highbd_masked_sad64x64_bits8,
aom_highbd_8_masked_sub_pixel_variance64x64)
HIGHBD_MBFP(BLOCK_64X32, aom_highbd_masked_sad64x32_bits8,
aom_highbd_8_masked_sub_pixel_variance64x32)
HIGHBD_MBFP(BLOCK_32X64, aom_highbd_masked_sad32x64_bits8,
aom_highbd_8_masked_sub_pixel_variance32x64)
HIGHBD_MBFP(BLOCK_32X32, aom_highbd_masked_sad32x32_bits8,
aom_highbd_8_masked_sub_pixel_variance32x32)
HIGHBD_MBFP(BLOCK_32X16, aom_highbd_masked_sad32x16_bits8,
aom_highbd_8_masked_sub_pixel_variance32x16)
HIGHBD_MBFP(BLOCK_16X32, aom_highbd_masked_sad16x32_bits8,
aom_highbd_8_masked_sub_pixel_variance16x32)
HIGHBD_MBFP(BLOCK_16X16, aom_highbd_masked_sad16x16_bits8,
aom_highbd_8_masked_sub_pixel_variance16x16)
HIGHBD_MBFP(BLOCK_8X16, aom_highbd_masked_sad8x16_bits8,
aom_highbd_8_masked_sub_pixel_variance8x16)
HIGHBD_MBFP(BLOCK_16X8, aom_highbd_masked_sad16x8_bits8,
aom_highbd_8_masked_sub_pixel_variance16x8)
HIGHBD_MBFP(BLOCK_8X8, aom_highbd_masked_sad8x8_bits8,
aom_highbd_8_masked_sub_pixel_variance8x8)
HIGHBD_MBFP(BLOCK_4X8, aom_highbd_masked_sad4x8_bits8,
aom_highbd_8_masked_sub_pixel_variance4x8)
HIGHBD_MBFP(BLOCK_8X4, aom_highbd_masked_sad8x4_bits8,
aom_highbd_8_masked_sub_pixel_variance8x4)
HIGHBD_MBFP(BLOCK_4X4, aom_highbd_masked_sad4x4_bits8,
aom_highbd_8_masked_sub_pixel_variance4x4)
#if CONFIG_EXT_PARTITION_TYPES
#if CONFIG_EXT_PARTITION
HIGHBD_MBFP(BLOCK_128X32, aom_highbd_masked_sad128x32_bits8,
aom_highbd_8_masked_sub_pixel_variance128x32)
HIGHBD_MBFP(BLOCK_32X128, aom_highbd_masked_sad32x128_bits8,
aom_highbd_8_masked_sub_pixel_variance32x128)
#endif // CONFIG_EXT_PARTITION
HIGHBD_MBFP(BLOCK_64X16, aom_highbd_masked_sad64x16_bits8,
aom_highbd_8_masked_sub_pixel_variance64x16)
HIGHBD_MBFP(BLOCK_16X64, aom_highbd_masked_sad16x64_bits8,
aom_highbd_8_masked_sub_pixel_variance16x64)
HIGHBD_MBFP(BLOCK_32X8, aom_highbd_masked_sad32x8_bits8,
aom_highbd_8_masked_sub_pixel_variance32x8)
HIGHBD_MBFP(BLOCK_8X32, aom_highbd_masked_sad8x32_bits8,
aom_highbd_8_masked_sub_pixel_variance8x32)
HIGHBD_MBFP(BLOCK_16X4, aom_highbd_masked_sad16x4_bits8,
aom_highbd_8_masked_sub_pixel_variance16x4)
HIGHBD_MBFP(BLOCK_4X16, aom_highbd_masked_sad4x16_bits8,
aom_highbd_8_masked_sub_pixel_variance4x16)
#endif
#if CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_128X128, aom_highbd_obmc_sad128x128_bits8,
aom_highbd_obmc_variance128x128,
aom_highbd_obmc_sub_pixel_variance128x128)
HIGHBD_OBFP(BLOCK_128X64, aom_highbd_obmc_sad128x64_bits8,
aom_highbd_obmc_variance128x64,
aom_highbd_obmc_sub_pixel_variance128x64)
HIGHBD_OBFP(BLOCK_64X128, aom_highbd_obmc_sad64x128_bits8,
aom_highbd_obmc_variance64x128,
aom_highbd_obmc_sub_pixel_variance64x128)
#endif // CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_64X64, aom_highbd_obmc_sad64x64_bits8,
aom_highbd_obmc_variance64x64,
aom_highbd_obmc_sub_pixel_variance64x64)
HIGHBD_OBFP(BLOCK_64X32, aom_highbd_obmc_sad64x32_bits8,
aom_highbd_obmc_variance64x32,
aom_highbd_obmc_sub_pixel_variance64x32)
HIGHBD_OBFP(BLOCK_32X64, aom_highbd_obmc_sad32x64_bits8,
aom_highbd_obmc_variance32x64,
aom_highbd_obmc_sub_pixel_variance32x64)
HIGHBD_OBFP(BLOCK_32X32, aom_highbd_obmc_sad32x32_bits8,
aom_highbd_obmc_variance32x32,
aom_highbd_obmc_sub_pixel_variance32x32)
HIGHBD_OBFP(BLOCK_32X16, aom_highbd_obmc_sad32x16_bits8,
aom_highbd_obmc_variance32x16,
aom_highbd_obmc_sub_pixel_variance32x16)
HIGHBD_OBFP(BLOCK_16X32, aom_highbd_obmc_sad16x32_bits8,
aom_highbd_obmc_variance16x32,
aom_highbd_obmc_sub_pixel_variance16x32)
HIGHBD_OBFP(BLOCK_16X16, aom_highbd_obmc_sad16x16_bits8,
aom_highbd_obmc_variance16x16,
aom_highbd_obmc_sub_pixel_variance16x16)
HIGHBD_OBFP(BLOCK_8X16, aom_highbd_obmc_sad8x16_bits8,
aom_highbd_obmc_variance8x16,
aom_highbd_obmc_sub_pixel_variance8x16)
HIGHBD_OBFP(BLOCK_16X8, aom_highbd_obmc_sad16x8_bits8,
aom_highbd_obmc_variance16x8,
aom_highbd_obmc_sub_pixel_variance16x8)
HIGHBD_OBFP(BLOCK_8X8, aom_highbd_obmc_sad8x8_bits8,
aom_highbd_obmc_variance8x8,
aom_highbd_obmc_sub_pixel_variance8x8)
HIGHBD_OBFP(BLOCK_4X8, aom_highbd_obmc_sad4x8_bits8,
aom_highbd_obmc_variance4x8,
aom_highbd_obmc_sub_pixel_variance4x8)
HIGHBD_OBFP(BLOCK_8X4, aom_highbd_obmc_sad8x4_bits8,
aom_highbd_obmc_variance8x4,
aom_highbd_obmc_sub_pixel_variance8x4)
HIGHBD_OBFP(BLOCK_4X4, aom_highbd_obmc_sad4x4_bits8,
aom_highbd_obmc_variance4x4,
aom_highbd_obmc_sub_pixel_variance4x4)
#if CONFIG_EXT_PARTITION_TYPES
#if CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_128X32, aom_highbd_obmc_sad128x32_bits8,
aom_highbd_obmc_variance128x32,
aom_highbd_obmc_sub_pixel_variance128x32)
HIGHBD_OBFP(BLOCK_32X128, aom_highbd_obmc_sad32x128_bits8,
aom_highbd_obmc_variance32x128,
aom_highbd_obmc_sub_pixel_variance32x128)
#endif // CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_64X16, aom_highbd_obmc_sad64x16_bits8,
aom_highbd_obmc_variance64x16,
aom_highbd_obmc_sub_pixel_variance64x16)
HIGHBD_OBFP(BLOCK_16X64, aom_highbd_obmc_sad16x64_bits8,
aom_highbd_obmc_variance16x64,
aom_highbd_obmc_sub_pixel_variance16x64)
HIGHBD_OBFP(BLOCK_32X8, aom_highbd_obmc_sad32x8_bits8,
aom_highbd_obmc_variance32x8,
aom_highbd_obmc_sub_pixel_variance32x8)
HIGHBD_OBFP(BLOCK_8X32, aom_highbd_obmc_sad8x32_bits8,
aom_highbd_obmc_variance8x32,
aom_highbd_obmc_sub_pixel_variance8x32)
HIGHBD_OBFP(BLOCK_16X4, aom_highbd_obmc_sad16x4_bits8,
aom_highbd_obmc_variance16x4,
aom_highbd_obmc_sub_pixel_variance16x4)
HIGHBD_OBFP(BLOCK_4X16, aom_highbd_obmc_sad4x16_bits8,
aom_highbd_obmc_variance4x16,
aom_highbd_obmc_sub_pixel_variance4x16)
#endif
break;
case AOM_BITS_10:
#if CONFIG_EXT_PARTITION_TYPES
#if CONFIG_EXT_PARTITION
HIGHBD_BFP(BLOCK_128X32, aom_highbd_sad128x32_bits10,
aom_highbd_sad128x32_avg_bits10,
aom_highbd_10_variance128x32,
aom_highbd_10_sub_pixel_variance128x32,
aom_highbd_10_sub_pixel_avg_variance128x32, NULL, NULL,
aom_highbd_sad128x32x4d_bits10)
HIGHBD_BFP(BLOCK_32X128, aom_highbd_sad32x128_bits10,
aom_highbd_sad32x128_avg_bits10,
aom_highbd_10_variance32x128,
aom_highbd_10_sub_pixel_variance32x128,
aom_highbd_10_sub_pixel_avg_variance32x128, NULL, NULL,
aom_highbd_sad32x128x4d_bits10)
#endif // CONFIG_EXT_PARTITION
HIGHBD_BFP(BLOCK_64X16, aom_highbd_sad64x16_bits10,
aom_highbd_sad64x16_avg_bits10, aom_highbd_10_variance64x16,
aom_highbd_10_sub_pixel_variance64x16,
aom_highbd_10_sub_pixel_avg_variance64x16, NULL, NULL,
aom_highbd_sad64x16x4d_bits10)
HIGHBD_BFP(BLOCK_16X64, aom_highbd_sad16x64_bits10,
aom_highbd_sad16x64_avg_bits10, aom_highbd_10_variance16x64,
aom_highbd_10_sub_pixel_variance16x64,
aom_highbd_10_sub_pixel_avg_variance16x64, NULL, NULL,
aom_highbd_sad16x64x4d_bits10)
HIGHBD_BFP(BLOCK_32X8, aom_highbd_sad32x8_bits10,
aom_highbd_sad32x8_avg_bits10, aom_highbd_10_variance32x8,
aom_highbd_10_sub_pixel_variance32x8,
aom_highbd_10_sub_pixel_avg_variance32x8, NULL, NULL,
aom_highbd_sad32x8x4d_bits10)
HIGHBD_BFP(BLOCK_8X32, aom_highbd_sad8x32_bits10,
aom_highbd_sad8x32_avg_bits10, aom_highbd_10_variance8x32,
aom_highbd_10_sub_pixel_variance8x32,
aom_highbd_10_sub_pixel_avg_variance8x32, NULL, NULL,
aom_highbd_sad8x32x4d_bits10)
HIGHBD_BFP(BLOCK_16X4, aom_highbd_sad16x4_bits10,
aom_highbd_sad16x4_avg_bits10, aom_highbd_10_variance16x4,
aom_highbd_10_sub_pixel_variance16x4,
aom_highbd_10_sub_pixel_avg_variance16x4, NULL, NULL,
aom_highbd_sad16x4x4d_bits10)
HIGHBD_BFP(BLOCK_4X16, aom_highbd_sad4x16_bits10,
aom_highbd_sad4x16_avg_bits10, aom_highbd_10_variance4x16,
aom_highbd_10_sub_pixel_variance4x16,
aom_highbd_10_sub_pixel_avg_variance4x16, NULL, NULL,
aom_highbd_sad4x16x4d_bits10)
#endif
HIGHBD_BFP(BLOCK_32X16, aom_highbd_sad32x16_bits10,
aom_highbd_sad32x16_avg_bits10, aom_highbd_10_variance32x16,
aom_highbd_10_sub_pixel_variance32x16,
aom_highbd_10_sub_pixel_avg_variance32x16, NULL, NULL,
aom_highbd_sad32x16x4d_bits10)
HIGHBD_BFP(BLOCK_16X32, aom_highbd_sad16x32_bits10,
aom_highbd_sad16x32_avg_bits10, aom_highbd_10_variance16x32,
aom_highbd_10_sub_pixel_variance16x32,
aom_highbd_10_sub_pixel_avg_variance16x32, NULL, NULL,
aom_highbd_sad16x32x4d_bits10)
HIGHBD_BFP(BLOCK_64X32, aom_highbd_sad64x32_bits10,
aom_highbd_sad64x32_avg_bits10, aom_highbd_10_variance64x32,
aom_highbd_10_sub_pixel_variance64x32,
aom_highbd_10_sub_pixel_avg_variance64x32, NULL, NULL,
aom_highbd_sad64x32x4d_bits10)
HIGHBD_BFP(BLOCK_32X64, aom_highbd_sad32x64_bits10,
aom_highbd_sad32x64_avg_bits10, aom_highbd_10_variance32x64,
aom_highbd_10_sub_pixel_variance32x64,
aom_highbd_10_sub_pixel_avg_variance32x64, NULL, NULL,
aom_highbd_sad32x64x4d_bits10)
HIGHBD_BFP(BLOCK_32X32, aom_highbd_sad32x32_bits10,
aom_highbd_sad32x32_avg_bits10, aom_highbd_10_variance32x32,
aom_highbd_10_sub_pixel_variance32x32,
aom_highbd_10_sub_pixel_avg_variance32x32,
aom_highbd_sad32x32x3_bits10, aom_highbd_sad32x32x8_bits10,
aom_highbd_sad32x32x4d_bits10)
HIGHBD_BFP(BLOCK_64X64, aom_highbd_sad64x64_bits10,
aom_highbd_sad64x64_avg_bits10, aom_highbd_10_variance64x64,
aom_highbd_10_sub_pixel_variance64x64,
aom_highbd_10_sub_pixel_avg_variance64x64,
aom_highbd_sad64x64x3_bits10, aom_highbd_sad64x64x8_bits10,
aom_highbd_sad64x64x4d_bits10)
HIGHBD_BFP(BLOCK_16X16, aom_highbd_sad16x16_bits10,
aom_highbd_sad16x16_avg_bits10, aom_highbd_10_variance16x16,
aom_highbd_10_sub_pixel_variance16x16,
aom_highbd_10_sub_pixel_avg_variance16x16,
aom_highbd_sad16x16x3_bits10, aom_highbd_sad16x16x8_bits10,
aom_highbd_sad16x16x4d_bits10)
HIGHBD_BFP(BLOCK_16X8, aom_highbd_sad16x8_bits10,
aom_highbd_sad16x8_avg_bits10, aom_highbd_10_variance16x8,
aom_highbd_10_sub_pixel_variance16x8,
aom_highbd_10_sub_pixel_avg_variance16x8,
aom_highbd_sad16x8x3_bits10, aom_highbd_sad16x8x8_bits10,
aom_highbd_sad16x8x4d_bits10)
HIGHBD_BFP(BLOCK_8X16, aom_highbd_sad8x16_bits10,
aom_highbd_sad8x16_avg_bits10, aom_highbd_10_variance8x16,
aom_highbd_10_sub_pixel_variance8x16,
aom_highbd_10_sub_pixel_avg_variance8x16,
aom_highbd_sad8x16x3_bits10, aom_highbd_sad8x16x8_bits10,
aom_highbd_sad8x16x4d_bits10)
HIGHBD_BFP(
BLOCK_8X8, aom_highbd_sad8x8_bits10, aom_highbd_sad8x8_avg_bits10,
aom_highbd_10_variance8x8, aom_highbd_10_sub_pixel_variance8x8,
aom_highbd_10_sub_pixel_avg_variance8x8, aom_highbd_sad8x8x3_bits10,
aom_highbd_sad8x8x8_bits10, aom_highbd_sad8x8x4d_bits10)
HIGHBD_BFP(BLOCK_8X4, aom_highbd_sad8x4_bits10,
aom_highbd_sad8x4_avg_bits10, aom_highbd_10_variance8x4,
aom_highbd_10_sub_pixel_variance8x4,
aom_highbd_10_sub_pixel_avg_variance8x4, NULL,
aom_highbd_sad8x4x8_bits10, aom_highbd_sad8x4x4d_bits10)
HIGHBD_BFP(BLOCK_4X8, aom_highbd_sad4x8_bits10,
aom_highbd_sad4x8_avg_bits10, aom_highbd_10_variance4x8,
aom_highbd_10_sub_pixel_variance4x8,
aom_highbd_10_sub_pixel_avg_variance4x8, NULL,
aom_highbd_sad4x8x8_bits10, aom_highbd_sad4x8x4d_bits10)
HIGHBD_BFP(
BLOCK_4X4, aom_highbd_sad4x4_bits10, aom_highbd_sad4x4_avg_bits10,
aom_highbd_10_variance4x4, aom_highbd_10_sub_pixel_variance4x4,
aom_highbd_10_sub_pixel_avg_variance4x4, aom_highbd_sad4x4x3_bits10,
aom_highbd_sad4x4x8_bits10, aom_highbd_sad4x4x4d_bits10)
HIGHBD_BFP(BLOCK_2X2, NULL, NULL, aom_highbd_10_variance2x2, NULL, NULL,
NULL, NULL, NULL)
HIGHBD_BFP(BLOCK_4X2, NULL, NULL, aom_highbd_10_variance4x2, NULL, NULL,
NULL, NULL, NULL)
HIGHBD_BFP(BLOCK_2X4, NULL, NULL, aom_highbd_10_variance2x4, NULL, NULL,
NULL, NULL, NULL)
#if CONFIG_EXT_PARTITION
HIGHBD_BFP(
BLOCK_128X128, aom_highbd_sad128x128_bits10,
aom_highbd_sad128x128_avg_bits10, aom_highbd_10_variance128x128,
aom_highbd_10_sub_pixel_variance128x128,
aom_highbd_10_sub_pixel_avg_variance128x128,
aom_highbd_sad128x128x3_bits10, aom_highbd_sad128x128x8_bits10,
aom_highbd_sad128x128x4d_bits10)
HIGHBD_BFP(BLOCK_128X64, aom_highbd_sad128x64_bits10,
aom_highbd_sad128x64_avg_bits10,
aom_highbd_10_variance128x64,
aom_highbd_10_sub_pixel_variance128x64,
aom_highbd_10_sub_pixel_avg_variance128x64, NULL, NULL,
aom_highbd_sad128x64x4d_bits10)
HIGHBD_BFP(BLOCK_64X128, aom_highbd_sad64x128_bits10,
aom_highbd_sad64x128_avg_bits10,
aom_highbd_10_variance64x128,
aom_highbd_10_sub_pixel_variance64x128,
aom_highbd_10_sub_pixel_avg_variance64x128, NULL, NULL,
aom_highbd_sad64x128x4d_bits10)
#endif // CONFIG_EXT_PARTITION
#if CONFIG_EXT_PARTITION
HIGHBD_MBFP(BLOCK_128X128, aom_highbd_masked_sad128x128_bits10,
aom_highbd_10_masked_sub_pixel_variance128x128)
HIGHBD_MBFP(BLOCK_128X64, aom_highbd_masked_sad128x64_bits10,
aom_highbd_10_masked_sub_pixel_variance128x64)
HIGHBD_MBFP(BLOCK_64X128, aom_highbd_masked_sad64x128_bits10,
aom_highbd_10_masked_sub_pixel_variance64x128)
#endif // CONFIG_EXT_PARTITION
HIGHBD_MBFP(BLOCK_64X64, aom_highbd_masked_sad64x64_bits10,
aom_highbd_10_masked_sub_pixel_variance64x64)
HIGHBD_MBFP(BLOCK_64X32, aom_highbd_masked_sad64x32_bits10,
aom_highbd_10_masked_sub_pixel_variance64x32)
HIGHBD_MBFP(BLOCK_32X64, aom_highbd_masked_sad32x64_bits10,
aom_highbd_10_masked_sub_pixel_variance32x64)
HIGHBD_MBFP(BLOCK_32X32, aom_highbd_masked_sad32x32_bits10,
aom_highbd_10_masked_sub_pixel_variance32x32)
HIGHBD_MBFP(BLOCK_32X16, aom_highbd_masked_sad32x16_bits10,
aom_highbd_10_masked_sub_pixel_variance32x16)
HIGHBD_MBFP(BLOCK_16X32, aom_highbd_masked_sad16x32_bits10,
aom_highbd_10_masked_sub_pixel_variance16x32)
HIGHBD_MBFP(BLOCK_16X16, aom_highbd_masked_sad16x16_bits10,
aom_highbd_10_masked_sub_pixel_variance16x16)
HIGHBD_MBFP(BLOCK_8X16, aom_highbd_masked_sad8x16_bits10,
aom_highbd_10_masked_sub_pixel_variance8x16)
HIGHBD_MBFP(BLOCK_16X8, aom_highbd_masked_sad16x8_bits10,
aom_highbd_10_masked_sub_pixel_variance16x8)
HIGHBD_MBFP(BLOCK_8X8, aom_highbd_masked_sad8x8_bits10,
aom_highbd_10_masked_sub_pixel_variance8x8)
HIGHBD_MBFP(BLOCK_4X8, aom_highbd_masked_sad4x8_bits10,
aom_highbd_10_masked_sub_pixel_variance4x8)
HIGHBD_MBFP(BLOCK_8X4, aom_highbd_masked_sad8x4_bits10,
aom_highbd_10_masked_sub_pixel_variance8x4)
HIGHBD_MBFP(BLOCK_4X4, aom_highbd_masked_sad4x4_bits10,
aom_highbd_10_masked_sub_pixel_variance4x4)
#if CONFIG_EXT_PARTITION_TYPES
#if CONFIG_EXT_PARTITION
HIGHBD_MBFP(BLOCK_128X32, aom_highbd_masked_sad128x32_bits10,
aom_highbd_10_masked_sub_pixel_variance128x32)
HIGHBD_MBFP(BLOCK_32X128, aom_highbd_masked_sad32x128_bits10,
aom_highbd_10_masked_sub_pixel_variance32x128)
#endif // CONFIG_EXT_PARTITION
HIGHBD_MBFP(BLOCK_64X16, aom_highbd_masked_sad64x16_bits10,
aom_highbd_10_masked_sub_pixel_variance64x16)
HIGHBD_MBFP(BLOCK_16X64, aom_highbd_masked_sad16x64_bits10,
aom_highbd_10_masked_sub_pixel_variance16x64)
HIGHBD_MBFP(BLOCK_32X8, aom_highbd_masked_sad32x8_bits10,
aom_highbd_10_masked_sub_pixel_variance32x8)
HIGHBD_MBFP(BLOCK_8X32, aom_highbd_masked_sad8x32_bits10,
aom_highbd_10_masked_sub_pixel_variance8x32)
HIGHBD_MBFP(BLOCK_16X4, aom_highbd_masked_sad16x4_bits10,
aom_highbd_10_masked_sub_pixel_variance16x4)
HIGHBD_MBFP(BLOCK_4X16, aom_highbd_masked_sad4x16_bits10,
aom_highbd_10_masked_sub_pixel_variance4x16)
#endif
#if CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_128X128, aom_highbd_obmc_sad128x128_bits10,
aom_highbd_10_obmc_variance128x128,
aom_highbd_10_obmc_sub_pixel_variance128x128)
HIGHBD_OBFP(BLOCK_128X64, aom_highbd_obmc_sad128x64_bits10,
aom_highbd_10_obmc_variance128x64,
aom_highbd_10_obmc_sub_pixel_variance128x64)
HIGHBD_OBFP(BLOCK_64X128, aom_highbd_obmc_sad64x128_bits10,
aom_highbd_10_obmc_variance64x128,
aom_highbd_10_obmc_sub_pixel_variance64x128)
#endif // CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_64X64, aom_highbd_obmc_sad64x64_bits10,
aom_highbd_10_obmc_variance64x64,
aom_highbd_10_obmc_sub_pixel_variance64x64)
HIGHBD_OBFP(BLOCK_64X32, aom_highbd_obmc_sad64x32_bits10,
aom_highbd_10_obmc_variance64x32,
aom_highbd_10_obmc_sub_pixel_variance64x32)
HIGHBD_OBFP(BLOCK_32X64, aom_highbd_obmc_sad32x64_bits10,
aom_highbd_10_obmc_variance32x64,
aom_highbd_10_obmc_sub_pixel_variance32x64)
HIGHBD_OBFP(BLOCK_32X32, aom_highbd_obmc_sad32x32_bits10,
aom_highbd_10_obmc_variance32x32,
aom_highbd_10_obmc_sub_pixel_variance32x32)
HIGHBD_OBFP(BLOCK_32X16, aom_highbd_obmc_sad32x16_bits10,
aom_highbd_10_obmc_variance32x16,
aom_highbd_10_obmc_sub_pixel_variance32x16)
HIGHBD_OBFP(BLOCK_16X32, aom_highbd_obmc_sad16x32_bits10,
aom_highbd_10_obmc_variance16x32,
aom_highbd_10_obmc_sub_pixel_variance16x32)
HIGHBD_OBFP(BLOCK_16X16, aom_highbd_obmc_sad16x16_bits10,
aom_highbd_10_obmc_variance16x16,
aom_highbd_10_obmc_sub_pixel_variance16x16)
HIGHBD_OBFP(BLOCK_8X16, aom_highbd_obmc_sad8x16_bits10,
aom_highbd_10_obmc_variance8x16,
aom_highbd_10_obmc_sub_pixel_variance8x16)
HIGHBD_OBFP(BLOCK_16X8, aom_highbd_obmc_sad16x8_bits10,
aom_highbd_10_obmc_variance16x8,
aom_highbd_10_obmc_sub_pixel_variance16x8)
HIGHBD_OBFP(BLOCK_8X8, aom_highbd_obmc_sad8x8_bits10,
aom_highbd_10_obmc_variance8x8,
aom_highbd_10_obmc_sub_pixel_variance8x8)
HIGHBD_OBFP(BLOCK_4X8, aom_highbd_obmc_sad4x8_bits10,
aom_highbd_10_obmc_variance4x8,
aom_highbd_10_obmc_sub_pixel_variance4x8)
HIGHBD_OBFP(BLOCK_8X4, aom_highbd_obmc_sad8x4_bits10,
aom_highbd_10_obmc_variance8x4,
aom_highbd_10_obmc_sub_pixel_variance8x4)
HIGHBD_OBFP(BLOCK_4X4, aom_highbd_obmc_sad4x4_bits10,
aom_highbd_10_obmc_variance4x4,
aom_highbd_10_obmc_sub_pixel_variance4x4)
#if CONFIG_EXT_PARTITION_TYPES
#if CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_128X32, aom_highbd_obmc_sad128x32_bits10,
aom_highbd_10_obmc_variance128x32,
aom_highbd_10_obmc_sub_pixel_variance128x32)
HIGHBD_OBFP(BLOCK_32X128, aom_highbd_obmc_sad32x128_bits10,
aom_highbd_10_obmc_variance32x128,
aom_highbd_10_obmc_sub_pixel_variance32x128)
#endif // CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_64X16, aom_highbd_obmc_sad64x16_bits10,
aom_highbd_10_obmc_variance64x16,
aom_highbd_10_obmc_sub_pixel_variance64x16)
HIGHBD_OBFP(BLOCK_16X64, aom_highbd_obmc_sad16x64_bits10,
aom_highbd_10_obmc_variance16x64,
aom_highbd_10_obmc_sub_pixel_variance16x64)
HIGHBD_OBFP(BLOCK_32X8, aom_highbd_obmc_sad32x8_bits10,
aom_highbd_10_obmc_variance32x8,
aom_highbd_10_obmc_sub_pixel_variance32x8)
HIGHBD_OBFP(BLOCK_8X32, aom_highbd_obmc_sad8x32_bits10,
aom_highbd_10_obmc_variance8x32,
aom_highbd_10_obmc_sub_pixel_variance8x32)
HIGHBD_OBFP(BLOCK_16X4, aom_highbd_obmc_sad16x4_bits10,
aom_highbd_10_obmc_variance16x4,
aom_highbd_10_obmc_sub_pixel_variance16x4)
HIGHBD_OBFP(BLOCK_4X16, aom_highbd_obmc_sad4x16_bits10,
aom_highbd_10_obmc_variance4x16,
aom_highbd_10_obmc_sub_pixel_variance4x16)
#endif
break;
case AOM_BITS_12:
#if CONFIG_EXT_PARTITION_TYPES
#if CONFIG_EXT_PARTITION
HIGHBD_BFP(BLOCK_128X32, aom_highbd_sad128x32_bits12,
aom_highbd_sad128x32_avg_bits12,
aom_highbd_12_variance128x32,
aom_highbd_12_sub_pixel_variance128x32,
aom_highbd_12_sub_pixel_avg_variance128x32, NULL, NULL,
aom_highbd_sad128x32x4d_bits12)
HIGHBD_BFP(BLOCK_32X128, aom_highbd_sad32x128_bits12,
aom_highbd_sad32x128_avg_bits12,
aom_highbd_12_variance32x128,
aom_highbd_12_sub_pixel_variance32x128,
aom_highbd_12_sub_pixel_avg_variance32x128, NULL, NULL,
aom_highbd_sad32x128x4d_bits12)
#endif // CONFIG_EXT_PARTITION
HIGHBD_BFP(BLOCK_64X16, aom_highbd_sad64x16_bits12,
aom_highbd_sad64x16_avg_bits12, aom_highbd_12_variance64x16,
aom_highbd_12_sub_pixel_variance64x16,
aom_highbd_12_sub_pixel_avg_variance64x16, NULL, NULL,
aom_highbd_sad64x16x4d_bits12)
HIGHBD_BFP(BLOCK_16X64, aom_highbd_sad16x64_bits12,
aom_highbd_sad16x64_avg_bits12, aom_highbd_12_variance16x64,
aom_highbd_12_sub_pixel_variance16x64,
aom_highbd_12_sub_pixel_avg_variance16x64, NULL, NULL,
aom_highbd_sad16x64x4d_bits12)
HIGHBD_BFP(BLOCK_32X8, aom_highbd_sad32x8_bits12,
aom_highbd_sad32x8_avg_bits12, aom_highbd_12_variance32x8,
aom_highbd_12_sub_pixel_variance32x8,
aom_highbd_12_sub_pixel_avg_variance32x8, NULL, NULL,
aom_highbd_sad32x8x4d_bits12)
HIGHBD_BFP(BLOCK_8X32, aom_highbd_sad8x32_bits12,
aom_highbd_sad8x32_avg_bits12, aom_highbd_12_variance8x32,
aom_highbd_12_sub_pixel_variance8x32,
aom_highbd_12_sub_pixel_avg_variance8x32, NULL, NULL,
aom_highbd_sad8x32x4d_bits12)
HIGHBD_BFP(BLOCK_16X4, aom_highbd_sad16x4_bits12,
aom_highbd_sad16x4_avg_bits12, aom_highbd_12_variance16x4,
aom_highbd_12_sub_pixel_variance16x4,
aom_highbd_12_sub_pixel_avg_variance16x4, NULL, NULL,
aom_highbd_sad16x4x4d_bits12)
HIGHBD_BFP(BLOCK_4X16, aom_highbd_sad4x16_bits12,
aom_highbd_sad4x16_avg_bits12, aom_highbd_12_variance4x16,
aom_highbd_12_sub_pixel_variance4x16,
aom_highbd_12_sub_pixel_avg_variance4x16, NULL, NULL,
aom_highbd_sad4x16x4d_bits12)
#endif
HIGHBD_BFP(BLOCK_32X16, aom_highbd_sad32x16_bits12,
aom_highbd_sad32x16_avg_bits12, aom_highbd_12_variance32x16,
aom_highbd_12_sub_pixel_variance32x16,
aom_highbd_12_sub_pixel_avg_variance32x16, NULL, NULL,
aom_highbd_sad32x16x4d_bits12)
HIGHBD_BFP(BLOCK_16X32, aom_highbd_sad16x32_bits12,
aom_highbd_sad16x32_avg_bits12, aom_highbd_12_variance16x32,
aom_highbd_12_sub_pixel_variance16x32,
aom_highbd_12_sub_pixel_avg_variance16x32, NULL, NULL,
aom_highbd_sad16x32x4d_bits12)
HIGHBD_BFP(BLOCK_64X32, aom_highbd_sad64x32_bits12,
aom_highbd_sad64x32_avg_bits12, aom_highbd_12_variance64x32,
aom_highbd_12_sub_pixel_variance64x32,
aom_highbd_12_sub_pixel_avg_variance64x32, NULL, NULL,
aom_highbd_sad64x32x4d_bits12)
HIGHBD_BFP(BLOCK_32X64, aom_highbd_sad32x64_bits12,
aom_highbd_sad32x64_avg_bits12, aom_highbd_12_variance32x64,
aom_highbd_12_sub_pixel_variance32x64,
aom_highbd_12_sub_pixel_avg_variance32x64, NULL, NULL,
aom_highbd_sad32x64x4d_bits12)
HIGHBD_BFP(BLOCK_32X32, aom_highbd_sad32x32_bits12,
aom_highbd_sad32x32_avg_bits12, aom_highbd_12_variance32x32,
aom_highbd_12_sub_pixel_variance32x32,
aom_highbd_12_sub_pixel_avg_variance32x32,
aom_highbd_sad32x32x3_bits12, aom_highbd_sad32x32x8_bits12,
aom_highbd_sad32x32x4d_bits12)
HIGHBD_BFP(BLOCK_64X64, aom_highbd_sad64x64_bits12,
aom_highbd_sad64x64_avg_bits12, aom_highbd_12_variance64x64,
aom_highbd_12_sub_pixel_variance64x64,
aom_highbd_12_sub_pixel_avg_variance64x64,
aom_highbd_sad64x64x3_bits12, aom_highbd_sad64x64x8_bits12,
aom_highbd_sad64x64x4d_bits12)
HIGHBD_BFP(BLOCK_16X16, aom_highbd_sad16x16_bits12,
aom_highbd_sad16x16_avg_bits12, aom_highbd_12_variance16x16,
aom_highbd_12_sub_pixel_variance16x16,
aom_highbd_12_sub_pixel_avg_variance16x16,
aom_highbd_sad16x16x3_bits12, aom_highbd_sad16x16x8_bits12,
aom_highbd_sad16x16x4d_bits12)
HIGHBD_BFP(BLOCK_16X8, aom_highbd_sad16x8_bits12,
aom_highbd_sad16x8_avg_bits12, aom_highbd_12_variance16x8,
aom_highbd_12_sub_pixel_variance16x8,
aom_highbd_12_sub_pixel_avg_variance16x8,
aom_highbd_sad16x8x3_bits12, aom_highbd_sad16x8x8_bits12,
aom_highbd_sad16x8x4d_bits12)
HIGHBD_BFP(BLOCK_8X16, aom_highbd_sad8x16_bits12,
aom_highbd_sad8x16_avg_bits12, aom_highbd_12_variance8x16,
aom_highbd_12_sub_pixel_variance8x16,
aom_highbd_12_sub_pixel_avg_variance8x16,
aom_highbd_sad8x16x3_bits12, aom_highbd_sad8x16x8_bits12,
aom_highbd_sad8x16x4d_bits12)
HIGHBD_BFP(
BLOCK_8X8, aom_highbd_sad8x8_bits12, aom_highbd_sad8x8_avg_bits12,
aom_highbd_12_variance8x8, aom_highbd_12_sub_pixel_variance8x8,
aom_highbd_12_sub_pixel_avg_variance8x8, aom_highbd_sad8x8x3_bits12,
aom_highbd_sad8x8x8_bits12, aom_highbd_sad8x8x4d_bits12)
HIGHBD_BFP(BLOCK_8X4, aom_highbd_sad8x4_bits12,
aom_highbd_sad8x4_avg_bits12, aom_highbd_12_variance8x4,
aom_highbd_12_sub_pixel_variance8x4,
aom_highbd_12_sub_pixel_avg_variance8x4, NULL,
aom_highbd_sad8x4x8_bits12, aom_highbd_sad8x4x4d_bits12)
HIGHBD_BFP(BLOCK_4X8, aom_highbd_sad4x8_bits12,
aom_highbd_sad4x8_avg_bits12, aom_highbd_12_variance4x8,
aom_highbd_12_sub_pixel_variance4x8,
aom_highbd_12_sub_pixel_avg_variance4x8, NULL,
aom_highbd_sad4x8x8_bits12, aom_highbd_sad4x8x4d_bits12)
HIGHBD_BFP(
BLOCK_4X4, aom_highbd_sad4x4_bits12, aom_highbd_sad4x4_avg_bits12,
aom_highbd_12_variance4x4, aom_highbd_12_sub_pixel_variance4x4,
aom_highbd_12_sub_pixel_avg_variance4x4, aom_highbd_sad4x4x3_bits12,
aom_highbd_sad4x4x8_bits12, aom_highbd_sad4x4x4d_bits12)
HIGHBD_BFP(BLOCK_2X2, NULL, NULL, aom_highbd_12_variance2x2, NULL, NULL,
NULL, NULL, NULL)
HIGHBD_BFP(BLOCK_4X2, NULL, NULL, aom_highbd_12_variance4x2, NULL, NULL,
NULL, NULL, NULL)
HIGHBD_BFP(BLOCK_2X4, NULL, NULL, aom_highbd_12_variance2x4, NULL, NULL,
NULL, NULL, NULL)
#if CONFIG_EXT_PARTITION
HIGHBD_BFP(
BLOCK_128X128, aom_highbd_sad128x128_bits12,
aom_highbd_sad128x128_avg_bits12, aom_highbd_12_variance128x128,
aom_highbd_12_sub_pixel_variance128x128,
aom_highbd_12_sub_pixel_avg_variance128x128,
aom_highbd_sad128x128x3_bits12, aom_highbd_sad128x128x8_bits12,
aom_highbd_sad128x128x4d_bits12)
HIGHBD_BFP(BLOCK_128X64, aom_highbd_sad128x64_bits12,
aom_highbd_sad128x64_avg_bits12,
aom_highbd_12_variance128x64,
aom_highbd_12_sub_pixel_variance128x64,
aom_highbd_12_sub_pixel_avg_variance128x64, NULL, NULL,
aom_highbd_sad128x64x4d_bits12)
HIGHBD_BFP(BLOCK_64X128, aom_highbd_sad64x128_bits12,
aom_highbd_sad64x128_avg_bits12,
aom_highbd_12_variance64x128,
aom_highbd_12_sub_pixel_variance64x128,
aom_highbd_12_sub_pixel_avg_variance64x128, NULL, NULL,
aom_highbd_sad64x128x4d_bits12)
#endif // CONFIG_EXT_PARTITION
#if CONFIG_EXT_PARTITION
HIGHBD_MBFP(BLOCK_128X128, aom_highbd_masked_sad128x128_bits12,
aom_highbd_12_masked_sub_pixel_variance128x128)
HIGHBD_MBFP(BLOCK_128X64, aom_highbd_masked_sad128x64_bits12,
aom_highbd_12_masked_sub_pixel_variance128x64)
HIGHBD_MBFP(BLOCK_64X128, aom_highbd_masked_sad64x128_bits12,
aom_highbd_12_masked_sub_pixel_variance64x128)
#endif // CONFIG_EXT_PARTITION
HIGHBD_MBFP(BLOCK_64X64, aom_highbd_masked_sad64x64_bits12,
aom_highbd_12_masked_sub_pixel_variance64x64)
HIGHBD_MBFP(BLOCK_64X32, aom_highbd_masked_sad64x32_bits12,
aom_highbd_12_masked_sub_pixel_variance64x32)
HIGHBD_MBFP(BLOCK_32X64, aom_highbd_masked_sad32x64_bits12,
aom_highbd_12_masked_sub_pixel_variance32x64)
HIGHBD_MBFP(BLOCK_32X32, aom_highbd_masked_sad32x32_bits12,
aom_highbd_12_masked_sub_pixel_variance32x32)
HIGHBD_MBFP(BLOCK_32X16, aom_highbd_masked_sad32x16_bits12,
aom_highbd_12_masked_sub_pixel_variance32x16)
HIGHBD_MBFP(BLOCK_16X32, aom_highbd_masked_sad16x32_bits12,
aom_highbd_12_masked_sub_pixel_variance16x32)
HIGHBD_MBFP(BLOCK_16X16, aom_highbd_masked_sad16x16_bits12,
aom_highbd_12_masked_sub_pixel_variance16x16)
HIGHBD_MBFP(BLOCK_8X16, aom_highbd_masked_sad8x16_bits12,
aom_highbd_12_masked_sub_pixel_variance8x16)
HIGHBD_MBFP(BLOCK_16X8, aom_highbd_masked_sad16x8_bits12,
aom_highbd_12_masked_sub_pixel_variance16x8)
HIGHBD_MBFP(BLOCK_8X8, aom_highbd_masked_sad8x8_bits12,
aom_highbd_12_masked_sub_pixel_variance8x8)
HIGHBD_MBFP(BLOCK_4X8, aom_highbd_masked_sad4x8_bits12,
aom_highbd_12_masked_sub_pixel_variance4x8)
HIGHBD_MBFP(BLOCK_8X4, aom_highbd_masked_sad8x4_bits12,
aom_highbd_12_masked_sub_pixel_variance8x4)
HIGHBD_MBFP(BLOCK_4X4, aom_highbd_masked_sad4x4_bits12,
aom_highbd_12_masked_sub_pixel_variance4x4)
#if CONFIG_EXT_PARTITION_TYPES
#if CONFIG_EXT_PARTITION
HIGHBD_MBFP(BLOCK_128X32, aom_highbd_masked_sad128x32_bits12,
aom_highbd_12_masked_sub_pixel_variance128x32)
HIGHBD_MBFP(BLOCK_32X128, aom_highbd_masked_sad32x128_bits12,
aom_highbd_12_masked_sub_pixel_variance32x128)
#endif // CONFIG_EXT_PARTITION
HIGHBD_MBFP(BLOCK_64X16, aom_highbd_masked_sad64x16_bits12,
aom_highbd_12_masked_sub_pixel_variance64x16)
HIGHBD_MBFP(BLOCK_16X64, aom_highbd_masked_sad16x64_bits12,
aom_highbd_12_masked_sub_pixel_variance16x64)
HIGHBD_MBFP(BLOCK_32X8, aom_highbd_masked_sad32x8_bits12,
aom_highbd_12_masked_sub_pixel_variance32x8)
HIGHBD_MBFP(BLOCK_8X32, aom_highbd_masked_sad8x32_bits12,
aom_highbd_12_masked_sub_pixel_variance8x32)
HIGHBD_MBFP(BLOCK_16X4, aom_highbd_masked_sad16x4_bits12,
aom_highbd_12_masked_sub_pixel_variance16x4)
HIGHBD_MBFP(BLOCK_4X16, aom_highbd_masked_sad4x16_bits12,
aom_highbd_12_masked_sub_pixel_variance4x16)
#endif
#if CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_128X128, aom_highbd_obmc_sad128x128_bits12,
aom_highbd_12_obmc_variance128x128,
aom_highbd_12_obmc_sub_pixel_variance128x128)
HIGHBD_OBFP(BLOCK_128X64, aom_highbd_obmc_sad128x64_bits12,
aom_highbd_12_obmc_variance128x64,
aom_highbd_12_obmc_sub_pixel_variance128x64)
HIGHBD_OBFP(BLOCK_64X128, aom_highbd_obmc_sad64x128_bits12,
aom_highbd_12_obmc_variance64x128,
aom_highbd_12_obmc_sub_pixel_variance64x128)
#endif // CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_64X64, aom_highbd_obmc_sad64x64_bits12,
aom_highbd_12_obmc_variance64x64,
aom_highbd_12_obmc_sub_pixel_variance64x64)
HIGHBD_OBFP(BLOCK_64X32, aom_highbd_obmc_sad64x32_bits12,
aom_highbd_12_obmc_variance64x32,
aom_highbd_12_obmc_sub_pixel_variance64x32)
HIGHBD_OBFP(BLOCK_32X64, aom_highbd_obmc_sad32x64_bits12,
aom_highbd_12_obmc_variance32x64,
aom_highbd_12_obmc_sub_pixel_variance32x64)
HIGHBD_OBFP(BLOCK_32X32, aom_highbd_obmc_sad32x32_bits12,
aom_highbd_12_obmc_variance32x32,
aom_highbd_12_obmc_sub_pixel_variance32x32)
HIGHBD_OBFP(BLOCK_32X16, aom_highbd_obmc_sad32x16_bits12,
aom_highbd_12_obmc_variance32x16,
aom_highbd_12_obmc_sub_pixel_variance32x16)
HIGHBD_OBFP(BLOCK_16X32, aom_highbd_obmc_sad16x32_bits12,
aom_highbd_12_obmc_variance16x32,
aom_highbd_12_obmc_sub_pixel_variance16x32)
HIGHBD_OBFP(BLOCK_16X16, aom_highbd_obmc_sad16x16_bits12,
aom_highbd_12_obmc_variance16x16,
aom_highbd_12_obmc_sub_pixel_variance16x16)
HIGHBD_OBFP(BLOCK_8X16, aom_highbd_obmc_sad8x16_bits12,
aom_highbd_12_obmc_variance8x16,
aom_highbd_12_obmc_sub_pixel_variance8x16)
HIGHBD_OBFP(BLOCK_16X8, aom_highbd_obmc_sad16x8_bits12,
aom_highbd_12_obmc_variance16x8,
aom_highbd_12_obmc_sub_pixel_variance16x8)
HIGHBD_OBFP(BLOCK_8X8, aom_highbd_obmc_sad8x8_bits12,
aom_highbd_12_obmc_variance8x8,
aom_highbd_12_obmc_sub_pixel_variance8x8)
HIGHBD_OBFP(BLOCK_4X8, aom_highbd_obmc_sad4x8_bits12,
aom_highbd_12_obmc_variance4x8,
aom_highbd_12_obmc_sub_pixel_variance4x8)
HIGHBD_OBFP(BLOCK_8X4, aom_highbd_obmc_sad8x4_bits12,
aom_highbd_12_obmc_variance8x4,
aom_highbd_12_obmc_sub_pixel_variance8x4)
HIGHBD_OBFP(BLOCK_4X4, aom_highbd_obmc_sad4x4_bits12,
aom_highbd_12_obmc_variance4x4,
aom_highbd_12_obmc_sub_pixel_variance4x4)
#if CONFIG_EXT_PARTITION_TYPES
#if CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_128X32, aom_highbd_obmc_sad128x32_bits12,
aom_highbd_12_obmc_variance128x32,
aom_highbd_12_obmc_sub_pixel_variance128x32)
HIGHBD_OBFP(BLOCK_32X128, aom_highbd_obmc_sad32x128_bits12,
aom_highbd_12_obmc_variance32x128,
aom_highbd_12_obmc_sub_pixel_variance32x128)
#endif // CONFIG_EXT_PARTITION
HIGHBD_OBFP(BLOCK_64X16, aom_highbd_obmc_sad64x16_bits12,
aom_highbd_12_obmc_variance64x16,
aom_highbd_12_obmc_sub_pixel_variance64x16)
HIGHBD_OBFP(BLOCK_16X64, aom_highbd_obmc_sad16x64_bits12,
aom_highbd_12_obmc_variance16x64,
aom_highbd_12_obmc_sub_pixel_variance16x64)
HIGHBD_OBFP(BLOCK_32X8, aom_highbd_obmc_sad32x8_bits12,
aom_highbd_12_obmc_variance32x8,
aom_highbd_12_obmc_sub_pixel_variance32x8)
HIGHBD_OBFP(BLOCK_8X32, aom_highbd_obmc_sad8x32_bits12,
aom_highbd_12_obmc_variance8x32,
aom_highbd_12_obmc_sub_pixel_variance8x32)
HIGHBD_OBFP(BLOCK_16X4, aom_highbd_obmc_sad16x4_bits12,
aom_highbd_12_obmc_variance16x4,
aom_highbd_12_obmc_sub_pixel_variance16x4)
HIGHBD_OBFP(BLOCK_4X16, aom_highbd_obmc_sad4x16_bits12,
aom_highbd_12_obmc_variance4x16,
aom_highbd_12_obmc_sub_pixel_variance4x16)
#endif
break;
default:
assert(0 &&
"cm->bit_depth should be AOM_BITS_8, "
"AOM_BITS_10 or AOM_BITS_12");
}
}
}
#endif // CONFIG_HIGHBITDEPTH
static void realloc_segmentation_maps(AV1_COMP *cpi) {
AV1_COMMON *const cm = &cpi->common;
// Create the encoder segmentation map and set all entries to 0
aom_free(cpi->segmentation_map);
CHECK_MEM_ERROR(cm, cpi->segmentation_map,
aom_calloc(cm->mi_rows * cm->mi_cols, 1));
// Create a map used for cyclic background refresh.
if (cpi->cyclic_refresh) av1_cyclic_refresh_free(cpi->cyclic_refresh);
CHECK_MEM_ERROR(cm, cpi->cyclic_refresh,
av1_cyclic_refresh_alloc(cm->mi_rows, cm->mi_cols));
// Create a map used to mark inactive areas.
aom_free(cpi->active_map.map);
CHECK_MEM_ERROR(cm, cpi->active_map.map,
aom_calloc(cm->mi_rows * cm->mi_cols, 1));
}
void set_compound_tools(AV1_COMMON *cm) {
(void)cm;
#if CONFIG_INTERINTRA
cm->allow_interintra_compound = 1;
#endif // CONFIG_INTERINTRA
cm->allow_masked_compound = 1;
}
void av1_change_config(struct AV1_COMP *cpi, const AV1EncoderConfig *oxcf) {
AV1_COMMON *const cm = &cpi->common;
RATE_CONTROL *const rc = &cpi->rc;
MACROBLOCK *const x = &cpi->td.mb;
if (cm->profile != oxcf->profile) cm->profile = oxcf->profile;
cm->bit_depth = oxcf->bit_depth;
cm->color_space = oxcf->color_space;
#if CONFIG_COLORSPACE_HEADERS
cm->transfer_function = oxcf->transfer_function;
cm->chroma_sample_position = oxcf->chroma_sample_position;
#endif
cm->color_range = oxcf->color_range;
if (cm->profile <= PROFILE_1)
assert(cm->bit_depth == AOM_BITS_8);
else
assert(cm->bit_depth > AOM_BITS_8);
cpi->oxcf = *oxcf;
x->e_mbd.bd = (int)cm->bit_depth;
x->e_mbd.global_motion = cm->global_motion;
if ((oxcf->pass == 0) && (oxcf->rc_mode == AOM_Q)) {
rc->baseline_gf_interval = FIXED_GF_INTERVAL;
} else {
rc->baseline_gf_interval = (MIN_GF_INTERVAL + MAX_GF_INTERVAL) / 2;
}
cpi->refresh_last_frame = 1;
cpi->refresh_golden_frame = 0;
cpi->refresh_bwd_ref_frame = 0;
cpi->refresh_alt2_ref_frame = 0;
cm->refresh_frame_context =
(oxcf->error_resilient_mode || oxcf->frame_parallel_decoding_mode)
? REFRESH_FRAME_CONTEXT_FORWARD
: REFRESH_FRAME_CONTEXT_BACKWARD;
#if CONFIG_EXT_TILE
if (oxcf->large_scale_tile)
cm->refresh_frame_context = REFRESH_FRAME_CONTEXT_FORWARD;
#endif // CONFIG_EXT_TILE
#if !CONFIG_NO_FRAME_CONTEXT_SIGNALING
cm->reset_frame_context = RESET_FRAME_CONTEXT_NONE;
#endif
if (x->palette_buffer == NULL) {
CHECK_MEM_ERROR(cm, x->palette_buffer,
aom_memalign(16, sizeof(*x->palette_buffer)));
}
set_compound_tools(cm);
av1_reset_segment_features(cm);
#if CONFIG_AMVR
set_high_precision_mv(cpi, 0, 0);
#else
set_high_precision_mv(cpi, 0);
#endif
set_rc_buffer_sizes(rc, &cpi->oxcf);
// Under a configuration change, where maximum_buffer_size may change,
// keep buffer level clipped to the maximum allowed buffer size.
rc->bits_off_target = AOMMIN(rc->bits_off_target, rc->maximum_buffer_size);
rc->buffer_level = AOMMIN(rc->buffer_level, rc->maximum_buffer_size);
// Set up frame rate and related parameters rate control values.
av1_new_framerate(cpi, cpi->framerate);
// Set absolute upper and lower quality limits
rc->worst_quality = cpi->oxcf.worst_allowed_q;
rc->best_quality = cpi->oxcf.best_allowed_q;
cm->interp_filter = cpi->sf.default_interp_filter;
if (cpi->oxcf.render_width > 0 && cpi->oxcf.render_height > 0) {
cm->render_width = cpi->oxcf.render_width;
cm->render_height = cpi->oxcf.render_height;
} else {
cm->render_width = cpi->oxcf.width;
cm->render_height = cpi->oxcf.height;
}
cm->width = cpi->oxcf.width;
cm->height = cpi->oxcf.height;
if (cpi->initial_width) {
if (cm->width > cpi->initial_width || cm->height > cpi->initial_height) {
av1_free_context_buffers(cm);
av1_free_pc_tree(&cpi->td);
alloc_compressor_data(cpi);
realloc_segmentation_maps(cpi);
cpi->initial_width = cpi->initial_height = 0;
}
}
update_frame_size(cpi);
cpi->alt_ref_source = NULL;
rc->is_src_frame_alt_ref = 0;
rc->is_bwd_ref_frame = 0;
rc->is_last_bipred_frame = 0;
rc->is_bipred_frame = 0;
#if 0
// Experimental RD Code
cpi->frame_distortion = 0;
cpi->last_frame_distortion = 0;
#endif
set_tile_info(cpi);
cpi->ext_refresh_frame_flags_pending = 0;
cpi->ext_refresh_frame_context_pending = 0;
#if CONFIG_HIGHBITDEPTH
highbd_set_var_fns(cpi);
#endif
#if CONFIG_ANS && ANS_MAX_SYMBOLS
cpi->common.ans_window_size_log2 = cpi->oxcf.ans_window_size_log2;
#endif // CONFIG_ANS && ANS_MAX_SYMBOLS
#if CONFIG_AMVR
cm->seq_force_integer_mv = 2;
#endif
}
AV1_COMP *av1_create_compressor(AV1EncoderConfig *oxcf,
BufferPool *const pool) {
unsigned int i;
AV1_COMP *volatile const cpi = aom_memalign(32, sizeof(AV1_COMP));
AV1_COMMON *volatile const cm = cpi != NULL ? &cpi->common : NULL;
if (!cm) return NULL;
av1_zero(*cpi);
if (setjmp(cm->error.jmp)) {
cm->error.setjmp = 0;
av1_remove_compressor(cpi);
return 0;
}
cm->error.setjmp = 1;
cm->alloc_mi = enc_alloc_mi;
cm->free_mi = enc_free_mi;
cm->setup_mi = enc_setup_mi;
#if CONFIG_NCOBMC_ADAPT_WEIGHT
get_default_ncobmc_kernels(cm);
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
CHECK_MEM_ERROR(cm, cm->fc,
(FRAME_CONTEXT *)aom_memalign(32, sizeof(*cm->fc)));
CHECK_MEM_ERROR(cm, cm->frame_contexts,
(FRAME_CONTEXT *)aom_memalign(
32, FRAME_CONTEXTS * sizeof(*cm->frame_contexts)));
memset(cm->fc, 0, sizeof(*cm->fc));
memset(cm->frame_contexts, 0, FRAME_CONTEXTS * sizeof(*cm->frame_contexts));
cpi->resize_state = 0;
cpi->resize_avg_qp = 0;
cpi->resize_buffer_underflow = 0;
cpi->common.buffer_pool = pool;
init_config(cpi, oxcf);
#if CONFIG_XIPHRC
cpi->od_rc.framerate = cpi->framerate;
cpi->od_rc.frame_width = cm->render_width;
cpi->od_rc.frame_height = cm->render_height;
cpi->od_rc.keyframe_rate = oxcf->key_freq;
cpi->od_rc.goldenframe_rate = FIXED_GF_INTERVAL;
cpi->od_rc.altref_rate = 25;
cpi->od_rc.firstpass_quant = 1;
cpi->od_rc.bit_depth = cm->bit_depth;
cpi->od_rc.minq = oxcf->best_allowed_q;
cpi->od_rc.maxq = oxcf->worst_allowed_q;
if (cpi->oxcf.rc_mode == AOM_CQ) cpi->od_rc.minq = cpi->od_rc.quality;
cpi->od_rc.quality = cpi->oxcf.rc_mode == AOM_Q ? oxcf->cq_level : -1;
cpi->od_rc.periodic_boosts = oxcf->frame_periodic_boost;
od_enc_rc_init(&cpi->od_rc,
cpi->oxcf.rc_mode == AOM_Q ? -1 : oxcf->target_bandwidth,
oxcf->maximum_buffer_size_ms);
#else
av1_rc_init(&cpi->oxcf, oxcf->pass, &cpi->rc);
#endif
cm->current_video_frame = 0;
cpi->partition_search_skippable_frame = 0;
cpi->tile_data = NULL;
cpi->last_show_frame_buf_idx = INVALID_IDX;
realloc_segmentation_maps(cpi);
for (i = 0; i < NMV_CONTEXTS; ++i) {
memset(cpi->nmv_costs, 0, sizeof(cpi->nmv_costs));
memset(cpi->nmv_costs_hp, 0, sizeof(cpi->nmv_costs_hp));
}
for (i = 0; i < (sizeof(cpi->mbgraph_stats) / sizeof(cpi->mbgraph_stats[0]));
i++) {
CHECK_MEM_ERROR(
cm, cpi->mbgraph_stats[i].mb_stats,
aom_calloc(cm->MBs * sizeof(*cpi->mbgraph_stats[i].mb_stats), 1));
}
#if CONFIG_FP_MB_STATS
cpi->use_fp_mb_stats = 0;
if (cpi->use_fp_mb_stats) {
// a place holder used to store the first pass mb stats in the first pass
CHECK_MEM_ERROR(cm, cpi->twopass.frame_mb_stats_buf,
aom_calloc(cm->MBs * sizeof(uint8_t), 1));
} else {
cpi->twopass.frame_mb_stats_buf = NULL;
}
#endif
cpi->refresh_alt_ref_frame = 0;
cpi->multi_arf_last_grp_enabled = 0;
cpi->b_calculate_psnr = CONFIG_INTERNAL_STATS;
#if CONFIG_INTERNAL_STATS
cpi->b_calculate_blockiness = 1;
cpi->b_calculate_consistency = 1;
cpi->total_inconsistency = 0;
cpi->psnr.worst = 100.0;
cpi->worst_ssim = 100.0;
cpi->count = 0;
cpi->bytes = 0;
if (cpi->b_calculate_psnr) {
cpi->total_sq_error = 0;
cpi->total_samples = 0;
cpi->tot_recode_hits = 0;
cpi->summed_quality = 0;
cpi->summed_weights = 0;
}
cpi->fastssim.worst = 100.0;
cpi->psnrhvs.worst = 100.0;
if (cpi->b_calculate_blockiness) {
cpi->total_blockiness = 0;
cpi->worst_blockiness = 0.0;
}
if (cpi->b_calculate_consistency) {
CHECK_MEM_ERROR(cm, cpi->ssim_vars,
aom_malloc(sizeof(*cpi->ssim_vars) * 4 *
cpi->common.mi_rows * cpi->common.mi_cols));
cpi->worst_consistency = 100.0;
}
#endif
#if CONFIG_ENTROPY_STATS
av1_zero(aggregate_fc);
av1_zero_array(aggregate_fc_per_type, FRAME_CONTEXTS);
#endif // CONFIG_ENTROPY_STATS
cpi->first_time_stamp_ever = INT64_MAX;
for (i = 0; i < NMV_CONTEXTS; ++i) {
cpi->td.mb.nmvcost[i][0] = &cpi->nmv_costs[i][0][MV_MAX];
cpi->td.mb.nmvcost[i][1] = &cpi->nmv_costs[i][1][MV_MAX];
cpi->td.mb.nmvcost_hp[i][0] = &cpi->nmv_costs_hp[i][0][MV_MAX];
cpi->td.mb.nmvcost_hp[i][1] = &cpi->nmv_costs_hp[i][1][MV_MAX];
}
#ifdef OUTPUT_YUV_SKINMAP
yuv_skinmap_file = fopen("skinmap.yuv", "ab");
#endif
#ifdef OUTPUT_YUV_REC
yuv_rec_file = fopen("rec.yuv", "wb");
#endif
#if 0
framepsnr = fopen("framepsnr.stt", "a");
kf_list = fopen("kf_list.stt", "w");
#endif
#if CONFIG_XIPHRC
if (oxcf->pass == 2) {
cpi->od_rc.twopass_allframes_buf = oxcf->two_pass_stats_in.buf;
cpi->od_rc.twopass_allframes_buf_size = oxcf->two_pass_stats_in.sz;
}
#else
if (oxcf->pass == 1) {
av1_init_first_pass(cpi);
} else if (oxcf->pass == 2) {
const size_t packet_sz = sizeof(FIRSTPASS_STATS);
const int packets = (int)(oxcf->two_pass_stats_in.sz / packet_sz);
#if CONFIG_FP_MB_STATS
if (cpi->use_fp_mb_stats) {
const size_t psz = cpi->common.MBs * sizeof(uint8_t);
const int ps = (int)(oxcf->firstpass_mb_stats_in.sz / psz);
cpi->twopass.firstpass_mb_stats.mb_stats_start =
oxcf->firstpass_mb_stats_in.buf;
cpi->twopass.firstpass_mb_stats.mb_stats_end =
cpi->twopass.firstpass_mb_stats.mb_stats_start +
(ps - 1) * cpi->common.MBs * sizeof(uint8_t);
}
#endif
cpi->twopass.stats_in_start = oxcf->two_pass_stats_in.buf;
cpi->twopass.stats_in = cpi->twopass.stats_in_start;
cpi->twopass.stats_in_end = &cpi->twopass.stats_in[packets - 1];
av1_init_second_pass(cpi);
}
#endif
#if CONFIG_HIGHBITDEPTH
int buf_scaler = 2;
#else
int buf_scaler = 1;
#endif
CHECK_MEM_ERROR(
cm, cpi->td.mb.above_pred_buf,
(uint8_t *)aom_memalign(16,
buf_scaler * MAX_MB_PLANE * MAX_SB_SQUARE *
sizeof(*cpi->td.mb.above_pred_buf)));
CHECK_MEM_ERROR(
cm, cpi->td.mb.left_pred_buf,
(uint8_t *)aom_memalign(16,
buf_scaler * MAX_MB_PLANE * MAX_SB_SQUARE *
sizeof(*cpi->td.mb.left_pred_buf)));
CHECK_MEM_ERROR(cm, cpi->td.mb.wsrc_buf,
(int32_t *)aom_memalign(
16, MAX_SB_SQUARE * sizeof(*cpi->td.mb.wsrc_buf)));
CHECK_MEM_ERROR(cm, cpi->td.mb.mask_buf,
(int32_t *)aom_memalign(
16, MAX_SB_SQUARE * sizeof(*cpi->td.mb.mask_buf)));
av1_set_speed_features_framesize_independent(cpi);
av1_set_speed_features_framesize_dependent(cpi);
#define BFP(BT, SDF, SDAF, VF, SVF, SVAF, SDX3F, SDX8F, SDX4DF) \
cpi->fn_ptr[BT].sdf = SDF; \
cpi->fn_ptr[BT].sdaf = SDAF; \
cpi->fn_ptr[BT].vf = VF; \
cpi->fn_ptr[BT].svf = SVF; \
cpi->fn_ptr[BT].svaf = SVAF; \
cpi->fn_ptr[BT].sdx3f = SDX3F; \
cpi->fn_ptr[BT].sdx8f = SDX8F; \
cpi->fn_ptr[BT].sdx4df = SDX4DF;
#if CONFIG_EXT_PARTITION_TYPES
BFP(BLOCK_4X16, aom_sad4x16, aom_sad4x16_avg, aom_variance4x16,
aom_sub_pixel_variance4x16, aom_sub_pixel_avg_variance4x16, NULL, NULL,
aom_sad4x16x4d)
BFP(BLOCK_16X4, aom_sad16x4, aom_sad16x4_avg, aom_variance16x4,
aom_sub_pixel_variance16x4, aom_sub_pixel_avg_variance16x4, NULL, NULL,
aom_sad16x4x4d)
BFP(BLOCK_8X32, aom_sad8x32, aom_sad8x32_avg, aom_variance8x32,
aom_sub_pixel_variance8x32, aom_sub_pixel_avg_variance8x32, NULL, NULL,
aom_sad8x32x4d)
BFP(BLOCK_32X8, aom_sad32x8, aom_sad32x8_avg, aom_variance32x8,
aom_sub_pixel_variance32x8, aom_sub_pixel_avg_variance32x8, NULL, NULL,
aom_sad32x8x4d)
BFP(BLOCK_16X64, aom_sad16x64, aom_sad16x64_avg, aom_variance16x64,
aom_sub_pixel_variance16x64, aom_sub_pixel_avg_variance16x64, NULL, NULL,
aom_sad16x64x4d)
BFP(BLOCK_64X16, aom_sad64x16, aom_sad64x16_avg, aom_variance64x16,
aom_sub_pixel_variance64x16, aom_sub_pixel_avg_variance64x16, NULL, NULL,
aom_sad64x16x4d)
#if CONFIG_EXT_PARTITION
BFP(BLOCK_32X128, aom_sad32x128, aom_sad32x128_avg, aom_variance32x128,
aom_sub_pixel_variance32x128, aom_sub_pixel_avg_variance32x128, NULL,
NULL, aom_sad32x128x4d)
BFP(BLOCK_128X32, aom_sad128x32, aom_sad128x32_avg, aom_variance128x32,
aom_sub_pixel_variance128x32, aom_sub_pixel_avg_variance128x32, NULL,
NULL, aom_sad128x32x4d)
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_EXT_PARTITION_TYPES
#if CONFIG_EXT_PARTITION
BFP(BLOCK_128X128, aom_sad128x128, aom_sad128x128_avg, aom_variance128x128,
aom_sub_pixel_variance128x128, aom_sub_pixel_avg_variance128x128,
aom_sad128x128x3, aom_sad128x128x8, aom_sad128x128x4d)
BFP(BLOCK_128X64, aom_sad128x64, aom_sad128x64_avg, aom_variance128x64,
aom_sub_pixel_variance128x64, aom_sub_pixel_avg_variance128x64, NULL,
NULL, aom_sad128x64x4d)
BFP(BLOCK_64X128, aom_sad64x128, aom_sad64x128_avg, aom_variance64x128,
aom_sub_pixel_variance64x128, aom_sub_pixel_avg_variance64x128, NULL,
NULL, aom_sad64x128x4d)
#endif // CONFIG_EXT_PARTITION
#if CONFIG_JNT_COMP
BFP(BLOCK_32X16, aom_sad32x16, aom_sad32x16_avg_c, aom_variance32x16,
aom_sub_pixel_variance32x16, aom_sub_pixel_avg_variance32x16, NULL, NULL,
aom_sad32x16x4d)
BFP(BLOCK_16X32, aom_sad16x32, aom_sad16x32_avg_c, aom_variance16x32,
aom_sub_pixel_variance16x32, aom_sub_pixel_avg_variance16x32, NULL, NULL,
aom_sad16x32x4d)
BFP(BLOCK_64X32, aom_sad64x32, aom_sad64x32_avg_c, aom_variance64x32,
aom_sub_pixel_variance64x32, aom_sub_pixel_avg_variance64x32, NULL, NULL,
aom_sad64x32x4d)
BFP(BLOCK_32X64, aom_sad32x64, aom_sad32x64_avg_c, aom_variance32x64,
aom_sub_pixel_variance32x64, aom_sub_pixel_avg_variance32x64, NULL, NULL,
aom_sad32x64x4d)
BFP(BLOCK_32X32, aom_sad32x32, aom_sad32x32_avg_c, aom_variance32x32,
aom_sub_pixel_variance32x32, aom_sub_pixel_avg_variance32x32,
aom_sad32x32x3, aom_sad32x32x8, aom_sad32x32x4d)
BFP(BLOCK_64X64, aom_sad64x64, aom_sad64x64_avg_c, aom_variance64x64,
aom_sub_pixel_variance64x64, aom_sub_pixel_avg_variance64x64,
aom_sad64x64x3, aom_sad64x64x8, aom_sad64x64x4d)
BFP(BLOCK_16X16, aom_sad16x16, aom_sad16x16_avg_c, aom_variance16x16,
aom_sub_pixel_variance16x16, aom_sub_pixel_avg_variance16x16,
aom_sad16x16x3, aom_sad16x16x8, aom_sad16x16x4d)
BFP(BLOCK_16X8, aom_sad16x8, aom_sad16x8_avg_c, aom_variance16x8,
aom_sub_pixel_variance16x8, aom_sub_pixel_avg_variance16x8, aom_sad16x8x3,
aom_sad16x8x8, aom_sad16x8x4d)
BFP(BLOCK_8X16, aom_sad8x16, aom_sad8x16_avg_c, aom_variance8x16,
aom_sub_pixel_variance8x16, aom_sub_pixel_avg_variance8x16, aom_sad8x16x3,
aom_sad8x16x8, aom_sad8x16x4d)
BFP(BLOCK_8X8, aom_sad8x8, aom_sad8x8_avg_c, aom_variance8x8,
aom_sub_pixel_variance8x8, aom_sub_pixel_avg_variance8x8, aom_sad8x8x3,
aom_sad8x8x8, aom_sad8x8x4d)
BFP(BLOCK_8X4, aom_sad8x4, aom_sad8x4_avg_c, aom_variance8x4,
aom_sub_pixel_variance8x4, aom_sub_pixel_avg_variance8x4, NULL,
aom_sad8x4x8, aom_sad8x4x4d)
BFP(BLOCK_4X8, aom_sad4x8, aom_sad4x8_avg_c, aom_variance4x8,
aom_sub_pixel_variance4x8, aom_sub_pixel_avg_variance4x8, NULL,
aom_sad4x8x8, aom_sad4x8x4d)
BFP(BLOCK_4X4, aom_sad4x4, aom_sad4x4_avg_c, aom_variance4x4,
aom_sub_pixel_variance4x4, aom_sub_pixel_avg_variance4x4, aom_sad4x4x3,
aom_sad4x4x8, aom_sad4x4x4d)
#else
BFP(BLOCK_32X16, aom_sad32x16, aom_sad32x16_avg, aom_variance32x16,
aom_sub_pixel_variance32x16, aom_sub_pixel_avg_variance32x16, NULL, NULL,
aom_sad32x16x4d)
BFP(BLOCK_16X32, aom_sad16x32, aom_sad16x32_avg, aom_variance16x32,
aom_sub_pixel_variance16x32, aom_sub_pixel_avg_variance16x32, NULL, NULL,
aom_sad16x32x4d)
BFP(BLOCK_64X32, aom_sad64x32, aom_sad64x32_avg, aom_variance64x32,
aom_sub_pixel_variance64x32, aom_sub_pixel_avg_variance64x32, NULL, NULL,
aom_sad64x32x4d)
BFP(BLOCK_32X64, aom_sad32x64, aom_sad32x64_avg, aom_variance32x64,
aom_sub_pixel_variance32x64, aom_sub_pixel_avg_variance32x64, NULL, NULL,
aom_sad32x64x4d)
BFP(BLOCK_32X32, aom_sad32x32, aom_sad32x32_avg, aom_variance32x32,
aom_sub_pixel_variance32x32, aom_sub_pixel_avg_variance32x32,
aom_sad32x32x3, aom_sad32x32x8, aom_sad32x32x4d)
BFP(BLO