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

Stefano Sabatini stefano.sabatini-lala at poste.it
Sat Jul 23 17:15:12 CEST 2011


On date Wednesday 2011-07-20 00:10:07 +0200, Stefano Sabatini encoded:
> 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).

Pushed.
-- 
FFmpeg = Fanciful and Fierce Mastodontic Powered Esoteric Gadget


More information about the ffmpeg-devel mailing list