ref: cba980e3eb375261635b9332d99137c0b6b32b5f
parent: df3296c8a107d68a35915fc224d5d151cc4af87d
parent: 185557344ae79890d4acbbf5972972d20af1dd05
author: John Koleszar <jkoleszar@google.com>
date: Thu Mar 17 20:05:06 EDT 2011
Merge remote branch 'internal/upstream' into HEAD
--- a/vp8/encoder/bitstream.c
+++ b/vp8/encoder/bitstream.c
@@ -1441,6 +1441,7 @@
oh.show_frame = (int) pc->show_frame;
oh.type = (int)pc->frame_type;
oh.version = pc->version;
+ oh.first_partition_length_in_bytes = 0;
mb_feature_data_bits = vp8_mb_feature_data_bits;
cx_data += 3;
@@ -1716,7 +1717,22 @@
#endif
vp8_stop_encode(bc);
+ oh.first_partition_length_in_bytes = cpi->bc.pos;
+ /* update frame tag */
+ {
+ int v = (oh.first_partition_length_in_bytes << 5) |
+ (oh.show_frame << 4) |
+ (oh.version << 1) |
+ oh.type;
+
+ dest[0] = v;
+ dest[1] = v >> 8;
+ dest[2] = v >> 16;
+ }
+
+ *size = VP8_HEADER_SIZE + extra_bytes_packed + cpi->bc.pos;
+
if (pc->multi_token_partition != ONE_PARTITION)
{
int num_part;
@@ -1725,9 +1741,7 @@
pack_tokens_into_partitions(cpi, cx_data + bc->pos, num_part, &asize);
- oh.first_partition_length_in_bytes = cpi->bc.pos;
-
- *size = cpi->bc.pos + VP8_HEADER_SIZE + asize + extra_bytes_packed;
+ *size += asize;
}
else
{
@@ -1741,19 +1755,8 @@
pack_tokens(&cpi->bc2, cpi->tok, cpi->tok_count);
vp8_stop_encode(&cpi->bc2);
- oh.first_partition_length_in_bytes = cpi->bc.pos ;
- *size = cpi->bc2.pos + cpi->bc.pos + VP8_HEADER_SIZE + extra_bytes_packed;
- }
- {
- int v = (oh.first_partition_length_in_bytes << 5) |
- (oh.show_frame << 4) |
- (oh.version << 1) |
- oh.type;
-
- dest[0] = v;
- dest[1] = v >> 8;
- dest[2] = v >> 16;
+ *size += cpi->bc2.pos;
}
}
--- a/vp8/vp8_dx_iface.c
+++ b/vp8/vp8_dx_iface.c
@@ -168,7 +168,7 @@
{
int i;
- for (i = 0; i < NELEMENTS(vp8_mem_req_segs); i++)
+ for (i = 0; i < NELEMENTS(ctx->mmaps); i++)
if (ctx->mmaps[i].id == id)
return ctx->mmaps[i].base;
@@ -176,25 +176,7 @@
}
static void vp8_finalize_mmaps(vpx_codec_alg_priv_t *ctx)
{
- /*
- ctx->pbi = mmap_lkup(ctx, VP6_SEG_PB_INSTANCE);
- ctx->pbi->mbi.block_dx_info[0].idct_output_ptr = mmap_lkup(ctx, VP6_SEG_IDCT_BUFFER);
- ctx->pbi->loop_filtered_block = mmap_lkup(ctx, VP6_SEG_LF_BLOCK);
- ctx->pbi->huff = mmap_lkup(ctx, VP6_SEG_HUFF);
- ctx->pbi->mbi.coeffs_base_ptr = mmap_lkup(ctx, VP6_SEG_COEFFS);
- ctx->pbi->fc.above_y = mmap_lkup(ctx, VP6_SEG_ABOVEY);
- ctx->pbi->fc.above_u = mmap_lkup(ctx, VP6_SEG_ABOVEU);
- ctx->pbi->fc.above_v = mmap_lkup(ctx, VP6_SEG_ABOVEV);
- ctx->pbi->prediction_mode = mmap_lkup(ctx, VP6_SEG_PRED_MODES);
- ctx->pbi->mbmotion_vector = mmap_lkup(ctx, VP6_SEG_MV_FIELD);
- ctx->pbi->fb_storage_ptr[0] = mmap_lkup(ctx, VP6_SEG_IMG0_STRG);
- ctx->pbi->fb_storage_ptr[1] = mmap_lkup(ctx, VP6_SEG_IMG1_STRG);
- ctx->pbi->fb_storage_ptr[2] = mmap_lkup(ctx, VP6_SEG_IMG2_STRG);
- #if CONFIG_POSTPROC
- ctx->pbi->postproc.deblock.fragment_variances = mmap_lkup(ctx, VP6_SEG_DEBLOCKER);
- ctx->pbi->fb_storage_ptr[3] = mmap_lkup(ctx, VP6_SEG_PP_IMG_STRG);
- #endif
- */
+ /* nothing to clean up */
}
static vpx_codec_err_t vp8_init(vpx_codec_ctx_t *ctx)
@@ -543,7 +525,7 @@
if (!res && ctx->priv->alg_priv)
{
- for (i = 0; i < NELEMENTS(vp8_mem_req_segs); i++)
+ for (i = 0; i < NELEMENTS(ctx->priv->alg_priv->mmaps); i++)
{
if (ctx->priv->alg_priv->mmaps[i].id == mmap->id)
if (!ctx->priv->alg_priv->mmaps[i].base)