[FFmpeg-devel] [PATCH] libvpxenc: add color-space option for vp9

James Zern jzern at google.com
Wed Jun 17 21:21:32 CEST 2015


On Tue, Jun 16, 2015 at 10:58 PM, James Almer <jamrial at gmail.com> wrote:
> On 16/06/15 2:43 AM, James Zern wrote:
>> the vp9 bitstream supports 8 values:
>> unknown (default), bt601, bt709, smpte170, smpte240, bt2020, reserved
>> and sRGB.
>> ---
>>  doc/encoders.texi      | 12 ++++++++++++
>>  libavcodec/libvpxenc.c | 22 ++++++++++++++++++++++
>>  2 files changed, 34 insertions(+)
>>
>> diff --git a/doc/encoders.texi b/doc/encoders.texi
>> index 8b0ecb7..09c90c2 100644
>> --- a/doc/encoders.texi
>> +++ b/doc/encoders.texi
>> @@ -1550,6 +1550,18 @@ Enable frame parallel decodability features.
>>  @item aq-mode
>>  Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
>>  cyclic refresh).
>> + at item color-space
>> +Set input color space.
>> + at table @samp
>> + at item unknown
>> + at item bt601
>> + at item bt709
>> + at item smpte170
>> + at item smpte240
>> + at item bt2020
>> + at item reserved
>> + at item sRGB
>> + at end table
>>  @end table
>>
>>  @end table
>> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
>> index 28a0e14..10f16e7 100644
>> --- a/libavcodec/libvpxenc.c
>> +++ b/libavcodec/libvpxenc.c
>> @@ -100,8 +100,12 @@ typedef struct VP8EncoderContext {
>>      int tile_rows;
>>      int frame_parallel;
>>      int aq_mode;
>> +    int colorspace;
>>  } VP8Context;
>>
>> +// VP9E_SET_COLOR_SPACE was added just prior to v1.4.0.
>> +#define HAVE_VP9_COLORSPACE_CONTROL (VPX_ENCODER_ABI_VERSION > 8)
>
> Why this custom define? the end result is not shorter and there are other uses of VPX version
> defines on this same file, like VPX_IMAGE_ABI_VERSION.
>

Given the current setup it doesn't do much for clarity; dropped.


More information about the ffmpeg-devel mailing list