]> granicus.if.org Git - libvpx/commitdiff
Added plumbing for setting color space
authorYaowu Xu <yaowu@google.com>
Fri, 9 Jan 2015 18:52:33 +0000 (10:52 -0800)
committerYaowu Xu <yaowu@google.com>
Fri, 9 Jan 2015 18:54:25 +0000 (10:54 -0800)
Change-Id: If64052cc6e404abc8a64a889f42930d14fad21d3

vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_encoder.h
vp9/vp9_cx_iface.c

index 510be9649380d2f7b3f6215ef19aaead2a40a507..904460e49445d32cc07c384c008b740e4eb7cb38 100644 (file)
@@ -607,7 +607,7 @@ static void init_config(struct VP9_COMP *cpi, VP9EncoderConfig *oxcf) {
 #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;
index 7872e2cc1654cb997b586385f7976a6b81a329b9..364e3d16caa7106683d7761c2a90d08709518a07 100644 (file)
@@ -231,6 +231,7 @@ typedef struct VP9EncoderConfig {
 #if CONFIG_VP9_HIGHBITDEPTH
   int use_highbitdepth;
 #endif
+  COLOR_SPACE color_space;
 } VP9EncoderConfig;
 
 static INLINE int is_lossless_requested(const VP9EncoderConfig *cfg) {
index 531a03ebec160313a42187e9fb142dbad7ab4152..b3ae4a71ee2dbbdc93a3ed2482b7b91024c8d9a8 100644 (file)
@@ -41,6 +41,7 @@ struct vp9_extracfg {
   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 @@ static struct vp9_extracfg default_extra_cfg = {
   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 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
       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 @@ static vpx_codec_err_t set_encoder_config(
   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;