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,
|
||||
};
|
||||
|
||||
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,11 +79,13 @@ static void Embed(int32_t t, Frame& dst, const Frame& base) {
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
dst.U[off] = base.U[off];
|
||||
dst.V[off] = base.V[off];
|
||||
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);
|
||||
dst.U[off] = base.U[off];
|
||||
dst.V[off] = base.V[off];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user