00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "dsputil.h"
00020
00021 #ifndef BIT_DEPTH
00022 #define BIT_DEPTH 8
00023 #endif
00024
00025 #ifdef AVCODEC_H264_HIGH_DEPTH_H
00026 # undef pixel
00027 # undef pixel2
00028 # undef pixel4
00029 # undef dctcoef
00030 # undef INIT_CLIP
00031 # undef no_rnd_avg_pixel4
00032 # undef rnd_avg_pixel4
00033 # undef AV_RN2P
00034 # undef AV_RN4P
00035 # undef AV_RN4PA
00036 # undef AV_WN2P
00037 # undef AV_WN4P
00038 # undef AV_WN4PA
00039 # undef CLIP
00040 # undef FUNC
00041 # undef FUNCC
00042 # undef av_clip_pixel
00043 # undef PIXEL_SPLAT_X4
00044 #else
00045 # define AVCODEC_H264_HIGH_DEPTH_H
00046 #endif
00047
00048 #if BIT_DEPTH > 8
00049 # define pixel uint16_t
00050 # define pixel2 uint32_t
00051 # define pixel4 uint64_t
00052 # define dctcoef int32_t
00053
00054 # define INIT_CLIP
00055 # define no_rnd_avg_pixel4 no_rnd_avg64
00056 # define rnd_avg_pixel4 rnd_avg64
00057 # define AV_RN2P AV_RN32
00058 # define AV_RN4P AV_RN64
00059 # define AV_RN4PA AV_RN64A
00060 # define AV_WN2P AV_WN32
00061 # define AV_WN4P AV_WN64
00062 # define AV_WN4PA AV_WN64A
00063 # define PIXEL_SPLAT_X4(x) ((x)*0x0001000100010001ULL)
00064
00065 # define av_clip_pixel(a) av_clip_uintp2(a, BIT_DEPTH)
00066 # define CLIP(a) av_clip_uintp2(a, BIT_DEPTH)
00067 #else
00068 # define pixel uint8_t
00069 # define pixel2 uint16_t
00070 # define pixel4 uint32_t
00071 # define dctcoef int16_t
00072
00073 # define INIT_CLIP
00074 # define no_rnd_avg_pixel4 no_rnd_avg32
00075 # define rnd_avg_pixel4 rnd_avg32
00076 # define AV_RN2P AV_RN16
00077 # define AV_RN4P AV_RN32
00078 # define AV_RN4PA AV_RN32A
00079 # define AV_WN2P AV_WN16
00080 # define AV_WN4P AV_WN32
00081 # define AV_WN4PA AV_WN32A
00082 # define PIXEL_SPLAT_X4(x) ((x)*0x01010101U)
00083
00084 # define av_clip_pixel(a) av_clip_uint8(a)
00085 # define CLIP(a) av_clip_uint8(a)
00086 #endif
00087
00088 #define FUNC3(a, b, c) a ## _ ## b ## c
00089 #define FUNC2(a, b, c) FUNC3(a, b, c)
00090 #define FUNC(a) FUNC2(a, BIT_DEPTH,)
00091 #define FUNCC(a) FUNC2(a, BIT_DEPTH, _c)