~ubuntu-branches/ubuntu/feisty/avidemux/feisty

« back to all changes in this revision

Viewing changes to avidemux/mpeg2enc/find_best_one_pel.cc

  • Committer: Bazaar Package Importer
  • Author(s): Christian Marillat
  • Date: 2005-05-25 13:02:29 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050525130229-jw94cav0yhmg7vjw
Tags: 1:2.0.40-0.0
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "config.h"
1
2
#include <stdlib.h>
2
 
#include "config.h"
3
3
#include <limits.h>
4
4
#include <math.h>
5
5
#include "mmxsse_motion.h"
23
23
        uint8_t *orgblk;
24
24
        int penalty;
25
25
        me_result_s matchrec;
26
 
        int resvec[4];
 
26
        int32_t resvec[4];
27
27
 
28
28
        for( k = 0; k < sub22set->len; ++k )
29
 
        {       
 
29
        {
 
30
                int x;
30
31
                matchrec = sub22set->mests[k];
31
32
                orgblk = org + (i0+matchrec.x)+rowstride*(j0+matchrec.y);
32
 
                penalty = intmax(abs(matchrec.x),abs(matchrec.y))<<5;
 
33
                penalty = (abs(matchrec.x) + abs(matchrec.y))<<3;
33
34
                
34
35
                /* Get SAD for macroblocks:     orgblk,orgblk(+1,0),
35
36
                   orgblk(0,+1), and orgblk(+1,+1)
36
37
                   Done all in one go to reduce memory bandwidth demand
37
38
                */
38
 
                mblock_nearest4_sads_mmxe(orgblk,blk,rowstride,h,
39
 
                resvec);
40
 
 
 
39
                if( penalty>=dmin )
 
40
                    continue;
 
41
                x=mblock_nearest4_sads_mmxe(orgblk,blk,rowstride,h,resvec,dmin-penalty);
 
42
                if( x+penalty>=dmin )
 
43
                    continue;
41
44
                for( i = 0; i < 4; ++i )
42
45
                {
43
46
                        if( matchrec.x <= ilim && matchrec.y <= jlim )