Revision caaf098c

View differences:

libavcodec/h264pred.c
29 29
#include "mpegvideo.h"
30 30
#include "h264pred.h"
31 31

  
32
static void pred4x4_vertical_c(uint8_t *src, uint8_t *topright, int stride){
32
static void pred4x4_vertical_c(uint8_t *src, const uint8_t *topright, int stride){
33 33
    const uint32_t a= ((uint32_t*)(src-stride))[0];
34 34
    ((uint32_t*)(src+0*stride))[0]= a;
35 35
    ((uint32_t*)(src+1*stride))[0]= a;
......
37 37
    ((uint32_t*)(src+3*stride))[0]= a;
38 38
}
39 39

  
40
static void pred4x4_horizontal_c(uint8_t *src, uint8_t *topright, int stride){
40
static void pred4x4_horizontal_c(uint8_t *src, const uint8_t *topright, int stride){
41 41
    ((uint32_t*)(src+0*stride))[0]= src[-1+0*stride]*0x01010101;
42 42
    ((uint32_t*)(src+1*stride))[0]= src[-1+1*stride]*0x01010101;
43 43
    ((uint32_t*)(src+2*stride))[0]= src[-1+2*stride]*0x01010101;
44 44
    ((uint32_t*)(src+3*stride))[0]= src[-1+3*stride]*0x01010101;
45 45
}
46 46

  
47
static void pred4x4_dc_c(uint8_t *src, uint8_t *topright, int stride){
47
static void pred4x4_dc_c(uint8_t *src, const uint8_t *topright, int stride){
48 48
    const int dc= (  src[-stride] + src[1-stride] + src[2-stride] + src[3-stride]
49 49
                   + src[-1+0*stride] + src[-1+1*stride] + src[-1+2*stride] + src[-1+3*stride] + 4) >>3;
50 50

  
......
54 54
    ((uint32_t*)(src+3*stride))[0]= dc* 0x01010101;
55 55
}
56 56

  
57
static void pred4x4_left_dc_c(uint8_t *src, uint8_t *topright, int stride){
57
static void pred4x4_left_dc_c(uint8_t *src, const uint8_t *topright, int stride){
58 58
    const int dc= (  src[-1+0*stride] + src[-1+1*stride] + src[-1+2*stride] + src[-1+3*stride] + 2) >>2;
59 59

  
60 60
    ((uint32_t*)(src+0*stride))[0]=
......
63 63
    ((uint32_t*)(src+3*stride))[0]= dc* 0x01010101;
64 64
}
65 65

  
66
static void pred4x4_top_dc_c(uint8_t *src, uint8_t *topright, int stride){
66
static void pred4x4_top_dc_c(uint8_t *src, const uint8_t *topright, int stride){
67 67
    const int dc= (  src[-stride] + src[1-stride] + src[2-stride] + src[3-stride] + 2) >>2;
68 68

  
69 69
    ((uint32_t*)(src+0*stride))[0]=
......
72 72
    ((uint32_t*)(src+3*stride))[0]= dc* 0x01010101;
73 73
}
74 74

  
75
static void pred4x4_128_dc_c(uint8_t *src, uint8_t *topright, int stride){
75
static void pred4x4_128_dc_c(uint8_t *src, const uint8_t *topright, int stride){
76 76
    ((uint32_t*)(src+0*stride))[0]=
77 77
    ((uint32_t*)(src+1*stride))[0]=
78 78
    ((uint32_t*)(src+2*stride))[0]=
......
104 104
    const int av_unused t2= src[ 2-1*stride];\
105 105
    const int av_unused t3= src[ 3-1*stride];\
106 106

  
107
static void pred4x4_down_right_c(uint8_t *src, uint8_t *topright, int stride){
107
static void pred4x4_down_right_c(uint8_t *src, const uint8_t *topright, int stride){
108 108
    const int lt= src[-1-1*stride];
109 109
    LOAD_TOP_EDGE
110 110
    LOAD_LEFT_EDGE
......
127 127
    src[3+0*stride]=(t1 + 2*t2 + t3 + 2)>>2;
128 128
}
129 129

  
130
static void pred4x4_down_left_c(uint8_t *src, uint8_t *topright, int stride){
130
static void pred4x4_down_left_c(uint8_t *src, const uint8_t *topright, int stride){
131 131
    LOAD_TOP_EDGE
132 132
    LOAD_TOP_RIGHT_EDGE
133 133
//    LOAD_LEFT_EDGE
......
150 150
    src[3+3*stride]=(t6 + 3*t7 + 2)>>2;
151 151
}
152 152

  
153
static void pred4x4_down_left_svq3_c(uint8_t *src, uint8_t *topright, int stride){
153
static void pred4x4_down_left_svq3_c(uint8_t *src, const uint8_t *topright, int stride){
154 154
    LOAD_TOP_EDGE
155 155
    LOAD_LEFT_EDGE
156 156
    const av_unused int unu0= t0;
......
174 174
    src[3+3*stride]=(l3 + t3)>>1;
175 175
}
176 176

  
177
static void pred4x4_down_left_rv40_c(uint8_t *src, uint8_t *topright, int stride){
177
static void pred4x4_down_left_rv40_c(uint8_t *src, const uint8_t *topright, int stride){
178 178
    LOAD_TOP_EDGE
179 179
    LOAD_TOP_RIGHT_EDGE
180 180
    LOAD_LEFT_EDGE
......
198 198
    src[3+3*stride]=(t6 + t7 + 1 + l6 + l7 + 1)>>2;
199 199
}
200 200

  
201
static void pred4x4_down_left_rv40_nodown_c(uint8_t *src, uint8_t *topright, int stride){
201
static void pred4x4_down_left_rv40_nodown_c(uint8_t *src, const uint8_t *topright, int stride){
202 202
    LOAD_TOP_EDGE
203 203
    LOAD_TOP_RIGHT_EDGE
204 204
    LOAD_LEFT_EDGE
......
221 221
    src[3+3*stride]=(t6 + t7 + 1 + 2*l3 + 1)>>2;
222 222
}
223 223

  
224
static void pred4x4_vertical_right_c(uint8_t *src, uint8_t *topright, int stride){
224
static void pred4x4_vertical_right_c(uint8_t *src, const uint8_t *topright, int stride){
225 225
    const int lt= src[-1-1*stride];
226 226
    LOAD_TOP_EDGE
227 227
    LOAD_LEFT_EDGE
......
244 244
    src[0+3*stride]=(l0 + 2*l1 + l2 + 2)>>2;
245 245
}
246 246

  
247
static void pred4x4_vertical_left_c(uint8_t *src, uint8_t *topright, int stride){
247
static void pred4x4_vertical_left_c(uint8_t *src, const uint8_t *topright, int stride){
248 248
    LOAD_TOP_EDGE
249 249
    LOAD_TOP_RIGHT_EDGE
250 250

  
......
266 266
    src[3+3*stride]=(t4 + 2*t5 + t6 + 2)>>2;
267 267
}
268 268

  
269
static void pred4x4_vertical_left_rv40(uint8_t *src, uint8_t *topright, int stride,
269
static void pred4x4_vertical_left_rv40(uint8_t *src, const uint8_t *topright, int stride,
270 270
                                      const int l0, const int l1, const int l2, const int l3, const int l4){
271 271
    LOAD_TOP_EDGE
272 272
    LOAD_TOP_RIGHT_EDGE
......
289 289
    src[3+3*stride]=(t4 + 2*t5 + t6 + 2)>>2;
290 290
}
291 291

  
292
static void pred4x4_vertical_left_rv40_c(uint8_t *src, uint8_t *topright, int stride){
292
static void pred4x4_vertical_left_rv40_c(uint8_t *src, const uint8_t *topright, int stride){
293 293
    LOAD_LEFT_EDGE
294 294
    LOAD_DOWN_LEFT_EDGE
295 295

  
296 296
    pred4x4_vertical_left_rv40(src, topright, stride, l0, l1, l2, l3, l4);
297 297
}
298 298

  
299
static void pred4x4_vertical_left_rv40_nodown_c(uint8_t *src, uint8_t *topright, int stride){
299
static void pred4x4_vertical_left_rv40_nodown_c(uint8_t *src, const uint8_t *topright, int stride){
300 300
    LOAD_LEFT_EDGE
301 301

  
302 302
    pred4x4_vertical_left_rv40(src, topright, stride, l0, l1, l2, l3, l3);
303 303
}
304 304

  
305
static void pred4x4_horizontal_up_c(uint8_t *src, uint8_t *topright, int stride){
305
static void pred4x4_horizontal_up_c(uint8_t *src, const uint8_t *topright, int stride){
306 306
    LOAD_LEFT_EDGE
307 307

  
308 308
    src[0+0*stride]=(l0 + l1 + 1)>>1;
......
323 323
    src[3+3*stride]=l3;
324 324
}
325 325

  
326
static void pred4x4_horizontal_up_rv40_c(uint8_t *src, uint8_t *topright, int stride){
326
static void pred4x4_horizontal_up_rv40_c(uint8_t *src, const uint8_t *topright, int stride){
327 327
    LOAD_LEFT_EDGE
328 328
    LOAD_DOWN_LEFT_EDGE
329 329
    LOAD_TOP_EDGE
......
347 347
    src[3+3*stride]=(l4 + 2*l5 + l6 + 2)>>2;
348 348
}
349 349

  
350
static void pred4x4_horizontal_up_rv40_nodown_c(uint8_t *src, uint8_t *topright, int stride){
350
static void pred4x4_horizontal_up_rv40_nodown_c(uint8_t *src, const uint8_t *topright, int stride){
351 351
    LOAD_LEFT_EDGE
352 352
    LOAD_TOP_EDGE
353 353
    LOAD_TOP_RIGHT_EDGE
......
370 370
    src[3+3*stride]=l3;
371 371
}
372 372

  
373
static void pred4x4_horizontal_down_c(uint8_t *src, uint8_t *topright, int stride){
373
static void pred4x4_horizontal_down_c(uint8_t *src, const uint8_t *topright, int stride){
374 374
    const int lt= src[-1-1*stride];
375 375
    LOAD_TOP_EDGE
376 376
    LOAD_LEFT_EDGE
libavcodec/h264pred.h
72 72
 * Context for storing H.264 prediction functions
73 73
 */
74 74
typedef struct H264PredContext{
75
    void (*pred4x4  [9+3+3])(uint8_t *src, uint8_t *topright, int stride);//FIXME move to dsp?
75
    void (*pred4x4  [9+3+3])(uint8_t *src, const uint8_t *topright, int stride);//FIXME move to dsp?
76 76
    void (*pred8x8l [9+3])(uint8_t *src, int topleft, int topright, int stride);
77 77
    void (*pred8x8  [4+3+4])(uint8_t *src, int stride);
78 78
    void (*pred16x16[4+3])(uint8_t *src, int stride);

Also available in: Unified diff