summaryrefslogtreecommitdiff
path: root/vp8
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2011-07-22 00:05:06 -0400
committerJohn Koleszar <jkoleszar@google.com>2011-07-22 00:05:06 -0400
commit7d44c805cfc3aefb8b0850f2e3fca159439aea68 (patch)
treee74f1b6fbeb61c2a754b3f2de1e83fa9aa45b7d1 /vp8
parent06e9386422c1b64b3fc2973b7c0ffd6546285b80 (diff)
parent52d13777daa3317d23733a03c3a6402ec3baf8d0 (diff)
downloadlibvpx-7d44c805cfc3aefb8b0850f2e3fca159439aea68.tar
libvpx-7d44c805cfc3aefb8b0850f2e3fca159439aea68.tar.gz
libvpx-7d44c805cfc3aefb8b0850f2e3fca159439aea68.tar.bz2
libvpx-7d44c805cfc3aefb8b0850f2e3fca159439aea68.zip
Merge remote branch 'internal/upstream' into HEAD
Diffstat (limited to 'vp8')
-rw-r--r--vp8/encoder/lookahead.c3
-rw-r--r--vp8/encoder/onyx_if.c9
-rw-r--r--vp8/vp8_dx_iface.c45
3 files changed, 40 insertions, 17 deletions
diff --git a/vp8/encoder/lookahead.c b/vp8/encoder/lookahead.c
index 3b86d4094..d7f85cba1 100644
--- a/vp8/encoder/lookahead.c
+++ b/vp8/encoder/lookahead.c
@@ -86,7 +86,8 @@ vp8_lookahead_init(unsigned int width,
if(!ctx->buf)
goto bail;
for(i=0; i<depth; i++)
- if (vp8_yv12_alloc_frame_buffer(&ctx->buf[i].img, width, height, 16))
+ if (vp8_yv12_alloc_frame_buffer(&ctx->buf[i].img,
+ width, height, VP8BORDERINPIXELS))
goto bail;
}
return ctx;
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index 3adc13689..270833263 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -961,6 +961,10 @@ void vp8_set_speed_features(VP8_COMP *cpi)
sf->improved_quant = 0;
sf->improved_dct = 0;
+
+ sf->use_fastquant_for_pick = 1;
+ sf->no_skip_block4x4_search = 0;
+ sf->first_step = 1;
}
if (Speed > 1)
@@ -1336,7 +1340,7 @@ static void alloc_raw_frame_buffers(VP8_COMP *cpi)
#if VP8_TEMPORAL_ALT_REF
if (vp8_yv12_alloc_frame_buffer(&cpi->alt_ref_buffer,
- width, height, 16))
+ width, height, VP8BORDERINPIXELS))
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
"Failed to allocate altref buffer");
@@ -1386,7 +1390,8 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi)
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
"Failed to allocate last frame buffer");
- if (vp8_yv12_alloc_frame_buffer(&cpi->scaled_source, width, height, 16))
+ if (vp8_yv12_alloc_frame_buffer(&cpi->scaled_source,
+ width, height, VP8BORDERINPIXELS))
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
"Failed to allocate scaled source buffer");
diff --git a/vp8/vp8_dx_iface.c b/vp8/vp8_dx_iface.c
index 58dc486de..13a072bff 100644
--- a/vp8/vp8_dx_iface.c
+++ b/vp8/vp8_dx_iface.c
@@ -301,6 +301,36 @@ update_error_state(vpx_codec_alg_priv_t *ctx,
return res;
}
+static void yuvconfig2image(vpx_image_t *img,
+ const YV12_BUFFER_CONFIG *yv12,
+ void *user_priv)
+{
+ /** vpx_img_wrap() doesn't allow specifying independent strides for
+ * the Y, U, and V planes, nor other alignment adjustments that
+ * might be representable by a YV12_BUFFER_CONFIG, so we just
+ * initialize all the fields.*/
+ img->fmt = yv12->clrtype == REG_YUV ?
+ VPX_IMG_FMT_I420 : VPX_IMG_FMT_VPXI420;
+ img->w = yv12->y_stride;
+ img->h = (yv12->y_height + 2 * VP8BORDERINPIXELS + 15) & ~15;
+ img->d_w = yv12->y_width;
+ img->d_h = yv12->y_height;
+ img->x_chroma_shift = 1;
+ img->y_chroma_shift = 1;
+ img->planes[VPX_PLANE_Y] = yv12->y_buffer;
+ img->planes[VPX_PLANE_U] = yv12->u_buffer;
+ img->planes[VPX_PLANE_V] = yv12->v_buffer;
+ img->planes[VPX_PLANE_ALPHA] = NULL;
+ img->stride[VPX_PLANE_Y] = yv12->y_stride;
+ img->stride[VPX_PLANE_U] = yv12->uv_stride;
+ img->stride[VPX_PLANE_V] = yv12->uv_stride;
+ img->stride[VPX_PLANE_ALPHA] = yv12->y_stride;
+ img->bps = 12;
+ img->user_priv = user_priv;
+ img->img_data = yv12->buffer_alloc;
+ img->img_data_owner = 0;
+ img->self_allocd = 0;
+}
static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx,
const uint8_t *data,
@@ -429,21 +459,8 @@ static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx,
if (!res && 0 == vp8dx_get_raw_frame(ctx->pbi, &sd, &time_stamp, &time_end_stamp, &flags))
{
- /* Align width/height */
- unsigned int a_w = (sd.y_width + 15) & ~15;
- unsigned int a_h = (sd.y_height + 15) & ~15;
-
- vpx_img_wrap(&ctx->img, VPX_IMG_FMT_I420,
- a_w + 2 * VP8BORDERINPIXELS,
- a_h + 2 * VP8BORDERINPIXELS,
- 1,
- sd.buffer_alloc);
- vpx_img_set_rect(&ctx->img,
- VP8BORDERINPIXELS, VP8BORDERINPIXELS,
- sd.y_width, sd.y_height);
- ctx->img.user_priv = user_priv;
+ yuvconfig2image(&ctx->img, &sd, user_priv);
ctx->img_avail = 1;
-
}
}