Use av_get_bits_per_pixel() for computing the bits per pixel of the

source and destination format, cache those values in the newly added
SwsContext:srcFormatBpp and SwsContext:dstFormatBpp fields, and remove
the fmt_depth() function.

Originally committed as revision 30419 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
This commit is contained in:
Stefano Sabatini
2010-01-24 12:55:05 +00:00
parent 59398ea9c0
commit 30b6147521
4 changed files with 12 additions and 46 deletions

View File

@@ -854,6 +854,8 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
c->flags= flags;
c->dstFormat= dstFormat;
c->srcFormat= srcFormat;
c->dstFormatBpp = av_get_bits_per_pixel(&av_pix_fmt_descriptors[dstFormat]);
c->srcFormatBpp = av_get_bits_per_pixel(&av_pix_fmt_descriptors[srcFormat]);
c->vRounder= 4* 0x0001000100010001ULL;
usesHFilter= usesVFilter= 0;