[FFmpeg-devel] [PATCH]Fix odd RGB555 camstudio, v2

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Apr 18 23:57:04 CEST 2012


On Tue, Apr 17, 2012 at 03:42:20PM +0200, Michael Niedermayer wrote:
> On Tue, Apr 17, 2012 at 11:01:26AM +0200, Carl Eugen Hoyos wrote:
> > Hi!
> > 
> > New patch for ticket #1220 attached.
> > 
> > Please review, Carl Eugen
> 
> >  cscd.c |    3 +++
> >  1 file changed, 3 insertions(+)
> > 6807c884fbac3f169bbc68e8cd5dd105f3bd1bf4  patchcamstudio2.diff
> > diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c
> > index 032b58a..b08e7a2 100644
> > --- a/libavcodec/cscd.c
> > +++ b/libavcodec/cscd.c
> > @@ -234,6 +234,9 @@ static av_cold int decode_init(AVCodecContext *avctx) {
> >      avcodec_get_frame_defaults(&c->pic);
> >      c->pic.data[0] = NULL;
> >      c->linelen = avctx->width * avctx->bits_per_coded_sample / 8;
> > +    // RGB16 is padded to word boundaries
> > +    if (avctx->bits_per_coded_sample == 16)
> > +        c->linelen = FFALIGN(c->linelen, 4);
> >      c->height = avctx->height;
> >      stride = c->linelen;
> >      if (avctx->bits_per_coded_sample == 24)
>            stride = FFALIGN(stride, 4);
> 
> the 24 and 16bpp cases look somehow similar and disimilar
> can these be merged somehow into something cleaner ?

Hm. It depends. For the 24 bpp case we tried to avoid writing the
padding.
If you/we think that is really pointless we can get rid of the line
len/stride distinction and just round linelen up completely independent
of format I think.


More information about the ffmpeg-devel mailing list