summaryrefslogtreecommitdiff
path: root/vp8/encoder/onyx_if.c
diff options
context:
space:
mode:
authorYunqing Wang <yunqingwang@google.com>2012-03-16 14:02:51 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2012-03-16 14:02:51 -0700
commit9ed1b2f09e9142687d4762d0c0906ebd9bfd167b (patch)
tree92814812084b8348cd2a7aab5e81682bbfef2518 /vp8/encoder/onyx_if.c
parent56e8485c8423072e552db537bd55dbdaebde877b (diff)
parent6a819ce4fe9e4cc6bd9eed1d19ee90602651ddf5 (diff)
downloadlibvpx-9ed1b2f09e9142687d4762d0c0906ebd9bfd167b.tar
libvpx-9ed1b2f09e9142687d4762d0c0906ebd9bfd167b.tar.gz
libvpx-9ed1b2f09e9142687d4762d0c0906ebd9bfd167b.tar.bz2
libvpx-9ed1b2f09e9142687d4762d0c0906ebd9bfd167b.zip
Merge "Add motion search skipping in first pass"
Diffstat (limited to 'vp8/encoder/onyx_if.c')
-rw-r--r--vp8/encoder/onyx_if.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index d7b1bc1c8..1de7514d0 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -1106,10 +1106,6 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi)
width, height, VP8BORDERINPIXELS))
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
"Failed to allocate scaled source buffer");
-
-
- vpx_free(cpi->tok);
-
{
#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING
unsigned int tokens = 8 * 24 * 16; /* one MB for each thread */
@@ -2934,7 +2930,6 @@ static void Pass1Encode(VP8_COMP *cpi, unsigned long *size, unsigned char *dest,
(void) frame_flags;
vp8_set_quantizer(cpi, 26);
- scale_and_extend_source(cpi->un_scaled_source, cpi);
vp8_first_pass(cpi);
}
#endif
@@ -4721,7 +4716,8 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
cpi->source_alt_ref_pending)
{
if ((cpi->source = vp8_lookahead_peek(cpi->lookahead,
- cpi->frames_till_gf_update_due)))
+ cpi->frames_till_gf_update_due,
+ PEEK_FORWARD)))
{
cpi->alt_ref_source = cpi->source;
if (cpi->oxcf.arnr_max_frames > 0)
@@ -4743,6 +4739,15 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
if (!cpi->source)
{
+ /* Read last frame source if we are encoding first pass. */
+ if (cpi->pass == 1 && cm->current_video_frame > 0)
+ {
+ if((cpi->last_source = vp8_lookahead_peek(cpi->lookahead, 1,
+ PEEK_BACKWARD)) == NULL)
+ return -1;
+ }
+
+
if ((cpi->source = vp8_lookahead_pop(cpi->lookahead, flush)))
{
cm->show_frame = 1;
@@ -4762,6 +4767,11 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
*time_stamp = cpi->source->ts_start;
*time_end = cpi->source->ts_end;
*frame_flags = cpi->source->flags;
+
+ if (cpi->pass == 1 && cm->current_video_frame > 0)
+ {
+ cpi->last_frame_unscaled_source = &cpi->last_source->img;
+ }
}
else
{