Commit c9c4e13d authored by Tim Kopp's avatar Tim Kopp

Added CFLAG for outputting vp9 denoised signal

Change-Id: Iab9b4e11cad927f3282e486c203564e1a658f377
parent b56f3af7
......@@ -64,6 +64,9 @@ void vp9_coef_tree_initialize();
// #define OUTPUT_YUV_REC
#ifdef OUTPUT_YUV_DENOISED
FILE *yuv_denoised_file;
#endif
#ifdef OUTPUT_YUV_SRC
FILE *yuv_file;
#endif
......@@ -866,6 +869,9 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf) {
cpi->mb.nmvsadcost_hp[1] = &cpi->mb.nmvsadcosts_hp[1][MV_MAX];
cal_nmvsadcosts_hp(cpi->mb.nmvsadcost_hp);
#ifdef OUTPUT_YUV_DENOISED
yuv_denoised_file = fopen("denoised.yuv", "ab");
#endif
#ifdef OUTPUT_YUV_SRC
yuv_file = fopen("bd.yuv", "ab");
#endif
......@@ -1111,6 +1117,9 @@ void vp9_remove_compressor(VP9_COMP *cpi) {
vp9_remove_common(&cpi->common);
vpx_free(cpi);
#ifdef OUTPUT_YUV_DENOISED
fclose(yuv_denoised_file);
#endif
#ifdef OUTPUT_YUV_SRC
fclose(yuv_file);
#endif
......@@ -1292,13 +1301,13 @@ int vp9_update_entropy(VP9_COMP * cpi, int update) {
}
#ifdef OUTPUT_YUV_SRC
void vp9_write_yuv_frame(YV12_BUFFER_CONFIG *s) {
#if defined(OUTPUT_YUV_SRC) || defined(OUTPUT_YUV_DENOISED)
void vp9_write_yuv_frame(YV12_BUFFER_CONFIG *s, FILE *f) {
uint8_t *src = s->y_buffer;
int h = s->y_height;
do {
fwrite(src, s->y_width, 1, yuv_file);
fwrite(src, s->y_width, 1, f);
src += s->y_stride;
} while (--h);
......@@ -1306,7 +1315,7 @@ void vp9_write_yuv_frame(YV12_BUFFER_CONFIG *s) {
h = s->uv_height;
do {
fwrite(src, s->uv_width, 1, yuv_file);
fwrite(src, s->uv_width, 1, f);
src += s->uv_stride;
} while (--h);
......@@ -1314,7 +1323,7 @@ void vp9_write_yuv_frame(YV12_BUFFER_CONFIG *s) {
h = s->uv_height;
do {
fwrite(src, s->uv_width, 1, yuv_file);
fwrite(src, s->uv_width, 1, f);
src += s->uv_stride;
} while (--h);
}
......@@ -2128,8 +2137,12 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
}
#endif
#ifdef OUTPUT_YUV_DENOISED
vp9_write_yuv_frame(&cpi->denoiser.running_avg_y[INTRA_FRAME],
yuv_denoised_file);
#endif
#ifdef OUTPUT_YUV_SRC
vp9_write_yuv_frame(cpi->Source);
vp9_write_yuv_frame(cpi->Source, yuv_file);
#endif
set_speed_features(cpi);
......
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