[FFmpeg-devel] [PATCH 3/3] avfilter/vf_telecine: do not reset pts to 0

Paul B Mahol onemda at gmail.com
Fri Oct 11 13:40:43 CEST 2013


Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavfilter/vf_telecine.c      |   6 +-
 tests/ref/fate/filter-telecine | 122 ++++++++++++++++++++---------------------
 2 files changed, 63 insertions(+), 65 deletions(-)

diff --git a/libavfilter/vf_telecine.c b/libavfilter/vf_telecine.c
index 9e87454e..9a97c91 100644
--- a/libavfilter/vf_telecine.c
+++ b/libavfilter/vf_telecine.c
@@ -40,7 +40,6 @@ typedef struct {
     unsigned int pattern_pos;
 
     AVRational pts;
-    double ts_unit;
     int out_cnt;
     int occupied;
 
@@ -158,8 +157,6 @@ static int config_output(AVFilterLink *outlink)
     av_log(ctx, AV_LOG_VERBOSE, "TB: %d/%d -> %d/%d\n",
            inlink->time_base.num, inlink->time_base.den, outlink->time_base.num, outlink->time_base.den);
 
-    s->ts_unit = av_q2d(av_inv_q(av_mul_q(fps, outlink->time_base)));
-
     return 0;
 }
 
@@ -232,7 +229,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
             return AVERROR(ENOMEM);
         }
 
-        frame->pts = outlink->frame_count * s->ts_unit;
+        frame->pts = av_rescale_q(inpicref->pts, inlink->time_base,
+                                  outlink->time_base) + outlink->frame_count;
         ret = ff_filter_frame(outlink, frame);
     }
     av_frame_free(&inpicref);
diff --git a/tests/ref/fate/filter-telecine b/tests/ref/fate/filter-telecine
index b8a13a9..4d951c2 100644
--- a/tests/ref/fate/filter-telecine
+++ b/tests/ref/fate/filter-telecine
@@ -1,63 +1,63 @@
 #tb 0: 4/125
 0,          0,          0,        1,   152064, 0x05b789ef
