Commit 73301080 authored by Yaowu Xu's avatar Yaowu Xu

Merge branch 'master' into nextgenv2

parents ec36a2b0 8f8a3b6a
......@@ -702,18 +702,6 @@ INSTANTIATE_TEST_CASE_P(MMX, SADTest, ::testing::ValuesIn(mmx_tests));
#if HAVE_SSE
#if CONFIG_USE_X86INC
const SadMxNParam sse_tests[] = {
make_tuple(4, 8, &vpx_sad4x8_sse, -1),
make_tuple(4, 4, &vpx_sad4x4_sse, -1),
};
INSTANTIATE_TEST_CASE_P(SSE, SADTest, ::testing::ValuesIn(sse_tests));
const SadMxNAvgParam avg_sse_tests[] = {
make_tuple(4, 8, &vpx_sad4x8_avg_sse, -1),
make_tuple(4, 4, &vpx_sad4x4_avg_sse, -1),
};
INSTANTIATE_TEST_CASE_P(SSE, SADavgTest, ::testing::ValuesIn(avg_sse_tests));
const SadMxNx4Param x4d_sse_tests[] = {
make_tuple(4, 8, &vpx_sad4x8x4d_sse, -1),
make_tuple(4, 4, &vpx_sad4x4x4d_sse, -1),
......@@ -736,6 +724,8 @@ const SadMxNParam sse2_tests[] = {
make_tuple(8, 16, &vpx_sad8x16_sse2, -1),
make_tuple(8, 8, &vpx_sad8x8_sse2, -1),
make_tuple(8, 4, &vpx_sad8x4_sse2, -1),
make_tuple(4, 8, &vpx_sad4x8_sse2, -1),
make_tuple(4, 4, &vpx_sad4x4_sse2, -1),
#if CONFIG_VP9_HIGHBITDEPTH
make_tuple(64, 64, &vpx_highbd_sad64x64_sse2, 8),
make_tuple(64, 32, &vpx_highbd_sad64x32_sse2, 8),
......@@ -786,6 +776,8 @@ const SadMxNAvgParam avg_sse2_tests[] = {
make_tuple(8, 16, &vpx_sad8x16_avg_sse2, -1),
make_tuple(8, 8, &vpx_sad8x8_avg_sse2, -1),
make_tuple(8, 4, &vpx_sad8x4_avg_sse2, -1),
make_tuple(4, 8, &vpx_sad4x8_avg_sse2, -1),
make_tuple(4, 4, &vpx_sad4x4_avg_sse2, -1),
#if CONFIG_VP9_HIGHBITDEPTH
make_tuple(64, 64, &vpx_highbd_sad64x64_avg_sse2, 8),
make_tuple(64, 32, &vpx_highbd_sad64x32_avg_sse2, 8),
......
......@@ -1228,10 +1228,6 @@ static void setup_quantization(VP10_COMMON *const cm,
cm->uv_dc_delta_q = read_delta_q(rb);
cm->uv_ac_delta_q = read_delta_q(rb);
cm->dequant_bit_depth = cm->bit_depth;
#if CONFIG_VP9_HIGHBITDEPTH
xd->bd = (int)cm->bit_depth;
#endif
}
static void setup_segmentation_dequant(VP10_COMMON *const cm) {
......@@ -2157,6 +2153,10 @@ static size_t read_uncompressed_header(VP10Decoder *pbi,
setup_loopfilter(&cm->lf, rb);
setup_quantization(cm, rb);
#if CONFIG_VP9_HIGHBITDEPTH
xd->bd = (int)cm->bit_depth;
#endif
setup_segmentation(cm, rb);
{
......
......@@ -680,9 +680,13 @@ static int choose_partitioning(VP9_COMP *cpi,
int64_t thresholds[4] = {cpi->vbp_thresholds[0], cpi->vbp_thresholds[1],
cpi->vbp_thresholds[2], cpi->vbp_thresholds[3]};
// For the variance computation under SVC mode, we treat the frame as key if
// the reference (base layer frame) is key frame (i.e., is_key_frame == 1).
const int is_key_frame = (cm->frame_type == KEY_FRAME ||
(is_one_pass_cbr_svc(cpi) &&
cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame));
// Always use 4x4 partition for key frame.
const int is_key_frame = (cm->frame_type == KEY_FRAME);
const int use_4x4_partition = is_key_frame;
const int use_4x4_partition = cm->frame_type == KEY_FRAME;
const int low_res = (cm->width <= 352 && cm->height <= 288);
int variance4x4downsample[16];
......@@ -708,8 +712,7 @@ static int choose_partitioning(VP9_COMP *cpi,
s = x->plane[0].src.buf;
sp = x->plane[0].src.stride;
if (!is_key_frame && !(is_one_pass_cbr_svc(cpi) &&
cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame)) {
if (!is_key_frame) {
// In the case of spatial/temporal scalable coding, the assumption here is
// that the temporal reference frame will always be of type LAST_FRAME.
// TODO(marpan): If that assumption is broken, we need to revisit this code.
......@@ -868,9 +871,7 @@ static int choose_partitioning(VP9_COMP *cpi,
}
}
}
// TODO(marpan): There is an issue with variance based on 4x4 average in
// svc mode, don't allow it for now.
if (is_key_frame || (low_res && !cpi->use_svc &&
if (is_key_frame || (low_res &&
vt.split[i].split[j].part_variances.none.variance >
(thresholds[1] << 1))) {
force_split[split_index] = 0;
......@@ -892,7 +893,6 @@ static int choose_partitioning(VP9_COMP *cpi,
}
}
}
// Fill the rest of the variance tree by summing split partition values.
avg_32x32 = 0;
for (i = 0; i < 4; i++) {
......@@ -937,7 +937,7 @@ static int choose_partitioning(VP9_COMP *cpi,
// If variance of this 64x64 block is above (some threshold of) the average
// variance over the sub-32x32 blocks, then force this block to split.
if (!is_key_frame &&
vt.part_variances.none.variance > (3 * avg_32x32) >> 3)
vt.part_variances.none.variance > (5 * avg_32x32) >> 4)
force_split[0] = 1;
}
......
......@@ -990,10 +990,10 @@ add_proto qw/unsigned int vpx_sad8x4/, "const uint8_t *src_ptr, int src_stride,
specialize qw/vpx_sad8x4 msa/, "$sse2_x86inc";
add_proto qw/unsigned int vpx_sad4x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride";
specialize qw/vpx_sad4x8 msa/, "$sse_x86inc";
specialize qw/vpx_sad4x8 msa/, "$sse2_x86inc";
add_proto qw/unsigned int vpx_sad4x4/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride";
specialize qw/vpx_sad4x4 mmx neon msa/, "$sse_x86inc";
specialize qw/vpx_sad4x4 mmx neon msa/, "$sse2_x86inc";
#
# Avg
......@@ -1061,10 +1061,10 @@ add_proto qw/unsigned int vpx_sad8x4_avg/, "const uint8_t *src_ptr, int src_stri
specialize qw/vpx_sad8x4_avg msa/, "$sse2_x86inc";
add_proto qw/unsigned int vpx_sad4x8_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred";
specialize qw/vpx_sad4x8_avg msa/, "$sse_x86inc";
specialize qw/vpx_sad4x8_avg msa/, "$sse2_x86inc";
add_proto qw/unsigned int vpx_sad4x4_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred";
specialize qw/vpx_sad4x4_avg msa/, "$sse_x86inc";
specialize qw/vpx_sad4x4_avg msa/, "$sse2_x86inc";
#
# Multi-block SAD, comparing a reference to N blocks 1 pixel apart horizontally
......
......@@ -222,8 +222,8 @@ SAD8XN 16, 1 ; sad8x16_avg_sse2
SAD8XN 8, 1 ; sad8x8_avg_sse2
SAD8XN 4, 1 ; sad8x4_avg_sse2
; unsigned int vpx_sad4x{4, 8}_sse(uint8_t *src, int src_stride,
; uint8_t *ref, int ref_stride);
; unsigned int vpx_sad4x{4, 8}_sse2(uint8_t *src, int src_stride,
; uint8_t *ref, int ref_stride);
%macro SAD4XN 1-2 0
SAD_FN 4, %1, 7, %2
mov n_rowsd, %1/4
......@@ -236,10 +236,10 @@ SAD8XN 4, 1 ; sad8x4_avg_sse2
movd m4, [refq+ref_stride3q]
punpckldq m1, m2
punpckldq m3, m4
movlhps m1, m3
%if %2 == 1
pavgb m1, [second_predq+mmsize*0]
pavgb m3, [second_predq+mmsize*1]
lea second_predq, [second_predq+mmsize*2]
lea second_predq, [second_predq+mmsize*1]
%endif
movd m2, [srcq]
movd m5, [srcq+src_strideq]
......@@ -247,20 +247,21 @@ SAD8XN 4, 1 ; sad8x4_avg_sse2
movd m6, [srcq+src_stride3q]
punpckldq m2, m5
punpckldq m4, m6
movlhps m2, m4
psadbw m1, m2
psadbw m3, m4
lea refq, [refq+ref_strideq*4]
paddd m0, m1
lea srcq, [srcq+src_strideq*4]
paddd m0, m3
dec n_rowsd
jg .loop
movhlps m1, m0
paddd m0, m1
movd eax, m0
RET
%endmacro
INIT_MMX sse
INIT_XMM sse2
SAD4XN 8 ; sad4x8_sse
SAD4XN 4 ; sad4x4_sse
SAD4XN 8, 1 ; sad4x8_avg_sse
......
......@@ -2060,9 +2060,11 @@ int main(int argc, const char **argv_) {
#if !CONFIG_WEBM_IO
FOREACH_STREAM({
stream->config.write_webm = 0;
warn("vpxenc was compiled without WebM container support."
"Producing IVF output");
if (stream->config.write_webm) {
stream->config.write_webm = 0;
warn("vpxenc was compiled without WebM container support."
"Producing IVF output");
}
});
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment