Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define CH1FILTER(src) ((6*(src)[0] + 2*(src)[1] + 4) >> 3)
- #define CH2FILTER(src) (( (src)[0] + (src)[1] + 1) >> 1)
- #define CH3FILTER(src) ((2*(src)[0] + 6*(src)[1] + 4) >> 3)
- #define CV1FILTER(src, i) ((6*(src)[0] + 2*(src)[i] + 4) >> 3)
- #define CV2FILTER(src, i) (( (src)[0] + (src)[i] + 1) >> 1)
- #define CV3FILTER(src, i) ((2*(src)[0] + 6*(src)[i] + 4) >> 3)
- static void bink2f_c_mc(Bink2Context *c, int x, int y,
- uint8_t *dst, int stride,
- uint8_t *src, int sstride,
- int width, int height,
- int mv_x, int mv_y,
- int mode)
- {
- uint8_t *msrc;
- msrc = src + mv_x + mv_y * sstride;
- ff_dlog(NULL, "CHROMA %d: %dx%d | %dx%d\n", mode, x, y, mv_x, mv_y);
- switch (mode) {
- case 0:
- case 4:
- case 8:
- case 12:
- copy_block8(dst, msrc, stride, sstride, 8);
- break;
- case 1:
- for (int j = 0; j < 8; j++) {
- for (int i = 0; i < 8; i++)
- dst[i] = av_clip_uint8(CH1FILTER(msrc + i));
- dst += stride;
- msrc += sstride;
- }
- break;
- case 2:
- for (int j = 0; j < 8; j++) {
- for (int i = 0; i < 8; i++)
- dst[i] = av_clip_uint8(CH2FILTER(msrc + i));
- dst += stride;
- msrc += sstride;
- }
- break;
- case 3:
- for (int j = 0; j < 8; j++) {
- for (int i = 0; i < 8; i++)
- dst[i] = av_clip_uint8(CH3FILTER(msrc + i));
- dst += stride;
- msrc += sstride;
- }
- break;
- case 5:
- for (int j = 0; j < 8; j++) {
- for (int i = 0; i < 8; i++)
- dst[i*stride] = av_clip_uint8(CV1FILTER(msrc + i*sstride, sstride));
- dst += 1;
- msrc += 1;
- }
- break;
- case 6:
- for (int j = 0; j < 8; j++) {
- for (int i = 0; i < 8; i++)
- dst[i*stride] = av_clip_uint8(CV2FILTER(msrc + i*sstride, sstride));
- dst += 1;
- msrc += 1;
- }
- break;
- case 7:
- for (int j = 0; j < 8; j++) {
- for (int i = 0; i < 8; i++)
- dst[i*stride] = av_clip_uint8(CV3FILTER(msrc + i*sstride, sstride));
- dst += 1;
- msrc += 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement