From 79401542f7e781d4eea0c8dc8f486db8a17f17f4 Mon Sep 17 00:00:00 2001 From: Jim Bankoski Date: Wed, 4 Sep 2013 10:02:08 -0700 Subject: [PATCH] make vp9 postproc a config option Vp9 postproc is disabled for now as its not been shown to help and may be merged with vp8. Change-Id: I25620d6cd34c6e10331b18c7b5ef7482e39c6057 --- configure | 5 ++++- vp9/common/vp9_onyxc_int.h | 4 ++-- vp9/common/vp9_postproc.c | 3 ++- vp9/common/vp9_rtcd_defs.sh | 2 +- vp9/decoder/vp9_onyxd_if.c | 8 +++++--- vp9/encoder/vp9_onyx_if.c | 10 +++++----- vp9/vp9_common.mk | 6 +++--- vp9/vp9_cx_iface.c | 2 +- vp9/vp9_dx_iface.c | 4 ++-- vp9/vp9cx.mk | 2 +- 10 files changed, 26 insertions(+), 20 deletions(-) diff --git a/configure b/configure index a2520819e..e7f9f4f09 100755 --- a/configure +++ b/configure @@ -38,6 +38,7 @@ Advanced options: ${toggle_internal_stats} output of encoder internal stats for debug, if supported (encoders) ${toggle_mem_tracker} track memory usage ${toggle_postproc} postprocessing + ${toggle_vp9_postproc} vp9 specific 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 @@ -279,6 +280,7 @@ CONFIG_LIST=" dc_recon runtime_cpu_detect postproc + vp9_postproc multithread internal_stats ${CODECS} @@ -333,6 +335,7 @@ CMDLINE_SELECT=" dequant_tokens dc_recon postproc + vp9_postproc multithread internal_stats ${CODECS} @@ -438,7 +441,7 @@ 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 postproc && ! enabled vp9_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}" diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index a669cc5e7..f0bc063f2 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -20,7 +20,7 @@ #include "vp9/common/vp9_entropymode.h" #include "vp9/common/vp9_quant_common.h" -#if CONFIG_POSTPROC +#if CONFIG_VP9_POSTPROC #include "vp9/common/vp9_postproc.h" #endif @@ -201,7 +201,7 @@ typedef struct VP9Common { unsigned int current_video_frame; int version; -#if CONFIG_POSTPROC +#if CONFIG_VP9_POSTPROC struct postproc_state postproc_state; #endif diff --git a/vp9/common/vp9_postproc.c b/vp9/common/vp9_postproc.c index 48d3d2d98..955e6766a 100644 --- a/vp9/common/vp9_postproc.c +++ b/vp9/common/vp9_postproc.c @@ -1011,7 +1011,8 @@ int vp9_post_proc_frame(struct VP9Common *cm, /* handle problem with extending borders */ dest->y_width = cm->width; dest->y_height = cm->height; - dest->uv_height = dest->y_height / 2; + dest->uv_width = dest->y_width >> cm->subsampling_x; + dest->uv_height = dest->y_height >> cm->subsampling_y; return 0; } diff --git a/vp9/common/vp9_rtcd_defs.sh b/vp9/common/vp9_rtcd_defs.sh index 615e07ba9..f9fb232a1 100644 --- a/vp9/common/vp9_rtcd_defs.sh +++ b/vp9/common/vp9_rtcd_defs.sh @@ -237,7 +237,7 @@ specialize vp9_loop_filter_horizontal_edge mmx neon # # post proc # -if [ "$CONFIG_POSTPROC" = "yes" ]; then +if [ "$CONFIG_VP9_POSTPROC" = "yes" ]; then prototype void vp9_mbpost_proc_down "uint8_t *dst, int pitch, int rows, int cols, int flimit" specialize vp9_mbpost_proc_down mmx sse2 vp9_mbpost_proc_down_sse2=vp9_mbpost_proc_down_xmm diff --git a/vp9/decoder/vp9_onyxd_if.c b/vp9/decoder/vp9_onyxd_if.c index b609f9f31..505e9dc5d 100644 --- a/vp9/decoder/vp9_onyxd_if.c +++ b/vp9/decoder/vp9_onyxd_if.c @@ -13,7 +13,7 @@ #include #include "vp9/common/vp9_onyxc_int.h" -#if CONFIG_POSTPROC +#if CONFIG_VP9_POSTPROC #include "vp9/common/vp9_postproc.h" #endif #include "vp9/decoder/vp9_onyxd.h" @@ -421,7 +421,7 @@ int vp9_get_raw_frame(VP9D_PTR ptr, YV12_BUFFER_CONFIG *sd, *time_stamp = pbi->last_time_stamp; *time_end_stamp = 0; -#if CONFIG_POSTPROC +#if CONFIG_VP9_POSTPROC ret = vp9_post_proc_frame(&pbi->common, sd, flags); #else @@ -429,7 +429,9 @@ int vp9_get_raw_frame(VP9D_PTR ptr, YV12_BUFFER_CONFIG *sd, *sd = *pbi->common.frame_to_show; sd->y_width = pbi->common.width; sd->y_height = pbi->common.height; - sd->uv_height = pbi->common.height / 2; + sd->uv_width = sd->y_width >> pbi->common.subsampling_x; + sd->uv_height = sd->y_height >> pbi->common.subsampling_y; + ret = 0; } else { ret = -1; diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index e9c214ff8..d35b739fb 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -28,7 +28,7 @@ #include "vp9/encoder/vp9_segmentation.h" #include "./vp9_rtcd.h" #include "./vpx_scale_rtcd.h" -#if CONFIG_POSTPROC +#if CONFIG_VP9_POSTPROC #include "vp9/common/vp9_postproc.h" #endif #include "vpx_mem/vpx_mem.h" @@ -2895,7 +2895,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, set_mvcost(&cpi->mb); } -#if CONFIG_POSTPROC +#if CONFIG_VP9_POSTPROC if (cpi->oxcf.noise_sensitivity > 0) { int l = 0; @@ -3954,7 +3954,7 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags, { double frame_psnr2, frame_ssim2 = 0; double weight = 0; -#if CONFIG_POSTPROC +#if CONFIG_VP9_POSTPROC vp9_deblock(cm->frame_to_show, &cm->post_proc_buffer, cm->lf.filter_level * 10 / 6); #endif @@ -4030,7 +4030,7 @@ int vp9_get_preview_raw_frame(VP9_PTR comp, YV12_BUFFER_CONFIG *dest, return -1; else { int ret; -#if CONFIG_POSTPROC +#if CONFIG_VP9_POSTPROC ret = vp9_post_proc_frame(&cpi->common, dest, flags); #else @@ -4044,7 +4044,7 @@ int vp9_get_preview_raw_frame(VP9_PTR comp, YV12_BUFFER_CONFIG *dest, ret = -1; } -#endif // !CONFIG_POSTPROC +#endif // !CONFIG_VP9_POSTPROC vp9_clear_system_state(); return ret; } diff --git a/vp9/vp9_common.mk b/vp9/vp9_common.mk index fb302abec..68a18f838 100644 --- a/vp9/vp9_common.mk +++ b/vp9/vp9_common.mk @@ -73,11 +73,11 @@ VP9_COMMON_SRCS-yes += common/vp9_common_data.h VP9_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/vp9_postproc_x86.h VP9_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/vp9_asm_stubs.c VP9_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/vp9_loopfilter_intrin_sse2.c -VP9_COMMON_SRCS-$(CONFIG_POSTPROC) += common/vp9_postproc.h -VP9_COMMON_SRCS-$(CONFIG_POSTPROC) += common/vp9_postproc.c +VP9_COMMON_SRCS-$(CONFIG_VP9_POSTPROC) += common/vp9_postproc.h +VP9_COMMON_SRCS-$(CONFIG_VP9_POSTPROC) += common/vp9_postproc.c VP9_COMMON_SRCS-$(HAVE_MMX) += common/x86/vp9_loopfilter_mmx.asm VP9_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/vp9_subpixel_8t_ssse3.asm -ifeq ($(CONFIG_POSTPROC),yes) +ifeq ($(CONFIG_VP9_POSTPROC),yes) VP9_COMMON_SRCS-$(HAVE_MMX) += common/x86/vp9_postproc_mmx.asm VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_postproc_sse2.asm endif diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c index 0874afdbc..e9549228e 100644 --- a/vp9/vp9_cx_iface.c +++ b/vp9/vp9_cx_iface.c @@ -888,7 +888,7 @@ static vpx_codec_err_t get_reference(vpx_codec_alg_priv_t *ctx, static vpx_codec_err_t vp9e_set_previewpp(vpx_codec_alg_priv_t *ctx, int ctr_id, va_list args) { -#if CONFIG_POSTPROC +#if CONFIG_VP9_POSTPROC vp8_postproc_cfg_t *data = va_arg(args, vp8_postproc_cfg_t *); (void)ctr_id; diff --git a/vp9/vp9_dx_iface.c b/vp9/vp9_dx_iface.c index e7362fca0..10b32385c 100644 --- a/vp9/vp9_dx_iface.c +++ b/vp9/vp9_dx_iface.c @@ -20,7 +20,7 @@ #include "vp9/decoder/vp9_read_bit_buffer.h" #include "vp9/vp9_iface_common.h" -#define VP9_CAP_POSTPROC (CONFIG_POSTPROC ? VPX_CODEC_CAP_POSTPROC : 0) +#define VP9_CAP_POSTPROC (CONFIG_VP9_POSTPROC ? VPX_CODEC_CAP_POSTPROC : 0) typedef vpx_codec_stream_info_t vp9_stream_info_t; /* Structures for handling memory allocations */ @@ -596,7 +596,7 @@ static vpx_codec_err_t get_reference(vpx_codec_alg_priv_t *ctx, static vpx_codec_err_t set_postproc(vpx_codec_alg_priv_t *ctx, int ctr_id, va_list args) { -#if CONFIG_POSTPROC +#if CONFIG_VP9_POSTPROC vp8_postproc_cfg_t *data = va_arg(args, vp8_postproc_cfg_t *); if (data) { diff --git a/vp9/vp9cx.mk b/vp9/vp9cx.mk index 89de6014e..9fbf100f5 100644 --- a/vp9/vp9cx.mk +++ b/vp9/vp9cx.mk @@ -64,7 +64,7 @@ VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS) += encoder/vp9_ssim.c VP9_CX_SRCS-yes += encoder/vp9_tokenize.c VP9_CX_SRCS-yes += encoder/vp9_treewriter.c VP9_CX_SRCS-yes += encoder/vp9_variance_c.c -ifeq ($(CONFIG_POSTPROC),yes) +ifeq ($(CONFIG_VP9_POSTPROC),yes) VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS) += common/vp9_postproc.h VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS) += common/vp9_postproc.c endif