~ubuntu-branches/ubuntu/saucy/x264/saucy-updates

« back to all changes in this revision

Viewing changes to common/predict.c

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2009-01-15 23:15:42 UTC
  • mto: (12.1.1 sid) (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20090115231542-19v12f85z0e7zev7
Tags: upstream-0.svn20081230
ImportĀ upstreamĀ versionĀ 0.svn20081230

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 * predict.c: h264 encoder
3
3
 *****************************************************************************
4
 
 * Copyright (C) 2003 Laurent Aimar
5
 
 * $Id: predict.c,v 1.1 2004/06/03 19:27:07 fenrir Exp $
 
4
 * Copyright (C) 2003-2008 x264 project
6
5
 *
7
6
 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8
7
 *          Loren Merritt <lorenm@u.washington.edu>
 
8
 *          Jason Garrett-Glaser <darkshikari@gmail.com>
9
9
 *
10
10
 * This program is free software; you can redistribute it and/or modify
11
11
 * it under the terms of the GNU General Public License as published by
19
19
 *
20
20
 * You should have received a copy of the GNU General Public License
21
21
 * along with this program; if not, write to the Free Software
22
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
 
22
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
23
23
 *****************************************************************************/
24
24
 
25
25
/* predict4x4 are inspired from ffmpeg h264 decoder */
27
27
 
28
28
#include "common.h"
29
29
 
30
 
#ifdef _MSC_VER
31
 
#undef HAVE_MMX  /* not finished now */
32
 
#endif
33
30
#ifdef HAVE_MMX
34
31
#   include "x86/predict.h"
35
32
#endif
37
34
#   include "ppc/predict.h"
38
35
#endif
39
36
 
40
 
static ALWAYS_INLINE uint32_t pack16to32( int a, int b )
41
 
{
42
 
#ifdef WORDS_BIGENDIAN
43
 
   return b + (a<<16);
44
 
#else
45
 
   return a + (b<<16);
46
 
#endif
47
 
}
48
 
 
49
 
static ALWAYS_INLINE uint32_t pack8to16( int a, int b )
50
 
{
51
 
#ifdef WORDS_BIGENDIAN
52
 
   return b + (a<<8);
53
 
#else
54
 
   return a + (b<<8);
55
 
#endif
56
 
}
57
 
 
58
37
/****************************************************************************
59
38
 * 16x16 prediction for intra luma block
60
39
 ****************************************************************************/
664
643
    SRC(5,0)=SRC(6,1)=SRC(7,2)= F2(t3,t4,t5);
665
644
    SRC(6,0)=SRC(7,1)= F2(t4,t5,t6);
666
645
    SRC(7,0)= F2(t5,t6,t7);
667
 
  
 
646
 
668
647
}
669
648
static void predict_8x8_vr( uint8_t *src, uint8_t edge[33] )
670
649
{
707
686
    int p6 = pack8to16(F1(l1,l2), F2(l0,l1,l2));
708
687
    int p7 = pack8to16(F1(l0,l1), F2(lt,l0,l1));
709
688
    int p8 = pack8to16(F1(lt,l0), F2(l0,lt,t0));
710
 
    int p9 = pack8to16(F2(t1,t0,lt), F2(t2,t1,t0 ));
711
 
    int p10 = pack8to16(F2(t3,t2,t1), F2(t4,t3,t2 ));
712
 
    int p11 = pack8to16(F2(t5,t4,t3), F2(t6,t5,t4 ));
 
689
    int p9 = pack8to16(F2(t1,t0,lt), F2(t2,t1,t0));
 
690
    int p10 = pack8to16(F2(t3,t2,t1), F2(t4,t3,t2));
 
691
    int p11 = pack8to16(F2(t5,t4,t3), F2(t6,t5,t4));
713
692
    SRC32(0,7)= pack16to32(p1,p2);
714
693
    SRC32(0,6)= pack16to32(p2,p3);
715
694
    SRC32(4,7)=SRC32(0,5)= pack16to32(p3,p4);