shithub: libvpx

Download patch

ref: 4a1c3cf7d8bb38db15702f6fb772c9b94233c8e9
parent: 53d11fa6ad8dc65cf335a108b0830dac07175c11
parent: 185557344ae79890d4acbbf5972972d20af1dd05
author: John Koleszar <jkoleszar@google.com>
date: Thu Mar 17 20:05:07 EDT 2011

Merge remote branch 'origin/master' into experimental

Change-Id: If77de7e96a971edd8666ea0b1bd5eac6b09c6912

--- a/vp8/encoder/bitstream.c
+++ b/vp8/encoder/bitstream.c
@@ -1366,6 +1366,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;
@@ -1634,7 +1635,22 @@
 
     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;
@@ -1643,9 +1659,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
     {
@@ -1659,19 +1673,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)
--