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

Michael Niedermayer michaelni at gmx.at
Sat Feb 4 23:23:35 CET 2012


On Sat, Feb 04, 2012 at 09:37:29PM +0000, Paul B Mahol wrote:
> 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.

older decoder is buggy

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120204/1c96e915/attachment.asc>


More information about the ffmpeg-devel mailing list