Commit cbbcd795 authored by Zoe Liu's avatar Zoe Liu
Browse files

Add the dumping of encoder side recon videos for debug

Change-Id: I5feee1b56159e15c5eb55b7e4e50694207b2e19c
parent 09eea219
......@@ -80,13 +80,15 @@
#ifdef OUTPUT_YUV_DENOISED
FILE *yuv_denoised_file = NULL;
#endif
#endif // OUTPUT_YUV_DENOISED
#ifdef OUTPUT_YUV_SKINMAP
FILE *yuv_skinmap_file = NULL;
#endif
#endif // OUTPUT_YUV_SKINMAP
#ifdef OUTPUT_YUV_REC
FILE *yuv_rec_file;
#endif
#endif // OUTPUT_YUV_REC
#if 0
FILE *framepsnr;
......@@ -1616,10 +1618,11 @@ AV1_COMP *av1_create_compressor(AV1EncoderConfig *oxcf,
#ifdef OUTPUT_YUV_SKINMAP
yuv_skinmap_file = fopen("skinmap.yuv", "ab");
#endif
#endif // OUTPUT_YUV_SKINMAP
#ifdef OUTPUT_YUV_REC
yuv_rec_file = fopen("rec.yuv", "wb");
#endif
yuv_rec_file = fopen("/tmp/enc_recon.yuv", "wb");
#endif // OUTPUT_YUV_REC
#if 0
framepsnr = fopen("framepsnr.stt", "a");
......@@ -1872,10 +1875,11 @@ void av1_remove_compressor(AV1_COMP *cpi) {
#ifdef OUTPUT_YUV_SKINMAP
fclose(yuv_skinmap_file);
#endif
#endif // OUTPUT_YUV_SKINMAP
#ifdef OUTPUT_YUV_REC
fclose(yuv_rec_file);
#endif
#endif // OUTPUT_YUV_REC
#if 0
......@@ -3504,6 +3508,19 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
// Set up frame to show to get ready for stats collection.
cm->frame_to_show = get_frame_new_buffer(cm);
#ifdef OUTPUT_YUV_REC
// NOTE: For debug - Output the filtered reconstructed video.
assert(cm->frame_to_show != NULL);
printf(
"\nFrame=%5d, encode_update_type[%5d]=%1d, show_existing_frame=%d, "
"y_stride=%4d, uv_stride=%4d, width=%4d, height=%4d\n",
cm->current_video_frame, cpi->twopass.gf_group.index,
cpi->twopass.gf_group.update_type[cpi->twopass.gf_group.index],
cm->show_existing_frame, cm->frame_to_show->y_stride,
cm->frame_to_show->uv_stride, cm->width, cm->height);
av1_write_yuv_rec_frame(cm);
#endif // OUTPUT_YUV_REC
// Update the LAST_FRAME in the reference frame buffer.
av1_update_reference_frames(cpi);
......@@ -3624,6 +3641,20 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
// build the bitstream
av1_pack_bitstream(cpi, dest, size);
#ifdef OUTPUT_YUV_REC
if (cm->show_frame) {
// NOTE: For debug - Output the filtered reconstructed video.
printf(
"\nFrame=%5d, encode_update_type[%5d]=%1d, show_existing_frame=%d, "
"y_stride=%4d, uv_stride=%4d, width=%4d, height=%4d\n",
cm->current_video_frame, cpi->twopass.gf_group.index,
cpi->twopass.gf_group.update_type[cpi->twopass.gf_group.index],
cm->show_existing_frame, cm->frame_to_show->y_stride,
cm->frame_to_show->uv_stride, cm->width, cm->height);
av1_write_yuv_rec_frame(cm);
}
#endif // OUTPUT_YUV_REC
#if CONFIG_EXT_REFS
if (cpi->rc.is_last_bipred_frame) {
// NOTE: If the current frame is a LAST_BIPRED_FRAME, next it is needed
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment