2
// C++ Implementation: ADM_pp
7
// Author: mean <fixounet@free.fr>, (C) 2004
9
// Copyright: See COPYING file that comes with this distribution
12
//________________________________________________
14
// PostProc : 1 Horiz deblock
17
// strength between 0 and 5
26
#include "ADM_lavcodec.h"
27
#include <ADM_assert.h>
29
#include "ADM_library/default.h"
31
#include "ADM_toolkit/ADM_cpuCap.h"
35
#define aprintf printf
37
void deletePostProc(ADM_PP *pp)
39
aprintf("Deleting post proc\n");
40
if(pp->ppMode) {pp_free_mode(pp->ppMode);pp->ppMode=NULL;}
41
if(pp->ppContext) {pp_free_context(pp->ppContext);pp->ppContext=NULL;}
44
void updatePostProc(ADM_PP *pp )
51
aprintf("updating post proc\n");
53
if(pp->postProcType&1) strcat(stringMode,"ha:a:128:7,");
54
if(pp->postProcType&2) strcat(stringMode,"va:a:128:7,");
55
if(pp->postProcType&4) strcat(stringMode,"dr:a,");
58
sprintf(stringFQ,"fq:%d,",pp->forcedQuant);
59
strcat(stringMode,stringFQ);
62
if(strlen(stringMode)) // something to do ?
66
#if (defined( ARCH_X86) || defined(ARCH_X86_64))
68
#define ADD(x,y) if( CpuCaps::has##x()) ppCaps|=PP_CPU_CAPS_##y;
75
ppCaps|=PP_CPU_CAPS_ALTIVEC;
77
pp->ppContext=pp_get_context(pp->w, pp->h, ppCaps
79
pp->ppMode=pp_get_mode_by_name_and_quality(
80
stringMode, pp->postProcStrength);;
81
ADM_assert(pp->ppMode);
82
aprintf("Enabled type:%d strength:%d\n",
83
pp->postProcType,pp->postProcStrength);
85
else // if nothing is selected we may as well set back every thing to 0
87
pp->postProcStrength=0;
88
aprintf("Disabled\n");
91
//______________________________________________________________________________
93
void initPostProc(ADM_PP *pp,uint32_t w, uint32_t h)
95
memset(pp,0,sizeof(ADM_PP));
99
aprintf("Initializing postproc\n");