diff mbox series

[FFmpeg-devel,v3] examples/extract_mvs.c: don't disply motionless vectors

Message ID fa3001984e5ecf600283091c92d27fe1b9419edd.1584458872.git.porschegt23@foxmail.com
State New
Headers show
Series [FFmpeg-devel,v3] examples/extract_mvs.c: don't disply motionless vectors
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

numberwolf March 17, 2020, 4 p.m. UTC
Signed-off-by: numberwolf <porschegt23@foxmail.com>
---



Here, don't need show motionless vectors,because they're useless.
 doc/examples/extract_mvs.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Paul B Mahol March 18, 2020, 4:05 p.m. UTC | #1
LGTM without comments.

On 3/17/20, numberwolf <porschegt23@foxmail.com> wrote:
> Signed-off-by: numberwolf <porschegt23@foxmail.com>
> ---
>
>
>
> Here, don't need show motionless vectors,because they're useless.
>  doc/examples/extract_mvs.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/doc/examples/extract_mvs.c b/doc/examples/extract_mvs.c
> index de31ccd..f6d19b7 100644
> --- a/doc/examples/extract_mvs.c
> +++ b/doc/examples/extract_mvs.c
> @@ -60,6 +60,13 @@ static int decode_packet(const AVPacket *pkt)
>                  const AVMotionVector *mvs = (const AVMotionVector
> *)sd->data;
>                  for (i = 0; i < sd->size / sizeof(*mvs); i++) {
>                      const AVMotionVector *mv = &mvs[i];
> +
> +                    // dont need show motionless vectors
> +                    // because they're useless
> +                    if (mv->src_x == mv->dst_x && mv->src_y == mv->dst_y) {
> +                        continue;
> +                    }
> +
>                      printf("%d,%2d,%2d,%2d,%4d,%4d,%4d,%4d,0x%"PRIx64"\n",
>                          video_frame_count, mv->source,
>                          mv->w, mv->h, mv->src_x, mv->src_y,
> --
> 2.17.2 (Apple Git-113)
>
> Thanks
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
numberwolf March 20, 2020, 4:51 p.m. UTC | #2
&gt; LGTM without comments.
&gt;&nbsp;
&gt; On 3/17/20, numberwolf <porschegt23@foxmail.com&gt; wrote:
&gt;&nbsp;&gt; Signed-off-by: numberwolf <porschegt23@foxmail.com&gt;
&gt;&nbsp;&gt; ---
&gt;&nbsp;&gt;
&gt;&nbsp;&gt;
&gt;&nbsp;&gt;
&gt;&nbsp;&gt; Here, don't need show motionless vectors,because they're useless.
&gt;&nbsp;&gt;&nbsp; doc/examples/extract_mvs.c | 7 +++++++
&gt;&nbsp;&gt;&nbsp; 1 file changed, 7 insertions(+)
&gt;&nbsp;&gt;
&gt;&nbsp;&gt; diff --git a/doc/examples/extract_mvs.c b/doc/examples/extract_mvs.c
&gt;&nbsp;&gt; index de31ccd..f6d19b7 100644
&gt;&nbsp;&gt; --- a/doc/examples/extract_mvs.c
&gt;&nbsp;&gt; +++ b/doc/examples/extract_mvs.c
&gt;&nbsp;&gt; @@ -60,6 +60,13 @@ static int decode_packet(const AVPacket *pkt)
&gt;&nbsp;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const AVMotionVector *mvs = (const AVMotionVector
&gt;&nbsp;&gt; *)sd-&gt;data;
&gt;&nbsp;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i = 0; i < sd-&gt;size / sizeof(*mvs); i++) {
&gt;&nbsp;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const AVMotionVector *mv = &amp;mvs[i];
&gt;&nbsp;&gt; +
&gt;&nbsp;&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // dont need show motionless vectors
&gt;&nbsp;&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // because they're useless
&gt;&nbsp;&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (mv-&gt;src_x == mv-&gt;dst_x &amp;&amp; mv-&gt;src_y == mv-&gt;dst_y) {
&gt;&nbsp;&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; continue;
&gt;&nbsp;&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
&gt;&nbsp;&gt; +
&gt;&nbsp;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("%d,%2d,%2d,%2d,%4d,%4d,%4d,%4d,0x%"PRIx64"\n",
&gt;&nbsp;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; video_frame_count, mv-&gt;source,
&gt;&nbsp;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mv-&gt;w, mv-&gt;h, mv-&gt;src_x, mv-&gt;src_y,
&gt;&nbsp;&gt; --
&gt;&nbsp;&gt; 2.17.2 (Apple Git-113)
&gt;&nbsp;&gt;
&gt;&nbsp;&gt; Thanks
&gt;&nbsp;&gt; _______________________________________________
&gt;&nbsp;&gt; ffmpeg-devel mailing list
&gt;&nbsp;&gt; ffmpeg-devel@ffmpeg.org
&gt;&nbsp;&gt; https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
&gt;&nbsp;&gt;
&gt;&nbsp;&gt; To unsubscribe, visit link above, or email
&gt;&nbsp;&gt; ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
&gt;&nbsp;_______________________________________________
&gt;&nbsp;ffmpeg-devel mailing list
&gt;&nbsp;ffmpeg-devel@ffmpeg.org
&gt;&nbsp;https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
&gt;&nbsp;
&gt;&nbsp;To unsubscribe, visit link above, or email
&gt;&nbsp;ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".


ping.


Thanks
Carl Eugen Hoyos March 20, 2020, 9:31 p.m. UTC | #3
Am Fr., 20. März 2020 um 17:59 Uhr schrieb porschegt23@foxmail.com
<porschegt23@foxmail.com>:

> &gt; LGTM without comments.
> &gt;&nbsp;

> ping.

Please resend your patch without the comments (and the mail without
the html codes).

Carl Eugen
diff mbox series

Patch

diff --git a/doc/examples/extract_mvs.c b/doc/examples/extract_mvs.c
index de31ccd..f6d19b7 100644
--- a/doc/examples/extract_mvs.c
+++ b/doc/examples/extract_mvs.c
@@ -60,6 +60,13 @@  static int decode_packet(const AVPacket *pkt)
                 const AVMotionVector *mvs = (const AVMotionVector *)sd->data;
                 for (i = 0; i < sd->size / sizeof(*mvs); i++) {
                     const AVMotionVector *mv = &mvs[i];
+
+                    // dont need show motionless vectors
+                    // because they're useless
+                    if (mv->src_x == mv->dst_x && mv->src_y == mv->dst_y) {
+                        continue;
+                    }
+
                     printf("%d,%2d,%2d,%2d,%4d,%4d,%4d,%4d,0x%"PRIx64"\n",
                         video_frame_count, mv->source,
                         mv->w, mv->h, mv->src_x, mv->src_y,