Commit 64358216 authored by Yaowu Xu's avatar Yaowu Xu

Remove postproc and postproc-visualizer

parent d4c704f3
......@@ -40,7 +40,6 @@ Advanced options:
hardware decoder compatibility
${toggle_vp10} VP10 codec support
${toggle_internal_stats} output of encoder internal stats for debug, if supported (encoders)
${toggle_postproc} postprocessing
${toggle_multithread} multithreaded encoding and decoding
${toggle_spatial_resampling} spatial sampling (scaling) support
${toggle_realtime_only} enable this option while building for real-time encoding
......@@ -53,7 +52,6 @@ Advanced options:
${toggle_shared} shared library support
${toggle_static} static library support
${toggle_small} favor smaller size over speed
${toggle_postproc_visualizer} macro block / block level visualizers
${toggle_multi_res_encoding} enable multiple-resolution encoding
${toggle_temporal_denoising} enable temporal denoising and disable the spatial denoiser
${toggle_webm_io} enable input from and output to WebM container
......@@ -279,7 +277,6 @@ CONFIG_LIST="
dequant_tokens
dc_recon
runtime_cpu_detect
postproc
multithread
internal_stats
${CODECS}
......@@ -294,7 +291,6 @@ CONFIG_LIST="
shared
static
small
postproc_visualizer
os_support
unit_tests
webm_io
......@@ -341,7 +337,6 @@ CMDLINE_SELECT="
dequant_tokens
dc_recon
postproc
multithread
internal_stats
${CODECS}
......@@ -354,7 +349,6 @@ CMDLINE_SELECT="
shared
static
small
postproc_visualizer
unit_tests
webm_io
libyuv
......@@ -437,7 +431,6 @@ process_targets() {
done
enabled debug_libs && DIST_DIR="${DIST_DIR}-debug"
enabled codec_srcs && DIST_DIR="${DIST_DIR}-src"
! enabled postproc && DIST_DIR="${DIST_DIR}-nopost"
! enabled multithread && DIST_DIR="${DIST_DIR}-nomt"
! enabled install_docs && DIST_DIR="${DIST_DIR}-nodocs"
DIST_DIR="${DIST_DIR}-${tgt_isa}-${tgt_os}"
......@@ -642,13 +635,6 @@ process_toolchain() {
;;
esac
# Other toolchain specific defaults
case $toolchain in x86*) soft_enable postproc;; esac
if enabled postproc_visualizer; then
enabled postproc || die "postproc_visualizer requires postproc to be enabled"
fi
# Enable unit tests by default if we have a working C++ compiler.
case "$toolchain" in
*-vs*)
......
......@@ -116,16 +116,6 @@ simple_decoder.SRCS += vpx_ports/mem_ops.h
simple_decoder.SRCS += vpx_ports/mem_ops_aligned.h
simple_decoder.SRCS += vpx_ports/msvc.h
simple_decoder.DESCRIPTION = Simplified decoder loop
EXAMPLES-$(CONFIG_DECODERS) += postproc.c
postproc.SRCS += ivfdec.h ivfdec.c
postproc.SRCS += tools_common.h tools_common.c
postproc.SRCS += video_common.h
postproc.SRCS += video_reader.h video_reader.c
postproc.SRCS += vpx_ports/mem_ops.h
postproc.SRCS += vpx_ports/mem_ops_aligned.h
postproc.SRCS += vpx_ports/msvc.h
postproc.GUID = 65E33355-F35E-4088-884D-3FD4905881D7
postproc.DESCRIPTION = Decoder postprocessor control
EXAMPLES-$(CONFIG_DECODERS) += decode_to_md5.c
decode_to_md5.SRCS += md5_utils.h md5_utils.c
decode_to_md5.SRCS += ivfdec.h ivfdec.c
......
/*
* 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.
*/
// Postprocessing Decoder
// ======================
//
// This example adds postprocessing to the simple decoder loop.
//
// Initializing Postprocessing
// ---------------------------
// You must inform the codec that you might request postprocessing at
// initialization time. This is done by passing the VPX_CODEC_USE_POSTPROC
// flag to `vpx_codec_dec_init`. If the codec does not support
// postprocessing, this call will return VPX_CODEC_INCAPABLE. For
// demonstration purposes, we also fall back to default initialization if
// the codec does not provide support.
//
// Using Adaptive Postprocessing
// -----------------------------
// VP6 provides "adaptive postprocessing." It will automatically select the
// best postprocessing filter on a frame by frame basis based on the amount
// of time remaining before the user's specified deadline expires. The
// special value 0 indicates that the codec should take as long as
// necessary to provide the best quality frame. This example gives the
// codec 15ms (15000us) to return a frame. Remember that this is a soft
// deadline, and the codec may exceed it doing its regular processing. In
// these cases, no additional postprocessing will be done.
//
// Codec Specific Postprocessing Controls
// --------------------------------------
// Some codecs provide fine grained controls over their built-in
// postprocessors. VP8 is one example. The following sample code toggles
// postprocessing on and off every 15 frames.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "vpx/vp8dx.h"
#include "vpx/vpx_decoder.h"
#include "../tools_common.h"
#include "../video_reader.h"
#include "./vpx_config.h"
static const char *exec_name;
void usage_exit(void) {
fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name);
exit(EXIT_FAILURE);
}
int main(int argc, char **argv) {
int frame_cnt = 0;
FILE *outfile = NULL;
vpx_codec_ctx_t codec;
vpx_codec_err_t res;
VpxVideoReader *reader = NULL;
const VpxInterface *decoder = NULL;
const VpxVideoInfo *info = NULL;
exec_name = argv[0];
if (argc != 3)
die("Invalid number of arguments.");
reader = vpx_video_reader_open(argv[1]);
if (!reader)
die("Failed to open %s for reading.", argv[1]);
if (!(outfile = fopen(argv[2], "wb")))
die("Failed to open %s for writing", argv[2]);
info = vpx_video_reader_get_info(reader);
decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc);
if (!decoder)
die("Unknown input codec.");
printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));
res = vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL,
VPX_CODEC_USE_POSTPROC);
if (res == VPX_CODEC_INCAPABLE)
die_codec(&codec, "Postproc not supported by this decoder.");
if (res)
die_codec(&codec, "Failed to initialize decoder.");
while (vpx_video_reader_read_frame(reader)) {
vpx_codec_iter_t iter = NULL;
vpx_image_t *img = NULL;
size_t frame_size = 0;
const unsigned char *frame = vpx_video_reader_get_frame(reader,
&frame_size);
++frame_cnt;
if (frame_cnt % 30 == 1) {
vp8_postproc_cfg_t pp = {0, 0, 0};
if (vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp))
die_codec(&codec, "Failed to turn off postproc.");
} else if (frame_cnt % 30 == 16) {
vp8_postproc_cfg_t pp = {VP8_DEBLOCK | VP8_DEMACROBLOCK | VP8_MFQE,
4, 0};
if (vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp))
die_codec(&codec, "Failed to turn on postproc.");
};
// Decode the frame with 15ms deadline
if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 15000))
die_codec(&codec, "Failed to decode frame");
while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) {
vpx_img_write(img, outfile);
}
}
printf("Processed %d frames.\n", frame_cnt);
if (vpx_codec_destroy(&codec))
die_codec(&codec, "Failed to destroy codec");
printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n",
info->frame_width, info->frame_height, argv[2]);
vpx_video_reader_close(reader);
fclose(outfile);
return EXIT_SUCCESS;
}
......@@ -60,7 +60,6 @@
\if decoder
Currently defined decoder features include:
- \ref usage_cb
- \ref usage_postproc
\endif
\section usage_init Initialization
......
......@@ -28,7 +28,6 @@ void vp10_init_context_buffers(struct VP10Common *cm);
void vp10_free_context_buffers(struct VP10Common *cm);
void vp10_free_ref_frame_buffers(struct BufferPool *pool);
void vp10_free_postproc_buffers(struct VP10Common *cm);
int vp10_alloc_state_buffers(struct VP10Common *cm, int width, int height);
void vp10_free_state_buffers(struct VP10Common *cm);
......
/*
* 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 "vp10/common/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 vp10_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 vp10_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;
}
}
}
}
/*
* 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 VP10_COMMON_TEXTBLIT_H_
#define VP10_COMMON_TEXTBLIT_H_
#ifdef __cplusplus
extern "C" {
#endif
void vp10_blit_text(const char *msg, unsigned char *address, int pitch);
void vp10_blit_line(int x0, int x1, int y0, int y1, unsigned char *image,
int pitch);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // VP10_COMMON_TEXTBLIT_H_
......@@ -56,7 +56,6 @@ VP10_COMMON_SRCS-yes += common/mvref_common.h
VP10_COMMON_SRCS-yes += common/quant_common.c
VP10_COMMON_SRCS-yes += common/reconinter.c
VP10_COMMON_SRCS-yes += common/reconintra.c
VP10_COMMON_SRCS-$(CONFIG_POSTPROC_VISUALIZER) += common/textblit.c
VP10_COMMON_SRCS-yes += common/common_data.h
VP10_COMMON_SRCS-yes += common/scan.c
VP10_COMMON_SRCS-yes += common/scan.h
......
......@@ -300,7 +300,7 @@ endif # CONFIG_USE_X86INC
endif # CONFIG_ENCODERS
ifneq ($(filter yes,$(CONFIG_ENCODERS) $(CONFIG_POSTPROC) $(CONFIG_VP9_POSTPROC)),)
ifneq ($(filter yes,$(CONFIG_ENCODERS)),)
DSP_SRCS-yes += variance.c
DSP_SRCS-yes += variance.h
......@@ -341,7 +341,7 @@ ifeq ($(CONFIG_USE_X86INC),yes)
DSP_SRCS-$(HAVE_SSE2) += x86/highbd_subpel_variance_impl_sse2.asm
endif # CONFIG_USE_X86INC
endif # CONFIG_VPX_HIGHBITDEPTH
endif # CONFIG_ENCODERS || CONFIG_POSTPROC || CONFIG_VP9_POSTPROC
endif # CONFIG_ENCODERS
DSP_SRCS-no += $(DSP_SRCS_REMOVE-yes)
......
......@@ -1375,7 +1375,7 @@ if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
} # CONFIG_VPX_HIGHBITDEPTH
} # CONFIG_ENCODERS
if (vpx_config("CONFIG_ENCODERS") eq "yes" || vpx_config("CONFIG_POSTPROC") eq "yes" || vpx_config("CONFIG_VP9_POSTPROC") eq "yes") {
if (vpx_config("CONFIG_ENCODERS") eq "yes") {
#
# Variance
......@@ -1899,6 +1899,6 @@ if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
add_proto qw/uint32_t vpx_highbd_8_sub_pixel_avg_variance4x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred";
} # CONFIG_VPX_HIGHBITDEPTH
} # CONFIG_ENCODERS || CONFIG_POSTPROC || CONFIG_VP9_POSTPROC
} # CONFIG_ENCODERS
1;
......@@ -390,15 +390,3 @@ section .text
section .note.GNU-stack noalloc noexec nowrite progbits
section .text
%endif
; On Android platforms use lrand48 when building postproc routines. Prior to L
; rand() was not available.
%if CONFIG_POSTPROC=1
%ifdef __ANDROID__
extern sym(lrand48)
%define LIBVPX_RAND lrand48
%else
extern sym(rand)
%define LIBVPX_RAND rand
%endif
%endif ; CONFIG_POSTPROC || CONFIG_VP9_POSTPROC
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