-0,          1,          1,        1,   152064, 0x4bb46551
-0,          2,          2,        1,   152064, 0x40692c80
-0,          3,          3,        1,   152064, 0xd7ad04cb
-0,          4,          4,        1,   152064, 0x2a8380b0
-0,          5,          5,        1,   152064, 0x4de3b652
-0,          6,          6,        1,   152064, 0xedb5a8e6
-0,          7,          7,        1,   152064, 0x549dfa8a
-0,          8,          8,        1,   152064, 0x447bc7b9
-0,          9,          9,        1,   152064, 0x5ab58bac
-0,         10,         10,        1,   152064, 0x1f1b8026
-0,         11,         11,        1,   152064, 0x91373915
-0,         12,         12,        1,   152064, 0x90895a6e
-0,         13,         13,        1,   152064, 0x793d075e
-0,         14,         14,        1,   152064, 0x30f5fcd5
-0,         15,         15,        1,   152064, 0xc711ad61
-0,         16,         16,        1,   152064, 0x24eca223
-0,         17,         17,        1,   152064, 0x0a4073dc
-0,         18,         18,        1,   152064, 0x06e34d70
-0,         19,         19,        1,   152064, 0xa91c0f05
-0,         20,         20,        1,   152064, 0x8e364e18
-0,         21,         21,        1,   152064, 0xb15d38c8
-0,         22,         22,        1,   152064, 0x6b2b2e46
-0,         23,         23,        1,   152064, 0xbd2320cb
-0,         24,         24,        1,   152064, 0xf34ddbff
-0,         25,         25,        1,   152064, 0xfc7bf570
-0,         26,         26,        1,   152064, 0x9dc72412
-0,         27,         27,        1,   152064, 0xa1242020
-0,         28,         28,        1,   152064, 0x1f939e6a
-0,         29,         29,        1,   152064, 0x2f2768ef
-0,         30,         30,        1,   152064, 0xce09f9d6
-0,         31,         31,        1,   152064, 0x95579936
-0,         32,         32,        1,   152064, 0x41181cbd
-0,         33,         33,        1,   152064, 0xe9cec847
-0,         34,         34,        1,   152064, 0xd780d887
-0,         35,         35,        1,   152064, 0x76d2a455
-0,         36,         36,        1,   152064, 0x6dc3650e
-0,         37,         37,        1,   152064, 0x8d165d23
-0,         38,         38,        1,   152064, 0x64f10efa
-0,         39,         39,        1,   152064, 0xe295c51e
-0,         40,         40,        1,   152064, 0xd766fc8d
-0,         41,         41,        1,   152064, 0xe22f7a30
-0,         42,         42,        1,   152064, 0xd8c68892
-0,         43,         43,        1,   152064, 0x26516b0e
-0,         44,         44,        1,   152064, 0xfa8d94fb
-0,         45,         45,        1,   152064, 0x4c9737ab
-0,         46,         46,        1,   152064, 0xa50d01f8
-0,         47,         47,        1,   152064, 0x82f12165
-0,         48,         48,        1,   152064, 0x113fadc0
-0,         49,         49,        1,   152064, 0x88734edd
-0,         50,         50,        1,   152064, 0xd2735925
-0,         51,         51,        1,   152064, 0xd4e49e08
-0,         52,         52,        1,   152064, 0x8cd54fc5
-0,         53,         53,        1,   152064, 0xae821cac
-0,         54,         54,        1,   152064, 0x575c20ec
-0,         55,         55,        1,   152064, 0xfd500471
-0,         56,         56,        1,   152064, 0x61b47e73
-0,         57,         57,        1,   152064, 0x213d5314
-0,         58,         58,        1,   152064, 0xb4ddd391
-0,         59,         59,        1,   152064, 0x6e88c5c2
-0,         60,         60,        1,   152064, 0xbb87b483
-0,         61,         61,        1,   152064, 0x4bbad8ea
+0,          2,          2,        1,   152064, 0x4bb46551
+0,          5,          5,        1,   152064, 0x40692c80
+0,          7,          7,        1,   152064, 0xd7ad04cb
+0,          8,          8,        1,   152064, 0x2a8380b0
+0,         10,         10,        1,   152064, 0x4de3b652
+0,         12,         12,        1,   152064, 0xedb5a8e6
+0,         15,         15,        1,   152064, 0x549dfa8a
+0,         17,         17,        1,   152064, 0x447bc7b9
+0,         18,         18,        1,   152064, 0x5ab58bac
+0,         20,         20,        1,   152064, 0x1f1b8026
+0,         22,         22,        1,   152064, 0x91373915
+0,         25,         25,        1,   152064, 0x90895a6e
+0,         27,         27,        1,   152064, 0x793d075e
+0,         28,         28,        1,   152064, 0x30f5fcd5
+0,         30,         30,        1,   152064, 0xc711ad61
+0,         32,         32,        1,   152064, 0x24eca223
+0,         35,         35,        1,   152064, 0x0a4073dc
+0,         37,         37,        1,   152064, 0x06e34d70
+0,         38,         38,        1,   152064, 0xa91c0f05
+0,         40,         40,        1,   152064, 0x8e364e18
+0,         42,         42,        1,   152064, 0xb15d38c8
+0,         45,         45,        1,   152064, 0x6b2b2e46
+0,         47,         47,        1,   152064, 0xbd2320cb
+0,         48,         48,        1,   152064, 0xf34ddbff
+0,         50,         50,        1,   152064, 0xfc7bf570
+0,         52,         52,        1,   152064, 0x9dc72412
+0,         55,         55,        1,   152064, 0xa1242020
+0,         57,         57,        1,   152064, 0x1f939e6a
+0,         58,         58,        1,   152064, 0x2f2768ef
+0,         60,         60,        1,   152064, 0xce09f9d6
+0,         62,         62,        1,   152064, 0x95579936
+0,         65,         65,        1,   152064, 0x41181cbd
+0,         67,         67,        1,   152064, 0xe9cec847
+0,         68,         68,        1,   152064, 0xd780d887
+0,         70,         70,        1,   152064, 0x76d2a455
+0,         72,         72,        1,   152064, 0x6dc3650e
+0,         75,         75,        1,   152064, 0x8d165d23
+0,         77,         77,        1,   152064, 0x64f10efa
+0,         78,         78,        1,   152064, 0xe295c51e
+0,         80,         80,        1,   152064, 0xd766fc8d
+0,         82,         82,        1,   152064, 0xe22f7a30
+0,         85,         85,        1,   152064, 0xd8c68892
+0,         87,         87,        1,   152064, 0x26516b0e
+0,         88,         88,        1,   152064, 0xfa8d94fb
+0,         90,         90,        1,   152064, 0x4c9737ab
+0,         92,         92,        1,   152064, 0xa50d01f8
+0,         95,         95,        1,   152064, 0x82f12165
+0,         97,         97,        1,   152064, 0x113fadc0
+0,         98,         98,        1,   152064, 0x88734edd
+0,        100,        100,        1,   152064, 0xd2735925
+0,        102,        102,        1,   152064, 0xd4e49e08
+0,        105,        105,        1,   152064, 0x8cd54fc5
+0,        107,        107,        1,   152064, 0xae821cac
+0,        108,        108,        1,   152064, 0x575c20ec
+0,        110,        110,        1,   152064, 0xfd500471
+0,        112,        112,        1,   152064, 0x61b47e73
+0,        115,        115,        1,   152064, 0x213d5314
+0,        117,        117,        1,   152064, 0xb4ddd391
+0,        118,        118,        1,   152064, 0x6e88c5c2
+0,        120,        120,        1,   152064, 0xbb87b483
+0,        122,        122,        1,   152064, 0x4bbad8ea
-- 
1.7.11.2



More information about the ffmpeg-devel mailing list