History

Move psnr/sse computation under RATE_CTRL flag

in update_encode_frame_result()

angiebird committed 6 years ago

Commit bfa9d011 parent b4a8ac32 files · +11 −2Browse files

Unified · Split

2 files
  1. vp9/encoder/vp9_encoder.c +9 −2
  2. vp9/encoder/vp9_encoder.h +2 −0
vp9/encoder/vp9_encoder.c+9−2
@@ -7107,17 +7107,24 @@ static void update_encode_frame_result(ENCODE_FRAME_RESULT *encode_frame_result, · 7106 unmodified lines
71077107 const YV12_BUFFER_CONFIG *coded_frame,
71087108 int quantize_index, uint32_t bit_depth,
71097109 uint32_t input_bit_depth) {
7110+#if CONFIG_RATE_CTRL
71107111 PSNR_STATS psnr;
71117112 #if CONFIG_VP9_HIGHBITDEPTH
71127113 vpx_calc_highbd_psnr(source_frame, coded_frame, &psnr, bit_depth,
71137114 input_bit_depth);
7114−#else
7115+#else // CONFIG_VP9_HIGHBITDEPTH
71157116 (void)bit_depth;
71167117 (void)input_bit_depth;
71177118 vpx_calc_psnr(source_frame, coded_frame, &psnr);
7118−#endif
7119+#endif // CONFIG_VP9_HIGHBITDEPTH
71197120 encode_frame_result->psnr = psnr.psnr[0];
71207121 encode_frame_result->sse = psnr.sse[0];
7122+#else // CONFIG_RATE_CTRL
7123+ (void)bit_depth;
7124+ (void)input_bit_depth;
7125+ (void)source_frame;
7126+ (void)coded_frame;
7127+#endif // CONFIG_RATE_CTRL
71217128 encode_frame_result->show_idx = show_idx;
71227129 encode_frame_result->update_type = update_type;
71237130 encode_frame_result->quantize_index = quantize_index;
vp9/encoder/vp9_encoder.h+2−0
@@ -853,8 +853,10 @@ typedef struct VP9_COMP { · 852 unmodified lines
853853 typedef struct ENCODE_FRAME_RESULT {
854854 int show_idx;
855855 FRAME_UPDATE_TYPE update_type;
856+#if CONFIG_RATE_CTRL
856857 double psnr;
857858 uint64_t sse;
859+#endif // CONFIG_RATE_CTRL
858860 int quantize_index;
859861 } ENCODE_FRAME_RESULT;
860862

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t