video_writer::copy_image::copy_image(uint32_t width, uint32_t height, uint32_t pitch) { uint32_t w_byte = width * 4 / 16; uint32_t index = 0; std::function<void()> funcs[3] = { [this] { mov16(); }, [this] { mov32(); }, [this] { mov64(); } }; for (; index < 2; ++index){ if ((w_byte & 1) == 1) { break; } else { w_byte = w_byte / 2; } } mov(r8, w_byte); mov(r9, height); mov(r10, pitch * 2); L("L2"); mov(rax, r8); L("L1"); funcs[index](); sub(rax, 1); jnz("L1"); sub(rcx, r10); sub(r9, 1); jnz("L2"); vzeroupper(); ret(); }
Code() { vzeroupper(); ret(); }