summaryrefslogtreecommitdiffstats
path: root/libswscale/swscale_internal.h
diff options
context:
space:
mode:
authorstefano <stefano@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-01-24 12:55:05 +0000
committerstefano <stefano@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-01-24 12:55:05 +0000
commit213092c8dcfc925d8d54cf320b60cf298a870696 (patch)
treebbdc7f5e986db757a89523d4e7494818f2ea73be /libswscale/swscale_internal.h
parent4b2e107710a1f81368433445ee7ed366a4f49700 (diff)
downloadmpv-213092c8dcfc925d8d54cf320b60cf298a870696.tar.bz2
mpv-213092c8dcfc925d8d54cf320b60cf298a870696.tar.xz
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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30419 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libswscale/swscale_internal.h')
-rw-r--r--libswscale/swscale_internal.h40
1 files changed, 2 insertions, 38 deletions
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 658c4aef72..aba4de25ff 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -86,6 +86,8 @@ typedef struct SwsContext {
int lumYInc, chrYInc;
enum PixelFormat dstFormat; ///< Destination pixel format.
enum PixelFormat srcFormat; ///< Source pixel format.
+ int dstFormatBpp; ///< Number of bits per pixel of the destination pixel format.
+ int srcFormatBpp; ///< Number of bits per pixel of the source pixel format.
int chrSrcHSubSample; ///< Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in source image.
int chrSrcVSubSample; ///< Binary logarithm of vertical subsampling factor between luma/alpha and chroma planes in source image.
int chrDstHSubSample; ///< Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in destination image.
@@ -417,44 +419,6 @@ const char *sws_format_name(enum PixelFormat format);
|| (x)==PIX_FMT_YUVA420P \
)
-static inline int fmt_depth(enum PixelFormat fmt)
-{
- switch(fmt) {
- case PIX_FMT_RGB48BE:
- case PIX_FMT_RGB48LE:
- return 48;
- case PIX_FMT_BGRA:
- case PIX_FMT_ABGR:
- case PIX_FMT_RGBA:
- case PIX_FMT_ARGB:
- return 32;
- case PIX_FMT_BGR24:
- case PIX_FMT_RGB24:
- return 24;
- case PIX_FMT_BGR565:
- case PIX_FMT_RGB565:
- case PIX_FMT_GRAY16BE:
- case PIX_FMT_GRAY16LE:
- return 16;
- case PIX_FMT_BGR555:
- case PIX_FMT_RGB555:
- return 15;
- case PIX_FMT_BGR8:
- case PIX_FMT_RGB8:
- return 8;
- case PIX_FMT_BGR4:
- case PIX_FMT_RGB4:
- case PIX_FMT_BGR4_BYTE:
- case PIX_FMT_RGB4_BYTE:
- return 4;
- case PIX_FMT_MONOBLACK:
- case PIX_FMT_MONOWHITE:
- return 1;
- default:
- return 0;
- }
-}
-
extern const uint64_t ff_dither4[2];
extern const uint64_t ff_dither8[2];