mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
Simplify getSubSampleFactors(), make it use the values provided by
av_pix_fmt_descriptors(). Originally committed as revision 30171 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
This commit is contained in:
parent
4a1289450a
commit
b3cf7cb144
@ -2280,53 +2280,8 @@ static int planarCopy(SwsContext *c, uint8_t* src[], int srcStride[], int srcSli
|
|||||||
|
|
||||||
static void getSubSampleFactors(int *h, int *v, int format)
|
static void getSubSampleFactors(int *h, int *v, int format)
|
||||||
{
|
{
|
||||||
switch(format) {
|
*h = av_pix_fmt_descriptors[format].log2_chroma_w;
|
||||||
case PIX_FMT_UYVY422:
|
*v = av_pix_fmt_descriptors[format].log2_chroma_h;
|
||||||
case PIX_FMT_YUYV422:
|
|
||||||
*h=1;
|
|
||||||
*v=0;
|
|
||||||
break;
|
|
||||||
case PIX_FMT_YUV420P:
|
|
||||||
case PIX_FMT_YUV420P16LE:
|
|
||||||
case PIX_FMT_YUV420P16BE:
|
|
||||||
case PIX_FMT_YUVA420P:
|
|
||||||
case PIX_FMT_GRAY16BE:
|
|
||||||
case PIX_FMT_GRAY16LE:
|
|
||||||
case PIX_FMT_GRAY8: //FIXME remove after different subsamplings are fully implemented
|
|
||||||
case PIX_FMT_NV12:
|
|
||||||
case PIX_FMT_NV21:
|
|
||||||
*h=1;
|
|
||||||
*v=1;
|
|
||||||
break;
|
|
||||||
case PIX_FMT_YUV440P:
|
|
||||||
*h=0;
|
|
||||||
*v=1;
|
|
||||||
break;
|
|
||||||
case PIX_FMT_YUV410P:
|
|
||||||
*h=2;
|
|
||||||
*v=2;
|
|
||||||
break;
|
|
||||||
case PIX_FMT_YUV444P:
|
|
||||||
case PIX_FMT_YUV444P16LE:
|
|
||||||
case PIX_FMT_YUV444P16BE:
|
|
||||||
*h=0;
|
|
||||||
*v=0;
|
|
||||||
break;
|
|
||||||
case PIX_FMT_YUV422P:
|
|
||||||
case PIX_FMT_YUV422P16LE:
|
|
||||||
case PIX_FMT_YUV422P16BE:
|
|
||||||
*h=1;
|
|
||||||
*v=0;
|
|
||||||
break;
|
|
||||||
case PIX_FMT_YUV411P:
|
|
||||||
*h=2;
|
|
||||||
*v=0;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
*h=0;
|
|
||||||
*v=0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint16_t roundToInt16(int64_t f)
|
static uint16_t roundToInt16(int64_t f)
|
||||||
|
Loading…
Reference in New Issue
Block a user