[FFmpeg-devel] [PATCH] imgconvert: remove useless PixFmtInfo.nb_channels field

Stefano Sabatini stefano.sabatini-lala at poste.it
Wed Jul 20 00:10:07 CEST 2011


On date Tuesday 2011-07-19 22:51:51 +0200, Michael Niedermayer encoded:
> On Tue, Jul 19, 2011 at 02:23:53PM +0200, Stefano Sabatini wrote:
> > ---
> >  libavcodec/imgconvert.c |   65 +++++-----------------------------------------
> >  1 files changed, 7 insertions(+), 58 deletions(-)
> > 
> [...]
> > @@ -579,13 +528,13 @@ static int avg_bits_per_pixel(enum PixelFormat pix_fmt)
> >              bits = 12;
> >              break;
> >          default:
> > -            bits = pf->depth * pf->nb_channels;
> > +            bits = av_get_bits_per_pixel(desc);
> >              break;
> >          }
> >          break;
> >      case FF_PIXEL_PLANAR:
> >          if (desc->log2_chroma_w == 0 && desc->log2_chroma_h == 0) {
> > -            bits = pf->depth * pf->nb_channels;
> > +            bits = av_get_bits_per_pixel(desc);
> >          } else {
> >              bits = pf->depth + ((2 * pf->depth) >>
> >                                  (desc->log2_chroma_w + desc->log2_chroma_h));
> 
> ok if these 2 stay the same in value

This is true for all the formats which are affected by the code (that
is the output of the function is the same after the change), but I
plan to remove this code (see next patch).
-- 
FFmpeg = Friendly Fundamental Moronic Pitiful Earthshaking Guru


More information about the ffmpeg-devel mailing list