summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
Diffstat (limited to 'vp9')
-rw-r--r--vp9/common/vp9_blockd.c2
-rw-r--r--vp9/common/vp9_blockd.h12
-rw-r--r--vp9/common/vp9_postproc.c22
-rw-r--r--vp9/common/vp9_reconinter.c2
-rw-r--r--vp9/common/vp9_rtcd_defs.pl39
-rw-r--r--vp9/decoder/vp9_decodeframe.c2
-rw-r--r--vp9/decoder/vp9_decodemv.c10
-rw-r--r--vp9/decoder/vp9_decoder.c46
-rw-r--r--vp9/encoder/vp9_encodemb.c130
-rw-r--r--vp9/encoder/vp9_encodemb.h9
-rw-r--r--vp9/encoder/vp9_firstpass.c8
-rw-r--r--vp9/encoder/vp9_pickmode.c15
-rw-r--r--vp9/encoder/vp9_rdopt.c26
-rw-r--r--vp9/encoder/vp9_tokenize.c29
-rw-r--r--vp9/encoder/x86/vp9_dct_ssse3.c5
-rw-r--r--vp9/encoder/x86/vp9_frame_scale_ssse3.c5
-rw-r--r--vp9/vp9_cx_iface.c13
-rw-r--r--vp9/vp9_dx_iface.c3
-rw-r--r--vp9/vp9_iface_common.h12
-rw-r--r--vp9/vp9cx.mk4
20 files changed, 201 insertions, 193 deletions
diff --git a/vp9/common/vp9_blockd.c b/vp9/common/vp9_blockd.c
index 7bab27d4f..88320584c 100644
--- a/vp9/common/vp9_blockd.c
+++ b/vp9/common/vp9_blockd.c
@@ -66,7 +66,7 @@ void vp9_foreach_transformed_block_in_plane(
for (r = 0; r < max_blocks_high; r += (1 << tx_size)) {
// Skip visiting the sub blocks that are wholly within the UMV.
for (c = 0; c < max_blocks_wide; c += (1 << tx_size)) {
- visit(plane, i, plane_bsize, tx_size, arg);
+ visit(plane, i, r, c, plane_bsize, tx_size, arg);
i += step;
}
i += extra_step;
diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h
index 3d26fb2b5..85b99c4bc 100644
--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -270,6 +270,7 @@ static INLINE const vpx_prob *get_y_mode_probs(const MODE_INFO *mi,
}
typedef void (*foreach_transformed_block_visitor)(int plane, int block,
+ int row, int col,
BLOCK_SIZE plane_bsize,
TX_SIZE tx_size,
void *arg);
@@ -283,17 +284,6 @@ void vp9_foreach_transformed_block(
const MACROBLOCKD* const xd, BLOCK_SIZE bsize,
foreach_transformed_block_visitor visit, void *arg);
-static INLINE void txfrm_block_to_raster_xy(BLOCK_SIZE plane_bsize,
- TX_SIZE tx_size, int block,
- int *x, int *y) {
- const int bwl = b_width_log2_lookup[plane_bsize];
- const int tx_cols_log2 = bwl - tx_size;
- const int tx_cols = 1 << tx_cols_log2;
- const int raster_mb = block >> (tx_size << 1);
- *x = (raster_mb & (tx_cols - 1)) << tx_size;
- *y = (raster_mb >> tx_cols_log2) << tx_size;
-}
-
void vp9_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob,
int aoff, int loff);
diff --git a/vp9/common/vp9_postproc.c b/vp9/common/vp9_postproc.c
index c04cc8f05..5dad81d64 100644
--- a/vp9/common/vp9_postproc.c
+++ b/vp9/common/vp9_postproc.c
@@ -618,15 +618,16 @@ int vp9_post_proc_frame(struct VP9Common *cm,
// Alloc memory for prev_mip in the first frame.
if (cm->current_video_frame == 1) {
- cm->postproc_state.last_base_qindex = cm->base_qindex;
- cm->postproc_state.last_frame_valid = 1;
+ ppstate->last_base_qindex = cm->base_qindex;
+ ppstate->last_frame_valid = 1;
+ }
+
+ if ((flags & VP9D_MFQE) && ppstate->prev_mip == NULL) {
ppstate->prev_mip = vpx_calloc(cm->mi_alloc_size, sizeof(*cm->mip));
if (!ppstate->prev_mip) {
return 1;
}
ppstate->prev_mi = ppstate->prev_mip + cm->mi_stride + 1;
- memset(ppstate->prev_mip, 0,
- cm->mi_stride * (cm->mi_rows + 1) * sizeof(*cm->mip));
}
// Allocate post_proc_buffer_int if needed.
@@ -664,9 +665,9 @@ int vp9_post_proc_frame(struct VP9Common *cm,
"Failed to allocate post-processing buffer");
if ((flags & VP9D_MFQE) && cm->current_video_frame >= 2 &&
- cm->postproc_state.last_frame_valid && cm->bit_depth == 8 &&
- cm->postproc_state.last_base_qindex <= last_q_thresh &&
- cm->base_qindex - cm->postproc_state.last_base_qindex >= q_diff_thresh) {
+ ppstate->last_frame_valid && cm->bit_depth == 8 &&
+ ppstate->last_base_qindex <= last_q_thresh &&
+ cm->base_qindex - ppstate->last_base_qindex >= q_diff_thresh) {
vp9_mfqe(cm);
// TODO(jackychen): Consider whether enable deblocking by default
// if mfqe is enabled. Need to take both the quality and the speed
@@ -692,8 +693,8 @@ int vp9_post_proc_frame(struct VP9Common *cm,
vp8_yv12_copy_frame(cm->frame_to_show, ppbuf);
}
- cm->postproc_state.last_base_qindex = cm->base_qindex;
- cm->postproc_state.last_frame_valid = 1;
+ ppstate->last_base_qindex = cm->base_qindex;
+ ppstate->last_frame_valid = 1;
if (flags & VP9D_ADDNOISE) {
const int noise_level = ppflags->noise_level;
@@ -714,7 +715,8 @@ int vp9_post_proc_frame(struct VP9Common *cm,
dest->uv_width = dest->y_width >> cm->subsampling_x;
dest->uv_height = dest->y_height >> cm->subsampling_y;
- swap_mi_and_prev_mi(cm);
+ if (flags & VP9D_MFQE)
+ swap_mi_and_prev_mi(cm);
return 0;
}
#endif // CONFIG_VP9_POSTPROC
diff --git a/vp9/common/vp9_reconinter.c b/vp9/common/vp9_reconinter.c
index 84718e970..67fe18c7e 100644
--- a/vp9/common/vp9_reconinter.c
+++ b/vp9/common/vp9_reconinter.c
@@ -178,7 +178,7 @@ static void build_inter_predictors(MACROBLOCKD *xd, int plane, int block,
// Co-ordinate of containing block to pixel precision.
const int x_start = (-xd->mb_to_left_edge >> (3 + pd->subsampling_x));
const int y_start = (-xd->mb_to_top_edge >> (3 + pd->subsampling_y));
-#if CONFIG_BETTER_HW_COMPATIBILITY
+#if 0 // CONFIG_BETTER_HW_COMPATIBILITY
assert(xd->mi[0]->sb_type != BLOCK_4X8 &&
xd->mi[0]->sb_type != BLOCK_8X4);
assert(mv_q4.row == mv.row * (1 << (1 - pd->subsampling_y)) &&
diff --git a/vp9/common/vp9_rtcd_defs.pl b/vp9/common/vp9_rtcd_defs.pl
index 846133674..276f14554 100644
--- a/vp9/common/vp9_rtcd_defs.pl
+++ b/vp9/common/vp9_rtcd_defs.pl
@@ -21,29 +21,6 @@ EOF
}
forward_decls qw/vp9_common_forward_decls/;
-# x86inc.asm had specific constraints. break it out so it's easy to disable.
-# zero all the variables to avoid tricky else conditions.
-$mmx_x86inc = $sse_x86inc = $sse2_x86inc = $ssse3_x86inc = $avx_x86inc =
- $avx2_x86inc = '';
-$mmx_x86_64_x86inc = $sse_x86_64_x86inc = $sse2_x86_64_x86inc =
- $ssse3_x86_64_x86inc = $avx_x86_64_x86inc = $avx2_x86_64_x86inc = '';
-if (vpx_config("CONFIG_USE_X86INC") eq "yes") {
- $mmx_x86inc = 'mmx';
- $sse_x86inc = 'sse';
- $sse2_x86inc = 'sse2';
- $ssse3_x86inc = 'ssse3';
- $avx_x86inc = 'avx';
- $avx2_x86inc = 'avx2';
- if ($opts{arch} eq "x86_64") {
- $mmx_x86_64_x86inc = 'mmx';
- $sse_x86_64_x86inc = 'sse';
- $sse2_x86_64_x86inc = 'sse2';
- $ssse3_x86_64_x86inc = 'ssse3';
- $avx_x86_64_x86inc = 'avx';
- $avx2_x86_64_x86inc = 'avx2';
- }
-}
-
# functions that are 64 bit only.
$mmx_x86_64 = $sse2_x86_64 = $ssse3_x86_64 = $avx_x86_64 = $avx2_x86_64 = '';
if ($opts{arch} eq "x86_64") {
@@ -202,10 +179,10 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
specialize qw/vp9_block_error/;
add_proto qw/int64_t vp9_highbd_block_error/, "const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz, int bd";
- specialize qw/vp9_highbd_block_error/, "$sse2_x86inc";
+ specialize qw/vp9_highbd_block_error sse2/;
add_proto qw/int64_t vp9_highbd_block_error_8bit/, "const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz";
- specialize qw/vp9_highbd_block_error_8bit/, "$sse2_x86inc", "$avx_x86inc";
+ specialize qw/vp9_highbd_block_error_8bit sse2 avx/;
add_proto qw/void vp9_quantize_fp/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
specialize qw/vp9_quantize_fp/;
@@ -217,16 +194,16 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
specialize qw/vp9_fdct8x8_quant/;
} else {
add_proto qw/int64_t vp9_block_error/, "const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz";
- specialize qw/vp9_block_error avx2 msa/, "$sse2_x86inc";
+ specialize qw/vp9_block_error avx2 msa sse2/;
add_proto qw/int64_t vp9_block_error_fp/, "const int16_t *coeff, const int16_t *dqcoeff, int block_size";
- specialize qw/vp9_block_error_fp neon/, "$sse2_x86inc";
+ specialize qw/vp9_block_error_fp neon sse2/;
add_proto qw/void vp9_quantize_fp/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
- specialize qw/vp9_quantize_fp neon sse2/, "$ssse3_x86_64_x86inc";
+ specialize qw/vp9_quantize_fp neon sse2/, "$ssse3_x86_64";
add_proto qw/void vp9_quantize_fp_32x32/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
- specialize qw/vp9_quantize_fp_32x32/, "$ssse3_x86_64_x86inc";
+ specialize qw/vp9_quantize_fp_32x32/, "$ssse3_x86_64";
add_proto qw/void vp9_fdct8x8_quant/, "const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
specialize qw/vp9_fdct8x8_quant sse2 ssse3 neon/;
@@ -245,7 +222,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
specialize qw/vp9_fht16x16 sse2/;
add_proto qw/void vp9_fwht4x4/, "const int16_t *input, tran_low_t *output, int stride";
- specialize qw/vp9_fwht4x4/, "$sse2_x86inc";
+ specialize qw/vp9_fwht4x4 sse2/;
} else {
add_proto qw/void vp9_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
specialize qw/vp9_fht4x4 sse2 msa/;
@@ -257,7 +234,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
specialize qw/vp9_fht16x16 sse2 msa/;
add_proto qw/void vp9_fwht4x4/, "const int16_t *input, tran_low_t *output, int stride";
- specialize qw/vp9_fwht4x4 msa/, "$sse2_x86inc";
+ specialize qw/vp9_fwht4x4 msa sse2/;
}
#
diff --git a/vp9/decoder/vp9_decodeframe.c b/vp9/decoder/vp9_decodeframe.c
index d63912932..3199b98aa 100644
--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -589,7 +589,7 @@ static void dec_build_inter_predictors(VPxWorker *const worker, MACROBLOCKD *xd,
// Co-ordinate of containing block to pixel precision.
int x_start = (-xd->mb_to_left_edge >> (3 + pd->subsampling_x));
int y_start = (-xd->mb_to_top_edge >> (3 + pd->subsampling_y));
-#if CONFIG_BETTER_HW_COMPATIBILITY
+#if 0 // CONFIG_BETTER_HW_COMPATIBILITY
assert(xd->mi[0]->sb_type != BLOCK_4X8 &&
xd->mi[0]->sb_type != BLOCK_8X4);
assert(mv_q4.row == mv->row * (1 << (1 - pd->subsampling_y)) &&
diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c
index ffc6839ad..6869036bc 100644
--- a/vp9/decoder/vp9_decodemv.c
+++ b/vp9/decoder/vp9_decodemv.c
@@ -902,10 +902,10 @@ void vp9_read_mode_info(VP9Decoder *const pbi, MACROBLOCKD *xd,
frame_mvs += cm->mi_cols;
}
}
-#if CONFIG_BETTER_HW_COMPATIBILITY && CONFIG_VP9_HIGHBITDEPTH
- if ((xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) &&
- (xd->above_mi == NULL || xd->left_mi == NULL) &&
- !is_inter_block(mi) && need_top_left[mi->uv_mode])
- assert(0);
+#if 0 // CONFIG_BETTER_HW_COMPATIBILITY && CONFIG_VP9_HIGHBITDEPTH
+ if ((xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) &&
+ (xd->above_mi == NULL || xd->left_mi == NULL) &&
+ !is_inter_block(mi) && need_top_left[mi->uv_mode])
+ assert(0);
#endif // CONFIG_BETTER_HW_COMPATIBILITY && CONFIG_VP9_HIGHBITDEPTH
}
diff --git a/vp9/decoder/vp9_decoder.c b/vp9/decoder/vp9_decoder.c
index 935c04f3a..9ed980081 100644
--- a/vp9/decoder/vp9_decoder.c
+++ b/vp9/decoder/vp9_decoder.c
@@ -187,47 +187,45 @@ vpx_codec_err_t vp9_copy_reference_dec(VP9Decoder *pbi,
vpx_codec_err_t vp9_set_reference_dec(VP9_COMMON *cm,
VP9_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) {
- RefBuffer *ref_buf = NULL;
- RefCntBuffer *const frame_bufs = cm->buffer_pool->frame_bufs;
+ int idx;
+ YV12_BUFFER_CONFIG *ref_buf = NULL;
// TODO(jkoleszar): The decoder doesn't have any real knowledge of what the
// encoder is using the frame buffers for. This is just a stub to keep the
// vpxenc --test-decode functionality working, and will be replaced in a
// later commit that adds VP9-specific controls for this functionality.
+ // (Yunqing) The set_reference control depends on the following setting in
+ // encoder.
+ // cpi->lst_fb_idx = 0;
+ // cpi->gld_fb_idx = 1;
+ // cpi->alt_fb_idx = 2;
if (ref_frame_flag == VP9_LAST_FLAG) {
- ref_buf = &cm->frame_refs[0];
+ idx = cm->ref_frame_map[0];
} else if (ref_frame_flag == VP9_GOLD_FLAG) {
- ref_buf = &cm->frame_refs[1];
+ idx = cm->ref_frame_map[1];
} else if (ref_frame_flag == VP9_ALT_FLAG) {
- ref_buf = &cm->frame_refs[2];
+ idx = cm->ref_frame_map[2];
} else {
vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
"Invalid reference frame");
return cm->error.error_code;
}
- if (!equal_dimensions(ref_buf->buf, sd)) {
+ if (idx < 0 || idx >= FRAME_BUFFERS) {
vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
- "Incorrect buffer dimensions");
- } else {
- int *ref_fb_ptr = &ref_buf->idx;
-
- // Find an empty frame buffer.
- const int free_fb = get_free_fb(cm);
- if (cm->new_fb_idx == INVALID_IDX) {
- vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
- "Unable to find free frame buffer");
- return cm->error.error_code;
- }
+ "Invalid reference frame map");
+ return cm->error.error_code;
+ }
- // Decrease ref_count since it will be increased again in
- // ref_cnt_fb() below.
- --frame_bufs[free_fb].ref_count;
+ // Get the destination reference buffer.
+ ref_buf = &cm->buffer_pool->frame_bufs[idx].buf;
- // Manage the reference counters and copy image.
- ref_cnt_fb(frame_bufs, ref_fb_ptr, free_fb);
- ref_buf->buf = &frame_bufs[*ref_fb_ptr].buf;
- vp8_yv12_copy_frame(sd, ref_buf->buf);
+ if (!equal_dimensions(ref_buf, sd)) {
+ vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
+ "Incorrect buffer dimensions");
+ } else {
+ // Overwrite the reference frame buffer.
+ vp8_yv12_copy_frame(sd, ref_buf);
}
return cm->error.error_code;
diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c
index 169943c10..05fbc4194 100644
--- a/vp9/encoder/vp9_encodemb.c
+++ b/vp9/encoder/vp9_encodemb.c
@@ -31,6 +31,9 @@ struct optimize_ctx {
ENTROPY_CONTEXT tl[MAX_MB_PLANE][16];
};
+#define HETEROMULT 12
+#define HETEROCOEF 4
+
void vp9_subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
struct macroblock_plane *const p = &x->plane[plane];
const struct macroblockd_plane *const pd = &x->e_mbd.plane[plane];
@@ -67,6 +70,48 @@ static const int plane_rd_mult[REF_TYPES][PLANE_TYPES] ={ {10, 6}, {8, 7}, };
rd_cost1 = RDCOST(rdmult, rddiv, rate1, error1);\
}
+// This function eliminates isolated small nonzero coefficients.
+static void eliminate_small_coeff(const tran_low_t *const coeff_ptr,
+ const TX_SIZE tx_size,
+ const int16_t *const zbin_ptr,
+ tran_low_t *const qcoeff_ptr,
+ tran_low_t *const dqcoeff_ptr,
+ uint16_t *const eob_ptr,
+ const int16_t *const scan) {
+ const int zbins[2] =
+ {tx_size == TX_32X32 ? ROUND_POWER_OF_TWO(zbin_ptr[0], 1) : zbin_ptr[0],
+ tx_size == TX_32X32 ? ROUND_POWER_OF_TWO(zbin_ptr[1], 1) : zbin_ptr[1]};
+ const int nzbins[2] = {zbins[0] * -1, zbins[1] * -1};
+ const int hetero_zbins[2] = {(HETEROCOEF + 1) * zbins[0] / HETEROCOEF,
+ (HETEROCOEF + 1) * zbins[1] / HETEROCOEF};
+ const int hetero_nzbins[2] = {hetero_zbins[0] * -1, hetero_zbins[1] * -1};
+ int eob = *eob_ptr, i = eob - 1, rc, tail_count = 0;
+
+ assert(i >= 0);
+ rc = scan[i];
+ while (i > 0 && coeff_ptr[rc] <= hetero_zbins[rc != 0] &&
+ coeff_ptr[rc] >= hetero_nzbins[rc != 0]) {
+ if (coeff_ptr[rc] > zbins[rc != 0] || coeff_ptr[rc] < nzbins[rc != 0])
+ ++tail_count;
+ if ((eob - i) * HETEROMULT >= tail_count * zbins[1]) {
+ eob = i;
+ tail_count = 0;
+ }
+ --i;
+ rc = scan[i];
+ }
+
+ for (i = eob; i < (*eob_ptr); ++i) {
+ rc = scan[i];
+ qcoeff_ptr[rc] = 0;
+ dqcoeff_ptr[rc] = 0;
+ }
+
+ while (eob > 0 && qcoeff_ptr[scan[eob - 1]] == 0) --eob;
+
+ *eob_ptr = eob;
+}
+
// This function is a place holder for now but may ultimately need
// to scan previous tokens to work out the correct context.
static int trellis_get_coeff_context(const int16_t *scan,
@@ -335,7 +380,7 @@ static INLINE void highbd_fdct32x32(int rd_transform, const int16_t *src,
}
#endif // CONFIG_VP9_HIGHBITDEPTH
-void vp9_xform_quant_fp(MACROBLOCK *x, int plane, int block,
+void vp9_xform_quant_fp(MACROBLOCK *x, int plane, int block, int row, int col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size) {
MACROBLOCKD *const xd = &x->e_mbd;
const struct macroblock_plane *const p = &x->plane[plane];
@@ -346,10 +391,8 @@ void vp9_xform_quant_fp(MACROBLOCK *x, int plane, int block,
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
uint16_t *const eob = &p->eobs[block];
const int diff_stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
- int i, j;
const int16_t *src_diff;
- txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j);
- src_diff = &p->src_diff[4 * (j * diff_stride + i)];
+ src_diff = &p->src_diff[4 * (row * diff_stride + col)];
#if CONFIG_VP9_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
@@ -425,7 +468,7 @@ void vp9_xform_quant_fp(MACROBLOCK *x, int plane, int block,
}
}
-void vp9_xform_quant_dc(MACROBLOCK *x, int plane, int block,
+void vp9_xform_quant_dc(MACROBLOCK *x, int plane, int block, int row, int col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size) {
MACROBLOCKD *const xd = &x->e_mbd;
const struct macroblock_plane *const p = &x->plane[plane];
@@ -435,12 +478,8 @@ void vp9_xform_quant_dc(MACROBLOCK *x, int plane, int block,
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
uint16_t *const eob = &p->eobs[block];
const int diff_stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
- int i, j;
const int16_t *src_diff;
-
- txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j);
- src_diff = &p->src_diff[4 * (j * diff_stride + i)];
-
+ src_diff = &p->src_diff[4 * (row * diff_stride + col)];
#if CONFIG_VP9_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
switch (tx_size) {
@@ -506,7 +545,7 @@ void vp9_xform_quant_dc(MACROBLOCK *x, int plane, int block,
}
}
-void vp9_xform_quant(MACROBLOCK *x, int plane, int block,
+void vp9_xform_quant(MACROBLOCK *x, int plane, int block, int row, int col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size) {
MACROBLOCKD *const xd = &x->e_mbd;
const struct macroblock_plane *const p = &x->plane[plane];
@@ -517,10 +556,8 @@ void vp9_xform_quant(MACROBLOCK *x, int plane, int block,
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
uint16_t *const eob = &p->eobs[block];
const int diff_stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
- int i, j;
const int16_t *src_diff;
- txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j);
- src_diff = &p->src_diff[4 * (j * diff_stride + i)];
+ src_diff = &p->src_diff[4 * (row * diff_stride + col)];
#if CONFIG_VP9_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
@@ -593,9 +630,14 @@ void vp9_xform_quant(MACROBLOCK *x, int plane, int block,
assert(0);
break;
}
+ if (!x->skip_block && *eob > 0) {
+ eliminate_small_coeff(coeff, tx_size, p->zbin, qcoeff, dqcoeff, eob,
+ scan_order->scan);
+ }
}
-static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize,
+static void encode_block(int plane, int block, int row, int col,
+ BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
struct encode_b_args *const args = arg;
MACROBLOCK *const x = args->x;
@@ -604,13 +646,11 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize,
struct macroblock_plane *const p = &x->plane[plane];
struct macroblockd_plane *const pd = &xd->plane[plane];
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
- int i, j;
uint8_t *dst;
ENTROPY_CONTEXT *a, *l;
- txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j);
- dst = &pd->dst.buf[4 * j * pd->dst.stride + 4 * i];
- a = &ctx->ta[plane][i];
- l = &ctx->tl[plane][j];
+ dst = &pd->dst.buf[4 * row * pd->dst.stride + 4 * col];
+ a = &ctx->ta[plane][col];
+ l = &ctx->tl[plane][row];
// TODO(jingning): per transformed block zero forcing only enabled for
// luma component. will integrate chroma components as well.
@@ -629,17 +669,17 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize,
*a = *l = 0;
return;
} else {
- vp9_xform_quant_fp(x, plane, block, plane_bsize, tx_size);
+ vp9_xform_quant_fp(x, plane, block, row, col, plane_bsize, tx_size);
}
} else {
if (max_txsize_lookup[plane_bsize] == tx_size) {
int txfm_blk_index = (plane << 2) + (block >> (tx_size << 1));
if (x->skip_txfm[txfm_blk_index] == SKIP_TXFM_NONE) {
// full forward transform and quantization
- vp9_xform_quant(x, plane, block, plane_bsize, tx_size);
+ vp9_xform_quant(x, plane, block, row, col, plane_bsize, tx_size);
} else if (x->skip_txfm[txfm_blk_index] == SKIP_TXFM_AC_ONLY) {
// fast path forward transform and quantization
- vp9_xform_quant_dc(x, plane, block, plane_bsize, tx_size);
+ vp9_xform_quant_dc(x, plane, block, row, col, plane_bsize, tx_size);
} else {
// skip forward transform
p->eobs[block] = 0;
@@ -647,7 +687,7 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize,
return;
}
} else {
- vp9_xform_quant(x, plane, block, plane_bsize, tx_size);
+ vp9_xform_quant(x, plane, block, row, col, plane_bsize, tx_size);
}
}
}
@@ -715,19 +755,18 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize,
}
}
-static void encode_block_pass1(int plane, int block, BLOCK_SIZE plane_bsize,
+static void encode_block_pass1(int plane, int block, int row, int col,
+ BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
MACROBLOCK *const x = (MACROBLOCK *)arg;
MACROBLOCKD *const xd = &x->e_mbd;
struct macroblock_plane *const p = &x->plane[plane];
struct macroblockd_plane *const pd = &xd->plane[plane];
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
- int i, j;
uint8_t *dst;
- txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j);
- dst = &pd->dst.buf[4 * j * pd->dst.stride + 4 * i];
+ dst = &pd->dst.buf[4 * row * pd->dst.stride + 4 * col];
- vp9_xform_quant(x, plane, block, plane_bsize, tx_size);
+ vp9_xform_quant(x, plane, block, row, col, plane_bsize, tx_size);
if (p->eobs[block] > 0) {
#if CONFIG_VP9_HIGHBITDEPTH
@@ -774,7 +813,8 @@ void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) {
}
}
-void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
+void vp9_encode_block_intra(int plane, int block, int row, int col,
+ BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
struct encode_b_args* const args = arg;
MACROBLOCK *const x = args->x;
@@ -795,18 +835,16 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
uint16_t *eob = &p->eobs[block];
const int src_stride = p->src.stride;
const int dst_stride = pd->dst.stride;
- int i, j;
struct optimize_ctx *const ctx = args->ctx;
ENTROPY_CONTEXT *a = NULL;
ENTROPY_CONTEXT *l = NULL;
int entropy_ctx = 0;
- txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j);
- dst = &pd->dst.buf[4 * (j * dst_stride + i)];
- src = &p->src.buf[4 * (j * src_stride + i)];
- src_diff = &p->src_diff[4 * (j * diff_stride + i)];
+ dst = &pd->dst.buf[4 * (row * dst_stride + col)];
+ src = &p->src.buf[4 * (row * src_stride + col)];
+ src_diff = &p->src_diff[4 * (row * diff_stride + col)];
if (args->ctx != NULL) {
- a = &ctx->ta[plane][i];
- l = &ctx->tl[plane][j];
+ a = &ctx->ta[plane][col];
+ l = &ctx->tl[plane][row];
entropy_ctx = combine_entropy_contexts(*a, *l);
}
@@ -826,7 +864,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
vp9_predict_intra_block(xd, bwl, tx_size, mode, x->skip_encode ? src : dst,
x->skip_encode ? src_stride : dst_stride,
- dst, dst_stride, i, j, plane);
+ dst, dst_stride, col, row, plane);
#if CONFIG_VP9_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
@@ -926,6 +964,10 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
p->quant, p->quant_shift, qcoeff, dqcoeff,
pd->dequant, eob, scan_order->scan,
scan_order->iscan);
+ if (!x->skip_block && *eob > 0) {
+ eliminate_small_coeff(coeff, tx_size, p->zbin, qcoeff, dqcoeff,
+ eob, scan_order->scan);
+ }
}
if (args->ctx != NULL && !x->skip_recode) {
*a = *l = optimize_b(x, plane, block, tx_size, entropy_ctx) > 0;
@@ -942,6 +984,10 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
p->quant, p->quant_shift, qcoeff, dqcoeff,
pd->dequant, eob, scan_order->scan,
scan_order->iscan);
+ if (!x->skip_block && *eob > 0) {
+ eliminate_small_coeff(coeff, tx_size, p->zbin, qcoeff, dqcoeff,
+ eob, scan_order->scan);
+ }
}
if (args->ctx != NULL && !x->skip_recode) {
*a = *l = optimize_b(x, plane, block, tx_size, entropy_ctx) > 0;
@@ -958,6 +1004,10 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
p->quant_shift, qcoeff, dqcoeff,
pd->dequant, eob, scan_order->scan,
scan_order->iscan);
+ if (!x->skip_block && *eob > 0) {
+ eliminate_small_coeff(coeff, tx_size, p->zbin, qcoeff, dqcoeff,
+ eob, scan_order->scan);
+ }
}
if (args->ctx != NULL && !x->skip_recode) {
*a = *l = optimize_b(x, plane, block, tx_size, entropy_ctx) > 0;
@@ -977,6 +1027,10 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
p->quant_shift, qcoeff, dqcoeff,
pd->dequant, eob, scan_order->scan,
scan_order->iscan);
+ if (!x->skip_block && *eob > 0) {
+ eliminate_small_coeff(coeff, tx_size, p->zbin, qcoeff, dqcoeff,
+ eob, scan_order->scan);
+ }
}
if (args->ctx != NULL && !x->skip_recode) {
*a = *l = optimize_b(x, plane, block, tx_size, entropy_ctx) > 0;
diff --git a/vp9/encoder/vp9_encodemb.h b/vp9/encoder/vp9_encodemb.h
index 25b0b23e0..62d75a129 100644
--- a/vp9/encoder/vp9_encodemb.h
+++ b/vp9/encoder/vp9_encodemb.h
@@ -25,16 +25,17 @@ struct encode_b_args {
};
void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize);
void vp9_encode_sby_pass1(MACROBLOCK *x, BLOCK_SIZE bsize);
-void vp9_xform_quant_fp(MACROBLOCK *x, int plane, int block,
+void vp9_xform_quant_fp(MACROBLOCK *x, int plane, int block, int row, int col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size);
-void vp9_xform_quant_dc(MACROBLOCK *x, int plane, int block,
+void vp9_xform_quant_dc(MACROBLOCK *x, int plane, int block, int row, int col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size);
-void vp9_xform_quant(MACROBLOCK *x, int plane, int block,
+void vp9_xform_quant(MACROBLOCK *x, int plane, int block, int row, int col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size);
void vp9_subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane);
-void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
+void vp9_encode_block_intra(int plane, int block, int row, int col,
+ BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg);
void vp9_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane,
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index 53a3ec7de..66ccc92c4 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -506,10 +506,10 @@ static int get_ul_intra_threshold(VP9_COMMON *cm) {
ret_val = UL_INTRA_THRESH;
break;
case VPX_BITS_10:
- ret_val = UL_INTRA_THRESH >> 2;
+ ret_val = UL_INTRA_THRESH << 2;
break;
case VPX_BITS_12:
- ret_val = UL_INTRA_THRESH >> 4;
+ ret_val = UL_INTRA_THRESH << 4;
break;
default:
assert(0 && "cm->bit_depth should be VPX_BITS_8, "
@@ -532,10 +532,10 @@ static int get_smooth_intra_threshold(VP9_COMMON *cm) {
ret_val = SMOOTH_INTRA_THRESH;
break;
case VPX_BITS_10:
- ret_val = SMOOTH_INTRA_THRESH >> 2;
+ ret_val = SMOOTH_INTRA_THRESH << 4;
break;
case VPX_BITS_12:
- ret_val = SMOOTH_INTRA_THRESH >> 4;
+ ret_val = SMOOTH_INTRA_THRESH << 8;
break;
default:
assert(0 && "cm->bit_depth should be VPX_BITS_8, "
diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c
index 7db6ef2b0..5ccadd005 100644
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -932,7 +932,8 @@ struct estimate_block_intra_args {
RD_COST *rdc;
};
-static void estimate_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
+static void estimate_block_intra(int plane, int block, int row, int col,
+ BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
struct estimate_block_intra_args* const args = arg;
VP9_COMP *const cpi = args->cpi;
@@ -945,20 +946,19 @@ static void estimate_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
uint8_t *const dst_buf_base = pd->dst.buf;
const int src_stride = p->src.stride;
const int dst_stride = pd->dst.stride;
- int i, j;
RD_COST this_rdc;
- txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j);
+ (void)block;
- p->src.buf = &src_buf_base[4 * (j * src_stride + i)];
- pd->dst.buf = &dst_buf_base[4 * (j * dst_stride + i)];
+ p->src.buf = &src_buf_base[4 * (row * src_stride + col)];
+ pd->dst.buf = &dst_buf_base[4 * (row * dst_stride + col)];
// Use source buffer as an approximation for the fully reconstructed buffer.
vp9_predict_intra_block(xd, b_width_log2_lookup[plane_bsize],
tx_size, args->mode,
x->skip_encode ? p->src.buf : pd->dst.buf,
x->skip_encode ? src_stride : dst_stride,
pd->dst.buf, dst_stride,
- i, j, plane);
+ col, row, plane);
if (plane == 0) {
int64_t this_sse = INT64_MAX;
@@ -1744,7 +1744,8 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
#if CONFIG_VP9_HIGHBITDEPTH
const int large_block = bsize > BLOCK_32X32;
#else
- const int large_block = bsize >= BLOCK_32X32;
+ const int large_block =
+ x->sb_is_skin ? bsize > BLOCK_32X32 : bsize >= BLOCK_32X32;
#endif
mi->interp_filter = (filter_ref == SWITCHABLE) ? EIGHTTAP : filter_ref;
vp9_build_inter_predictors_sby(xd, mi_row, mi_col, bsize);
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 6e4ffee92..28530386c 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -498,18 +498,16 @@ static void dist_block(MACROBLOCK *x, int plane, int block, TX_SIZE tx_size,
}
}
-static int rate_block(int plane, int block, BLOCK_SIZE plane_bsize,
+static int rate_block(int plane, int block, int row, int col,
TX_SIZE tx_size, struct rdcost_block_args* args) {
- int x_idx, y_idx;
- txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &x_idx, &y_idx);
-
- return cost_coeffs(args->x, plane, block, args->t_above + x_idx,
- args->t_left + y_idx, tx_size,
+ return cost_coeffs(args->x, plane, block, args->t_above + col,
+ args->t_left + row, tx_size,
args->so->scan, args->so->neighbors,
args->use_fast_coef_costing);
}
-static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize,
+static void block_rd_txfm(int plane, int block, int row, int col,
+ BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
struct rdcost_block_args *args = arg;
MACROBLOCK *const x = args->x;
@@ -525,20 +523,20 @@ static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize,
if (!is_inter_block(mi)) {
struct encode_b_args arg = {x, NULL, &mi->skip};
- vp9_encode_block_intra(plane, block, plane_bsize, tx_size, &arg);
+ vp9_encode_block_intra(plane, block, row, col, plane_bsize, tx_size, &arg);
dist_block(x, plane, block, tx_size, &dist, &sse);
} else if (max_txsize_lookup[plane_bsize] == tx_size) {
if (x->skip_txfm[(plane << 2) + (block >> (tx_size << 1))] ==
SKIP_TXFM_NONE) {
// full forward transform and quantization
- vp9_xform_quant(x, plane, block, plane_bsize, tx_size);
+ vp9_xform_quant(x, plane, block, row, col, plane_bsize, tx_size);
dist_block(x, plane, block, tx_size, &dist, &sse);
} else if (x->skip_txfm[(plane << 2) + (block >> (tx_size << 1))] ==
SKIP_TXFM_AC_ONLY) {
// compute DC coefficient
tran_low_t *const coeff = BLOCK_OFFSET(x->plane[plane].coeff, block);
tran_low_t *const dqcoeff = BLOCK_OFFSET(xd->plane[plane].dqcoeff, block);
- vp9_xform_quant_dc(x, plane, block, plane_bsize, tx_size);
+ vp9_xform_quant_dc(x, plane, block, row, col, plane_bsize, tx_size);
sse = x->bsse[(plane << 2) + (block >> (tx_size << 1))] << 4;
dist = sse;
if (x->plane[plane].eobs[block]) {
@@ -562,7 +560,7 @@ static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize,
}
} else {
// full forward transform and quantization
- vp9_xform_quant(x, plane, block, plane_bsize, tx_size);
+ vp9_xform_quant(x, plane, block, row, col, plane_bsize, tx_size);
dist_block(x, plane, block, tx_size, &dist, &sse);
}
@@ -572,7 +570,7 @@ static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize,
return;
}
- rate = rate_block(plane, block, plane_bsize, tx_size, args);
+ rate = rate_block(plane, block, row, col, tx_size, args);
rd1 = RDCOST(x->rdmult, x->rddiv, rate, dist);
rd2 = RDCOST(x->rdmult, x->rddiv, 0, sse);
@@ -2465,9 +2463,9 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
if (pred_filter_search) {
INTERP_FILTER af = SWITCHABLE, lf = SWITCHABLE;
- if (xd->above_mi)
+ if (xd->above_mi && is_inter_block(xd->above_mi))
af = xd->above_mi->interp_filter;
- if (xd->left_mi)
+ if (xd->left_mi && is_inter_block(xd->left_mi))
lf = xd->left_mi->interp_filter;
if ((this_mode != NEWMV) || (af == lf))
diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c
index edec755dd..4400da42d 100644
--- a/vp9/encoder/vp9_tokenize.c
+++ b/vp9/encoder/vp9_tokenize.c
@@ -319,7 +319,8 @@ struct tokenize_b_args {
TOKENEXTRA **tp;
};
-static void set_entropy_context_b(int plane, int block, BLOCK_SIZE plane_bsize,
+static void set_entropy_context_b(int plane, int block, int row, int col,
+ BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
struct tokenize_b_args* const args = arg;
ThreadData *const td = args->td;
@@ -327,10 +328,8 @@ static void set_entropy_context_b(int plane, int block, BLOCK_SIZE plane_bsize,
MACROBLOCKD *const xd = &x->e_mbd;
struct macroblock_plane *p = &x->plane[plane];
struct macroblockd_plane *pd = &xd->plane[plane];
- int aoff, loff;
- txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &aoff, &loff);
vp9_set_contexts(xd, pd, plane_bsize, tx_size, p->eobs[block] > 0,
- aoff, loff);
+ col, row);
}
static INLINE void add_token(TOKENEXTRA **t, const vpx_prob *context_tree,
@@ -353,7 +352,8 @@ static INLINE void add_token_no_extra(TOKENEXTRA **t,
++counts[token];
}
-static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
+static void tokenize_b(int plane, int block, int row, int col,
+ BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
struct tokenize_b_args* const args = arg;
VP9_COMP *cpi = args->cpi;
@@ -384,11 +384,8 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
const int tx_eob = 16 << (tx_size << 1);
int16_t token;
EXTRABIT extra;
- int aoff, loff;
- txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &aoff, &loff);
-
- pt = get_entropy_context(tx_size, pd->above_context + aoff,
- pd->left_context + loff);
+ pt = get_entropy_context(tx_size, pd->above_context + col,
+ pd->left_context + row);
so = get_scan(xd, tx_size, type, block);
scan = so->scan;
nb = so->neighbors;
@@ -426,20 +423,23 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
*tp = t;
- vp9_set_contexts(xd, pd, plane_bsize, tx_size, c > 0, aoff, loff);
+ vp9_set_contexts(xd, pd, plane_bsize, tx_size, c > 0, col, row);
}
struct is_skippable_args {
uint16_t *eobs;
int *skippable;
};
-static void is_skippable(int plane, int block,
+
+static void is_skippable(int plane, int block, int row, int col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
void *argv) {
struct is_skippable_args *args = argv;
(void)plane;
(void)plane_bsize;
(void)tx_size;
+ (void)row;
+ (void)col;
args->skippable[0] &= (!args->eobs[block]);
}
@@ -453,14 +453,15 @@ int vp9_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
return result;
}
-static void has_high_freq_coeff(int plane, int block,
+static void has_high_freq_coeff(int plane, int block, int row, int col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
void *argv) {
struct is_skippable_args *args = argv;
int eobs = (tx_size == TX_4X4) ? 3 : 10;
(void) plane;
(void) plane_bsize;
-
+ (void) row;
+ (void) col;
*(args->skippable) |= (args->eobs[block] > eobs);
}
diff --git a/vp9/encoder/x86/vp9_dct_ssse3.c b/vp9/encoder/x86/vp9_dct_ssse3.c
index b09eac0d1..1a1d4eabc 100644
--- a/vp9/encoder/x86/vp9_dct_ssse3.c
+++ b/vp9/encoder/x86/vp9_dct_ssse3.c
@@ -9,11 +9,6 @@
*/
#include <assert.h>
-#if defined(_MSC_VER) && _MSC_VER <= 1500
-// Need to include math.h before calling tmmintrin.h/intrin.h
-// in certain versions of MSVS.
-#include <math.h>
-#endif
#include <tmmintrin.h> // SSSE3
#include "./vp9_rtcd.h"
diff --git a/vp9/encoder/x86/vp9_frame_scale_ssse3.c b/vp9/encoder/x86/vp9_frame_scale_ssse3.c
index 38af3b13a..23325d63b 100644
--- a/vp9/encoder/x86/vp9_frame_scale_ssse3.c
+++ b/vp9/encoder/x86/vp9_frame_scale_ssse3.c
@@ -8,11 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#if defined(_MSC_VER) && _MSC_VER <= 1500
-// Need to include math.h before calling tmmintrin.h/intrin.h
-// in certain versions of MSVS.
-#include <math.h>
-#endif
#include <tmmintrin.h> // SSSE3
#include "./vp9_rtcd.h"
diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c
index 9ad86cbf8..51c6fbb02 100644
--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -105,19 +105,6 @@ struct vpx_codec_alg_priv {
BufferPool *buffer_pool;
};
-static VP9_REFFRAME ref_frame_to_vp9_reframe(vpx_ref_frame_type_t frame) {
- switch (frame) {
- case VP8_LAST_FRAME:
- return VP9_LAST_FLAG;
- case VP8_GOLD_FRAME:
- return VP9_GOLD_FLAG;
- case VP8_ALTR_FRAME:
- return VP9_ALT_FLAG;
- }
- assert(0 && "Invalid Reference Frame");
- return VP9_LAST_FLAG;
-}
-
static vpx_codec_err_t update_error_state(vpx_codec_alg_priv_t *ctx,
const struct vpx_internal_error_info *error) {
const vpx_codec_err_t res = error->error_code;
diff --git a/vp9/vp9_dx_iface.c b/vp9/vp9_dx_iface.c
index 6531e2c61..08adea026 100644
--- a/vp9/vp9_dx_iface.c
+++ b/vp9/vp9_dx_iface.c
@@ -785,7 +785,8 @@ static vpx_codec_err_t ctrl_set_reference(vpx_codec_alg_priv_t *ctx,
FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
image2yuvconfig(&frame->img, &sd);
return vp9_set_reference_dec(&frame_worker_data->pbi->common,
- (VP9_REFFRAME)frame->frame_type, &sd);
+ ref_frame_to_vp9_reframe(frame->frame_type),
+ &sd);
} else {
return VPX_CODEC_INVALID_PARAM;
}
diff --git a/vp9/vp9_iface_common.h b/vp9/vp9_iface_common.h
index 938d4224b..44a5e8157 100644
--- a/vp9/vp9_iface_common.h
+++ b/vp9/vp9_iface_common.h
@@ -133,4 +133,16 @@ static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
return VPX_CODEC_OK;
}
+static VP9_REFFRAME ref_frame_to_vp9_reframe(vpx_ref_frame_type_t frame) {
+ switch (frame) {
+ case VP8_LAST_FRAME:
+ return VP9_LAST_FLAG;
+ case VP8_GOLD_FRAME:
+ return VP9_GOLD_FLAG;
+ case VP8_ALTR_FRAME:
+ return VP9_ALT_FLAG;
+ }
+ assert(0 && "Invalid Reference Frame");
+ return VP9_LAST_FLAG;
+}
#endif // VP9_VP9_IFACE_COMMON_H_
diff --git a/vp9/vp9cx.mk b/vp9/vp9cx.mk
index 5f3de8f8a..b8342b9e1 100644
--- a/vp9/vp9cx.mk
+++ b/vp9/vp9cx.mk
@@ -101,7 +101,6 @@ ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_highbd_block_error_intrin_sse2.c
endif
-ifeq ($(CONFIG_USE_X86INC),yes)
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_dct_sse2.asm
ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_highbd_error_sse2.asm
@@ -109,13 +108,10 @@ VP9_CX_SRCS-$(HAVE_AVX) += encoder/x86/vp9_highbd_error_avx.asm
else
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_error_sse2.asm
endif
-endif
ifeq ($(ARCH_X86_64),yes)
-ifeq ($(CONFIG_USE_X86INC),yes)
VP9_CX_SRCS-$(HAVE_SSSE3) += encoder/x86/vp9_quantize_ssse3_x86_64.asm
endif
-endif
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_dct_intrin_sse2.c
VP9_CX_SRCS-$(HAVE_SSSE3) += encoder/x86/vp9_dct_ssse3.c