ref: 9a8204d6ee0f2d2d7a64d22aadfd567552a44db7
parent: af8f1928d1ca6df5ae6961acebd524da585fa8ab
author: Paul Wilkins <paulwilkins@google.com>
date: Mon Feb 13 12:05:26 EST 2012
Simplification of experimental code base. Removed ~CONFIG_REALTIME_ONLY code. Change-Id: I5fafff29a08acd8928699f9ddce8744787024d8c
--- a/configure
+++ b/configure
@@ -35,7 +35,6 @@
${toggle_mem_tracker} track memory usage
${toggle_postproc} postprocessing
${toggle_spatial_resampling} spatial sampling (scaling) support
- ${toggle_realtime_only} enable this option while building for real-time encoding
${toggle_error_concealment} enable this option to get a decoder which is able to conceal losses
${toggle_runtime_cpu_detect} runtime cpu detection
${toggle_shared} shared library support
@@ -263,7 +262,6 @@
decoders
static_msvcrt
spatial_resampling
- realtime_only
error_concealment
shared
static
@@ -307,7 +305,6 @@
static_msvcrt
mem_tracker
spatial_resampling
- realtime_only
error_concealment
shared
static
--- a/vp8/encoder/generic/csystemdependent.c
+++ b/vp8/encoder/generic/csystemdependent.c
@@ -101,9 +101,7 @@
cpi->rtcd.search.full_search = vp8_full_search_sad;
cpi->rtcd.search.refining_search = vp8_refining_search_sad;
cpi->rtcd.search.diamond_search = vp8_diamond_search_sad;
-#if !(CONFIG_REALTIME_ONLY)
cpi->rtcd.temporal.apply = vp8_temporal_filter_apply_c;
-#endif
#if CONFIG_INTERNAL_STATS
cpi->rtcd.variance.ssimpf_8x8 = vp8_ssim_parms_8x8_c;
cpi->rtcd.variance.ssimpf_16x16 = vp8_ssim_parms_16x16_c;
--- a/vp8/encoder/lookahead.c
+++ b/vp8/encoder/lookahead.c
@@ -13,7 +13,7 @@
#include "lookahead.h"
#include "vp8/common/extend.h"
-#define MAX_LAG_BUFFERS (CONFIG_REALTIME_ONLY? 1 : 25)
+#define MAX_LAG_BUFFERS 25
struct lookahead_ctx
{
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -359,7 +359,6 @@
vpx_free(cpi->mb.pip);
cpi->mb.pip = 0;
-#if !(CONFIG_REALTIME_ONLY)
vpx_free(cpi->twopass.total_stats);
cpi->twopass.total_stats = 0;
@@ -368,7 +367,6 @@
vpx_free(cpi->twopass.this_frame_stats);
cpi->twopass.this_frame_stats = 0;
-#endif
}
static void segmentation_test_function(VP8_PTR ptr)
@@ -828,7 +826,6 @@
switch (Mode)
{
-#if !(CONFIG_REALTIME_ONLY)
case 0: // best quality mode
sf->thresh_mult[THR_ZEROMV ] = 0;
sf->thresh_mult[THR_ZEROG ] = 0;
@@ -1137,7 +1134,6 @@
}
break;
-#endif
case 2:
sf->optimize_coefficients = 0;
sf->recode_loop = 0;
@@ -1767,7 +1763,6 @@
vpx_calloc(sizeof(unsigned int),
cm->mb_rows * cm->mb_cols));
-#if !(CONFIG_REALTIME_ONLY)
vpx_free(cpi->twopass.total_stats);
cpi->twopass.total_stats = vpx_calloc(1, sizeof(FIRSTPASS_STATS));
@@ -1784,7 +1779,6 @@
!cpi->twopass.this_frame_stats)
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
"Failed to allocate firstpass stats");
-#endif
vpx_free(cpi->tplist);
@@ -2443,8 +2437,6 @@
cpi->output_pkt_list = oxcf->output_pkt_list;
-#if !(CONFIG_REALTIME_ONLY)
-
if (cpi->pass == 1)
{
vp8_init_first_pass(cpi);
@@ -2461,8 +2453,6 @@
vp8_init_second_pass(cpi);
}
-#endif
-
if (cpi->compressor_speed == 2)
{
cpi->cpu_freq = 0; //vp8_get_processor_freq();
@@ -2575,15 +2565,11 @@
if (cpi && (cpi->common.current_video_frame > 0))
{
-#if !(CONFIG_REALTIME_ONLY)
-
if (cpi->pass == 2)
{
vp8_end_second_pass(cpi);
}
-#endif
-
#ifdef ENTROPY_STATS
print_context_counters();
print_tree_update_probs();
@@ -3413,7 +3399,6 @@
return i;
}
-#if !(CONFIG_REALTIME_ONLY)
static void Pass1Encode(VP8_COMP *cpi, unsigned long *size, unsigned char *dest, unsigned int *frame_flags)
{
(void) size;
@@ -3426,7 +3411,7 @@
scale_and_extend_source(cpi->un_scaled_source, cpi);
vp8_first_pass(cpi);
}
-#endif
+
//#define WRITE_RECON_BUFFER 1
#if WRITE_RECON_BUFFER
void write_cx_frame_to_file(YV12_BUFFER_CONFIG *frame, int this_frame)
@@ -3788,7 +3773,6 @@
}
// For an alt ref frame in 2 pass we skip the call to the second pass function that sets the target bandwidth
-#if !(CONFIG_REALTIME_ONLY)
if (cpi->pass == 2)
{
if (cpi->common.refresh_alt_ref_frame)
@@ -3798,7 +3782,6 @@
}
}
else
-#endif
cpi->per_frame_bandwidth = (int)(cpi->target_bandwidth / cpi->output_frame_rate);
// Default turn off buffer to buffer copying
@@ -4195,7 +4178,7 @@
scale_and_extend_source(cpi->un_scaled_source, cpi);
-#if !(CONFIG_REALTIME_ONLY) && CONFIG_POSTPROC
+#if CONFIG_POSTPROC
if (cpi->oxcf.noise_sensitivity > 0)
{
@@ -4435,7 +4418,6 @@
else
active_worst_qchanged = FALSE;
-#if !(CONFIG_REALTIME_ONLY)
// Special case handling for forced key frames
if ( (cm->frame_type == KEY_FRAME) && cpi->this_key_frame_forced )
{
@@ -4603,7 +4585,6 @@
last_zbin_oq = cpi->zbin_over_quant;
}
else
-#endif
Loop = FALSE;
if (cpi->is_src_frame_alt_ref)
@@ -5164,7 +5145,6 @@
#endif
}
-#if !(CONFIG_REALTIME_ONLY)
static void Pass2Encode(VP8_COMP *cpi, unsigned long *size, unsigned char *dest, unsigned int *frame_flags)
{
@@ -5181,7 +5161,6 @@
cpi->twopass.bits_left += (int64_t)(two_pass_min_rate / cpi->oxcf.frame_rate);
}
}
-#endif
//For ARM NEON, d8-d15 are callee-saved registers, and need to be saved by us.
#if HAVE_ARMV7
@@ -5272,7 +5251,6 @@
cpi->source = NULL;
-#if !(CONFIG_REALTIME_ONLY)
// Should we code an alternate reference frame
if (cpi->oxcf.error_resilient_mode == 0 &&
cpi->oxcf.play_alternate &&
@@ -5297,7 +5275,6 @@
cpi->is_src_frame_alt_ref = 0;
}
}
-#endif
if (!cpi->source)
{
@@ -5324,8 +5301,6 @@
else
{
*size = 0;
-#if !(CONFIG_REALTIME_ONLY)
-
if (flush && cpi->pass == 1 && !cpi->twopass.first_pass_done)
{
vp8_end_first_pass(cpi); /* get last stats packet */
@@ -5332,8 +5307,6 @@
cpi->twopass.first_pass_done = 1;
}
-#endif
-
#if HAVE_ARMV7
#if CONFIG_RUNTIME_CPU_DETECT
if (cm->rtcd.flags & HAS_NEON)
@@ -5447,8 +5420,6 @@
assert(i < NUM_YV12_BUFFERS );
}
-#if !(CONFIG_REALTIME_ONLY)
-
if (cpi->pass == 1)
{
Pass1Encode(cpi, size, dest, frame_flags);
@@ -5458,8 +5429,7 @@
Pass2Encode(cpi, size, dest, frame_flags);
}
else
-#endif
- encode_frame_to_data_rate(cpi, size, dest, frame_flags);
+ encode_frame_to_data_rate(cpi, size, dest, frame_flags);
if (cpi->compressor_speed == 2)
{
--- a/vp8/encoder/onyx_int.h
+++ b/vp8/encoder/onyx_int.h
@@ -36,7 +36,7 @@
#define KEY_FRAME_CONTEXT 5
-#define MAX_LAG_BUFFERS (CONFIG_REALTIME_ONLY? 1 : 25)
+#define MAX_LAG_BUFFERS 25
#define AF_THRESH 25
#define AF_THRESH2 100
@@ -51,9 +51,7 @@
#define MV_ZBIN_BOOST 4
#define ZBIN_OQ_MAX 192
-#if !(CONFIG_REALTIME_ONLY)
#define VP8_TEMPORAL_ALT_REF 1
-#endif
typedef struct
{
--- a/vp8/encoder/x86/x86_csystemdependent.c
+++ b/vp8/encoder/x86/x86_csystemdependent.c
@@ -218,10 +218,7 @@
cpi->rtcd.encodemb.submbuv = vp8_subtract_mbuv_sse2;
cpi->rtcd.quantize.fastquantb = vp8_fast_quantize_b_sse2;
-
-#if !(CONFIG_REALTIME_ONLY)
cpi->rtcd.temporal.apply = vp8_temporal_filter_apply_sse2;
-#endif
#if CONFIG_INTERNAL_STATS
#if ARCH_X86_64
--- a/vp8/vp8_cx_iface.c
+++ b/vp8/vp8_cx_iface.c
@@ -56,13 +56,8 @@
0,
{
NULL,
-#if !(CONFIG_REALTIME_ONLY)
VP8_BEST_QUALITY_ENCODING, /* Encoding Mode */
0, /* cpu_used */
-#else
- VP8_REAL_TIME_ENCODING, /* Encoding Mode */
- 4, /* cpu_used */
-#endif
0, /* enable_auto_alt_ref */
0, /* noise_sensitivity */
0, /* Sharpness */
@@ -149,11 +144,7 @@
RANGE_CHECK_HI(cfg, rc_max_quantizer, 63);
RANGE_CHECK_HI(cfg, rc_min_quantizer, cfg->rc_max_quantizer);
RANGE_CHECK_HI(cfg, g_threads, 64);
-#if !(CONFIG_REALTIME_ONLY)
RANGE_CHECK_HI(cfg, g_lag_in_frames, 25);
-#else
- RANGE_CHECK_HI(cfg, g_lag_in_frames, 0);
-#endif
RANGE_CHECK(cfg, rc_end_usage, VPX_VBR, VPX_CQ);
RANGE_CHECK_HI(cfg, rc_undershoot_pct, 1000);
RANGE_CHECK_HI(cfg, rc_overshoot_pct, 1000);
@@ -164,11 +155,7 @@
RANGE_CHECK_HI(cfg, rc_dropframe_thresh, 100);
RANGE_CHECK_HI(cfg, rc_resize_up_thresh, 100);
RANGE_CHECK_HI(cfg, rc_resize_down_thresh, 100);
-#if !(CONFIG_REALTIME_ONLY)
RANGE_CHECK(cfg, g_pass, VPX_RC_ONE_PASS, VPX_RC_LAST_PASS);
-#else
- RANGE_CHECK(cfg, g_pass, VPX_RC_ONE_PASS, VPX_RC_ONE_PASS);
-#endif
/* VP8 does not support a lower bound on the keyframe interval in
* automatic keyframe placement mode.
@@ -181,13 +168,8 @@
RANGE_CHECK_BOOL(vp8_cfg, enable_auto_alt_ref);
RANGE_CHECK(vp8_cfg, cpu_used, -16, 16);
-#if !(CONFIG_REALTIME_ONLY)
RANGE_CHECK(vp8_cfg, encoding_mode, VP8_BEST_QUALITY_ENCODING, VP8_REAL_TIME_ENCODING);
RANGE_CHECK_HI(vp8_cfg, noise_sensitivity, 6);
-#else
- RANGE_CHECK(vp8_cfg, encoding_mode, VP8_REAL_TIME_ENCODING, VP8_REAL_TIME_ENCODING);
- RANGE_CHECK(vp8_cfg, noise_sensitivity, 0, 0);
-#endif
RANGE_CHECK(vp8_cfg, token_partitions, VP8_ONE_TOKENPARTITION, VP8_EIGHT_TOKENPARTITION);
RANGE_CHECK_HI(vp8_cfg, Sharpness, 7);
@@ -196,7 +178,6 @@
RANGE_CHECK(vp8_cfg, arnr_type, 1, 3);
RANGE_CHECK(vp8_cfg, cq_level, 0, 63);
-#if !(CONFIG_REALTIME_ONLY)
if (cfg->g_pass == VPX_RC_LAST_PASS)
{
size_t packet_sz = sizeof(FIRSTPASS_STATS);
@@ -218,7 +199,6 @@
if ((int)(stats->count + 0.5) != n_packets - 1)
ERROR("rc_twopass_stats_in missing EOS stats packet");
}
-#endif
return VPX_CODEC_OK;
}
@@ -618,7 +598,6 @@
{
unsigned int new_qc;
-#if !(CONFIG_REALTIME_ONLY)
/* Use best quality mode if no deadline is given. */
new_qc = MODE_BESTQUALITY;
@@ -636,10 +615,6 @@
*/
new_qc = (deadline > duration_us) ? MODE_GOODQUALITY : MODE_REALTIME;
}
-
-#else
- new_qc = MODE_REALTIME;
-#endif
switch (ctx->deprecated_mode)
{
--- a/vp8/vp8cx.mk
+++ b/vp8/vp8cx.mk
@@ -91,11 +91,6 @@
VP8_CX_SRCS-yes += encoder/mbgraph.h
-ifeq ($(CONFIG_REALTIME_ONLY),yes)
-VP8_CX_SRCS_REMOVE-yes += encoder/firstpass.c
-VP8_CX_SRCS_REMOVE-yes += encoder/temporal_filter.c
-endif
-
VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/encodemb_x86.h
VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/dct_x86.h
VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/mcomp_x86.h
@@ -126,10 +121,6 @@
VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/quantize_mmx.asm
VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/encodeopt.asm
VP8_CX_SRCS-$(ARCH_X86_64) += encoder/x86/ssim_opt.asm
-
-ifeq ($(CONFIG_REALTIME_ONLY),yes)
-VP8_CX_SRCS_REMOVE-$(HAVE_SSE2) += encoder/x86/temporal_filter_apply_sse2.asm
-endif
VP8_CX_SRCS-yes := $(filter-out $(VP8_CX_SRCS_REMOVE-yes),$(VP8_CX_SRCS-yes))