]> granicus.if.org Git - libvpx/commitdiff
Increase min size of compressed data
authorYaowu Xu <yaowu@google.com>
Mon, 11 Jul 2016 18:38:53 +0000 (11:38 -0700)
committerYaowu Xu <yaowu@google.com>
Mon, 24 Oct 2016 16:56:09 +0000 (09:56 -0700)
This commit increases the minimum size for allocated buffer for
compressed data. The old size underestimated the size needed for
small images with width or height less than 64 pixels.

BUG=https://bugs.chromium.org/p/aomedia/issues/detail?id=31

Change-Id: Ia12507edc2be1e737ec49c32f64fd2ebf1eab41f

av1/av1_cx_iface.c

index fae7d042acc946b0cab6f23e42d8466c578412d0..63f7618cddb206cebbc5c91359ea13cd4d227693 100644 (file)
@@ -932,6 +932,7 @@ static aom_codec_frame_flags_t get_frame_pkt_flags(const AV1_COMP *cpi,
   return flags;
 }
 
+const size_t kMinCompressedSize = 8192;
 static aom_codec_err_t encoder_encode(aom_codec_alg_priv_t *ctx,
                                       const aom_image_t *img,
                                       aom_codec_pts_t pts,
@@ -959,7 +960,7 @@ static aom_codec_err_t encoder_encode(aom_codec_alg_priv_t *ctx,
       data_sz = ctx->cfg.g_w * ctx->cfg.g_h * get_image_bps(img) / 8 *
                 (cpi->multi_arf_allowed ? 8 : 2);
 #endif  // CONFIG_EXT_REFS
-      if (data_sz < 4096) data_sz = 4096;
+      if (data_sz < kMinCompressedSize) data_sz = kMinCompressedSize;
       if (ctx->cx_data == NULL || ctx->cx_data_sz < data_sz) {
         ctx->cx_data_sz = data_sz;
         free(ctx->cx_data);