diff mbox series

[FFmpeg-devel,v2] not display motionless vectors in examples/extract_mvs.c

Message ID 20200316172115.7279-1-porschegt23@foxmail.com
State New
Headers show
Series [FFmpeg-devel,v2] not display motionless vectors in examples/extract_mvs.c | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

numberwolf March 16, 2020, 5:21 p.m. UTC
Here, dont need show motionless vectors,because they're useless.
(Sorry about I forget to remove the 'printf' on previous version.)

Signed-off-by: numberwolf <porschegt23@foxmail.com>
---
 doc/examples/extract_mvs.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Moritz Barsnick March 17, 2020, 12:59 p.m. UTC | #1
On Tue, Mar 17, 2020 at 01:21:15 +0800, numberwolf wrote:
> Subject: not display motionless vectors in examples/extract_mvs.c

Please do have a look at other commits in the repository. This would be
examples/extract_mvs: don't display motionless vectors.


> Here, dont need show motionless vectors,because they're useless.
> (Sorry about I forget to remove the 'printf' on previous version.)

These remarks belong below the three dashes "---" below, otherwise they
become part of the repository.
> Signed-off-by: numberwolf <porschegt23@foxmail.com>
> ---

^^^^^
These three lines.

> +                    if (mv->src_x == mv->dst_x && mv->src_y == mv->dst_y) {
> +                        printf("extract_mvs skip\n");

You didn't actually remove the printf().

Moritz
diff mbox series

Patch

diff --git a/doc/examples/extract_mvs.c b/doc/examples/extract_mvs.c
index de31ccd..eaf7816 100644
--- a/doc/examples/extract_mvs.c
+++ b/doc/examples/extract_mvs.c
@@ -60,6 +60,14 @@  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) {
+                        printf("extract_mvs skip\n");
+                        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,