[FFmpeg-devel] [PATCH v2] avcodec/jpeg2000: Add support for High-Throughput JPEG 2000 (HTJ2K) decoding.

Caleb Etemesi etemesicaleb at gmail.com
Thu Sep 22 07:07:30 EEST 2022


There is one with way better performance on its way, especially with images
with magnitude refinement passes.

here @https://github.com/etemesi254/FFmpeg/tree/my-profile

And the associated runtime profile from running

`perf record -g -F 999 ./ffmpeg_g  -i ~/jpeg2000/meridian.ht.j2c  -v 32
 -bench
mark -f null  -`

Online version  - https://share.firefox.dev/3C0rI9e

Image - https://etemesi254.github.io/assets/imgs/gsoc/meridian.ht.j2c [ 4K
image]

Ffmpeg results from the benchmark

`
bench: utime=0.371s stime=0.036s rtime=0.408s
bench: maxrss=165900kB
`
The machine is an AMD Ryzen 6000U with 6 cores 128kb L1.

Perf reports it takes 826 ms,  because the decoder does two decodes per
image,(I think one for the demuxer then the decoder, probably a bug).
anf most of the time is spent on idwt

OpenJPH decodes the same image in ~90ms.

So I do think there is room for improvement.

On Wed, 21 Sept 2022, 17:08 Tomas Härdin, <tjoppen at acc.umu.se> wrote:

> ons 2022-09-21 klockan 12:30 +0200 skrev Tomas Härdin:
> > Tested this locally on some 4k sample files and it achieved 19 fps
> > with
> > -lowres 2 on an Intel(R) Core(TM) i5-3317U CPU @ 1.70GHz (4 cores).
> > I'm
> > getting access to a better machine to test this on as well.
>
> Ran some tests on a c5n.4xlarge instance, Intel(R) Xeon(R) Platinum
> 8124M CPU @ 3.00GHz, 16 vCPUs. Test sequence is 273 4k htj2k frames
> from Disney encoded with OpenJPH version 0.7.3, 20-21 megs each. Tested
> like so:
>
> ./ffmpeg -i ~/samples/htj2k-unwrapped/000000%03d.j2c -f null -
>
> Achieved fps with a filled disk cache:
> -lowres  this patch  libopenjpegdec
> 0        9.1         7.0
> 1        40          27
> 2        105         92
> 3        128         157
> 4        129         164
>
> This is with the default frame-based threading. Not too bad. I suspect
> the slower performance compared to opj with -lowres >= 3 is due to the
> way parsing works. This is what's holding up my codeblock-threading
> patchset's performance as well.
>
> I have in mind to compare this with a regular j2k sample on the same
> machine, but it's taking its sweet time transferring..
>
> /Tomas
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-devel mailing list