shithub: libvpx

Download patch

ref: 6f6fbf9175a7969574c7c4b1b855cc6df6641f20
parent: 0337bae9b3cdb2869073911b0efc2b4f3cfcf595
parent: ce52b0f8d347224cd526dc1ba55597a2aa79c341
author: Yaowu Xu <yaowu@google.com>
date: Tue Jan 13 04:20:13 EST 2015

Merge "Added plumbing for setting color space"

--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -607,7 +607,7 @@
 #if CONFIG_VP9_HIGHBITDEPTH
   cm->use_highbitdepth = oxcf->use_highbitdepth;
 #endif
-  cm->color_space = UNKNOWN;
+  cm->color_space = oxcf->color_space;
 
   cm->width = oxcf->width;
   cm->height = oxcf->height;
--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -231,6 +231,7 @@
 #if CONFIG_VP9_HIGHBITDEPTH
   int use_highbitdepth;
 #endif
+  COLOR_SPACE color_space;
 } VP9EncoderConfig;
 
 static INLINE int is_lossless_requested(const VP9EncoderConfig *cfg) {
--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -41,6 +41,7 @@
   AQ_MODE                     aq_mode;
   unsigned int                frame_periodic_boost;
   vpx_bit_depth_t             bit_depth;
+  COLOR_SPACE                 color_space;
   vp9e_tune_content           content;
 };
 
@@ -64,6 +65,7 @@
   NO_AQ,                      // aq_mode
   0,                          // frame_periodic_delta_q
   VPX_BITS_8,                 // Bit depth
+  UNKNOWN,                    // Color Space
   VP9E_CONTENT_DEFAULT        // content
 };
 
@@ -294,7 +296,7 @@
       cfg->g_bit_depth == VPX_BITS_8) {
     ERROR("Codec bit-depth 8 not supported in profile > 1");
   }
-
+  RANGE_CHECK(extra_cfg, color_space, UNKNOWN, SRGB);
   return VPX_CODEC_OK;
 }
 
@@ -437,6 +439,7 @@
   oxcf->firstpass_mb_stats_in  = cfg->rc_firstpass_mb_stats_in;
 #endif
 
+  oxcf->color_space = extra_cfg->color_space;
   oxcf->arnr_max_frames = extra_cfg->arnr_max_frames;
   oxcf->arnr_strength   = extra_cfg->arnr_strength;