Commit e4852fb3 authored by Michael Niedermayer's avatar Michael Niedermayer

Add MPlayers libmpcodecs, this will be needed for our libavfilter wraper for it.

parent fe678413
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPLAYER_CPUDETECT_H
#define MPLAYER_CPUDETECT_H
//#include "config.h"
#define CPUTYPE_I386 3
#define CPUTYPE_I486 4
#define CPUTYPE_I586 5
#define CPUTYPE_I686 6
#include "libavutil/x86_cpu.h"
typedef struct cpucaps_s {
int cpuType;
int cpuModel;
int cpuStepping;
int hasMMX;
int hasMMX2;
int has3DNow;
int has3DNowExt;
int hasSSE;
int hasSSE2;
int hasSSE3;
int hasSSSE3;
int hasSSE4a;
int isX86;
unsigned cl_size; /* size of cache line */
int hasAltiVec;
int hasTSC;
} CpuCaps;
extern CpuCaps gCpuCaps;
void do_cpuid(unsigned int ax, unsigned int *p);
void GetCpuCaps(CpuCaps *caps);
/* returned value is malloc()'ed so free() it after use */
char *GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]);
#endif /* MPLAYER_CPUDETECT_H */
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "img_format.h"
#include "stdio.h"
const char *vo_format_name(int format)
{
static char unknown_format[20];
switch(format)
{
case IMGFMT_RGB1: return "RGB 1-bit";
case IMGFMT_RGB4: return "RGB 4-bit";
case IMGFMT_RG4B: return "RGB 4-bit per byte";
case IMGFMT_RGB8: return "RGB 8-bit";
case IMGFMT_RGB12: return "RGB 12-bit";
case IMGFMT_RGB15: return "RGB 15-bit";
case IMGFMT_RGB16: return "RGB 16-bit";
case IMGFMT_RGB24: return "RGB 24-bit";
// case IMGFMT_RGB32: return "RGB 32-bit";
case IMGFMT_RGB48LE: return "RGB 48-bit LE";
case IMGFMT_RGB48BE: return "RGB 48-bit BE";
case IMGFMT_BGR1: return "BGR 1-bit";
case IMGFMT_BGR4: return "BGR 4-bit";
case IMGFMT_BG4B: return "BGR 4-bit per byte";
case IMGFMT_BGR8: return "BGR 8-bit";
case IMGFMT_BGR12: return "BGR 12-bit";
case IMGFMT_BGR15: return "BGR 15-bit";
case IMGFMT_BGR16: return "BGR 16-bit";
case IMGFMT_BGR24: return "BGR 24-bit";
// case IMGFMT_BGR32: return "BGR 32-bit";
case IMGFMT_ABGR: return "ABGR";
case IMGFMT_BGRA: return "BGRA";
case IMGFMT_ARGB: return "ARGB";
case IMGFMT_RGBA: return "RGBA";
case IMGFMT_YVU9: return "Planar YVU9";
case IMGFMT_IF09: return "Planar IF09";
case IMGFMT_YV12: return "Planar YV12";
case IMGFMT_I420: return "Planar I420";
case IMGFMT_IYUV: return "Planar IYUV";
case IMGFMT_CLPL: return "Planar CLPL";
case IMGFMT_Y800: return "Planar Y800";
case IMGFMT_Y8: return "Planar Y8";
case IMGFMT_420P16_LE: return "Planar 420P 16-bit little-endian";
case IMGFMT_420P16_BE: return "Planar 420P 16-bit big-endian";
case IMGFMT_422P16_LE: return "Planar 422P 16-bit little-endian";
case IMGFMT_422P16_BE: return "Planar 422P 16-bit big-endian";
case IMGFMT_444P16_LE: return "Planar 444P 16-bit little-endian";
case IMGFMT_444P16_BE: return "Planar 444P 16-bit big-endian";
case IMGFMT_420A: return "Planar 420P with alpha";
case IMGFMT_444P: return "Planar 444P";
case IMGFMT_422P: return "Planar 422P";
case IMGFMT_411P: return "Planar 411P";
case IMGFMT_NV12: return "Planar NV12";
case IMGFMT_NV21: return "Planar NV21";
case IMGFMT_HM12: return "Planar NV12 Macroblock";
case IMGFMT_IUYV: return "Packed IUYV";
case IMGFMT_IY41: return "Packed IY41";
case IMGFMT_IYU1: return "Packed IYU1";
case IMGFMT_IYU2: return "Packed IYU2";
case IMGFMT_UYVY: return "Packed UYVY";
case IMGFMT_UYNV: return "Packed UYNV";
case IMGFMT_cyuv: return "Packed CYUV";
case IMGFMT_Y422: return "Packed Y422";
case IMGFMT_YUY2: return "Packed YUY2";
case IMGFMT_YUNV: return "Packed YUNV";
case IMGFMT_YVYU: return "Packed YVYU";
case IMGFMT_Y41P: return "Packed Y41P";
case IMGFMT_Y211: return "Packed Y211";
case IMGFMT_Y41T: return "Packed Y41T";
case IMGFMT_Y42T: return "Packed Y42T";
case IMGFMT_V422: return "Packed V422";
case IMGFMT_V655: return "Packed V655";
case IMGFMT_CLJR: return "Packed CLJR";
case IMGFMT_YUVP: return "Packed YUVP";
case IMGFMT_UYVP: return "Packed UYVP";
case IMGFMT_MPEGPES: return "Mpeg PES";
case IMGFMT_ZRMJPEGNI: return "Zoran MJPEG non-interlaced";
case IMGFMT_ZRMJPEGIT: return "Zoran MJPEG top field first";
case IMGFMT_ZRMJPEGIB: return "Zoran MJPEG bottom field first";
case IMGFMT_XVMC_MOCO_MPEG2: return "MPEG1/2 Motion Compensation";
case IMGFMT_XVMC_IDCT_MPEG2: return "MPEG1/2 Motion Compensation and IDCT";
case IMGFMT_VDPAU_MPEG1: return "MPEG1 VDPAU acceleration";
case IMGFMT_VDPAU_MPEG2: return "MPEG2 VDPAU acceleration";
case IMGFMT_VDPAU_H264: return "H.264 VDPAU acceleration";
case IMGFMT_VDPAU_MPEG4: return "MPEG-4 Part 2 VDPAU acceleration";
case IMGFMT_VDPAU_WMV3: return "WMV3 VDPAU acceleration";
case IMGFMT_VDPAU_VC1: return "VC1 VDPAU acceleration";
}
snprintf(unknown_format,20,"Unknown 0x%04x",format);
return unknown_format;
}
int mp_get_chroma_shift(int format, int *x_shift, int *y_shift)
{
int xs = 0, ys = 0;
int bpp;
int bpp_factor = 1;
int err = 0;
switch (format) {
case IMGFMT_420P16_LE:
case IMGFMT_420P16_BE:
bpp_factor = 2;
case IMGFMT_420A:
case IMGFMT_I420:
case IMGFMT_IYUV:
case IMGFMT_YV12:
xs = 1;
ys = 1;
break;
case IMGFMT_IF09:
case IMGFMT_YVU9:
xs = 2;
ys = 2;
break;
case IMGFMT_444P16_LE:
case IMGFMT_444P16_BE:
bpp_factor = 2;
case IMGFMT_444P:
xs = 0;
ys = 0;
break;
case IMGFMT_422P16_LE:
case IMGFMT_422P16_BE:
bpp_factor = 2;
case IMGFMT_422P:
xs = 1;
ys = 0;
break;
case IMGFMT_411P:
xs = 2;
ys = 0;
break;
case IMGFMT_440P:
xs = 0;
ys = 1;
break;
case IMGFMT_Y8:
case IMGFMT_Y800:
xs = 31;
ys = 31;
break;
default:
err = 1;
break;
}
if (x_shift) *x_shift = xs;
if (y_shift) *y_shift = ys;
bpp = 8 + ((16 >> xs) >> ys);
if (format == IMGFMT_420A)
bpp += 8;
bpp *= bpp_factor;
return err ? 0 : bpp;
}
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPLAYER_IMG_FORMAT_H
#define MPLAYER_IMG_FORMAT_H
#include "config.h"
/* RGB/BGR Formats */
#define IMGFMT_RGB_MASK 0xFFFFFF00
#define IMGFMT_RGB (('R'<<24)|('G'<<16)|('B'<<8))
#define IMGFMT_RGB1 (IMGFMT_RGB|1)
#define IMGFMT_RGB4 (IMGFMT_RGB|4)
#define IMGFMT_RGB4_CHAR (IMGFMT_RGB|4|128) // RGB4 with 1 pixel per byte
#define IMGFMT_RGB8 (IMGFMT_RGB|8)
#define IMGFMT_RGB12 (IMGFMT_RGB|12)
#define IMGFMT_RGB15 (IMGFMT_RGB|15)
#define IMGFMT_RGB16 (IMGFMT_RGB|16)
#define IMGFMT_RGB24 (IMGFMT_RGB|24)
#define IMGFMT_RGB32 (IMGFMT_RGB|32)
#define IMGFMT_RGB48LE (IMGFMT_RGB|48)
#define IMGFMT_RGB48BE (IMGFMT_RGB|48|128)
#define IMGFMT_BGR_MASK 0xFFFFFF00
#define IMGFMT_BGR (('B'<<24)|('G'<<16)|('R'<<8))
#define IMGFMT_BGR1 (IMGFMT_BGR|1)
#define IMGFMT_BGR4 (IMGFMT_BGR|4)
#define IMGFMT_BGR4_CHAR (IMGFMT_BGR|4|128) // BGR4 with 1 pixel per byte
#define IMGFMT_BGR8 (IMGFMT_BGR|8)
#define IMGFMT_BGR12 (IMGFMT_BGR|12)
#define IMGFMT_BGR15 (IMGFMT_BGR|15)
#define IMGFMT_BGR16 (IMGFMT_BGR|16)
#define IMGFMT_BGR24 (IMGFMT_BGR|24)
#define IMGFMT_BGR32 (IMGFMT_BGR|32)
#if HAVE_BIGENDIAN
#define IMGFMT_ABGR IMGFMT_RGB32
#define IMGFMT_BGRA (IMGFMT_RGB32|64)
#define IMGFMT_ARGB IMGFMT_BGR32
#define IMGFMT_RGBA (IMGFMT_BGR32|64)
#define IMGFMT_RGB48NE IMGFMT_RGB48BE
#define IMGFMT_RGB12BE IMGFMT_RGB12
#define IMGFMT_RGB12LE (IMGFMT_RGB12|64)
#define IMGFMT_RGB15BE IMGFMT_RGB15
#define IMGFMT_RGB15LE (IMGFMT_RGB15|64)
#define IMGFMT_RGB16BE IMGFMT_RGB16
#define IMGFMT_RGB16LE (IMGFMT_RGB16|64)
#define IMGFMT_BGR12BE IMGFMT_BGR12
#define IMGFMT_BGR12LE (IMGFMT_BGR12|64)
#define IMGFMT_BGR15BE IMGFMT_BGR15
#define IMGFMT_BGR15LE (IMGFMT_BGR15|64)
#define IMGFMT_BGR16BE IMGFMT_BGR16
#define IMGFMT_BGR16LE (IMGFMT_BGR16|64)
#else
#define IMGFMT_ABGR (IMGFMT_BGR32|64)
#define IMGFMT_BGRA IMGFMT_BGR32
#define IMGFMT_ARGB (IMGFMT_RGB32|64)
#define IMGFMT_RGBA IMGFMT_RGB32
#define IMGFMT_RGB48NE IMGFMT_RGB48LE
#define IMGFMT_RGB12BE (IMGFMT_RGB12|64)
#define IMGFMT_RGB12LE IMGFMT_RGB12
#define IMGFMT_RGB15BE (IMGFMT_RGB15|64)
#define IMGFMT_RGB15LE IMGFMT_RGB15
#define IMGFMT_RGB16BE (IMGFMT_RGB16|64)
#define IMGFMT_RGB16LE IMGFMT_RGB16
#define IMGFMT_BGR12BE (IMGFMT_BGR12|64)
#define IMGFMT_BGR12LE IMGFMT_BGR12
#define IMGFMT_BGR15BE (IMGFMT_BGR15|64)
#define IMGFMT_BGR15LE IMGFMT_BGR15
#define IMGFMT_BGR16BE (IMGFMT_BGR16|64)
#define IMGFMT_BGR16LE IMGFMT_BGR16
#endif
/* old names for compatibility */
#define IMGFMT_RG4B IMGFMT_RGB4_CHAR
#define IMGFMT_BG4B IMGFMT_BGR4_CHAR
#define IMGFMT_IS_RGB(fmt) (((fmt)&IMGFMT_RGB_MASK)==IMGFMT_RGB)
#define IMGFMT_IS_BGR(fmt) (((fmt)&IMGFMT_BGR_MASK)==IMGFMT_BGR)
#define IMGFMT_RGB_DEPTH(fmt) ((fmt)&0x3F)
#define IMGFMT_BGR_DEPTH(fmt) ((fmt)&0x3F)
/* Planar YUV Formats */
#define IMGFMT_YVU9 0x39555659
#define IMGFMT_IF09 0x39304649
#define IMGFMT_YV12 0x32315659
#define IMGFMT_I420 0x30323449
#define IMGFMT_IYUV 0x56555949
#define IMGFMT_CLPL 0x4C504C43
#define IMGFMT_Y800 0x30303859
#define IMGFMT_Y8 0x20203859
#define IMGFMT_NV12 0x3231564E
#define IMGFMT_NV21 0x3132564E
/* unofficial Planar Formats, FIXME if official 4CC exists */
#define IMGFMT_444P 0x50343434
#define IMGFMT_422P 0x50323234
#define IMGFMT_411P 0x50313134
#define IMGFMT_440P 0x50303434
#define IMGFMT_HM12 0x32314D48
// 4:2:0 planar with alpha
#define IMGFMT_420A 0x41303234
#define IMGFMT_444P16_LE 0x51343434
#define IMGFMT_444P16_BE 0x34343451
#define IMGFMT_422P16_LE 0x51323234
#define IMGFMT_422P16_BE 0x34323251
#define IMGFMT_420P16_LE 0x51303234
#define IMGFMT_420P16_BE 0x34323051
#if HAVE_BIGENDIAN
#define IMGFMT_444P16 IMGFMT_444P16_BE
#define IMGFMT_422P16 IMGFMT_422P16_BE
#define IMGFMT_420P16 IMGFMT_420P16_BE
#else
#define IMGFMT_444P16 IMGFMT_444P16_LE
#define IMGFMT_422P16 IMGFMT_422P16_LE
#define IMGFMT_420P16 IMGFMT_420P16_LE
#endif
#define IMGFMT_IS_YUVP16_LE(fmt) (((fmt ^ IMGFMT_420P16_LE) & 0xff0000ff) == 0)
#define IMGFMT_IS_YUVP16_BE(fmt) (((fmt ^ IMGFMT_420P16_BE) & 0xff0000ff) == 0)
#define IMGFMT_IS_YUVP16_NE(fmt) (((fmt ^ IMGFMT_420P16 ) & 0xff0000ff) == 0)
#define IMGFMT_IS_YUVP16(fmt) (IMGFMT_IS_YUVP16_LE(fmt) || IMGFMT_IS_YUVP16_BE(fmt))
/* Packed YUV Formats */
#define IMGFMT_IUYV 0x56595549
#define IMGFMT_IY41 0x31435949
#define IMGFMT_IYU1 0x31555949
#define IMGFMT_IYU2 0x32555949
#define IMGFMT_UYVY 0x59565955
#define IMGFMT_UYNV 0x564E5955
#define IMGFMT_cyuv 0x76757963
#define IMGFMT_Y422 0x32323459
#define IMGFMT_YUY2 0x32595559
#define IMGFMT_YUNV 0x564E5559
#define IMGFMT_YVYU 0x55595659
#define IMGFMT_Y41P 0x50313459
#define IMGFMT_Y211 0x31313259
#define IMGFMT_Y41T 0x54313459
#define IMGFMT_Y42T 0x54323459
#define IMGFMT_V422 0x32323456
#define IMGFMT_V655 0x35353656
#define IMGFMT_CLJR 0x524A4C43
#define IMGFMT_YUVP 0x50565559
#define IMGFMT_UYVP 0x50565955
/* Compressed Formats */
#define IMGFMT_MPEGPES (('M'<<24)|('P'<<16)|('E'<<8)|('S'))
#define IMGFMT_MJPEG (('M')|('J'<<8)|('P'<<16)|('G'<<24))
/* Formats that are understood by zoran chips, we include
* non-interlaced, interlaced top-first, interlaced bottom-first */
#define IMGFMT_ZRMJPEGNI (('Z'<<24)|('R'<<16)|('N'<<8)|('I'))
#define IMGFMT_ZRMJPEGIT (('Z'<<24)|('R'<<16)|('I'<<8)|('T'))
#define IMGFMT_ZRMJPEGIB (('Z'<<24)|('R'<<16)|('I'<<8)|('B'))
// I think that this code could not be used by any other codec/format
#define IMGFMT_XVMC 0x1DC70000
#define IMGFMT_XVMC_MASK 0xFFFF0000
#define IMGFMT_IS_XVMC(fmt) (((fmt)&IMGFMT_XVMC_MASK)==IMGFMT_XVMC)
//these are chroma420
#define IMGFMT_XVMC_MOCO_MPEG2 (IMGFMT_XVMC|0x02)
#define IMGFMT_XVMC_IDCT_MPEG2 (IMGFMT_XVMC|0x82)
// VDPAU specific format.
#define IMGFMT_VDPAU 0x1DC80000
#define IMGFMT_VDPAU_MASK 0xFFFF0000
#define IMGFMT_IS_VDPAU(fmt) (((fmt)&IMGFMT_VDPAU_MASK)==IMGFMT_VDPAU)
#define IMGFMT_VDPAU_MPEG1 (IMGFMT_VDPAU|0x01)
#define IMGFMT_VDPAU_MPEG2 (IMGFMT_VDPAU|0x02)
#define IMGFMT_VDPAU_H264 (IMGFMT_VDPAU|0x03)
#define IMGFMT_VDPAU_WMV3 (IMGFMT_VDPAU|0x04)
#define IMGFMT_VDPAU_VC1 (IMGFMT_VDPAU|0x05)
#define IMGFMT_VDPAU_MPEG4 (IMGFMT_VDPAU|0x06)
#define IMGFMT_IS_HWACCEL(fmt) (IMGFMT_IS_VDPAU(fmt) || IMGFMT_IS_XVMC(fmt))
typedef struct {
void* data;
int size;
int id; // stream id. usually 0x1E0
int timestamp; // pts, 90000 Hz counter based
} vo_mpegpes_t;
const char *vo_format_name(int format);
/**
* Calculates the scale shifts for the chroma planes for planar YUV
*
* \return bits-per-pixel for format if successful (i.e. format is 3 or 4-planes planar YUV), 0 otherwise
*/
int mp_get_chroma_shift(int format, int *x_shift, int *y_shift);
#endif /* MPLAYER_IMG_FORMAT_H */
/*
* This file is part of MPlayer.
*
* MPlayer is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* MPlayer 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with MPlayer; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef MPLAYER_FASTMEMCPY_H
#define MPLAYER_FASTMEMCPY_H
#include <inttypes.h>
#include <string.h>
#include <stddef.h>
void * fast_memcpy(void * to, const void * from, size_t len);
void * mem2agpcpy(void * to, const void * from, size_t len);
#if ! defined(CONFIG_FASTMEMCPY) || ! (HAVE_MMX || HAVE_MMX2 || HAVE_AMD3DNOW /* || HAVE_SSE || HAVE_SSE2 */)
#define mem2agpcpy(a,b,c) memcpy(a,b,c)
#define fast_memcpy(a,b,c) memcpy(a,b,c)
#endif
static inline void * mem2agpcpy_pic(void * dst, const void * src, int bytesPerLine, int height, int dstStride, int srcStride)
{
int i;
void *retval=dst;
if(dstStride == srcStride)
{
if (srcStride < 0) {
src = (uint8_t*)src + (height-1)*srcStride;
dst = (uint8_t*)dst + (height-1)*dstStride;
srcStride = -srcStride;
}
mem2agpcpy(dst, src, srcStride*height);
}
else
{
for(i=0; i<height; i++)
{
mem2agpcpy(dst, src, bytesPerLine);
src = (uint8_t*)src + srcStride;
dst = (uint8_t*)dst + dstStride;
}
}
return retval;
}
#define memcpy_pic(d, s, b, h, ds, ss) memcpy_pic2(d, s, b, h, ds, ss, 0)
#define my_memcpy_pic(d, s, b, h, ds, ss) memcpy_pic2(d, s, b, h, ds, ss, 1)
/**
* \param limit2width always skip data between end of line and start of next
* instead of copying the full block when strides are the same
*/
static inline void * memcpy_pic2(void * dst, const void * src,
int bytesPerLine, int height,
int dstStride, int srcStride, int limit2width)
{
int i;
void *retval=dst;
if(!limit2width && dstStride == srcStride)
{
if (srcStride < 0) {
src = (uint8_t*)src + (height-1)*srcStride;
dst = (uint8_t*)dst + (height-1)*dstStride;
srcStride = -srcStride;
}
fast_memcpy(dst, src, srcStride*height);
}
else
{
for(i=0; i<height; i++)
{
fast_memcpy(dst, src, bytesPerLine);
src = (uint8_t*)src + srcStride;
dst = (uint8_t*)dst + dstStride;
}
}
return retval;
}
#endif /* MPLAYER_FASTMEMCPY_H */
/*
* Copyright (C) Aaron Holtzman - Aug 1999
* Strongly modified, most parts rewritten: A'rpi/ESP-team - 2000-2001
* (C) MPlayer developers
*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPLAYER_VIDEO_OUT_H
#define MPLAYER_VIDEO_OUT_H
#include <inttypes.h>
#include <stdarg.h>
//#include "sub/font_load.h"
#include "libmpcodecs/img_format.h"
//#include "vidix/vidix.h"
#define VO_EVENT_EXPOSE 1
#define VO_EVENT_RESIZE 2
#define VO_EVENT_KEYPRESS 4
#define VO_EVENT_REINIT 8
#define VO_EVENT_MOVE 16
/* Obsolete: VOCTRL_QUERY_VAA 1 */
/* does the device support the required format */
#define VOCTRL_QUERY_FORMAT 2
/* signal a device reset seek */
#define VOCTRL_RESET 3
/* true if vo driver can use GUI created windows */
#define VOCTRL_GUISUPPORT 4
#define VOCTRL_GUI_NOWINDOW 19
/* used to switch to fullscreen */
#define VOCTRL_FULLSCREEN 5
/* signal a device pause */
#define VOCTRL_PAUSE 7
/* start/resume playback */
#define VOCTRL_RESUME 8
/* libmpcodecs direct rendering: */
#define VOCTRL_GET_IMAGE 9
#define VOCTRL_DRAW_IMAGE 13
#define VOCTRL_SET_SPU_PALETTE 14
/* decoding ahead: */
#define VOCTRL_GET_NUM_FRAMES 10
#define VOCTRL_GET_FRAME_NUM 11
#define VOCTRL_SET_FRAME_NUM 12
#define VOCTRL_GET_PANSCAN 15
#define VOCTRL_SET_PANSCAN 16
/* equalizer controls */
#define VOCTRL_SET_EQUALIZER 17
#define VOCTRL_GET_EQUALIZER 18
//#define VOCTRL_GUI_NOWINDOW 19
/* Frame duplication */
#define VOCTRL_DUPLICATE_FRAME 20
// ... 21
#define VOCTRL_START_SLICE 21
#define VOCTRL_ONTOP 25
#define VOCTRL_ROOTWIN 26
#define VOCTRL_BORDER 27
#define VOCTRL_DRAW_EOSD 28
#define VOCTRL_GET_EOSD_RES 29
#define VOCTRL_SET_DEINTERLACE 30
#define VOCTRL_GET_DEINTERLACE 31
#define VOCTRL_UPDATE_SCREENINFO 32
// Vo can be used by xover
#define VOCTRL_XOVERLAY_SUPPORT 22
#define VOCTRL_XOVERLAY_SET_COLORKEY 24
typedef struct {
uint32_t x11; // The raw x11 color
uint16_t r,g,b;
} mp_colorkey_t;
#define VOCTRL_XOVERLAY_SET_WIN 23
typedef struct {
int x,y;
int w,h;
} mp_win_t;
#define VO_TRUE 1
#define VO_FALSE 0
#define VO_ERROR -1
#define VO_NOTAVAIL -2
#define VO_NOTIMPL -3
#define VOFLAG_FULLSCREEN 0x01
#define VOFLAG_MODESWITCHING 0x02
#define VOFLAG_SWSCALE 0x04
#define VOFLAG_FLIPPING 0x08
#define VOFLAG_HIDDEN 0x10 //< Use to create a hidden window
#define VOFLAG_STEREO 0x20 //< Use to create a stereo-capable window
#define VOFLAG_XOVERLAY_SUB_VO 0x10000
typedef struct vo_info_s
{
/* driver name ("Matrox Millennium G200/G400" */
const char *name;
/* short name (for config strings) ("mga") */
const char *short_name;
/* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
const char *author;
/* any additional comments */
const char *comment;
} vo_info_t;
typedef struct vo_functions_s
{
const vo_info_t *info;
/*
* Preinitializes driver (real INITIALIZATION)
* arg - currently it's vo_subdevice
* returns: zero on successful initialization, non-zero on error.
*/
int (*preinit)(const char *arg);
/*
* Initialize (means CONFIGURE) the display driver.
* params:
* width,height: image source size
* d_width,d_height: size of the requested window size, just a hint
* fullscreen: flag, 0=windowd 1=fullscreen, just a hint
* title: window title, if available
* format: fourcc of pixel format
* returns : zero on successful initialization, non-zero on error.
*/
int (*config)(uint32_t width, uint32_t height, uint32_t d_width,
uint32_t d_height, uint32_t fullscreen, char *title,
uint32_t format);
/*
* Control interface
*/
int (*control)(uint32_t request, void *data, ...);
/*
* Display a new RGB/BGR frame of the video to the screen.
* params:
* src[0] - pointer to the image
*/
int (*draw_frame)(uint8_t *src[]);
/*
* Draw a planar YUV slice to the buffer:
* params:
* src[3] = source image planes (Y,U,V)
* stride[3] = source image planes line widths (in bytes)
* w,h = width*height of area to be copied (in Y pixels)
* x,y = position at the destination image (in Y pixels)
*/
int (*draw_slice)(uint8_t *src[], int stride[], int w,int h, int x,int y);
/*
* Draws OSD to the screen buffer
*/
void (*draw_osd)(void);
/*
* Blit/Flip buffer to the screen. Must be called after each frame!
*/
void (*flip_page)(void);
/*
* This func is called after every frames to handle keyboard and
* other events. It's called in PAUSE mode too!
*/
void (*check_events)(void);
/*
* Closes driver. Should restore the original state of the system.
*/
void (*uninit)(void);
} vo_functions_t;
const vo_functions_t* init_best_video_out(char** vo_list);
int config_video_out(const vo_functions_t *vo, uint32_t width, uint32_t height,
uint32_t d_width, uint32_t d_height, uint32_t flags,
char *title, uint32_t format);
void list_video_out(void);
// NULL terminated array of all drivers
extern const vo_functions_t* const video_out_drivers[];
extern int vo_flags;
extern int vo_config_count;
extern int xinerama_screen;
extern int xinerama_x;
extern int xinerama_y;
// correct resolution/bpp on screen: (should be autodetected by vo_init())
extern int vo_depthonscreen;
extern int vo_screenwidth;
extern int vo_screenheight;
// requested resolution/bpp: (-x -y -bpp options)
extern int vo_dx;
extern int vo_dy;
extern int vo_dwidth;
extern int vo_dheight;
extern int vo_dbpp;
extern int vo_grabpointer;
extern int vo_doublebuffering;
extern int vo_directrendering;
extern int vo_vsync;
extern int vo_fs;
extern int vo_fsmode;
extern float vo_panscan;
extern int vo_adapter_num;
extern int vo_refresh_rate;
extern int vo_keepaspect;
extern int vo_rootwin;
extern int vo_ontop;
extern int vo_border;
extern int vo_gamma_gamma;
extern int vo_gamma_brightness;
extern int vo_gamma_saturation;
extern int vo_gamma_contrast;
extern int vo_gamma_hue;
extern int vo_gamma_red_intensity;
extern int vo_gamma_green_intensity;
extern int vo_gamma_blue_intensity;
extern int vo_nomouse_input;
extern int enable_mouse_movements;
extern int vo_pts;
extern float vo_fps;
extern char *vo_subdevice;
extern int vo_colorkey;
extern char *vo_winname;
extern char *vo_wintitle;
extern int64_t WinID;
typedef struct {
float min;
float max;
} range_t;
float range_max(range_t *r);
int in_range(range_t *r, float f);
range_t *str2range(char *s);
extern char *monitor_hfreq_str;
extern char *monitor_vfreq_str;
extern char *monitor_dotclock_str;
struct mp_keymap {
int from;
int to;
};
int lookup_keymap_table(const struct mp_keymap *map, int key);
struct vo_rect {
int left, right, top, bottom, width, height;
};
void calc_src_dst_rects(int src_width, int src_height, struct vo_rect *src, struct vo_rect *dst,
struct vo_rect *borders, const struct vo_rect *crop);
void vo_mouse_movement(int posx, int posy);
static inline int aspect_scaling(void)
{
return vo_fs;
}
#endif /* MPLAYER_VIDEO_OUT_H */
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if HAVE_MALLOC_H
#include <malloc.h>
#endif
#include "libmpcodecs/img_format.h"
#include "libmpcodecs/mp_image.h"
#include "libvo/fastmemcpy.h"
#include "libavutil/mem.h"
void mp_image_alloc_planes(mp_image_t *mpi) {
// IF09 - allocate space for 4. plane delta info - unused
if (mpi->imgfmt == IMGFMT_IF09) {
mpi->planes[0]=av_malloc(mpi->bpp*mpi->width*(mpi->height+2)/8+
mpi->chroma_width*mpi->chroma_height);
} else
mpi->planes[0]=av_malloc(mpi->bpp*mpi->width*(mpi->height+2)/8);
if (mpi->flags&MP_IMGFLAG_PLANAR) {
int bpp = IMGFMT_IS_YUVP16(mpi->imgfmt)? 2 : 1;
// YV12/I420/YVU9/IF09. feel free to add other planar formats here...
mpi->stride[0]=mpi->stride[3]=bpp*mpi->width;
if(mpi->num_planes > 2){
mpi->stride[1]=mpi->stride[2]=bpp*mpi->chroma_width;
if(mpi->flags&MP_IMGFLAG_SWAPPED){
// I420/IYUV (Y,U,V)
mpi->planes[1]=mpi->planes[0]+mpi->stride[0]*mpi->height;
mpi->planes[2]=mpi->planes[1]+mpi->stride[1]*mpi->chroma_height;
if (mpi->num_planes > 3)
mpi->planes[3]=mpi->planes[2]+mpi->stride[2]*mpi->chroma_height;
} else {
// YV12,YVU9,IF09 (Y,V,U)
mpi->planes[2]=mpi->planes[0]+mpi->stride[0]*mpi->height;
mpi->planes[1]=mpi->planes[2]+mpi->stride[1]*mpi->chroma_height;
if (mpi->num_planes > 3)
mpi->planes[3]=mpi->planes[1]+mpi->stride[1]*mpi->chroma_height;
}
} else {
// NV12/NV21
mpi->stride[1]=mpi->chroma_width;
mpi->planes[1]=mpi->planes[0]+mpi->stride[0]*mpi->height;
}
} else {
mpi->stride[0]=mpi->width*mpi->bpp/8;
if (mpi->flags & MP_IMGFLAG_RGB_PALETTE)
mpi->planes[1] = av_malloc(1024);
}
mpi->flags|=MP_IMGFLAG_ALLOCATED;
}
mp_image_t* alloc_mpi(int w, int h, unsigned long int fmt) {
mp_image_t* mpi = new_mp_image(w,h);
mp_image_setfmt(mpi,fmt);
mp_image_alloc_planes(mpi);
return mpi;
}
void copy_mpi(mp_image_t *dmpi, mp_image_t *mpi) {
if(mpi->flags&MP_IMGFLAG_PLANAR){
memcpy_pic(dmpi->planes[0],mpi->planes[0], mpi->w, mpi->h,
dmpi->stride[0],mpi->stride[0]);
memcpy_pic(dmpi->planes[1],mpi->planes[1], mpi->chroma_width, mpi->chroma_height,
dmpi->stride[1],mpi->stride[1]);
memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->chroma_width, mpi->chroma_height,
dmpi->stride[2],mpi->stride[2]);
} else {
memcpy_pic(dmpi->planes[0],mpi->planes[0],
mpi->w*(dmpi->bpp/8), mpi->h,
dmpi->stride[0],mpi->stride[0]);
}
}
void mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt){
mpi->flags&=~(MP_IMGFLAG_PLANAR|MP_IMGFLAG_YUV|MP_IMGFLAG_SWAPPED);
mpi->imgfmt=out_fmt;
// compressed formats
if(out_fmt == IMGFMT_MPEGPES ||
out_fmt == IMGFMT_ZRMJPEGNI || out_fmt == IMGFMT_ZRMJPEGIT || out_fmt == IMGFMT_ZRMJPEGIB ||
IMGFMT_IS_HWACCEL(out_fmt)){
mpi->bpp=0;
return;
}
mpi->num_planes=1;
if (IMGFMT_IS_RGB(out_fmt)) {
if (IMGFMT_RGB_DEPTH(out_fmt) < 8 && !(out_fmt&128))
mpi->bpp = IMGFMT_RGB_DEPTH(out_fmt);
else
mpi->bpp=(IMGFMT_RGB_DEPTH(out_fmt)+7)&(~7);
return;
}
if (IMGFMT_IS_BGR(out_fmt)) {
if (IMGFMT_BGR_DEPTH(out_fmt) < 8 && !(out_fmt&128))
mpi->bpp = IMGFMT_BGR_DEPTH(out_fmt);
else
mpi->bpp=(IMGFMT_BGR_DEPTH(out_fmt)+7)&(~7);
mpi->flags|=MP_IMGFLAG_SWAPPED;
return;
}
mpi->flags|=MP_IMGFLAG_YUV;
mpi->num_planes=3;
if (mp_get_chroma_shift(out_fmt, NULL, NULL)) {
mpi->flags|=MP_IMGFLAG_PLANAR;
mpi->bpp = mp_get_chroma_shift(out_fmt, &mpi->chroma_x_shift, &mpi->chroma_y_shift);
mpi->chroma_width = mpi->width >> mpi->chroma_x_shift;
mpi->chroma_height = mpi->height >> mpi->chroma_y_shift;
}
switch(out_fmt){
case IMGFMT_I420:
case IMGFMT_IYUV:
mpi->flags|=MP_IMGFLAG_SWAPPED;
case IMGFMT_YV12:
return;
case IMGFMT_420A:
case IMGFMT_IF09:
mpi->num_planes=4;
case IMGFMT_YVU9:
case IMGFMT_444P:
case IMGFMT_422P:
case IMGFMT_411P:
case IMGFMT_440P:
case IMGFMT_444P16_LE:
case IMGFMT_444P16_BE:
case IMGFMT_422P16_LE:
case IMGFMT_422P16_BE:
case IMGFMT_420P16_LE:
case IMGFMT_420P16_BE:
return;
case IMGFMT_Y800:
case IMGFMT_Y8:
/* they're planar ones, but for easier handling use them as packed */
mpi->flags&=~MP_IMGFLAG_PLANAR;
mpi->num_planes=1;
return;
case IMGFMT_UYVY:
mpi->flags|=MP_IMGFLAG_SWAPPED;
case IMGFMT_YUY2:
mpi->bpp=16;
mpi->num_planes=1;
return;
case IMGFMT_NV12:
mpi->flags|=MP_IMGFLAG_SWAPPED;
case IMGFMT_NV21:
mpi->flags|=MP_IMGFLAG_PLANAR;
mpi->bpp=12;
mpi->num_planes=2;
mpi->chroma_width=(mpi->width>>0);
mpi->chroma_height=(mpi->height>>1);
mpi->chroma_x_shift=0;
mpi->chroma_y_shift=1;
return;
}
mp_msg(MSGT_DECVIDEO,MSGL_WARN,"mp_image: unknown out_fmt: 0x%X\n",out_fmt);
mpi->bpp=0;
}
mp_image_t* new_mp_image(int w,int h){
mp_image_t* mpi = malloc(sizeof(mp_image_t));
if(!mpi) return NULL; // error!
memset(mpi,0,sizeof(mp_image_t));
mpi->width=mpi->w=w;
mpi->height=mpi->h=h;
return mpi;
}
void free_mp_image(mp_image_t* mpi){
if(!mpi) return;
if(mpi->flags&MP_IMGFLAG_ALLOCATED){
/* becouse we allocate the whole image in once */
av_free(mpi->planes[0]);
if (mpi->flags & MP_IMGFLAG_RGB_PALETTE)
av_free(mpi->planes[1]);
}
free(mpi);
}
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPLAYER_MP_IMAGE_H
#define MPLAYER_MP_IMAGE_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mp_msg.h"
//--------- codec's requirements (filled by the codec/vf) ---------
//--- buffer content restrictions:
// set if buffer content shouldn't be modified:
#define MP_IMGFLAG_PRESERVE 0x01
// set if buffer content will be READ for next frame's MC: (I/P mpeg frames)
#define MP_IMGFLAG_READABLE 0x02
//--- buffer width/stride/plane restrictions: (used for direct rendering)
// stride _have_to_ be aligned to MB boundary: [for DR restrictions]
#define MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE 0x4
// stride should be aligned to MB boundary: [for buffer allocation]
#define MP_IMGFLAG_PREFER_ALIGNED_STRIDE 0x8
// codec accept any stride (>=width):
#define MP_IMGFLAG_ACCEPT_STRIDE 0x10
// codec accept any width (width*bpp=stride -> stride%bpp==0) (>=width):
#define MP_IMGFLAG_ACCEPT_WIDTH 0x20
//--- for planar formats only:
// uses only stride[0], and stride[1]=stride[2]=stride[0]>>mpi->chroma_x_shift
#define MP_IMGFLAG_COMMON_STRIDE 0x40
// uses only planes[0], and calculates planes[1,2] from width,height,imgfmt
#define MP_IMGFLAG_COMMON_PLANE 0x80
#define MP_IMGFLAGMASK_RESTRICTIONS 0xFF
//--------- color info (filled by mp_image_setfmt() ) -----------
// set if number of planes > 1
#define MP_IMGFLAG_PLANAR 0x100
// set if it's YUV colorspace
#define MP_IMGFLAG_YUV 0x200
// set if it's swapped (BGR or YVU) plane/byteorder
#define MP_IMGFLAG_SWAPPED 0x400
// set if you want memory for palette allocated and managed by vf_get_image etc.
#define MP_IMGFLAG_RGB_PALETTE 0x800
#define MP_IMGFLAGMASK_COLORS 0xF00
// codec uses drawing/rendering callbacks (draw_slice()-like thing, DR method 2)
// [the codec will set this flag if it supports callbacks, and the vo _may_
// clear it in get_image() if draw_slice() not implemented]
#define MP_IMGFLAG_DRAW_CALLBACK 0x1000
// set if it's in video buffer/memory: [set by vo/vf's get_image() !!!]
#define MP_IMGFLAG_DIRECT 0x2000
// set if buffer is allocated (used in destination images):
#define MP_IMGFLAG_ALLOCATED 0x4000
// buffer type was printed (do NOT set this flag - it's for INTERNAL USE!!!)
#define MP_IMGFLAG_TYPE_DISPLAYED 0x8000
// codec doesn't support any form of direct rendering - it has own buffer
// allocation. so we just export its buffer pointers:
#define MP_IMGTYPE_EXPORT 0
// codec requires a static WO buffer, but it does only partial updates later:
#define MP_IMGTYPE_STATIC 1
// codec just needs some WO memory, where it writes/copies the whole frame to:
#define MP_IMGTYPE_TEMP 2
// I+P type, requires 2+ independent static R/W buffers
#define MP_IMGTYPE_IP 3
// I+P+B type, requires 2+ independent static R/W and 1+ temp WO buffers
#define MP_IMGTYPE_IPB 4
// Upper 16 bits give desired buffer number, -1 means get next available
#define MP_IMGTYPE_NUMBERED 5
// Doesn't need any buffer, incomplete image (probably a first field only)
// we need this type to be able to differentiate between half frames and
// all other cases
#define MP_IMGTYPE_INCOMPLETE 6
#define MP_MAX_PLANES 4
#define MP_IMGFIELD_ORDERED 0x01
#define MP_IMGFIELD_TOP_FIRST 0x02
#define MP_IMGFIELD_REPEAT_FIRST 0x04
#define MP_IMGFIELD_TOP 0x08
#define MP_IMGFIELD_BOTTOM 0x10
#define MP_IMGFIELD_INTERLACED 0x20
typedef struct mp_image {
unsigned int flags;
unsigned char type;
int number;
unsigned char bpp; // bits/pixel. NOT depth! for RGB it will be n*8
unsigned int imgfmt;
int width,height; // stored dimensions
int x,y,w,h; // visible dimensions
unsigned char* planes[MP_MAX_PLANES];
int stride[MP_MAX_PLANES];
char * qscale;
int qstride;
int pict_type; // 0->unknown, 1->I, 2->P, 3->B
int fields;
int qscale_type; // 0->mpeg1/4/h263, 1->mpeg2
int num_planes;
/* these are only used by planar formats Y,U(Cb),V(Cr) */
int chroma_width;
int chroma_height;
int chroma_x_shift; // horizontal
int chroma_y_shift; // vertical
int usage_count;
/* for private use by filter or vo driver (to store buffer id or dmpi) */
void* priv;
} mp_image_t;
void mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt);
mp_image_t* new_mp_image(int w,int h);
void free_mp_image(mp_image_t* mpi);
mp_image_t* alloc_mpi(int w, int h, unsigned long int fmt);
void mp_image_alloc_planes(mp_image_t *mpi);
void copy_mpi(mp_image_t *dmpi, mp_image_t *mpi);
#endif /* MPLAYER_MP_IMAGE_H */
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPLAYER_MP_MSG_H
#define MPLAYER_MP_MSG_H
#include <stdarg.h>
// defined in mplayer.c and mencoder.c
extern int verbose;
// verbosity elevel:
/* Only messages level MSGL_FATAL-MSGL_STATUS should be translated,
* messages level MSGL_V and above should not be translated. */
#define MSGL_FATAL 0 // will exit/abort
#define MSGL_ERR 1 // continues
#define MSGL_WARN 2 // only warning
#define MSGL_HINT 3 // short help message
#define MSGL_INFO 4 // -quiet
#define MSGL_STATUS 5 // v=0
#define MSGL_V 6 // v=1
#define MSGL_DBG2 7 // v=2
#define MSGL_DBG3 8 // v=3
#define MSGL_DBG4 9 // v=4
#define MSGL_DBG5 10 // v=5
#define MSGL_FIXME 1 // for conversions from printf where the appropriate MSGL is not known; set equal to ERR for obtrusiveness
#define MSGT_FIXME 0 // for conversions from printf where the appropriate MSGT is not known; set equal to GLOBAL for obtrusiveness
// code/module:
#define MSGT_GLOBAL 0 // common player stuff errors
#define MSGT_CPLAYER 1 // console player (mplayer.c)
#define MSGT_GPLAYER 2 // gui player
#define MSGT_VO 3 // libvo
#define MSGT_AO 4 // libao
#define MSGT_DEMUXER 5 // demuxer.c (general stuff)
#define MSGT_DS 6 // demux stream (add/read packet etc)
#define MSGT_DEMUX 7 // fileformat-specific stuff (demux_*.c)
#define MSGT_HEADER 8 // fileformat-specific header (*header.c)
#define MSGT_AVSYNC 9 // mplayer.c timer stuff
#define MSGT_AUTOQ 10 // mplayer.c auto-quality stuff
#define MSGT_CFGPARSER 11 // cfgparser.c
#define MSGT_DECAUDIO 12 // av decoder
#define MSGT_DECVIDEO 13
#define MSGT_SEEK 14 // seeking code
#define MSGT_WIN32 15 // win32 dll stuff
#define MSGT_OPEN 16 // open.c (stream opening)
#define MSGT_DVD 17 // open.c (DVD init/read/seek)
#define MSGT_PARSEES 18 // parse_es.c (mpeg stream parser)
#define MSGT_LIRC 19 // lirc_mp.c and input lirc driver
#define MSGT_STREAM 20 // stream.c
#define MSGT_CACHE 21 // cache2.c
#define MSGT_MENCODER 22
#define MSGT_XACODEC 23 // XAnim codecs
#define MSGT_TV 24 // TV input subsystem
#define MSGT_OSDEP 25 // OS-dependent parts
#define MSGT_SPUDEC 26 // spudec.c
#define MSGT_PLAYTREE 27 // Playtree handeling (playtree.c, playtreeparser.c)
#define MSGT_INPUT 28
#define MSGT_VFILTER 29
#define MSGT_OSD 30
#define MSGT_NETWORK 31
#define MSGT_CPUDETECT 32
#define MSGT_CODECCFG 33
#define MSGT_SWS 34
#define MSGT_VOBSUB 35
#define MSGT_SUBREADER 36
#define MSGT_AFILTER 37 // Audio filter messages
#define MSGT_NETST 38 // Netstream
#define MSGT_MUXER 39 // muxer layer
#define MSGT_OSD_MENU 40
#define MSGT_IDENTIFY 41 // -identify output
#define MSGT_RADIO 42
#define MSGT_ASS 43 // libass messages
#define MSGT_LOADER 44 // dll loader messages
#define MSGT_STATUSLINE 45 // playback/encoding status line
#define MSGT_TELETEXT 46 // Teletext decoder
#define MSGT_MAX 64
extern char *mp_msg_charset;
extern int mp_msg_color;
extern int mp_msg_module;
extern int mp_msg_levels[MSGT_MAX];
extern int mp_msg_level_all;
void mp_msg_init(void);
int mp_msg_test(int mod, int lev);
#include "config.h"
void mp_msg_va(int mod, int lev, const char *format, va_list va);
#ifdef __GNUC__
void mp_msg(int mod, int lev, const char *format, ... ) __attribute__ ((format (printf, 3, 4)));
# ifdef MP_DEBUG
# define mp_dbg(mod,lev, args... ) mp_msg(mod, lev, ## args )
# else
# define mp_dbg(mod,lev, args... ) /* only useful for developers */
# endif
#else // not GNU C
void mp_msg(int mod, int lev, const char *format, ... );
# ifdef MP_DEBUG
# define mp_dbg(mod,lev, ... ) mp_msg(mod, lev, __VA_ARGS__)
# else
# define mp_dbg(mod,lev, ... ) /* only useful for developers */
# endif
#endif /* __GNUC__ */
const char* filename_recode(const char* filename);
#endif /* MPLAYER_MP_MSG_H */
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPLAYER_MPBSWAP_H
#define MPLAYER_MPBSWAP_H
#include <sys/types.h>
#include "config.h"
#include "libavutil/bswap.h"
#define bswap_16(v) av_bswap16(v)
#define bswap_32(v) av_bswap32(v)
#define le2me_16(v) av_le2ne16(v)
#define le2me_32(v) av_le2ne32(v)
#define le2me_64(v) av_le2ne64(v)
#define be2me_16(v) av_be2ne16(v)
#define be2me_32(v) av_be2ne32(v)
#ifndef HAVE_SWAB
void swab(const void *from, void *to, ssize_t n);
#endif
#endif /* MPLAYER_MPBSWAP_H */
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPLAYER_MPC_INFO_H
#define MPLAYER_MPC_INFO_H
typedef struct mp_codec_info_s
{
/* codec long name ("Autodesk FLI/FLC Animation decoder" */
const char *name;
/* short name (same as driver name in codecs.conf) ("dshow") */
const char *short_name;
/* interface author/maintainer */
const char *maintainer;
/* codec author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
const char *author;
/* any additional comments */
const char *comment;
} mp_codec_info_t;
#define CONTROL_OK 1
#define CONTROL_TRUE 1
#define CONTROL_FALSE 0
#define CONTROL_UNKNOWN -1
#define CONTROL_ERROR -2
#define CONTROL_NA -3
#endif /* MPLAYER_MPC_INFO_H */
This diff is collapsed.
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPLAYER_PULLUP_H
#define MPLAYER_PULLUP_H
#define PULLUP_CPU_MMX 1
#define PULLUP_CPU_MMX2 2
#define PULLUP_CPU_3DNOW 4
#define PULLUP_CPU_3DNOWEXT 8
#define PULLUP_CPU_SSE 16
#define PULLUP_CPU_SSE2 32
#define PULLUP_FMT_Y 1
#define PULLUP_FMT_YUY2 2
#define PULLUP_FMT_UYVY 3
#define PULLUP_FMT_RGB32 4
struct pullup_buffer
{
int lock[2];
unsigned char **planes;
};
struct pullup_field
{
int parity;
struct pullup_buffer *buffer;
unsigned int flags;
int breaks;
int affinity;
int *diffs;
int *comb;
int *var;
struct pullup_field *prev, *next;
};
struct pullup_frame
{
int lock;
int length;
int parity;
struct pullup_buffer **ifields, *ofields[2];
struct pullup_buffer *buffer;
};
struct pullup_context
{
/* Public interface */
int format;
int nplanes;
int *bpp, *w, *h, *stride, *background;
unsigned int cpu;
int junk_left, junk_right, junk_top, junk_bottom;
int verbose;
int metric_plane;
int strict_breaks;
int strict_pairs;
/* Internal data */
struct pullup_field *first, *last, *head;
struct pullup_buffer *buffers;
int nbuffers;
int (*diff)(unsigned char *, unsigned char *, int);
int (*comb)(unsigned char *, unsigned char *, int);
int (*var)(unsigned char *, unsigned char *, int);
int metric_w, metric_h, metric_len, metric_offset;
struct pullup_frame *frame;
};
struct pullup_buffer *pullup_lock_buffer(struct pullup_buffer *b, int parity);
void pullup_release_buffer(struct pullup_buffer *b, int parity);
struct pullup_buffer *pullup_get_buffer(struct pullup_context *c, int parity);
void pullup_submit_field(struct pullup_context *c, struct pullup_buffer *b, int parity);
void pullup_flush_fields(struct pullup_context *c);
struct pullup_frame *pullup_get_frame(struct pullup_context *c);
void pullup_pack_frame(struct pullup_context *c, struct pullup_frame *fr);
void pullup_release_frame(struct pullup_frame *fr);
struct pullup_context *pullup_alloc_context(void);
void pullup_preinit_context(struct pullup_context *c);
void pullup_init_context(struct pullup_context *c);
void pullup_free_context(struct pullup_context *c);
#endif /* MPLAYER_PULLUP_H */
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPLAYER_VD_FFMPEG_H
#define MPLAYER_VD_FFMPEG_H
void init_avcodec(void);
#endif /* MPLAYER_VD_FFMPEG_H */
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPLAYER_VF_H
#define MPLAYER_VF_H
#include "m_option.h"
#include "mp_image.h"
extern m_obj_settings_t* vf_settings;
extern const m_obj_list_t vf_obj_list;
struct vf_instance;
struct vf_priv_s;
typedef struct vf_info_s {
const char *info;
const char *name;
const char *author;
const char *comment;
int (*vf_open)(struct vf_instance *vf,char* args);
// Ptr to a struct dscribing the options
const void* opts;
} vf_info_t;
#define NUM_NUMBERED_MPI 50
typedef struct vf_image_context_s {
mp_image_t* static_images[2];
mp_image_t* temp_images[1];
mp_image_t* export_images[1];
mp_image_t* numbered_images[NUM_NUMBERED_MPI];
int static_idx;
} vf_image_context_t;
typedef struct vf_format_context_t {
int have_configured;
int orig_width, orig_height, orig_fmt;
} vf_format_context_t;
typedef struct vf_instance {
const vf_info_t* info;
// funcs:
int (*config)(struct vf_instance *vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt);
int (*control)(struct vf_instance *vf,
int request, void* data);
int (*query_format)(struct vf_instance *vf,
unsigned int fmt);
void (*get_image)(struct vf_instance *vf,
mp_image_t *mpi);
int (*put_image)(struct vf_instance *vf,
mp_image_t *mpi, double pts);
void (*start_slice)(struct vf_instance *vf,
mp_image_t *mpi);
void (*draw_slice)(struct vf_instance *vf,
unsigned char** src, int* stride, int w,int h, int x, int y);
void (*uninit)(struct vf_instance *vf);
int (*continue_buffered_image)(struct vf_instance *vf);
// caps:
unsigned int default_caps; // used by default query_format()
unsigned int default_reqs; // used by default config()
// data:
int w, h;
vf_image_context_t imgctx;
vf_format_context_t fmt;
struct vf_instance *next;
mp_image_t *dmpi;
struct vf_priv_s* priv;
} vf_instance_t;
// control codes:
#include "mpc_info.h"
typedef struct vf_seteq_s
{
const char *item;
int value;
} vf_equalizer_t;
#define VFCTRL_QUERY_MAX_PP_LEVEL 4 /* test for postprocessing support (max level) */
#define VFCTRL_SET_PP_LEVEL 5 /* set postprocessing level */
#define VFCTRL_SET_EQUALIZER 6 /* set color options (brightness,contrast etc) */
#define VFCTRL_GET_EQUALIZER 8 /* gset color options (brightness,contrast etc) */
#define VFCTRL_DRAW_OSD 7
#define VFCTRL_CHANGE_RECTANGLE 9 /* Change the rectangle boundaries */
#define VFCTRL_FLIP_PAGE 10 /* Tell the vo to flip pages */
#define VFCTRL_DUPLICATE_FRAME 11 /* For encoding - encode zero-change frame */
#define VFCTRL_SKIP_NEXT_FRAME 12 /* For encoding - drop the next frame that passes thru */
#define VFCTRL_FLUSH_FRAMES 13 /* For encoding - flush delayed frames */
#define VFCTRL_SCREENSHOT 14 /* Make a screenshot */
#define VFCTRL_INIT_EOSD 15 /* Select EOSD renderer */
#define VFCTRL_DRAW_EOSD 16 /* Render EOSD */
#define VFCTRL_GET_PTS 17 /* Return last pts value that reached vf_vo*/
#define VFCTRL_SET_DEINTERLACE 18 /* Set deinterlacing status */
#define VFCTRL_GET_DEINTERLACE 19 /* Get deinterlacing status */
#include "vfcap.h"
//FIXME this should be in a common header, but i dunno which
#define MP_NOPTS_VALUE (-1LL<<63) //both int64_t and double should be able to represent this exactly
// functions:
void vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h);
mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h);
vf_instance_t* vf_open_plugin(const vf_info_t* const* filter_list, vf_instance_t* next, const char *name, char **args);
vf_instance_t* vf_open_filter(vf_instance_t* next, const char *name, char **args);
vf_instance_t* vf_add_before_vo(vf_instance_t **vf, char *name, char **args);
vf_instance_t* vf_open_encoder(vf_instance_t* next, const char *name, char *args);
unsigned int vf_match_csp(vf_instance_t** vfp,const unsigned int* list,unsigned int preferred);
void vf_clone_mpi_attributes(mp_image_t* dst, mp_image_t* src);
void vf_queue_frame(vf_instance_t *vf, int (*)(vf_instance_t *));
int vf_output_queued_frame(vf_instance_t *vf);
// default wrappers:
int vf_next_config(struct vf_instance *vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt);
int vf_next_control(struct vf_instance *vf, int request, void* data);
void vf_extra_flip(struct vf_instance *vf);
int vf_next_query_format(struct vf_instance *vf, unsigned int fmt);
int vf_next_put_image(struct vf_instance *vf,mp_image_t *mpi, double pts);
void vf_next_draw_slice (struct vf_instance *vf, unsigned char** src, int* stride, int w,int h, int x, int y);
vf_instance_t* append_filters(vf_instance_t* last);
void vf_uninit_filter(vf_instance_t* vf);
void vf_uninit_filter_chain(vf_instance_t* vf);
int vf_config_wrapper(struct vf_instance *vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt);
static inline int norm_qscale(int qscale, int type)
{
switch (type) {
case 0: // MPEG-1
return qscale;
case 1: // MPEG-2
return qscale >> 1;
case 2: // H264
return qscale >> 2;
case 3: // VP56
return (63 - qscale + 2) >> 2;
}
return qscale;
}
#endif /* MPLAYER_VF_H */
This diff is collapsed.
/*
* detect frames that are (almost) black
* search for black frames to detect scene transitions
* (c) 2006 Julian Hall
*
* based on code designed for skipping commercials
* (c) 2002-2003 Brian J. Murrell
*
* cleanup, simplify, speedup (c) 2006 by Ivo van Poorten
*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include "mp_msg.h"
#include "img_format.h"
#include "mp_image.h"
#include "vf.h"
struct vf_priv_s {
unsigned int bamount, bthresh, frame, lastkeyframe;
};
static int config(struct vf_instance *vf, int width, int height, int d_width,
int d_height, unsigned int flags, unsigned int outfmt) {
return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
}
static int query_format(struct vf_instance *vf, unsigned fmt) {
switch(fmt) {
case IMGFMT_YVU9:
case IMGFMT_IF09:
case IMGFMT_YV12:
case IMGFMT_I420:
case IMGFMT_IYUV:
case IMGFMT_CLPL:
case IMGFMT_Y800:
case IMGFMT_Y8:
case IMGFMT_NV12:
case IMGFMT_NV21:
case IMGFMT_444P:
case IMGFMT_422P:
case IMGFMT_411P:
case IMGFMT_HM12:
return vf_next_query_format(vf, fmt);
}
return 0;
}
static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
mp_image_t *dmpi;
int x, y;
int nblack=0, pblack=0;
unsigned char *yplane = mpi->planes[0];
unsigned int ystride = mpi->stride[0];
int pict_type = mpi->pict_type;
int w = mpi->w, h = mpi->h;
int bthresh = vf->priv->bthresh;
int bamount = vf->priv->bamount;
static const char *const picttypes[4] = { "unknown", "I", "P", "B" };
for (y=1; y<=h; y++) {
for (x=0; x<w; x++)
nblack += yplane[x] < bthresh;
pblack = nblack*100/(w*y);
if (pblack < bamount) break;
yplane += ystride;
}
if (pict_type > 3 || pict_type < 0) pict_type = 0;
if (pict_type == 1) vf->priv->lastkeyframe = vf->priv->frame;
if (pblack >= bamount)
mp_msg(MSGT_VFILTER, MSGL_INFO,"vf_blackframe: %u, %i%%, %s (I:%u)\n",
vf->priv->frame, pblack, picttypes[pict_type],
vf->priv->lastkeyframe);
vf->priv->frame++;
dmpi = vf_get_image(vf->next, mpi->imgfmt, MP_IMGTYPE_EXPORT, 0,
mpi->width, mpi->height);
dmpi->planes[0] = mpi->planes[0];
dmpi->stride[0] = mpi->stride[0];
dmpi->planes[1] = mpi->planes[1];
dmpi->stride[1] = mpi->stride[1];
dmpi->planes[2] = mpi->planes[2];
dmpi->stride[2] = mpi->stride[2];
vf_clone_mpi_attributes(dmpi, mpi);
return vf_next_put_image(vf, dmpi, pts);
}
static int control(struct vf_instance *vf, int request, void* data){
return vf_next_control(vf,request,data);
}
static void uninit(struct vf_instance *vf) {
free(vf->priv);
}
static int vf_open(vf_instance_t *vf, char *args){
vf->priv = malloc(sizeof(struct vf_priv_s));
if (!vf->priv) return 0;
vf->config = config;
vf->put_image = put_image;
vf->control = control;
vf->uninit = uninit;
vf->query_format = query_format;
vf->priv->bamount = 98;
vf->priv->bthresh = 0x20;
vf->priv->frame = 0;
vf->priv->lastkeyframe = 0;
if (args)
sscanf(args, "%u:%u", &vf->priv->bamount, &vf->priv->bthresh);
return 1;
}
const vf_info_t vf_info_blackframe = {
"detects black frames",
"blackframe",
"Brian J. Murrell, Julian Hall, Ivo van Poorten",
"Useful for detecting scene transitions",
vf_open,
NULL
};
/*
* Copyright (C) 2002 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <assert.h>
#include "mp_msg.h"
#include "img_format.h"
#include "mp_image.h"
#include "vf.h"
//===========================================================================//
typedef struct FilterParam{
int radius;
int power;
}FilterParam;
struct vf_priv_s {
FilterParam lumaParam;
FilterParam chromaParam;
};
/***************************************************************************/
static int config(struct vf_instance *vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt){
return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
}
static inline void blur(uint8_t *dst, uint8_t *src, int w, int radius, int dstStep, int srcStep){
int x;
const int length= radius*2 + 1;
const int inv= ((1<<16) + length/2)/length;
int sum= 0;
for(x=0; x<radius; x++){
sum+= src[x*srcStep]<<1;
}
sum+= src[radius*srcStep];
for(x=0; x<=radius; x++){
sum+= src[(radius+x)*srcStep] - src[(radius-x)*srcStep];
dst[x*dstStep]= (sum*inv + (1<<15))>>16;
}
for(; x<w-radius; x++){
sum+= src[(radius+x)*srcStep] - src[(x-radius-1)*srcStep];
dst[x*dstStep]= (sum*inv + (1<<15))>>16;
}
for(; x<w; x++){
sum+= src[(2*w-radius-x-1)*srcStep] - src[(x-radius-1)*srcStep];
dst[x*dstStep]= (sum*inv + (1<<15))>>16;
}
}
static inline void blur2(uint8_t *dst, uint8_t *src, int w, int radius, int power, int dstStep, int srcStep){
uint8_t temp[2][4096];
uint8_t *a= temp[0], *b=temp[1];
if(radius){
blur(a, src, w, radius, 1, srcStep);
for(; power>2; power--){
uint8_t *c;
blur(b, a, w, radius, 1, 1);
c=a; a=b; b=c;
}
if(power>1)
blur(dst, a, w, radius, dstStep, 1);
else{
int i;
for(i=0; i<w; i++)
dst[i*dstStep]= a[i];
}
}else{
int i;
for(i=0; i<w; i++)
dst[i*dstStep]= src[i*srcStep];
}
}
static void hBlur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride, int radius, int power){
int y;
if(radius==0 && dst==src) return;
for(y=0; y<h; y++){
blur2(dst + y*dstStride, src + y*srcStride, w, radius, power, 1, 1);
}
}
//FIXME optimize (x before y !!!)
static void vBlur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride, int radius, int power){
int x;
if(radius==0 && dst==src) return;
for(x=0; x<w; x++){
blur2(dst + x, src + x, h, radius, power, dstStride, srcStride);
}
}
static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
int cw= mpi->w >> mpi->chroma_x_shift;
int ch= mpi->h >> mpi->chroma_y_shift;
mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_READABLE,
mpi->w,mpi->h);
assert(mpi->flags&MP_IMGFLAG_PLANAR);
hBlur(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h,
dmpi->stride[0], mpi->stride[0], vf->priv->lumaParam.radius, vf->priv->lumaParam.power);
hBlur(dmpi->planes[1], mpi->planes[1], cw,ch,
dmpi->stride[1], mpi->stride[1], vf->priv->chromaParam.radius, vf->priv->chromaParam.power);
hBlur(dmpi->planes[2], mpi->planes[2], cw,ch,
dmpi->stride[2], mpi->stride[2], vf->priv->chromaParam.radius, vf->priv->chromaParam.power);
vBlur(dmpi->planes[0], dmpi->planes[0], mpi->w,mpi->h,
dmpi->stride[0], dmpi->stride[0], vf->priv->lumaParam.radius, vf->priv->lumaParam.power);
vBlur(dmpi->planes[1], dmpi->planes[1], cw,ch,
dmpi->stride[1], dmpi->stride[1], vf->priv->chromaParam.radius, vf->priv->chromaParam.power);
vBlur(dmpi->planes[2], dmpi->planes[2], cw,ch,
dmpi->stride[2], dmpi->stride[2], vf->priv->chromaParam.radius, vf->priv->chromaParam.power);
return vf_next_put_image(vf,dmpi, pts);
}
//===========================================================================//
static int query_format(struct vf_instance *vf, unsigned int fmt){
switch(fmt)
{
case IMGFMT_YV12:
case IMGFMT_I420:
case IMGFMT_IYUV:
case IMGFMT_YVU9:
case IMGFMT_444P:
case IMGFMT_422P:
case IMGFMT_411P:
return vf_next_query_format(vf, fmt);
}
return 0;
}
static int vf_open(vf_instance_t *vf, char *args){
int e;
vf->config=config;
vf->put_image=put_image;
// vf->get_image=get_image;
vf->query_format=query_format;
vf->priv=malloc(sizeof(struct vf_priv_s));
memset(vf->priv, 0, sizeof(struct vf_priv_s));
if(args==NULL) return 0;
e=sscanf(args, "%d:%d:%d:%d",
&vf->priv->lumaParam.radius,
&vf->priv->lumaParam.power,
&vf->priv->chromaParam.radius,
&vf->priv->chromaParam.power
);
if(e==2){
vf->priv->chromaParam.radius= vf->priv->lumaParam.radius;
vf->priv->chromaParam.power = vf->priv->lumaParam.power;
}else if(e!=4)
return 0;
if(vf->priv->lumaParam.radius < 0) return 0;
if(vf->priv->chromaParam.radius < 0) return 0;
return 1;
}
const vf_info_t vf_info_boxblur = {
"box blur",
"boxblur",
"Michael Niedermayer",
"",
vf_open,
NULL
};
//===========================================================================//
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include "config.h"
#include "mp_msg.h"
#include "help_mp.h"
#include "img_format.h"
#include "mp_image.h"
#include "vf.h"
struct vf_priv_s {
int x1,y1,x2,y2;
int limit;
int round;
int reset_count;
int fno;
};
static int checkline(unsigned char* src,int stride,int len,int bpp){
int total=0;
int div=len;
switch(bpp){
case 1:
while(--len>=0){
total+=src[0]; src+=stride;
}
break;
case 3:
case 4:
while(--len>=0){
total+=src[0]+src[1]+src[2]; src+=stride;
}
div*=3;
break;
}
total/=div;
// printf("total=%d\n",total);
return total;
}
//===========================================================================//
static int config(struct vf_instance *vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt){
vf->priv->x1=width - 1;
vf->priv->y1=height - 1;
vf->priv->x2=0;
vf->priv->y2=0;
vf->priv->fno=-2;
return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
}
static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
mp_image_t *dmpi;
int bpp=mpi->bpp/8;
int w,h,x,y,shrink_by;
// hope we'll get DR buffer:
dmpi=vf_get_image(vf->next,mpi->imgfmt,
MP_IMGTYPE_EXPORT, 0,
mpi->w, mpi->h);
dmpi->planes[0]=mpi->planes[0];
dmpi->planes[1]=mpi->planes[1];
dmpi->planes[2]=mpi->planes[2];
dmpi->stride[0]=mpi->stride[0];
dmpi->stride[1]=mpi->stride[1];
dmpi->stride[2]=mpi->stride[2];
dmpi->width=mpi->width;
dmpi->height=mpi->height;
if(++vf->priv->fno>0){ // ignore first 2 frames - they may be empty
// Reset the crop area every reset_count frames, if reset_count is > 0
if(vf->priv->reset_count > 0 && vf->priv->fno > vf->priv->reset_count){
vf->priv->x1=mpi->w-1;
vf->priv->y1=mpi->h-1;
vf->priv->x2=0;
vf->priv->y2=0;
vf->priv->fno=1;
}
for(y=0;y<vf->priv->y1;y++){
if(checkline(mpi->planes[0]+mpi->stride[0]*y,bpp,mpi->w,bpp)>vf->priv->limit){
vf->priv->y1=y;
break;
}
}
for(y=mpi->h-1;y>vf->priv->y2;y--){
if(checkline(mpi->planes[0]+mpi->stride[0]*y,bpp,mpi->w,bpp)>vf->priv->limit){
vf->priv->y2=y;
break;
}
}
for(y=0;y<vf->priv->x1;y++){
if(checkline(mpi->planes[0]+bpp*y,mpi->stride[0],mpi->h,bpp)>vf->priv->limit){
vf->priv->x1=y;
break;
}
}
for(y=mpi->w-1;y>vf->priv->x2;y--){
if(checkline(mpi->planes[0]+bpp*y,mpi->stride[0],mpi->h,bpp)>vf->priv->limit){
vf->priv->x2=y;
break;
}
}
// round x and y (up), important for yuv colorspaces
// make sure they stay rounded!
x=(vf->priv->x1+1)&(~1);
y=(vf->priv->y1+1)&(~1);
w = vf->priv->x2 - x + 1;
h = vf->priv->y2 - y + 1;
// w and h must be divisible by 2 as well because of yuv
// colorspace problems.
if (vf->priv->round <= 1)
vf->priv->round = 16;
if (vf->priv->round % 2)
vf->priv->round *= 2;
shrink_by = w % vf->priv->round;
w -= shrink_by;
x += (shrink_by / 2 + 1) & ~1;
shrink_by = h % vf->priv->round;
h -= shrink_by;
y += (shrink_by / 2 + 1) & ~1;
mp_msg(MSGT_VFILTER, MSGL_INFO, MSGTR_MPCODECS_CropArea,
vf->priv->x1,vf->priv->x2,
vf->priv->y1,vf->priv->y2,
w,h,x,y);
}
return vf_next_put_image(vf,dmpi, pts);
}
static int query_format(struct vf_instance *vf, unsigned int fmt) {
switch(fmt) {
// the default limit value works only right with YV12 right now.
case IMGFMT_YV12:
return vf_next_query_format(vf, fmt);
}
return 0;
}
//===========================================================================//
static int vf_open(vf_instance_t *vf, char *args){
vf->config=config;
vf->put_image=put_image;
vf->query_format=query_format;
vf->priv=malloc(sizeof(struct vf_priv_s));
vf->priv->limit=24; // should be option
vf->priv->round = 0;
vf->priv->reset_count = 0;
if(args) sscanf(args, "%d:%d:%d",
&vf->priv->limit,
&vf->priv->round,
&vf->priv->reset_count);
return 1;
}
const vf_info_t vf_info_cropdetect = {
"autodetect crop size",
"cropdetect",
"A'rpi",
"",
vf_open,
NULL
};
//===========================================================================//
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include "mp_msg.h"
#include "cpudetect.h"
#include "img_format.h"
#include "mp_image.h"
#include "vf.h"
#include "libvo/fastmemcpy.h"
struct vf_priv_s {
int hi, lo;
float frac;
int max, last, cnt;
};
#if HAVE_MMX && HAVE_EBX_AVAILABLE
static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns)
{
volatile short out[4];
__asm__ (
"movl $8, %%ecx \n\t"
"pxor %%mm4, %%mm4 \n\t"
"pxor %%mm7, %%mm7 \n\t"
ASMALIGN(4)
"1: \n\t"
"movq (%%"REG_S"), %%mm0 \n\t"
"movq (%%"REG_S"), %%mm2 \n\t"
"add %%"REG_a", %%"REG_S" \n\t"
"movq (%%"REG_D"), %%mm1 \n\t"
"add %%"REG_b", %%"REG_D" \n\t"
"psubusb %%mm1, %%mm2 \n\t"
"psubusb %%mm0, %%mm1 \n\t"
"movq %%mm2, %%mm0 \n\t"
"movq %%mm1, %%mm3 \n\t"
"punpcklbw %%mm7, %%mm0 \n\t"
"punpcklbw %%mm7, %%mm1 \n\t"
"punpckhbw %%mm7, %%mm2 \n\t"
"punpckhbw %%mm7, %%mm3 \n\t"
"paddw %%mm0, %%mm4 \n\t"
"paddw %%mm1, %%mm4 \n\t"
"paddw %%mm2, %%mm4 \n\t"
"paddw %%mm3, %%mm4 \n\t"
"decl %%ecx \n\t"
"jnz 1b \n\t"
"movq %%mm4, (%%"REG_d") \n\t"
"emms \n\t"
:
: "S" (old), "D" (new), "a" ((long)os), "b" ((long)ns), "d" (out)
: "%ecx", "memory"
);
return out[0]+out[1]+out[2]+out[3];
}
#endif
static int diff_C(unsigned char *old, unsigned char *new, int os, int ns)
{
int x, y, d=0;
for (y = 8; y; y--) {
for (x = 8; x; x--) {
d += abs(new[x] - old[x]);
}
new += ns;
old += os;
}
return d;
}
static int (*diff)(unsigned char *, unsigned char *, int, int);
static int diff_to_drop_plane(int hi, int lo, float frac, unsigned char *old, unsigned char *new, int w, int h, int os, int ns)
{
int x, y;
int d, c=0;
int t = (w/16)*(h/16)*frac;
for (y = 0; y < h-7; y += 4) {
for (x = 8; x < w-7; x += 4) {
d = diff(old+x+y*os, new+x+y*ns, os, ns);
if (d > hi) return 0;
if (d > lo) {
c++;
if (c > t) return 0;
}
}
}
return 1;
}
static int diff_to_drop(int hi, int lo, float frac, mp_image_t *old, mp_image_t *new)
{
if (new->flags & MP_IMGFLAG_PLANAR) {
return diff_to_drop_plane(hi,lo,frac, old->planes[0], new->planes[0],
new->w, new->h, old->stride[0], new->stride[0])
&& diff_to_drop_plane(hi,lo,frac, old->planes[1], new->planes[1],
new->chroma_width, new->chroma_height,
old->stride[1], new->stride[1])
&& diff_to_drop_plane(hi,lo,frac, old->planes[2], new->planes[2],
new->chroma_width, new->chroma_height,
old->stride[2], new->stride[2]);
}
return diff_to_drop_plane(hi,lo,frac, old->planes[0], new->planes[0],
new->w*(new->bpp/8), new->h, old->stride[0], new->stride[0]);
}
static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
{
mp_image_t *dmpi;
dmpi = vf_get_image(vf->next, mpi->imgfmt,
MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
mpi->width, mpi->height);
dmpi->qscale = mpi->qscale;
dmpi->qstride = mpi->qstride;
dmpi->qscale_type = mpi->qscale_type;
if (diff_to_drop(vf->priv->hi, vf->priv->lo, vf->priv->frac, dmpi, mpi)) {
if (vf->priv->max == 0)
return 0;
else if ((vf->priv->max > 0) && (vf->priv->cnt++ < vf->priv->max))
return 0;
else if ((vf->priv->max < 0) && (vf->priv->last+1 >= -vf->priv->max))
return vf->priv->last=0;
}
vf->priv->last++;
vf->priv->cnt=0;
memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
dmpi->stride[0], mpi->stride[0]);
if (mpi->flags & MP_IMGFLAG_PLANAR) {
memcpy_pic(dmpi->planes[1], mpi->planes[1],
mpi->chroma_width, mpi->chroma_height,
dmpi->stride[1], mpi->stride[1]);
memcpy_pic(dmpi->planes[2], mpi->planes[2],
mpi->chroma_width, mpi->chroma_height,
dmpi->stride[2], mpi->stride[2]);
}
return vf_next_put_image(vf, dmpi, pts);
}
static void uninit(struct vf_instance *vf)
{
free(vf->priv);
}
static int vf_open(vf_instance_t *vf, char *args)
{
struct vf_priv_s *p;
vf->put_image = put_image;
vf->uninit = uninit;
vf->default_reqs = VFCAP_ACCEPT_STRIDE;
vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
p->max = 0;
p->hi = 64*12;
p->lo = 64*5;
p->frac = 0.33;
if (args) sscanf(args, "%d:%d:%d:%f", &p->max, &p->hi, &p->lo, &p->frac);
diff = diff_C;
#if HAVE_MMX && HAVE_EBX_AVAILABLE
if(gCpuCaps.hasMMX) diff = diff_MMX;
#endif
return 1;
}
const vf_info_t vf_info_decimate = {
"near-duplicate frame remover",
"decimate",
"Rich Felker",
"",
vf_open,
NULL
};
/*
* Copyright (C) 2002 Jindrich Makovicka <makovick@gmail.com>
*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/* A very simple tv station logo remover */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <math.h>
#include "mp_msg.h"
#include "cpudetect.h"
#include "img_format.h"
#include "mp_image.h"
#include "vf.h"
#include "libvo/fastmemcpy.h"
#include "m_option.h"
#include "m_struct.h"
//===========================================================================//
static struct vf_priv_s {
unsigned int outfmt;
int xoff, yoff, lw, lh, band, show;
} const vf_priv_dflt = {
0,
0, 0, 0, 0, 0, 0
};
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
static void delogo(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int width, int height,
int logo_x, int logo_y, int logo_w, int logo_h, int band, int show, int direct) {
int y, x;
int interp, dist;
uint8_t *xdst, *xsrc;
uint8_t *topleft, *botleft, *topright;
int xclipl, xclipr, yclipt, yclipb;
int logo_x1, logo_x2, logo_y1, logo_y2;
xclipl = MAX(-logo_x, 0);
xclipr = MAX(logo_x+logo_w-width, 0);
yclipt = MAX(-logo_y, 0);
yclipb = MAX(logo_y+logo_h-height, 0);
logo_x1 = logo_x + xclipl;
logo_x2 = logo_x + logo_w - xclipr;
logo_y1 = logo_y + yclipt;
logo_y2 = logo_y + logo_h - yclipb;
topleft = src+logo_y1*srcStride+logo_x1;
topright = src+logo_y1*srcStride+logo_x2-1;
botleft = src+(logo_y2-1)*srcStride+logo_x1;
if (!direct) memcpy_pic(dst, src, width, height, dstStride, srcStride);
dst += (logo_y1+1)*dstStride;
src += (logo_y1+1)*srcStride;
for(y = logo_y1+1; y < logo_y2-1; y++)
{
for (x = logo_x1+1, xdst = dst+logo_x1+1, xsrc = src+logo_x1+1; x < logo_x2-1; x++, xdst++, xsrc++) {
interp = ((topleft[srcStride*(y-logo_y-yclipt)]
+ topleft[srcStride*(y-logo_y-1-yclipt)]
+ topleft[srcStride*(y-logo_y+1-yclipt)])*(logo_w-(x-logo_x))/logo_w
+ (topright[srcStride*(y-logo_y-yclipt)]
+ topright[srcStride*(y-logo_y-1-yclipt)]
+ topright[srcStride*(y-logo_y+1-yclipt)])*(x-logo_x)/logo_w
+ (topleft[x-logo_x-xclipl]
+ topleft[x-logo_x-1-xclipl]
+ topleft[x-logo_x+1-xclipl])*(logo_h-(y-logo_y))/logo_h
+ (botleft[x-logo_x-xclipl]
+ botleft[x-logo_x-1-xclipl]
+ botleft[x-logo_x+1-xclipl])*(y-logo_y)/logo_h
)/6;
/* interp = (topleft[srcStride*(y-logo_y)]*(logo_w-(x-logo_x))/logo_w
+ topright[srcStride*(y-logo_y)]*(x-logo_x)/logo_w
+ topleft[x-logo_x]*(logo_h-(y-logo_y))/logo_h
+ botleft[x-logo_x]*(y-logo_y)/logo_h
)/2;*/
if (y >= logo_y+band && y < logo_y+logo_h-band && x >= logo_x+band && x < logo_x+logo_w-band) {
*xdst = interp;
} else {
dist = 0;
if (x < logo_x+band) dist = MAX(dist, logo_x-x+band);
else if (x >= logo_x+logo_w-band) dist = MAX(dist, x-(logo_x+logo_w-1-band));
if (y < logo_y+band) dist = MAX(dist, logo_y-y+band);
else if (y >= logo_y+logo_h-band) dist = MAX(dist, y-(logo_y+logo_h-1-band));
*xdst = (*xsrc*dist + interp*(band-dist))/band;
if (show && (dist == band-1)) *xdst = 0;
}
}
dst+= dstStride;
src+= srcStride;
}
}
static int config(struct vf_instance *vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt){
return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
}
static void get_image(struct vf_instance *vf, mp_image_t *mpi){
if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change
if(mpi->imgfmt!=vf->priv->outfmt) return; // colorspace differ
// ok, we can do pp in-place (or pp disabled):
vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,
mpi->type, mpi->flags, mpi->w, mpi->h);
mpi->planes[0]=vf->dmpi->planes[0];
mpi->stride[0]=vf->dmpi->stride[0];
mpi->width=vf->dmpi->width;
if(mpi->flags&MP_IMGFLAG_PLANAR){
mpi->planes[1]=vf->dmpi->planes[1];
mpi->planes[2]=vf->dmpi->planes[2];
mpi->stride[1]=vf->dmpi->stride[1];
mpi->stride[2]=vf->dmpi->stride[2];
}
mpi->flags|=MP_IMGFLAG_DIRECT;
}
static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
mp_image_t *dmpi;
if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
// no DR, so get a new image! hope we'll get DR buffer:
vf->dmpi=vf_get_image(vf->next,vf->priv->outfmt,
MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
mpi->w,mpi->h);
}
dmpi= vf->dmpi;
delogo(dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h,
vf->priv->xoff, vf->priv->yoff, vf->priv->lw, vf->priv->lh, vf->priv->band, vf->priv->show,
mpi->flags&MP_IMGFLAG_DIRECT);
delogo(dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2,
vf->priv->xoff/2, vf->priv->yoff/2, vf->priv->lw/2, vf->priv->lh/2, vf->priv->band/2, vf->priv->show,
mpi->flags&MP_IMGFLAG_DIRECT);
delogo(dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w/2, mpi->h/2,
vf->priv->xoff/2, vf->priv->yoff/2, vf->priv->lw/2, vf->priv->lh/2, vf->priv->band/2, vf->priv->show,
mpi->flags&MP_IMGFLAG_DIRECT);
vf_clone_mpi_attributes(dmpi, mpi);
return vf_next_put_image(vf,dmpi, pts);
}
static void uninit(struct vf_instance *vf){
if(!vf->priv) return;
free(vf->priv);
vf->priv=NULL;
}
//===========================================================================//
static int query_format(struct vf_instance *vf, unsigned int fmt){
switch(fmt)
{
case IMGFMT_YV12:
case IMGFMT_I420:
case IMGFMT_IYUV:
return vf_next_query_format(vf,vf->priv->outfmt);
}
return 0;
}
static const unsigned int fmt_list[]={
IMGFMT_YV12,
IMGFMT_I420,
IMGFMT_IYUV,
0
};
static int vf_open(vf_instance_t *vf, char *args){
vf->config=config;
vf->put_image=put_image;
vf->get_image=get_image;
vf->query_format=query_format;
vf->uninit=uninit;
mp_msg(MSGT_VFILTER, MSGL_V, "delogo: %d x %d, %d x %d, band = %d\n",
vf->priv->xoff, vf->priv->yoff,
vf->priv->lw, vf->priv->lh,
vf->priv->band);
vf->priv->show = 0;
if (vf->priv->band < 0) {
vf->priv->band = 4;
vf->priv->show = 1;
}
vf->priv->lw += vf->priv->band*2;
vf->priv->lh += vf->priv->band*2;
vf->priv->xoff -= vf->priv->band;
vf->priv->yoff -= vf->priv->band;
// check csp:
vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_YV12);
if(!vf->priv->outfmt)
{
uninit(vf);
return 0; // no csp match :(
}
return 1;
}
#define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
static const m_option_t vf_opts_fields[] = {
{ "x", ST_OFF(xoff), CONF_TYPE_INT, 0, 0, 0, NULL },
{ "y", ST_OFF(yoff), CONF_TYPE_INT, 0, 0, 0, NULL },
{ "w", ST_OFF(lw), CONF_TYPE_INT, 0, 0, 0, NULL },
{ "h", ST_OFF(lh), CONF_TYPE_INT, 0, 0, 0, NULL },
{ "t", ST_OFF(band), CONF_TYPE_INT, 0, 0, 0, NULL },
{ "band", ST_OFF(band), CONF_TYPE_INT, 0, 0, 0, NULL }, // alias
{ NULL, NULL, 0, 0, 0, 0, NULL }
};
static const m_struct_t vf_opts = {
"delogo",
sizeof(struct vf_priv_s),
&vf_priv_dflt,
vf_opts_fields
};
const vf_info_t vf_info_delogo = {
"simple logo remover",
"delogo",
"Jindrich Makovicka, Alex Beregszaszi",
"",
vf_open,
&vf_opts
};
//===========================================================================//
/*
* Copyright (C) 2003 Daniel Moreno <comac@comac.darktech.org>
*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <math.h>
#include "mp_msg.h"
#include "img_format.h"
#include "mp_image.h"
#include "vf.h"
#define PARAM1_DEFAULT 4.0
#define PARAM2_DEFAULT 3.0
#define PARAM3_DEFAULT 6.0
//===========================================================================//
struct vf_priv_s {
int Coefs[4][512];
unsigned char *Line;
mp_image_t *pmpi;
};
/***************************************************************************/
static int config(struct vf_instance *vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt){
free(vf->priv->Line);
vf->priv->Line = malloc(width);
vf->priv->pmpi=NULL;
// vf->default_caps &= !VFCAP_ACCEPT_STRIDE;
return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
}
static void uninit(struct vf_instance *vf)
{
free(vf->priv->Line);
}
#define LowPass(Prev, Curr, Coef) (Curr + Coef[Prev - Curr])
static void deNoise(unsigned char *Frame, // mpi->planes[x]
unsigned char *FramePrev, // pmpi->planes[x]
unsigned char *FrameDest, // dmpi->planes[x]
unsigned char *LineAnt, // vf->priv->Line (width bytes)
int W, int H, int sStride, int pStride, int dStride,
int *Horizontal, int *Vertical, int *Temporal)
{
int X, Y;
int sLineOffs = 0, pLineOffs = 0, dLineOffs = 0;
unsigned char PixelAnt;
/* First pixel has no left nor top neighbor. Only previous frame */
LineAnt[0] = PixelAnt = Frame[0];
FrameDest[0] = LowPass(FramePrev[0], LineAnt[0], Temporal);
/* Fist line has no top neighbor. Only left one for each pixel and
* last frame */
for (X = 1; X < W; X++)
{
PixelAnt = LowPass(PixelAnt, Frame[X], Horizontal);
LineAnt[X] = PixelAnt;
FrameDest[X] = LowPass(FramePrev[X], LineAnt[X], Temporal);
}
for (Y = 1; Y < H; Y++)
{
sLineOffs += sStride, pLineOffs += pStride, dLineOffs += dStride;
/* First pixel on each line doesn't have previous pixel */
PixelAnt = Frame[sLineOffs];
LineAnt[0] = LowPass(LineAnt[0], PixelAnt, Vertical);
FrameDest[dLineOffs] = LowPass(FramePrev[pLineOffs], LineAnt[0], Temporal);
for (X = 1; X < W; X++)
{
/* The rest are normal */
PixelAnt = LowPass(PixelAnt, Frame[sLineOffs+X], Horizontal);
LineAnt[X] = LowPass(LineAnt[X], PixelAnt, Vertical);
FrameDest[dLineOffs+X] = LowPass(FramePrev[pLineOffs+X], LineAnt[X], Temporal);
}
}
}
static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
int cw= mpi->w >> mpi->chroma_x_shift;
int ch= mpi->h >> mpi->chroma_y_shift;
int W = mpi->w, H = mpi->h;
mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
MP_IMGTYPE_IP, MP_IMGFLAG_ACCEPT_STRIDE |
MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
mpi->w,mpi->h);
if(!dmpi) return 0;
if (!vf->priv->pmpi) vf->priv->pmpi=mpi;
deNoise(mpi->planes[0], vf->priv->pmpi->planes[0], dmpi->planes[0],
vf->priv->Line, W, H,
mpi->stride[0], vf->priv->pmpi->stride[0], dmpi->stride[0],
vf->priv->Coefs[0] + 256,
vf->priv->Coefs[0] + 256,
vf->priv->Coefs[1] + 256);
deNoise(mpi->planes[1], vf->priv->pmpi->planes[1], dmpi->planes[1],
vf->priv->Line, cw, ch,
mpi->stride[1], vf->priv->pmpi->stride[1], dmpi->stride[1],
vf->priv->Coefs[2] + 256,
vf->priv->Coefs[2] + 256,
vf->priv->Coefs[3] + 256);
deNoise(mpi->planes[2], vf->priv->pmpi->planes[2], dmpi->planes[2],
vf->priv->Line, cw, ch,
mpi->stride[2], vf->priv->pmpi->stride[2], dmpi->stride[2],
vf->priv->Coefs[2] + 256,
vf->priv->Coefs[2] + 256,
vf->priv->Coefs[3] + 256);
vf->priv->pmpi=dmpi; // save reference image
return vf_next_put_image(vf,dmpi, pts);
}
//===========================================================================//
static int query_format(struct vf_instance *vf, unsigned int fmt){
switch(fmt)
{
case IMGFMT_YV12:
case IMGFMT_I420:
case IMGFMT_IYUV:
case IMGFMT_YVU9:
case IMGFMT_444P:
case IMGFMT_422P:
case IMGFMT_411P:
return vf_next_query_format(vf, fmt);
}
return 0;
}
#define ABS(A) ( (A) > 0 ? (A) : -(A) )
static void PrecalcCoefs(int *Ct, double Dist25)
{
int i;
double Gamma, Simil, C;
Gamma = log(0.25) / log(1.0 - Dist25/255.0);
for (i = -256; i <= 255; i++)
{
Simil = 1.0 - ABS(i) / 255.0;
// Ct[256+i] = lround(pow(Simil, Gamma) * (double)i);
C = pow(Simil, Gamma) * (double)i;
Ct[256+i] = (C<0) ? (C-0.5) : (C+0.5);
}
}
static int vf_open(vf_instance_t *vf, char *args){
double LumSpac, LumTmp, ChromSpac, ChromTmp;
double Param1, Param2, Param3;
vf->config=config;
vf->put_image=put_image;
vf->query_format=query_format;
vf->uninit=uninit;
vf->priv=malloc(sizeof(struct vf_priv_s));
memset(vf->priv, 0, sizeof(struct vf_priv_s));
if (args)
{
switch(sscanf(args, "%lf:%lf:%lf",
&Param1, &Param2, &Param3
))
{
case 0:
LumSpac = PARAM1_DEFAULT;
LumTmp = PARAM3_DEFAULT;
ChromSpac = PARAM2_DEFAULT;
ChromTmp = LumTmp * ChromSpac / LumSpac;
break;
case 1:
LumSpac = Param1;
LumTmp = PARAM3_DEFAULT * Param1 / PARAM1_DEFAULT;
ChromSpac = PARAM2_DEFAULT * Param1 / PARAM1_DEFAULT;
ChromTmp = LumTmp * ChromSpac / LumSpac;
break;
case 2:
LumSpac = Param1;
LumTmp = PARAM3_DEFAULT * Param1 / PARAM1_DEFAULT;
ChromSpac = Param2;
ChromTmp = LumTmp * ChromSpac / LumSpac;
break;
case 3:
LumSpac = Param1;
LumTmp = Param3;
ChromSpac = Param2;
ChromTmp = LumTmp * ChromSpac / LumSpac;
break;
default:
LumSpac = PARAM1_DEFAULT;
LumTmp = PARAM3_DEFAULT;
ChromSpac = PARAM2_DEFAULT;
ChromTmp = LumTmp * ChromSpac / LumSpac;
}
}
else
{
LumSpac = PARAM1_DEFAULT;
LumTmp = PARAM3_DEFAULT;
ChromSpac = PARAM2_DEFAULT;
ChromTmp = LumTmp * ChromSpac / LumSpac;
}
PrecalcCoefs(vf->priv->Coefs[0], LumSpac);
PrecalcCoefs(vf->priv->Coefs[1], LumTmp);
PrecalcCoefs(vf->priv->Coefs[2], ChromSpac);
PrecalcCoefs(vf->priv->Coefs[3], ChromTmp);
return 1;
}
const vf_info_t vf_info_denoise3d = {
"3D Denoiser (variable lowpass filter)",
"denoise3d",
"Daniel Moreno",
"",
vf_open,
NULL
};
//===========================================================================//
This diff is collapsed.
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include "config.h"
#include "mp_msg.h"
#include "mp_image.h"
#include "img_format.h"
#include "vf.h"
struct vf_priv_s {
float sense; // first parameter
float level; // second parameter
unsigned int imgfmt;
char diff;
uint32_t max;
// int dfr;
// int rdfr;
int was_dint;
mp_image_t *pmpi; // previous mpi
};
#define MAXROWSIZE 1200
static int config (struct vf_instance *vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt)
{
int rowsize;
vf->priv->pmpi = vf_get_image (vf->next, outfmt, MP_IMGTYPE_TEMP,
0, width, height);
if (!(vf->priv->pmpi->flags & MP_IMGFLAG_PLANAR) &&
outfmt != IMGFMT_RGB32 && outfmt != IMGFMT_BGR32 &&
outfmt != IMGFMT_RGB24 && outfmt != IMGFMT_BGR24 &&
outfmt != IMGFMT_RGB16 && outfmt != IMGFMT_BGR16)
{
mp_msg (MSGT_VFILTER, MSGL_WARN, "Drop-interlaced filter doesn't support this outfmt :(\n");
return 0;
}
vf->priv->imgfmt = outfmt;
// recalculate internal values
rowsize = vf->priv->pmpi->width;
if (rowsize > MAXROWSIZE) rowsize = MAXROWSIZE;
vf->priv->max = vf->priv->level * vf->priv->pmpi->height * rowsize / 2;
if (vf->priv->pmpi->flags & MP_IMGFLAG_PLANAR) // planar YUV
vf->priv->diff = vf->priv->sense * 256;
else
vf->priv->diff = vf->priv->sense * (1 << (vf->priv->pmpi->bpp/3));
if (vf->priv->diff < 0) vf->priv->diff = 0;
if (!(vf->priv->pmpi->flags & MP_IMGFLAG_PLANAR) &&
vf->priv->pmpi->bpp < 24 && vf->priv->diff > 31)
vf->priv->diff = 31;
mp_msg (MSGT_VFILTER, MSGL_INFO, "Drop-interlaced: %dx%d diff %d / level %u\n",
vf->priv->pmpi->width, vf->priv->pmpi->height,
(int)vf->priv->diff, (unsigned int)vf->priv->max);
// vf->priv->rdfr = vf->priv->dfr = 0;
vf->priv->was_dint = 0;
return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
}
static int put_image (struct vf_instance *vf, mp_image_t *mpi, double pts)
{
char rrow0[MAXROWSIZE];
char rrow1[MAXROWSIZE];
char rrow2[MAXROWSIZE];
char *row0 = rrow0, *row1 = rrow1, *row2 = rrow2/*, *row3 = rrow3*/;
int rowsize = mpi->width;
uint32_t nok = 0, max = vf->priv->max;
int diff = vf->priv->diff;
int i, j;
register int n1, n2;
unsigned char *cur0, *prv0;
register unsigned char *cur, *prv;
if (rowsize > MAXROWSIZE) rowsize = MAXROWSIZE;
// check if nothing to do
if (mpi->imgfmt == vf->priv->imgfmt)
{
cur0 = mpi->planes[0] + mpi->stride[0];
prv0 = mpi->planes[0];
for (j = 1; j < mpi->height && nok <= max; j++)
{
cur = cur0;
prv = prv0;
// analyse row (row0)
if (mpi->flags & MP_IMGFLAG_PLANAR) // planar YUV - check luminance
for (i = 0; i < rowsize; i++)
{
if (cur[0] - prv[0] > diff)
row0[i] = 1;
else if (cur[0] - prv[0] < -diff)
row0[i] = -1;
else
row0[i] = 0;
cur++;
prv++;
// check if row0 is 1 but row1 is 0, and row2 is 1 or row2 is 0
// but row3 is 1 so it's interlaced ptr (nok++)
if (j > 2 && row0[i] > 0 && (row1[i] < 0 || (!row1[i] && row2[i] < 0)) &&
(++nok) > max)
break;
}
else if (mpi->bpp < 24) // RGB/BGR 16 - check all colors
for (i = 0; i < rowsize; i++)
{
n1 = cur[0] + (cur[1]<<8);
n2 = prv[0] + (prv[1]<<8);
if ((n1&0x1f) - (n2&0x1f) > diff ||
((n1>>5)&0x3f) - ((n2>>5)&0x3f) > diff ||
((n1>>11)&0x1f) - ((n2>>11)&0x1f) > diff)
row0[i] = 1;
else if ((n1&0x1f) - (n2&0x1f) < -diff ||
((n1>>5)&0x3f) - ((n2>>5)&0x3f) < -diff ||
((n1>>11)&0x1f) - ((n2>>11)&0x1f) < -diff)
row0[i] = -1;
else
row0[i] = 0;
cur += 2;
prv += 2;
// check if row0 is 1 but row1 is 0, and row2 is 1 or row2 is 0
// but row3 is 1 so it's interlaced ptr (nok++)
if (j > 2 && row0[i] > 0 && (row1[i] < 0 || (!row1[i] && row2[i] < 0)) &&
(++nok) > max)
break;
}
else // RGB/BGR 24/32
for (i = 0; i < rowsize; i++)
{
if (cur[0] - prv[0] > diff ||
cur[1] - prv[1] > diff ||
cur[2] - prv[2] > diff)
row0[i] = 1;
else if (prv[0] - cur[0] > diff ||
prv[1] - cur[1] > diff ||
prv[2] - cur[2] > diff)
row0[i] = -1;
else
row0[i] = 0;
cur += mpi->bpp/8;
prv += mpi->bpp/8;
// check if row0 is 1 but row1 is 0, and row2 is 1 or row2 is 0
// but row3 is 1 so it's interlaced ptr (nok++)
if (j > 2 && row0[i] > 0 && (row1[i] < 0 || (!row1[i] && row2[i] < 0)) &&
(++nok) > max)
break;
}
cur0 += mpi->stride[0];
prv0 += mpi->stride[0];
// rotate rows
cur = row2;
row2 = row1;
row1 = row0;
row0 = cur;
}
}
// check if number of interlaced is above of max
if (nok > max)
{
// vf->priv->dfr++;
if (vf->priv->was_dint < 1) // can skip at most one frame!
{
vf->priv->was_dint++;
// vf->priv->rdfr++;
// mp_msg (MSGT_VFILTER, MSGL_INFO, "DI:%d/%d ", vf->priv->rdfr, vf->priv->dfr);
return 0;
}
}
vf->priv->was_dint = 0;
// mp_msg (MSGT_VFILTER, MSGL_INFO, "DI:%d/%d ", vf->priv->rdfr, vf->priv->dfr);
return vf_next_put_image (vf, mpi, pts);
}
static int vf_open(vf_instance_t *vf, char *args){
vf->config = config;
vf->put_image = put_image;
// vf->default_reqs=VFCAP_ACCEPT_STRIDE;
vf->priv = malloc (sizeof(struct vf_priv_s));
vf->priv->sense = 0.1;
vf->priv->level = 0.15;
vf->priv->pmpi = NULL;
if (args)
sscanf (args, "%f:%f", &vf->priv->sense, &vf->priv->level);
return 1;
}
const vf_info_t vf_info_dint = {
"drop interlaced frames",
"dint",
"A.G.",
"",
vf_open,
NULL
};
This diff is collapsed.
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include "config.h"
#include "mp_msg.h"
#include "cpudetect.h"
#include "img_format.h"
#include "mp_image.h"
#include "vf.h"
#include "libvo/fastmemcpy.h"
struct vf_priv_s {
int skipline;
int scalew;
int scaleh;
};
static void toright(unsigned char *dst[3], unsigned char *src[3],
int dststride[3], int srcstride[3],
int w, int h, struct vf_priv_s* p)
{
int k;
for (k = 0; k < 3; k++) {
unsigned char* fromL = src[k];
unsigned char* fromR = src[k];
unsigned char* to = dst[k];
int src = srcstride[k];
int dst = dststride[k];
int ss;
unsigned int dd;
int i;
if (k > 0) {
i = h / 4 - p->skipline / 2;
ss = src * (h / 4 + p->skipline / 2);
dd = w / 4;
} else {
i = h / 2 - p->skipline;
ss = src * (h / 2 + p->skipline);
dd = w / 2;
}
fromR += ss;
for ( ; i > 0; i--) {
int j;
unsigned char* t = to;
unsigned char* sL = fromL;
unsigned char* sR = fromR;
if (p->scalew == 1) {
for (j = dd; j > 0; j--) {
*t++ = (sL[0] + sL[1]) / 2;
sL+=2;
}
for (j = dd ; j > 0; j--) {
*t++ = (sR[0] + sR[1]) / 2;
sR+=2;
}
} else {
for (j = dd * 2 ; j > 0; j--)
*t++ = *sL++;
for (j = dd * 2 ; j > 0; j--)
*t++ = *sR++;
}
if (p->scaleh == 1) {
fast_memcpy(to + dst, to, dst);
to += dst;
}
to += dst;
fromL += src;
fromR += src;
}
//printf("K %d %d %d %d %d \n", k, w, h, src, dst);
}
}
static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
{
mp_image_t *dmpi;
// hope we'll get DR buffer:
dmpi=vf_get_image(vf->next, IMGFMT_YV12,
MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE |
(vf->priv->scaleh == 1) ? MP_IMGFLAG_READABLE : 0,
mpi->w * vf->priv->scalew,
mpi->h / vf->priv->scaleh - vf->priv->skipline);
toright(dmpi->planes, mpi->planes, dmpi->stride,
mpi->stride, mpi->w, mpi->h, vf->priv);
return vf_next_put_image(vf,dmpi, pts);
}
static int config(struct vf_instance *vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt)
{
/* FIXME - also support UYVY output? */
return vf_next_config(vf, width * vf->priv->scalew,
height / vf->priv->scaleh - vf->priv->skipline, d_width, d_height, flags, IMGFMT_YV12);
}
static int query_format(struct vf_instance *vf, unsigned int fmt)
{
/* FIXME - really any YUV 4:2:0 input format should work */
switch (fmt) {
case IMGFMT_YV12:
case IMGFMT_IYUV:
case IMGFMT_I420:
return vf_next_query_format(vf, IMGFMT_YV12);
}
return 0;
}
static void uninit(struct vf_instance *vf)
{
free(vf->priv);
}
static int vf_open(vf_instance_t *vf, char *args)
{
vf->config=config;
vf->query_format=query_format;
vf->put_image=put_image;
vf->uninit=uninit;
vf->priv = calloc(1, sizeof (struct vf_priv_s));
vf->priv->skipline = 0;
vf->priv->scalew = 1;
vf->priv->scaleh = 2;
if (args) sscanf(args, "%d:%d:%d", &vf->priv->skipline, &vf->priv->scalew, &vf->priv->scaleh);
return 1;
}
const vf_info_t vf_info_down3dright = {
"convert stereo movie from top-bottom to left-right field",
"down3dright",
"Zdenek Kabelac",
"",
vf_open,
NULL
};
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment