00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00028 #include "libavutil/avassert.h"
00029 #include "h264pred.h"
00030
00031 #define BIT_DEPTH 8
00032 #include "h264pred_template.c"
00033 #undef BIT_DEPTH
00034
00035 #define BIT_DEPTH 9
00036 #include "h264pred_template.c"
00037 #undef BIT_DEPTH
00038
00039 #define BIT_DEPTH 10
00040 #include "h264pred_template.c"
00041 #undef BIT_DEPTH
00042
00043 #define BIT_DEPTH 12
00044 #include "h264pred_template.c"
00045 #undef BIT_DEPTH
00046
00047 #define BIT_DEPTH 14
00048 #include "h264pred_template.c"
00049 #undef BIT_DEPTH
00050
00051 static void pred4x4_vertical_vp8_c(uint8_t *src, const uint8_t *topright, int stride){
00052 const unsigned lt = src[-1-1*stride];
00053 LOAD_TOP_EDGE
00054 LOAD_TOP_RIGHT_EDGE
00055 uint32_t v = PACK_4U8((lt + 2*t0 + t1 + 2) >> 2,
00056 (t0 + 2*t1 + t2 + 2) >> 2,
00057 (t1 + 2*t2 + t3 + 2) >> 2,
00058 (t2 + 2*t3 + t4 + 2) >> 2);
00059
00060 AV_WN32A(src+0*stride, v);
00061 AV_WN32A(src+1*stride, v);
00062 AV_WN32A(src+2*stride, v);
00063 AV_WN32A(src+3*stride, v);
00064 }
00065
00066 static void pred4x4_horizontal_vp8_c(uint8_t *src, const uint8_t *topright, int stride){
00067 const unsigned lt = src[-1-1*stride];
00068 LOAD_LEFT_EDGE
00069
00070 AV_WN32A(src+0*stride, ((lt + 2*l0 + l1 + 2) >> 2)*0x01010101);
00071 AV_WN32A(src+1*stride, ((l0 + 2*l1 + l2 + 2) >> 2)*0x01010101);
00072 AV_WN32A(src+2*stride, ((l1 + 2*l2 + l3 + 2) >> 2)*0x01010101);
00073 AV_WN32A(src+3*stride, ((l2 + 2*l3 + l3 + 2) >> 2)*0x01010101);
00074 }
00075
00076 static void pred4x4_down_left_svq3_c(uint8_t *src, const uint8_t *topright, int stride){
00077 LOAD_TOP_EDGE
00078 LOAD_LEFT_EDGE
00079
00080 src[0+0*stride]=(l1 + t1)>>1;
00081 src[1+0*stride]=
00082 src[0+1*stride]=(l2 + t2)>>1;
00083 src[2+0*stride]=
00084 src[1+1*stride]=
00085 src[0+2*stride]=
00086 src[3+0*stride]=
00087 src[2+1*stride]=
00088 src[1+2*stride]=
00089 src[0+3*stride]=
00090 src[3+1*stride]=
00091 src[2+2*stride]=
00092 src[1+3*stride]=
00093 src[3+2*stride]=
00094 src[2+3*stride]=
00095 src[3+3*stride]=(l3 + t3)>>1;
00096 }
00097
00098 static void pred4x4_down_left_rv40_c(uint8_t *src, const uint8_t *topright, int stride){
00099 LOAD_TOP_EDGE
00100 LOAD_TOP_RIGHT_EDGE
00101 LOAD_LEFT_EDGE
00102 LOAD_DOWN_LEFT_EDGE
00103
00104 src[0+0*stride]=(t0 + t2 + 2*t1 + 2 + l0 + l2 + 2*l1 + 2)>>3;
00105 src[1+0*stride]=
00106 src[0+1*stride]=(t1 + t3 + 2*t2 + 2 + l1 + l3 + 2*l2 + 2)>>3;
00107 src[2+0*stride]=
00108 src[1+1*stride]=
00109 src[0+2*stride]=(t2 + t4 + 2*t3 + 2 + l2 + l4 + 2*l3 + 2)>>3;
00110 src[3+0*stride]=
00111 src[2+1*stride]=
00112 src[1+2*stride]=
00113 src[0+3*stride]=(t3 + t5 + 2*t4 + 2 + l3 + l5 + 2*l4 + 2)>>3;
00114 src[3+1*stride]=
00115 src[2+2*stride]=
00116 src[1+3*stride]=(t4 + t6 + 2*t5 + 2 + l4 + l6 + 2*l5 + 2)>>3;
00117 src[3+2*stride]=
00118 src[2+3*stride]=(t5 + t7 + 2*t6 + 2 + l5 + l7 + 2*l6 + 2)>>3;
00119 src[3+3*stride]=(t6 + t7 + 1 + l6 + l7 + 1)>>2;
00120 }
00121
00122 static void pred4x4_down_left_rv40_nodown_c(uint8_t *src, const uint8_t *topright, int stride){
00123 LOAD_TOP_EDGE
00124 LOAD_TOP_RIGHT_EDGE
00125 LOAD_LEFT_EDGE
00126
00127 src[0+0*stride]=(t0 + t2 + 2*t1 + 2 + l0 + l2 + 2*l1 + 2)>>3;
00128 src[1+0*stride]=
00129 src[0+1*stride]=(t1 + t3 + 2*t2 + 2 + l1 + l3 + 2*l2 + 2)>>3;
00130 src[2+0*stride]=
00131 src[1+1*stride]=
00132 src[0+2*stride]=(t2 + t4 + 2*t3 + 2 + l2 + 3*l3 + 2)>>3;
00133 src[3+0*stride]=
00134 src[2+1*stride]=
00135 src[1+2*stride]=
00136 src[0+3*stride]=(t3 + t5 + 2*t4 + 2 + l3*4 + 2)>>3;
00137 src[3+1*stride]=
00138 src[2+2*stride]=
00139 src[1+3*stride]=(t4 + t6 + 2*t5 + 2 + l3*4 + 2)>>3;
00140 src[3+2*stride]=
00141 src[2+3*stride]=(t5 + t7 + 2*t6 + 2 + l3*4 + 2)>>3;
00142 src[3+3*stride]=(t6 + t7 + 1 + 2*l3 + 1)>>2;
00143 }
00144
00145 static void pred4x4_vertical_left_rv40(uint8_t *src, const uint8_t *topright, int stride,
00146 const int l0, const int l1, const int l2, const int l3, const int l4){
00147 LOAD_TOP_EDGE
00148 LOAD_TOP_RIGHT_EDGE
00149
00150 src[0+0*stride]=(2*t0 + 2*t1 + l1 + 2*l2 + l3 + 4)>>3;
00151 src[1+0*stride]=
00152 src[0+2*stride]=(t1 + t2 + 1)>>1;
00153 src[2+0*stride]=
00154 src[1+2*stride]=(t2 + t3 + 1)>>1;
00155 src[3+0*stride]=
00156 src[2+2*stride]=(t3 + t4+ 1)>>1;
00157 src[3+2*stride]=(t4 + t5+ 1)>>1;
00158 src[0+1*stride]=(t0 + 2*t1 + t2 + l2 + 2*l3 + l4 + 4)>>3;
00159 src[1+1*stride]=
00160 src[0+3*stride]=(t1 + 2*t2 + t3 + 2)>>2;
00161 src[2+1*stride]=
00162 src[1+3*stride]=(t2 + 2*t3 + t4 + 2)>>2;
00163 src[3+1*stride]=
00164 src[2+3*stride]=(t3 + 2*t4 + t5 + 2)>>2;
00165 src[3+3*stride]=(t4 + 2*t5 + t6 + 2)>>2;
00166 }
00167
00168 static void pred4x4_vertical_left_rv40_c(uint8_t *src, const uint8_t *topright, int stride){
00169 LOAD_LEFT_EDGE
00170 LOAD_DOWN_LEFT_EDGE
00171
00172 pred4x4_vertical_left_rv40(src, topright, stride, l0, l1, l2, l3, l4);
00173 }
00174
00175 static void pred4x4_vertical_left_rv40_nodown_c(uint8_t *src, const uint8_t *topright, int stride){
00176 LOAD_LEFT_EDGE
00177
00178 pred4x4_vertical_left_rv40(src, topright, stride, l0, l1, l2, l3, l3);
00179 }
00180
00181 static void pred4x4_vertical_left_vp8_c(uint8_t *src, const uint8_t *topright, int stride){
00182 LOAD_TOP_EDGE
00183 LOAD_TOP_RIGHT_EDGE
00184
00185 src[0+0*stride]=(t0 + t1 + 1)>>1;
00186 src[1+0*stride]=
00187 src[0+2*stride]=(t1 + t2 + 1)>>1;
00188 src[2+0*stride]=
00189 src[1+2*stride]=(t2 + t3 + 1)>>1;
00190 src[3+0*stride]=
00191 src[2+2*stride]=(t3 + t4 + 1)>>1;
00192 src[0+1*stride]=(t0 + 2*t1 + t2 + 2)>>2;
00193 src[1+1*stride]=
00194 src[0+3*stride]=(t1 + 2*t2 + t3 + 2)>>2;
00195 src[2+1*stride]=
00196 src[1+3*stride]=(t2 + 2*t3 + t4 + 2)>>2;
00197 src[3+1*stride]=
00198 src[2+3*stride]=(t3 + 2*t4 + t5 + 2)>>2;
00199 src[3+2*stride]=(t4 + 2*t5 + t6 + 2)>>2;
00200 src[3+3*stride]=(t5 + 2*t6 + t7 + 2)>>2;
00201 }
00202
00203 static void pred4x4_horizontal_up_rv40_c(uint8_t *src, const uint8_t *topright, int stride){
00204 LOAD_LEFT_EDGE
00205 LOAD_DOWN_LEFT_EDGE
00206 LOAD_TOP_EDGE
00207 LOAD_TOP_RIGHT_EDGE
00208
00209 src[0+0*stride]=(t1 + 2*t2 + t3 + 2*l0 + 2*l1 + 4)>>3;
00210 src[1+0*stride]=(t2 + 2*t3 + t4 + l0 + 2*l1 + l2 + 4)>>3;
00211 src[2+0*stride]=
00212 src[0+1*stride]=(t3 + 2*t4 + t5 + 2*l1 + 2*l2 + 4)>>3;
00213 src[3+0*stride]=
00214 src[1+1*stride]=(t4 + 2*t5 + t6 + l1 + 2*l2 + l3 + 4)>>3;
00215 src[2+1*stride]=
00216 src[0+2*stride]=(t5 + 2*t6 + t7 + 2*l2 + 2*l3 + 4)>>3;
00217 src[3+1*stride]=
00218 src[1+2*stride]=(t6 + 3*t7 + l2 + 3*l3 + 4)>>3;
00219 src[3+2*stride]=
00220 src[1+3*stride]=(l3 + 2*l4 + l5 + 2)>>2;
00221 src[0+3*stride]=
00222 src[2+2*stride]=(t6 + t7 + l3 + l4 + 2)>>2;
00223 src[2+3*stride]=(l4 + l5 + 1)>>1;
00224 src[3+3*stride]=(l4 + 2*l5 + l6 + 2)>>2;
00225 }
00226
00227 static void pred4x4_horizontal_up_rv40_nodown_c(uint8_t *src, const uint8_t *topright, int stride){
00228 LOAD_LEFT_EDGE
00229 LOAD_TOP_EDGE
00230 LOAD_TOP_RIGHT_EDGE
00231
00232 src[0+0*stride]=(t1 + 2*t2 + t3 + 2*l0 + 2*l1 + 4)>>3;
00233 src[1+0*stride]=(t2 + 2*t3 + t4 + l0 + 2*l1 + l2 + 4)>>3;
00234 src[2+0*stride]=
00235 src[0+1*stride]=(t3 + 2*t4 + t5 + 2*l1 + 2*l2 + 4)>>3;
00236 src[3+0*stride]=
00237 src[1+1*stride]=(t4 + 2*t5 + t6 + l1 + 2*l2 + l3 + 4)>>3;
00238 src[2+1*stride]=
00239 src[0+2*stride]=(t5 + 2*t6 + t7 + 2*l2 + 2*l3 + 4)>>3;
00240 src[3+1*stride]=
00241 src[1+2*stride]=(t6 + 3*t7 + l2 + 3*l3 + 4)>>3;
00242 src[3+2*stride]=
00243 src[1+3*stride]=l3;
00244 src[0+3*stride]=
00245 src[2+2*stride]=(t6 + t7 + 2*l3 + 2)>>2;
00246 src[2+3*stride]=
00247 src[3+3*stride]=l3;
00248 }
00249
00250 static void pred4x4_tm_vp8_c(uint8_t *src, const uint8_t *topright, int stride){
00251 uint8_t *cm = ff_cropTbl + MAX_NEG_CROP - src[-1-stride];
00252 uint8_t *top = src-stride;
00253 int y;
00254
00255 for (y = 0; y < 4; y++) {
00256 uint8_t *cm_in = cm + src[-1];
00257 src[0] = cm_in[top[0]];
00258 src[1] = cm_in[top[1]];
00259 src[2] = cm_in[top[2]];
00260 src[3] = cm_in[top[3]];
00261 src += stride;
00262 }
00263 }
00264
00265 static void pred16x16_plane_svq3_c(uint8_t *src, int stride){
00266 pred16x16_plane_compat_8_c(src, stride, 1, 0);
00267 }
00268
00269 static void pred16x16_plane_rv40_c(uint8_t *src, int stride){
00270 pred16x16_plane_compat_8_c(src, stride, 0, 1);
00271 }
00272
00273 static void pred16x16_tm_vp8_c(uint8_t *src, int stride){
00274 uint8_t *cm = ff_cropTbl + MAX_NEG_CROP - src[-1-stride];
00275 uint8_t *top = src-stride;
00276 int y;
00277
00278 for (y = 0; y < 16; y++) {
00279 uint8_t *cm_in = cm + src[-1];
00280 src[0] = cm_in[top[0]];
00281 src[1] = cm_in[top[1]];
00282 src[2] = cm_in[top[2]];
00283 src[3] = cm_in[top[3]];
00284 src[4] = cm_in[top[4]];
00285 src[5] = cm_in[top[5]];
00286 src[6] = cm_in[top[6]];
00287 src[7] = cm_in[top[7]];
00288 src[8] = cm_in[top[8]];
00289 src[9] = cm_in[top[9]];
00290 src[10] = cm_in[top[10]];
00291 src[11] = cm_in[top[11]];
00292 src[12] = cm_in[top[12]];
00293 src[13] = cm_in[top[13]];
00294 src[14] = cm_in[top[14]];
00295 src[15] = cm_in[top[15]];
00296 src += stride;
00297 }
00298 }
00299
00300 static void pred8x8_left_dc_rv40_c(uint8_t *src, int stride){
00301 int i;
00302 unsigned dc0;
00303
00304 dc0=0;
00305 for(i=0;i<8; i++)
00306 dc0+= src[-1+i*stride];
00307 dc0= 0x01010101*((dc0 + 4)>>3);
00308
00309 for(i=0; i<8; i++){
00310 ((uint32_t*)(src+i*stride))[0]=
00311 ((uint32_t*)(src+i*stride))[1]= dc0;
00312 }
00313 }
00314
00315 static void pred8x8_top_dc_rv40_c(uint8_t *src, int stride){
00316 int i;
00317 unsigned dc0;
00318
00319 dc0=0;
00320 for(i=0;i<8; i++)
00321 dc0+= src[i-stride];
00322 dc0= 0x01010101*((dc0 + 4)>>3);
00323
00324 for(i=0; i<8; i++){
00325 ((uint32_t*)(src+i*stride))[0]=
00326 ((uint32_t*)(src+i*stride))[1]= dc0;
00327 }
00328 }
00329
00330 static void pred8x8_dc_rv40_c(uint8_t *src, int stride){
00331 int i;
00332 unsigned dc0 = 0;
00333
00334 for(i=0;i<4; i++){
00335 dc0+= src[-1+i*stride] + src[i-stride];
00336 dc0+= src[4+i-stride];
00337 dc0+= src[-1+(i+4)*stride];
00338 }
00339 dc0= 0x01010101*((dc0 + 8)>>4);
00340
00341 for(i=0; i<4; i++){
00342 ((uint32_t*)(src+i*stride))[0]= dc0;
00343 ((uint32_t*)(src+i*stride))[1]= dc0;
00344 }
00345 for(i=4; i<8; i++){
00346 ((uint32_t*)(src+i*stride))[0]= dc0;
00347 ((uint32_t*)(src+i*stride))[1]= dc0;
00348 }
00349 }
00350
00351 static void pred8x8_tm_vp8_c(uint8_t *src, int stride){
00352 uint8_t *cm = ff_cropTbl + MAX_NEG_CROP - src[-1-stride];
00353 uint8_t *top = src-stride;
00354 int y;
00355
00356 for (y = 0; y < 8; y++) {
00357 uint8_t *cm_in = cm + src[-1];
00358 src[0] = cm_in[top[0]];
00359 src[1] = cm_in[top[1]];
00360 src[2] = cm_in[top[2]];
00361 src[3] = cm_in[top[3]];
00362 src[4] = cm_in[top[4]];
00363 src[5] = cm_in[top[5]];
00364 src[6] = cm_in[top[6]];
00365 src[7] = cm_in[top[7]];
00366 src += stride;
00367 }
00368 }
00369
00373 void ff_h264_pred_init(H264PredContext *h, int codec_id, const int bit_depth, const int chroma_format_idc){
00374
00375
00376 #undef FUNC
00377 #undef FUNCC
00378 #define FUNC(a, depth) a ## _ ## depth
00379 #define FUNCC(a, depth) a ## _ ## depth ## _c
00380 #define FUNCD(a) a ## _c
00381
00382 #define H264_PRED(depth) \
00383 if(codec_id != AV_CODEC_ID_RV40){\
00384 if(codec_id == AV_CODEC_ID_VP8) {\
00385 h->pred4x4[VERT_PRED ]= FUNCD(pred4x4_vertical_vp8);\
00386 h->pred4x4[HOR_PRED ]= FUNCD(pred4x4_horizontal_vp8);\
00387 } else {\
00388 h->pred4x4[VERT_PRED ]= FUNCC(pred4x4_vertical , depth);\
00389 h->pred4x4[HOR_PRED ]= FUNCC(pred4x4_horizontal , depth);\
00390 }\
00391 h->pred4x4[DC_PRED ]= FUNCC(pred4x4_dc , depth);\
00392 if(codec_id == AV_CODEC_ID_SVQ3)\
00393 h->pred4x4[DIAG_DOWN_LEFT_PRED ]= FUNCD(pred4x4_down_left_svq3);\
00394 else\
00395 h->pred4x4[DIAG_DOWN_LEFT_PRED ]= FUNCC(pred4x4_down_left , depth);\
00396 h->pred4x4[DIAG_DOWN_RIGHT_PRED]= FUNCC(pred4x4_down_right , depth);\
00397 h->pred4x4[VERT_RIGHT_PRED ]= FUNCC(pred4x4_vertical_right , depth);\
00398 h->pred4x4[HOR_DOWN_PRED ]= FUNCC(pred4x4_horizontal_down , depth);\
00399 if (codec_id == AV_CODEC_ID_VP8) {\
00400 h->pred4x4[VERT_LEFT_PRED ]= FUNCD(pred4x4_vertical_left_vp8);\
00401 } else\
00402 h->pred4x4[VERT_LEFT_PRED ]= FUNCC(pred4x4_vertical_left , depth);\
00403 h->pred4x4[HOR_UP_PRED ]= FUNCC(pred4x4_horizontal_up , depth);\
00404 if(codec_id != AV_CODEC_ID_VP8) {\
00405 h->pred4x4[LEFT_DC_PRED ]= FUNCC(pred4x4_left_dc , depth);\
00406 h->pred4x4[TOP_DC_PRED ]= FUNCC(pred4x4_top_dc , depth);\
00407 h->pred4x4[DC_128_PRED ]= FUNCC(pred4x4_128_dc , depth);\
00408 } else {\
00409 h->pred4x4[TM_VP8_PRED ]= FUNCD(pred4x4_tm_vp8);\
00410 h->pred4x4[DC_127_PRED ]= FUNCC(pred4x4_127_dc , depth);\
00411 h->pred4x4[DC_129_PRED ]= FUNCC(pred4x4_129_dc , depth);\
00412 h->pred4x4[VERT_VP8_PRED ]= FUNCC(pred4x4_vertical , depth);\
00413 h->pred4x4[HOR_VP8_PRED ]= FUNCC(pred4x4_horizontal , depth);\
00414 }\
00415 }else{\
00416 h->pred4x4[VERT_PRED ]= FUNCC(pred4x4_vertical , depth);\
00417 h->pred4x4[HOR_PRED ]= FUNCC(pred4x4_horizontal , depth);\
00418 h->pred4x4[DC_PRED ]= FUNCC(pred4x4_dc , depth);\
00419 h->pred4x4[DIAG_DOWN_LEFT_PRED ]= FUNCD(pred4x4_down_left_rv40);\
00420 h->pred4x4[DIAG_DOWN_RIGHT_PRED]= FUNCC(pred4x4_down_right , depth);\
00421 h->pred4x4[VERT_RIGHT_PRED ]= FUNCC(pred4x4_vertical_right , depth);\
00422 h->pred4x4[HOR_DOWN_PRED ]= FUNCC(pred4x4_horizontal_down , depth);\
00423 h->pred4x4[VERT_LEFT_PRED ]= FUNCD(pred4x4_vertical_left_rv40);\
00424 h->pred4x4[HOR_UP_PRED ]= FUNCD(pred4x4_horizontal_up_rv40);\
00425 h->pred4x4[LEFT_DC_PRED ]= FUNCC(pred4x4_left_dc , depth);\
00426 h->pred4x4[TOP_DC_PRED ]= FUNCC(pred4x4_top_dc , depth);\
00427 h->pred4x4[DC_128_PRED ]= FUNCC(pred4x4_128_dc , depth);\
00428 h->pred4x4[DIAG_DOWN_LEFT_PRED_RV40_NODOWN]= FUNCD(pred4x4_down_left_rv40_nodown);\
00429 h->pred4x4[HOR_UP_PRED_RV40_NODOWN]= FUNCD(pred4x4_horizontal_up_rv40_nodown);\
00430 h->pred4x4[VERT_LEFT_PRED_RV40_NODOWN]= FUNCD(pred4x4_vertical_left_rv40_nodown);\
00431 }\
00432 \
00433 h->pred8x8l[VERT_PRED ]= FUNCC(pred8x8l_vertical , depth);\
00434 h->pred8x8l[HOR_PRED ]= FUNCC(pred8x8l_horizontal , depth);\
00435 h->pred8x8l[DC_PRED ]= FUNCC(pred8x8l_dc , depth);\
00436 h->pred8x8l[DIAG_DOWN_LEFT_PRED ]= FUNCC(pred8x8l_down_left , depth);\
00437 h->pred8x8l[DIAG_DOWN_RIGHT_PRED]= FUNCC(pred8x8l_down_right , depth);\
00438 h->pred8x8l[VERT_RIGHT_PRED ]= FUNCC(pred8x8l_vertical_right , depth);\
00439 h->pred8x8l[HOR_DOWN_PRED ]= FUNCC(pred8x8l_horizontal_down , depth);\
00440 h->pred8x8l[VERT_LEFT_PRED ]= FUNCC(pred8x8l_vertical_left , depth);\
00441 h->pred8x8l[HOR_UP_PRED ]= FUNCC(pred8x8l_horizontal_up , depth);\
00442 h->pred8x8l[LEFT_DC_PRED ]= FUNCC(pred8x8l_left_dc , depth);\
00443 h->pred8x8l[TOP_DC_PRED ]= FUNCC(pred8x8l_top_dc , depth);\
00444 h->pred8x8l[DC_128_PRED ]= FUNCC(pred8x8l_128_dc , depth);\
00445 \
00446 if (chroma_format_idc == 1) {\
00447 h->pred8x8[VERT_PRED8x8 ]= FUNCC(pred8x8_vertical , depth);\
00448 h->pred8x8[HOR_PRED8x8 ]= FUNCC(pred8x8_horizontal , depth);\
00449 } else {\
00450 h->pred8x8[VERT_PRED8x8 ]= FUNCC(pred8x16_vertical , depth);\
00451 h->pred8x8[HOR_PRED8x8 ]= FUNCC(pred8x16_horizontal , depth);\
00452 }\
00453 if (codec_id != AV_CODEC_ID_VP8) {\
00454 if (chroma_format_idc == 1) {\
00455 h->pred8x8[PLANE_PRED8x8]= FUNCC(pred8x8_plane , depth);\
00456 } else {\
00457 h->pred8x8[PLANE_PRED8x8]= FUNCC(pred8x16_plane , depth);\
00458 }\
00459 } else\
00460 h->pred8x8[PLANE_PRED8x8]= FUNCD(pred8x8_tm_vp8);\
00461 if(codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP8){\
00462 if (chroma_format_idc == 1) {\
00463 h->pred8x8[DC_PRED8x8 ]= FUNCC(pred8x8_dc , depth);\
00464 h->pred8x8[LEFT_DC_PRED8x8]= FUNCC(pred8x8_left_dc , depth);\
00465 h->pred8x8[TOP_DC_PRED8x8 ]= FUNCC(pred8x8_top_dc , depth);\
00466 h->pred8x8[ALZHEIMER_DC_L0T_PRED8x8 ]= FUNC(pred8x8_mad_cow_dc_l0t, depth);\
00467 h->pred8x8[ALZHEIMER_DC_0LT_PRED8x8 ]= FUNC(pred8x8_mad_cow_dc_0lt, depth);\
00468 h->pred8x8[ALZHEIMER_DC_L00_PRED8x8 ]= FUNC(pred8x8_mad_cow_dc_l00, depth);\
00469 h->pred8x8[ALZHEIMER_DC_0L0_PRED8x8 ]= FUNC(pred8x8_mad_cow_dc_0l0, depth);\
00470 } else {\
00471 h->pred8x8[DC_PRED8x8 ]= FUNCC(pred8x16_dc , depth);\
00472 h->pred8x8[LEFT_DC_PRED8x8]= FUNCC(pred8x16_left_dc , depth);\
00473 h->pred8x8[TOP_DC_PRED8x8 ]= FUNCC(pred8x16_top_dc , depth);\
00474 h->pred8x8[ALZHEIMER_DC_L0T_PRED8x8 ]= FUNC(pred8x16_mad_cow_dc_l0t, depth);\
00475 h->pred8x8[ALZHEIMER_DC_0LT_PRED8x8 ]= FUNC(pred8x16_mad_cow_dc_0lt, depth);\
00476 h->pred8x8[ALZHEIMER_DC_L00_PRED8x8 ]= FUNC(pred8x16_mad_cow_dc_l00, depth);\
00477 h->pred8x8[ALZHEIMER_DC_0L0_PRED8x8 ]= FUNC(pred8x16_mad_cow_dc_0l0, depth);\
00478 }\
00479 }else{\
00480 h->pred8x8[DC_PRED8x8 ]= FUNCD(pred8x8_dc_rv40);\
00481 h->pred8x8[LEFT_DC_PRED8x8]= FUNCD(pred8x8_left_dc_rv40);\
00482 h->pred8x8[TOP_DC_PRED8x8 ]= FUNCD(pred8x8_top_dc_rv40);\
00483 if (codec_id == AV_CODEC_ID_VP8) {\
00484 h->pred8x8[DC_127_PRED8x8]= FUNCC(pred8x8_127_dc , depth);\
00485 h->pred8x8[DC_129_PRED8x8]= FUNCC(pred8x8_129_dc , depth);\
00486 }\
00487 }\
00488 if (chroma_format_idc == 1) {\
00489 h->pred8x8[DC_128_PRED8x8 ]= FUNCC(pred8x8_128_dc , depth);\
00490 } else {\
00491 h->pred8x8[DC_128_PRED8x8 ]= FUNCC(pred8x16_128_dc , depth);\
00492 }\
00493 \
00494 h->pred16x16[DC_PRED8x8 ]= FUNCC(pred16x16_dc , depth);\
00495 h->pred16x16[VERT_PRED8x8 ]= FUNCC(pred16x16_vertical , depth);\
00496 h->pred16x16[HOR_PRED8x8 ]= FUNCC(pred16x16_horizontal , depth);\
00497 switch(codec_id){\
00498 case AV_CODEC_ID_SVQ3:\
00499 h->pred16x16[PLANE_PRED8x8 ]= FUNCD(pred16x16_plane_svq3);\
00500 break;\
00501 case AV_CODEC_ID_RV40:\
00502 h->pred16x16[PLANE_PRED8x8 ]= FUNCD(pred16x16_plane_rv40);\
00503 break;\
00504 case AV_CODEC_ID_VP8:\
00505 h->pred16x16[PLANE_PRED8x8 ]= FUNCD(pred16x16_tm_vp8);\
00506 h->pred16x16[DC_127_PRED8x8]= FUNCC(pred16x16_127_dc , depth);\
00507 h->pred16x16[DC_129_PRED8x8]= FUNCC(pred16x16_129_dc , depth);\
00508 break;\
00509 default:\
00510 h->pred16x16[PLANE_PRED8x8 ]= FUNCC(pred16x16_plane , depth);\
00511 break;\
00512 }\
00513 h->pred16x16[LEFT_DC_PRED8x8]= FUNCC(pred16x16_left_dc , depth);\
00514 h->pred16x16[TOP_DC_PRED8x8 ]= FUNCC(pred16x16_top_dc , depth);\
00515 h->pred16x16[DC_128_PRED8x8 ]= FUNCC(pred16x16_128_dc , depth);\
00516 \
00517 \
00518 h->pred4x4_add [VERT_PRED ]= FUNCC(pred4x4_vertical_add , depth);\
00519 h->pred4x4_add [ HOR_PRED ]= FUNCC(pred4x4_horizontal_add , depth);\
00520 h->pred8x8l_add [VERT_PRED ]= FUNCC(pred8x8l_vertical_add , depth);\
00521 h->pred8x8l_add [ HOR_PRED ]= FUNCC(pred8x8l_horizontal_add , depth);\
00522 if (chroma_format_idc == 1) {\
00523 h->pred8x8_add [VERT_PRED8x8]= FUNCC(pred8x8_vertical_add , depth);\
00524 h->pred8x8_add [ HOR_PRED8x8]= FUNCC(pred8x8_horizontal_add , depth);\
00525 } else {\
00526 h->pred8x8_add [VERT_PRED8x8]= FUNCC(pred8x16_vertical_add , depth);\
00527 h->pred8x8_add [ HOR_PRED8x8]= FUNCC(pred8x16_horizontal_add , depth);\
00528 }\
00529 h->pred16x16_add[VERT_PRED8x8]= FUNCC(pred16x16_vertical_add , depth);\
00530 h->pred16x16_add[ HOR_PRED8x8]= FUNCC(pred16x16_horizontal_add , depth);\
00531
00532 switch (bit_depth) {
00533 case 9:
00534 H264_PRED(9)
00535 break;
00536 case 10:
00537 H264_PRED(10)
00538 break;
00539 case 12:
00540 H264_PRED(12)
00541 break;
00542 case 14:
00543 H264_PRED(14)
00544 break;
00545 default:
00546 av_assert0(bit_depth<=8);
00547 H264_PRED(8)
00548 break;
00549 }
00550
00551 if (ARCH_ARM) ff_h264_pred_init_arm(h, codec_id, bit_depth, chroma_format_idc);
00552 if (HAVE_MMX) ff_h264_pred_init_x86(h, codec_id, bit_depth, chroma_format_idc);
00553 }