summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_encoder.c9
-rw-r--r--vp9/encoder/vp9_encoder.h3
-rw-r--r--vp9/simple_encode.cc1
-rw-r--r--vp9/simple_encode.h2
4 files changed, 9 insertions, 6 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 ||
diff --git a/vp9/simple_encode.cc b/vp9/simple_encode.cc
index 4d7ec3084..018d50a1e 100644
--- a/vp9/simple_encode.cc
+++ b/vp9/simple_encode.cc
@@ -92,6 +92,7 @@ static void update_encode_frame_result(
get_frame_type_from_update_type(encode_frame_info->update_type);
encode_frame_result->psnr = encode_frame_info->psnr;
encode_frame_result->sse = encode_frame_info->sse;
+ encode_frame_result->quantize_index = encode_frame_info->quantize_index;
}
SimpleEncode::SimpleEncode(int frame_width, int frame_height,
diff --git a/vp9/simple_encode.h b/vp9/simple_encode.h
index fa1847161..48a86d056 100644
--- a/vp9/simple_encode.h
+++ b/vp9/simple_encode.h
@@ -16,7 +16,7 @@ struct EncodeFrameResult {
std::unique_ptr<unsigned char[]> coding_data;
double psnr;
uint64_t sse;
- // TODO(angiebird): int quantize_index ;
+ int quantize_index;
};
class SimpleEncode {