shithub: libvpx

Download patch

ref: bfa9d015b0dc00cb70af55bb16c7eb3feef218c5
parent: b4a8ac3c46dfcc46ecb30c8730d3312d07419533
author: angiebird <[email protected]>
date: Thu Dec 12 10:43:48 EST 2019

Move psnr/sse computation under RATE_CTRL flag

in update_encode_frame_result()

Change-Id: Ie86d11f66744ef95dd224c7daf325750a5e5458b

--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -7107,17 +7107,24 @@
                                        const YV12_BUFFER_CONFIG *coded_frame,
                                        int quantize_index, uint32_t bit_depth,
                                        uint32_t input_bit_depth) {
+#if CONFIG_RATE_CTRL
   PSNR_STATS psnr;
 #if CONFIG_VP9_HIGHBITDEPTH
   vpx_calc_highbd_psnr(source_frame, coded_frame, &psnr, bit_depth,
                        input_bit_depth);
-#else
+#else   // CONFIG_VP9_HIGHBITDEPTH
   (void)bit_depth;
   (void)input_bit_depth;
   vpx_calc_psnr(source_frame, coded_frame, &psnr);
-#endif
+#endif  // CONFIG_VP9_HIGHBITDEPTH
   encode_frame_result->psnr = psnr.psnr[0];
   encode_frame_result->sse = psnr.sse[0];
+#else   // CONFIG_RATE_CTRL
+  (void)bit_depth;
+  (void)input_bit_depth;
+  (void)source_frame;
+  (void)coded_frame;
+#endif  // CONFIG_RATE_CTRL
   encode_frame_result->show_idx = show_idx;
   encode_frame_result->update_type = update_type;
   encode_frame_result->quantize_index = quantize_index;
--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -853,8 +853,10 @@
 typedef struct ENCODE_FRAME_RESULT {
   int show_idx;
   FRAME_UPDATE_TYPE update_type;
+#if CONFIG_RATE_CTRL
   double psnr;
   uint64_t sse;
+#endif  // CONFIG_RATE_CTRL
   int quantize_index;
 } ENCODE_FRAME_RESULT;