From e94b415c3479129944a69fafbeacf550fb9237b7 Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Tue, 13 Jan 2015 10:07:20 -0800 Subject: Add encoder control for setting color space This commit adds encoder side control for vp9 to set color space info in the output compressed bitstream. It also amends the "vp9_encoder_params_get_to_decoder" test to verify the correct color space information is passed from the encoder end to decoder end. Change-Id: Ibf5fba2edcb2a8dc37557f6fae5c7816efa52650 --- test/vp9_encoder_parms_get_to_decoder.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/vp9_encoder_parms_get_to_decoder.cc b/test/vp9_encoder_parms_get_to_decoder.cc index 6c354fd38..34e7854a9 100644 --- a/test/vp9_encoder_parms_get_to_decoder.cc +++ b/test/vp9_encoder_parms_get_to_decoder.cc @@ -65,14 +65,15 @@ struct EncodeParameters { int32_t lossless; int32_t error_resilient; int32_t frame_parallel; + vpx_color_space_t cs; // TODO(JBB): quantizers / bitrate }; const EncodeParameters kVP9EncodeParameterSet[] = { - {0, 0, 0, 1, 0}, - {0, 0, 0, 0, 0}, - {0, 0, 1, 0, 0}, - {0, 2, 0, 0, 1}, + {0, 0, 0, 1, 0, VPX_CS_BT_601}, + {0, 0, 0, 0, 0, VPX_CS_BT_709}, + {0, 0, 1, 0, 0, VPX_CS_BT_2020}, + {0, 2, 0, 0, 1, VPX_CS_UNKNOWN}, // TODO(JBB): Test profiles (requires more work). }; @@ -109,6 +110,7 @@ class Vp9EncoderParmsGetToDecoder virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video, ::libvpx_test::Encoder *encoder) { if (video->frame() == 1) { + encoder->Control(VP9E_SET_COLOR_SPACE, encode_parms.cs); encoder->Control(VP9E_SET_LOSSLESS, encode_parms.lossless); encoder->Control(VP9E_SET_FRAME_PARALLEL_DECODING, encode_parms.frame_parallel); @@ -147,7 +149,7 @@ class Vp9EncoderParmsGetToDecoder EXPECT_EQ(common->frame_parallel_decoding_mode, encode_parms.frame_parallel); } - + EXPECT_EQ(common->color_space, encode_parms.cs); EXPECT_EQ(common->log2_tile_cols, encode_parms.tile_cols); EXPECT_EQ(common->log2_tile_rows, encode_parms.tile_rows); -- cgit v1.2.3