shithub: libvpx

Download patch

ref: 47321016da8eaa0427eec81b42563f047b9e7aa6
parent: 7763c888e0c0a0c7b0a25746b11fdc3d53da4f70
author: Jerome Jiang <jianj@google.com>
date: Tue Jan 28 10:25:31 EST 2020

Fix initialization of delta_q_uv

Change-Id: If778c6534a5e68a9bcd5974f778e97e1c5cc89ee

--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -61,6 +61,7 @@
   int render_height;
   unsigned int row_mt;
   unsigned int motion_vector_unit_test;
+  int delta_q_uv;
 } vp9_extracfg;
 
 static struct vp9_extracfg default_extra_cfg = {
@@ -95,6 +96,7 @@
   0,                     // render height
   0,                     // row_mt
   0,                     // motion_vector_unit_test
+  0,                     // delta_q_uv
 };
 
 struct vpx_codec_alg_priv {
@@ -601,6 +603,8 @@
   oxcf->row_mt = extra_cfg->row_mt;
   oxcf->motion_vector_unit_test = extra_cfg->motion_vector_unit_test;
 
+  oxcf->delta_q_uv = extra_cfg->delta_q_uv;
+
   for (sl = 0; sl < oxcf->ss_number_layers; ++sl) {
     for (tl = 0; tl < oxcf->ts_number_layers; ++tl) {
       oxcf->layer_target_bitrate[sl * oxcf->ts_number_layers + tl] =
@@ -1642,12 +1646,11 @@
 
 static vpx_codec_err_t ctrl_set_delta_q_uv(vpx_codec_alg_priv_t *ctx,
                                            va_list args) {
+  struct vp9_extracfg extra_cfg = ctx->extra_cfg;
   int data = va_arg(args, int);
-  VP9_COMP *const cpi = ctx->cpi;
   data = VPXMIN(VPXMAX(data, -20), 20);
-  cpi->oxcf.delta_q_uv = data;
-  ctx->oxcf.delta_q_uv = data;
-  return VPX_CODEC_OK;
+  extra_cfg.delta_q_uv = data;
+  return update_extra_cfg(ctx, &extra_cfg);
 }
 
 static vpx_codec_err_t ctrl_register_cx_callback(vpx_codec_alg_priv_t *ctx,