diff mbox series

[FFmpeg-devel,v4] examples/extract_mvs.c: dont disply motionless vectors

Message ID 9f27e90b417a4c416bb1cf7e0ac685d17393cce2.1584765328.git.porschegt23@foxmail.com
State New
Headers show
Series [FFmpeg-devel,v4] examples/extract_mvs.c: dont 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 21, 2020, 4:46 a.m. UTC
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: numberwolf <porschegt23@foxmail.com>
---


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

Comments

numberwolf March 25, 2020, 2:25 p.m. UTC | #1
Numberwolf:
>Reviewed-by: Paul B Mahol <onemda@gmail.com>
>Signed-off-by: numberwolf <porschegt23@foxmail.com>
>---
>
>
>Here, don't need show motionless vectors,because they're useless.
>And remove comments.
> doc/examples/extract_mvs.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/doc/examples/extract_mvs.c b/doc/examples/extract_mvs.c
>index de31ccd..af62e02 100644
>--- a/doc/examples/extract_mvs.c
>+++ b/doc/examples/extract_mvs.c
>@@ -60,6 +60,9 @@ 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];
>+                    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
>Numberwolf
>
ping

Thanks
Moritz Barsnick March 30, 2020, 1:35 p.m. UTC | #2
On Sat, Mar 21, 2020 at 12:46:09 +0800, numberwolf wrote:
> Subject: examples/extract_mvs.c: dont disply motionless vectors

Two typos in the commit message: -> don't display

> Reviewed-by: Paul B Mahol <onemda@gmail.com>

Please don't do this. (Not speaking for Paul here, but in general, this
doesn't really make sense.)

Moritz
diff mbox series

Patch

diff --git a/doc/examples/extract_mvs.c b/doc/examples/extract_mvs.c
index de31ccd..af62e02 100644
--- a/doc/examples/extract_mvs.c
+++ b/doc/examples/extract_mvs.c
@@ -60,6 +60,9 @@  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];
+                    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,