[FFmpeg-cvslog] avfilter/vf_lut2: add slice threading

2019-06-09 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Jun  9 14:07:00 
2019 +0200| [a9bf65657752ba0abf2c3760f7b5cecf59a6d216] | committer: Paul B Mahol

avfilter/vf_lut2: add slice threading

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

 libavfilter/vf_lut2.c | 50 +-
 1 file changed, 37 insertions(+), 13 deletions(-)

diff --git a/libavfilter/vf_lut2.c b/libavfilter/vf_lut2.c
index d765dc9ad2..2d4ede7158 100644
--- a/libavfilter/vf_lut2.c
+++ b/libavfilter/vf_lut2.c
@@ -70,10 +70,13 @@ typedef struct LUT2Context {
 int tlut2;
 AVFrame *prev_frame;/* only used with tlut2 */
 
-void (*lut2)(struct LUT2Context *s, AVFrame *dst, AVFrame *srcx, AVFrame 
*srcy);
-
+int (*lut2)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
 } LUT2Context;
 
+typedef struct ThreadData {
+AVFrame *out, *srcx, *srcy;
+} ThreadData;
+
 #define OFFSET(x) offsetof(LUT2Context, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
@@ -238,24 +241,31 @@ static int config_inputy(AVFilterLink *inlink)
 }
 
 #define DEFINE_LUT2(zname, xname, yname, ztype, xtype, ytype, zdiv, xdiv, 
ydiv)  \
-static void lut2_##zname##_##xname##_##yname(struct LUT2Context *s,
  \
- AVFrame *out, 
  \
- AVFrame *srcx, AVFrame *srcy) 
  \
+static int lut2_##zname##_##xname##_##yname(AVFilterContext *ctx,  
  \
+ void *arg,
  \
+ int jobnr, int nb_jobs)   
  \
 {  
  \
+LUT2Context *s = ctx->priv;
  \
+ThreadData *td = arg;  
  \
+AVFrame *out = td->out;
  \
+AVFrame *srcx = td->srcx;  
  \
+AVFrame *srcy = td->srcy;  
  \
 const int odepth = s->odepth;  
  \
 int p, y, x;   
  \

  \
 for (p = 0; p < s->nb_planes; p++) {   
  \
+const int slice_start = (s->heightx[p] * jobnr) / nb_jobs; 
  \
+const int slice_end = (s->heightx[p] * (jobnr+1)) / nb_jobs;   
  \
 const uint16_t *lut = s->lut[p];   
  \
 const xtype *srcxx;
  \
 const ytype *srcyy;
  \
 ztype *dst;
  \

  \
-dst   = (ztype *)out->data[p]; 
  \
-srcxx = (const xtype *)srcx->data[p];  
  \
-srcyy = (const ytype *)srcy->data[p];  
  \
+dst   = (ztype *)(out->data[p] + slice_start * out->linesize[p]);  
  \
+srcxx = (const xtype *)(srcx->data[p] + slice_start * 
srcx->linesize[p]);\
+srcyy = (const ytype *)(srcy->data[p] + slice_start * 
srcy->linesize[p]);\

  \
-for (y = 0; y < s->heightx[p]; y++) {  
  \
+for (y = slice_start; y < slice_end; y++) {
  \
 for (x = 0; x < s->widthx[p]; x++) {   
  \
 dst[x] = av_clip_uintp2_c(lut[(srcyy[x] << s->depthx) | 
srcxx[x]], odepth); \
 }  
  \
@@ -265,6 +275,7 @@ static void lut2_##zname##_##xname##_##yname(struct 
LUT2Context *s,
 srcyy += srcy->linesize[p] / ydiv; 
  \
 }  
  \
 }  
  \
+return 0;  
  \
 }
 
 DEFINE_LUT2(8,   8,  8,  uint8_t,  uint8_t,  uint8_t, 1, 1, 1)
@@ -293,12 +304,17 @@ static int process_frame(FFFrameSync *fs)
 if (!out)
 return AVERROR(ENOMEM);
 } else {
+ThreadData td;
+
 out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
 if (!out)
 return AVERROR(ENOMEM)

[FFmpeg-cvslog] fate: add dst decoder test

2019-06-09 Thread Peter Ross
ffmpeg | branch: master | Peter Ross  | Mon Dec 24 20:09:46 
2018 +1100| [b12432721611ea7a0936645dcbd57b3b8f7d56e6] | committer: Peter Ross

fate: add dst decoder test

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

 tests/fate/audio.mak | 5 +
 1 file changed, 5 insertions(+)

diff --git a/tests/fate/audio.mak b/tests/fate/audio.mak
index 4fab472f90..c41958ea2d 100644
--- a/tests/fate/audio.mak
+++ b/tests/fate/audio.mak
@@ -28,6 +28,11 @@ FATE_SAMPLES_AUDIO-$(call DEMDEC, DSS, DSS_SP) += 
fate-dss-lp fate-dss-sp
 fate-dss-lp: CMD = framecrc -i $(TARGET_SAMPLES)/dss/lp.dss -frames 30
 fate-dss-sp: CMD = framecrc -i $(TARGET_SAMPLES)/dss/sp.dss -frames 30
 
+FATE_SAMPLES_AUDIO-$(call DEMDEC, DSF, DST) += fate-dsf-dst
+fate-dsf-dst: CMD = pcm -i $(TARGET_SAMPLES)/dst/dst-64fs44-2ch.dff
+fate-dsf-dst: CMP = oneoff
+fate-dsf-dst: REF = $(SAMPLES)/dst/dst-64fs44-2ch.pcm
+
 FATE_SAMPLES_AUDIO-$(call DEMDEC, AVI, IMC) += fate-imc
 fate-imc: CMD = pcm -i $(TARGET_SAMPLES)/imc/imc.avi
 fate-imc: CMP = oneoff

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".