ref: 7a298d0b03982ff4d3406bc613327634c3db5dd2
parent: 3e2b4b3d4803f20814d6b6cb3109efbc95249b60
parent: 9ce7bf835a8dceca891dbce05fecd5b5417b3856
author: Paul Wilkins <paulwilkins@google.com>
date: Wed Mar 20 07:40:46 EDT 2019
Merge "Store a group level noise metric from first pass."
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -49,7 +49,6 @@
#define MIN_DECAY_FACTOR 0.01
#define NEW_MV_MODE_PENALTY 32
#define DARK_THRESH 64
-#define SECTION_NOISE_DEF 250.0
#define LOW_I_THRESH 24000
#define NCOUNT_INTRA_THRESH 8192
@@ -2658,6 +2657,10 @@
// Calculate the bits to be allocated to the gf/arf group as a whole
gf_group_bits = calculate_total_gf_group_bits(cpi, gf_group_err);
+
+ // Store the average moise level measured for the group
+ twopass->gf_group.group_noise_energy =
+ (int)(gf_group_noise / rc->baseline_gf_interval);
// Calculate an estimate of the maxq needed for the group.
// We are more aggressive about correcting for sections
--- a/vp9/encoder/vp9_firstpass.h
+++ b/vp9/encoder/vp9_firstpass.h
@@ -44,6 +44,7 @@
#define INVALID_ROW (-1)
#define MAX_ARF_LAYERS 6
+#define SECTION_NOISE_DEF 250.0
typedef struct {
double frame_mb_intra_factor;
@@ -142,6 +143,7 @@
int gf_group_size;
int max_layer_depth;
int allowed_max_layer_depth;
+ int group_noise_energy;
} GF_GROUP;
typedef struct {