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
7107 const YV12_BUFFER_CONFIG *coded_frame,7107 const YV12_BUFFER_CONFIG *coded_frame,
7108 int quantize_index, uint32_t bit_depth,7108 int quantize_index, uint32_t bit_depth,
7109 uint32_t input_bit_depth) {7109 uint32_t input_bit_depth) {
7110#if CONFIG_RATE_CTRL
7110 PSNR_STATS psnr;7111 PSNR_STATS psnr;
7111#if CONFIG_VP9_HIGHBITDEPTH7112#if CONFIG_VP9_HIGHBITDEPTH
7112 vpx_calc_highbd_psnr(source_frame, coded_frame, &psnr, bit_depth,7113 vpx_calc_highbd_psnr(source_frame, coded_frame, &psnr, bit_depth,
7113 input_bit_depth);7114 input_bit_depth);
7114#else7115#else // CONFIG_VP9_HIGHBITDEPTH
7115 (void)bit_depth;7116 (void)bit_depth;
7116 (void)input_bit_depth;7117 (void)input_bit_depth;
7117 vpx_calc_psnr(source_frame, coded_frame, &psnr);7118 vpx_calc_psnr(source_frame, coded_frame, &psnr);
7118#endif7119#endif // CONFIG_VP9_HIGHBITDEPTH
7119 encode_frame_result->psnr = psnr.psnr[0];7120 encode_frame_result->psnr = psnr.psnr[0];
7120 encode_frame_result->sse = psnr.sse[0];7121 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
7121 encode_frame_result->show_idx = show_idx;7128 encode_frame_result->show_idx = show_idx;
7122 encode_frame_result->update_type = update_type;7129 encode_frame_result->update_type = update_type;
7123 encode_frame_result->quantize_index = quantize_index;7130 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
853typedef struct ENCODE_FRAME_RESULT {853typedef struct ENCODE_FRAME_RESULT {
854 int show_idx;854 int show_idx;
855 FRAME_UPDATE_TYPE update_type;855 FRAME_UPDATE_TYPE update_type;
856#if CONFIG_RATE_CTRL
856 double psnr;857 double psnr;
857 uint64_t sse;858 uint64_t sse;
859#endif // CONFIG_RATE_CTRL
858 int quantize_index;860 int quantize_index;
859} ENCODE_FRAME_RESULT;861} ENCODE_FRAME_RESULT;
860 862

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