summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/dct32x32_test.cc4
-rw-r--r--vp9/encoder/vp9_encoder.c1
-rw-r--r--vp9/encoder/vp9_ratectrl.c10
-rw-r--r--vp9/encoder/vp9_ratectrl.h1
-rw-r--r--vpx_dsp/avg.c12
-rw-r--r--vpx_dsp/vpx_dsp_rtcd_defs.pl14
6 files changed, 24 insertions, 18 deletions
diff --git a/test/dct32x32_test.cc b/test/dct32x32_test.cc
index 2a9942e80..1cbac5c63 100644
--- a/test/dct32x32_test.cc
+++ b/test/dct32x32_test.cc
@@ -402,7 +402,7 @@ INSTANTIATE_TEST_CASE_P(C, PartialTrans32x32Test,
VPX_BITS_8)));
#endif // CONFIG_VP9_HIGHBITDEPTH
-#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
+#if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
NEON, Trans32x32Test,
::testing::Values(
@@ -410,7 +410,7 @@ INSTANTIATE_TEST_CASE_P(
&vpx_idct32x32_1024_add_neon, 0, VPX_BITS_8),
make_tuple(&vpx_fdct32x32_rd_c,
&vpx_idct32x32_1024_add_neon, 1, VPX_BITS_8)));
-#endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
+#endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index 69445af64..4e5377889 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -1687,6 +1687,7 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf,
cpi->common.buffer_pool = pool;
cpi->rc.high_source_sad = 0;
+ cpi->rc.count_last_scene_change = 0;
init_config(cpi, oxcf);
vp9_rc_init(&cpi->oxcf, oxcf->pass, &cpi->rc);
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c
index e06d56be4..dab7f6730 100644
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -835,8 +835,8 @@ static int get_active_cq_level_two_pass(
int active_cq_level = oxcf->cq_level;
if (oxcf->rc_mode == VPX_CQ) {
if (twopass->mb_smooth_pct > SMOOTH_PCT_MIN) {
- active_cq_level -= (twopass->mb_smooth_pct - SMOOTH_PCT_MIN) /
- SMOOTH_PCT_DIV;
+ active_cq_level -= (int)((twopass->mb_smooth_pct - SMOOTH_PCT_MIN) /
+ SMOOTH_PCT_DIV);
active_cq_level = VPXMAX(active_cq_level, 0);
}
if (rc->total_target_bits > 0) {
@@ -2084,10 +2084,11 @@ void vp9_avg_source_sad(VP9_COMP *cpi) {
else
rc->high_source_sad = 0;
if (avg_sad > 0 || cpi->oxcf.rc_mode == VPX_CBR)
- rc->avg_source_sad = (rc->avg_source_sad + avg_sad) >> 1;
+ rc->avg_source_sad = (3 * rc->avg_source_sad + avg_sad) >> 2;
// For VBR, under scene change/high content change, force golden refresh.
if (cpi->oxcf.rc_mode == VPX_VBR &&
rc->high_source_sad &&
+ rc->count_last_scene_change > 4 &&
cpi->ext_refresh_frame_flags_pending == 0) {
int target;
cpi->refresh_golden_frame = 1;
@@ -2099,6 +2100,9 @@ void vp9_avg_source_sad(VP9_COMP *cpi) {
rc->frames_till_gf_update_due = rc->frames_to_key;
target = calc_pframe_target_size_one_pass_vbr(cpi);
vp9_rc_set_frame_target(cpi, target);
+ rc->count_last_scene_change = 0;
+ } else {
+ rc->count_last_scene_change++;
}
}
}
diff --git a/vp9/encoder/vp9_ratectrl.h b/vp9/encoder/vp9_ratectrl.h
index 3df909cb1..4cd4b12ab 100644
--- a/vp9/encoder/vp9_ratectrl.h
+++ b/vp9/encoder/vp9_ratectrl.h
@@ -161,6 +161,7 @@ typedef struct {
uint64_t avg_source_sad;
int high_source_sad;
+ int count_last_scene_change;
} RATE_CONTROL;
struct VP9_COMP;
diff --git a/vpx_dsp/avg.c b/vpx_dsp/avg.c
index 26fe7859a..a44c52e8d 100644
--- a/vpx_dsp/avg.c
+++ b/vpx_dsp/avg.c
@@ -62,7 +62,7 @@ static void hadamard_col8(const int16_t *src_diff, int src_stride,
coeff[5] = c3 - c7;
}
-void vpx_hadamard_8x8_c(int16_t const *src_diff, int src_stride,
+void vpx_hadamard_8x8_c(const int16_t *src_diff, int src_stride,
int16_t *coeff) {
int idx;
int16_t buffer[64];
@@ -85,12 +85,12 @@ void vpx_hadamard_8x8_c(int16_t const *src_diff, int src_stride,
}
// In place 16x16 2D Hadamard transform
-void vpx_hadamard_16x16_c(int16_t const *src_diff, int src_stride,
+void vpx_hadamard_16x16_c(const int16_t *src_diff, int src_stride,
int16_t *coeff) {
int idx;
for (idx = 0; idx < 4; ++idx) {
// src_diff: 9 bit, dynamic range [-255, 255]
- int16_t const *src_ptr = src_diff + (idx >> 1) * 8 * src_stride
+ const int16_t *src_ptr = src_diff + (idx >> 1) * 8 * src_stride
+ (idx & 0x01) * 8;
vpx_hadamard_8x8_c(src_ptr, src_stride, coeff + idx * 64);
}
@@ -130,7 +130,7 @@ int vpx_satd_c(const int16_t *coeff, int length) {
// Integer projection onto row vectors.
// height: value range {16, 32, 64}.
-void vpx_int_pro_row_c(int16_t hbuf[16], uint8_t const *ref,
+void vpx_int_pro_row_c(int16_t hbuf[16], const uint8_t *ref,
const int ref_stride, const int height) {
int idx;
const int norm_factor = height >> 1;
@@ -147,7 +147,7 @@ void vpx_int_pro_row_c(int16_t hbuf[16], uint8_t const *ref,
}
// width: value range {16, 32, 64}.
-int16_t vpx_int_pro_col_c(uint8_t const *ref, const int width) {
+int16_t vpx_int_pro_col_c(const uint8_t *ref, const int width) {
int idx;
int16_t sum = 0;
// sum: 14 bit, dynamic range [0, 16320]
@@ -159,7 +159,7 @@ int16_t vpx_int_pro_col_c(uint8_t const *ref, const int width) {
// ref: [0 - 510]
// src: [0 - 510]
// bwl: {2, 3, 4}
-int vpx_vector_var_c(int16_t const *ref, int16_t const *src,
+int vpx_vector_var_c(const int16_t *ref, const int16_t *src,
const int bwl) {
int i;
int width = 4 << bwl;
diff --git a/vpx_dsp/vpx_dsp_rtcd_defs.pl b/vpx_dsp/vpx_dsp_rtcd_defs.pl
index 34dd0bc85..2b131929e 100644
--- a/vpx_dsp/vpx_dsp_rtcd_defs.pl
+++ b/vpx_dsp/vpx_dsp_rtcd_defs.pl
@@ -919,9 +919,9 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
$vpx_idct32x32_135_add_msa=vpx_idct32x32_1024_add_msa;
add_proto qw/void vpx_idct32x32_34_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
- specialize qw/vpx_idct32x32_34_add sse2 neon_asm dspr2 msa/, "$ssse3_x86_64_x86inc";
+ specialize qw/vpx_idct32x32_34_add sse2 neon dspr2 msa/, "$ssse3_x86_64_x86inc";
# Need to add 34 eob idct32x32 neon implementation.
- $vpx_idct32x32_34_add_neon_asm=vpx_idct32x32_1024_add_neon;
+ $vpx_idct32x32_34_add_neon=vpx_idct32x32_1024_add_neon;
add_proto qw/void vpx_idct32x32_1_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
specialize qw/vpx_idct32x32_1_add sse2 neon dspr2 msa/;
@@ -1016,22 +1016,22 @@ if ((vpx_config("CONFIG_VP9_ENCODER") eq "yes") || (vpx_config("CONFIG_VP10_ENCO
add_proto qw/void vpx_minmax_8x8/, "const uint8_t *s, int p, const uint8_t *d, int dp, int *min, int *max";
specialize qw/vpx_minmax_8x8 sse2/;
- add_proto qw/void vpx_hadamard_8x8/, "int16_t const *src_diff, int src_stride, int16_t *coeff";
+ add_proto qw/void vpx_hadamard_8x8/, "const int16_t *src_diff, int src_stride, int16_t *coeff";
specialize qw/vpx_hadamard_8x8 sse2/, "$ssse3_x86_64_x86inc";
- add_proto qw/void vpx_hadamard_16x16/, "int16_t const *src_diff, int src_stride, int16_t *coeff";
+ add_proto qw/void vpx_hadamard_16x16/, "const int16_t *src_diff, int src_stride, int16_t *coeff";
specialize qw/vpx_hadamard_16x16 sse2/;
add_proto qw/int vpx_satd/, "const int16_t *coeff, int length";
specialize qw/vpx_satd sse2 neon/;
- add_proto qw/void vpx_int_pro_row/, "int16_t *hbuf, uint8_t const *ref, const int ref_stride, const int height";
+ add_proto qw/void vpx_int_pro_row/, "int16_t *hbuf, const uint8_t *ref, const int ref_stride, const int height";
specialize qw/vpx_int_pro_row sse2 neon/;
- add_proto qw/int16_t vpx_int_pro_col/, "uint8_t const *ref, const int width";
+ add_proto qw/int16_t vpx_int_pro_col/, "const uint8_t *ref, const int width";
specialize qw/vpx_int_pro_col sse2 neon/;
- add_proto qw/int vpx_vector_var/, "int16_t const *ref, int16_t const *src, const int bwl";
+ add_proto qw/int vpx_vector_var/, "const int16_t *ref, const int16_t *src, const int bwl";
specialize qw/vpx_vector_var neon sse2/;
} # CONFIG_VP9_ENCODER || CONFIG_VP10_ENCODER