[FFmpeg-cvslog] diracdec: decode HQ profile slices in rows
Rostislav Pehlivanov
git at videolan.org
Tue Jul 12 00:45:36 CEST 2016
ffmpeg | branch: master | Rostislav Pehlivanov <rpehlivanov at ob-encoder.com> | Thu Jun 23 18:06:58 2016 +0100| [b9c6c5f4539dfaf26e8484aece1b39f0a55f8fff] | committer: Rostislav Pehlivanov
diracdec: decode HQ profile slices in rows
Siginificantly improves the performance.
Signed-off-by: Rostislav Pehlivanov <rpehlivanov at obe.tv>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b9c6c5f4539dfaf26e8484aece1b39f0a55f8fff
---
libavcodec/diracdec.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 72947ec..c5d00b9 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -806,6 +806,16 @@ static int decode_hq_slice(AVCodecContext *avctx, void *arg)
return 0;
}
+static int decode_hq_slice_row(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
+{
+ int i;
+ DiracContext *s = avctx->priv_data;
+ DiracSlice *slices = ((DiracSlice *)arg) + s->num_x*jobnr;
+ for (i = 0; i < s->num_x; i++)
+ decode_hq_slice(avctx, &slices[i]);
+ return 0;
+}
+
/**
* Dirac Specification ->
* 13.5.1 low_delay_transform_data()
@@ -857,8 +867,7 @@ static int decode_lowdelay(DiracContext *s)
bufsize = 0;
}
}
- avctx->execute(avctx, decode_hq_slice, slices, NULL, slice_num,
- sizeof(DiracSlice));
+ avctx->execute2(avctx, decode_hq_slice_row, slices, NULL, s->num_y);
} else {
for (slice_y = 0; bufsize > 0 && slice_y < s->num_y; slice_y++) {
for (slice_x = 0; bufsize > 0 && slice_x < s->num_x; slice_x++) {
More information about the ffmpeg-cvslog
mailing list