diff --git a/conv/bidx_video.cc b/conv/bidx_video.cc index 03e0c43..493b2b1 100644 --- a/conv/bidx_video.cc +++ b/conv/bidx_video.cc @@ -37,6 +37,10 @@ ValueFlag utime { parser, "10", "duration of each feature (frame)", {"utime"}, 10, }; +Flag uvfix { + parser, "uvfix", "fix UV values in feature", {"uvfix"}, +}; + Positional dst { parser, "path", "destination video file path", }; @@ -51,8 +55,7 @@ std::vector> indices; // util -static std::vector> ReadIndices( - std::istream&) noexcept; +static std::vector> 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]; + } } } }