19 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
* |
* |
22 |
* $Id: gmc.c,v 1.5 2006-06-14 21:44:07 Skal Exp $ |
* $Id: gmc.c,v 1.7 2006-11-07 19:59:03 Skal Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
27 |
#include "../global.h" |
#include "../global.h" |
28 |
#include "../encoder.h" |
#include "../encoder.h" |
29 |
#include "gmc.h" |
#include "gmc.h" |
30 |
|
#include "../utils/emms.h" |
31 |
|
|
32 |
#include <stdio.h> |
#include <stdio.h> |
33 |
|
|
460 |
if ( W2>(uint32_t)U && W2>(uint32_t)(U+15*dUx) && |
if ( W2>(uint32_t)U && W2>(uint32_t)(U+15*dUx) && |
461 |
H2>(uint32_t)V && H2>(uint32_t)(V+15*dVx) ) |
H2>(uint32_t)V && H2>(uint32_t)(V+15*dVx) ) |
462 |
{ |
{ |
463 |
|
uint32_t UV1, UV2; |
464 |
for(i=0; i<16; ++i) |
for(i=0; i<16; ++i) |
465 |
{ |
{ |
466 |
uint32_t u = ( U >> 16 ) << rho; |
uint32_t u = ( U >> 16 ) << rho; |
470 |
Offsets[16+i] = v; |
Offsets[16+i] = v; |
471 |
} |
} |
472 |
// batch 8 input pixels when linearity says it's ok |
// batch 8 input pixels when linearity says it's ok |
473 |
uint32_t UV1, UV2; |
|
474 |
UV1 = (Offsets[0] | (Offsets[16]<<16)) & 0xfff0fff0U; |
UV1 = (Offsets[0] | (Offsets[16]<<16)) & 0xfff0fff0U; |
475 |
UV2 = (Offsets[7] | (Offsets[23]<<16)) & 0xfff0fff0U; |
UV2 = (Offsets[7] | (Offsets[23]<<16)) & 0xfff0fff0U; |
476 |
if (UV1+7*16==UV2) |
if (UV1+7*16==UV2) |
534 |
if ( W2>(uint32_t)U && W2>(uint32_t)(U+15*dUx) && |
if ( W2>(uint32_t)U && W2>(uint32_t)(U+15*dUx) && |
535 |
H2>(uint32_t)V && H2>(uint32_t)(V+15*dVx) ) |
H2>(uint32_t)V && H2>(uint32_t)(V+15*dVx) ) |
536 |
{ |
{ |
537 |
|
uint32_t UV1, UV2; |
538 |
for(i=0; i<8; ++i) |
for(i=0; i<8; ++i) |
539 |
{ |
{ |
540 |
int32_t u = ( U >> 16 ) << rho; |
int32_t u = ( U >> 16 ) << rho; |
543 |
Offsets[ i] = u; |
Offsets[ i] = u; |
544 |
Offsets[16+i] = v; |
Offsets[16+i] = v; |
545 |
} |
} |
546 |
|
|
547 |
// batch 8 input pixels when linearity says it's ok |
// batch 8 input pixels when linearity says it's ok |
548 |
const uint32_t UV1 = (Offsets[ 0] | (Offsets[16]<<16)) & 0xfff0fff0U; |
UV1 = (Offsets[ 0] | (Offsets[16]<<16)) & 0xfff0fff0U; |
549 |
const uint32_t UV2 = (Offsets[ 7] | (Offsets[23]<<16)) & 0xfff0fff0U; |
UV2 = (Offsets[ 7] | (Offsets[23]<<16)) & 0xfff0fff0U; |
550 |
if (UV1+7*16==UV2) |
if (UV1+7*16==UV2) |
551 |
{ |
{ |
552 |
const uint32_t Off = (Offsets[0]>>4) + (Offsets[16]>>4)*srcstride; |
const uint32_t Off = (Offsets[0]>>4) + (Offsets[16]>>4)*srcstride; |
587 |
Predict_16x16_func = Predict_16x16_C; |
Predict_16x16_func = Predict_16x16_C; |
588 |
Predict_8x8_func = Predict_8x8_C; |
Predict_8x8_func = Predict_8x8_C; |
589 |
|
|
590 |
#if 0 // #if defined(ARCH_IS_IA32) |
#if defined(ARCH_IS_IA32) |
591 |
if ((cpu_flags & XVID_CPU_MMX) || (cpu_flags & XVID_CPU_MMXEXT) || |
if ((cpu_flags & XVID_CPU_MMX) || (cpu_flags & XVID_CPU_MMXEXT) || |
592 |
(cpu_flags & XVID_CPU_3DNOW) || (cpu_flags & XVID_CPU_3DNOWEXT) || |
(cpu_flags & XVID_CPU_3DNOW) || (cpu_flags & XVID_CPU_3DNOWEXT) || |
593 |
(cpu_flags & XVID_CPU_SSE) || (cpu_flags & XVID_CPU_SSE2)) |
(cpu_flags & XVID_CPU_SSE) || (cpu_flags & XVID_CPU_SSE2)) |
738 |
|
|
739 |
pMBs[mbnum].mcsel = 0; /* until mode decision */ |
pMBs[mbnum].mcsel = 0; /* until mode decision */ |
740 |
} |
} |
741 |
|
emms(); |
742 |
} |
} |