[vlc-commits] qsv: use MPEG macros for timestamp conversion
Steve Lhomme
git at videolan.org
Thu Sep 20 16:15:58 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Sep 20 13:05:48 2018 +0200| [21fbbe93eaef8574ca089ca817f38f2878cc229c] | committer: Steve Lhomme
qsv: use MPEG macros for timestamp conversion
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=21fbbe93eaef8574ca089ca817f38f2878cc229c
---
modules/codec/qsv.c | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/modules/codec/qsv.c b/modules/codec/qsv.c
index d2f37254c1..bfdd57f44e 100644
--- a/modules/codec/qsv.c
+++ b/modules/codec/qsv.c
@@ -303,16 +303,6 @@ typedef struct
static block_t *Encode(encoder_t *, picture_t *);
-static inline vlc_tick_t qsv_timestamp_to_mtime(int64_t mfx_ts)
-{
- return FROM_SCALE_NZ(mfx_ts);
-}
-
-static inline uint64_t qsv_mtime_to_timestamp(vlc_tick_t vlc_ts)
-{
- return TO_SCALE_NZ(vlc_ts);
-}
-
static void clear_unused_frames(encoder_sys_t *sys)
{
QSVFrame *cur = sys->work_frames;
@@ -686,8 +676,8 @@ static void qsv_set_block_flags(block_t *block, uint16_t frame_type)
*/
static void qsv_set_block_ts(encoder_t *enc, encoder_sys_t *sys, block_t *block, mfxBitstream *bs)
{
- block->i_pts = qsv_timestamp_to_mtime(bs->TimeStamp) + sys->offset_pts;
- block->i_dts = qsv_timestamp_to_mtime(bs->DecodeTimeStamp) + sys->offset_pts;
+ block->i_pts = FROM_SCALE_NZ(bs->TimeStamp) + sys->offset_pts;
+ block->i_dts = FROM_SCALE_NZ(bs->DecodeTimeStamp) + sys->offset_pts;
/* HW encoder (with old driver versions) and some parameters
combinations doesn't set the DecodeTimeStamp field so we warn
@@ -780,7 +770,7 @@ static int submit_frame(encoder_t *enc, picture_t *pic, QSVFrame **new_frame)
qf->surface.Data.Y = qf->pic->p[0].p_pixels;
qf->surface.Data.UV = qf->pic->p[1].p_pixels;
- qf->surface.Data.TimeStamp = qsv_mtime_to_timestamp(pic->date - sys->offset_pts);
+ qf->surface.Data.TimeStamp = TO_SCALE_NZ(pic->date - sys->offset_pts);
*new_frame = qf;
More information about the vlc-commits
mailing list