[FFmpeg-devel] [RFC] ffv1: 16bit gray support

Paul B Mahol onemda at gmail.com
Sat Feb 4 22:37:29 CET 2012


On 2/4/12, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sat, Feb 04, 2012 at 01:35:14AM +0000, Paul B Mahol wrote:
>>
>> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>> ---
>>  libavcodec/ffv1.c |   26 +++++++++++++++++++++++---
>>  1 files changed, 23 insertions(+), 3 deletions(-)
>>
>> diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
>> index 667b8ea..3cf218a 100644
>> --- a/libavcodec/ffv1.c
>> +++ b/libavcodec/ffv1.c
>> @@ -912,6 +912,18 @@ static av_cold int encode_init(AVCodecContext *avctx)
>>
>>      avctx->coded_frame= &s->picture;
>>      switch(avctx->pix_fmt){
>> +    case PIX_FMT_GRAY16:
>> +        if(avctx->bits_per_raw_sample <=8){
>> +            av_log(avctx, AV_LOG_ERROR, "bits_per_raw_sample invalid\n");
>> +            return -1;
>> +        }
>> +        if(!s->ac){
>> +            av_log(avctx, AV_LOG_ERROR, "bits_per_raw_sample of more than
>> 8 needs -coder 1 currently\n");
>> +            return -1;
>> +        }
>> +        s->colorspace= 2;
>
> this should be colorspace = 0 and grayscale = 1
> ok we have no grayscale variable in the implementation but the spec
> does have one.
> put_rac(c, state, 1); //chroma planes  <------grayscale

Hmm? Decoder just skip that one. So older decoders would not abort early.


More information about the ffmpeg-devel mailing list