summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorangiebird <angiebird@google.com>2019-11-12 08:56:13 -0800
committerangiebird <angiebird@google.com>2019-11-18 11:37:24 -0800
commit2b97860f971f1f0407595338241714c00c13bae3 (patch)
treed82da6d4ecd31835ca9b45f930d6a2ce3ab06eaa /vp9/encoder
parent56735c3fdb8401fb052f69cdaf2ebf16714bd21d (diff)
downloadlibvpx-2b97860f971f1f0407595338241714c00c13bae3.tar
libvpx-2b97860f971f1f0407595338241714c00c13bae3.tar.gz
libvpx-2b97860f971f1f0407595338241714c00c13bae3.tar.bz2
libvpx-2b97860f971f1f0407595338241714c00c13bae3.zip
Add quantize_index to EncodeFrameResult
Change-Id: Idfb36a8bfa264df8294eba70424fd25fa5d88cda
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_encoder.c9
-rw-r--r--vp9/encoder/vp9_encoder.h3
2 files changed, 7 insertions, 5 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index c080ad47d..3104e71d1 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -7095,7 +7095,7 @@ static void update_encode_frame_result(ENCODE_FRAME_RESULT *encode_frame_result,
FRAME_UPDATE_TYPE update_type,
const YV12_BUFFER_CONFIG *source_frame,
const YV12_BUFFER_CONFIG *coded_frame,
- uint32_t bit_depth,
+ int quantize_index, uint32_t bit_depth,
uint32_t input_bit_depth) {
PSNR_STATS psnr;
#if CONFIG_VP9_HIGHBITDEPTH
@@ -7110,6 +7110,7 @@ static void update_encode_frame_result(ENCODE_FRAME_RESULT *encode_frame_result,
encode_frame_result->sse = psnr.sse[0];
encode_frame_result->show_idx = show_idx;
encode_frame_result->update_type = update_type;
+ encode_frame_result->quantize_index = quantize_index;
}
#endif // !CONFIG_REALTIME_ONLY
@@ -7406,8 +7407,8 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
update_encode_frame_result(
encode_frame_result, source->show_idx,
cpi->twopass.gf_group.update_type[cpi->twopass.gf_group.index],
- cpi->Source, get_frame_new_buffer(cm), cpi->oxcf.input_bit_depth,
- cm->bit_depth);
+ cpi->Source, get_frame_new_buffer(cm), vp9_get_quantizer(cpi),
+ cpi->oxcf.input_bit_depth, cm->bit_depth);
vp9_twopass_postencode_update(cpi);
} else if (cpi->use_svc) {
SvcEncode(cpi, size, dest, frame_flags);
@@ -7714,7 +7715,7 @@ void vp9_set_svc(VP9_COMP *cpi, int use_svc) {
return;
}
-int vp9_get_quantizer(VP9_COMP *cpi) { return cpi->common.base_qindex; }
+int vp9_get_quantizer(const VP9_COMP *cpi) { return cpi->common.base_qindex; }
void vp9_apply_encoding_flags(VP9_COMP *cpi, vpx_enc_frame_flags_t flags) {
if (flags &
diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h
index 66526bd00..e12945f41 100644
--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -827,6 +827,7 @@ typedef struct ENCODE_FRAME_RESULT {
FRAME_UPDATE_TYPE update_type;
double psnr;
uint64_t sse;
+ int quantize_index;
} ENCODE_FRAME_RESULT;
void vp9_initialize_enc(void);
@@ -899,7 +900,7 @@ static INLINE void stack_init(int *stack, int length) {
for (idx = 0; idx < length; ++idx) stack[idx] = -1;
}
-int vp9_get_quantizer(struct VP9_COMP *cpi);
+int vp9_get_quantizer(const VP9_COMP *cpi);
static INLINE int frame_is_kf_gf_arf(const VP9_COMP *cpi) {
return frame_is_intra_only(&cpi->common) || cpi->refresh_alt_ref_frame ||