vp8: remove VP8_SET_DBG* control support
the --enable-postproc-visualizer configure option remains as a no-op as do the control names and values for compatibility + remove the corresponding debug flags from vpxdec: --pp-* Change-Id: I4a001cd9962b59560d7d6bda6272d4ff32b8d37c
This commit is contained in:
parent
b6e686b1ea
commit
3f72509587
@ -160,10 +160,6 @@ typedef struct VP8Common {
|
||||
#ifdef PACKET_TESTING
|
||||
VP8_HEADER oh;
|
||||
#endif
|
||||
#if CONFIG_POSTPROC_VISUALIZER
|
||||
double bitrate;
|
||||
double framerate;
|
||||
#endif
|
||||
|
||||
#if CONFIG_MULTITHREAD
|
||||
int processor_core_count;
|
||||
|
@ -37,46 +37,6 @@
|
||||
(0.071 * (float)(t & 0xff)) + 128)
|
||||
/* clang-format on */
|
||||
|
||||
/* global constants */
|
||||
#if CONFIG_POSTPROC_VISUALIZER
|
||||
static const unsigned char MB_PREDICTION_MODE_colors[MB_MODE_COUNT][3] = {
|
||||
{ RGB_TO_YUV(0x98FB98) }, /* PaleGreen */
|
||||
{ RGB_TO_YUV(0x00FF00) }, /* Green */
|
||||
{ RGB_TO_YUV(0xADFF2F) }, /* GreenYellow */
|
||||
{ RGB_TO_YUV(0x228B22) }, /* ForestGreen */
|
||||
{ RGB_TO_YUV(0x006400) }, /* DarkGreen */
|
||||
{ RGB_TO_YUV(0x98F5FF) }, /* Cadet Blue */
|
||||
{ RGB_TO_YUV(0x6CA6CD) }, /* Sky Blue */
|
||||
{ RGB_TO_YUV(0x00008B) }, /* Dark blue */
|
||||
{ RGB_TO_YUV(0x551A8B) }, /* Purple */
|
||||
{ RGB_TO_YUV(0xFF0000) } /* Red */
|
||||
};
|
||||
|
||||
static const unsigned char B_PREDICTION_MODE_colors[B_MODE_COUNT][3] = {
|
||||
{ RGB_TO_YUV(0x6633ff) }, /* Purple */
|
||||
{ RGB_TO_YUV(0xcc33ff) }, /* Magenta */
|
||||
{ RGB_TO_YUV(0xff33cc) }, /* Pink */
|
||||
{ RGB_TO_YUV(0xff3366) }, /* Coral */
|
||||
{ RGB_TO_YUV(0x3366ff) }, /* Blue */
|
||||
{ RGB_TO_YUV(0xed00f5) }, /* Dark Blue */
|
||||
{ RGB_TO_YUV(0x2e00b8) }, /* Dark Purple */
|
||||
{ RGB_TO_YUV(0xff6633) }, /* Orange */
|
||||
{ RGB_TO_YUV(0x33ccff) }, /* Light Blue */
|
||||
{ RGB_TO_YUV(0x8ab800) }, /* Green */
|
||||
{ RGB_TO_YUV(0xffcc33) }, /* Light Orange */
|
||||
{ RGB_TO_YUV(0x33ffcc) }, /* Aqua */
|
||||
{ RGB_TO_YUV(0x66ff33) }, /* Light Green */
|
||||
{ RGB_TO_YUV(0xccff33) }, /* Yellow */
|
||||
};
|
||||
|
||||
static const unsigned char MV_REFERENCE_FRAME_colors[MAX_REF_FRAMES][3] = {
|
||||
{ RGB_TO_YUV(0x00ff00) }, /* Blue */
|
||||
{ RGB_TO_YUV(0x0000ff) }, /* Green */
|
||||
{ RGB_TO_YUV(0xffff00) }, /* Yellow */
|
||||
{ RGB_TO_YUV(0xff0000) }, /* Red */
|
||||
};
|
||||
#endif
|
||||
|
||||
extern void vp8_blit_text(const char *msg, unsigned char *address,
|
||||
const int pitch);
|
||||
extern void vp8_blit_line(int x0, int x1, int y0, int y1, unsigned char *image,
|
||||
@ -308,43 +268,6 @@ void vp8_blend_b_c(unsigned char *y, unsigned char *u, unsigned char *v,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_POSTPROC_VISUALIZER
|
||||
static void constrain_line(int x_0, int *x_1, int y_0, int *y_1, int width,
|
||||
int height) {
|
||||
int dx;
|
||||
int dy;
|
||||
|
||||
if (*x_1 > width) {
|
||||
dx = *x_1 - x_0;
|
||||
dy = *y_1 - y_0;
|
||||
|
||||
*x_1 = width;
|
||||
if (dx) *y_1 = ((width - x_0) * dy) / dx + y_0;
|
||||
}
|
||||
if (*x_1 < 0) {
|
||||
dx = *x_1 - x_0;
|
||||
dy = *y_1 - y_0;
|
||||
|
||||
*x_1 = 0;
|
||||
if (dx) *y_1 = ((0 - x_0) * dy) / dx + y_0;
|
||||
}
|
||||
if (*y_1 > height) {
|
||||
dx = *x_1 - x_0;
|
||||
dy = *y_1 - y_0;
|
||||
|
||||
*y_1 = height;
|
||||
if (dy) *x_1 = ((height - y_0) * dx) / dy + x_0;
|
||||
}
|
||||
if (*y_1 < 0) {
|
||||
dx = *x_1 - x_0;
|
||||
dy = *y_1 - y_0;
|
||||
|
||||
*y_1 = 0;
|
||||
if (dy) *x_1 = ((0 - y_0) * dx) / dy + x_0;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_POSTPROC_VISUALIZER
|
||||
|
||||
#if CONFIG_POSTPROC
|
||||
int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest,
|
||||
vp8_ppflags_t *ppflags) {
|
||||
@ -455,331 +378,6 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest,
|
||||
oci->post_proc_buffer.y_stride);
|
||||
}
|
||||
|
||||
#if CONFIG_POSTPROC_VISUALIZER
|
||||
if (flags & VP8D_DEBUG_TXT_FRAME_INFO) {
|
||||
char message[512];
|
||||
sprintf(message, "F%1dG%1dQ%3dF%3dP%d_s%dx%d",
|
||||
(oci->frame_type == KEY_FRAME), oci->refresh_golden_frame,
|
||||
oci->base_qindex, oci->filter_level, flags, oci->mb_cols,
|
||||
oci->mb_rows);
|
||||
vp8_blit_text(message, oci->post_proc_buffer.y_buffer,
|
||||
oci->post_proc_buffer.y_stride);
|
||||
}
|
||||
|
||||
if (flags & VP8D_DEBUG_TXT_MBLK_MODES) {
|
||||
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.mode + 'a');
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & VP8D_DEBUG_TXT_DC_DIFF) {
|
||||
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];
|
||||
int dc_diff = !(mi[mb_index].mbmi.mode != B_PRED &&
|
||||
mi[mb_index].mbmi.mode != SPLITMV &&
|
||||
mi[mb_index].mbmi.mb_skip_coeff);
|
||||
|
||||
if (oci->frame_type == KEY_FRAME)
|
||||
sprintf(zz, "a");
|
||||
else
|
||||
sprintf(zz, "%c", 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;
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & VP8D_DEBUG_TXT_RATE_INFO) {
|
||||
char message[512];
|
||||
sprintf(message, "Bitrate: %10.2f framerate: %10.2f ", oci->bitrate,
|
||||
oci->framerate);
|
||||
vp8_blit_text(message, oci->post_proc_buffer.y_buffer,
|
||||
oci->post_proc_buffer.y_stride);
|
||||
}
|
||||
|
||||
/* Draw motion vectors */
|
||||
if ((flags & VP8D_DEBUG_DRAW_MV) && ppflags->display_mv_flag) {
|
||||
YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer;
|
||||
int width = post->y_width;
|
||||
int height = post->y_height;
|
||||
unsigned char *y_buffer = oci->post_proc_buffer.y_buffer;
|
||||
int y_stride = oci->post_proc_buffer.y_stride;
|
||||
MODE_INFO *mi = oci->mi;
|
||||
int x0, y0;
|
||||
|
||||
for (y0 = 0; y0 < height; y0 += 16) {
|
||||
for (x0 = 0; x0 < width; x0 += 16) {
|
||||
int x1, y1;
|
||||
|
||||
if (!(ppflags->display_mv_flag & (1 << mi->mbmi.mode))) {
|
||||
mi++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mi->mbmi.mode == SPLITMV) {
|
||||
switch (mi->mbmi.partitioning) {
|
||||
case 0: /* mv_top_bottom */
|
||||
{
|
||||
union b_mode_info *bmi = &mi->bmi[0];
|
||||
MV *mv = &bmi->mv.as_mv;
|
||||
|
||||
x1 = x0 + 8 + (mv->col >> 3);
|
||||
y1 = y0 + 4 + (mv->row >> 3);
|
||||
|
||||
constrain_line(x0 + 8, &x1, y0 + 4, &y1, width, height);
|
||||
vp8_blit_line(x0 + 8, x1, y0 + 4, y1, y_buffer, y_stride);
|
||||
|
||||
bmi = &mi->bmi[8];
|
||||
|
||||
x1 = x0 + 8 + (mv->col >> 3);
|
||||
y1 = y0 + 12 + (mv->row >> 3);
|
||||
|
||||
constrain_line(x0 + 8, &x1, y0 + 12, &y1, width, height);
|
||||
vp8_blit_line(x0 + 8, x1, y0 + 12, y1, y_buffer, y_stride);
|
||||
|
||||
break;
|
||||
}
|
||||
case 1: /* mv_left_right */
|
||||
{
|
||||
union b_mode_info *bmi = &mi->bmi[0];
|
||||
MV *mv = &bmi->mv.as_mv;
|
||||
|
||||
x1 = x0 + 4 + (mv->col >> 3);
|
||||
y1 = y0 + 8 + (mv->row >> 3);
|
||||
|
||||
constrain_line(x0 + 4, &x1, y0 + 8, &y1, width, height);
|
||||
vp8_blit_line(x0 + 4, x1, y0 + 8, y1, y_buffer, y_stride);
|
||||
|
||||
bmi = &mi->bmi[2];
|
||||
|
||||
x1 = x0 + 12 + (mv->col >> 3);
|
||||
y1 = y0 + 8 + (mv->row >> 3);
|
||||
|
||||
constrain_line(x0 + 12, &x1, y0 + 8, &y1, width, height);
|
||||
vp8_blit_line(x0 + 12, x1, y0 + 8, y1, y_buffer, y_stride);
|
||||
|
||||
break;
|
||||
}
|
||||
case 2: /* mv_quarters */
|
||||
{
|
||||
union b_mode_info *bmi = &mi->bmi[0];
|
||||
MV *mv = &bmi->mv.as_mv;
|
||||
|
||||
x1 = x0 + 4 + (mv->col >> 3);
|
||||
y1 = y0 + 4 + (mv->row >> 3);
|
||||
|
||||
constrain_line(x0 + 4, &x1, y0 + 4, &y1, width, height);
|
||||
vp8_blit_line(x0 + 4, x1, y0 + 4, y1, y_buffer, y_stride);
|
||||
|
||||
bmi = &mi->bmi[2];
|
||||
|
||||
x1 = x0 + 12 + (mv->col >> 3);
|
||||
y1 = y0 + 4 + (mv->row >> 3);
|
||||
|
||||
constrain_line(x0 + 12, &x1, y0 + 4, &y1, width, height);
|
||||
vp8_blit_line(x0 + 12, x1, y0 + 4, y1, y_buffer, y_stride);
|
||||
|
||||
bmi = &mi->bmi[8];
|
||||
|
||||
x1 = x0 + 4 + (mv->col >> 3);
|
||||
y1 = y0 + 12 + (mv->row >> 3);
|
||||
|
||||
constrain_line(x0 + 4, &x1, y0 + 12, &y1, width, height);
|
||||
vp8_blit_line(x0 + 4, x1, y0 + 12, y1, y_buffer, y_stride);
|
||||
|
||||
bmi = &mi->bmi[10];
|
||||
|
||||
x1 = x0 + 12 + (mv->col >> 3);
|
||||
y1 = y0 + 12 + (mv->row >> 3);
|
||||
|
||||
constrain_line(x0 + 12, &x1, y0 + 12, &y1, width, height);
|
||||
vp8_blit_line(x0 + 12, x1, y0 + 12, y1, y_buffer, y_stride);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
union b_mode_info *bmi = mi->bmi;
|
||||
int bx0, by0;
|
||||
|
||||
for (by0 = y0; by0 < (y0 + 16); by0 += 4) {
|
||||
for (bx0 = x0; bx0 < (x0 + 16); bx0 += 4) {
|
||||
MV *mv = &bmi->mv.as_mv;
|
||||
|
||||
x1 = bx0 + 2 + (mv->col >> 3);
|
||||
y1 = by0 + 2 + (mv->row >> 3);
|
||||
|
||||
constrain_line(bx0 + 2, &x1, by0 + 2, &y1, width, height);
|
||||
vp8_blit_line(bx0 + 2, x1, by0 + 2, y1, y_buffer, y_stride);
|
||||
|
||||
bmi++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (mi->mbmi.mode >= NEARESTMV) {
|
||||
MV *mv = &mi->mbmi.mv.as_mv;
|
||||
const int lx0 = x0 + 8;
|
||||
const int ly0 = y0 + 8;
|
||||
|
||||
x1 = lx0 + (mv->col >> 3);
|
||||
y1 = ly0 + (mv->row >> 3);
|
||||
|
||||
if (x1 != lx0 && y1 != ly0) {
|
||||
constrain_line(lx0, &x1, ly0 - 1, &y1, width, height);
|
||||
vp8_blit_line(lx0, x1, ly0 - 1, y1, y_buffer, y_stride);
|
||||
|
||||
constrain_line(lx0, &x1, ly0 + 1, &y1, width, height);
|
||||
vp8_blit_line(lx0, x1, ly0 + 1, y1, y_buffer, y_stride);
|
||||
} else
|
||||
vp8_blit_line(lx0, x1, ly0, y1, y_buffer, y_stride);
|
||||
}
|
||||
|
||||
mi++;
|
||||
}
|
||||
mi++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Color in block modes */
|
||||
if ((flags & VP8D_DEBUG_CLR_BLK_MODES) &&
|
||||
(ppflags->display_mb_modes_flag || ppflags->display_b_modes_flag)) {
|
||||
int y, x;
|
||||
YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer;
|
||||
int width = post->y_width;
|
||||
int height = post->y_height;
|
||||
unsigned char *y_ptr = oci->post_proc_buffer.y_buffer;
|
||||
unsigned char *u_ptr = oci->post_proc_buffer.u_buffer;
|
||||
unsigned char *v_ptr = oci->post_proc_buffer.v_buffer;
|
||||
int y_stride = oci->post_proc_buffer.y_stride;
|
||||
MODE_INFO *mi = oci->mi;
|
||||
|
||||
for (y = 0; y < height; y += 16) {
|
||||
for (x = 0; x < width; x += 16) {
|
||||
int Y = 0, U = 0, V = 0;
|
||||
|
||||
if (mi->mbmi.mode == B_PRED &&
|
||||
((ppflags->display_mb_modes_flag & B_PRED) ||
|
||||
ppflags->display_b_modes_flag)) {
|
||||
int by, bx;
|
||||
unsigned char *yl, *ul, *vl;
|
||||
union b_mode_info *bmi = mi->bmi;
|
||||
|
||||
yl = y_ptr + x;
|
||||
ul = u_ptr + (x >> 1);
|
||||
vl = v_ptr + (x >> 1);
|
||||
|
||||
for (by = 0; by < 16; by += 4) {
|
||||
for (bx = 0; bx < 16; bx += 4) {
|
||||
if ((ppflags->display_b_modes_flag & (1 << mi->mbmi.mode)) ||
|
||||
(ppflags->display_mb_modes_flag & B_PRED)) {
|
||||
Y = B_PREDICTION_MODE_colors[bmi->as_mode][0];
|
||||
U = B_PREDICTION_MODE_colors[bmi->as_mode][1];
|
||||
V = B_PREDICTION_MODE_colors[bmi->as_mode][2];
|
||||
|
||||
vp8_blend_b(yl + bx, ul + (bx >> 1), vl + (bx >> 1), Y, U, V,
|
||||
0xc000, y_stride);
|
||||
}
|
||||
bmi++;
|
||||
}
|
||||
|
||||
yl += y_stride * 4;
|
||||
ul += y_stride * 1;
|
||||
vl += y_stride * 1;
|
||||
}
|
||||
} else if (ppflags->display_mb_modes_flag & (1 << mi->mbmi.mode)) {
|
||||
Y = MB_PREDICTION_MODE_colors[mi->mbmi.mode][0];
|
||||
U = MB_PREDICTION_MODE_colors[mi->mbmi.mode][1];
|
||||
V = MB_PREDICTION_MODE_colors[mi->mbmi.mode][2];
|
||||
|
||||
vp8_blend_mb_inner(y_ptr + x, u_ptr + (x >> 1), v_ptr + (x >> 1), Y,
|
||||
U, V, 0xc000, y_stride);
|
||||
}
|
||||
|
||||
mi++;
|
||||
}
|
||||
y_ptr += y_stride * 16;
|
||||
u_ptr += y_stride * 4;
|
||||
v_ptr += y_stride * 4;
|
||||
|
||||
mi++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Color in frame reference blocks */
|
||||
if ((flags & VP8D_DEBUG_CLR_FRM_REF_BLKS) &&
|
||||
ppflags->display_ref_frame_flag) {
|
||||
int y, x;
|
||||
YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer;
|
||||
int width = post->y_width;
|
||||
int height = post->y_height;
|
||||
unsigned char *y_ptr = oci->post_proc_buffer.y_buffer;
|
||||
unsigned char *u_ptr = oci->post_proc_buffer.u_buffer;
|
||||
unsigned char *v_ptr = oci->post_proc_buffer.v_buffer;
|
||||
int y_stride = oci->post_proc_buffer.y_stride;
|
||||
MODE_INFO *mi = oci->mi;
|
||||
|
||||
for (y = 0; y < height; y += 16) {
|
||||
for (x = 0; x < width; x += 16) {
|
||||
int Y = 0, U = 0, V = 0;
|
||||
|
||||
if (ppflags->display_ref_frame_flag & (1 << mi->mbmi.ref_frame)) {
|
||||
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];
|
||||
|
||||
vp8_blend_mb_outer(y_ptr + x, u_ptr + (x >> 1), v_ptr + (x >> 1), Y,
|
||||
U, V, 0xc000, y_stride);
|
||||
}
|
||||
|
||||
mi++;
|
||||
}
|
||||
y_ptr += y_stride * 16;
|
||||
u_ptr += y_stride * 4;
|
||||
v_ptr += y_stride * 4;
|
||||
|
||||
mi++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
*dest = oci->post_proc_buffer;
|
||||
|
||||
/* handle problem with extending borders */
|
||||
|
@ -1,118 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
void vp8_blit_text(const char *msg, unsigned char *address, const int pitch) {
|
||||
int letter_bitmap;
|
||||
unsigned char *output_pos = address;
|
||||
int colpos;
|
||||
const int font[] = {
|
||||
0x0, 0x5C00, 0x8020, 0xAFABEA, 0xD7EC0, 0x1111111, 0x1855740,
|
||||
0x18000, 0x45C0, 0x74400, 0x51140, 0x23880, 0xC4000, 0x21080,
|
||||
0x80000, 0x111110, 0xE9D72E, 0x87E40, 0x12AD732, 0xAAD62A, 0x4F94C4,
|
||||
0x4D6B7, 0x456AA, 0x3E8423, 0xAAD6AA, 0xAAD6A2, 0x2800, 0x2A00,
|
||||
0x8A880, 0x52940, 0x22A20, 0x15422, 0x6AD62E, 0x1E4A53E, 0xAAD6BF,
|
||||
0x8C62E, 0xE8C63F, 0x118D6BF, 0x1094BF, 0xCAC62E, 0x1F2109F, 0x118FE31,
|
||||
0xF8C628, 0x8A89F, 0x108421F, 0x1F1105F, 0x1F4105F, 0xE8C62E, 0x2294BF,
|
||||
0x164C62E, 0x12694BF, 0x8AD6A2, 0x10FC21, 0x1F8421F, 0x744107, 0xF8220F,
|
||||
0x1151151, 0x117041, 0x119D731, 0x47E0, 0x1041041, 0xFC400, 0x10440,
|
||||
0x1084210, 0x820
|
||||
};
|
||||
colpos = 0;
|
||||
|
||||
while (msg[colpos] != 0) {
|
||||
char letter = msg[colpos];
|
||||
int fontcol, fontrow;
|
||||
|
||||
if (letter <= 'Z' && letter >= ' ')
|
||||
letter_bitmap = font[letter - ' '];
|
||||
else if (letter <= 'z' && letter >= 'a')
|
||||
letter_bitmap = font[letter - 'a' + 'A' - ' '];
|
||||
else
|
||||
letter_bitmap = font[0];
|
||||
|
||||
for (fontcol = 6; fontcol >= 0; fontcol--)
|
||||
for (fontrow = 0; fontrow < 5; ++fontrow)
|
||||
output_pos[fontrow * pitch + fontcol] =
|
||||
((letter_bitmap >> (fontcol * 5)) & (1 << fontrow) ? 255 : 0);
|
||||
|
||||
output_pos += 7;
|
||||
colpos++;
|
||||
}
|
||||
}
|
||||
|
||||
static void plot(const int x, const int y, unsigned char *image,
|
||||
const int pitch) {
|
||||
image[x + y * pitch] ^= 255;
|
||||
}
|
||||
|
||||
/* Bresenham line algorithm */
|
||||
void vp8_blit_line(int x0, int x1, int y0, int y1, unsigned char *image,
|
||||
const int pitch) {
|
||||
int steep = abs(y1 - y0) > abs(x1 - x0);
|
||||
int deltax, deltay;
|
||||
int error, ystep, y, x;
|
||||
|
||||
if (steep) {
|
||||
int t;
|
||||
t = x0;
|
||||
x0 = y0;
|
||||
y0 = t;
|
||||
|
||||
t = x1;
|
||||
x1 = y1;
|
||||
y1 = t;
|
||||
}
|
||||
|
||||
if (x0 > x1) {
|
||||
int t;
|
||||
t = x0;
|
||||
x0 = x1;
|
||||
x1 = t;
|
||||
|
||||
t = y0;
|
||||
y0 = y1;
|
||||
y1 = t;
|
||||
}
|
||||
|
||||
deltax = x1 - x0;
|
||||
deltay = abs(y1 - y0);
|
||||
error = deltax / 2;
|
||||
|
||||
y = y0;
|
||||
|
||||
if (y0 < y1)
|
||||
ystep = 1;
|
||||
else
|
||||
ystep = -1;
|
||||
|
||||
if (steep) {
|
||||
for (x = x0; x <= x1; ++x) {
|
||||
plot(y, x, image, pitch);
|
||||
|
||||
error = error - deltay;
|
||||
if (error < 0) {
|
||||
y = y + ystep;
|
||||
error = error + deltax;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (x = x0; x <= x1; ++x) {
|
||||
plot(x, y, image, pitch);
|
||||
|
||||
error = error - deltay;
|
||||
if (error < 0) {
|
||||
y = y + ystep;
|
||||
error = error + deltax;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -68,7 +68,6 @@ VP8_COMMON_SRCS-yes += common/vp8_entropymodedata.h
|
||||
|
||||
|
||||
|
||||
VP8_COMMON_SRCS-$(CONFIG_POSTPROC_VISUALIZER) += common/textblit.c
|
||||
VP8_COMMON_SRCS-yes += common/treecoder.c
|
||||
|
||||
VP8_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/filter_x86.c
|
||||
|
@ -46,13 +46,6 @@ struct vpx_codec_alg_priv {
|
||||
int decoder_init;
|
||||
int postproc_cfg_set;
|
||||
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_decrypt_cb decrypt_cb;
|
||||
void *decrypt_state;
|
||||
vpx_image_t img;
|
||||
@ -478,22 +471,8 @@ static vpx_image_t *vp8_get_frame(vpx_codec_alg_priv_t *ctx,
|
||||
|
||||
if (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC) {
|
||||
flags.post_proc_flag = ctx->postproc_cfg.post_proc_flag;
|
||||
#if CONFIG_POSTPROC_VISUALIZER
|
||||
flags.post_proc_flag |=
|
||||
((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
|
||||
}
|
||||
|
||||
if (0 == vp8dx_get_raw_frame(ctx->yv12_frame_buffers.pbi[0], &sd,
|
||||
@ -589,54 +568,6 @@ static vpx_codec_err_t vp8_set_postproc(vpx_codec_alg_priv_t *ctx,
|
||||
#endif
|
||||
}
|
||||
|
||||
static vpx_codec_err_t vp8_set_dbg_color_ref_frame(vpx_codec_alg_priv_t *ctx,
|
||||
va_list args) {
|
||||
#if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
|
||||
ctx->dbg_color_ref_frame_flag = va_arg(args, int);
|
||||
return VPX_CODEC_OK;
|
||||
#else
|
||||
(void)ctx;
|
||||
(void)args;
|
||||
return VPX_CODEC_INCAPABLE;
|
||||
#endif
|
||||
}
|
||||
|
||||
static vpx_codec_err_t vp8_set_dbg_color_mb_modes(vpx_codec_alg_priv_t *ctx,
|
||||
va_list args) {
|
||||
#if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
|
||||
ctx->dbg_color_mb_modes_flag = va_arg(args, int);
|
||||
return VPX_CODEC_OK;
|
||||
#else
|
||||
(void)ctx;
|
||||
(void)args;
|
||||
return VPX_CODEC_INCAPABLE;
|
||||
#endif
|
||||
}
|
||||
|
||||
static vpx_codec_err_t vp8_set_dbg_color_b_modes(vpx_codec_alg_priv_t *ctx,
|
||||
va_list args) {
|
||||
#if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
|
||||
ctx->dbg_color_b_modes_flag = va_arg(args, int);
|
||||
return VPX_CODEC_OK;
|
||||
#else
|
||||
(void)ctx;
|
||||
(void)args;
|
||||
return VPX_CODEC_INCAPABLE;
|
||||
#endif
|
||||
}
|
||||
|
||||
static vpx_codec_err_t vp8_set_dbg_display_mv(vpx_codec_alg_priv_t *ctx,
|
||||
va_list args) {
|
||||
#if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
|
||||
ctx->dbg_display_mv_flag = va_arg(args, int);
|
||||
return VPX_CODEC_OK;
|
||||
#else
|
||||
(void)ctx;
|
||||
(void)args;
|
||||
return VPX_CODEC_INCAPABLE;
|
||||
#endif
|
||||
}
|
||||
|
||||
static vpx_codec_err_t vp8_get_last_ref_updates(vpx_codec_alg_priv_t *ctx,
|
||||
va_list args) {
|
||||
int *update_info = va_arg(args, int *);
|
||||
@ -706,10 +637,6 @@ vpx_codec_ctrl_fn_map_t vp8_ctf_maps[] = {
|
||||
{ VP8_SET_REFERENCE, vp8_set_reference },
|
||||
{ VP8_COPY_REFERENCE, vp8_get_reference },
|
||||
{ VP8_SET_POSTPROC, vp8_set_postproc },
|
||||
{ VP8_SET_DBG_COLOR_REF_FRAME, vp8_set_dbg_color_ref_frame },
|
||||
{ VP8_SET_DBG_COLOR_MB_MODES, vp8_set_dbg_color_mb_modes },
|
||||
{ VP8_SET_DBG_COLOR_B_MODES, vp8_set_dbg_color_b_modes },
|
||||
{ VP8_SET_DBG_DISPLAY_MV, vp8_set_dbg_display_mv },
|
||||
{ VP8D_GET_LAST_REF_UPDATES, vp8_get_last_ref_updates },
|
||||
{ VP8D_GET_FRAME_CORRUPTED, vp8_get_frame_corrupted },
|
||||
{ VP8D_GET_LAST_REF_USED, vp8_get_last_ref_frame },
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
#include "vp9/common/vp9_onyxc_int.h"
|
||||
#include "vp9/common/vp9_postproc.h"
|
||||
#include "vp9/common/vp9_textblit.h"
|
||||
|
||||
#if CONFIG_VP9_POSTPROC
|
||||
|
||||
|
@ -1,119 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "vp9/common/vp9_textblit.h"
|
||||
|
||||
static const int font[] = {
|
||||
0x0, 0x5C00, 0x8020, 0xAFABEA, 0xD7EC0, 0x1111111, 0x1855740,
|
||||
0x18000, 0x45C0, 0x74400, 0x51140, 0x23880, 0xC4000, 0x21080,
|
||||
0x80000, 0x111110, 0xE9D72E, 0x87E40, 0x12AD732, 0xAAD62A, 0x4F94C4,
|
||||
0x4D6B7, 0x456AA, 0x3E8423, 0xAAD6AA, 0xAAD6A2, 0x2800, 0x2A00,
|
||||
0x8A880, 0x52940, 0x22A20, 0x15422, 0x6AD62E, 0x1E4A53E, 0xAAD6BF,
|
||||
0x8C62E, 0xE8C63F, 0x118D6BF, 0x1094BF, 0xCAC62E, 0x1F2109F, 0x118FE31,
|
||||
0xF8C628, 0x8A89F, 0x108421F, 0x1F1105F, 0x1F4105F, 0xE8C62E, 0x2294BF,
|
||||
0x164C62E, 0x12694BF, 0x8AD6A2, 0x10FC21, 0x1F8421F, 0x744107, 0xF8220F,
|
||||
0x1151151, 0x117041, 0x119D731, 0x47E0, 0x1041041, 0xFC400, 0x10440,
|
||||
0x1084210, 0x820
|
||||
};
|
||||
|
||||
static void plot(int x, int y, unsigned char *image, int pitch) {
|
||||
image[x + y * pitch] ^= 255;
|
||||
}
|
||||
|
||||
void vp9_blit_text(const char *msg, unsigned char *address, const int pitch) {
|
||||
int letter_bitmap;
|
||||
unsigned char *output_pos = address;
|
||||
int colpos = 0;
|
||||
|
||||
while (msg[colpos] != 0) {
|
||||
char letter = msg[colpos];
|
||||
int fontcol, fontrow;
|
||||
|
||||
if (letter <= 'Z' && letter >= ' ')
|
||||
letter_bitmap = font[letter - ' '];
|
||||
else if (letter <= 'z' && letter >= 'a')
|
||||
letter_bitmap = font[letter - 'a' + 'A' - ' '];
|
||||
else
|
||||
letter_bitmap = font[0];
|
||||
|
||||
for (fontcol = 6; fontcol >= 0; fontcol--)
|
||||
for (fontrow = 0; fontrow < 5; fontrow++)
|
||||
output_pos[fontrow * pitch + fontcol] =
|
||||
((letter_bitmap >> (fontcol * 5)) & (1 << fontrow) ? 255 : 0);
|
||||
|
||||
output_pos += 7;
|
||||
colpos++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Bresenham line algorithm */
|
||||
void vp9_blit_line(int x0, int x1, int y0, int y1, unsigned char *image,
|
||||
int pitch) {
|
||||
int steep = abs(y1 - y0) > abs(x1 - x0);
|
||||
int deltax, deltay;
|
||||
int error, ystep, y, x;
|
||||
|
||||
if (steep) {
|
||||
int t;
|
||||
t = x0;
|
||||
x0 = y0;
|
||||
y0 = t;
|
||||
|
||||
t = x1;
|
||||
x1 = y1;
|
||||
y1 = t;
|
||||
}
|
||||
|
||||
if (x0 > x1) {
|
||||
int t;
|
||||
t = x0;
|
||||
x0 = x1;
|
||||
x1 = t;
|
||||
|
||||
t = y0;
|
||||
y0 = y1;
|
||||
y1 = t;
|
||||
}
|
||||
|
||||
deltax = x1 - x0;
|
||||
deltay = abs(y1 - y0);
|
||||
error = deltax / 2;
|
||||
|
||||
y = y0;
|
||||
|
||||
if (y0 < y1)
|
||||
ystep = 1;
|
||||
else
|
||||
ystep = -1;
|
||||
|
||||
if (steep) {
|
||||
for (x = x0; x <= x1; x++) {
|
||||
plot(y, x, image, pitch);
|
||||
|
||||
error = error - deltay;
|
||||
if (error < 0) {
|
||||
y = y + ystep;
|
||||
error = error + deltax;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (x = x0; x <= x1; x++) {
|
||||
plot(x, y, image, pitch);
|
||||
|
||||
error = error - deltay;
|
||||
if (error < 0) {
|
||||
y = y + ystep;
|
||||
error = error + deltax;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef VP9_COMMON_VP9_TEXTBLIT_H_
|
||||
#define VP9_COMMON_VP9_TEXTBLIT_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void vp9_blit_text(const char *msg, unsigned char *address, int pitch);
|
||||
|
||||
void vp9_blit_line(int x0, int x1, int y0, int y1, unsigned char *image,
|
||||
int pitch);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // VP9_COMMON_VP9_TEXTBLIT_H_
|
@ -45,7 +45,6 @@ VP9_COMMON_SRCS-yes += common/vp9_scale.h
|
||||
VP9_COMMON_SRCS-yes += common/vp9_scale.c
|
||||
VP9_COMMON_SRCS-yes += common/vp9_seg_common.h
|
||||
VP9_COMMON_SRCS-yes += common/vp9_seg_common.c
|
||||
VP9_COMMON_SRCS-yes += common/vp9_textblit.h
|
||||
VP9_COMMON_SRCS-yes += common/vp9_tile_common.h
|
||||
VP9_COMMON_SRCS-yes += common/vp9_tile_common.c
|
||||
VP9_COMMON_SRCS-yes += common/vp9_loopfilter.c
|
||||
@ -55,7 +54,6 @@ VP9_COMMON_SRCS-yes += common/vp9_mvref_common.h
|
||||
VP9_COMMON_SRCS-yes += common/vp9_quant_common.c
|
||||
VP9_COMMON_SRCS-yes += common/vp9_reconinter.c
|
||||
VP9_COMMON_SRCS-yes += common/vp9_reconintra.c
|
||||
VP9_COMMON_SRCS-$(CONFIG_POSTPROC_VISUALIZER) += common/vp9_textblit.c
|
||||
VP9_COMMON_SRCS-yes += common/vp9_common_data.c
|
||||
VP9_COMMON_SRCS-yes += common/vp9_common_data.h
|
||||
VP9_COMMON_SRCS-yes += common/vp9_scan.c
|
||||
|
@ -829,13 +829,6 @@ static vpx_codec_err_t ctrl_set_postproc(vpx_codec_alg_priv_t *ctx,
|
||||
#endif
|
||||
}
|
||||
|
||||
static vpx_codec_err_t ctrl_set_dbg_options(vpx_codec_alg_priv_t *ctx,
|
||||
va_list args) {
|
||||
(void)ctx;
|
||||
(void)args;
|
||||
return VPX_CODEC_INCAPABLE;
|
||||
}
|
||||
|
||||
static vpx_codec_err_t ctrl_get_last_ref_updates(vpx_codec_alg_priv_t *ctx,
|
||||
va_list args) {
|
||||
int *const update_info = va_arg(args, int *);
|
||||
@ -1014,10 +1007,6 @@ static vpx_codec_ctrl_fn_map_t decoder_ctrl_maps[] = {
|
||||
// Setters
|
||||
{ VP8_SET_REFERENCE, ctrl_set_reference },
|
||||
{ VP8_SET_POSTPROC, ctrl_set_postproc },
|
||||
{ VP8_SET_DBG_COLOR_REF_FRAME, ctrl_set_dbg_options },
|
||||
{ VP8_SET_DBG_COLOR_MB_MODES, ctrl_set_dbg_options },
|
||||
{ VP8_SET_DBG_COLOR_B_MODES, ctrl_set_dbg_options },
|
||||
{ VP8_SET_DBG_DISPLAY_MV, ctrl_set_dbg_options },
|
||||
{ VP9_INVERT_TILE_DECODE_ORDER, ctrl_set_invert_tile_order },
|
||||
{ VPXD_SET_DECRYPTOR, ctrl_set_decryptor },
|
||||
{ VP9_SET_BYTE_ALIGNMENT, ctrl_set_byte_alignment },
|
||||
|
17
vpx/vp8.h
17
vpx/vp8.h
@ -47,11 +47,10 @@ enum vp8_com_control_id {
|
||||
VP8_SET_REFERENCE = 1,
|
||||
VP8_COPY_REFERENCE = 2, /**< get a copy of reference frame from the decoder */
|
||||
VP8_SET_POSTPROC = 3, /**< set the decoder's post processing settings */
|
||||
VP8_SET_DBG_COLOR_REF_FRAME =
|
||||
4, /**< set the reference frames to color for each macroblock */
|
||||
VP8_SET_DBG_COLOR_MB_MODES = 5, /**< set which macro block modes to color */
|
||||
VP8_SET_DBG_COLOR_B_MODES = 6, /**< set which blocks modes to color */
|
||||
VP8_SET_DBG_DISPLAY_MV = 7, /**< set which motion vector modes to draw */
|
||||
VP8_SET_DBG_COLOR_REF_FRAME = 4, /**< \deprecated */
|
||||
VP8_SET_DBG_COLOR_MB_MODES = 5, /**< \deprecated */
|
||||
VP8_SET_DBG_COLOR_B_MODES = 6, /**< \deprecated */
|
||||
VP8_SET_DBG_DISPLAY_MV = 7, /**< \deprecated */
|
||||
|
||||
/* TODO(jkoleszar): The encoder incorrectly reuses some of these values (5+)
|
||||
* for its control ids. These should be migrated to something like the
|
||||
@ -133,13 +132,13 @@ VPX_CTRL_USE_TYPE(VP8_COPY_REFERENCE, vpx_ref_frame_t *)
|
||||
#define VPX_CTRL_VP8_COPY_REFERENCE
|
||||
VPX_CTRL_USE_TYPE(VP8_SET_POSTPROC, vp8_postproc_cfg_t *)
|
||||
#define VPX_CTRL_VP8_SET_POSTPROC
|
||||
VPX_CTRL_USE_TYPE(VP8_SET_DBG_COLOR_REF_FRAME, int)
|
||||
VPX_CTRL_USE_TYPE_DEPRECATED(VP8_SET_DBG_COLOR_REF_FRAME, int)
|
||||
#define VPX_CTRL_VP8_SET_DBG_COLOR_REF_FRAME
|
||||
VPX_CTRL_USE_TYPE(VP8_SET_DBG_COLOR_MB_MODES, int)
|
||||
VPX_CTRL_USE_TYPE_DEPRECATED(VP8_SET_DBG_COLOR_MB_MODES, int)
|
||||
#define VPX_CTRL_VP8_SET_DBG_COLOR_MB_MODES
|
||||
VPX_CTRL_USE_TYPE(VP8_SET_DBG_COLOR_B_MODES, int)
|
||||
VPX_CTRL_USE_TYPE_DEPRECATED(VP8_SET_DBG_COLOR_B_MODES, int)
|
||||
#define VPX_CTRL_VP8_SET_DBG_COLOR_B_MODES
|
||||
VPX_CTRL_USE_TYPE(VP8_SET_DBG_DISPLAY_MV, int)
|
||||
VPX_CTRL_USE_TYPE_DEPRECATED(VP8_SET_DBG_DISPLAY_MV, int)
|
||||
#define VPX_CTRL_VP8_SET_DBG_DISPLAY_MV
|
||||
VPX_CTRL_USE_TYPE(VP9_GET_REFERENCE, vp9_ref_frame_t *)
|
||||
#define VPX_CTRL_VP9_GET_REFERENCE
|
||||
|
89
vpxdec.c
89
vpxdec.c
@ -125,30 +125,11 @@ static const arg_def_t deblock =
|
||||
ARG_DEF(NULL, "deblock", 0, "Enable VP8 deblocking");
|
||||
static const arg_def_t demacroblock_level = ARG_DEF(
|
||||
NULL, "demacroblock-level", 1, "Enable VP8 demacroblocking, w/ level");
|
||||
static const arg_def_t pp_debug_info =
|
||||
ARG_DEF(NULL, "pp-debug-info", 1, "Enable VP8 visible debug info");
|
||||
static const arg_def_t pp_disp_ref_frame =
|
||||
ARG_DEF(NULL, "pp-dbg-ref-frame", 1,
|
||||
"Display only selected reference frame per macro block");
|
||||
static const arg_def_t pp_disp_mb_modes = ARG_DEF(
|
||||
NULL, "pp-dbg-mb-modes", 1, "Display only selected macro block modes");
|
||||
static const arg_def_t pp_disp_b_modes =
|
||||
ARG_DEF(NULL, "pp-dbg-b-modes", 1, "Display only selected block modes");
|
||||
static const arg_def_t pp_disp_mvs =
|
||||
ARG_DEF(NULL, "pp-dbg-mvs", 1, "Draw only selected motion vectors");
|
||||
static const arg_def_t mfqe =
|
||||
ARG_DEF(NULL, "mfqe", 0, "Enable multiframe quality enhancement");
|
||||
|
||||
static const arg_def_t *vp8_pp_args[] = { &addnoise_level,
|
||||
&deblock,
|
||||
&demacroblock_level,
|
||||
&pp_debug_info,
|
||||
&pp_disp_ref_frame,
|
||||
&pp_disp_mb_modes,
|
||||
&pp_disp_b_modes,
|
||||
&pp_disp_mvs,
|
||||
&mfqe,
|
||||
NULL };
|
||||
static const arg_def_t *vp8_pp_args[] = { &addnoise_level, &deblock,
|
||||
&demacroblock_level, &mfqe, NULL };
|
||||
#endif
|
||||
|
||||
#if CONFIG_LIBYUV
|
||||
@ -539,10 +520,6 @@ static int main_loop(int argc, const char **argv_) {
|
||||
#endif
|
||||
#if CONFIG_VP8_DECODER
|
||||
vp8_postproc_cfg_t vp8_pp_cfg = { 0, 0, 0 };
|
||||
int vp8_dbg_color_ref_frame = 0;
|
||||
int vp8_dbg_color_mb_modes = 0;
|
||||
int vp8_dbg_color_b_modes = 0;
|
||||
int vp8_dbg_display_mv = 0;
|
||||
#endif
|
||||
int frames_corrupted = 0;
|
||||
int dec_flags = 0;
|
||||
@ -647,37 +624,6 @@ static int main_loop(int argc, const char **argv_) {
|
||||
} else if (arg_match(&arg, &mfqe, argi)) {
|
||||
postproc = 1;
|
||||
vp8_pp_cfg.post_proc_flag |= VP8_MFQE;
|
||||
} else if (arg_match(&arg, &pp_debug_info, argi)) {
|
||||
unsigned int level = arg_parse_uint(&arg);
|
||||
|
||||
postproc = 1;
|
||||
vp8_pp_cfg.post_proc_flag &= ~0x7;
|
||||
|
||||
if (level) vp8_pp_cfg.post_proc_flag |= level;
|
||||
} else if (arg_match(&arg, &pp_disp_ref_frame, argi)) {
|
||||
unsigned int flags = arg_parse_int(&arg);
|
||||
if (flags) {
|
||||
postproc = 1;
|
||||
vp8_dbg_color_ref_frame = flags;
|
||||
}
|
||||
} else if (arg_match(&arg, &pp_disp_mb_modes, argi)) {
|
||||
unsigned int flags = arg_parse_int(&arg);
|
||||
if (flags) {
|
||||
postproc = 1;
|
||||
vp8_dbg_color_mb_modes = flags;
|
||||
}
|
||||
} else if (arg_match(&arg, &pp_disp_b_modes, argi)) {
|
||||
unsigned int flags = arg_parse_int(&arg);
|
||||
if (flags) {
|
||||
postproc = 1;
|
||||
vp8_dbg_color_b_modes = flags;
|
||||
}
|
||||
} else if (arg_match(&arg, &pp_disp_mvs, argi)) {
|
||||
unsigned int flags = arg_parse_int(&arg);
|
||||
if (flags) {
|
||||
postproc = 1;
|
||||
vp8_dbg_display_mv = flags;
|
||||
}
|
||||
} else if (arg_match(&arg, &error_concealment, argi)) {
|
||||
ec_enabled = 1;
|
||||
}
|
||||
@ -789,37 +735,6 @@ static int main_loop(int argc, const char **argv_) {
|
||||
vpx_codec_error(&decoder));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (vp8_dbg_color_ref_frame &&
|
||||
vpx_codec_control(&decoder, VP8_SET_DBG_COLOR_REF_FRAME,
|
||||
vp8_dbg_color_ref_frame)) {
|
||||
fprintf(stderr, "Failed to configure reference block visualizer: %s\n",
|
||||
vpx_codec_error(&decoder));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (vp8_dbg_color_mb_modes &&
|
||||
vpx_codec_control(&decoder, VP8_SET_DBG_COLOR_MB_MODES,
|
||||
vp8_dbg_color_mb_modes)) {
|
||||
fprintf(stderr, "Failed to configure macro block visualizer: %s\n",
|
||||
vpx_codec_error(&decoder));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (vp8_dbg_color_b_modes &&
|
||||
vpx_codec_control(&decoder, VP8_SET_DBG_COLOR_B_MODES,
|
||||
vp8_dbg_color_b_modes)) {
|
||||
fprintf(stderr, "Failed to configure block visualizer: %s\n",
|
||||
vpx_codec_error(&decoder));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (vp8_dbg_display_mv &&
|
||||
vpx_codec_control(&decoder, VP8_SET_DBG_DISPLAY_MV, vp8_dbg_display_mv)) {
|
||||
fprintf(stderr, "Failed to configure motion vector visualizer: %s\n",
|
||||
vpx_codec_error(&decoder));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (arg_skip) fprintf(stderr, "Skipping first %d frames.\n", arg_skip);
|
||||
|
Loading…
Reference in New Issue
Block a user