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
7
6
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
8
7
* Loren Merritt <lorenm@u.washington.edu>
8
* Jason Garrett-Glaser <darkshikari@gmail.com>
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
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
*****************************************************************************/
25
25
/* predict4x4 are inspired from ffmpeg h264 decoder */
37
34
# include "ppc/predict.h"
40
static ALWAYS_INLINE uint32_t pack16to32( int a, int b )
42
#ifdef WORDS_BIGENDIAN
49
static ALWAYS_INLINE uint32_t pack8to16( int a, int b )
51
#ifdef WORDS_BIGENDIAN
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);
669
648
static void predict_8x8_vr( uint8_t *src, uint8_t edge[33] )
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);