Commit 647df00f authored by Fritz Koenig's avatar Fritz Koenig
Browse files

postproc : Re-work posproc calling to allow more flags.

Debugging in postproc needs more flags to allow for specific
block types to be turned on or off in the visualizations.

Must be enabled with --enable-postproc-visualizer during
configuration time.

Change-Id: Ia74f357ddc3ad4fb8082afd3a64f62384e4fcb2d
parent 6adbe090
...@@ -41,6 +41,7 @@ Advanced options: ...@@ -41,6 +41,7 @@ Advanced options:
${toggle_shared} shared library support ${toggle_shared} shared library support
${toggle_small} favor smaller size over speed ${toggle_small} favor smaller size over speed
${toggle_arm_asm_detok} assembly version of the detokenizer (ARM platforms only) ${toggle_arm_asm_detok} assembly version of the detokenizer (ARM platforms only)
${toggle_postproc_visualizer} macro block / block level visualizers
Codecs: Codecs:
Codecs can be selectively enabled or disabled individually, or by family: Codecs can be selectively enabled or disabled individually, or by family:
...@@ -250,6 +251,7 @@ CONFIG_LIST=" ...@@ -250,6 +251,7 @@ CONFIG_LIST="
shared shared
small small
arm_asm_detok arm_asm_detok
postproc_visualizer
" "
CMDLINE_SELECT=" CMDLINE_SELECT="
extra_warnings extra_warnings
...@@ -289,6 +291,7 @@ CMDLINE_SELECT=" ...@@ -289,6 +291,7 @@ CMDLINE_SELECT="
shared shared
small small
arm_asm_detok arm_asm_detok
postproc_visualizer
" "
process_cmdline() { process_cmdline() {
...@@ -325,8 +328,6 @@ post_process_cmdline() { ...@@ -325,8 +328,6 @@ post_process_cmdline() {
for c in ${CODECS}; do for c in ${CODECS}; do
enabled ${c} && enable ${c##*_}s enabled ${c} && enable ${c##*_}s
done done
} }
...@@ -536,6 +537,9 @@ process_toolchain() { ...@@ -536,6 +537,9 @@ process_toolchain() {
# Other toolchain specific defaults # Other toolchain specific defaults
case $toolchain in x86*|ppc*|universal*) soft_enable postproc;; esac case $toolchain in x86*|ppc*|universal*) soft_enable postproc;; esac
enabled postproc_visualizer && {enabled postproc \
|| die "postproc_visualizer requires postproc to be enabled"}
} }
......
...@@ -204,7 +204,7 @@ extern "C" ...@@ -204,7 +204,7 @@ extern "C"
// and not just a copy of the pointer.. // and not just a copy of the pointer..
int vp8_receive_raw_frame(VP8_PTR comp, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, INT64 time_stamp, INT64 end_time_stamp); int vp8_receive_raw_frame(VP8_PTR comp, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, INT64 time_stamp, INT64 end_time_stamp);
int vp8_get_compressed_data(VP8_PTR comp, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, INT64 *time_stamp, INT64 *time_end, int flush); int vp8_get_compressed_data(VP8_PTR comp, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, INT64 *time_stamp, INT64 *time_end, int flush);
int vp8_get_preview_raw_frame(VP8_PTR comp, YV12_BUFFER_CONFIG *dest, int deblock_level, int noise_level, int flags); int vp8_get_preview_raw_frame(VP8_PTR comp, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *flags);
int vp8_use_as_reference(VP8_PTR comp, int ref_frame_flags); int vp8_use_as_reference(VP8_PTR comp, int ref_frame_flags);
int vp8_update_reference(VP8_PTR comp, int ref_frame_flags); int vp8_update_reference(VP8_PTR comp, int ref_frame_flags);
......
...@@ -51,7 +51,7 @@ extern "C" ...@@ -51,7 +51,7 @@ extern "C"
int vp8dx_get_setting(VP8D_PTR comp, VP8D_SETTING oxst); int vp8dx_get_setting(VP8D_PTR comp, VP8D_SETTING oxst);
int vp8dx_receive_compressed_data(VP8D_PTR comp, unsigned long size, const unsigned char *dest, INT64 time_stamp); int vp8dx_receive_compressed_data(VP8D_PTR comp, unsigned long size, const unsigned char *dest, INT64 time_stamp);
int vp8dx_get_raw_frame(VP8D_PTR comp, YV12_BUFFER_CONFIG *sd, INT64 *time_stamp, INT64 *time_end_stamp, int deblock_level, int noise_level, int flags); int vp8dx_get_raw_frame(VP8D_PTR comp, YV12_BUFFER_CONFIG *sd, INT64 *time_stamp, INT64 *time_end_stamp, vp8_ppflags_t *flags);
int vp8dx_get_reference(VP8D_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd); int vp8dx_get_reference(VP8D_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd);
int vp8dx_set_reference(VP8D_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd); int vp8dx_set_reference(VP8D_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd);
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
( (0.439*(float)(t>>16)) - (0.368*(float)(t>>8&0xff)) - (0.071*(float)(t&0xff)) + 128) ( (0.439*(float)(t>>16)) - (0.368*(float)(t>>8&0xff)) - (0.071*(float)(t&0xff)) + 128)
/* global constants */ /* global constants */
#if CONFIG_POSTPROC_VISUALIZER
static const unsigned char MB_PREDICTION_MODE_colors[MB_MODE_COUNT][3] = static const unsigned char MB_PREDICTION_MODE_colors[MB_MODE_COUNT][3] =
{ {
{ RGB_TO_YUV(0x98FB98) }, /* PaleGreen */ { RGB_TO_YUV(0x98FB98) }, /* PaleGreen */
...@@ -59,13 +59,14 @@ static const unsigned char B_PREDICTION_MODE_colors[B_MODE_COUNT][3] = ...@@ -59,13 +59,14 @@ static const unsigned char B_PREDICTION_MODE_colors[B_MODE_COUNT][3] =
{ RGB_TO_YUV(0xccff33) }, /* Yellow */ { RGB_TO_YUV(0xccff33) }, /* Yellow */
}; };
static const unsigned char MV_REFERENCE_FRAME_colors[MB_MODE_COUNT][3] = static const unsigned char MV_REFERENCE_FRAME_colors[MAX_REF_FRAMES][3] =
{ {
{ RGB_TO_YUV(0x00ff00) }, /* Blue */ { RGB_TO_YUV(0x00ff00) }, /* Blue */
{ RGB_TO_YUV(0x0000ff) }, /* Green */ { RGB_TO_YUV(0x0000ff) }, /* Green */
{ RGB_TO_YUV(0xffff00) }, /* Yellow */ { RGB_TO_YUV(0xffff00) }, /* Yellow */
{ RGB_TO_YUV(0xff0000) }, /* Red */ { RGB_TO_YUV(0xff0000) }, /* Red */
}; };
#endif
static const short kernel5[] = static const short kernel5[] =
{ {
...@@ -677,10 +678,13 @@ static void constrain_line (int x0, int *x1, int y0, int *y1, int width, int hei ...@@ -677,10 +678,13 @@ static void constrain_line (int x0, int *x1, int y0, int *y1, int width, int hei
#define RTCD_VTABLE(oci) NULL #define RTCD_VTABLE(oci) NULL
#endif #endif
int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_level, int noise_level, int flags) int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *ppflags)
{ {
char message[512]; char message[512];
int q = oci->filter_level * 10 / 6; int q = oci->filter_level * 10 / 6;
int flags = ppflags->post_proc_flag;
int deblock_level = ppflags->deblocking_level;
int noise_level = ppflags->noise_level;
if (!oci->frame_to_show) if (!oci->frame_to_show)
return -1; return -1;
...@@ -737,7 +741,8 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l ...@@ -737,7 +741,8 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l
oci->post_proc_buffer.y_stride); oci->post_proc_buffer.y_stride);
} }
if (flags & VP8D_DEBUG_LEVEL1) #if CONFIG_POSTPROC_VISUALIZER
if (flags & VP8D_DEBUG_TXT_FRAME_INFO)
{ {
sprintf(message, "F%1dG%1dQ%3dF%3dP%d_s%dx%d", sprintf(message, "F%1dG%1dQ%3dF%3dP%d_s%dx%d",
(oci->frame_type == KEY_FRAME), (oci->frame_type == KEY_FRAME),
...@@ -749,7 +754,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l ...@@ -749,7 +754,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l
vp8_blit_text(message, oci->post_proc_buffer.y_buffer, oci->post_proc_buffer.y_stride); vp8_blit_text(message, oci->post_proc_buffer.y_buffer, oci->post_proc_buffer.y_stride);
} }
if (flags & VP8D_DEBUG_LEVEL2) if (flags & VP8D_DEBUG_TXT_MBLK_MODES)
{ {
int i, j; int i, j;
unsigned char *y_ptr; unsigned char *y_ptr;
...@@ -781,7 +786,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l ...@@ -781,7 +786,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l
} }
} }
if (flags & VP8D_DEBUG_LEVEL3) if (flags & VP8D_DEBUG_TXT_DC_DIFF)
{ {
int i, j; int i, j;
unsigned char *y_ptr; unsigned char *y_ptr;
...@@ -816,45 +821,14 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l ...@@ -816,45 +821,14 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l
} }
} }
if (flags & VP8D_DEBUG_LEVEL4) if (flags & VP8D_DEBUG_TXT_RATE_INFO)
{ {
sprintf(message, "Bitrate: %10.2f frame_rate: %10.2f ", oci->bitrate, oci->framerate); sprintf(message, "Bitrate: %10.2f frame_rate: %10.2f ", oci->bitrate, oci->framerate);
vp8_blit_text(message, oci->post_proc_buffer.y_buffer, oci->post_proc_buffer.y_stride); vp8_blit_text(message, oci->post_proc_buffer.y_buffer, oci->post_proc_buffer.y_stride);
#if 0
int i, j;
unsigned char *y_ptr;
YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer;
int mb_rows = post->y_height >> 4;
int mb_cols = post->y_width >> 4;
int mb_index = 0;
MODE_INFO *mi = oci->mi;
y_ptr = post->y_buffer + 4 * post->y_stride + 4;
/* vp8_filter each macro block */
for (i = 0; i < mb_rows; i++)
{
for (j = 0; j < mb_cols; j++)
{
char zz[4];
sprintf(zz, "%c", mi[mb_index].mbmi.dc_diff + '0');
vp8_blit_text(zz, y_ptr, post->y_stride);
mb_index ++;
y_ptr += 16;
}
mb_index ++; /* border */
y_ptr += post->y_stride * 16 - post->y_width;
}
#endif
} }
/* Draw motion vectors */ /* Draw motion vectors */
if (flags & VP8D_DEBUG_DRAW_MV) if ((flags & VP8D_DEBUG_DRAW_MV) && ppflags->display_mv_flag)
{ {
YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer;
int width = post->y_width; int width = post->y_width;
...@@ -871,6 +845,12 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l ...@@ -871,6 +845,12 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l
{ {
int x1, y1; int x1, y1;
if (!(ppflags->display_mv_flag & (1<<mi->mbmi.mode)))
{
mi++;
continue;
}
if (mi->mbmi.mode == SPLITMV) if (mi->mbmi.mode == SPLITMV)
{ {
switch (mi->mbmi.partitioning) switch (mi->mbmi.partitioning)
...@@ -996,6 +976,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l ...@@ -996,6 +976,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l
else else
vp8_blit_line (lx0, x1, ly0, y1, y_buffer, y_stride); vp8_blit_line (lx0, x1, ly0, y1, y_buffer, y_stride);
} }
mi++; mi++;
} }
mi++; mi++;
...@@ -1003,7 +984,8 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l ...@@ -1003,7 +984,8 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l
} }
/* Color in block modes */ /* Color in block modes */
if (flags & VP8D_DEBUG_CLR_BLK_MODES) if ((flags & VP8D_DEBUG_CLR_BLK_MODES)
&& (ppflags->display_mb_modes_flag || ppflags->display_b_modes_flag))
{ {
int y, x; int y, x;
YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer;
...@@ -1021,7 +1003,8 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l ...@@ -1021,7 +1003,8 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l
{ {
int Y = 0, U = 0, V = 0; int Y = 0, U = 0, V = 0;
if (mi->mbmi.mode == B_PRED) if (mi->mbmi.mode == B_PRED &&
((ppflags->display_mb_modes_flag & B_PRED) || ppflags->display_b_modes_flag))
{ {
int by, bx; int by, bx;
unsigned char *yl, *ul, *vl; unsigned char *yl, *ul, *vl;
...@@ -1035,13 +1018,16 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l ...@@ -1035,13 +1018,16 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l
{ {
for (bx = 0; bx < 16; bx += 4) for (bx = 0; bx < 16; bx += 4)
{ {
Y = B_PREDICTION_MODE_colors[bmi->mode][0]; if ((ppflags->display_b_modes_flag & (1<<mi->mbmi.mode))
U = B_PREDICTION_MODE_colors[bmi->mode][1]; || (ppflags->display_mb_modes_flag & B_PRED))
V = B_PREDICTION_MODE_colors[bmi->mode][2]; {
Y = B_PREDICTION_MODE_colors[bmi->mode][0];
POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_b) U = B_PREDICTION_MODE_colors[bmi->mode][1];
(yl+bx, ul+(bx>>1), vl+(bx>>1), Y, U, V, 0xc000, y_stride); V = B_PREDICTION_MODE_colors[bmi->mode][2];
POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_b)
(yl+bx, ul+(bx>>1), vl+(bx>>1), Y, U, V, 0xc000, y_stride);
}
bmi++; bmi++;
} }
...@@ -1050,7 +1036,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l ...@@ -1050,7 +1036,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l
vl += y_stride*1; vl += y_stride*1;
} }
} }
else else if (ppflags->display_mb_modes_flag & (1<<mi->mbmi.mode))
{ {
Y = MB_PREDICTION_MODE_colors[mi->mbmi.mode][0]; Y = MB_PREDICTION_MODE_colors[mi->mbmi.mode][0];
U = MB_PREDICTION_MODE_colors[mi->mbmi.mode][1]; U = MB_PREDICTION_MODE_colors[mi->mbmi.mode][1];
...@@ -1059,6 +1045,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l ...@@ -1059,6 +1045,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l
POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_mb_inner) POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_mb_inner)
(y_ptr+x, u_ptr+(x>>1), v_ptr+(x>>1), Y, U, V, 0xc000, y_stride); (y_ptr+x, u_ptr+(x>>1), v_ptr+(x>>1), Y, U, V, 0xc000, y_stride);
} }
mi++; mi++;
} }
y_ptr += y_stride*16; y_ptr += y_stride*16;
...@@ -1070,7 +1057,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l ...@@ -1070,7 +1057,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l
} }
/* Color in frame reference blocks */ /* Color in frame reference blocks */
if (flags & VP8D_DEBUG_CLR_FRM_REF_BLKS) if ((flags & VP8D_DEBUG_CLR_FRM_REF_BLKS) && ppflags->display_ref_frame_flag)
{ {
int y, x; int y, x;
YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer;
...@@ -1088,12 +1075,15 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l ...@@ -1088,12 +1075,15 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l
{ {
int Y = 0, U = 0, V = 0; int Y = 0, U = 0, V = 0;
Y = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][0]; if (ppflags->display_ref_frame_flag & (1<<mi->mbmi.ref_frame))
U = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][1]; {
V = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][2]; Y = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][0];
U = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][1];
V = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][2];
POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_mb_outer) POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_mb_outer)
(y_ptr+x, u_ptr+(x>>1), v_ptr+(x>>1), Y, U, V, 0xc000, y_stride); (y_ptr+x, u_ptr+(x>>1), v_ptr+(x>>1), Y, U, V, 0xc000, y_stride);
}
mi++; mi++;
} }
...@@ -1104,6 +1094,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l ...@@ -1104,6 +1094,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, int deblock_l
mi++; mi++;
} }
} }
#endif
*dest = oci->post_proc_buffer; *dest = oci->post_proc_buffer;
......
...@@ -111,7 +111,7 @@ struct postproc_state ...@@ -111,7 +111,7 @@ struct postproc_state
#include "onyxc_int.h" #include "onyxc_int.h"
#include "ppflags.h" #include "ppflags.h"
int vp8_post_proc_frame(struct VP8Common *oci, YV12_BUFFER_CONFIG *dest, int vp8_post_proc_frame(struct VP8Common *oci, YV12_BUFFER_CONFIG *dest,
int deblock_level, int noise_level, int flags); vp8_ppflags_t *flags);
void vp8_de_noise(YV12_BUFFER_CONFIG *source, void vp8_de_noise(YV12_BUFFER_CONFIG *source,
......
...@@ -17,13 +17,24 @@ enum ...@@ -17,13 +17,24 @@ enum
VP8D_DEBLOCK = 1<<0, VP8D_DEBLOCK = 1<<0,
VP8D_DEMACROBLOCK = 1<<1, VP8D_DEMACROBLOCK = 1<<1,
VP8D_ADDNOISE = 1<<2, VP8D_ADDNOISE = 1<<2,
VP8D_DEBUG_LEVEL1 = 1<<3, VP8D_DEBUG_TXT_FRAME_INFO = 1<<3,
VP8D_DEBUG_LEVEL2 = 1<<4, VP8D_DEBUG_TXT_MBLK_MODES = 1<<4,
VP8D_DEBUG_LEVEL3 = 1<<5, VP8D_DEBUG_TXT_DC_DIFF = 1<<5,
VP8D_DEBUG_LEVEL4 = 1<<6, VP8D_DEBUG_TXT_RATE_INFO = 1<<6,
VP8D_DEBUG_DRAW_MV = 1<<7, VP8D_DEBUG_DRAW_MV = 1<<7,
VP8D_DEBUG_CLR_BLK_MODES = 1<<8, VP8D_DEBUG_CLR_BLK_MODES = 1<<8,
VP8D_DEBUG_CLR_FRM_REF_BLKS = 1<<9 VP8D_DEBUG_CLR_FRM_REF_BLKS = 1<<9
}; };
typedef struct
{
int post_proc_flag;
int deblocking_level;
int noise_level;
int display_ref_frame_flag;
int display_mb_modes_flag;
int display_b_modes_flag;
int display_mv_flag;
} vp8_ppflags_t;
#endif #endif
...@@ -506,7 +506,7 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign ...@@ -506,7 +506,7 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign
pbi->common.error.setjmp = 0; pbi->common.error.setjmp = 0;
return retcode; return retcode;
} }
int vp8dx_get_raw_frame(VP8D_PTR ptr, YV12_BUFFER_CONFIG *sd, INT64 *time_stamp, INT64 *time_end_stamp, int deblock_level, int noise_level, int flags) int vp8dx_get_raw_frame(VP8D_PTR ptr, YV12_BUFFER_CONFIG *sd, INT64 *time_stamp, INT64 *time_end_stamp, vp8_ppflags_t *flags)
{ {
int ret = -1; int ret = -1;
VP8D_COMP *pbi = (VP8D_COMP *) ptr; VP8D_COMP *pbi = (VP8D_COMP *) ptr;
...@@ -524,7 +524,7 @@ int vp8dx_get_raw_frame(VP8D_PTR ptr, YV12_BUFFER_CONFIG *sd, INT64 *time_stamp, ...@@ -524,7 +524,7 @@ int vp8dx_get_raw_frame(VP8D_PTR ptr, YV12_BUFFER_CONFIG *sd, INT64 *time_stamp,
sd->clrtype = pbi->common.clr_type; sd->clrtype = pbi->common.clr_type;
#if CONFIG_POSTPROC #if CONFIG_POSTPROC
ret = vp8_post_proc_frame(&pbi->common, sd, deblock_level, noise_level, flags); ret = vp8_post_proc_frame(&pbi->common, sd, flags);
#else #else
if (pbi->common.frame_to_show) if (pbi->common.frame_to_show)
......
...@@ -5224,7 +5224,7 @@ int vp8_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, unsigned lon ...@@ -5224,7 +5224,7 @@ int vp8_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, unsigned lon
return 0; return 0;
} }
int vp8_get_preview_raw_frame(VP8_PTR comp, YV12_BUFFER_CONFIG *dest, int deblock_level, int noise_level, int flags) int vp8_get_preview_raw_frame(VP8_PTR comp, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *flags)
{ {
VP8_COMP *cpi = (VP8_COMP *) comp; VP8_COMP *cpi = (VP8_COMP *) comp;
...@@ -5234,7 +5234,7 @@ int vp8_get_preview_raw_frame(VP8_PTR comp, YV12_BUFFER_CONFIG *dest, int debloc ...@@ -5234,7 +5234,7 @@ int vp8_get_preview_raw_frame(VP8_PTR comp, YV12_BUFFER_CONFIG *dest, int debloc
{ {
int ret; int ret;
#if CONFIG_POSTPROC #if CONFIG_POSTPROC
ret = vp8_post_proc_frame(&cpi->common, dest, deblock_level, noise_level, flags); ret = vp8_post_proc_frame(&cpi->common, dest, flags);
#else #else
if (cpi->common.frame_to_show) if (cpi->common.frame_to_show)
......
...@@ -860,8 +860,16 @@ static vpx_image_t *vp8e_get_preview(vpx_codec_alg_priv_t *ctx) ...@@ -860,8 +860,16 @@ static vpx_image_t *vp8e_get_preview(vpx_codec_alg_priv_t *ctx)
{ {
YV12_BUFFER_CONFIG sd; YV12_BUFFER_CONFIG sd;
vp8_ppflags_t flags = {0};
if (0 == vp8_get_preview_raw_frame(ctx->cpi, &sd, ctx->preview_ppcfg.deblocking_level, ctx->preview_ppcfg.noise_level, ctx->preview_ppcfg.post_proc_flag)) if (ctx->preview_ppcfg.post_proc_flag)
{
flags.post_proc_flag = ctx->preview_ppcfg.post_proc_flag;
flags.deblocking_level = ctx->preview_ppcfg.deblocking_level;
flags.noise_level = ctx->preview_ppcfg.noise_level;
}
if (0 == vp8_get_preview_raw_frame(ctx->cpi, &sd, &flags))
{ {
/* /*
......
...@@ -65,12 +65,19 @@ struct vpx_codec_alg_priv ...@@ -65,12 +65,19 @@ struct vpx_codec_alg_priv
vpx_codec_priv_t base; vpx_codec_priv_t base;
vpx_codec_mmap_t mmaps[NELEMENTS(vp8_mem_req_segs)-1]; vpx_codec_mmap_t mmaps[NELEMENTS(vp8_mem_req_segs)-1];
vpx_codec_dec_cfg_t cfg; vpx_codec_dec_cfg_t cfg;
vp8_stream_info_t si; vp8_stream_info_t si;
int defer_alloc; int defer_alloc;
int decoder_init; int decoder_init;
VP8D_PTR pbi; VP8D_PTR pbi;
int postproc_cfg_set; int postproc_cfg_set;
vp8_postproc_cfg_t postproc_cfg; vp8_postproc_cfg_t postproc_cfg;
#if CONFIG_POSTPROC_VISUALIZER
unsigned int dbg_postproc_flag;
int dbg_color_ref_frame_flag;
int dbg_color_mb_modes_flag;
int dbg_color_b_modes_flag;
int dbg_display_mv_flag;
#endif
vpx_image_t img; vpx_image_t img;
int img_setup; int img_setup;
int img_avail; int img_avail;
...@@ -416,15 +423,27 @@ static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx, ...@@ -416,15 +423,27 @@ static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx,
{ {
YV12_BUFFER_CONFIG sd; YV12_BUFFER_CONFIG sd;
INT64 time_stamp = 0, time_end_stamp = 0; INT64 time_stamp = 0, time_end_stamp = 0;
int ppflag = 0; vp8_ppflags_t flags = {0};
int ppdeblocking = 0;
int ppnoise = 0;
if (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC) if (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC)
{ {
ppflag = ctx->postproc_cfg.post_proc_flag; flags.post_proc_flag= ctx->postproc_cfg.post_proc_flag
ppdeblocking = ctx->postproc_cfg.deblocking_level; #if CONFIG_POSTPROC_VISUALIZER
ppnoise = ctx->postproc_cfg.noise_level;
| ((ctx->dbg_color_ref_frame_flag != 0) ? VP8D_DEBUG_CLR_FRM_REF_BLKS : 0)
| ((ctx->dbg_color_mb_modes_flag != 0) ? VP8D_DEBUG_CLR_BLK_MODES : 0)
| ((ctx->dbg_color_b_modes_flag != 0) ? VP8D_DEBUG_CLR_BLK_MODES : 0)
| ((ctx->dbg_display_mv_flag != 0) ? VP8D_DEBUG_DRAW_MV : 0)
#endif
;
flags.deblocking_level = ctx->postproc_cfg.deblocking_level;
flags.noise_level = ctx->postproc_cfg.noise_level;
#if CONFIG_POSTPROC_VISUALIZER
flags.display_ref_frame_flag= ctx->dbg_color_ref_frame_flag;
flags.display_mb_modes_flag = ctx->dbg_color_mb_modes_flag;
flags.display_b_modes_flag = ctx->dbg_color_b_modes_flag;
flags.display_mv_flag = ctx->dbg_display_mv_flag;
#endif