add 'uvfix' option to conv/bidx_video

This commit is contained in:
falsycat 2022-09-06 20:09:31 +09:00
parent c90ec1a935
commit ecece4021f

View File

@ -37,6 +37,10 @@ ValueFlag<int32_t> utime {
parser, "10", "duration of each feature (frame)", {"utime"}, 10,
};
Flag uvfix {
parser, "uvfix", "fix UV values in feature", {"uvfix"},
};
Positional<std::string> dst {
parser, "path", "destination video file path",
};
@ -51,8 +55,7 @@ std::vector<std::vector<int32_t>> indices;
// util
static std::vector<std::vector<int32_t>> ReadIndices(
std::istream&) noexcept;
static std::vector<std::vector<int32_t>> ReadIndices(std::istream&) noexcept;
static void Embed(int32_t t, Frame& dst, const Frame& base) {
const auto bw = args::get(param::bw);
@ -76,6 +79,7 @@ static void Embed(int32_t t, Frame& dst, const Frame& base) {
}
}
if (param::uvfix) {
for (int32_t y = 0; y < hbh; ++y) {
for (int32_t x = 0; x < hbw; ++x) {
const auto off = (by*hbh+y)*base.hw + (bx*hbw+x);
@ -85,6 +89,7 @@ static void Embed(int32_t t, Frame& dst, const Frame& base) {
}
}
}
}
static void Exec() {
const auto bw = args::get(param::bw);