📄 motion_comp.c
字号:
dest[1] = (((ref[1] + ref[1 + 1] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[2] + ref[2 + 1] + 1) >> 1)); x++; dest[2] = (((ref[2] + ref[2 + 1] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[3] + ref[3 + 1] + 1) >> 1)); x++; dest[3] = (((ref[3] + ref[3 + 1] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[4] + ref[4 + 1] + 1) >> 1)); x++; dest[4] = (((ref[4] + ref[4 + 1] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[5] + ref[5 + 1] + 1) >> 1)); x++; dest[5] = (((ref[5] + ref[5 + 1] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[6] + ref[6 + 1] + 1) >> 1)); x++; dest[6] = (((ref[6] + ref[6 + 1] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[7] + ref[7 + 1] + 1) >> 1)); x++; dest[7] = (((ref[7] + ref[7 + 1] + 1) >> 1)); x = 0; y+=8; LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[8] + ref[8 + 1] + 1) >> 1)); x++; dest[8] = (((ref[8] + ref[8 + 1] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[9] + ref[9 + 1] + 1) >> 1)); x++; dest[9] = (((ref[9] + ref[9 + 1] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[10] + ref[10 + 1] + 1) >> 1)); x++; dest[10] = (((ref[10] + ref[10 + 1] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[11] + ref[11 + 1] + 1) >> 1)); x++; dest[11] = (((ref[11] + ref[11 + 1] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[12] + ref[12 + 1] + 1) >> 1)); x++; dest[12] = (((ref[12] + ref[12 + 1] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[13] + ref[13 + 1] + 1) >> 1)); x++; dest[13] = (((ref[13] + ref[13 + 1] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[14] + ref[14 + 1] + 1) >> 1)); x++; dest[14] = (((ref[14] + ref[14 + 1] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[15] + ref[15 + 1] + 1) >> 1)); x++; dest[15] = (((ref[15] + ref[15 + 1] + 1) >> 1)); x = 0; y = 0; z+=1; z = (z == 8) ? 16 : z; ref += stride; dest += stride; } while (--height);}static voidMC_put_x_8_c (uint8_t * dest, const uint8_t * ref, const int stride, int height){ int x; x = 0; do { ChromaData[ChromaOffset + x++] = dest[0] = (((ref[0] + ref[0 + 1] + 1) >> 1)); ChromaData[ChromaOffset + x++] = dest[1] = (((ref[1] + ref[1 + 1] + 1) >> 1)); ChromaData[ChromaOffset + x++] = dest[2] = (((ref[2] + ref[2 + 1] + 1) >> 1)); ChromaData[ChromaOffset + x++] = dest[3] = (((ref[3] + ref[3 + 1] + 1) >> 1)); ChromaData[ChromaOffset + x++] = dest[4] = (((ref[4] + ref[4 + 1] + 1) >> 1)); ChromaData[ChromaOffset + x++] = dest[5] = (((ref[5] + ref[5 + 1] + 1) >> 1)); ChromaData[ChromaOffset + x++] = dest[6] = (((ref[6] + ref[6 + 1] + 1) >> 1)); ChromaData[ChromaOffset + x++] = dest[7] = (((ref[7] + ref[7 + 1] + 1) >> 1)); ref += stride; dest += stride; } while (--height);}static voidMC_avg_x_16_c (uint8_t * dest, const uint8_t * ref, const int stride, int height){ int x,y,z; x = y = z = 0; do { LumaData[LumaOffset + x + y * 8 + z * 8] = ((ref[0] + ref[0 + 1] + 1) >> 1); x++; dest[0] = (((((ref[0] + ref[0 + 1] + 1) >> 1)) + dest[0] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = ((ref[1] + ref[1 + 1] + 1) >> 1); x++; dest[1] = (((((ref[1] + ref[1 + 1] + 1) >> 1)) + dest[1] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = ((ref[2] + ref[2 + 1] + 1) >> 1); x++; dest[2] = (((((ref[2] + ref[2 + 1] + 1) >> 1)) + dest[2] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = ((ref[3] + ref[3 + 1] + 1) >> 1); x++; dest[3] = (((((ref[3] + ref[3 + 1] + 1) >> 1)) + dest[3] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = ((ref[4] + ref[4 + 1] + 1) >> 1); x++; dest[4] = (((((ref[4] + ref[4 + 1] + 1) >> 1)) + dest[4] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = ((ref[5] + ref[5 + 1] + 1) >> 1); x++; dest[5] = (((((ref[5] + ref[5 + 1] + 1) >> 1)) + dest[5] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = ((ref[6] + ref[6 + 1] + 1) >> 1); x++; dest[6] = (((((ref[6] + ref[6 + 1] + 1) >> 1)) + dest[6] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = ((ref[7] + ref[7 + 1] + 1) >> 1); x++; dest[7] = (((((ref[7] + ref[7 + 1] + 1) >> 1)) + dest[7] + 1) >> 1); x = 0; y += 8; LumaData[LumaOffset + x + y * 8 + z * 8] = ((ref[8] + ref[8 + 1] + 1) >> 1); x++; dest[8] = (((((ref[8] + ref[8 + 1] + 1) >> 1)) + dest[8] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = ((ref[9] + ref[9 + 1] + 1) >> 1); x++; dest[9] = (((((ref[9] + ref[9 + 1] + 1) >> 1)) + dest[9] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = ((ref[10] + ref[10 + 1] + 1) >> 1); x++; dest[10] = (((((ref[10] + ref[10 + 1] + 1) >> 1)) + dest[10] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = ((ref[11] + ref[11 + 1] + 1) >> 1); x++; dest[11] = (((((ref[11] + ref[11 + 1] + 1) >> 1)) + dest[11] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = ((ref[12] + ref[12 + 1] + 1) >> 1); x++; dest[12] = (((((ref[12] + ref[12 + 1] + 1) >> 1)) + dest[12] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = ((ref[13] + ref[13 + 1] + 1) >> 1); x++; dest[13] = (((((ref[13] + ref[13 + 1] + 1) >> 1)) + dest[13] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = ((ref[14] + ref[14 + 1] + 1) >> 1); x++; dest[14] = (((((ref[14] + ref[14 + 1] + 1) >> 1)) + dest[14] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = ((ref[15] + ref[15 + 1] + 1) >> 1); x++; dest[15] = (((((ref[15] + ref[15 + 1] + 1) >> 1)) + dest[15] + 1) >> 1); x = 0; y = 0; z+=1; z = (z == 8) ? 16 : z; ref += stride; dest += stride; } while (--height);}static voidMC_avg_x_8_c (uint8_t * dest, const uint8_t * ref, const int stride, int height){ int x; x = 0; do { ChromaData[ChromaOffset + x++] = (((((ref[0] + ref[0 + 1] + 1) >> 1)))); dest[0] = (((((ref[0] + ref[0 + 1] + 1) >> 1)) + dest[0] + 1) >> 1); ChromaData[ChromaOffset + x++] = (((((ref[1] + ref[1 + 1] + 1) >> 1)))); dest[1] = (((((ref[1] + ref[1 + 1] + 1) >> 1)) + dest[1] + 1) >> 1); ChromaData[ChromaOffset + x++] = (((((ref[2] + ref[2 + 1] + 1) >> 1)))); dest[2] = (((((ref[2] + ref[2 + 1] + 1) >> 1)) + dest[2] + 1) >> 1); ChromaData[ChromaOffset + x++] = (((((ref[3] + ref[3 + 1] + 1) >> 1)))); dest[3] = (((((ref[3] + ref[3 + 1] + 1) >> 1)) + dest[3] + 1) >> 1); ChromaData[ChromaOffset + x++] = (((((ref[4] + ref[4 + 1] + 1) >> 1)))); dest[4] = (((((ref[4] + ref[4 + 1] + 1) >> 1)) + dest[4] + 1) >> 1); ChromaData[ChromaOffset + x++] = (((((ref[5] + ref[5 + 1] + 1) >> 1)))); dest[5] = (((((ref[5] + ref[5 + 1] + 1) >> 1)) + dest[5] + 1) >> 1); ChromaData[ChromaOffset + x++] = (((((ref[6] + ref[6 + 1] + 1) >> 1)))); dest[6] = (((((ref[6] + ref[6 + 1] + 1) >> 1)) + dest[6] + 1) >> 1); ChromaData[ChromaOffset + x++] = (((((ref[7] + ref[7 + 1] + 1) >> 1)))); dest[7] = (((((ref[7] + ref[7 + 1] + 1) >> 1)) + dest[7] + 1) >> 1); ref += stride; dest += stride; } while (--height);}static voidMC_put_y_16_c (uint8_t * dest, const uint8_t * ref, const int stride, int height){ int x,y,z; x = y = z =0; do { LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[0] + (ref + stride)[0] + 1) >> 1)); x++; dest[0] = (((ref[0] + (ref + stride)[0] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[1] + (ref + stride)[1] + 1) >> 1)); x++; dest[1] = (((ref[1] + (ref + stride)[1] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[2] + (ref + stride)[2] + 1) >> 1)); x++; dest[2] = (((ref[2] + (ref + stride)[2] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[3] + (ref + stride)[3] + 1) >> 1)); x++; dest[3] = (((ref[3] + (ref + stride)[3] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[4] + (ref + stride)[4] + 1) >> 1)); x++; dest[4] = (((ref[4] + (ref + stride)[4] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[5] + (ref + stride)[5] + 1) >> 1)); x++; dest[5] = (((ref[5] + (ref + stride)[5] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[6] + (ref + stride)[6] + 1) >> 1)); x++; dest[6] = (((ref[6] + (ref + stride)[6] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[7] + (ref + stride)[7] + 1) >> 1)); x++; dest[7] = (((ref[7] + (ref + stride)[7] + 1) >> 1)); x = 0; y+=8; LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[8] + (ref + stride)[8] + 1) >> 1)); x++; dest[8] = (((ref[8] + (ref + stride)[8] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[9] + (ref + stride)[9] + 1) >> 1)); x++; dest[9] = (((ref[9] + (ref + stride)[9] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[10] + (ref + stride)[10] + 1) >> 1)); x++; dest[10] = (((ref[10] + (ref + stride)[10] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[11] + (ref + stride)[11] + 1) >> 1)); x++; dest[11] = (((ref[11] + (ref + stride)[11] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[12] + (ref + stride)[12] + 1) >> 1)); x++; dest[12] = (((ref[12] + (ref + stride)[12] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[13] + (ref + stride)[13] + 1) >> 1)); x++; dest[13] = (((ref[13] + (ref + stride)[13] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[14] + (ref + stride)[14] + 1) >> 1)); x++; dest[14] = (((ref[14] + (ref + stride)[14] + 1) >> 1)); LumaData[LumaOffset + x + y * 8 + z * 8] = (((ref[15] + (ref + stride)[15] + 1) >> 1)); x++; dest[15] = (((ref[15] + (ref + stride)[15] + 1) >> 1)); x = 0; y = 0; z+=1; z = (z == 8) ? 16 : z; ref += stride; dest += stride; } while (--height);}static voidMC_put_y_8_c (uint8_t * dest, const uint8_t * ref, const int stride, int height){ int x; x = 0; do { ChromaData[ChromaOffset + x++] = dest[0] = (((ref[0] + (ref + stride)[0] + 1) >> 1)); ChromaData[ChromaOffset + x++] = dest[1] = (((ref[1] + (ref + stride)[1] + 1) >> 1)); ChromaData[ChromaOffset + x++] = dest[2] = (((ref[2] + (ref + stride)[2] + 1) >> 1)); ChromaData[ChromaOffset + x++] = dest[3] = (((ref[3] + (ref + stride)[3] + 1) >> 1)); ChromaData[ChromaOffset + x++] = dest[4] = (((ref[4] + (ref + stride)[4] + 1) >> 1)); ChromaData[ChromaOffset + x++] = dest[5] = (((ref[5] + (ref + stride)[5] + 1) >> 1)); ChromaData[ChromaOffset + x++] = dest[6] = (((ref[6] + (ref + stride)[6] + 1) >> 1)); ChromaData[ChromaOffset + x++] = dest[7] = (((ref[7] + (ref + stride)[7] + 1) >> 1)); ref += stride; dest += stride; } while (--height);}static voidMC_avg_y_16_c (uint8_t * dest, const uint8_t * ref, const int stride, int height){ int x,y,z; x = y = z = 0; do { LumaData[LumaOffset + x + y * 8 + z * 8] = (((((ref[0] + (ref + stride)[0] + 1) >> 1)))); x++; dest[0] = (((((ref[0] + (ref + stride)[0] + 1) >> 1)) + dest[0] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = (((((ref[1] + (ref + stride)[1] + 1) >> 1)))); x++; dest[1] = (((((ref[1] + (ref + stride)[1] + 1) >> 1)) + dest[1] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = (((((ref[2] + (ref + stride)[2] + 1) >> 1)))); x++; dest[2] = (((((ref[2] + (ref + stride)[2] + 1) >> 1)) + dest[2] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = (((((ref[3] + (ref + stride)[3] + 1) >> 1)))); x++; dest[3] = (((((ref[3] + (ref + stride)[3] + 1) >> 1)) + dest[3] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = (((((ref[4] + (ref + stride)[4] + 1) >> 1)))); x++; dest[4] = (((((ref[4] + (ref + stride)[4] + 1) >> 1)) + dest[4] + 1) >> 1); LumaData[LumaOffset + x + y * 8 + z * 8] = (((((ref[5] + (ref + stride)[5] + 1) >> 1)))); x++;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -