summaryrefslogtreecommitdiff
path: root/vp8/decoder/onyxd_if.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp8/decoder/onyxd_if.c')
-rw-r--r--vp8/decoder/onyxd_if.c63
1 files changed, 61 insertions, 2 deletions
diff --git a/vp8/decoder/onyxd_if.c b/vp8/decoder/onyxd_if.c
index 224619480..71f323282 100644
--- a/vp8/decoder/onyxd_if.c
+++ b/vp8/decoder/onyxd_if.c
@@ -43,6 +43,43 @@ extern void vp8cx_init_de_quantizer(VP8D_COMP *pbi);
static int get_free_fb (VP8_COMMON *cm);
static void ref_cnt_fb (int *buf, int *idx, int new_idx);
+#if CONFIG_DEBUG
+void vp8_recon_write_yuv_frame(char *name, YV12_BUFFER_CONFIG *s)
+{
+ FILE *yuv_file = fopen((char *)name, "ab");
+ unsigned char *src = s->y_buffer;
+ int h = s->y_height;
+
+ do
+ {
+ fwrite(src, s->y_width, 1, yuv_file);
+ src += s->y_stride;
+ }
+ while (--h);
+
+ src = s->u_buffer;
+ h = s->uv_height;
+
+ do
+ {
+ fwrite(src, s->uv_width, 1, yuv_file);
+ src += s->uv_stride;
+ }
+ while (--h);
+
+ src = s->v_buffer;
+ h = s->uv_height;
+
+ do
+ {
+ fwrite(src, s->uv_width, 1, yuv_file);
+ src += s->uv_stride;
+ }
+ while (--h);
+
+ fclose(yuv_file);
+}
+#endif
void vp8dx_initialize()
{
@@ -56,7 +93,6 @@ void vp8dx_initialize()
}
}
-
VP8D_PTR vp8dx_create_decompressor(VP8D_CONFIG *oxcf)
{
VP8D_COMP *pbi = vpx_memalign(32, sizeof(VP8D_COMP));
@@ -107,13 +143,17 @@ VP8D_PTR vp8dx_create_decompressor(VP8D_CONFIG *oxcf)
return (VP8D_PTR) pbi;
}
-
void vp8dx_remove_decompressor(VP8D_PTR ptr)
{
VP8D_COMP *pbi = (VP8D_COMP *) ptr;
if (!pbi)
return;
+#if CONFIG_SEGMENTATION
+ // Delete sementation map
+ if (pbi->segmentation_map != 0)
+ vpx_free(pbi->segmentation_map);
+#endif
#if CONFIG_MULTITHREAD
if (pbi->b_multithreaded_rd)
@@ -288,6 +328,22 @@ static int swap_frame_buffers (VP8_COMMON *cm)
return err;
}
+/*
+static void vp8_print_yuv_rec_mb(VP8_COMMON *cm, int mb_row, int mb_col)
+{
+ YV12_BUFFER_CONFIG *s = cm->frame_to_show;
+ unsigned char *src = s->y_buffer;
+ int i, j;
+
+ printf("After loop filter\n");
+ for (i=0;i<16;i++) {
+ for (j=0;j<16;j++)
+ printf("%3d ", src[(mb_row*16+i)*s->y_stride + mb_col*16+j]);
+ printf("\n");
+ }
+}
+*/
+
int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsigned char *source, int64_t time_stamp)
{
#if HAVE_ARMV7
@@ -455,6 +511,9 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign
vp8_yv12_extend_frame_borders_ptr(cm->frame_to_show);
}
+#if CONFIG_DEBUG
+ vp8_recon_write_yuv_frame("recon.yuv", cm->frame_to_show);
+#endif
vp8_clear_system_state();