add 'uvfix' option to conv/bidx_video
This commit is contained in:
parent
c90ec1a935
commit
ecece4021f
@ -37,6 +37,10 @@ ValueFlag<int32_t> utime {
|
|||||||
parser, "10", "duration of each feature (frame)", {"utime"}, 10,
|
parser, "10", "duration of each feature (frame)", {"utime"}, 10,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Flag uvfix {
|
||||||
|
parser, "uvfix", "fix UV values in feature", {"uvfix"},
|
||||||
|
};
|
||||||
|
|
||||||
Positional<std::string> dst {
|
Positional<std::string> dst {
|
||||||
parser, "path", "destination video file path",
|
parser, "path", "destination video file path",
|
||||||
};
|
};
|
||||||
@ -51,8 +55,7 @@ std::vector<std::vector<int32_t>> indices;
|
|||||||
|
|
||||||
|
|
||||||
// util
|
// util
|
||||||
static std::vector<std::vector<int32_t>> ReadIndices(
|
static std::vector<std::vector<int32_t>> ReadIndices(std::istream&) noexcept;
|
||||||
std::istream&) noexcept;
|
|
||||||
|
|
||||||
static void Embed(int32_t t, Frame& dst, const Frame& base) {
|
static void Embed(int32_t t, Frame& dst, const Frame& base) {
|
||||||
const auto bw = args::get(param::bw);
|
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 y = 0; y < hbh; ++y) {
|
||||||
for (int32_t x = 0; x < hbw; ++x) {
|
for (int32_t x = 0; x < hbw; ++x) {
|
||||||
const auto off = (by*hbh+y)*base.hw + (bx*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() {
|
static void Exec() {
|
||||||
const auto bw = args::get(param::bw);
|
const auto bw = args::get(param::bw);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user