[FFmpeg-cvslog] avfilter/af_astats: add support for s64(p) sample format

Paul B Mahol git at videolan.org
Thu Aug 18 17:31:08 EEST 2016


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Aug 18 11:02:31 2016 +0200| [81f7d07608e1ac2ee480abcc4a26adb7b2dc3a78] | committer: Paul B Mahol

avfilter/af_astats: add support for s64(p) sample format

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=81f7d07608e1ac2ee480abcc4a26adb7b2dc3a78
---

 libavfilter/af_astats.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/libavfilter/af_astats.c b/libavfilter/af_astats.c
index 4c701ff..220ee78 100644
--- a/libavfilter/af_astats.c
+++ b/libavfilter/af_astats.c
@@ -73,6 +73,7 @@ static int query_formats(AVFilterContext *ctx)
     static const enum AVSampleFormat sample_fmts[] = {
         AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P,
         AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32P,
+        AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S64P,
         AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
         AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP,
         AV_SAMPLE_FMT_NONE
@@ -351,6 +352,23 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
                 update_stat(s, &s->chstats[c], *src, *src / (double)INT16_MAX, llrint(*src * (UINT64_C(1) << 63)));
         }}
         break;
+    case AV_SAMPLE_FMT_S64P:
+        for (c = 0; c < channels; c++) {
+            ChannelStats *p = &s->chstats[c];
+            const int64_t *src = (const int64_t *)buf->extended_data[c];
+
+            for (i = 0; i < buf->nb_samples; i++, src++)
+                update_stat(s, p, *src, *src / (double)INT64_MAX, *src);
+        }
+        break;
+    case AV_SAMPLE_FMT_S64: {
+        const int64_t *src = (const int64_t *)buf->extended_data[0];
+
+        for (i = 0; i < buf->nb_samples; i++) {
+            for (c = 0; c < channels; c++, src++)
+                update_stat(s, &s->chstats[c], *src, *src / (double)INT64_MAX, *src);
+        }}
+        break;
     case AV_SAMPLE_FMT_S32P:
         for (c = 0; c < channels; c++) {
             ChannelStats *p = &s->chstats[c];



More information about the ffmpeg-cvslog mailing list