From e2fcfe476b1c8a88e24e0c27b4baac6b9af4e887 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 22 Oct 2001 23:36:35 +0000 Subject: auto brightness/ contrast bugfix getPPModeByNameAndQuality git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2390 b3059339-0415-0410-9bf9-f77b7e298cf2 --- postproc/postprocess.c | 252 +++++++++++++++++++++++++++++++++++++--- postproc/postprocess.h | 29 ++++- postproc/postprocess_template.c | 252 +++++++++++++++++++++++++++++++++++++--- 3 files changed, 498 insertions(+), 35 deletions(-) (limited to 'postproc') diff --git a/postproc/postprocess.c b/postproc/postprocess.c index 214626966d..5f3717a64f 100644 --- a/postproc/postprocess.c +++ b/postproc/postprocess.c @@ -71,6 +71,7 @@ Notes: #include #include #include +#include #include "../config.h" //#undef HAVE_MMX2 //#define HAVE_3DNOW @@ -88,6 +89,10 @@ Notes: #define PAVGB(a,b) "pavgusb " #a ", " #b " \n\t" #endif +#define GET_MODE_BUFFER_SIZE 500 +#define OPTIONS_ARRAY_SIZE 10 + + static uint64_t packedYOffset= 0x0000000000000000LL; static uint64_t packedYScale= 0x0100010001000100LL; static uint64_t w05= 0x0005000500050005LL; @@ -130,10 +135,35 @@ int vFlatnessThreshold= 56 - 16; //amount of "black" u r willing to loose to get a brightness corrected picture double maxClippedThreshold= 0.01; -int maxAllowedY=255; +int maxAllowedY=234; //FIXME can never make a movie´s black brighter (anyone needs that?) int minAllowedY=16; +static struct PPFilter filters[]= +{ + {"hb", "hdeblock", 1, 1, 3, H_DEBLOCK}, + {"vb", "vdeblock", 1, 2, 4, V_DEBLOCK}, + {"vr", "rkvdeblock", 1, 2, 4, H_RK1_FILTER}, + {"h1", "x1hdeblock", 1, 1, 3, H_X1_FILTER}, + {"v1", "x1vdeblock", 1, 2, 4, V_X1_FILTER}, + {"dr", "dering", 1, 5, 6, DERING}, + {"al", "autolevels", 0, 1, 2, LEVEL_FIX}, + {"lb", "linblenddeint", 0, 1, 6, LINEAR_BLEND_DEINT_FILTER}, + {"li", "linipoldeint", 0, 1, 6, LINEAR_IPOL_DEINT_FILTER}, + {"ci", "cubicipoldeint", 0, 1, 6, CUBIC_IPOL_DEINT_FILTER}, + {"md", "mediandeint", 0, 1, 6, MEDIAN_DEINT_FILTER}, + {NULL, NULL,0,0,0,0} //End Marker +}; + +static char *replaceTable[]= +{ + "default", "hdeblock:a,vdeblock:a,dering:a,autolevels", + "de", "hdeblock:a,vdeblock:a,dering:a,autolevels", + "fast", "x1hdeblock:a,x1vdeblock:a,dering:a,autolevels", + "fa", "x1hdeblock:a,x1vdeblock:a,dering:a,autolevels", + NULL //End Marker +}; + #ifdef TIMING static inline long long rdtsc() { @@ -2163,6 +2193,165 @@ int use_old_pp=0; static void postProcess(uint8_t src[], int srcStride, uint8_t dst[], int dstStride, int width, int height, QP_STORE_T QPs[], int QPStride, int isColor, int mode); +/* -pp Command line Help +NOTE/FIXME: put this at an appropriate place (--help, html docs, man mplayer)? + +-pp [: