Revision 8dbe5856 libavcodec/dsputil_internal.h

View differences:

libavcodec/dsputil_internal.h
27 27
 * DSP utils
28 28
 */
29 29

  
30
#include "dsputil.h"
30
#include "h264_high_depth.h"
31 31

  
32
#define BIT_DEPTH 8
32
static inline void FUNC(copy_block2)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
33
{
34
    int i;
35
    for(i=0; i<h; i++)
36
    {
37
        AV_WN2P(dst   , AV_RN2P(src   ));
38
        dst+=dstStride;
39
        src+=srcStride;
40
    }
41
}
33 42

  
34
#define pixel  uint8_t
35
#define pixel2 uint16_t
36
#define pixel4 uint32_t
37
#define dctcoef int16_t
43
static inline void FUNC(copy_block4)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
44
{
45
    int i;
46
    for(i=0; i<h; i++)
47
    {
48
        AV_WN4P(dst   , AV_RN4P(src   ));
49
        dst+=dstStride;
50
        src+=srcStride;
51
    }
52
}
38 53

  
39
#define FUNC(a)  a
40
#define FUNCC(a) a ## _c
41
#define INIT_CLIP uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
42
#define CLIP(a) cm[a]
43
#define AV_RN2P AV_RN16
44
#define AV_RN4P AV_RN32
45
#define PIXEL_MAX ((1<<BIT_DEPTH)-1)
54
static inline void FUNC(copy_block8)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
55
{
56
    int i;
57
    for(i=0; i<h; i++)
58
    {
59
        AV_WN4P(dst                , AV_RN4P(src                ));
60
        AV_WN4P(dst+4*sizeof(pixel), AV_RN4P(src+4*sizeof(pixel)));
61
        dst+=dstStride;
62
        src+=srcStride;
63
    }
64
}
46 65

  
47
#define no_rnd_avg_pixel4 no_rnd_avg32
48
#define    rnd_avg_pixel4    rnd_avg32
66
static inline void FUNC(copy_block16)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
67
{
68
    int i;
69
    for(i=0; i<h; i++)
70
    {
71
        AV_WN4P(dst                 , AV_RN4P(src                 ));
72
        AV_WN4P(dst+ 4*sizeof(pixel), AV_RN4P(src+ 4*sizeof(pixel)));
73
        AV_WN4P(dst+ 8*sizeof(pixel), AV_RN4P(src+ 8*sizeof(pixel)));
74
        AV_WN4P(dst+12*sizeof(pixel), AV_RN4P(src+12*sizeof(pixel)));
75
        dst+=dstStride;
76
        src+=srcStride;
77
    }
78
}
49 79

  
50 80
/* draw the edges of width 'w' of an image of size width, height */
51 81
//FIXME check that this is ok for mpeg4 interlaced
......
1319 1349
#undef op2_put
1320 1350
#endif
1321 1351

  
1322
#define put_h264_qpel8_mc00_c  ff_put_pixels8x8_c
1323
#define avg_h264_qpel8_mc00_c  ff_avg_pixels8x8_c
1324
#define put_h264_qpel16_mc00_c ff_put_pixels16x16_c
1325
#define avg_h264_qpel16_mc00_c ff_avg_pixels16x16_c
1352
#if BIT_DEPTH == 8
1353
#   define put_h264_qpel8_mc00_8_c  ff_put_pixels8x8_8_c
1354
#   define avg_h264_qpel8_mc00_8_c  ff_avg_pixels8x8_8_c
1355
#   define put_h264_qpel16_mc00_8_c ff_put_pixels16x16_8_c
1356
#   define avg_h264_qpel16_mc00_8_c ff_avg_pixels16x16_8_c
1357
#elif BIT_DEPTH == 9
1358
#   define put_h264_qpel8_mc00_9_c  ff_put_pixels8x8_9_c
1359
#   define avg_h264_qpel8_mc00_9_c  ff_avg_pixels8x8_9_c
1360
#   define put_h264_qpel16_mc00_9_c ff_put_pixels16x16_9_c
1361
#   define avg_h264_qpel16_mc00_9_c ff_avg_pixels16x16_9_c
1362
#elif BIT_DEPTH == 10
1363
#   define put_h264_qpel8_mc00_10_c  ff_put_pixels8x8_10_c
1364
#   define avg_h264_qpel8_mc00_10_c  ff_avg_pixels8x8_10_c
1365
#   define put_h264_qpel16_mc00_10_c ff_put_pixels16x16_10_c
1366
#   define avg_h264_qpel16_mc00_10_c ff_avg_pixels16x16_10_c
1367
#endif
1326 1368

  
1327 1369
void FUNCC(ff_put_pixels8x8)(uint8_t *dst, uint8_t *src, int stride) {
1328 1370
    FUNCC(put_pixels8)(dst, src, stride, 8);

Also available in: Unified diff