summaryrefslogtreecommitdiff
path: root/vp8
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2011-01-13 11:35:00 -0500
committerJohn Koleszar <jkoleszar@google.com>2011-01-13 11:35:00 -0500
commit05be0987486d02f9b104270896ea77b60849c3e0 (patch)
treea7a4b45dfcfff14a1762d71c146f673d9c3fcf92 /vp8
parent2dc04461f26b749cee78b8834c066316031b0107 (diff)
parent757a45f3ebcb62ae1262c80f68eee447d6788de5 (diff)
downloadlibvpx-05be0987486d02f9b104270896ea77b60849c3e0.tar
libvpx-05be0987486d02f9b104270896ea77b60849c3e0.tar.gz
libvpx-05be0987486d02f9b104270896ea77b60849c3e0.tar.bz2
libvpx-05be0987486d02f9b104270896ea77b60849c3e0.zip
Merge remote branch 'internal/upstream-experimental' into HEAD
Diffstat (limited to 'vp8')
-rw-r--r--vp8/common/postproc.c3
-rw-r--r--vp8/decoder/decodframe.c1
-rw-r--r--vp8/decoder/threading.c5
-rw-r--r--vp8/encoder/encodeframe.c2
-rw-r--r--vp8/encoder/encodemb.c1
-rw-r--r--vp8/encoder/firstpass.c14
-rw-r--r--vp8/encoder/onyx_if.c30
-rw-r--r--vp8/encoder/onyx_int.h4
-rw-r--r--vp8/encoder/quantize.c1
-rw-r--r--vp8/encoder/rdopt.c3
-rw-r--r--vp8/encoder/x86/temporal_filter_apply_sse2.asm2
11 files changed, 42 insertions, 24 deletions
diff --git a/vp8/common/postproc.c b/vp8/common/postproc.c
index 15b1c2c89..d30068ef5 100644
--- a/vp8/common/postproc.c
+++ b/vp8/common/postproc.c
@@ -680,7 +680,6 @@ static void constrain_line (int x0, int *x1, int y0, int *y1, int width, int hei
int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *ppflags)
{
- char message[512];
int q = oci->filter_level * 10 / 6;
int flags = ppflags->post_proc_flag;
int deblock_level = ppflags->deblocking_level;
@@ -744,6 +743,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
#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,
@@ -823,6 +823,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
if (flags & VP8D_DEBUG_TXT_RATE_INFO)
{
+ char message[512];
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);
}
diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c
index 06204fec6..d88c1fd01 100644
--- a/vp8/decoder/decodframe.c
+++ b/vp8/decoder/decodframe.c
@@ -485,7 +485,6 @@ static void setup_token_decoder(VP8D_COMP *pbi,
static void stop_token_decoder(VP8D_COMP *pbi)
{
- int i;
VP8_COMMON *pc = &pbi->common;
if (pc->multi_token_partition != ONE_PARTITION)
diff --git a/vp8/decoder/threading.c b/vp8/decoder/threading.c
index fea4e1cc1..dac990a26 100644
--- a/vp8/decoder/threading.c
+++ b/vp8/decoder/threading.c
@@ -451,7 +451,6 @@ void vp8_decoder_create_threads(VP8D_COMP *pbi)
#if CONFIG_MULTITHREAD
int core_count = 0;
int ithread;
- int i;
pbi->b_multithreaded_rd = 0;
pbi->allocated_decoding_thread_count = 0;
@@ -721,7 +720,6 @@ void vp8mt_lpf_init( VP8D_COMP *pbi, int default_filt_lvl)
/*int mb_row;
int mb_col;
int baseline_filter_level[MAX_MB_SEGMENTS];*/
- int filter_level;
int alt_flt_enabled = mbd->segmentation_enabled;
int i;
@@ -769,7 +767,7 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
int ibc = 0;
int num_part = 1 << pbi->common.multi_token_partition;
- int i, j;
+ int i;
volatile int *last_row_current_mb_col = NULL;
int nsync = pbi->sync_range;
@@ -809,7 +807,6 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
for (mb_row = 0; mb_row < pc->mb_rows; mb_row += (pbi->decoding_thread_count + 1))
{
- int i;
xd->current_bc = &pbi->mbc[mb_row%num_part];
diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c
index 5a727af3d..138239843 100644
--- a/vp8/encoder/encodeframe.c
+++ b/vp8/encoder/encodeframe.c
@@ -416,7 +416,6 @@ unsigned int vp8_activity_masking(VP8_COMP *cpi, MACROBLOCK *x)
int sum;
unsigned int a;
unsigned int b;
- unsigned int d;
/* TODO: This could also be done over smaller areas (8x8), but that would
* require extensive changes elsewhere, as lambda is assumed to be fixed
* over an entire MB in most of the code.
@@ -674,7 +673,6 @@ void vp8_encode_frame(VP8_COMP *cpi)
VP8_COMMON *const cm = & cpi->common;
MACROBLOCKD *const xd = & x->e_mbd;
- int i;
TOKENEXTRA *tp = cpi->tok;
#if CONFIG_SEGMENTATION
int segment_counts[MAX_MB_SEGMENTS + SEEK_SEGID];
diff --git a/vp8/encoder/encodemb.c b/vp8/encoder/encodemb.c
index 464d4a236..efcea745b 100644
--- a/vp8/encoder/encodemb.c
+++ b/vp8/encoder/encodemb.c
@@ -273,7 +273,6 @@ void vp8_optimize_b(MACROBLOCK *mb, int ib, int type,
int x;
int sz;
int next;
- int path;
int rdmult;
int rddiv;
int final_eob;
diff --git a/vp8/encoder/firstpass.c b/vp8/encoder/firstpass.c
index 4d259c676..c59613838 100644
--- a/vp8/encoder/firstpass.c
+++ b/vp8/encoder/firstpass.c
@@ -262,7 +262,6 @@ extern size_t vp8_firstpass_stats_sz(unsigned int mb_count)
* macroblock.
*/
size_t stats_sz;
- FIRSTPASS_STATS stats;
stats_sz = sizeof(FIRSTPASS_STATS) + mb_count;
stats_sz = (stats_sz + 7) & ~7;
@@ -389,8 +388,6 @@ unsigned char *vp8_fpmm_get_pos(VP8_COMP *cpi)
}
void vp8_fpmm_reset_pos(VP8_COMP *cpi, unsigned char *target_pos)
{
- int Offset;
-
cpi->fp_motion_map_stats = target_pos;
}
@@ -983,10 +980,10 @@ static int estimate_max_q(VP8_COMP *cpi, double section_err, int section_target_
// Restriction on active max q for constrained quality mode.
if ( (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) &&
(Q < cpi->cq_target_quality) )
- //(Q < cpi->oxcf.cq_target_quality) )
+ //(Q < cpi->oxcf.cq_level;) )
{
Q = cpi->cq_target_quality;
- //Q = cpi->oxcf.cq_target_quality;
+ //Q = cpi->oxcf.cq_level;
}
// Adjust maxq_min_limit and maxq_max_limit limits based on
@@ -2289,6 +2286,9 @@ void vp8_find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
cpi->common.frame_type = KEY_FRAME;
+ // is this a forced key frame by interval
+ cpi->this_key_frame_forced = cpi->next_key_frame_forced;
+
// Clear the alt ref active flag as this can never be active on a key frame
cpi->source_alt_ref_active = FALSE;
@@ -2351,7 +2351,11 @@ void vp8_find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
kf_group_err /= 2.0;
kf_group_intra_err /= 2.0;
kf_group_coded_err /= 2.0;
+
+ cpi->next_key_frame_forced = TRUE;
}
+ else
+ cpi->next_key_frame_forced = FALSE;
// Special case for the last frame of the file
if (cpi->stats_in >= cpi->stats_in_end)
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index 6a71896b0..0fca39037 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -589,6 +589,7 @@ void vp8_set_speed_features(VP8_COMP *cpi)
sf->iterative_sub_pixel = 1;
sf->optimize_coefficients = 1;
sf->use_fastquant_for_pick = 0;
+ sf->no_skip_block4x4_search = 1;
sf->first_step = 0;
sf->max_step_search_steps = MAX_MVSEARCH_STEPS;
@@ -791,6 +792,7 @@ void vp8_set_speed_features(VP8_COMP *cpi)
sf->first_step = 1;
sf->max_step_search_steps = MAX_MVSEARCH_STEPS;
+ sf->no_skip_block4x4_search = 0;
}
if (Speed > 1)
@@ -2266,6 +2268,8 @@ VP8_PTR vp8_create_compressor(VP8_CONFIG *oxcf)
cpi->frames_since_key = 8; // Give a sensible default for the first frame.
cpi->key_frame_frequency = cpi->oxcf.key_freq;
+ cpi->this_key_frame_forced = FALSE;
+ cpi->next_key_frame_forced = FALSE;
cpi->source_alt_ref_pending = FALSE;
cpi->source_alt_ref_active = FALSE;
@@ -3792,8 +3796,6 @@ static void encode_frame_to_data_rate
if (cpi->pass == 2 || (cm->current_video_frame > 150))
{
int Q;
- int i;
- int bpm_target;
//int tmp;
vp8_clear_system_state();
@@ -3817,10 +3819,22 @@ static void encode_frame_to_data_rate
// KEY FRAMES
else
{
- if (cpi->gfu_boost > 600)
- cpi->active_best_quality = kf_low_motion_minq[Q];
- else
- cpi->active_best_quality = kf_high_motion_minq[Q];
+ // Special case for key frames forced because we have reached
+ // the maximum key frame interval. Here force the Q to a range
+ // close to but just below the ambient Q to reduce the risk
+ // of popping
+ if ( cpi->this_key_frame_forced )
+ {
+ cpi->active_worst_quality = cpi->avg_frame_qindex * 7/8;
+ cpi->active_best_quality = cpi->avg_frame_qindex * 2/3;
+ }
+ else
+ {
+ if (cpi->gfu_boost > 600)
+ cpi->active_best_quality = kf_low_motion_minq[Q];
+ else
+ cpi->active_best_quality = kf_high_motion_minq[Q];
+ }
}
}
else
@@ -4827,7 +4841,9 @@ extern void vp8_pop_neon(INT64 *store);
#endif
int vp8_receive_raw_frame(VP8_PTR ptr, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, INT64 time_stamp, INT64 end_time)
{
+#if HAVE_ARMV7
INT64 store_reg[8];
+#endif
VP8_COMP *cpi = (VP8_COMP *) ptr;
VP8_COMMON *cm = &cpi->common;
struct vpx_usec_timer timer;
@@ -4930,7 +4946,9 @@ int vp8_receive_raw_frame(VP8_PTR ptr, unsigned int frame_flags, YV12_BUFFER_CON
}
int vp8_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, INT64 *time_stamp, INT64 *time_end, int flush)
{
+#if HAVE_ARMV7
INT64 store_reg[8];
+#endif
VP8_COMP *cpi = (VP8_COMP *) ptr;
VP8_COMMON *cm = &cpi->common;
struct vpx_usec_timer tsctimer;
diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h
index 45238622b..472bcdb0c 100644
--- a/vp8/encoder/onyx_int.h
+++ b/vp8/encoder/onyx_int.h
@@ -183,6 +183,7 @@ typedef struct
int optimize_coefficients;
int use_fastquant_for_pick;
+ int no_skip_block4x4_search;
} SPEED_FEATURES;
@@ -320,7 +321,8 @@ typedef struct
unsigned int frames_since_key;
unsigned int key_frame_frequency;
- unsigned int next_key;
+ unsigned int this_key_frame_forced;
+ unsigned int next_key_frame_forced;
unsigned int mode_check_freq[MAX_MODES];
unsigned int mode_test_hit_counts[MAX_MODES];
diff --git a/vp8/encoder/quantize.c b/vp8/encoder/quantize.c
index a67299487..be9f26c7f 100644
--- a/vp8/encoder/quantize.c
+++ b/vp8/encoder/quantize.c
@@ -70,7 +70,6 @@ void vp8_fast_quantize_b_c(BLOCK *b, BLOCKD *d)
void vp8_fast_quantize_b_c(BLOCK *b, BLOCKD *d)
{
int i, rc, eob;
- int zbin;
int x, y, z, sz;
short *coeff_ptr = b->coeff;
short *round_ptr = b->round;
diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c
index 366b8759a..e751b0961 100644
--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -1375,7 +1375,8 @@ static int vp8_rd_pick_best_mbsegmentation(VP8_COMP *cpi, MACROBLOCK *x,
}
/* If 8x8 is better than 16x8/8x16, then do 4x4 search */
- if (bsi.segment_num == BLOCK_8X8) /* || (sv_segment_rd8x8-bsi.segment_rd) < sv_segment_rd8x8>>5) */
+ /* Not skip 4x4 if speed=0 (good quality) */
+ if (cpi->sf.no_skip_block4x4_search || bsi.segment_num == BLOCK_8X8) /* || (sv_segment_rd8x8-bsi.segment_rd) < sv_segment_rd8x8>>5) */
{
bsi.mvp = &bsi.sv_mvp[0];
vp8_rd_check_segment(cpi, x, &bsi, BLOCK_4X4);
diff --git a/vp8/encoder/x86/temporal_filter_apply_sse2.asm b/vp8/encoder/x86/temporal_filter_apply_sse2.asm
index 0127b012e..f2adcccba 100644
--- a/vp8/encoder/x86/temporal_filter_apply_sse2.asm
+++ b/vp8/encoder/x86/temporal_filter_apply_sse2.asm
@@ -84,7 +84,7 @@ temporal_filter_apply_load_8:
jmp temporal_filter_apply_load_finished
temporal_filter_apply_load_16:
- movdqa xmm0, [rsi] ; src (frame1)
+ movdqu xmm0, [rsi] ; src (frame1)
lea rsi, [rsi + rbp] ; += stride
movdqa xmm1, xmm0
punpcklbw xmm0, xmm7 ; src[ 0- 7]