mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 19:24:06 +00:00
Merge branch 'psnr-output-changes'
This commit is contained in:
commit
20d6444f07
10
src/cli.c
10
src/cli.c
|
@ -501,14 +501,18 @@ void print_help(void)
|
|||
|
||||
void print_frame_info(const kvz_frame_info *const info,
|
||||
const double frame_psnr[3],
|
||||
const uint32_t bytes)
|
||||
const uint32_t bytes,
|
||||
const bool print_psnr)
|
||||
{
|
||||
fprintf(stderr, "POC %4d QP %2d (%c-frame) %10d bits PSNR: %2.4f %2.4f %2.4f",
|
||||
fprintf(stderr, "POC %4d QP %2d (%c-frame) %10d bits",
|
||||
info->poc,
|
||||
info->qp,
|
||||
"BPI"[info->slice_type % 3],
|
||||
bytes << 3,
|
||||
bytes << 3);
|
||||
if (print_psnr) {
|
||||
fprintf(stderr, " PSNR Y %2.4f U %2.4f V %2.4f",
|
||||
frame_psnr[0], frame_psnr[1], frame_psnr[2]);
|
||||
}
|
||||
|
||||
if (info->slice_type != KVZ_SLICE_I) {
|
||||
// Print reference picture lists
|
||||
|
|
|
@ -57,6 +57,7 @@ void print_version(void);
|
|||
void print_help(void);
|
||||
void print_frame_info(const kvz_frame_info *const info,
|
||||
const double frame_psnr[3],
|
||||
const uint32_t bytes);
|
||||
const uint32_t bytes,
|
||||
const bool print_psnr);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -561,7 +561,7 @@ int main(int argc, char *argv[])
|
|||
psnr_sum[1] += frame_psnr[1];
|
||||
psnr_sum[2] += frame_psnr[2];
|
||||
|
||||
print_frame_info(&info_out, frame_psnr, len_out);
|
||||
print_frame_info(&info_out, frame_psnr, len_out, encoder->cfg.calc_psnr);
|
||||
}
|
||||
|
||||
api->picture_free(cur_in_img);
|
||||
|
@ -581,8 +581,8 @@ int main(int argc, char *argv[])
|
|||
fprintf(stderr, " Processed %d frames, %10llu bits",
|
||||
frames_done,
|
||||
(long long unsigned int)bitstream_length * 8);
|
||||
if (frames_done > 0) {
|
||||
fprintf(stderr, " AVG PSNR: %2.4f %2.4f %2.4f",
|
||||
if (encoder->cfg.calc_psnr && frames_done > 0) {
|
||||
fprintf(stderr, " AVG PSNR Y %2.4f U %2.4f V %2.4f",
|
||||
psnr_sum[0] / frames_done,
|
||||
psnr_sum[1] / frames_done,
|
||||
psnr_sum[2] / frames_done);
|
||||
|
|
Loading…
Reference in a new issue