summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
Diffstat (limited to 'vp9')
-rw-r--r--vp9/common/x86/vp9_asm_stubs.c22
-rw-r--r--vp9/encoder/vp9_firstpass.c16
-rw-r--r--vp9/encoder/vp9_onyx_if.c19
3 files changed, 22 insertions, 35 deletions
diff --git a/vp9/common/x86/vp9_asm_stubs.c b/vp9/common/x86/vp9_asm_stubs.c
index 106e6d426..f95423678 100644
--- a/vp9/common/x86/vp9_asm_stubs.c
+++ b/vp9/common/x86/vp9_asm_stubs.c
@@ -13,28 +13,6 @@
#include "./vpx_config.h"
#include "./vp9_rtcd.h"
#include "vpx_ports/mem.h"
-///////////////////////////////////////////////////////////////////////////
-// the mmx function that does the bilinear filtering and var calculation //
-// int one pass //
-///////////////////////////////////////////////////////////////////////////
-DECLARE_ALIGNED(16, const short, vp9_bilinear_filters_mmx[16][8]) = {
- { 128, 128, 128, 128, 0, 0, 0, 0 },
- { 120, 120, 120, 120, 8, 8, 8, 8 },
- { 112, 112, 112, 112, 16, 16, 16, 16 },
- { 104, 104, 104, 104, 24, 24, 24, 24 },
- { 96, 96, 96, 96, 32, 32, 32, 32 },
- { 88, 88, 88, 88, 40, 40, 40, 40 },
- { 80, 80, 80, 80, 48, 48, 48, 48 },
- { 72, 72, 72, 72, 56, 56, 56, 56 },
- { 64, 64, 64, 64, 64, 64, 64, 64 },
- { 56, 56, 56, 56, 72, 72, 72, 72 },
- { 48, 48, 48, 48, 80, 80, 80, 80 },
- { 40, 40, 40, 40, 88, 88, 88, 88 },
- { 32, 32, 32, 32, 96, 96, 96, 96 },
- { 24, 24, 24, 24, 104, 104, 104, 104 },
- { 16, 16, 16, 16, 112, 112, 112, 112 },
- { 8, 8, 8, 8, 120, 120, 120, 120 }
-};
typedef void filter8_1dfunction (
const unsigned char *src_ptr,
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index e473b10c0..16cf28473 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -1714,7 +1714,6 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
}
}
-
// Set the interval until the next gf or arf.
cpi->rc.baseline_gf_interval = i;
@@ -1920,15 +1919,18 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
if (cpi->twopass.kf_group_bits < 0)
cpi->twopass.kf_group_bits = 0;
- // Note the error score left in the remaining frames of the group.
- // For normal GFs we want to remove the error score for the first frame
- // of the group (except in Key frame case where this has already
- // happened)
- if (!cpi->rc.source_alt_ref_pending && cpi->common.frame_type != KEY_FRAME)
+ // If this is an arf update we want to remove the score for the
+ // overlay frame at the end which will usually be very cheap to code.
+ // For normal GFs remove the score for the GF itself unless this is
+ // also a key frame in which case it has already been accounted for.
+ if (cpi->rc.source_alt_ref_pending) {
+ cpi->twopass.gf_group_error_left = (int64_t)gf_group_err - mod_frame_err;
+ } else if (cpi->common.frame_type != KEY_FRAME) {
cpi->twopass.gf_group_error_left = (int64_t)(gf_group_err
- gf_first_frame_err);
- else
+ } else {
cpi->twopass.gf_group_error_left = (int64_t)gf_group_err;
+ }
cpi->twopass.gf_group_bits -= cpi->twopass.gf_bits
- cpi->rc.min_frame_bandwidth;
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c
index 3f813a1f6..fb5fb334c 100644
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -1094,12 +1094,18 @@ static void init_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
// Initialize active best and worst q and average q values.
cpi->rc.active_worst_quality = cpi->oxcf.worst_allowed_q;
- cpi->rc.avg_frame_qindex[0] = (cpi->oxcf.worst_allowed_q +
- cpi->oxcf.best_allowed_q) / 2;
- cpi->rc.avg_frame_qindex[1] = (cpi->oxcf.worst_allowed_q +
- cpi->oxcf.best_allowed_q) / 2;
- cpi->rc.avg_frame_qindex[2] = (cpi->oxcf.worst_allowed_q +
- cpi->oxcf.best_allowed_q) / 2;
+ if (cpi->pass == 0 && cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
+ cpi->rc.avg_frame_qindex[0] = cpi->oxcf.worst_allowed_q;
+ cpi->rc.avg_frame_qindex[1] = cpi->oxcf.worst_allowed_q;
+ cpi->rc.avg_frame_qindex[2] = cpi->oxcf.worst_allowed_q;
+ } else {
+ cpi->rc.avg_frame_qindex[0] = (cpi->oxcf.worst_allowed_q +
+ cpi->oxcf.best_allowed_q) / 2;
+ cpi->rc.avg_frame_qindex[1] = (cpi->oxcf.worst_allowed_q +
+ cpi->oxcf.best_allowed_q) / 2;
+ cpi->rc.avg_frame_qindex[2] = (cpi->oxcf.worst_allowed_q +
+ cpi->oxcf.best_allowed_q) / 2;
+ }
cpi->rc.last_q[0] = cpi->oxcf.best_allowed_q;
cpi->rc.last_q[1] = cpi->oxcf.best_allowed_q;
cpi->rc.last_q[2] = cpi->oxcf.best_allowed_q;
@@ -3167,6 +3173,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
#endif
// As this frame is a key frame the next defaults to an inter frame.
+ cm->frame_type = INTER_FRAME;
vp9_clear_system_state();
cpi->rc.frames_since_key = 0;
} else {