4 * Copyright (C) 2005-2013 Team XBMC
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, see
19 * <http://www.gnu.org/licenses/>.
23 #include "Video/DVDVideoCodec.h"
24 #include "cores/VideoRenderers/RenderFormats.h"
31 static DVDVideoPicture* AllocatePicture(int iWidth, int iHeight);
32 static void FreePicture(DVDVideoPicture* pPicture);
33 static bool CopyPicture(DVDVideoPicture* pDst, DVDVideoPicture* pSrc);
34 static bool CopyPicture(YV12Image* pDst, DVDVideoPicture *pSrc);
36 static DVDVideoPicture* ConvertToNV12Picture(DVDVideoPicture *pSrc);
37 static DVDVideoPicture* ConvertToYUV422PackedPicture(DVDVideoPicture *pSrc, ERenderFormat format);
38 static bool CopyNV12Picture(YV12Image* pImage, DVDVideoPicture *pSrc);
39 static bool CopyYUV422PackedPicture(YV12Image* pImage, DVDVideoPicture *pSrc);
40 static bool CopyDXVA2Picture(YV12Image* pImage, DVDVideoPicture *pSrc);
42 static bool IsVP3CompatibleWidth(int width);
44 static double NormalizeFrameduration(double frameduration);
46 static ERenderFormat EFormatFromPixfmt(int fmt);
47 static int PixfmtFromEFormat(ERenderFormat format);