[FFmpeg-soc] [soc]: r567 - in rv40: h264pred.c h264pred.h rv40.c
kostya
subversion at mplayerhq.hu
Tue Jul 31 08:40:55 CEST 2007
Author: kostya
Date: Tue Jul 31 08:40:55 2007
New Revision: 567
Log:
Correct two last 4x4 intra prediction modes
Modified:
rv40/h264pred.c
rv40/h264pred.h
rv40/rv40.c
Modified: rv40/h264pred.c
==============================================================================
--- rv40/h264pred.c (original)
+++ rv40/h264pred.c Tue Jul 31 08:40:55 2007
@@ -264,6 +264,29 @@ static void pred4x4_vertical_left_c(uint
src[3+3*stride]=(t4 + 2*t5 + t6 + 2)>>2;
}
+static void pred4x4_vertical_left_rv40_c(uint8_t *src, uint8_t *topright, int stride){
+ LOAD_TOP_EDGE
+ LOAD_TOP_RIGHT_EDGE
+ LOAD_LEFT_EDGE
+
+ src[0+0*stride]=(2*t0 + 2*t1 + l1 + 2*l2 + l3 + 4)>>3;
+ src[1+0*stride]=
+ src[0+2*stride]=(t1 + t2 + 1)>>1;
+ src[2+0*stride]=
+ src[1+2*stride]=(t2 + t3 + 1)>>1;
+ src[3+0*stride]=
+ src[2+2*stride]=(t3 + t4+ 1)>>1;
+ src[3+2*stride]=(t4 + t5+ 1)>>1;
+ src[0+1*stride]=(t0 + 2*t1 + t2 + l2 + 2*l3 + l3 + 4)>>3;
+ src[1+1*stride]=
+ src[0+3*stride]=(t1 + 2*t2 + t3 + 2)>>2;
+ src[2+1*stride]=
+ src[1+3*stride]=(t2 + 2*t3 + t4 + 2)>>2;
+ src[3+1*stride]=
+ src[2+3*stride]=(t3 + 2*t4 + t5 + 2)>>2;
+ src[3+3*stride]=(t4 + 2*t5 + t6 + 2)>>2;
+}
+
static void pred4x4_horizontal_up_c(uint8_t *src, uint8_t *topright, int stride){
LOAD_LEFT_EDGE
@@ -285,6 +308,53 @@ static void pred4x4_horizontal_up_c(uint
src[3+3*stride]=l3;
}
+static void pred4x4_horizontal_up_rv40_c(uint8_t *src, uint8_t *topright, int stride){
+ LOAD_LEFT_EDGE
+ LOAD_DOWN_LEFT_EDGE
+ LOAD_TOP_EDGE
+ LOAD_TOP_RIGHT_EDGE
+
+ src[0+0*stride]=(t1 + 2*t2 + t3 + 2*l0 + 2*l1 + 4)>>3;
+ src[1+0*stride]=(t2 + 2*t3 + t4 + l0 + 2*l1 + l2 + 4)>>3;
+ src[2+0*stride]=
+ src[0+1*stride]=(t3 + 2*t4 + t5 + 2*l1 + 2*l2 + 4)>>3;
+ src[3+0*stride]=
+ src[1+1*stride]=(t4 + 2*t5 + t6 + l1 + 2*l2 + l3 + 4)>>3;
+ src[2+1*stride]=
+ src[0+2*stride]=(t5 + 2*t6 + t7 + 2*l2 + 2*l3 + 4)>>3;
+ src[3+1*stride]=
+ src[1+2*stride]=(t6 + 3*t7 + l2 + 3*l3 + 4)>>3;
+ src[3+2*stride]=
+ src[1+3*stride]=(l3 + 2*l4 + l5 + 2)>>2;
+ src[0+3*stride]=
+ src[2+2*stride]=(t6 + t7 + l3 + l4 + 2)>>2;
+ src[2+3*stride]=(l4 + l5 + 1)>>1;
+ src[3+3*stride]=(l4 + 2*l5 + l6 + 2)>>2;
+}
+
+static void pred4x4_horizontal_up_rv40_nodown_c(uint8_t *src, uint8_t *topright, int stride){
+ LOAD_LEFT_EDGE
+ LOAD_TOP_EDGE
+ LOAD_TOP_RIGHT_EDGE
+
+ src[0+0*stride]=(t1 + 2*t2 + t3 + 2*l0 + 2*l1 + 4)>>3;
+ src[1+0*stride]=(t2 + 2*t3 + t4 + l0 + 2*l1 + l2 + 4)>>3;
+ src[2+0*stride]=
+ src[0+1*stride]=(t3 + 2*t4 + t5 + 2*l1 + 2*l2 + 4)>>3;
+ src[3+0*stride]=
+ src[1+1*stride]=(t4 + 2*t5 + t6 + l1 + 2*l2 + l3 + 4)>>3;
+ src[2+1*stride]=
+ src[0+2*stride]=(t5 + 2*t6 + t7 + 2*l2 + 2*l3 + 4)>>3;
+ src[3+1*stride]=
+ src[1+2*stride]=(t6 + 3*t7 + l2 + 3*l3 + 4)>>3;
+ src[3+2*stride]=
+ src[1+3*stride]=l3;
+ src[0+3*stride]=
+ src[2+2*stride]=(t6 + t7 + 2*l3 + 2)>>2;
+ src[2+3*stride]=
+ src[3+3*stride]=l3;
+}
+
static void pred4x4_horizontal_down_c(uint8_t *src, uint8_t *topright, int stride){
const int lt= src[-1-1*stride];
LOAD_TOP_EDGE
@@ -838,6 +908,9 @@ void ff_h264_pred_init(H264PredContext *
h->pred4x4[DIAG_DOWN_LEFT_PRED_RV40]= pred4x4_down_left_rv40_c;
h->pred4x4[DIAG_DOWN_LEFT_PRED_RV40_NODOWN]= pred4x4_down_left_rv40_nodown_c;
h->pred4x4[DIAG_DOWN_LEFT_PRED_RV40_NOTOP]= pred4x4_down_left_rv40_notop_c;
+ h->pred4x4[VERT_LEFT_PRED_RV40 ]= pred4x4_vertical_left_rv40_c;
+ h->pred4x4[HOR_UP_PRED_RV40 ]= pred4x4_horizontal_up_rv40_c;
+ h->pred4x4[HOR_UP_PRED_RV40_NODOWN]= pred4x4_horizontal_up_rv40_nodown_c;
h->pred8x8l[VERT_PRED ]= pred8x8l_vertical_c;
h->pred8x8l[HOR_PRED ]= pred8x8l_horizontal_c;
Modified: rv40/h264pred.h
==============================================================================
--- rv40/h264pred.h (original)
+++ rv40/h264pred.h Tue Jul 31 08:40:55 2007
@@ -51,6 +51,9 @@
#define DIAG_DOWN_LEFT_PRED_RV40 12
#define DIAG_DOWN_LEFT_PRED_RV40_NODOWN 13
#define DIAG_DOWN_LEFT_PRED_RV40_NOTOP 14
+#define VERT_LEFT_PRED_RV40 15
+#define HOR_UP_PRED_RV40 16
+#define HOR_UP_PRED_RV40_NODOWN 17
#define DC_PRED8x8 0
#define HOR_PRED8x8 1
@@ -66,7 +69,7 @@
* Context for storing H.264 prediction functions
*/
typedef struct H264PredContext{
- void (*pred4x4 [9+3+3])(uint8_t *src, uint8_t *topright, int stride);//FIXME move to dsp?
+ void (*pred4x4 [9+3+6])(uint8_t *src, uint8_t *topright, int stride);//FIXME move to dsp?
void (*pred8x8l [9+3])(uint8_t *src, int topleft, int topright, int stride);
void (*pred8x8 [4+3])(uint8_t *src, int stride);
void (*pred16x16[4+3])(uint8_t *src, int stride);
Modified: rv40/rv40.c
==============================================================================
--- rv40/rv40.c (original)
+++ rv40/rv40.c Tue Jul 31 08:40:55 2007
@@ -652,7 +652,7 @@ static int rv40_decode_mb_info(RV40DecCo
/** Mapping of RV40 intra prediction types to standard H.264 types */
static const int ittrans[9] = {
DC_PRED, VERT_PRED, HOR_PRED, DIAG_DOWN_RIGHT_PRED, DIAG_DOWN_LEFT_PRED_RV40,
- VERT_RIGHT_PRED, VERT_LEFT_PRED, HOR_UP_PRED, HOR_DOWN_PRED,
+ VERT_RIGHT_PRED, VERT_LEFT_PRED_RV40, HOR_UP_PRED_RV40, HOR_DOWN_PRED,
};
/** Mapping of RV40 intra 16x16 prediction types to standard H.264 types */
@@ -688,6 +688,7 @@ static void rv40_output_macroblock(RV40D
if(itype == DIAG_DOWN_LEFT_PRED_RV40) itype = DIAG_DOWN_LEFT_PRED;
}
if((i || j==3) && itype == DIAG_DOWN_LEFT_PRED_RV40) itype = DIAG_DOWN_LEFT_PRED_RV40_NODOWN;
+ if((i || j==3) && itype == HOR_UP_PRED_RV40) itype = HOR_UP_PRED_RV40_NODOWN;
PY = YY - s->linesize + 4;
if(j && i == 3){
topleft = YY[-s->linesize + 3] * 0x01010101;
More information about the FFmpeg-soc
mailing list