⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 meandeinterlacer.cpp

📁 linux下实现视频播放的播放器
💻 CPP
字号:
/* *  Copyright (C) 2005-2008  gulikoza, mtrooper * *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *//* $Id$ */#include "MeanDeinterlacer.h"//#define DEBUG#include "log.h"#define MODULE "BlendDeinterlacer"MeanDeinterlacer::MeanDeinterlacer(){#ifdef HAVE_ALTIVEC_H	if(SDL_HasAltiVec()) {	    Merge = MergeAltivec;	    EndMerge = NULL;	    LOG_MSG("Using Altivec optimizations");	} else#endif#if (C_HOSTCPU == X86) || (C_HOSTCPU == X86_64)	if(SDL_HasSSE2()) {	    Merge = MergeSSE2;	    EndMerge = EndMMX;	    LOG_MSG("Using SSE2 optimizations");	} else	if(SDL_HasSSE()) {	    Merge = MergeMMXEXT;	    EndMerge = EndMMX;	    LOG_MSG("Using SSE optimizations");	} else	if(SDL_Has3DNow()) {	    Merge = Merge3DNow;	    EndMerge = End3DNow;	    LOG_MSG("Using 3DNow optimizations");	} else#endif	{	    Merge = MergeGeneric;	    EndMerge = NULL;	}}void MeanDeinterlacer::Render(unsigned char * ptr[],  unsigned char * src[], deint * d){    /* Copy image and skip lines */    register int j = d->height>>1;    register unsigned int k = 0;    while(j--) {	// Y        Merge(ptr[2], src[2], src[2] + d->src_pitch[2], d->width);        src[2] += d->src_pitch[2]<<1;        ptr[2] += d->dst_pitch[2];	// U & V        Merge(ptr[k], src[k], src[k] + d->src_pitch[k], d->width>>1);        src[k] += d->src_pitch[k]<<1;        ptr[k] += d->dst_pitch[k];        k = (k+1)&1;    }    if(EndMerge) EndMerge();}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -