1
/* Optimised lowlevel motion estimation routines for mpeg2enc */
3
/* (C) 2000/2001 Andrew Stevens */
5
/* This is free software; you can redistribute it
6
* and/or modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2 of
8
* the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22
#include "motionsearch.h"
23
#include "mblock_sub44_sads_x86.h"
27
void sub_mean_reduction( me_result_set *matchset,
31
void enable_mmxsse_motion(int a);
32
void mblock_sub22_nearest4_sads_mmxe(uint8_t *blk1,uint8_t *blk2,
33
int frowstride,int fh, int* resvec);
35
//int mblock_nearest4_sads_mmxe(uint8_t *blk1, uint8_t *blk2,int rowstride, int h, int *resvec);
36
int mblock_nearest4_sads_mmxe(uint8_t *blk1,uint8_t *blk2,int lx,int h,int32_t *weightvec,int peakerror);
39
int sad_00_mmxe(uint8_t *blk1, uint8_t *blk2, int rowstride, int h, int distlim);
40
int sad_01_mmxe(uint8_t *blk1, uint8_t *blk2, int rowstride, int h);
41
int sad_10_mmxe(uint8_t *blk1, uint8_t *blk2, int rowstride, int h);
42
int sad_11_mmxe(uint8_t *blk1, uint8_t *blk2, int rowstride, int h);
45
int sad_sub22_mmxe ( uint8_t *blk1, uint8_t *blk2, int frowstride, int fh) ;
46
int sad_sub44_mmxe ( uint8_t *blk1, uint8_t *blk2, int qrowstride, int qh);
47
int sumsq_mmx( uint8_t *blk1, uint8_t *blk2, int rowstride, int hx, int hy, int h) ;
48
int sumsq_sub22_mmx( uint8_t *blk1, uint8_t *blk2, int rowstride, int h) ;
49
int bsumsq_sub22_mmx( uint8_t *blk1f, uint8_t *blk1b, uint8_t *blk2, int rowstride, int h) ;
50
int bsumsq_mmx (uint8_t *pf, uint8_t *pb, uint8_t *p2, int rowstride,
51
int hxf, int hyf, int hxb, int hyb, int h);
52
int bsad_mmx (uint8_t *pf, uint8_t *pb, uint8_t *p2, int rowstride,
53
int hxf, int hyf, int hxb, int hyb, int h);
55
void variance_mmx( uint8_t *p, int size, int rowstride,
56
uint32_t *p_variance, uint32_t *p_mean);
58
int sad_00_mmx ( uint8_t *blk1, uint8_t *blk2, int rowstride, int h, int distlim);
59
int sad_01_mmx(uint8_t *blk1, uint8_t *blk2, int rowstride, int h);
60
int sad_10_mmx(uint8_t *blk1, uint8_t *blk2, int rowstride, int h);
61
int sad_11_mmx(uint8_t *blk1, uint8_t *blk2, int rowstride, int h);
62
int sad_sub22_mmx ( uint8_t *blk1, uint8_t *blk2, int frowstride, int fh);
63
int sad_sub44_mmx (uint8_t *blk1, uint8_t *blk2, int qrowstride, int qh);
66
/* Assembler core routine used in x86 MMX/SSE implementation */
68
extern int (*pmblocks_sub44_mests)( uint8_t *blk, uint8_t *ref,
75
void find_best_one_pel_mmxe( me_result_set *sub22set,
76
uint8_t *org, uint8_t *blk,
80
me_result_s *best_so_far);
82
int build_sub44_mests_mmx( me_result_set *sub44set,
83
int ilow, int jlow, int ihigh, int jhigh,
86
uint8_t *s44org, uint8_t *s44blk,
87
int qrowstride, int qh,
90
int build_sub22_mests_mmxe( me_result_set *sub44set,
91
me_result_set *sub22set,
92
int i0, int j0, int ihigh, int jhigh,
94
uint8_t *s22org, uint8_t *s22blk,
95
int frowstride, int fh,