X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavutil%2Ftime_internal.h;fp=ffmpeg%2Flibavcodec%2Fdsputil_compat.c;h=612a75a0411d97b75fc80f05b7c4c010fe05a6eb;hp=7ac1099f1602cdcef05953b2c598647c081aac57;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavcodec/dsputil_compat.c b/ffmpeg/libavutil/time_internal.h similarity index 53% rename from ffmpeg/libavcodec/dsputil_compat.c rename to ffmpeg/libavutil/time_internal.h index 7ac1099..612a75a 100644 --- a/ffmpeg/libavcodec/dsputil_compat.c +++ b/ffmpeg/libavutil/time_internal.h @@ -1,6 +1,4 @@ /* - * DSP utils - * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or @@ -18,39 +16,32 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "me_cmp.h" -#include "dsputil.h" +#ifndef AVUTIL_TIME_INTERNAL_H +#define AVUTIL_TIME_INTERNAL_H -#if FF_API_DSPUTIL +#include +#include "config.h" -void avpriv_dsputil_init(DSPContext* p, AVCodecContext *avctx) +#if !HAVE_GMTIME_R && !defined(gmtime_r) +static inline struct tm *gmtime_r(const time_t* clock, struct tm *result) { - MECmpContext mecc; - - ff_me_cmp_init(&mecc, avctx); -#define COPY(name) memcpy(&p->name, &mecc.name, sizeof(p->name)) - COPY(sum_abs_dctelem); - COPY(sad); - COPY(sse); - COPY(hadamard8_diff); - COPY(dct_sad); - COPY(quant_psnr); - COPY(bit); - COPY(rd); - COPY(vsad); - COPY(vsse); - COPY(nsse); - COPY(w53); - COPY(w97); - COPY(dct_max); - COPY(dct264_sad); - COPY(me_pre_cmp); - COPY(me_cmp); - COPY(me_sub_cmp); - COPY(mb_cmp); - COPY(ildct_cmp); - COPY(frame_skip_cmp); - COPY(pix_abs); + struct tm *ptr = gmtime(clock); + if (!ptr) + return NULL; + *result = *ptr; + return result; } +#endif +#if !HAVE_LOCALTIME_R && !defined(localtime_r) +static inline struct tm *localtime_r(const time_t* clock, struct tm *result) +{ + struct tm *ptr = localtime(clock); + if (!ptr) + return NULL; + *result = *ptr; + return result; +} #endif + +#endif /* AVUTIL_TIME_INTERNAL_H */