25 #define pw_1 (ULONG_MAX / UINT16_MAX) 29 #if !HAVE_FAST_UNALIGNED 30 if((
long)src2 & (
sizeof(
long)-1)){
31 for(i=0; i+3<
w; i+=4){
32 dst[i+0] = (src1[i+0]-src2[i+0]) & mask;
33 dst[i+1] = (src1[i+1]-src2[i+1]) & mask;
34 dst[i+2] = (src1[i+2]-src2[i+2]) & mask;
35 dst[i+3] = (src1[i+3]-src2[i+3]) & mask;
40 unsigned long pw_lsb = (mask >> 1) *
pw_1;
41 unsigned long pw_msb = pw_lsb +
pw_1;
43 for (i = 0; i <= w - (
int)
sizeof(
long)/2; i +=
sizeof(long)/2) {
44 long a = *(
long*)(src1+i);
45 long b = *(
long*)(src2+i);
46 *(
long*)(dst+i) = ((a|pw_msb) - (b&pw_lsb)) ^ ((a^b^pw_msb)&pw_msb);
50 dst[i] = (src1[i] - src2[i]) &
mask;
61 const int pred =
mid_pred(l, src1[i], (l + src1[i] - lt) & mask);
64 dst[i] = (l -
pred) & mask;
void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, AVCodecContext *avctx)
Macro definitions for various function/variable attributes.
av_cold void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, AVCodecContext *avctx)
void(* sub_hfyu_median_pred_int16)(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w, int *left, int *left_top)
static const uint16_t mask[17]
void(* diff_int16)(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w)
static const float pred[4]
main external API structure.
static void diff_int16_c(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w)
static void sub_hfyu_median_pred_int16_c(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w, int *left, int *left_top)