summaryrefslogtreecommitdiff
path: root/vp8/encoder
diff options
context:
space:
mode:
authorJerome Jiang <jianj@google.com>2017-05-26 16:20:49 -0700
committerJerome Jiang <jianj@google.com>2017-05-30 10:30:05 -0700
commitc39526da8a88facd9326ce68a6ad5ad250e096dc (patch)
tree5cc2b37f526bd21cff92f160125fd56cae06349f /vp8/encoder
parent327c9bb1da0e0ceac4293ab42fa8c25e8f1706c9 (diff)
downloadlibvpx-c39526da8a88facd9326ce68a6ad5ad250e096dc.tar
libvpx-c39526da8a88facd9326ce68a6ad5ad250e096dc.tar.gz
libvpx-c39526da8a88facd9326ce68a6ad5ad250e096dc.tar.bz2
libvpx-c39526da8a88facd9326ce68a6ad5ad250e096dc.zip
Write skin map of vp8 skin detection for debug.
Change-Id: Ica1b4e918aa759cd0ce65920f9d88452bbf9e3b4
Diffstat (limited to 'vp8/encoder')
-rw-r--r--vp8/encoder/onyx_if.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index b571d29d9..fe72d7844 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -16,6 +16,7 @@
#include "vp8/common/blockd.h"
#include "onyx_int.h"
#include "vp8/common/systemdependent.h"
+#include "vp8/common/skin_detection.h"
#include "vp8/encoder/quantize.h"
#include "vp8/common/alloccommon.h"
#include "mcomp.h"
@@ -87,6 +88,9 @@ FILE *yuv_file;
#ifdef OUTPUT_YUV_DENOISED
FILE *yuv_denoised_file;
#endif
+#ifdef OUTPUT_YUV_SKINMAP
+FILE *yuv_skinmap_file = NULL;
+#endif
#if 0
FILE *framepsnr;
@@ -1933,6 +1937,9 @@ struct VP8_COMP *vp8_create_compressor(VP8_CONFIG *oxcf) {
#ifdef OUTPUT_YUV_DENOISED
yuv_denoised_file = fopen("denoised.yuv", "ab");
#endif
+#ifdef OUTPUT_YUV_SKINMAP
+ yuv_skinmap_file = fopen("skinmap.yuv", "ab");
+#endif
#if 0
framepsnr = fopen("framepsnr.stt", "a");
@@ -2298,6 +2305,9 @@ void vp8_remove_compressor(VP8_COMP **ptr) {
#ifdef OUTPUT_YUV_DENOISED
fclose(yuv_denoised_file);
#endif
+#ifdef OUTPUT_YUV_SKINMAP
+ fclose(yuv_skinmap_file);
+#endif
#if 0
@@ -2474,7 +2484,8 @@ int vp8_update_entropy(VP8_COMP *cpi, int update) {
return 0;
}
-#if defined(OUTPUT_YUV_SRC) || defined(OUTPUT_YUV_DENOISED)
+#if defined(OUTPUT_YUV_SRC) || defined(OUTPUT_YUV_DENOISED) || \
+ defined(OUTPUT_YUV_SKINMAP)
void vp8_write_yuv_frame(FILE *yuv_file, YV12_BUFFER_CONFIG *s) {
unsigned char *src = s->y_buffer;
int h = s->y_height;
@@ -4421,6 +4432,12 @@ static void encode_frame_to_data_rate(VP8_COMP *cpi, size_t *size,
}
#endif
+#ifdef OUTPUT_YUV_SKINMAP
+ if (cpi->common.current_video_frame > 1) {
+ compute_skin_map(cpi, yuv_skinmap_file);
+ }
+#endif
+
#if CONFIG_MULTITHREAD
if (cpi->b_multi_threaded) {
/* start loopfilter in separate thread */