Merge remote branch 'origin/master' into experimental
authorJohn Koleszar <jkoleszar@google.com>
Thu, 3 Mar 2011 14:01:10 +0000 (09:01 -0500)
committerJohn Koleszar <jkoleszar@google.com>
Thu, 3 Mar 2011 14:01:10 +0000 (09:01 -0500)
Conflicts:
vp8/vp8_cx_iface.c

Change-Id: Ib30d0cfbdaeb605ee4b846f683d204cd07e0c028

1  2 
vp8/encoder/generic/csystemdependent.c
vp8/encoder/onyx_if.c
vp8/vp8_cx_iface.c

Simple merge
@@@ -498,58 -492,67 +498,68 @@@ static vpx_codec_err_t vp8e_common_init
      {
          priv = calloc(1, sizeof(struct vpx_codec_alg_priv));
  
-         if (priv)
+         if (!priv)
          {
-             ctx->priv = &priv->base;
-             ctx->priv->sz = sizeof(*ctx->priv);
-             ctx->priv->iface = ctx->iface;
-             ctx->priv->alg_priv = priv;
-             ctx->priv->init_flags = ctx->init_flags;
-             if (ctx->config.enc)
-             {
-                 /* Update the reference to the config structure to an
-                  * internal copy.
-                  */
-                 ctx->priv->alg_priv->cfg = *ctx->config.enc;
-                 ctx->config.enc = &ctx->priv->alg_priv->cfg;
-             }
-             cfg =  &ctx->priv->alg_priv->cfg;
-             /* Select the extra vp6 configuration table based on the current
-              * usage value. If the current usage value isn't found, use the
-              * values for usage case 0.
+             return VPX_CODEC_MEM_ERROR;
+         }
+         ctx->priv = &priv->base;
+         ctx->priv->sz = sizeof(*ctx->priv);
+         ctx->priv->iface = ctx->iface;
+         ctx->priv->alg_priv = priv;
+         ctx->priv->init_flags = ctx->init_flags;
+         if (ctx->config.enc)
+         {
+             /* Update the reference to the config structure to an
+              * internal copy.
               */
-             for (i = 0;
-                  extracfg_map[i].usage && extracfg_map[i].usage != cfg->g_usage;
-                  i++);
+             ctx->priv->alg_priv->cfg = *ctx->config.enc;
+             ctx->config.enc = &ctx->priv->alg_priv->cfg;
+         }
+         cfg =  &ctx->priv->alg_priv->cfg;
  
-             priv->vp8_cfg = extracfg_map[i].cfg;
-             priv->vp8_cfg.pkt_list = &priv->pkt_list.head;
+         /* Select the extra vp6 configuration table based on the current
+          * usage value. If the current usage value isn't found, use the
+          * values for usage case 0.
+          */
+         for (i = 0;
+              extracfg_map[i].usage && extracfg_map[i].usage != cfg->g_usage;
+              i++);
+         priv->vp8_cfg = extracfg_map[i].cfg;
+         priv->vp8_cfg.pkt_list = &priv->pkt_list.head;
 +            priv->vp8_cfg.experimental = experimental;
  
-             priv->cx_data_sz = priv->cfg.g_w * priv->cfg.g_h * 3 / 2 * 2;
+         priv->cx_data_sz = priv->cfg.g_w * priv->cfg.g_h * 3 / 2 * 2;
  
-             if (priv->cx_data_sz < 4096) priv->cx_data_sz = 4096;
+         if (priv->cx_data_sz < 4096) priv->cx_data_sz = 4096;
  
-             priv->cx_data = malloc(priv->cx_data_sz);
-             priv->deprecated_mode = NO_MODE_SET;
+         priv->cx_data = malloc(priv->cx_data_sz);
  
-             vp8_initialize();
+         if (!priv->cx_data)
+         {
+             return VPX_CODEC_MEM_ERROR;
+         }
  
-             res = validate_config(priv, &priv->cfg, &priv->vp8_cfg);
+         priv->deprecated_mode = NO_MODE_SET;
  
-             if (!res)
-             {
-                 set_vp8e_config(&ctx->priv->alg_priv->oxcf, ctx->priv->alg_priv->cfg, ctx->priv->alg_priv->vp8_cfg);
-                 optr = vp8_create_compressor(&ctx->priv->alg_priv->oxcf);
+         vp8_initialize();
  
-                 if (!optr)
-                     res = VPX_CODEC_MEM_ERROR;
-                 else
-                     ctx->priv->alg_priv->cpi = optr;
-             }
+         res = validate_config(priv, &priv->cfg, &priv->vp8_cfg);
+         if (!res)
+         {
+             set_vp8e_config(&ctx->priv->alg_priv->oxcf,
+                              ctx->priv->alg_priv->cfg,
+                              ctx->priv->alg_priv->vp8_cfg);
+             optr = vp8_create_compressor(&ctx->priv->alg_priv->oxcf);
+             if (!optr)
+                 res = VPX_CODEC_MEM_ERROR;
+             else
+                 ctx->priv->alg_priv->cpi = optr;
          }
      }