On Fri, 12 Jul 2019, hwrenx wrote:

Can effectivly improved decoding speed when memcpy becomes a limitation
for proccessing high resolution source.
Tested under i7-8700k with `ffmpeg -i 7680x4320.avs2 -vsync 0 -f null -`
got performance 23fps => 42fps

Signed-off-by: hwrenx <hwr...@126.com>
---
libavcodec/libdavs2.c | 54 +++++++++++++++++++++++++++++----------------------
1 file changed, 31 insertions(+), 23 deletions(-)

diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
index 1b274a3..af0778f 100644
--- a/libavcodec/libdavs2.c
+++ b/libavcodec/libdavs2.c
@@ -60,13 +60,24 @@ static av_cold int davs2_init(AVCodecContext *avctx)
    return 0;
}

+static void davs2_frame_unref(void *opaque, uint8_t *data) {
+    DAVS2Context    *cad = (DAVS2Context *)opaque;
+    davs2_picture_t  pic;
+
+    pic.magic = (davs2_picture_t *)data;
+
+    if (cad->decoder) {
+        davs2_decoder_frame_unref(cad->decoder, &pic);
+    } else {
+        av_log(NULL, AV_LOG_WARNING, "Decoder not found, frame unreference 
failed.\n");

Whoa, this should not happen, and you have to be prepared that the user might close the decoder before freeing the last frame.

Maybe you should use some refcounting and create references to the decoder, others may have a better idea.

Regards,
Marton
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Reply via email to