~ubuntu-branches/ubuntu/hardy/avidemux/hardy

« back to all changes in this revision

Viewing changes to avidemux/ADM_pp.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Matvey Kozhev
  • Date: 2007-12-18 13:53:04 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20071218135304-cdqec2lg2bglyz15
Tags: 1:2.4~preview3-0.0ubuntu1
* Upload to Ubuntu. (LP: #163287, LP: #126572)
* debian/changelog: re-added Ubuntu releases.
* debian/control:
  - Require debhelper >= 5.0.51 (for dh_icons) and imagemagick.
  - Build-depend on libsdl1.2-dev instead of libsdl-dev.
  - Build against newer libx264-dev. (LP: #138854)
  - Removed libamrnb-dev, not in Ubuntu yet.
* debian/rules:
  - Install all icon sizes, using convert (upstream installs none).
  - Added missing calls to dh_installmenu, dh_installman, dh_icons and
    dh_desktop.
* debian/menu, debian/avidemux-qt.menu:
  - Corrected package and executable names.
* debian/avidemux-common.install: Install icons.
* debian/avidemux.common.manpages: Install man/avidemux.1.
* debian/links, debian/avidemux-cli.links, debian/avidemux-gtk.links:
  - Link manpages to avidemux.1.gz.
* debian/install, debian/avidemux-qt.install, debian/avidemux-gtk.desktop,
  debian/avidemux-qt.desktop: Install desktop files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//
2
 
// C++ Implementation: ADM_pp
3
 
//
4
 
// Description: 
5
 
//
6
 
//
7
 
// Author: mean <fixounet@free.fr>, (C) 2004
8
 
//
9
 
// Copyright: See COPYING file that comes with this distribution
10
 
//
11
 
//
12
 
//________________________________________________
13
 
 
14
 
//      PostProc : 1 Horiz deblock
15
 
//             2 Verti deblock
16
 
//             4 Dering
17
 
// strength between 0 and 5
18
 
#include "config.h"
19
 
 
20
 
#include <stdio.h>
21
 
#include <stdlib.h>
22
 
#include <string.h>
23
 
#include <math.h>
24
 
 
25
 
 
26
 
#include "ADM_lavcodec.h"
27
 
#include <ADM_assert.h>
28
 
 
29
 
#include "ADM_library/default.h"
30
 
 
31
 
#include "ADM_toolkit/ADM_cpuCap.h"
32
 
#include "ADM_pp.h"
33
 
 
34
 
 
35
 
#define aprintf printf
36
 
 
37
 
void deletePostProc(ADM_PP *pp)
38
 
{
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;}
42
 
 
43
 
}
44
 
void updatePostProc(ADM_PP *pp )                    
45
 
{
46
 
char stringMode[60];
47
 
char stringFQ[60];
48
 
 
49
 
        stringMode[0]=0;
50
 
        deletePostProc(pp);
51
 
        aprintf("updating post proc\n");
52
 
 
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,");
56
 
        if(pp->forcedQuant)  
57
 
                {
58
 
                        sprintf(stringFQ,"fq:%d,",pp->forcedQuant);
59
 
                        strcat(stringMode,stringFQ);
60
 
                }
61
 
                        
62
 
        if(strlen(stringMode))  // something to do ?
63
 
                {
64
 
                uint32_t ppCaps=0;
65
 
                
66
 
#if (defined( ARCH_X86)  || defined(ARCH_X86_64))
67
 
                
68
 
        #define ADD(x,y) if( CpuCaps::has##x()) ppCaps|=PP_CPU_CAPS_##y;
69
 
                
70
 
                ADD(MMX,MMX);           
71
 
                ADD(3DNOW,3DNOW);
72
 
                ADD(MMXEXT,MMX2);
73
 
#endif          
74
 
#ifdef HAVE_ALTIVEC
75
 
                ppCaps|=PP_CPU_CAPS_ALTIVEC;
76
 
#endif  
77
 
                        pp->ppContext=pp_get_context(pp->w, pp->h, ppCaps
78
 
                           );           
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);
84
 
                }          
85
 
        else    // if nothing is selected we may as well set back every thing to 0
86
 
                {
87
 
                        pp->postProcStrength=0;
88
 
                        aprintf("Disabled\n");
89
 
                }
90
 
}
91
 
//______________________________________________________________________________
92
 
 
93
 
void initPostProc(ADM_PP *pp,uint32_t w, uint32_t h)
94
 
{
95
 
        memset(pp,0,sizeof(ADM_PP));
96
 
        pp->w=w;
97
 
        pp->h=h;
98
 
        pp->swapuv=0;
99
 
        aprintf("Initializing postproc\n");
100
 
        
101
 
 
102
 
}